ethers.js/packages/web/lib/fetch-data.d.ts

25 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2022-04-11 17:14:19 -04:00
import { FetchRequest } from "./request.js";
import { FetchResponse } from "./response.js";
import type { Frozen } from "@ethersproject/properties";
export declare type PreflightRequestFunc = (request: Frozen<FetchRequest>) => Promise<FetchRequest>;
export declare type ProcessResponseFunc = (request: Frozen<FetchRequest>, response: FetchResponse) => Promise<FetchResponse>;
export declare type ThrottleRetryFunc = (request: Frozen<FetchRequest>, response: FetchResponse, attempt: number) => Promise<boolean>;
export declare type FrozenFetchRequest = Frozen<FetchRequest>;
export declare type FrozenFetchResponse = Frozen<FetchResponse>;
export declare type ConnectionInfo = {
request: FetchRequest;
preflightRequest?: PreflightRequestFunc;
processResponse?: ProcessResponseFunc;
throttleLimit?: number;
throttleSlotInterval?: number;
throttleRetry?: ThrottleRetryFunc;
};
export declare type GatewayFunc = (url: string) => Promise<FetchRequest | FetchResponse>;
export declare function fetchData(connection: string | FetchRequest | ConnectionInfo): Promise<Frozen<FetchResponse>>;
export declare namespace fetchData {
var lock: () => void;
var setGateway: (gateway: GatewayFunc | null) => void;
var setIpfsGateway: (gateway: string | GatewayFunc | null) => void;
var setArGateway: (gateway: string | GatewayFunc | null) => void;
}
//# sourceMappingURL=fetch-data.d.ts.map