@@ -182,15 +182,15 @@ export type ReducerCreators<
182
182
: Name ] : SliceReducerCreators < State , any , any > [ CreatorMap [ Name ] ] [ 'create' ]
183
183
}
184
184
185
- interface ReducerHandlingContext < State > {
185
+ interface InternalReducerHandlingContext < State > {
186
186
sliceCaseReducersByType : Record < string , CaseReducer < State , any > >
187
187
sliceMatchers : ActionMatcherDescriptionCollection < State >
188
188
189
189
sliceCaseReducersByName : Record < string , any >
190
190
actionCreators : Record < string , any >
191
191
}
192
192
193
- export interface ReducerHandlingContextMethods < State > {
193
+ export interface ReducerHandlingContext < State > {
194
194
/**
195
195
* Adds a case reducer to handle a single action type.
196
196
* @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.
@@ -199,7 +199,7 @@ export interface ReducerHandlingContextMethods<State> {
199
199
addCase < ActionCreator extends TypedActionCreator < string > > (
200
200
actionCreator : ActionCreator ,
201
201
reducer : CaseReducer < State , ReturnType < ActionCreator > > ,
202
- ) : ReducerHandlingContextMethods < State >
202
+ ) : ReducerHandlingContext < State >
203
203
/**
204
204
* Adds a case reducer to handle a single action type.
205
205
* @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.
@@ -208,7 +208,7 @@ export interface ReducerHandlingContextMethods<State> {
208
208
addCase < Type extends string , A extends Action < Type > > (
209
209
type : Type ,
210
210
reducer : CaseReducer < State , A > ,
211
- ) : ReducerHandlingContextMethods < State >
211
+ ) : ReducerHandlingContext < State >
212
212
213
213
/**
214
214
* Allows you to match incoming actions against your own filter function instead of only the `action.type` property.
@@ -224,7 +224,7 @@ export interface ReducerHandlingContextMethods<State> {
224
224
addMatcher < A > (
225
225
matcher : TypeGuard < A > ,
226
226
reducer : CaseReducer < State , A extends Action ? A : A & Action > ,
227
- ) : ReducerHandlingContextMethods < State >
227
+ ) : ReducerHandlingContext < State >
228
228
/**
229
229
* Add an action to be exposed under the final `slice.actions` key.
230
230
* @param name The key to be exposed as.
@@ -239,7 +239,7 @@ export interface ReducerHandlingContextMethods<State> {
239
239
exposeAction (
240
240
name : string ,
241
241
actionCreator : unknown ,
242
- ) : ReducerHandlingContextMethods < State >
242
+ ) : ReducerHandlingContext < State >
243
243
/**
244
244
* Add a case reducer to be exposed under the final `slice.caseReducers` key.
245
245
* @param name The key to be exposed as.
@@ -254,7 +254,7 @@ export interface ReducerHandlingContextMethods<State> {
254
254
exposeCaseReducer (
255
255
name : string ,
256
256
reducer : unknown ,
257
- ) : ReducerHandlingContextMethods < State >
257
+ ) : ReducerHandlingContext < State >
258
258
/**
259
259
* Provides access to the initial state value given to the slice.
260
260
* If a lazy state initializer was provided, it will be called and a fresh value returned.
@@ -319,7 +319,7 @@ export type ReducerCreator<Type extends RegisteredReducerType> = {
319
319
handle < State > (
320
320
details : ReducerDetails ,
321
321
definition : ReducerDefinitionsForType < Type > ,
322
- context : ReducerHandlingContextMethods < State > ,
322
+ context : ReducerHandlingContext < State > ,
323
323
) : void
324
324
} )
325
325
@@ -892,14 +892,14 @@ export function buildCreateSlice<
892
892
893
893
const getInitialState = makeGetInitialState ( options . initialState )
894
894
895
- const context : ReducerHandlingContext < State > = {
895
+ const context : InternalReducerHandlingContext < State > = {
896
896
sliceCaseReducersByName : { } ,
897
897
sliceCaseReducersByType : { } ,
898
898
actionCreators : { } ,
899
899
sliceMatchers : [ ] ,
900
900
}
901
901
902
- const contextMethods : ReducerHandlingContextMethods < State > = {
902
+ const contextMethods : ReducerHandlingContext < State > = {
903
903
addCase (
904
904
typeOrActionCreator : string | TypedActionCreator < any > ,
905
905
reducer : CaseReducer < State > ,
0 commit comments