Skip to content

Commit 14f997a

Browse files
committed
Fix missing exports
1 parent 9c4b698 commit 14f997a

File tree

13 files changed

+55
-38
lines changed

13 files changed

+55
-38
lines changed

packages/toolkit/src/createAction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { isAction } from 'redux'
22
import type {
3+
AnyFunction,
34
AnyNonNullishValue,
45
IfMaybeUndefined,
56
IfVoid,

packages/toolkit/src/createReducer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ export type ActionMatcherDescription<S, A extends Action> = {
2121
reducer: CaseReducer<S, NoInfer<A>>
2222
}
2323

24-
export type ReadonlyActionMatcherDescriptionCollection<S> = readonly ActionMatcherDescription<S, any>[]
24+
export type ReadonlyActionMatcherDescriptionCollection<S> =
25+
readonly ActionMatcherDescription<S, any>[]
2526

26-
export type ActionMatcherDescriptionCollection<S> = ActionMatcherDescription<S, any>[]
27+
export type ActionMatcherDescriptionCollection<S> = ActionMatcherDescription<
28+
S,
29+
any
30+
>[]
2731

2832
/**
2933
* A *case reducer* is a reducer function for a specific action type. Case

packages/toolkit/src/devtoolsExtension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Action, ActionCreator, StoreEnhancer } from 'redux'
22
import { compose } from 'redux'
3-
import type { AnyNonNullishValue } from './tsHelpers'
3+
import type { AnyFunction, AnyNonNullishValue } from './tsHelpers'
44

55
/**
66
* @public

packages/toolkit/src/dynamicMiddleware/index.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ import type {
1313
WithMiddleware,
1414
} from './types'
1515

16+
export type {
17+
DynamicMiddlewareInstance,
18+
GetDispatchType as GetDispatch,
19+
MiddlewareApiConfig,
20+
} from './types'
21+
1622
const createMiddlewareEntry = <
1723
State = any,
1824
DispatchType extends Dispatch<UnknownAction> = Dispatch<UnknownAction>,
@@ -67,9 +73,11 @@ export const createDynamicMiddleware = <
6773
{ withTypes: () => addMiddleware },
6874
) as AddMiddleware<State, DispatchType>
6975

70-
const getFinalMiddleware: Middleware<AnyNonNullishValue, State, Dispatch> = (
71-
api,
72-
) => {
76+
const getFinalMiddleware: Middleware<
77+
AnyNonNullishValue,
78+
State,
79+
DispatchType
80+
> = (api) => {
7381
const appliedMiddleware = Array.from(middlewareMap.values()).map((entry) =>
7482
emplace(entry.applied, api, { insert: () => entry.middleware(api) }),
7583
)

packages/toolkit/src/entities/unsorted_state_adapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function createUnsortedStateAdapter<T, Id extends EntityId>(
102102
}
103103

104104
function takeNewKey(
105-
keys: Record<string, Id>,
105+
keys: Record<EntityId, Id>,
106106
update: Update<T, Id>,
107107
state: R,
108108
): boolean {
@@ -132,9 +132,9 @@ export function createUnsortedStateAdapter<T, Id extends EntityId>(
132132
updates: readonly Update<T, Id>[],
133133
state: R,
134134
): void {
135-
const newKeys: Record<string, Id> = {}
135+
const newKeys: Record<EntityId, Id> = {}
136136

137-
const updatesPerEntity: Record<string, Update<T, Id>> = {}
137+
const updatesPerEntity: Record<EntityId, Update<T, Id>> = {}
138138

139139
updates.forEach((update) => {
140140
// Only apply updates to entities that currently exist

packages/toolkit/src/listenerMiddleware/tests/effectScenarios.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ import {
66
createSlice,
77
isAnyOf,
88
} from '@reduxjs/toolkit'
9-
import { vi } from 'vitest'
10-
11-
import type { PayloadAction } from '@reduxjs/toolkit'
12-
139
import { TaskAbortError, createListenerMiddleware } from '../index'
1410

15-
import type { TypedAddListener } from '../index'
16-
1711
describe('Saga-style Effects Scenarios', () => {
1812
interface CounterState {
1913
value: number

packages/toolkit/src/query/core/buildMiddleware/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export function buildMiddleware<
4848
const { apiUid } = context
4949

5050
const actions = {
51-
invalidateTags: createAction<
52-
(TagTypes | FullTagDescription<TagTypes>)[]
53-
>(`${reducerPath}/invalidateTags`),
51+
invalidateTags: createAction<(TagTypes | FullTagDescription<TagTypes>)[]>(
52+
`${reducerPath}/invalidateTags`,
53+
),
5454
}
5555

5656
const isThisApiSliceAction = (action: Action) =>

packages/toolkit/src/query/core/buildMiddleware/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import type {
66
ThunkDispatch,
77
UnknownAction,
88
} from '@reduxjs/toolkit'
9-
10-
import type { AnyNonNullishValue } from '@reduxjs/toolkit/dist/tsHelpers'
9+
import type { AnyNonNullishValue } from '../../../tsHelpers'
1110
import type { Api, ApiContext } from '../../apiTypes'
1211
import type {
1312
AssertTagTypes,

packages/toolkit/src/query/endpointDefinitions.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Api } from '@reduxjs/toolkit/query'
2-
import type { AnyNonNullishValue } from '../tsHelpers'
2+
import type { AnyFunction, AnyNonNullishValue } from '../tsHelpers'
33
import type {
44
BaseQueryApi,
55
BaseQueryArg,
@@ -11,6 +11,15 @@ import type {
1111
QueryReturnValue,
1212
} from './baseQueryTypes'
1313
import type { QuerySubState, RootState } from './core/apiState'
14+
import type { CacheCollectionQueryExtraOptions } from './core/buildMiddleware/cacheCollection'
15+
import type {
16+
CacheLifecycleMutationExtraOptions,
17+
CacheLifecycleQueryExtraOptions,
18+
} from './core/buildMiddleware/cacheLifecycle'
19+
import type {
20+
QueryLifecycleMutationExtraOptions,
21+
QueryLifecycleQueryExtraOptions,
22+
} from './core/buildMiddleware/queryLifecycle'
1423
import type { SerializeQueryArgs } from './defaultSerializeQueryArgs'
1524
import type { NEVER } from './fakeBaseQuery'
1625
import type {

packages/toolkit/src/query/tests/retry.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { noop, setupApiStore } from '@internal/tests/utils/helpers'
2-
import type { BaseQueryFn } from '@reduxjs/toolkit/query'
2+
import type { BaseQueryFn, FetchBaseQueryError } from '@reduxjs/toolkit/query'
33
import { createApi, retry } from '@reduxjs/toolkit/query'
44

55
beforeEach(() => {

0 commit comments

Comments
 (0)