WIP: initial prototype

- Added options parameter in API methods
- Updated typings
This commit is contained in:
delvedor
2018-12-12 16:47:29 +01:00
parent 7c1b58d703
commit b91b1ad1de
4 changed files with 413 additions and 391 deletions

9
lib/Transport.d.ts vendored
View File

@ -38,6 +38,13 @@ export interface SniffMeta {
reason: string;
}
export interface RequestOptions {
ignore?: number | number[];
requestTimeout?: number | string;
maxRetries?: number;
asStream?: boolean;
}
export default class Transport {
static sniffReasons: {
SNIFF_ON_START: string;
@ -58,7 +65,7 @@ export default class Transport {
_nextSniff: number;
_isSniffing: boolean;
constructor(opts: TransportOptions);
request(params: any, callback: (err: Error | null, result: ApiResponse) => void): any;
request(params: any, options: RequestOptions, callback: (err: Error | null, result: ApiResponse) => void): any;
getConnection(): Connection | null;
sniff(callback?: (...args: any[]) => void): void;
}