use-swr.d.ts 1.4 KB

1234567891011121314
  1. /// <reference types="react" />
  2. import { defaultConfig } from './utils/config';
  3. import { Fetcher, Key, SWRResponse, FullConfiguration, SWRConfiguration, SWRHook } from './types';
  4. export declare const useSWRHandler: <Data = any, Error_1 = any>(_key: Key, fetcher: ((args_0: string) => import("./types").FetcherResponse<Data>) | ((args_0: any, ...args_1: unknown[]) => import("./types").FetcherResponse<Data>) | ((args_0: Record<any, any>) => import("./types").FetcherResponse<Data>) | ((args_0: string | [any, ...unknown[]] | readonly [any, ...unknown[]] | Record<any, any>) => import("./types").FetcherResponse<Data>) | null, config: import("./types").InternalConfiguration & import("./types").PublicConfiguration<any, any, import("./types").BareFetcher<unknown>> & Partial<import("./types").PublicConfiguration<Data, Error_1, import("./types").BareFetcher<any>>>) => SWRResponse<Data, Error_1>;
  5. export declare const SWRConfig: import("react").FC<{
  6. value?: (Partial<import("./types").PublicConfiguration<any, any, import("./types").BareFetcher<any>>> & Partial<import("./types").ProviderConfiguration> & {
  7. provider?: ((cache: Readonly<import("./types").Cache<any>>) => import("./types").Cache<any>) | undefined;
  8. }) | undefined;
  9. }> & {
  10. default: FullConfiguration;
  11. };
  12. export declare const unstable_serialize: (key: Key) => string;
  13. declare const _default: SWRHook;
  14. export default _default;