Skip to content

Commit 86fa7b7

Browse files
committed
Fix missing exports
1 parent 3df6ae8 commit 86fa7b7

File tree

9 files changed

+39
-28
lines changed

9 files changed

+39
-28
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/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(() => {

packages/toolkit/src/tests/configureStore.test-d.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,11 @@ describe('type tests', () => {
608608
const concatenated = gDM().prepend(otherMiddleware)
609609

610610
expectTypeOf(concatenated).toMatchTypeOf<
611-
readonly (| typeof otherMiddleware
611+
readonly (
612+
| typeof otherMiddleware
612613
| ThunkMiddleware
613-
| Middleware<AnyNonNullishValue>)[]
614+
| Middleware<AnyNonNullishValue>
615+
)[]
614616
>()
615617

616618
return concatenated
@@ -634,9 +636,11 @@ describe('type tests', () => {
634636
const concatenated = gDM().concat(otherMiddleware)
635637

636638
expectTypeOf(concatenated).toMatchTypeOf<
637-
readonly (| typeof otherMiddleware
639+
readonly (
640+
| typeof otherMiddleware
638641
| ThunkMiddleware
639-
| Middleware<AnyNonNullishValue>)[]
642+
| Middleware<AnyNonNullishValue>
643+
)[]
640644
>()
641645

642646
return concatenated

packages/toolkit/src/tests/createReducer.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import type {
66
Reducer,
77
UnknownAction,
88
} from '@reduxjs/toolkit'
9-
import { isPlainObject } from '@reduxjs/toolkit'
10-
import { createAction, createNextState, createReducer } from '@reduxjs/toolkit'
119
import {
12-
createConsole,
13-
getLog,
14-
mockConsole,
15-
} from 'console-testing-library/pure'
10+
createAction,
11+
createNextState,
12+
createReducer,
13+
isPlainObject,
14+
} from '@reduxjs/toolkit'
15+
import { createConsole, mockConsole } from 'console-testing-library/pure'
1616

1717
interface Todo {
1818
text: string
@@ -84,9 +84,9 @@ describe('createReducer', () => {
8484
it('Throws an error if the legacy object notation is used', async () => {
8585
const { createReducer } = await import('../createReducer')
8686
const wrapper = () => {
87-
// @ts-ignore
8887
const dummyReducer = (createReducer as CreateReducer)(
8988
[] as TodoState,
89+
// @ts-ignore
9090
{},
9191
)
9292
}
@@ -104,9 +104,9 @@ describe('createReducer', () => {
104104
process.env.NODE_ENV = 'production'
105105
const { createReducer } = await import('../createReducer')
106106
const wrapper = () => {
107-
// @ts-ignore
108107
const dummyReducer = (createReducer as CreateReducer)(
109108
[] as TodoState,
109+
// @ts-ignore
110110
{},
111111
)
112112
}

0 commit comments

Comments
 (0)