UNPKG

undox

Version:

Redux implementation of Undo/Redo based on storing actions instead of states.

12 lines (11 loc) 844 B
import { Action, Reducer, Comparator, UndoxState, Limit } from './interfaces/public'; import { UndoxAction } from './undox.action'; export declare const createSelectors: <S, A extends Action<any>>(reducer: Reducer<S, A>) => { getPastStates: (state: UndoxState<S, A>) => S[]; getFutureStates: (state: UndoxState<S, A>) => S[]; getPresentState: <S_1, A_1 extends Action<any>>(state: UndoxState<S_1, A_1>) => Readonly<S_1>; getPastActions: (state: UndoxState<S, A>) => A[]; getPresentAction: (state: UndoxState<S, A>) => A | A[]; getFutureActions: (state: UndoxState<S, A>) => A[]; }; export declare const undox: <S, A extends Action<any>>(reducer: Reducer<S, A>, initAction?: any, comparator?: Comparator<S>, limit?: Limit | undefined) => (state: UndoxState<S, A> | undefined, action: UndoxAction<A>) => UndoxState<S, A>;