import { Reducer } from 'redux'; import { PayloadAction } from './createAction'; import { CaseReducers } from './createReducer'; /** * An action creator atttached to a slice. */ export declare type SliceActionCreator
= P extends void ? () => PayloadAction ;
export interface Slice {
/**
* The slice name.
*/
slice: string;
/**
* The slice's reducer.
*/
reducer: Reducer;
/**
* Action creators for the types of actions that are handled by the slice
* reducer.
*/
actions: {
[type in keyof AP]: SliceActionCreator = CaseReducers> {
/**
* The slice's name. Used to namespace the generated action types and to
* name the selector for retrieving the reducer's state.
*/
slice?: string;
/**
* The initial state to be returned by the slice reducer.
*/
initialState: S;
/**
* A mapping from action types to action-type-specific *case reducer*
* functions. For every action type, a matching action creator will be
* generated using `createAction()`.
*/
reducers: CR;
/**
* A mapping from action types to action-type-specific *case reducer*
* functions. These reducers should have existing action types used
* as the keys, and action creators will _not_ be generated.
*/
extraReducers?: CaseReducers;
}
declare type CaseReducerActionPayloads>(options: CreateSliceOptions): Slice>;
export {};