@searsuite/sear-domain-cell-types
Cell values
CellType identifies the kind of stored value. The built-in commit strategies handle text, numbers, booleans, formulas, and rich text.
- typeCellType
-
type CellType = typeof CellType[keyof typeof CellType]CellType: { Boolean: "boolean"; Empty: "empty"; Formula: "formula"; Number: "number"; RichText: "richtext"; String: "string" } - interfaceCellMatrixElement
-
Persisted cell payload stored in the sheet matrix.
property formula?: stringFormula source text for formula cells; calculated results live in formula plugin state.
property formulaEvaluationMode?: "dynamic" | "legacy"Array evaluation mode used when the formula was entered.
property type: stringCell type identifier owned by the cell type catalog.
property value?: unknownRaw value whose shape is owned by the cell type.
Formatting and displayed values
Formatting turns a stored value into display text. CellFormat and the alignment values describe presentation without changing the underlying value.
- interfaceICellFormatLocaleProvider
-
interface ICellFormatLocaleProviderICellFormatLocaleProvider: unknownProvides sheet-local defaults for number and date/time display formatting.
method getCellFormatLocale(): CellFormatLocalevariablesymbol symbol: typeof symbol - enumSheetHorizontalAlignment
-
Horizontal alignment values supported by the built-in Sheet alignment feature.
- enumSheetVerticalAlignment
-
Vertical alignment values supported by the built-in Sheet alignment feature.
- classCellFormatTransferRegistry
-
Editor-local cell-format codecs; unregistered types preserve their payload verbatim.
constructor CellFormatTransferRegistry(): CellFormatTransferRegistryproperty readonly symbol: typeof symbolstaticmethod apply(cell: CellMatrixElement | null, format: Readonly<Record<string, unknown>>): CellMatrixElement | nullmethod capture(cell: CellMatrixElement | null): Readonly<Record<string, unknown>>method destroy(): voidmethod register(codec: CellFormatTransferCodec): (): void - classSheetDisplayedValueChanges
-
Editor-local fanout for changes to displayed cell values.
constructor SheetDisplayedValueChanges(warn: (error: unknown): void): SheetDisplayedValueChangesproperty readonly symbol: typeof symbolstaticmethod dispose(): voidmethod enforceCommandBoundary(isExecuting: (): boolean, runWithoutMutationAuthority: <Value>(callback: (): Value): Value): voidSeals publishing after startup while keeping host listeners outside command authority.
method publish(cells: readonly SheetDisplayedValueCoordinate[]): voidmethod subscribe(listener: SheetDisplayedValueChangeListener): (): void - interfaceCellFormatLocale
-
Locale defaults used when a cell format does not declare explicit display settings.
property readonly datePattern: stringproperty readonly dateTimePattern: stringproperty readonly decimalSeparator?: stringproperty readonly groupSeparator?: stringproperty readonly locale: stringproperty readonly timePattern: string - interfaceCellFormatTransferCodec
-
Type-owned format projection that never substitutes source values for target values.
- interfaceSheetDisplayedValueCoordinate
-
A cell whose displayed value changed after a derived value update.
property readonly column: numberproperty readonly row: number - typeCellFormat
-
type CellFormat = { kind: "general" } | { kind: "text" } | { code: string; kind: "excelCode" } | { kind: "number"; locale?: string; maximumFractionDigits?: number; minimumFractionDigits?: number; useGrouping?: boolean } | { kind: "percent"; locale?: string; maximumFractionDigits?: number; minimumFractionDigits?: number } | { currency: string; kind: "currency"; locale?: string; maximumFractionDigits?: number; minimumFractionDigits?: number } | { kind: "date"; pattern?: string } | { kind: "time"; pattern?: string } | { kind: "dateTime"; pattern?: string }Cell formatting changes input interpretation and display only, never the raw value for display purposes.
- typeSheetDisplayedValueChangeListener
-
type SheetDisplayedValueChangeListener = (cells: readonly SheetDisplayedValueCoordinate[]): void - variableCellFormats
-
CellFormats: { date: { kind: "date" }; dateTime: { kind: "dateTime" }; general: { kind: "general" }; number: { kind: "number" }; percent: { kind: "percent" }; text: { kind: "text" }; time: { kind: "time" }; currency: unknown; … } - variableDefaultCellFormatLocale
-
DefaultCellFormatLocale: CellFormatLocaleExcel-compatible formatting defaults used when no i18n plugin is installed.
- functionadjustCellFormatDecimalPlaces
-
adjustCellFormatDecimalPlaces(format: unknown, delta: number): CellFormatAdjusts the visible decimal-place count of numeric built-in formats.
- functionassertSheetHorizontalAlignment
-
assertSheetHorizontalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet horizontal alignments.
- functionassertSheetVerticalAlignment
-
assertSheetVerticalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet vertical alignments.
- functioncellFormatToExcelCode
-
cellFormatToExcelCode(format: unknown): string | undefinedConverts an explicit cell format into the Excel-style code exposed to formula metadata readers.
- functioncreateDefaultCellFormatLocaleProvider
-
createDefaultCellFormatLocaleProvider(): ICellFormatLocaleProviderCreates the default cell-format locale provider.
- functioncreateGeneralNumberDisplayCandidates
-
createGeneralNumberDisplayCandidates(value: number): readonly string[]Returns General-format candidates from most informative to most compact.
- functionformatCellNumber
-
formatCellNumber(value: number, format: unknown, locale?: CellFormatLocale): string - functionformatCellNumberDisplay
-
formatCellNumberDisplay(value: number, format: unknown, locale?: CellFormatLocale): SpreadsheetFormatDisplayFormats one numeric cell and preserves format-section visual metadata.
- functionformatCellText
-
formatCellText(value: string, format: unknown, locale?: CellFormatLocale): stringApplies the fourth custom-format section to a text cell.
- functioninterpretNumberInput
-
interpretNumberInput(source: string, currentFormat: CellFormat | null | undefined, locale?: CellFormatLocale): { format?: CellFormat; value: number } | nullParses direct numeric/date input and suggests a display format for General cells.
- functionisSheetHorizontalAlignment
-
isSheetHorizontalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet horizontal alignment.
- functionisSheetVerticalAlignment
-
isSheetVerticalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet vertical alignment.
- functionnormalizeCellFormat
-
normalizeCellFormat(value: unknown): CellFormatNormalizes a public CellFormat object, falling back to General for invalid input.
- functionparseFormattedNumber
-
parseFormattedNumber(text: string, format: unknown, locale?: CellFormatLocale): number | undefined
Input and commit
A commit strategy interprets an edit before it enters Sheet state. Input validators can reject values that do not meet a feature’s rule.
- classBooleanCellCommitStrategy
-
class BooleanCellCommitStrategy extends CellCommitStrategyRecognizes directly entered spreadsheet logical literals.
constructor BooleanCellCommitStrategy(): BooleanCellCommitStrategyproperty readonly key: "boolean"Stable identifier for this commit strategy.
property readonly priority: 20Ordering priority used when more than one strategy matches.
method commit(context: CellCommitContext): CellMatrixElementConverts matching edit input into a persisted cell value.
method matches(context: CellCommitContext): booleanReports whether this strategy can commit the supplied input.
- classCellCommitStrategy
-
class CellCommitStrategy extends CellCommitStrategyDefinitionBase class for reusable strategies; plain definitions can also be registered.
constructor CellCommitStrategy(): CellCommitStrategyproperty readonly key: stringStable identifier for this commit strategy.
property readonly priority: numberOrdering priority used when more than one strategy matches.
method commit(context: CellCommitContext): CellMatrixElement | nullConverts matching edit input into a persisted cell value.
method matches(context: CellCommitContext): booleanReports whether this strategy can commit the supplied input.
- classCellCommitStrategyRegistry
-
Extensible value-type registry. Hosts and plugins can add or replace input classifiers without coupling their domain types to the cell editor.
constructor CellCommitStrategyRegistry(): CellCommitStrategyRegistryproperty readonly symbol: typeof symbolstaticDI token for resolving CellCommitStrategyRegistry.
method commit(context: CellCommitContext): CellMatrixElement | nullSelects a matching strategy and commits the supplied edit input.
method commitWithFormat(context: CellCommitContext): { cell: CellMatrixElement | null; format: CellFormat | null }Commits a value and returns any format inferred by its owning strategy.
method get(key: string): CellCommitStrategyDefinition | undefinedmethod getAll(): readonly CellCommitStrategyDefinition[]Returns the all.
method register(strategy: CellCommitStrategyDefinition): (): voidRegisters or replaces a strategy. The returned disposer restores the replaced strategy when this registration remains active.
method unregister(key: string): booleanUnregisters the value.
- classDefaultStringCellCommitStrategy
-
class DefaultStringCellCommitStrategy extends CellCommitStrategyFinal fallback: persist otherwise-unclassified input as plain text.
constructor DefaultStringCellCommitStrategy(): DefaultStringCellCommitStrategyproperty readonly key: "fallback-string"Stable identifier for the default string strategy.
property readonly priority: 0Ordering priority for the default string fallback.
method commit(context: CellCommitContext): CellMatrixElementPersists unmatched input as a string cell.
method matches(): booleanMatches input not claimed by a more specific strategy.
- classEmptyCellCommitStrategy
-
class EmptyCellCommitStrategy extends CellCommitStrategyRemoves a cell when its editor document has no semantic text.
constructor EmptyCellCommitStrategy(): EmptyCellCommitStrategyproperty readonly key: "empty"Stable identifier for the empty-cell strategy.
property readonly priority: 100Ordering priority for empty input.
method commit(): nullConverts empty input into an absent cell value.
method matches(context: CellCommitContext): booleanReports whether the input should clear the cell.
- classFormulaCellCommitStrategy
-
class FormulaCellCommitStrategy extends CellCommitStrategyRecognizes formula source and normalizes it before persistence.
constructor FormulaCellCommitStrategy(): FormulaCellCommitStrategyproperty readonly key: "formula"Stable identifier for the formula strategy.
property readonly priority: 90Ordering priority for formula input.
method commit(context: CellCommitContext): CellMatrixElementPersists formula source without evaluating it.
method matches(context: CellCommitContext): booleanReports whether the input is formula source.
- classNumberCellCommitStrategy
-
class NumberCellCommitStrategy extends CellCommitStrategyInfers numeric values after more-specific domain types have had a chance to match.
constructor NumberCellCommitStrategy(): NumberCellCommitStrategyproperty readonly key: "number"Stable identifier for the number strategy.
property readonly priority: 10Ordering priority for numeric input.
method commit(context: CellCommitContext): CellMatrixElementPersists input as a numeric cell.
method inferFormat(context: CellCommitContext): CellFormat | nullmethod matches(context: CellCommitContext): booleanReports whether the input is a valid numeric value.
- classRichTextCellCommitStrategy
-
class RichTextCellCommitStrategy extends CellCommitStrategyPersists the document tree only when it contains durable inline/block semantics.
constructor RichTextCellCommitStrategy(): RichTextCellCommitStrategyproperty readonly key: "richtext"Stable identifier for the rich-text strategy.
property readonly priority: 110Ordering priority for rich-text input.
method commit(context: CellCommitContext): CellMatrixElementPersists a cloned rich-document snapshot.
method matches(context: CellCommitContext): booleanReports whether the input is a rich-document snapshot.
- classSheetCellInputValidationRegistry
-
Editor-local validation contributions, evaluated before a cell edit commits.
constructor SheetCellInputValidationRegistry(): SheetCellInputValidationRegistryproperty readonly symbol: typeof symbolstaticmethod beginTeardown(token: object): voidAllows owner-controlled cleanup after command dispatch has ended.
method enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void, teardownToken: object): voidCloses direct writes once the editor finishes starting.
method register(id: string, validator: SheetCellInputValidator): (): voidmethod unregister(registrationId: number): voidRemoves one registration, dispatching through its command after assembly.
method validate(row: number, column: number, text: string): SheetCellInputValidationResult - classTextCellCommitStrategy
-
class TextCellCommitStrategy extends CellCommitStrategyHandles explicit text input: Text-format cells and apostrophe-prefixed values.
constructor TextCellCommitStrategy(): TextCellCommitStrategyproperty readonly key: "string"Stable identifier for the explicit text strategy.
property readonly priority: 80Ordering priority for explicit text input.
method commit(context: CellCommitContext): CellMatrixElementPersists input as an explicit text cell.
method matches(context: CellCommitContext): booleanReports whether the input is explicitly typed as text.
- interfaceCellCommitContext
-
Input available when the cell editor commits one edited cell.
property col: numberproperty format?: CellFormat | nullExplicit format read from the Sheet cell-format state owner.
property formatLocale?: CellFormatLocaleLocale used to interpret the formatted editor text.
property plainText: stringproperty previous: CellMatrixElement | nullproperty richText: RichDocNode[]property row: number - interfaceCellCommitStrategyDefinition
-
Contract for deciding how editor input becomes persisted cell data.
- interfaceSheetCellInputValidationResult
-
Result of validating a proposed cell edit.
property readonly message?: stringproperty readonly reject: booleanproperty readonly ruleId?: stringproperty readonly valid: boolean - typeSheetCellInputValidator
-
type SheetCellInputValidator = (row: number, column: number, text: string): SheetCellInputValidationResult - functionassertCellExtensionWrite
-
assertCellExtensionWrite(owner: object): voidChecks registration changes only; cell reads and rendering stay on their existing hot paths.
- functionsealCellExtensionWrites
-
sealCellExtensionWrites(owner: object, assertWrite: (): void): voidSeals an editor-local cell extension owner after setup contributions are registered.
Clipboard transfer
Clipboard codecs preserve type-specific values when cells are copied and pasted.
- classCellClipboardCodecRegistry
-
Editor-local registry for cell-type-owned clipboard behavior.
constructor CellClipboardCodecRegistry(): CellClipboardCodecRegistryproperty readonly symbol: typeof symbolstaticmethod decode(payload: CellClipboardCellPayload, context: CellClipboardDecodeContext): CellMatrixElement | nullmethod decodePlainText(text: string): CellMatrixElement | nullmethod encode(cell: CellMatrixElement): CellClipboardCellPayloadmethod get(cellType: string): CellClipboardCodecDefinition | undefinedmethod register(codec: CellClipboardCodecDefinition): (): voidmethod toPlainText(cell: CellMatrixElement): string - interfaceCellClipboardCellPayload
-
JSON-safe representation owned by the cell type that produced it.
property readonly data: unknownproperty readonly type: string - interfaceCellClipboardCodecDefinition
-
Clipboard behavior contributed by one persisted cell type.
property readonly cellType: stringmethod decode(data: unknown, context: CellClipboardDecodeContext): CellMatrixElement | nullmethod decodePlainText(text: string): CellMatrixElement | nullmethod encode(cell: CellMatrixElement): unknownmethod rebase(cell: CellMatrixElement, context: CellClipboardDecodeContext): CellMatrixElementmethod toPlainText(cell: CellMatrixElement): string - interfaceCellClipboardDecodeContext
-
Context used by a cell type when a native clipboard cell is pasted elsewhere.
property readonly columnDelta: numberproperty readonly rowDelta: number
No matching API entries.