2019-05-14 18:48:48 -04:00
|
|
|
export declare type ConnectionInfo = {
|
|
|
|
url: string;
|
|
|
|
user?: string;
|
|
|
|
password?: string;
|
2019-06-12 01:01:04 -04:00
|
|
|
allowInsecureAuthentication?: boolean;
|
2019-11-23 21:38:13 +09:00
|
|
|
throttleLimit?: number;
|
2019-05-14 18:48:48 -04:00
|
|
|
timeout?: number;
|
|
|
|
headers?: {
|
|
|
|
[key: string]: string | number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export interface OnceBlockable {
|
|
|
|
once(eventName: "block", handler: () => void): void;
|
|
|
|
}
|
2020-05-04 23:01:04 -04:00
|
|
|
export interface OncePollable {
|
|
|
|
once(eventName: "poll", handler: () => void): void;
|
|
|
|
}
|
2019-05-14 18:48:48 -04:00
|
|
|
export declare type PollOptions = {
|
|
|
|
timeout?: number;
|
|
|
|
floor?: number;
|
|
|
|
ceiling?: number;
|
|
|
|
interval?: number;
|
|
|
|
retryLimit?: number;
|
|
|
|
onceBlock?: OnceBlockable;
|
2020-05-04 23:01:04 -04:00
|
|
|
oncePoll?: OncePollable;
|
2019-05-14 18:48:48 -04:00
|
|
|
};
|
2019-09-28 02:36:19 -04:00
|
|
|
export declare type FetchJsonResponse = {
|
|
|
|
statusCode: number;
|
|
|
|
headers: {
|
|
|
|
[header: string]: string;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export declare function fetchJson(connection: string | ConnectionInfo, json?: string, processFunc?: (value: any, response: FetchJsonResponse) => any): Promise<any>;
|
2020-05-21 00:07:41 -04:00
|
|
|
export declare function poll<T>(func: () => Promise<T>, options?: PollOptions): Promise<T>;
|