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 { BaseQueryArg , BaseQueryFn } from './baseQueryTypes'
66import type { CombinedState } from './core/apiState'
@@ -324,7 +324,9 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
324324 endpoints ,
325325 ) ) {
326326 if ( typeof partialDefinition === 'function' ) {
327- partialDefinition ( context . endpointDefinitions [ endpointName ] )
327+ ; ( partialDefinition as AnyFunction ) (
328+ context . endpointDefinitions [ endpointName ] ,
329+ )
328330 } else {
329331 Object . assign (
330332 context . endpointDefinitions [ endpointName ] || { } ,
@@ -335,13 +337,7 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
335337 }
336338 return api
337339 } ,
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' ] >
345341
346342 const initializedModules = modules . map ( ( m ) =>
347343 m . init ( api as any , optionsWithDefaults as any , context ) ,
0 commit comments