insomnia/flow-typed/insomnia-node-libcurl.js
Gregory Schier 158510d4d8
Fix/large response body handling (#614)
* Basic fix in place

* Use curlopt_writefunction

* Fix tests
2017-11-21 17:49:17 +00:00

90 lines
1.8 KiB
JavaScript

declare class Curl {
static getVersion: () => string;
static feature: {
NO_HEADER_PARSING: number,
NO_DATA_PARSING: number
};
static option: {
ACCEPT_ENCODING: number,
CAINFO: number,
COOKIE: number,
COOKIEFILE: number,
COOKIELIST: number,
CUSTOMREQUEST: number,
DEBUGFUNCTION: number,
FOLLOWLOCATION: number,
HTTPAUTH: number,
HTTPGET: number,
HTTPHEADER: number,
HTTPPOST: number,
INFILESIZE_LARGE: number,
KEYPASSWD: number,
MAXREDIRS: number,
NETRC: number,
NOBODY: number,
NOPROGRESS: number,
NOPROXY: number,
PASSWORD: number,
POST: number,
POSTFIELDS: number,
PROXY: number,
PROXYAUTH: number,
READDATA: number,
READFUNCTION: number,
SSLCERT: number,
SSLCERTTYPE: number,
SSLKEY: number,
SSL_VERIFYHOST: number,
SSL_VERIFYPEER: number,
TIMEOUT_MS: number,
UNIX_SOCKET_PATH: number,
UPLOAD: number,
URL: number,
USERAGENT: number,
USERNAME: number,
VERBOSE: number,
WRITEFUNCTION: number,
XFERINFOFUNCTION: number,
};
static auth: {
NTLM: string,
DIGEST: string,
BASIC: string,
ANY: string
};
static code: {
CURLE_ABORTED_BY_CALLBACK: string
};
static netrc: {
IGNORED: number,
OPTIONAL: number,
REQUIRED: number,
};
static info: {
EFFECTIVE_URL: string,
SIZE_DOWNLOAD: string,
TOTAL_TIME: string,
debug: {
SSL_DATA_IN: string,
SSL_DATA_OUT: string,
}
};
setOpt: (option: number, ...args: Array<any>) => void;
enable: (option: number, ...args: Array<any>) => void;
getInfo: (option: string, ...args: Array<any>) => any;
perform: () => void;
close: () => void;
on: (event: string, callback: Function) => void;
}
declare module 'insomnia-node-libcurl' {
declare module.exports: {
Curl: typeof Curl
}
}