Updated typings (#819)

This commit is contained in:
Tomas Della Vedova
2019-04-17 11:23:15 +02:00
committed by delvedor
parent cfd4e70fb9
commit d4f4b47d7e
2 changed files with 20 additions and 7 deletions

7
lib/Transport.d.ts vendored
View File

@ -96,6 +96,10 @@ export interface TransportRequestOptions {
warnings?: [string];
}
export interface TransportRequestCallback {
abort: () => void;
}
export default class Transport {
static sniffReasons: {
SNIFF_ON_START: string;
@ -117,7 +121,8 @@ export default class Transport {
_nextSniff: number;
_isSniffing: boolean;
constructor(opts: TransportOptions);
request(params: TransportRequestParams, options: TransportRequestOptions, callback: (err: Error | null, result: ApiResponse) => void): any;
request(params: TransportRequestParams, options?: TransportRequestOptions): Promise<ApiResponse>;
request(params: TransportRequestParams, options?: TransportRequestOptions, callback?: (err: Error | null, result: ApiResponse) => void): TransportRequestCallback;
getConnection(): Connection | null;
sniff(callback?: (...args: any[]) => void): void;
}