← All packages

API reference

@searsuite/sear-plugin-freeze

Persistent Sheet freeze boundaries and typed command surface.

11 exportsderived from source

classSheetFreezeBoundaryErrorsource ↗
class SheetFreezeBoundaryError extends SearError

Public invalid-boundary error with stable diagnostics.

constructorconstructor
SheetFreezeBoundaryError(input: SheetFreezeState, rowCount: number, columnCount: number): SheetFreezeBoundaryError
input: SheetFreezeState
rowCount: number
columnCount: number
propertycode
readonly code: "SHEET_FREEZE_INVALID_BOUNDARY"

Stable machine-readable identifier for this error category.

Inherited members 9

Inherited from SearError.

classSheetFreezeMatrixsource ↗
class SheetFreezeMatrix extends CSRMatrix<number | null>

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

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

Creates or restores a freeze matrix.

data: SheetFreezeMatrixData
shape: [number, number]
methodaddItem
addItem(row: number, column: number, value: number | null): this

Adds a boundary count through the same sparse normalization.

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

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

row: number
column: number
value: number | null
Inherited members 34

Inherited from CSRMatrix.

classSheetFreezePluginsource ↗
class SheetFreezePlugin extends Plugin<unknown, CellProperties, SheetFreezePluginState>

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

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

Document-state export modules owned by this plugin state.

propertyinterestedIn
readonly 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
propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

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

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetFreezePluginState, SheetFreezePluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
methodapply
apply(state: SheetFreezePluginState, transaction: Transaction): SheetFreezePluginState | null

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

state: SheetFreezePluginState
transaction: Transaction
methodgetPluginConfig
getPluginConfig(): null

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

methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterState
registerState(): { 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
render(): Node<CellProperties>[]

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

Inherited members 26

Inherited from Plugin.

interfaceSheetFreezeCommandSourcesource ↗
interface SheetFreezeCommandSource

Supplies current boundaries and sheet dimensions to the command factory.

propertytarget
readonly target: PluginKey

Owner of the persistent freeze matrix.

methodread
read(): SheetFreezeState

Reads the currently committed freeze boundaries.

methodshape
shape(): readonly [number, number]

Reads the current row and column counts.

interfaceSheetFreezeMatrixDatasource ↗
interface SheetFreezeMatrixData

Sparse serialization payload accepted by the freeze matrix.

propertydata
readonly data: number | null[]

Stored boundary counts.

propertyindices
readonly indices: number[]

Sparse row offsets.

propertyindptr
readonly indptr: number[]

Stored axis indices.

interfaceSheetFreezePluginStatesource ↗
interface SheetFreezePluginState

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

propertyfreeze
readonly freeze: SheetFreezeMatrix

Sparse freeze boundary matrix.

interfaceSheetFreezeStatesource ↗
interface SheetFreezeState

Number of leading rows and columns kept visible while scrolling.

propertycolumns
readonly columns: number

Frozen column count.

propertyrows
readonly rows: number

Frozen row count.

variableSetSheetFreezeCommandsource ↗
SetSheetFreezeCommand: SheetCommandDefinition<SheetFreezeState, SheetCommandResult>

Replaces both freeze boundaries in one transaction.

variableSheetFreezeFieldKeysource ↗
SheetFreezeFieldKey: "sheet.freeze"

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

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

Creates invertible updates for the changed freeze boundaries.

input: SheetFreezeState
source: SheetFreezeCommandSource
functionreadSheetFreezesource ↗
readSheetFreeze(dataEngine: DataEngine): SheetFreezeState

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

dataEngine: DataEngine