API reference
@searsuite/sear-plugin-sheet-demo
A complete, optional Sheet state-owner plugin example.
17 exportsderived from source
- classSheetDemoMatrixsource ↗
-
class SheetDemoMatrix extends CSRMatrix<SheetDemoMarker | null>One marker per cell; absence and null both mean no marker.
constructorconstructor SheetDemoMatrix(data?: SheetDemoMatrixData, shape?: [number, number]): SheetDemoMatrixdata: SheetDemoMatrixDatashape: [number, number]
methodaddItem addItem(row: number, column: number, marker: SheetDemoMarker | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
row: numberThe row index.
column: numbermarker: SheetDemoMarker | null
methodsetItem setItem(row: number, column: number, marker: SheetDemoMarker | null): thisrow: numbercolumn: numbermarker: SheetDemoMarker | null
Inherited members 34
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- clone
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getItem
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- classSheetDemoPluginsource ↗
-
class SheetDemoPlugin extends SheetPlugin<SheetDemoPluginState>Reference implementation of a collaborative, matrix-backed Sheet feature.
constructorconstructor SheetDemoPlugin(state: SheetDemoPluginState): SheetDemoPluginstate: SheetDemoPluginState
propertydocumentState readonly documentState: PluginDocumentStateContribution<SheetDemoPluginState, SheetDemoPluginState>Document-state export modules owned by this plugin state.
propertyinterestedIn interestedIn: MatrixOTActionName[]Declares which Sheet OT action names this plugin is interested in. The engine will only call
applywhen a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.['uc', 'rr', 'rc']— only called for UpdateCell, ResizeRow, ResizeCol['*']— 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetDemoPluginState, SheetDemoPluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmethodapply apply(state: SheetDemoPluginState, transaction: Transaction): SheetDemoPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
state: SheetDemoPluginStatetransaction: Transaction
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidThis is an override because cell fill already has a separate owner.
registry: SheetCellVisualReaderRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters every stable command id owned by this plugin.
commands: SheetCommandBus
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes state-owner planning for same-sheet cell moves.
registry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: SheetRangeReorderRegistry
methodregisterState registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): SheetDemoMatrix; viewKey: string }[] }; key: PluginKey; state: SheetDemoPluginState }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 36
Inherited from SheetPlugin.
- depth
- pluginKey
- transactionHistory
- key
- configure
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- initialize
- lockCommittedState
- onClick
- onDblClick
- onEditorDestroy
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerCapabilities
- registerConfig
- registerFormatTransfers
- registerObservations
- registerSessionState
- registerStructureMoves
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- start
- registerServices
- interfaceSetSheetDemoMarkerInputsource ↗
-
interface SetSheetDemoMarkerInput extends SheetDemoCellInputpropertymarker readonly marker: SheetDemoMarker | null - interfaceSheetDemoCellInputsource ↗
-
interface SheetDemoCellInput - interfaceSheetDemoCommandSourcesource ↗
-
interface SheetDemoCommandSourcepropertytarget readonly target: PluginKeymethodreadMatrix readMatrix(): SheetDemoMatrix - interfaceSheetDemoMatrixDatasource ↗
-
interface SheetDemoMatrixData - interfaceSheetDemoPluginStatesource ↗
-
interface SheetDemoPluginStatepropertymarkers readonly markers: SheetDemoMatrix - typeSheetDemoMarkersource ↗
-
type SheetDemoMarker = typeof SheetDemoMarker[keyof typeof SheetDemoMarker]Canonical persisted values owned by the demo feature.
- variableReadSheetDemoMarkerQuerysource ↗
-
ReadSheetDemoMarkerQuery: SheetQueryDefinition<SheetDemoCellInput, SheetDemoMarker | null> - variableSetSheetDemoMarkerCommandsource ↗
-
SetSheetDemoMarkerCommand: SheetCommandDefinition<SetSheetDemoMarkerInput, SheetCommandResult> - variableSheetDemoFieldKeysource ↗
-
SheetDemoFieldKey: "sheet.demo.markers" - variableSheetDemoMarkersource ↗
-
SheetDemoMarker: { Approved: "approved"; Review: "review" }Canonical persisted values owned by the demo feature.
- variableSheetDemoStateTokensource ↗
-
SheetDemoStateToken: typeof SheetDemoStateTokenThe host binds one state object per Sheet editor before plugin construction.
- functionassertSheetDemoMarkersource ↗
-
assertSheetDemoMarker(value: unknown): valuevalue: unknown
- functionreadSheetDemoMarkerssource ↗
-
readSheetDemoMarkers(dataEngine: DataEngine): SheetDemoMatrix | nulldataEngine: DataEngine
- functionregisterSheetDemoCommandssource ↗
-
registerSheetDemoCommands(commands: SheetCommandBus, source: SheetDemoCommandSource): voidcommands: SheetCommandBussource: SheetDemoCommandSource
- functionregisterSheetDemoQueriessource ↗
-
registerSheetDemoQueries(queries: SheetQueryRegistry, readMatrix: (): SheetDemoMatrix): voidqueries: SheetQueryRegistryreadMatrix: (): SheetDemoMatrix
No public exports match that search.