export interface Options { size: number; onUndo?: () => void; onRedo?: () => void; } declare type NextState = T | ((nextState: T) => T); export interface StateWithHistory { /** Current state of history */ current: T; /** Can history be undone? */ canUndo: boolean; /** Can history be redone? */ canRedo: boolean; /** Go to previous state, if available. */ undo: () => void; /** Go to next state, if available. */ redo: () => void; /** * Add a new entry to history, after the current entry. * All entries added after current will be purged. */ setCurrent: (nextState: NextState>) => void; } /** * Use state hook with a history of the size provided via `options`. The initial returned state will be `undefined`. * @param options */ export declare function useStateWithHistory(options: Options): StateWithHistory; /** * Use state hook with a history of the size provided via `options`. * @param options */ export declare function useStateWithHistory(initialState: T, options: Options): StateWithHistory; export {}; //# sourceMappingURL=StateWithHistory.d.ts.map