@@ -147,11 +147,13 @@ export type GetResultDescriptionFn<
147
147
TagTypes extends string ,
148
148
ResultType ,
149
149
QueryArg ,
150
- ErrorType
150
+ ErrorType ,
151
+ MetaType
151
152
> = (
152
153
result : ResultType | undefined ,
153
154
error : ErrorType | undefined ,
154
- arg : QueryArg
155
+ arg : QueryArg ,
156
+ meta : MetaType
155
157
) => ReadonlyArray < TagDescription < TagTypes > >
156
158
157
159
export type FullTagDescription < TagType > = {
@@ -163,10 +165,11 @@ export type ResultDescription<
163
165
TagTypes extends string ,
164
166
ResultType ,
165
167
QueryArg ,
166
- ErrorType
168
+ ErrorType ,
169
+ MetaType
167
170
> =
168
171
| ReadonlyArray < TagDescription < TagTypes > >
169
- | GetResultDescriptionFn < TagTypes , ResultType , QueryArg , ErrorType >
172
+ | GetResultDescriptionFn < TagTypes , ResultType , QueryArg , ErrorType , MetaType >
170
173
171
174
/** @deprecated please use `onQueryStarted` instead */
172
175
export interface QueryApi < ReducerPath extends string , Context extends { } > {
@@ -236,7 +239,8 @@ export interface QueryExtraOptions<
236
239
TagTypes ,
237
240
ResultType ,
238
241
QueryArg ,
239
- BaseQueryError < BaseQuery >
242
+ BaseQueryError < BaseQuery > ,
243
+ BaseQueryMeta < BaseQuery >
240
244
>
241
245
/**
242
246
* Not to be used. A query should not invalidate tags in the cache.
@@ -310,7 +314,8 @@ export interface MutationExtraOptions<
310
314
TagTypes ,
311
315
ResultType ,
312
316
QueryArg ,
313
- BaseQueryError < BaseQuery >
317
+ BaseQueryError < BaseQuery > ,
318
+ BaseQueryMeta < BaseQuery >
314
319
>
315
320
/**
316
321
* Not to be used. A mutation should not provide tags to the cache.
@@ -429,17 +434,23 @@ export type EndpointBuilder<
429
434
430
435
export type AssertTagTypes = < T extends FullTagDescription < string > > ( t : T ) => T
431
436
432
- export function calculateProvidedBy < ResultType , QueryArg , ErrorType > (
437
+ export function calculateProvidedBy < ResultType , QueryArg , ErrorType , MetaType > (
433
438
description :
434
- | ResultDescription < string , ResultType , QueryArg , ErrorType >
439
+ | ResultDescription < string , ResultType , QueryArg , ErrorType , MetaType >
435
440
| undefined ,
436
441
result : ResultType | undefined ,
437
442
error : ErrorType | undefined ,
438
443
queryArg : QueryArg ,
444
+ meta : MetaType | undefined ,
439
445
assertTagTypes : AssertTagTypes
440
446
) : readonly FullTagDescription < string > [ ] {
441
447
if ( isFunction ( description ) ) {
442
- return description ( result as ResultType , error as undefined , queryArg )
448
+ return description (
449
+ result as ResultType ,
450
+ error as undefined ,
451
+ queryArg ,
452
+ meta as MetaType
453
+ )
443
454
. map ( expandTagDescription )
444
455
. map ( assertTagTypes )
445
456
}
0 commit comments