# @embedpdf/react — ./history HISTORY_DEFAULTS [VariableDeclaration] (from packages/plugin/history/src/contract.ts): HISTORY_DEFAULTS: HistorySettings ={ limit: 100} HistoryCapability [InterfaceDeclaration] (from packages/plugin/history/src/contract.ts): export interface HistoryCapability extends SettingsApi{ undo(): void; redo(): void; canUndo(): boolean; canRedo(): boolean; getUndoLabel(): ChangeLabel | null; getRedoLabel(): ChangeLabel | null; clear(): void; readonly onUndone: EventHook; readonly onUndoFailed: EventHook; } HistoryConfig [TypeAliasDeclaration] (from packages/plugin/history/src/contract.ts): export type HistoryConfig = DeepPartial; HistorySettings [InterfaceDeclaration] (from packages/plugin/history/src/contract.ts): export interface HistorySettings{ readonly limit: number; } HistoryState [InterfaceDeclaration] (from packages/plugin/history/src/state.ts): export interface HistoryState{ readonly canUndo: boolean; readonly canRedo: boolean; readonly undoLabel: ChangeLabel | null; readonly redoLabel: ChangeLabel | null; } HistoryToken [VariableDeclaration] (from packages/plugin/history/src/token.ts): HistoryToken = createCapabilityToken('history', { hint: "add historyPlugin() from '@embedpdf/plugin-history' to your plugins list", } ) HistoryUndoFailedEvent [InterfaceDeclaration] (from packages/plugin/history/src/contract.ts): export interface HistoryUndoFailedEvent{ readonly label: ChangeLabel; readonly redo: boolean; readonly reason: 'unavailable' | 'refused'; readonly error: PluginError; } HistoryUndoneEvent [InterfaceDeclaration] (from packages/plugin/history/src/contract.ts): export interface HistoryUndoneEvent{ readonly label: ChangeLabel; readonly redo: boolean; readonly skipped: number; } historyCommands [VariableDeclaration] (from packages/framework/react/src/command-lists.ts): historyCommands = createHistoryCommands() historyPlugin [VariableDeclaration] (from packages/plugin/history/src/history.plugin.ts): historyPlugin = (config?: HistoryConfig) => definePlugin({ id: 'history', token: HistoryToken, scope: 'document', state: emptyHistory, settings:{ defaults: HISTORY_DEFAULTS, registered: config} , create: createHistoryController, } ) historyState [VariableDeclaration] (from packages/plugin/history/src/state.ts): historyState = defineState(HistoryToken, { read: (history): HistoryState => ({ canUndo: history.canUndo(), canRedo: history.canRedo(), undoLabel: history.getUndoLabel(), redoLabel: history.getRedoLabel(), } ), empty:{ canUndo: false, canRedo: false, undoLabel: null, redoLabel: null, } , } ) useHistory [FunctionDeclaration]: export function useHistory(): HistoryCapability{ return useCapability(HistoryToken); } useHistoryEvent [FunctionDeclaration]: export function useHistoryEvent( select: (history: HistoryCapability) => EventHook, handler: (event: T) => void, ): void{ useCapabilityEvent(HistoryToken, select, handler); } useHistoryState [VariableDeclaration]: useHistoryState = stateHook(historyState)