11import type { UnknownAction } from '@reduxjs/toolkit'
22import { weakMapMemoize } from 'reselect'
3- import type { AnyNonNullishValue } from '../tsHelpers'
3+ import type { AnyFunction , AnyObject } from '../tsHelpers'
44import type { Api , ApiContext , Module , ModuleName } from './apiTypes'
55import type { BaseQueryFn } from './baseQueryTypes'
66import type { CombinedState } from './core/apiState'
@@ -417,7 +417,9 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
417417 endpoints ,
418418 ) ) {
419419 if ( typeof partialDefinition === 'function' ) {
420- partialDefinition ( context . endpointDefinitions [ endpointName ] )
420+ ; ( partialDefinition as AnyFunction ) (
421+ context . endpointDefinitions [ endpointName ] ,
422+ )
421423 } else {
422424 Object . assign (
423425 context . endpointDefinitions [ endpointName ] || { } ,
@@ -428,13 +430,7 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
428430 }
429431 return api
430432 } ,
431- } as Api <
432- BaseQueryFn ,
433- AnyNonNullishValue ,
434- string ,
435- string ,
436- Modules [ number ] [ 'name' ]
437- >
433+ } as Api < BaseQueryFn , AnyObject , string , string , Modules [ number ] [ 'name' ] >
438434
439435 const initializedModules = modules . map ( ( m ) =>
440436 m . init ( api as any , optionsWithDefaults as any , context ) ,
0 commit comments