All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.core.dist.index.d.ts Maven / Gradle / Ivy

There is a newer version: 2.2.5
Show newest version
import * as react from 'react';
import * as swr__internal from 'swr/_internal';
import { FullConfiguration, Key, SWRHook } from 'swr/_internal';
export { Arguments, BareFetcher, Cache, Fetcher, Key, KeyLoader, KeyedMutator, Middleware, MutatorCallback, MutatorOptions, Revalidator, RevalidatorOptions, SWRConfiguration, SWRHook, SWRResponse, State, mutate, preload, useSWRConfig } from 'swr/_internal';

declare const SWRConfig: react.FC>> & Partial & {
        provider?: ((cache: Readonly>) => swr__internal.Cache) | undefined;
    }) | ((parentConfig?: (Partial>> & Partial & {
        provider?: ((cache: Readonly>) => swr__internal.Cache) | undefined;
    }) | undefined) => Partial>> & Partial & {
        provider?: ((cache: Readonly>) => swr__internal.Cache) | undefined;
    }) | undefined;
}>> & {
    defaultValue: FullConfiguration;
};
declare const unstable_serialize: (key: Key) => string;
/**
 * A hook to fetch data.
 *
 * @link https://swr.vercel.app
 * @example
 * ```jsx
 * import useSWR from 'swr'
 * function Profile() {
 *   const { data, error } = useSWR('/api/user', fetcher)
 *   if (error) return 
failed to load
* if (!data) return
loading...
* return
hello {data.name}!
* } * ``` */ declare const _default: SWRHook; export { SWRConfig, _default as default, unstable_serialize };




© 2015 - 2024 Weber Informatics LLC | Privacy Policy