// This must remain here so that the `mangleErrors.cjs` build script
// does not have to import this into each source file it rewrites.
import { formatProdErrorMessage } from '@reduxjs/toolkit'

export type {
  CombinedState,
  QueryCacheKey,
  QueryKeys,
  QuerySubState,
  RootState,
  SubscriptionOptions,
} from './core/apiState'
export { QueryStatus } from './core/apiState'
export type { Api, ApiContext, Module } from './apiTypes'

export type {
  BaseQueryApi,
  BaseQueryArg,
  BaseQueryEnhancer,
  BaseQueryError,
  BaseQueryExtraOptions,
  BaseQueryFn,
  BaseQueryMeta,
  BaseQueryResult,
  QueryReturnValue,
} from './baseQueryTypes'
export type {
  BaseEndpointDefinition,
  EndpointDefinitions,
  EndpointDefinition,
  EndpointBuilder,
  QueryDefinition,
  MutationDefinition,
  MutationExtraOptions,
  InfiniteQueryArgFrom,
  InfiniteQueryDefinition,
  InfiniteQueryExtraOptions,
  PageParamFrom,
  TagDescription,
  QueryArgFrom,
  QueryExtraOptions,
  ResultTypeFrom,
  DefinitionType,
  DefinitionsFromApi,
  OverrideResultType,
  ResultDescription,
  TagTypesFromApi,
  UpdateDefinitions,
  SchemaFailureHandler,
  SchemaFailureConverter,
  SchemaFailureInfo,
  SchemaType,
} from './endpointDefinitions'
export { fetchBaseQuery } from './fetchBaseQuery'
export type {
  FetchBaseQueryArgs,
  FetchBaseQueryError,
  FetchBaseQueryMeta,
  FetchArgs,
} from './fetchBaseQuery'
export { retry } from './retry'
export type { RetryOptions } from './retry'
export { setupListeners } from './core/setupListeners'
export { skipToken } from './core/buildSelectors'
export type {
  QueryResultSelectorResult,
  MutationResultSelectorResult,
  SkipToken,
} from './core/buildSelectors'
export type {
  QueryActionCreatorResult,
  MutationActionCreatorResult,
  StartQueryActionCreatorOptions,
} from './core/buildInitiate'
export type { CreateApi, CreateApiOptions } from './createApi'
export { buildCreateApi } from './createApi'
export { _NEVER, fakeBaseQuery } from './fakeBaseQuery'
export { copyWithStructuralSharing } from './utils/copyWithStructuralSharing'
export { createApi, coreModule, coreModuleName } from './core/index'
export type {
  InfiniteData,
  InfiniteQueryActionCreatorResult,
  InfiniteQueryConfigOptions,
  InfiniteQueryResultSelectorResult,
  InfiniteQuerySubState,
  TypedMutationOnQueryStarted,
  TypedQueryOnQueryStarted,
} from './core/index'
export type {
  ApiEndpointMutation,
  ApiEndpointQuery,
  ApiEndpointInfiniteQuery,
  ApiModules,
  CoreModule,
  PrefetchOptions,
} from './core/module'
export { defaultSerializeQueryArgs } from './defaultSerializeQueryArgs'
export type { SerializeQueryArgs } from './defaultSerializeQueryArgs'

export type {
  Id as TSHelpersId,
  Override as TSHelpersOverride,
} from './tsHelpers'

export { NamedSchemaError } from './standardSchema'
