@@ -3,7 +3,9 @@ import type { BaseQueryError } from '../baseQueryTypes'
33import type {
44 BaseEndpointDefinition ,
55 EndpointDefinitions ,
6+ InfiniteQueryDefinition ,
67 MutationDefinition ,
8+ PageParamFrom ,
79 QueryArgFrom ,
810 QueryDefinition ,
911 ResultTypeFrom ,
@@ -30,9 +32,9 @@ export type RefetchConfigOptions = {
3032
3133export type PageParamFunction < DataType , PageParam > = (
3234 firstPage : DataType ,
33- allPages : Array < DataType > ,
35+ allPages : DataType [ ] ,
3436 firstPageParam : PageParam ,
35- allPageParams : Array < PageParam > ,
37+ allPageParams : PageParam [ ] ,
3638) => PageParam | undefined | null
3739
3840export type InfiniteQueryConfigOptions < DataType , PageParam > = {
@@ -59,8 +61,8 @@ export type InfiniteQueryConfigOptions<DataType, PageParam> = {
5961}
6062
6163export interface InfiniteData < DataType , PageParam > {
62- pages : Array < DataType >
63- pageParams : Array < PageParam >
64+ pages : DataType [ ]
65+ pageParams : PageParam [ ]
6466}
6567
6668/**
@@ -146,7 +148,7 @@ export type SubscriptionOptions = {
146148 */
147149 refetchOnFocus ?: boolean
148150}
149- export type Subscribers = { [ requestId : string ] : SubscriptionOptions }
151+ export type Subscribers = Record < string , SubscriptionOptions >
150152export type QueryKeys < Definitions extends EndpointDefinitions > = {
151153 [ K in keyof Definitions ] : Definitions [ K ] extends QueryDefinition <
152154 any ,
@@ -306,23 +308,20 @@ export type CombinedState<
306308 config : ConfigState < ReducerPath >
307309}
308310
309- export type InvalidationState < TagTypes extends string > = {
310- [ _ in TagTypes ] : {
311- [ id : string ] : Array < QueryCacheKey >
312- [ id : number ] : Array < QueryCacheKey >
311+ export type InvalidationState < TagTypes extends string > = Record <
312+ TagTypes ,
313+ {
314+ [ id : string ] : QueryCacheKey [ ]
315+ [ id : number ] : QueryCacheKey [ ]
313316 }
314- }
317+ >
315318
316- export type QueryState < D extends EndpointDefinitions > = {
317- [ queryCacheKey : string ] :
318- | QuerySubState < D [ string ] >
319- | InfiniteQuerySubState < D [ string ] >
320- | undefined
321- }
319+ export type QueryState < D extends EndpointDefinitions > = Record <
320+ string ,
321+ QuerySubState < D [ string ] > | InfiniteQuerySubState < D [ string ] > | undefined
322+ >
322323
323- export type SubscriptionState = {
324- [ queryCacheKey : string ] : Subscribers | undefined
325- }
324+ export type SubscriptionState = Record < string , Subscribers | undefined >
326325
327326export type ConfigState < ReducerPath > = RefetchConfigOptions & {
328327 reducerPath : ReducerPath
@@ -336,9 +335,10 @@ export type ModifiableConfigState = {
336335 invalidationBehavior : 'delayed' | 'immediately'
337336} & RefetchConfigOptions
338337
339- export type MutationState < D extends EndpointDefinitions > = {
340- [ requestId : string ] : MutationSubState < D [ string ] > | undefined
341- }
338+ export type MutationState < D extends EndpointDefinitions > = Record <
339+ string ,
340+ MutationSubState < D [ string ] > | undefined
341+ >
342342
343343export type RootState <
344344 Definitions extends EndpointDefinitions ,
0 commit comments