Type alias History<T>

History<T>: {
    canRedo?: boolean;
    canUndo?: boolean;
    changed: boolean;
    changes: Partial<T>;
    clear: (() => void);
    forget: (() => void);
    redo: (() => void) & {
        list: ChangeList;
    };
    reset: (() => void);
    undo: (() => void) & {
        list: ChangeList;
    };
}

Type Parameters

Type declaration

  • Optional Readonly canRedo?: boolean

    Can we call .redo()?

  • Optional Readonly canUndo?: boolean

    Can we call .undo()?

  • Readonly changed: boolean

    Does the state is changed?

  • changes: Partial<T>

    The changed properties

  • clear: (() => void)
      • (): void
      • Function to mark the history as unchanged

        Returns void

  • forget: (() => void)
      • (): void
      • Function to stop watching the changes

        Returns void

  • redo: (() => void) & {
        list: ChangeList;
    }

    Function to redo the previous change

  • reset: (() => void)
      • (): void
      • Function to reset to initial state

        Returns void

  • undo: (() => void) & {
        list: ChangeList;
    }

    Function to undo the previous change

Generated using TypeDoc