1
1
import type { UnknownAction } from '@reduxjs/toolkit'
2
2
import { weakMapMemoize } from 'reselect'
3
- import type { AnyNonNullishValue } from '../tsHelpers'
3
+ import type { AnyFunction , AnyObject } from '../tsHelpers'
4
4
import type { Api , ApiContext , Module , ModuleName } from './apiTypes'
5
5
import type { BaseQueryArg , BaseQueryFn } from './baseQueryTypes'
6
6
import type { CombinedState } from './core/apiState'
@@ -324,7 +324,9 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
324
324
endpoints ,
325
325
) ) {
326
326
if ( typeof partialDefinition === 'function' ) {
327
- partialDefinition ( context . endpointDefinitions [ endpointName ] )
327
+ ; ( partialDefinition as AnyFunction ) (
328
+ context . endpointDefinitions [ endpointName ] ,
329
+ )
328
330
} else {
329
331
Object . assign (
330
332
context . endpointDefinitions [ endpointName ] || { } ,
@@ -335,13 +337,7 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
335
337
}
336
338
return api
337
339
} ,
338
- } as Api <
339
- BaseQueryFn ,
340
- AnyNonNullishValue ,
341
- string ,
342
- string ,
343
- Modules [ number ] [ 'name' ]
344
- >
340
+ } as Api < BaseQueryFn , AnyObject , string , string , Modules [ number ] [ 'name' ] >
345
341
346
342
const initializedModules = modules . map ( ( m ) =>
347
343
m . init ( api as any , optionsWithDefaults as any , context ) ,
0 commit comments