import { useEffect } from "react"; import { CacheStoreType, FetchContextType, ImperativeFetch, FetchInit, TimeSpan, FetchConfigType, StaticFetchConfig, StaticFetchConfigNoUrl } from "../types"; import { gql } from "./shared"; export declare function getMiliseconds(v: TimeSpan): number; export declare function getTimePassed(key: any): number; export declare const createImperativeFetch: (ctx: FetchContextType) => ImperativeFetch; export declare const useIsomorphicLayoutEffect: typeof useEffect; /** * Revalidate requests that match an id or ids */ export declare function revalidate(id: any | any[], __reval__?: boolean): void; export declare function revalidateKey(key: any): void; export declare function cancelRequest(id: any | any[]): void; /** * * @param queries * @returns A hook that has full TypeScript support and offers autocomplete for every query passed */ export declare function queryProvider(queries: { [e in keyof R]: R[e]; }, providerConfig?: { defaults?: { [key in keyof R]?: Partial>["value"]>; }; config?: { /** * The base url */ baseUrl?: string; /** * Any aditional headers */ headers?: { [key: string]: any; }; /** * The caching mechanism */ cacheProvider?: CacheStoreType; }; }):

(queryName: P, otherConfig?: Omit ? { [e in keyof R]: R[e]; }[P]["value"] : any>, "url"> & { default?: { [e in keyof R]: R[e]; }[P] extends ReturnType ? { [e in keyof R]: R[e]; }[P]["value"] : any; variables?: { [e in keyof R]: R[e]; }[P] extends ReturnType ? { [e in keyof R]: R[e]; }[P]["variables"] : any; graphqlPath?: string; }) => Omit Promise; ref: import("react").RefObject; }; formRef: import("react").RefObject; hasData: boolean; revalidating: boolean; success: boolean; loadingFirst: boolean; isLoadingFirst: boolean; expiration: Date; data: any; isPending?: boolean; loading: boolean; isLoading: boolean; isRevalidating: boolean; error: any; online: boolean; code: number; reFetch: () => Promise; submit: (submitData: any) => Promise; mutate: (update: any, callback?: ((data: any, fetcher: ImperativeFetch) => void) | undefined) => any; fetcher: ImperativeFetch; abort: () => void; config: Required> & { baseUrl: string; url: string; rawUrl: string; }; response: import("../types").CustomResponse; id: any; key: string; responseTime: number; requestStart: Date; requestEnd: Date; }, "data"> & { data: { data: any; errors: any[]; variables: { [k: string]: any; }; }; }, "data"> & { data: { data: { [e in keyof R]: R[e]; }[P] extends ReturnType ? { [e in keyof R]: R[e]; }[P]["value"] : any; errors?: any[]; variables: { [e in keyof R]: R[e]; }[P] extends ReturnType ? { [e in keyof R]: R[e]; }[P]["variables"] : any; }; }; /** * Force mutation in requests from anywhere. This doesn't revalidate requests */ export declare function mutateData(...pairs: [any, any | ((cache: any) => any), boolean?][]): void; export declare function fetchOptions(init: UrlType | StaticFetchConfig, options?: Partial>): StaticFetchConfig;