← All packages

API reference

@searsuite/sear-plugin-zoom

Editor-local zoom state, commands, observations, and render integration.

3 exportsderived from source

classSheetZoomPluginsource ↗
class SheetZoomPlugin extends Plugin<SearCoreSheet, CellProperties, Record<string, never>>

Local-only Excel-style sheet view zoom. It never changes document data or OT state.

constructorconstructor
SheetZoomPlugin(keyboardRouter: KeyboardRouter, commands?: SheetCommandBus, platform?: Platform): SheetZoomPlugin

Creates a SheetZoomPlugin instance.

keyboardRouter: KeyboardRouter
commands: SheetCommandBus
platform: Platform
propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetZoomPlugin.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetZoomPlugin.

methodapply
apply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

Applies a transaction to SheetZoomPlugin state.

state: Record<string, never>
_transaction: Transaction
methodgetPluginConfig
getPluginConfig(): unknown

Returns the plugin config.

methodgetScale
getScale(): number

Returns the scale.

methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the commands.

commands: SheetCommandBus
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ maxScale: number; minScale: number; step: number }>; key: PluginKey }[]

Registers default configuration values owned by this plugin.

methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers local view scale after Core initialization makes zoom effects available.

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: Record<string, never> }

Registers the state.

methodrender
render(core: SearCoreSheet): Node<CellProperties>[]

Renders SheetZoomPlugin scene output.

core: SearCoreSheet
methodsetScale
setScale(nextScale: number): void

Updates the scale.

nextScale: number
Inherited members 29

Inherited from Plugin.

variableSetSheetZoomCommandsource ↗
SetSheetZoomCommand: SheetCommandDefinition<number, SheetCommandResult>

Command that updates local sheet view zoom; input is the next zoom scale.

variableSheetZoomSessionStateDefinitionsource ↗
SheetZoomSessionStateDefinition: SessionStateDefinition<number>

Stable session-state identity owned by SheetZoomPlugin.