import { RequestInit } from 'node-fetch'; import { PromiseType } from 'utility-types'; export declare const CLOUD_FUNCTION_ROOT_ENDPOINT = "CLOUD_FUNCTION_ROOT_ENDPOINT"; export declare const defaultApiParams: () => { rootEndpoint: string; }; export interface IApiParams { rootEndpoint: string; } export declare const fetchFn: (functionName: string, init?: RequestInit | undefined, params?: IApiParams) => Promise; /** * Call function using Firebase HTTP call conventions * @param functionName Name of the function * @param authToken Authentication token * @param rootEndpoint Functions root endpoint */ export declare const callFn: (functionName: string, params?: IApiParams) => (data: P, opts?: ICallOpts) => Promise; interface ICallOpts { authToken?: string; } declare type ParametersIf = T extends (...args: unknown[]) => unknown ? Parameters : [never]; declare type ReturnTypeIf = T extends (...args: unknown[]) => unknown ? ReturnType : never; declare type PromiseTypeIf = T extends Promise ? PromiseType : never; export declare function apiOf(params?: IApiParams): { callFn: (name: K, param: ParametersIf[0], opts?: ICallOpts) => Promise>>; }; export {};