← All packages

API reference

@searsuite/sear-domain-cell

Cell catalogs that compose commit, display, render, and clipboard behavior.

13 exportsderived from source

classCellDisplayTextRegistrysource ↗
class CellDisplayTextRegistry

Maps persisted cell types to their display-text semantics without creating render Cells.

constructorconstructor
CellDisplayTextRegistry(platform: Platform): CellDisplayTextRegistry

Creates a CellDisplayTextRegistry instance.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving CellDisplayTextRegistry.

methodgetDisplayText
getDisplayText(cell: CellDisplayData, context: CellDisplayContext): string

Returns the display text.

cell: CellDisplayData
context: CellDisplayContext
methodregister
register(provider: CellDisplayTextProvider): (): void

Registers the value.

provider: CellDisplayTextProvider
classCellRenderDefinitionsource ↗
class CellRenderDefinition

A rendering-only sheet cell definition, such as an editor overlay or header affix.

constructorconstructor
CellRenderDefinition(): CellRenderDefinition
propertytype
readonly type: string | symbol

Stable type key for CellRenderDefinition.

methodcreateRenderer
createRenderer(): CellRendererDefinition

Creates the renderer.

classCellTypeCatalogsource ↗
class CellTypeCatalog

Workbook catalog of available persisted cell types and render-only cell roles.

Registering a definition installs all of its capabilities atomically into the specialised registries; disposing it restores the definition it replaced.

constructorconstructor
CellTypeCatalog(commitStrategies: CellCommitStrategyRegistry, displayTexts: CellDisplayTextRegistry, renderCoordinator: SheetRenderCoordinatorManager, clipboardCodecs: CellClipboardCodecRegistry, formatCodecs?: CellFormatTransferRegistry): CellTypeCatalog

Creates a catalog over the specialised commit, display-text and renderer registries.

commitStrategies: CellCommitStrategyRegistry
displayTexts: CellDisplayTextRegistry
renderCoordinator: SheetRenderCoordinatorManager
clipboardCodecs: CellClipboardCodecRegistry
formatCodecs: CellFormatTransferRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the workbook cell type catalog.

methodget
get(type: string | symbol): CellRenderDefinition | undefined

Returns the registered definition for a type key.

type: string | symbol
methodgetAll
getAll(): readonly CellRenderDefinition[]

Returns all registered definitions in insertion order.

methodgetDisplayText
getDisplayText(cell: CellDisplayData, context: CellDisplayContext): string

Resolves display text through the registered provider for a persisted cell type.

cell: CellDisplayData
context: CellDisplayContext
methodregister
register(definition: CellRenderDefinition): (): void

Registers a definition atomically and returns a disposer that restores the previous definition.

definition: CellRenderDefinition
methodunregister
unregister(type: string | symbol): boolean

Unregisters a definition by type key.

type: string | symbol
methodinstallstatic
install(container: Container): void

Registers implementation registries without exposing them from the package entry point.

container: Container
classCellTypeDefinitionsource ↗
class CellTypeDefinition extends CellRenderDefinition

A persisted spreadsheet cell type and all behaviours associated with it.

constructorconstructor
CellTypeDefinition(): CellTypeDefinition
propertytype
readonly type: string

Persisted cell type identifier stored on sheet cell data.

methodcreateClipboardCodec
createClipboardCodec(): CellClipboardCodecDefinition | undefined

Creates clipboard behavior owned by this persisted cell type.

methodcreateCommitStrategies
createCommitStrategies(): readonly CellCommitStrategyDefinition[]

Creates commit strategies associated with this cell type.

methodcreateDisplayTextProvider
createDisplayTextProvider(): CellDisplayTextProvider | undefined

Creates the display-text provider associated with this cell type.

methodcreateFormatTransferCodec
createFormatTransferCodec(): CellFormatTransferCodec | undefined

Optional format-transfer behavior owned by this cell type.

methodcreateRenderer
createRenderer(): CellRendererDefinition

Creates the renderer definition associated with this cell type.

methodisStoredValue
isStoredValue(_cell: { formula?: unknown; value?: unknown }): boolean

Validates persisted data before it reaches a renderer-specific Cell.

_cell: { formula?: unknown; value?: unknown }
interfaceCellDisplayContextsource ↗
interface CellDisplayContext

Read-only data available while deriving display text.

This deliberately does not reuse a render-cell context: measurement, copy, and search need the same cell semantics without taking a render dependency.

propertycellFormatLocale
cellFormatLocale?: CellFormatLocale
propertycol
col?: number
propertyformulaResultProvider
formulaResultProvider?: FormulaResultReader
propertyrow
row?: number
interfaceCellDisplayDatasource ↗
interface CellDisplayData

Persisted data required to derive a cell's plain-text representation.

propertyformat
format?: unknown
propertyformula
formula?: string
propertytype
type: string | symbol
propertyvalue
value?: unknown
interfaceCellDocumentFormattingsource ↗
interface CellDocumentFormatting

Pure document formatting supplied by an embedded editor implementation.

methodapply
apply(document: readonly Schema[], format: Readonly<Record<string, unknown>>): Schema[]
document: readonly Schema[]
format: Readonly<Record<string, unknown>>
methodcapture
capture(document: readonly Schema[]): Readonly<Record<string, unknown>>
document: readonly Schema[]
interfaceCellRendererDefinitionsource ↗
interface CellRendererDefinition

Render contribution belonging to one spreadsheet cell definition.

propertycellType
readonly cellType: string | symbol
methodregister
register(renderCoordinator: SheetRenderCoordinatorManager): (): void
renderCoordinator: SheetRenderCoordinatorManager
interfaceFormulaResultReadersource ↗
interface FormulaResultReader

Minimal formula-result capability required by formula display text.

methodgetFormulaResult
getFormulaResult(row: number, col: number): unknown
row: number
col: number
functioncreateFormulaCellClipboardCodecsource ↗
createFormulaCellClipboardCodec(): CellClipboardCodecDefinition

Clipboard behavior for formula source text and relative references.

functiondefineCellRenderersource ↗
defineCellRenderer<DataType, Properties>(cellType: string | symbol, cell: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<DataType>): CellRendererDefinition

Creates the standard renderer definition for a Cell subclass.

cellType: string | symbol
cell: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<DataType>
functionregisterBuiltinCellDefinitionssource ↗
registerBuiltinCellDefinitions(catalog: CellTypeCatalog): (): void

Registers built-in cell definitions and returns a disposer in reverse order.

catalog: CellTypeCatalog
functionregisterTextFormatTransferCodecssource ↗
registerTextFormatTransferCodecs(registry: CellFormatTransferRegistry, readFormatting: (): CellDocumentFormatting | undefined): (): void

Text cell type composition; numeric and formula values remain with their own codecs.

registry: CellFormatTransferRegistry
readFormatting: (): CellDocumentFormatting | undefined