import { Fetch } from "../common/Types.js";
import { APIMethods, APIResponse } from "./Client.js";
export interface APIProvider {
    /**
     * Call an API endpoint and return the response.
     * Provider is responsible for JSON encoding the params and decoding the response.
     * @argument path The endpoint path, e.g. `/v1/chain/get_info`
     * @argument params The request body if any.
     */
    call(args: {
        path: string;
        params?: unknown;
        method?: APIMethods;
    }): Promise<APIResponse>;
}
export interface FetchProviderOptions {
    /**
     * Fetch instance, must be provided in non-browser environments.
     * You can use the node-fetch package in Node.js.
     */
    fetch?: Fetch;
    /**
     * Headers that will be applied to every request
     * */
    headers?: Record<string, string>;
}
/** Default provider that uses the Fetch API to call a single node. */
export declare class FetchProvider implements APIProvider {
    readonly url: string;
    readonly fetch: Fetch;
    readonly headers: Record<string, string>;
    constructor(url: string, options?: FetchProviderOptions);
    call(args: {
        path: string;
        params?: Record<string, unknown>;
        method?: APIMethods;
        headers?: Record<string, string>;
    }): Promise<APIResponse>;
}
//# sourceMappingURL=Provider.d.ts.map