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'
@@ -414,7 +414,9 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
414414 endpoints ,
415415 ) ) {
416416 if ( typeof partialDefinition === 'function' ) {
417- partialDefinition ( context . endpointDefinitions [ endpointName ] )
417+ ; ( partialDefinition as AnyFunction ) (
418+ context . endpointDefinitions [ endpointName ] ,
419+ )
418420 } else {
419421 Object . assign (
420422 context . endpointDefinitions [ endpointName ] || { } ,
@@ -425,13 +427,7 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
425427 }
426428 return api
427429 } ,
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' ] >
435431
436432 const initializedModules = modules . map ( ( m ) =>
437433 m . init ( api as any , optionsWithDefaults as any , context ) ,
0 commit comments