← All packages

@searsuite/sear-plugin-freeze

Persistent Sheet freeze boundaries and typed command surface.

Freeze state

classSheetFreezeBoundaryError
class SheetFreezeBoundaryError extends SearError

Public invalid-boundary error with stable diagnostics.

Inherited members 9

Inherited from SearError.

classSheetFreezeMatrix
class SheetFreezeMatrix extends CSRMatrix<number | null>

One row with the frozen row and column counts at columns zero and one.

constructorSheetFreezeMatrix(data?: SheetFreezeMatrixData, shape?: [number, number]): SheetFreezeMatrix

Creates or restores a freeze matrix.

methodaddItem(row: number, column: number, value: number | null): this

Adds a boundary count through the same sparse normalization.

methodsetItem(row: number, column: number, value: number | null): this

Sets a boundary count, removing empty values from sparse storage.

Inherited members 34

Inherited from CSRMatrix.

classSheetFreezePlugin
class SheetFreezePlugin extends Plugin<unknown, CellProperties, SheetFreezePluginState>

Owns the persistent row and column prefix kept visible during scrolling.

constructorSheetFreezePlugin(state: SheetFreezePluginState, shape: (): readonly [number, number]): SheetFreezePlugin
propertyreadonly documentState: PluginDocumentStateContribution<SheetFreezePluginState, SheetFreezePluginState>

Document-state export modules owned by this plugin state.

propertyreadonly interestedIn: MatrixOTActionName[]

Declares which Sheet OT action names this plugin is interested in. The engine will only call apply when a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.

  • [&#39;uc&#39;, &#39;rr&#39;, &#39;rc&#39;] — only called for UpdateCell, ResizeRow, ResizeCol
  • [&#39;*&#39;] — called for any transaction (wildcard)
  • [] — only called for this plugin's own transactions
propertyreadonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertyreadonly warnOnDuplicateDepth: false

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

propertyreadonly documentState: PluginDocumentStateContribution<SheetFreezePluginState, SheetFreezePluginState>static
propertyreadonly pluginKey: PluginKeystatic
propertyreadonly symbol: typeof symbolstatic
methodapply(state: SheetFreezePluginState, transaction: Transaction): SheetFreezePluginState | null

Applies a transaction to plugin-owned state and returns the next state.

methodgetPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodregisterCommands(commands: SheetCommandBus): void
methodregisterState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): SheetFreezeMatrix; viewKey: string }[] }; key: PluginKey; state: SheetFreezePluginState }

Registers one or more plugin-owned state records with the host manager.

methodrender(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

Inherited members 25

Inherited from Plugin.

interfaceSheetFreezeMatrixData

Sparse serialization payload accepted by the freeze matrix.

propertyreadonly data: number | null[]

Stored boundary counts.

propertyreadonly indices: number[]

Sparse row offsets.

propertyreadonly indptr: number[]

Stored axis indices.

interfaceSheetFreezePluginState

Document-owned state for one Sheet editor's freeze boundaries.

propertyreadonly freeze: SheetFreezeMatrix

Sparse freeze boundary matrix.

interfaceSheetFreezeState

Number of leading rows and columns kept visible while scrolling.

propertyreadonly columns: number

Frozen column count.

propertyreadonly rows: number

Frozen row count.

variableSheetFreezeFieldKey
SheetFreezeFieldKey: "sheet.freeze"

Plugin-owned data-view field for persistent freeze boundaries.

Set and read freeze boundaries

interfaceSheetFreezeCommandSource

Supplies current boundaries and sheet dimensions to the command factory.

propertyreadonly target: PluginKey

Owner of the persistent freeze matrix.

methodread(): SheetFreezeState

Reads the currently committed freeze boundaries.

methodshape(): readonly [number, number]

Reads the current row and column counts.

variableSetSheetFreezeCommand
SetSheetFreezeCommand: SheetCommandDefinition<SheetFreezeState, SheetCommandResult>

Replaces both freeze boundaries in one transaction.

functioncreateSetSheetFreezeOperations
createSetSheetFreezeOperations(input: SheetFreezeState, source: SheetFreezeCommandSource): UpdateCellOTOperation<number | null>[]

Creates invertible updates for the changed freeze boundaries.

functionreadSheetFreeze
readSheetFreeze(dataEngine: DataEngine): SheetFreezeState

Reads freeze boundaries, returning zeroes when the plugin is absent.