← All packages

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): CheckboxCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
methodgetDisplayText
getDisplayText(): string

Preserves boolean editor, auto-size and plain-text semantics.

methodrender
render(): FixBoxNode<CellProperties<boolean>>

Creates a glyph only for well-formed boolean values.

Inherited members 4

Inherited from Cell.

classCheckboxCellCommitStrategysource ↗
class CheckboxCellCommitStrategy extends CellCommitStrategyDefinition

Retains checkbox identity for boolean edits, including cells governed by checkbox validation.

constructorconstructor
CheckboxCellCommitStrategy(hasRule?: (row: number, column: number): boolean): CheckboxCellCommitStrategy

Creates 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: 1100

Runs before numeric/formula/string fallbacks, only for checkbox targets.

methodcommit
commit(context: CellCommitContext): { type: "string"; value: string } | { type: string; value: boolean } | null

Produces boolean cells, clears empty edits, or leaves permitted invalid warning input as text.

context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean

Reports whether this strategy owns the target's edit semantics.

context: CellCommitContext
classCheckboxCellTypeDefinitionsource ↗
class CheckboxCellTypeDefinition extends CellTypeDefinition

Atomic catalog contribution for rendering, editing, display and clipboard behavior.

constructorconstructor
CheckboxCellTypeDefinition(hasRule?: (row: number, column: number): boolean): CheckboxCellTypeDefinition

Binds 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(): CellRendererDefinition

Registers portable glyph rendering.

methodisStoredValue
isStoredValue(cell: { value?: unknown }): boolean

Validates persisted booleans before creating a glyph.

cell: { value?: unknown }
Inherited members 1

Inherited from CellTypeDefinition.

classCheckboxErrorsource ↗
class CheckboxError extends SearError

Checkbox-specific public error with structured context.

constructorconstructor
CheckboxError(code: CheckboxErrorCode, message: string, details?: SearErrorDetails): CheckboxError

Creates a feature diagnostic.

code: CheckboxErrorCode
message: string
details: 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): CheckboxGlyphNode

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

positionRect: PositionRectProps
props: Partial<T>

Partial properties and position for initialization.

runtime: Container
methoddrawScene
drawScene(context: RenderContext, _clip?: ClipRegion): void

Paints the symbol using paths supported by every render adapter.

context: RenderContext
_clip: ClipRegion
Inherited members 42

Inherited from FixBoxNode.

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): SheetCheckboxPlugin

Installs all type capabilities atomically into the owning editor's registries.

options: SheetCheckboxOptions
propertydepth
readonly depth: -25

Intercepts glyph hits before selection and text editing.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Stateless input features need no duplicate-depth warning.

propertysymbolstatic
readonly symbol: typeof symbol

Editor-local DI token.

methodapply
apply(): null

The feature never owns or directly applies cell state.

methoddestroy
destroy(): void

Restores all replaced capabilities and releases handlers idempotently.

methodgetPluginConfig
getPluginConfig(): null

No render configuration is contributed.

methodonDblClick
onDblClick(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Consumes glyph double-clicks so they do not enter text editing.

_core: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseDown
onMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Changes a glyph through typed selection and toggle commands, never through direct matrix mutation.

_core: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers owner-targeted commands; each change is one staged cell transaction.

commands: SheetCommandBus
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

Publishes sparse range-state reads.

queries: SheetQueryRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

No independent document state is registered.

methodrender
render(): null

Glyphs are rendered by the catalog's ordinary cell renderer.

Inherited members 26

Inherited from Plugin.

interfaceCheckboxCellValuesource ↗
interface CheckboxCellValue extends CellMatrixElement

A checkbox's persisted boolean state.

propertytype
type: "checkbox"

Feature-owned cell identifier.

propertyvalue
value: boolean

Boolean used directly by formula semantics.

Inherited members 2

Inherited from CellMatrixElement.

interfaceCheckboxCellWritesource ↗
interface CheckboxCellWrite

Planned update owned by the ordinary cell-data plugin.

propertycell
readonly cell: CellMatrixElement | null

Replacement cell; null clears it.

propertycolumn
readonly column: number

Absolute column.

propertyrow
readonly row: number

Absolute row.

interfaceCheckboxRangeStatussource ↗
interface CheckboxRangeStatus

Read-only aggregate of existing checkbox states.

propertychecked
readonly checked: number

Checked checkbox count.

propertycount
readonly count: number

Well-formed checkbox count.

propertymixed
readonly mixed: boolean

Whether both states occur in the range.

propertyunchecked
readonly unchecked: number

Unchecked checkbox count.

interfaceInsertCheckboxesInputsource ↗
interface InsertCheckboxesInput extends SheetRangeInput

Converts empty or explicit boolean cells; replacement of other content requires opt-in.

propertychecked
readonly checked?: boolean

Optional forced initial state; otherwise existing boolean states are retained.

propertyreplaceExisting
readonly replaceExisting?: boolean

Explicitly replace other persisted content.

Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetCheckboxOptionssource ↗
interface SheetCheckboxOptions

Editor-local dependencies; checkbox state stays in the cell-data owner.

propertycatalog
readonly catalog: CellTypeCatalog

Cell-type extension catalog.

propertycursor
readonly cursor?: CursorRegistry

Optional editor-local cursor registry.

propertyformulas
readonly formulas?: CellFormulaValueConverterRegistry

Formula converter registry, when formula support is installed.

propertyinputValidation
readonly inputValidation?: SheetCellInputValidationRegistry

Shared cell-edit validation registry.

methodbeforeToggle
beforeToggle(): boolean

Allows the composition root to commit or reject an active edit before pointer toggling.

methodcreateTransaction
createTransaction(writes: readonly CheckboxCellWrite[]): Transaction

Creates 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): void

Visits persisted sparse entries inside the inclusive selection.

range: SheetRangeInput
visit: (cell: CellMatrixElement | null, row: number, column: number): void
methodhasCheckboxRule
hasCheckboxRule(row: number, column: number): boolean

Reports a checkbox validation rule, including cells currently showing warning text.

row: number
column: number
methodisMergedCoveredCell
isMergedCoveredCell(row: number, column: number): boolean

True when a merged range hides this coordinate behind its anchor.

row: number
column: number
methodreadCell
readCell(row: number, column: number): CellMatrixElement | null

Reads current persisted cell values.

row: number
column: 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: number
column: number
text: 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: 10000

Maximum 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): string

Formats the boolean display, editor and clipboard representation.

value: boolean
functionisCheckboxCellsource ↗
isCheckboxCell(cell: CellMatrixElement | null | undefined): cell

Reports whether a persisted value is a well-formed checkbox.

cell: CellMatrixElement | null | undefined
functionnormalizeCheckboxRangesource ↗
normalizeCheckboxRange(input: SheetRangeInput, shape: readonly [number, number]): SheetRangeInput

Validates and orders a public range without limiting sparse read traversal by viewport.

input: SheetRangeInput
shape: readonly [number, number]
functionparseCheckboxTextsource ↗
parseCheckboxText(text: string): boolean | null

Converts explicit boolean editor text without coercing numbers or other strings.

text: string