import { MutationHooks, QueryHooks } from './buildHooks'; import { EndpointDefinitions, QueryDefinition, MutationDefinition, QueryArgFrom } from '../endpointDefinitions'; import { TS41Hooks } from '../ts41Types'; import { Module } from '../apiTypes'; import { BaseQueryFn } from '../baseQueryTypes'; import { QueryKeys } from '../core/apiState'; import { PrefetchOptions } from '../core/module'; export declare const reactHooksModuleName: unique symbol; export declare type ReactHooksModule = typeof reactHooksModuleName; declare module '../apiTypes' { interface ApiModules { [reactHooksModuleName]: { /** * Endpoints based on the input endpoints provided to `createApi`, containing `select`, `hooks` and `action matchers`. */ endpoints: { [K in keyof Definitions]: Definitions[K] extends QueryDefinition ? QueryHooks : Definitions[K] extends MutationDefinition ? MutationHooks : never; }; /** * A hook that accepts a string endpoint name, and provides a callback that when called, pre-fetches the data for that endpoint. */ usePrefetch>(endpointName: EndpointName, options?: PrefetchOptions): (arg: QueryArgFrom, options?: PrefetchOptions) => void; } & TS41Hooks; } } declare type RR = typeof import('react-redux'); export interface ReactHooksModuleOptions { /** * The version of the `batchedUpdates` function to be used */ batch?: RR['batch']; /** * The version of the `useDispatch` hook to be used */ useDispatch?: RR['useDispatch']; /** * The version of the `useSelector` hook to be used */ useSelector?: RR['useSelector']; /** * Currently unused - for potential future use */ useStore?: RR['useStore']; } /** * Creates a module that generates react hooks from endpoints, for use with `buildCreateApi`. * * @example * ```ts * const MyContext = React.createContext(null as any); * const customCreateApi = buildCreateApi( * coreModule(), * reactHooksModule({ useDispatch: createDispatchHook(MyContext) }) * ); * ``` * * @returns A module for use with `buildCreateApi` */ export declare const reactHooksModule: ({ batch, useDispatch, useSelector, useStore, }?: ReactHooksModuleOptions) => Module; export {}; //# sourceMappingURL=module.d.ts.map