2019-05-14 18:48:48 -04:00
|
|
|
export declare type ConnectionInfo = {
|
|
|
|
url: string;
|
2020-07-14 02:33:30 -04:00
|
|
|
headers?: {
|
|
|
|
[key: string]: string | number;
|
|
|
|
};
|
2019-05-14 18:48:48 -04:00
|
|
|
user?: string;
|
|
|
|
password?: string;
|
2019-06-12 01:01:04 -04:00
|
|
|
allowInsecureAuthentication?: boolean;
|
2020-10-07 20:10:50 -04:00
|
|
|
allowGzip?: boolean;
|
2019-11-23 21:38:13 +09:00
|
|
|
throttleLimit?: number;
|
2020-07-15 14:00:36 -04:00
|
|
|
throttleSlotInterval?: number;
|
2020-07-14 02:33:30 -04:00
|
|
|
throttleCallback?: (attempt: number, url: string) => Promise<boolean>;
|
2022-03-09 02:56:08 -05:00
|
|
|
skipFetchSetup?: boolean;
|
|
|
|
errorPassThrough?: boolean;
|
2019-05-14 18:48:48 -04:00
|
|
|
timeout?: 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;
|
|
|
|
};
|
|
|
|
};
|
2020-07-31 01:32:26 -04:00
|
|
|
export declare function _fetchData<T = Uint8Array>(connection: string | ConnectionInfo, body?: Uint8Array, processFunc?: (value: Uint8Array, response: FetchJsonResponse) => T): Promise<T>;
|
2019-09-28 02:36:19 -04:00
|
|
|
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>;
|
2021-01-19 05:22:54 -05:00
|
|
|
//# sourceMappingURL=index.d.ts.map
|