2018-07-30 18:59:52 -04:00
|
|
|
export declare type ConnectionInfo = {
|
|
|
|
url: string;
|
|
|
|
user?: string;
|
|
|
|
password?: string;
|
|
|
|
allowInsecure?: boolean;
|
2018-09-06 16:41:02 -04:00
|
|
|
timeout?: number;
|
|
|
|
headers?: {
|
|
|
|
[key: string]: string | number;
|
|
|
|
};
|
2018-07-30 18:59:52 -04:00
|
|
|
};
|
|
|
|
export interface OnceBlockable {
|
|
|
|
once(eventName: "block", handler: () => void): void;
|
|
|
|
}
|
|
|
|
export declare type PollOptions = {
|
|
|
|
timeout?: number;
|
|
|
|
floor?: number;
|
|
|
|
ceiling?: number;
|
|
|
|
interval?: number;
|
|
|
|
onceBlock?: OnceBlockable;
|
|
|
|
};
|
|
|
|
export declare function fetchJson(connection: string | ConnectionInfo, json: string, processFunc: (value: any) => any): Promise<any>;
|
|
|
|
export declare function poll(func: () => Promise<any>, options?: PollOptions): Promise<any>;
|