← All packages

@searsuite/sear-plugin-history

Commit-driven Sheet and Doc undo and redo stacks.

History state

classNoopSheetExternalHistory
class NoopSheetExternalHistory extends SheetExternalHistory

Optional parent history visible through a mounted Sheet editor.

Inherited members 1

Inherited from SheetExternalHistory.

classSheetHistoryPlugin
class SheetHistoryPlugin extends Plugin<SearCoreSheet, CellProperties, null>, SheetLifecycleController, SheetHistoryStatusProvider

Editor-local command history for plugin-owned Sheet state with registered transaction algebra.

constructorSheetHistoryPlugin(plugins: PluginManager<SearCoreSheet, CellProperties>, interaction: SheetInteractionStore, keyboard: KeyboardRouter, platform: Platform, commands: SheetCommandBus, externalHistory: SheetExternalHistory): SheetHistoryPlugin
propertyreadonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertyreadonly pluginKey: PluginKeystatic

Stable owner key for the private history state.

propertyreadonly symbol: typeof symbolstatic

DI token for resolving the default Sheet history plugin.

methodapply(_state: null, _transaction: Transaction): null

History observes committed commands and owns no transactional sheet projection.

methoddestroy(): void

Releases command/status subscriptions owned by this editor instance.

methodgetPluginConfig(): null

History has no render-time configuration.

methodgetStatus(): SheetHistoryStatus

Returns current undo and redo availability.

methodregisterCommands(commands: SheetCommandBus): void

Registers typed history commands on this editor's command bus.

methodregisterObservations(observations: ObservationRegistry): void

Registers the host-facing history status observation for this editor.

methodregisterSessionState(registry: SessionStateRegistry): void

Registers sheet-local undo and redo history for editor remounts.

methodregisterState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

History state is private runtime state and is never persisted or synchronized.

methodrender(): null

History contributes no scene nodes.

methodstart(_context: SheetLifecycleContext): void

Starts command observation and semantic keyboard shortcuts after Core is ready.

methodsubscribe(listener: (status: SheetHistoryStatus): void): (): void

Subscribes to future history availability changes.

Inherited members 28

Inherited from Plugin.

classSheetHistoryStatusProvider

Editor-local DI contract used by plugins that render history controls.

constructorSheetHistoryStatusProvider(): SheetHistoryStatusProvider
propertyreadonly symbol: typeof symbolstatic

DI token for resolving the active editor's history status provider.

methodgetStatus(): SheetHistoryStatus

Returns the current editor-local history availability.

methodsubscribe(listener: (status: SheetHistoryStatus): void): (): void

Observes future history availability changes and returns an idempotent disposer.

interfaceSheetHistoryEntry
propertygroupId?: string

Pending group token retained until a matching command commits.

propertyredo: Transaction<Operation>[]
propertyundo: Transaction<Operation>[]
interfaceSheetHistorySessionState

In-memory history retained for one sheet session while a workbook is open.

interfaceSheetHistoryStatus

Immutable status published whenever one editor's history availability changes.

variableSheetHistorySessionStateDefinition
SheetHistorySessionStateDefinition: SessionStateDefinition<SheetHistorySessionState>

Stable session-state identity owned by SheetHistoryPlugin.

variableSheetHistoryStatusObservation
SheetHistoryStatusObservation: StateObservationDefinition<SheetHistoryStatus>

Editor-local undo/redo availability exposed to third-party hosts.

Undo and redo

variableRedoSheetCommand
RedoSheetCommand: SheetCommandDefinition<void, SheetCommandResult>

Reapplies the latest sheet mutation reverted by undo.

variableUndoSheetCommand
UndoSheetCommand: SheetCommandDefinition<void, SheetCommandResult>

Reverts the latest successfully committed sheet mutation.