import type { EndpointDefinitions, EndpointBuilder, EndpointDefinition, ReplaceTagTypes } from './endpointDefinitions'; import type { UnionToIntersection, NoInfer } from './tsHelpers'; import type { CoreModule } from './core/module'; import type { CreateApiOptions } from './createApi'; import type { BaseQueryFn } from './baseQueryTypes'; export interface ApiModules { } export declare type ModuleName = keyof ApiModules; export declare type Module = { name: Name; init(api: Api, options: Required>, context: ApiContext): { injectEndpoint(endpointName: string, definition: EndpointDefinition): void; }; }; export interface ApiContext { apiUid: string; endpointDefinitions: Definitions; batch(cb: () => void): void; } export declare type Api = UnionToIntersection[Enhancers]> & { /** * A function to inject the endpoints into the original API, but also give you that same API with correct types for these endpoints back. Useful with code-splitting. */ injectEndpoints(_: { endpoints: (build: EndpointBuilder) => NewDefinitions; overrideExisting?: boolean; }): Api; /** *A function to enhance a generated API with additional information. Useful with code-generation. */ enhanceEndpoints(_: { addTagTypes?: readonly NewTagTypes[]; endpoints?: ReplaceTagTypes> extends infer NewDefinitions ? { [K in keyof NewDefinitions]?: Partial | ((definition: NewDefinitions[K]) => void); } : never; }): Api, ReducerPath, TagTypes | NewTagTypes, Enhancers>; };