UNPKG

26.3 kBTypeScriptView Raw
1import type { AnyAction, ThunkDispatch } from '@reduxjs/toolkit';
2import type { SerializeQueryArgs } from './defaultSerializeQueryArgs';
3import type { QuerySubState, RootState } from './core/apiState';
4import type { BaseQueryExtraOptions, BaseQueryFn, BaseQueryResult, BaseQueryArg, BaseQueryApi, QueryReturnValue, BaseQueryError, BaseQueryMeta } from './baseQueryTypes';
5import type { HasRequiredProps, MaybePromise, OmitFromUnion, CastAny } from './tsHelpers';
6import type { NEVER } from './fakeBaseQuery';
7declare const resultType: unique symbol;
8declare const baseQuery: unique symbol;
9interface EndpointDefinitionWithQuery<QueryArg, BaseQuery extends BaseQueryFn, ResultType> {
10 /**
11 * `query` can be a function that returns either a `string` or an `object` which is passed to your `baseQuery`. If you are using [fetchBaseQuery](./fetchBaseQuery), this can return either a `string` or an `object` of properties in `FetchArgs`. If you use your own custom [`baseQuery`](../../rtk-query/usage/customizing-queries), you can customize this behavior to your liking.
12 *
13 * @example
14 *
15 * ```ts
16 * // codeblock-meta title="query example"
17 *
18 * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
19 * interface Post {
20 * id: number
21 * name: string
22 * }
23 * type PostsResponse = Post[]
24 *
25 * const api = createApi({
26 * baseQuery: fetchBaseQuery({ baseUrl: '/' }),
27 * tagTypes: ['Post'],
28 * endpoints: (build) => ({
29 * getPosts: build.query<PostsResponse, void>({
30 * // highlight-start
31 * query: () => 'posts',
32 * // highlight-end
33 * }),
34 * addPost: build.mutation<Post, Partial<Post>>({
35 * // highlight-start
36 * query: (body) => ({
37 * url: `posts`,
38 * method: 'POST',
39 * body,
40 * }),
41 * // highlight-end
42 * invalidatesTags: [{ type: 'Post', id: 'LIST' }],
43 * }),
44 * })
45 * })
46 * ```
47 */
48 query(arg: QueryArg): BaseQueryArg<BaseQuery>;
49 queryFn?: never;
50 /**
51 * A function to manipulate the data returned by a query or mutation.
52 */
53 transformResponse?(baseQueryReturnValue: BaseQueryResult<BaseQuery>, meta: BaseQueryMeta<BaseQuery>, arg: QueryArg): ResultType | Promise<ResultType>;
54 /**
55 * A function to manipulate the data returned by a failed query or mutation.
56 */
57 transformErrorResponse?(baseQueryReturnValue: BaseQueryError<BaseQuery>, meta: BaseQueryMeta<BaseQuery>, arg: QueryArg): unknown;
58 /**
59 * Defaults to `true`.
60 *
61 * Most apps should leave this setting on. The only time it can be a performance issue
62 * is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and
63 * you're unable to paginate it.
64 *
65 * For details of how this works, please see the below. When it is set to `false`,
66 * every request will cause subscribed components to rerender, even when the data has not changed.
67 *
68 * @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing
69 */
70 structuralSharing?: boolean;
71}
72interface EndpointDefinitionWithQueryFn<QueryArg, BaseQuery extends BaseQueryFn, ResultType> {
73 /**
74 * Can be used in place of `query` as an inline function that bypasses `baseQuery` completely for the endpoint.
75 *
76 * @example
77 * ```ts
78 * // codeblock-meta title="Basic queryFn example"
79 *
80 * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
81 * interface Post {
82 * id: number
83 * name: string
84 * }
85 * type PostsResponse = Post[]
86 *
87 * const api = createApi({
88 * baseQuery: fetchBaseQuery({ baseUrl: '/' }),
89 * endpoints: (build) => ({
90 * getPosts: build.query<PostsResponse, void>({
91 * query: () => 'posts',
92 * }),
93 * flipCoin: build.query<'heads' | 'tails', void>({
94 * // highlight-start
95 * queryFn(arg, queryApi, extraOptions, baseQuery) {
96 * const randomVal = Math.random()
97 * if (randomVal < 0.45) {
98 * return { data: 'heads' }
99 * }
100 * if (randomVal < 0.9) {
101 * return { data: 'tails' }
102 * }
103 * return { error: { status: 500, statusText: 'Internal Server Error', data: "Coin landed on it's edge!" } }
104 * }
105 * // highlight-end
106 * })
107 * })
108 * })
109 * ```
110 */
111 queryFn(arg: QueryArg, api: BaseQueryApi, extraOptions: BaseQueryExtraOptions<BaseQuery>, baseQuery: (arg: Parameters<BaseQuery>[0]) => ReturnType<BaseQuery>): MaybePromise<QueryReturnValue<ResultType, BaseQueryError<BaseQuery>>>;
112 query?: never;
113 transformResponse?: never;
114 transformErrorResponse?: never;
115 /**
116 * Defaults to `true`.
117 *
118 * Most apps should leave this setting on. The only time it can be a performance issue
119 * is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and
120 * you're unable to paginate it.
121 *
122 * For details of how this works, please see the below. When it is set to `false`,
123 * every request will cause subscribed components to rerender, even when the data has not changed.
124 *
125 * @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing
126 */
127 structuralSharing?: boolean;
128}
129export interface BaseEndpointTypes<QueryArg, BaseQuery extends BaseQueryFn, ResultType> {
130 QueryArg: QueryArg;
131 BaseQuery: BaseQuery;
132 ResultType: ResultType;
133}
134export declare type BaseEndpointDefinition<QueryArg, BaseQuery extends BaseQueryFn, ResultType> = (([CastAny<BaseQueryResult<BaseQuery>, {}>] extends [NEVER] ? never : EndpointDefinitionWithQuery<QueryArg, BaseQuery, ResultType>) | EndpointDefinitionWithQueryFn<QueryArg, BaseQuery, ResultType>) & {
135 [resultType]?: ResultType;
136 [baseQuery]?: BaseQuery;
137} & HasRequiredProps<BaseQueryExtraOptions<BaseQuery>, {
138 extraOptions: BaseQueryExtraOptions<BaseQuery>;
139}, {
140 extraOptions?: BaseQueryExtraOptions<BaseQuery>;
141}>;
142export declare enum DefinitionType {
143 query = "query",
144 mutation = "mutation"
145}
146export declare type GetResultDescriptionFn<TagTypes extends string, ResultType, QueryArg, ErrorType, MetaType> = (result: ResultType | undefined, error: ErrorType | undefined, arg: QueryArg, meta: MetaType) => ReadonlyArray<TagDescription<TagTypes>>;
147export declare type FullTagDescription<TagType> = {
148 type: TagType;
149 id?: number | string;
150};
151export declare type TagDescription<TagType> = TagType | FullTagDescription<TagType>;
152export declare type ResultDescription<TagTypes extends string, ResultType, QueryArg, ErrorType, MetaType> = ReadonlyArray<TagDescription<TagTypes>> | GetResultDescriptionFn<TagTypes, ResultType, QueryArg, ErrorType, MetaType>;
153/** @deprecated please use `onQueryStarted` instead */
154export interface QueryApi<ReducerPath extends string, Context extends {}> {
155 /** @deprecated please use `onQueryStarted` instead */
156 dispatch: ThunkDispatch<any, any, AnyAction>;
157 /** @deprecated please use `onQueryStarted` instead */
158 getState(): RootState<any, any, ReducerPath>;
159 /** @deprecated please use `onQueryStarted` instead */
160 extra: unknown;
161 /** @deprecated please use `onQueryStarted` instead */
162 requestId: string;
163 /** @deprecated please use `onQueryStarted` instead */
164 context: Context;
165}
166export interface QueryTypes<QueryArg, BaseQuery extends BaseQueryFn, TagTypes extends string, ResultType, ReducerPath extends string = string> extends BaseEndpointTypes<QueryArg, BaseQuery, ResultType> {
167 /**
168 * The endpoint definition type. To be used with some internal generic types.
169 * @example
170 * ```ts
171 * const useMyWrappedHook: UseQuery<typeof api.endpoints.query.Types.QueryDefinition> = ...
172 * ```
173 */
174 QueryDefinition: QueryDefinition<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>;
175 TagTypes: TagTypes;
176 ReducerPath: ReducerPath;
177}
178export interface QueryExtraOptions<TagTypes extends string, ResultType, QueryArg, BaseQuery extends BaseQueryFn, ReducerPath extends string = string> {
179 type: DefinitionType.query;
180 /**
181 * Used by `query` endpoints. Determines which 'tag' is attached to the cached data returned by the query.
182 * Expects an array of tag type strings, an array of objects of tag types with ids, or a function that returns such an array.
183 * 1. `['Post']` - equivalent to `2`
184 * 2. `[{ type: 'Post' }]` - equivalent to `1`
185 * 3. `[{ type: 'Post', id: 1 }]`
186 * 4. `(result, error, arg) => ['Post']` - equivalent to `5`
187 * 5. `(result, error, arg) => [{ type: 'Post' }]` - equivalent to `4`
188 * 6. `(result, error, arg) => [{ type: 'Post', id: 1 }]`
189 *
190 * @example
191 *
192 * ```ts
193 * // codeblock-meta title="providesTags example"
194 *
195 * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
196 * interface Post {
197 * id: number
198 * name: string
199 * }
200 * type PostsResponse = Post[]
201 *
202 * const api = createApi({
203 * baseQuery: fetchBaseQuery({ baseUrl: '/' }),
204 * tagTypes: ['Posts'],
205 * endpoints: (build) => ({
206 * getPosts: build.query<PostsResponse, void>({
207 * query: () => 'posts',
208 * // highlight-start
209 * providesTags: (result) =>
210 * result
211 * ? [
212 * ...result.map(({ id }) => ({ type: 'Posts' as const, id })),
213 * { type: 'Posts', id: 'LIST' },
214 * ]
215 * : [{ type: 'Posts', id: 'LIST' }],
216 * // highlight-end
217 * })
218 * })
219 * })
220 * ```
221 */
222 providesTags?: ResultDescription<TagTypes, ResultType, QueryArg, BaseQueryError<BaseQuery>, BaseQueryMeta<BaseQuery>>;
223 /**
224 * Not to be used. A query should not invalidate tags in the cache.
225 */
226 invalidatesTags?: never;
227 /**
228 * Can be provided to return a custom cache key value based on the query arguments.
229 *
230 * This is primarily intended for cases where a non-serializable value is passed as part of the query arg object and should be excluded from the cache key. It may also be used for cases where an endpoint should only have a single cache entry, such as an infinite loading / pagination implementation.
231 *
232 * Unlike the `createApi` version which can _only_ return a string, this per-endpoint option can also return an an object, number, or boolean. If it returns a string, that value will be used as the cache key directly. If it returns an object / number / boolean, that value will be passed to the built-in `defaultSerializeQueryArgs`. This simplifies the use case of stripping out args you don't want included in the cache key.
233 *
234 *
235 * @example
236 *
237 * ```ts
238 * // codeblock-meta title="serializeQueryArgs : exclude value"
239 *
240 * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'
241 * interface Post {
242 * id: number
243 * name: string
244 * }
245 *
246 * interface MyApiClient {
247 * fetchPost: (id: string) => Promise<Post>
248 * }
249 *
250 * createApi({
251 * baseQuery: fetchBaseQuery({ baseUrl: '/' }),
252 * endpoints: (build) => ({
253 * // Example: an endpoint with an API client passed in as an argument,
254 * // but only the item ID should be used as the cache key
255 * getPost: build.query<Post, { id: string; client: MyApiClient }>({
256 * queryFn: async ({ id, client }) => {
257 * const post = await client.fetchPost(id)
258 * return { data: post }
259 * },
260 * // highlight-start
261 * serializeQueryArgs: ({ queryArgs, endpointDefinition, endpointName }) => {
262 * const { id } = queryArgs
263 * // This can return a string, an object, a number, or a boolean.
264 * // If it returns an object, number or boolean, that value
265 * // will be serialized automatically via `defaultSerializeQueryArgs`
266 * return { id } // omit `client` from the cache key
267 *
268 * // Alternately, you can use `defaultSerializeQueryArgs` yourself:
269 * // return defaultSerializeQueryArgs({
270 * // endpointName,
271 * // queryArgs: { id },
272 * // endpointDefinition
273 * // })
274 * // Or create and return a string yourself:
275 * // return `getPost(${id})`
276 * },
277 * // highlight-end
278 * }),
279 * }),
280 *})
281 * ```
282 */
283 serializeQueryArgs?: SerializeQueryArgs<QueryArg, string | number | boolean | Record<any, any>>;
284 /**
285 * Can be provided to merge an incoming response value into the current cache data.
286 * If supplied, no automatic structural sharing will be applied - it's up to
287 * you to update the cache appropriately.
288 *
289 * Since RTKQ normally replaces cache entries with the new response, you will usually
290 * need to use this with the `serializeQueryArgs` or `forceRefetch` options to keep
291 * an existing cache entry so that it can be updated.
292 *
293 * Since this is wrapped with Immer, you , you may either mutate the `currentCacheValue` directly,
294 * or return a new value, but _not_ both at once.
295 *
296 * Will only be called if the existing `currentCacheData` is _not_ `undefined` - on first response,
297 * the cache entry will just save the response data directly.
298 *
299 * Useful if you don't want a new request to completely override the current cache value,
300 * maybe because you have manually updated it from another source and don't want those
301 * updates to get lost.
302 *
303 *
304 * @example
305 *
306 * ```ts
307 * // codeblock-meta title="merge: pagination"
308 *
309 * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'
310 * interface Post {
311 * id: number
312 * name: string
313 * }
314 *
315 * createApi({
316 * baseQuery: fetchBaseQuery({ baseUrl: '/' }),
317 * endpoints: (build) => ({
318 * listItems: build.query<string[], number>({
319 * query: (pageNumber) => `/listItems?page=${pageNumber}`,
320 * // Only have one cache entry because the arg always maps to one string
321 * serializeQueryArgs: ({ endpointName }) => {
322 * return endpointName
323 * },
324 * // Always merge incoming data to the cache entry
325 * merge: (currentCache, newItems) => {
326 * currentCache.push(...newItems)
327 * },
328 * // Refetch when the page arg changes
329 * forceRefetch({ currentArg, previousArg }) {
330 * return currentArg !== previousArg
331 * },
332 * }),
333 * }),
334 *})
335 * ```
336 */
337 merge?(currentCacheData: ResultType, responseData: ResultType, otherArgs: {
338 arg: QueryArg;
339 baseQueryMeta: BaseQueryMeta<BaseQuery>;
340 requestId: string;
341 fulfilledTimeStamp: number;
342 }): ResultType | void;
343 /**
344 * Check to see if the endpoint should force a refetch in cases where it normally wouldn't.
345 * This is primarily useful for "infinite scroll" / pagination use cases where
346 * RTKQ is keeping a single cache entry that is added to over time, in combination
347 * with `serializeQueryArgs` returning a fixed cache key and a `merge` callback
348 * set to add incoming data to the cache entry each time.
349 *
350 * @example
351 *
352 * ```ts
353 * // codeblock-meta title="forceRefresh: pagination"
354 *
355 * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'
356 * interface Post {
357 * id: number
358 * name: string
359 * }
360 *
361 * createApi({
362 * baseQuery: fetchBaseQuery({ baseUrl: '/' }),
363 * endpoints: (build) => ({
364 * listItems: build.query<string[], number>({
365 * query: (pageNumber) => `/listItems?page=${pageNumber}`,
366 * // Only have one cache entry because the arg always maps to one string
367 * serializeQueryArgs: ({ endpointName }) => {
368 * return endpointName
369 * },
370 * // Always merge incoming data to the cache entry
371 * merge: (currentCache, newItems) => {
372 * currentCache.push(...newItems)
373 * },
374 * // Refetch when the page arg changes
375 * forceRefetch({ currentArg, previousArg }) {
376 * return currentArg !== previousArg
377 * },
378 * }),
379 * }),
380 *})
381 * ```
382 */
383 forceRefetch?(params: {
384 currentArg: QueryArg | undefined;
385 previousArg: QueryArg | undefined;
386 state: RootState<any, any, string>;
387 endpointState?: QuerySubState<any>;
388 }): boolean;
389 /**
390 * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!
391 */
392 Types?: QueryTypes<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>;
393}
394export declare type QueryDefinition<QueryArg, BaseQuery extends BaseQueryFn, TagTypes extends string, ResultType, ReducerPath extends string = string> = BaseEndpointDefinition<QueryArg, BaseQuery, ResultType> & QueryExtraOptions<TagTypes, ResultType, QueryArg, BaseQuery, ReducerPath>;
395export interface MutationTypes<QueryArg, BaseQuery extends BaseQueryFn, TagTypes extends string, ResultType, ReducerPath extends string = string> extends BaseEndpointTypes<QueryArg, BaseQuery, ResultType> {
396 /**
397 * The endpoint definition type. To be used with some internal generic types.
398 * @example
399 * ```ts
400 * const useMyWrappedHook: UseMutation<typeof api.endpoints.query.Types.MutationDefinition> = ...
401 * ```
402 */
403 MutationDefinition: MutationDefinition<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>;
404 TagTypes: TagTypes;
405 ReducerPath: ReducerPath;
406}
407export interface MutationExtraOptions<TagTypes extends string, ResultType, QueryArg, BaseQuery extends BaseQueryFn, ReducerPath extends string = string> {
408 type: DefinitionType.mutation;
409 /**
410 * Used by `mutation` endpoints. Determines which cached data should be either re-fetched or removed from the cache.
411 * Expects the same shapes as `providesTags`.
412 *
413 * @example
414 *
415 * ```ts
416 * // codeblock-meta title="invalidatesTags example"
417 * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
418 * interface Post {
419 * id: number
420 * name: string
421 * }
422 * type PostsResponse = Post[]
423 *
424 * const api = createApi({
425 * baseQuery: fetchBaseQuery({ baseUrl: '/' }),
426 * tagTypes: ['Posts'],
427 * endpoints: (build) => ({
428 * getPosts: build.query<PostsResponse, void>({
429 * query: () => 'posts',
430 * providesTags: (result) =>
431 * result
432 * ? [
433 * ...result.map(({ id }) => ({ type: 'Posts' as const, id })),
434 * { type: 'Posts', id: 'LIST' },
435 * ]
436 * : [{ type: 'Posts', id: 'LIST' }],
437 * }),
438 * addPost: build.mutation<Post, Partial<Post>>({
439 * query(body) {
440 * return {
441 * url: `posts`,
442 * method: 'POST',
443 * body,
444 * }
445 * },
446 * // highlight-start
447 * invalidatesTags: [{ type: 'Posts', id: 'LIST' }],
448 * // highlight-end
449 * }),
450 * })
451 * })
452 * ```
453 */
454 invalidatesTags?: ResultDescription<TagTypes, ResultType, QueryArg, BaseQueryError<BaseQuery>, BaseQueryMeta<BaseQuery>>;
455 /**
456 * Not to be used. A mutation should not provide tags to the cache.
457 */
458 providesTags?: never;
459 /**
460 * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!
461 */
462 Types?: MutationTypes<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>;
463}
464export declare type MutationDefinition<QueryArg, BaseQuery extends BaseQueryFn, TagTypes extends string, ResultType, ReducerPath extends string = string> = BaseEndpointDefinition<QueryArg, BaseQuery, ResultType> & MutationExtraOptions<TagTypes, ResultType, QueryArg, BaseQuery, ReducerPath>;
465export declare type EndpointDefinition<QueryArg, BaseQuery extends BaseQueryFn, TagTypes extends string, ResultType, ReducerPath extends string = string> = QueryDefinition<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath> | MutationDefinition<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>;
466export declare type EndpointDefinitions = Record<string, EndpointDefinition<any, any, any, any>>;
467export declare function isQueryDefinition(e: EndpointDefinition<any, any, any, any>): e is QueryDefinition<any, any, any, any>;
468export declare function isMutationDefinition(e: EndpointDefinition<any, any, any, any>): e is MutationDefinition<any, any, any, any>;
469export declare type EndpointBuilder<BaseQuery extends BaseQueryFn, TagTypes extends string, ReducerPath extends string> = {
470 /**
471 * An endpoint definition that retrieves data, and may provide tags to the cache.
472 *
473 * @example
474 * ```js
475 * // codeblock-meta title="Example of all query endpoint options"
476 * const api = createApi({
477 * baseQuery,
478 * endpoints: (build) => ({
479 * getPost: build.query({
480 * query: (id) => ({ url: `post/${id}` }),
481 * // Pick out data and prevent nested properties in a hook or selector
482 * transformResponse: (response) => response.data,
483 * // Pick out error and prevent nested properties in a hook or selector
484 * transformErrorResponse: (response) => response.error,
485 * // `result` is the server response
486 * providesTags: (result, error, id) => [{ type: 'Post', id }],
487 * // trigger side effects or optimistic updates
488 * onQueryStarted(id, { dispatch, getState, extra, requestId, queryFulfilled, getCacheEntry, updateCachedData }) {},
489 * // handle subscriptions etc
490 * onCacheEntryAdded(id, { dispatch, getState, extra, requestId, cacheEntryRemoved, cacheDataLoaded, getCacheEntry, updateCachedData }) {},
491 * }),
492 * }),
493 *});
494 *```
495 */
496 query<ResultType, QueryArg>(definition: OmitFromUnion<QueryDefinition<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>, 'type'>): QueryDefinition<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>;
497 /**
498 * An endpoint definition that alters data on the server or will possibly invalidate the cache.
499 *
500 * @example
501 * ```js
502 * // codeblock-meta title="Example of all mutation endpoint options"
503 * const api = createApi({
504 * baseQuery,
505 * endpoints: (build) => ({
506 * updatePost: build.mutation({
507 * query: ({ id, ...patch }) => ({ url: `post/${id}`, method: 'PATCH', body: patch }),
508 * // Pick out data and prevent nested properties in a hook or selector
509 * transformResponse: (response) => response.data,
510 * // Pick out error and prevent nested properties in a hook or selector
511 * transformErrorResponse: (response) => response.error,
512 * // `result` is the server response
513 * invalidatesTags: (result, error, id) => [{ type: 'Post', id }],
514 * // trigger side effects or optimistic updates
515 * onQueryStarted(id, { dispatch, getState, extra, requestId, queryFulfilled, getCacheEntry }) {},
516 * // handle subscriptions etc
517 * onCacheEntryAdded(id, { dispatch, getState, extra, requestId, cacheEntryRemoved, cacheDataLoaded, getCacheEntry }) {},
518 * }),
519 * }),
520 * });
521 * ```
522 */
523 mutation<ResultType, QueryArg>(definition: OmitFromUnion<MutationDefinition<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>, 'type'>): MutationDefinition<QueryArg, BaseQuery, TagTypes, ResultType, ReducerPath>;
524};
525export declare type AssertTagTypes = <T extends FullTagDescription<string>>(t: T) => T;
526export declare function calculateProvidedBy<ResultType, QueryArg, ErrorType, MetaType>(description: ResultDescription<string, ResultType, QueryArg, ErrorType, MetaType> | undefined, result: ResultType | undefined, error: ErrorType | undefined, queryArg: QueryArg, meta: MetaType | undefined, assertTagTypes: AssertTagTypes): readonly FullTagDescription<string>[];
527export declare function expandTagDescription(description: TagDescription<string>): FullTagDescription<string>;
528export declare type QueryArgFrom<D extends BaseEndpointDefinition<any, any, any>> = D extends BaseEndpointDefinition<infer QA, any, any> ? QA : unknown;
529export declare type ResultTypeFrom<D extends BaseEndpointDefinition<any, any, any>> = D extends BaseEndpointDefinition<any, any, infer RT> ? RT : unknown;
530export declare type ReducerPathFrom<D extends EndpointDefinition<any, any, any, any, any>> = D extends EndpointDefinition<any, any, any, any, infer RP> ? RP : unknown;
531export declare type TagTypesFrom<D extends EndpointDefinition<any, any, any, any>> = D extends EndpointDefinition<any, any, infer RP, any> ? RP : unknown;
532export declare type ReplaceTagTypes<Definitions extends EndpointDefinitions, NewTagTypes extends string> = {
533 [K in keyof Definitions]: Definitions[K] extends QueryDefinition<infer QueryArg, infer BaseQuery, any, infer ResultType, infer ReducerPath> ? QueryDefinition<QueryArg, BaseQuery, NewTagTypes, ResultType, ReducerPath> : Definitions[K] extends MutationDefinition<infer QueryArg, infer BaseQuery, any, infer ResultType, infer ReducerPath> ? MutationDefinition<QueryArg, BaseQuery, NewTagTypes, ResultType, ReducerPath> : never;
534};
535export {};