export interface UndoManager { push(undo: UndoItem): void; undo(): void; redo(): void; } export type UndoItem = [ state: UndoState, undo: UndoCallback ]; export type UndoCallback = (state: UndoState) => RedoItem; export type RedoItem = [ state: RedoState, redo: RedoCallback ]; export type RedoCallback = (state: RedoState) => UndoItem;