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'
@@ -327,7 +327,9 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
327327 endpoints ,
328328 ) ) {
329329 if ( typeof partialDefinition === 'function' ) {
330- partialDefinition ( context . endpointDefinitions [ endpointName ] )
330+ ; ( partialDefinition as AnyFunction ) (
331+ context . endpointDefinitions [ endpointName ] ,
332+ )
331333 } else {
332334 Object . assign (
333335 context . endpointDefinitions [ endpointName ] || { } ,
@@ -338,13 +340,7 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
338340 }
339341 return api
340342 } ,
341- } as Api <
342- BaseQueryFn ,
343- AnyNonNullishValue ,
344- string ,
345- string ,
346- Modules [ number ] [ 'name' ]
347- >
343+ } as Api < BaseQueryFn , AnyObject , string , string , Modules [ number ] [ 'name' ] >
348344
349345 const initializedModules = modules . map ( ( m ) =>
350346 m . init ( api as any , optionsWithDefaults as any , context ) ,
0 commit comments