API reference
@searsuite/sear-plugin-checkbox
Portable boolean checkbox cell type, typed commands and stateless Sheet integration.
27 exportsderived from source
- classCheckboxCellsource ↗
-
class CheckboxCell extends Cell<CellProperties<boolean>>Renders a centered symbol while leaving the rest of the cell available for selection.
constructorconstructor CheckboxCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): CheckboxCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
methodgetDisplayText getDisplayText(): stringPreserves boolean editor, auto-size and plain-text semantics.
methodrender render(): FixBoxNode<CellProperties<boolean>>Creates a glyph only for well-formed boolean values.
- classCheckboxCellCommitStrategysource ↗
-
class CheckboxCellCommitStrategy extends CellCommitStrategyDefinitionRetains checkbox identity for boolean edits, including cells governed by checkbox validation.
constructorconstructor CheckboxCellCommitStrategy(hasRule?: (row: number, column: number): boolean): CheckboxCellCommitStrategyCreates a target predicate owned by the current editor.
hasRule: (row: number, column: number): boolean
propertykey readonly key: "checkbox"Stable editor-local strategy identity.
propertypriority readonly priority: 1100Runs before numeric/formula/string fallbacks, only for checkbox targets.
methodcommit commit(context: CellCommitContext): { type: "string"; value: string } | { type: string; value: boolean } | nullProduces boolean cells, clears empty edits, or leaves permitted invalid warning input as text.
context: CellCommitContext
methodmatches matches(context: CellCommitContext): booleanReports whether this strategy owns the target's edit semantics.
context: CellCommitContext
- classCheckboxCellTypeDefinitionsource ↗
-
class CheckboxCellTypeDefinition extends CellTypeDefinitionAtomic catalog contribution for rendering, editing, display and clipboard behavior.
constructorconstructor CheckboxCellTypeDefinition(hasRule?: (row: number, column: number): boolean): CheckboxCellTypeDefinitionBinds rule-aware edit conversion to one editor.
hasRule: (row: number, column: number): boolean
propertytype readonly type: "checkbox"Persisted feature identifier.
methodcreateClipboardCodec createClipboardCodec(): { cellType: string; decode: (data: unknown): { type: string; value: boolean } | null; encode: (cell: { value?: unknown }): { value: unknown }; toPlainText: (cell: { value?: unknown }): string }Preserves checkbox identity on native copies; plain text remains TRUE/FALSE.
methodcreateCommitStrategies createCommitStrategies(): CheckboxCellCommitStrategy[]Creates the checkbox edit strategy.
methodcreateDisplayTextProvider createDisplayTextProvider(): { cellType: string; getDisplayText: (cell: { value?: unknown }): string }Provides stable boolean text for searches and measurements.
methodcreateRenderer createRenderer(): CellRendererDefinitionRegisters portable glyph rendering.
methodisStoredValue isStoredValue(cell: { value?: unknown }): booleanValidates persisted booleans before creating a glyph.
cell: { value?: unknown }
- classCheckboxErrorsource ↗
-
class CheckboxError extends SearErrorCheckbox-specific public error with structured context.
constructorconstructor CheckboxError(code: CheckboxErrorCode, message: string, details?: SearErrorDetails): CheckboxErrorCreates a feature diagnostic.
code: CheckboxErrorCodemessage: stringdetails: SearErrorDetails
Inherited members 10
Inherited from SearError.
- classCheckboxGlyphNodesource ↗
-
class CheckboxGlyphNode extends FixBoxNode<CellProperties<boolean>>Portable checkbox symbol; its own bounds are the pointer hit region.
constructorconstructor CheckboxGlyphNode(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): CheckboxGlyphNodeConstructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
positionRect: PositionRectPropsprops: Partial<T>Partial properties and position for initialization.
runtime: Container
methoddrawScene drawScene(context: RenderContext, _clip?: ClipRegion): voidPaints the symbol using paths supported by every render adapter.
context: RenderContext_clip: ClipRegion
Inherited members 42
Inherited from FixBoxNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classSheetCheckboxPluginsource ↗
-
class SheetCheckboxPlugin extends Plugin<unknown, CellProperties, null>Stateless feature; persistent values, history and collaboration belong to the ordinary cell owner.
constructorconstructor SheetCheckboxPlugin(options: SheetCheckboxOptions): SheetCheckboxPluginInstalls all type capabilities atomically into the owning editor's registries.
options: SheetCheckboxOptions
propertydepth readonly depth: -25Intercepts glyph hits before selection and text editing.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseStateless input features need no duplicate-depth warning.
propertysymbolstatic readonly symbol: typeof symbolEditor-local DI token.
methodapply apply(): nullThe feature never owns or directly applies cell state.
methoddestroy destroy(): voidRestores all replaced capabilities and releases handlers idempotently.
methodgetPluginConfig getPluginConfig(): nullNo render configuration is contributed.
methodonDblClick onDblClick(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidConsumes glyph double-clicks so they do not enter text editing.
_core: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseDown onMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidChanges a glyph through typed selection and toggle commands, never through direct matrix mutation.
_core: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters owner-targeted commands; each change is one staged cell transaction.
commands: SheetCommandBus
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidPublishes sparse range-state reads.
queries: SheetQueryRegistry
methodregisterState registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }No independent document state is registered.
methodrender render(): nullGlyphs are rendered by the catalog's ordinary cell renderer.
Inherited members 26
Inherited from Plugin.
- documentState
- interestedIn
- pluginKey
- transactionHistory
- transactionOT
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onInitialDataCell
- onInitialDataComplete
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfaceCheckboxCellValuesource ↗
-
interface CheckboxCellValue extends CellMatrixElementA checkbox's persisted boolean state.
- interfaceCheckboxCellWritesource ↗
-
interface CheckboxCellWritePlanned update owned by the ordinary cell-data plugin.
- interfaceCheckboxRangeStatussource ↗
-
interface CheckboxRangeStatusRead-only aggregate of existing checkbox states.
- interfaceInsertCheckboxesInputsource ↗
-
interface InsertCheckboxesInput extends SheetRangeInputConverts empty or explicit boolean cells; replacement of other content requires opt-in.
propertychecked readonly checked?: booleanOptional forced initial state; otherwise existing boolean states are retained.
propertyreplaceExisting readonly replaceExisting?: booleanExplicitly replace other persisted content.
- interfaceSheetCheckboxOptionssource ↗
-
interface SheetCheckboxOptionsEditor-local dependencies; checkbox state stays in the cell-data owner.
propertycatalog readonly catalog: CellTypeCatalogCell-type extension catalog.
propertycursor readonly cursor?: CursorRegistryOptional editor-local cursor registry.
propertyformulas readonly formulas?: CellFormulaValueConverterRegistryFormula converter registry, when formula support is installed.
propertyinputValidation readonly inputValidation?: SheetCellInputValidationRegistryShared cell-edit validation registry.
methodbeforeToggle beforeToggle(): booleanAllows the composition root to commit or reject an active edit before pointer toggling.
methodcreateTransaction createTransaction(writes: readonly CheckboxCellWrite[]): TransactionCreates a semantic cell-owner transaction without mutating live data.
writes: readonly CheckboxCellWrite[]
methodforEachStored forEachStored(range: SheetRangeInput, visit: (cell: CellMatrixElement | null, row: number, column: number): void): voidVisits persisted sparse entries inside the inclusive selection.
range: SheetRangeInputvisit: (cell: CellMatrixElement | null, row: number, column: number): void
methodhasCheckboxRule hasCheckboxRule(row: number, column: number): booleanReports a checkbox validation rule, including cells currently showing warning text.
row: numbercolumn: number
methodisMergedCoveredCell isMergedCoveredCell(row: number, column: number): booleanTrue when a merged range hides this coordinate behind its anchor.
row: numbercolumn: number
methodreadCell readCell(row: number, column: number): CellMatrixElement | nullReads current persisted cell values.
row: numbercolumn: number
methodreadShape readShape(): readonly [number, number]Reads current Sheet dimensions.
methodvalidateValue validateValue(row: number, column: number, text: string): { message?: string; reject: boolean }Rejects incompatible existing validation on direct checkbox commands.
row: numbercolumn: numbertext: string
- typeCheckboxErrorCodesource ↗
-
type CheckboxErrorCode = typeof CheckboxErrorCode[keyof typeof CheckboxErrorCode]One checkbox diagnostic identity.
- typeCheckboxRemovalModesource ↗
-
type CheckboxRemovalMode = typeof CheckboxRemovalMode[keyof typeof CheckboxRemovalMode]One supported removal policy.
- variableCheckboxCellTypesource ↗
-
CheckboxCellType: "checkbox"Stable persisted identifier owned by the checkbox extension.
- variableCheckboxErrorCodesource ↗
-
CheckboxErrorCode: { Conflict: "CHECKBOX_CONTENT_CONFLICT"; Invalid: "CHECKBOX_INVALID"; Limit: "CHECKBOX_RANGE_LIMIT" }Stable checkbox diagnostic codes.
- variableCheckboxGlyphRolesource ↗
-
CheckboxGlyphRole: { Checked: "checked"; Unchecked: "unchecked" }Stable semantic state roles used by checkbox render targets and diagnostics.
- variableCheckboxMutationLimitsource ↗
-
CheckboxMutationLimit: 10000Maximum number of persisted cells one checkbox command can change.
- variableCheckboxRemovalModesource ↗
-
CheckboxRemovalMode: { Clear: "clear"; Text: "text" }Removal policies shared by command inputs and hosts.
- variableInsertCheckboxesCommandsource ↗
-
InsertCheckboxesCommand: SheetCommandDefinition<InsertCheckboxesInput, SheetCommandResult>Inserts checkbox cells in one cell-owner transaction.
- variableReadCheckboxRangeQuerysource ↗
-
ReadCheckboxRangeQuery: SheetQueryDefinition<SheetRangeInput, CheckboxRangeStatus>Reads sparse checkbox state without traversing every empty coordinate.
- variableRemoveCheckboxesCommandsource ↗
-
RemoveCheckboxesCommand: SheetCommandDefinition<SheetRangeInput & { mode?: CheckboxRemovalMode }, SheetCommandResult>Converts only existing checkbox cells to text or clears them.
- variableSetCheckboxesCommandsource ↗
-
SetCheckboxesCommand: SheetCommandDefinition<SheetRangeInput & { checked: boolean }, SheetCommandResult>Sets only existing checkbox cells in the range.
- variableToggleCheckboxesCommandsource ↗
-
ToggleCheckboxesCommand: SheetCommandDefinition<SheetRangeInput, SheetCommandResult>Checks a mixed/unchecked range, or unchecks an entirely checked range.
- functioncheckboxTextsource ↗
-
checkboxText(value: boolean): stringFormats the boolean display, editor and clipboard representation.
value: boolean
- functionisCheckboxCellsource ↗
-
isCheckboxCell(cell: CellMatrixElement | null | undefined): cellReports whether a persisted value is a well-formed checkbox.
cell: CellMatrixElement | null | undefined
- functionnormalizeCheckboxRangesource ↗
-
normalizeCheckboxRange(input: SheetRangeInput, shape: readonly [number, number]): SheetRangeInputValidates and orders a public range without limiting sparse read traversal by viewport.
input: SheetRangeInputshape: readonly [number, number]
- functionparseCheckboxTextsource ↗
-
parseCheckboxText(text: string): boolean | nullConverts explicit boolean editor text without coercing numbers or other strings.
text: string
No public exports match that search.