Skip to content

Commit

Permalink
Export problematic types that were causing type portability issues
Browse files Browse the repository at this point in the history
- This should serve as a partial fix for reduxjs#3962, reduxjs#4448, reduxjs#3983, reduxjs#4066, reduxjs#4108, reduxjs#4401
- Here is the list of the problematic (now exported) types:
  From `@reduxjs/toolkit`:
  - `CombinedSliceReducer`
  - `CaseReducerDefinition`
  - `Id` renamed to `TSHelpersId`
  - `UncheckedIndexedAccess`
  - `ReducerWithInitialState`
  - `CaseReducerDefinition`
  - `Id` renamed to `TSHelpersId`
  - `UncheckedIndexedAccess`
  - `ReducerWithInitialState`
  From `@reduxjs/toolkit/query/react`:
  - `UseLazyQuery`
  - `UseQuery`
  - `QueryHooks`
  • Loading branch information
aryaemami59 committed Jun 8, 2024
1 parent 32b0155 commit 92dbfdd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/toolkit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export type {
Actions,
CaseReducer,
CaseReducers,
ReducerWithInitialState,
} from './createReducer'
export {
// js
Expand All @@ -79,6 +80,7 @@ export type {
CaseReducerWithPrepare,
ReducerCreators,
SliceSelectors,
CaseReducerDefinition,
} from './createSlice'
export type { ActionCreatorInvariantMiddlewareOptions } from './actionCreatorInvariantMiddleware'
export { createActionCreatorInvariantMiddleware } from './actionCreatorInvariantMiddleware'
Expand Down Expand Up @@ -202,11 +204,14 @@ export type { AutoBatchOptions } from './autoBatchEnhancer'

export { combineSlices } from './combineSlices'

export type { WithSlice } from './combineSlices'
export type { CombinedSliceReducer, WithSlice } from './combineSlices'

export type {
ExtractDispatchExtensions as TSHelpersExtractDispatchExtensions,
Id as TSHelpersId,
SafePromise,
} from './tsHelpers'

export { formatProdErrorMessage } from './formatProdErrorMessage'

export type { UncheckedIndexedAccess } from './uncheckedindexed'
3 changes: 3 additions & 0 deletions packages/toolkit/src/query/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const createApi = /* @__PURE__ */ buildCreateApi(
)

export type {
QueryHooks,
TypedUseMutationResult,
TypedUseQueryHookResult,
TypedUseQueryStateResult,
Expand All @@ -26,5 +27,7 @@ export type {
TypedUseQuery,
TypedUseQuerySubscription,
TypedUseLazyQuerySubscription,
UseLazyQuery,
UseQuery,
} from './buildHooks'
export { createApi, reactHooksModule, reactHooksModuleName }

0 comments on commit 92dbfdd

Please sign in to comment.