← All packages

API reference

@searsuite/sear-plugin-history

Commit-driven Sheet and Doc undo and redo stacks.

12 exportsderived from source

classNoopSheetExternalHistorysource ↗
class NoopSheetExternalHistory extends SheetExternalHistory

Optional parent history visible through a mounted Sheet editor.

constructorconstructor
NoopSheetExternalHistory(): NoopSheetExternalHistory
methodgetStatus
getStatus(): SheetExternalHistoryStatus
methodredo
redo(): void
methodsubscribe
subscribe(): (): void
methodundo
undo(): void
Inherited members 1

Inherited from SheetExternalHistory.

classSheetExternalHistorysource ↗
class SheetExternalHistory

Optional parent history visible through a mounted Sheet editor.

constructorconstructor
SheetExternalHistory(): SheetExternalHistory
propertysymbolstatic
readonly symbol: typeof symbol
methodgetStatus
getStatus(): SheetExternalHistoryStatus
methodredo
redo(): void | Promise<void>
methodsubscribe
subscribe(listener: (): void): (): void
listener: (): void
methodundo
undo(): void | Promise<void>
classSheetHistoryPluginsource ↗
class SheetHistoryPlugin extends Plugin<SearCoreSheet, CellProperties, null>, SheetLifecycleController, SheetHistoryStatusProvider

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

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

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

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable owner key for the private history state.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the default Sheet history plugin.

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

History observes committed commands and owns no transactional sheet projection.

_state: null
_transaction: Transaction
methoddestroy
destroy(): void

Releases command/status subscriptions owned by this editor instance.

methodgetPluginConfig
getPluginConfig(): null

History has no render-time configuration.

methodgetStatus
getStatus(): SheetHistoryStatus

Returns current undo and redo availability.

methodregisterCommands
registerCommands(commands: SheetCommandBus): void

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

commands: SheetCommandBus
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

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

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

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

methodrender
render(): null

History contributes no scene nodes.

methodstart
start(_context: SheetLifecycleContext): void

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

_context: SheetLifecycleContext
methodsubscribe
subscribe(listener: (status: SheetHistoryStatus): void): (): void

Subscribes to future history availability changes.

listener: (status: SheetHistoryStatus): void
Inherited members 29

Inherited from Plugin.

classSheetHistoryStatusProvidersource ↗
class SheetHistoryStatusProvider

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

constructorconstructor
SheetHistoryStatusProvider(): SheetHistoryStatusProvider
propertysymbolstatic
readonly symbol: typeof symbol

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

methodgetStatus
getStatus(): SheetHistoryStatus

Returns the current editor-local history availability.

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

Observes future history availability changes and returns an idempotent disposer.

listener: (status: SheetHistoryStatus): void
interfaceSheetExternalHistoryStatussource ↗
interface SheetExternalHistoryStatus
propertycanRedo
readonly canRedo: boolean
propertycanUndo
readonly canUndo: boolean
interfaceSheetHistoryEntrysource ↗
interface SheetHistoryEntry
propertygroupId
groupId?: string

Pending group token retained until a matching command commits.

propertyredo
redo: Transaction<Operation>[]
propertyundo
undo: Transaction<Operation>[]
interfaceSheetHistorySessionStatesource ↗
interface SheetHistorySessionState

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

propertyredoStack
readonly redoStack: SheetHistoryEntry[]
propertyundoStack
readonly undoStack: SheetHistoryEntry[]
interfaceSheetHistoryStatussource ↗
interface SheetHistoryStatus

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

propertycanRedo
readonly canRedo: boolean
propertycanUndo
readonly canUndo: boolean
variableRedoSheetCommandsource ↗
RedoSheetCommand: SheetCommandDefinition<void, SheetCommandResult>

Reapplies the latest sheet mutation reverted by undo.

variableSheetHistorySessionStateDefinitionsource ↗
SheetHistorySessionStateDefinition: SessionStateDefinition<SheetHistorySessionState>

Stable session-state identity owned by SheetHistoryPlugin.

variableSheetHistoryStatusObservationsource ↗
SheetHistoryStatusObservation: StateObservationDefinition<SheetHistoryStatus>

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

variableUndoSheetCommandsource ↗
UndoSheetCommand: SheetCommandDefinition<void, SheetCommandResult>

Reverts the latest successfully committed sheet mutation.