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 { BaseQueryFn } from './baseQueryTypes'
6
6
import type { CombinedState } from './core/apiState'
@@ -414,7 +414,9 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
414
414
endpoints ,
415
415
) ) {
416
416
if ( typeof partialDefinition === 'function' ) {
417
- partialDefinition ( context . endpointDefinitions [ endpointName ] )
417
+ ; ( partialDefinition as AnyFunction ) (
418
+ context . endpointDefinitions [ endpointName ] ,
419
+ )
418
420
} else {
419
421
Object . assign (
420
422
context . endpointDefinitions [ endpointName ] || { } ,
@@ -425,13 +427,7 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
425
427
}
426
428
return api
427
429
} ,
428
- } as Api <
429
- BaseQueryFn ,
430
- AnyNonNullishValue ,
431
- string ,
432
- string ,
433
- Modules [ number ] [ 'name' ]
434
- >
430
+ } as Api < BaseQueryFn , AnyObject , string , string , Modules [ number ] [ 'name' ] >
435
431
436
432
const initializedModules = modules . map ( ( m ) =>
437
433
m . init ( api as any , optionsWithDefaults as any , context ) ,
0 commit comments