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'
@@ -331,7 +331,9 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
331331 endpoints ,
332332 ) ) {
333333 if ( typeof partialDefinition === 'function' ) {
334- partialDefinition ( context . endpointDefinitions [ endpointName ] )
334+ ; ( partialDefinition as AnyFunction ) (
335+ context . endpointDefinitions [ endpointName ] ,
336+ )
335337 } else {
336338 Object . assign (
337339 context . endpointDefinitions [ endpointName ] || { } ,
@@ -342,13 +344,7 @@ export function buildCreateApi<Modules extends [Module<any>, ...Module<any>[]]>(
342344 }
343345 return api
344346 } ,
345- } as Api <
346- BaseQueryFn ,
347- AnyNonNullishValue ,
348- string ,
349- string ,
350- Modules [ number ] [ 'name' ]
351- >
347+ } as Api < BaseQueryFn , AnyObject , string , string , Modules [ number ] [ 'name' ] >
352348
353349 const initializedModules = modules . map ( ( m ) =>
354350 m . init ( api as any , optionsWithDefaults as any , context ) ,
0 commit comments