← All packages

@searsuite/sear-render-registry

Cell renderers

classAffixCell
class AffixCell extends Cell<CellProperties<string | number | null | SheetDocumentNode>>

Rendering-only cell used for fixed row/column header affixes.

constructorAffixCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): AffixCell
propertyreadonly symbol: symbolstatic

Built-in affix cell type symbol.

methodgetDisplayText(): string

Returns plain display text for numeric/string labels and rich header content.

methodrender(): Node<CellProperties<string | number | Schema | null>> | Node<CellProperties<string | number | Schema | null>>[]

Renders the affix background and optional text content.

Inherited members 4

Inherited from Cell.

classBooleanCell
class BooleanCell extends Cell<CellProperties<boolean>>

Draws a persisted logical cell using spreadsheet TRUE/FALSE labels.

constructorBooleanCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): BooleanCell
propertyreadonly symbol: typeof symbolstatic
methodgetDisplayText(): string

Returns this cell's plain-text representation for:

  • Automatic column-width and row-height measurement (SheetResizePlugin).
  • Non-rendering workflows such as copy/paste and find/replace.

Each subclass implements its own semantics, so callers do not need type switches.

methodrender(): Node<CellProperties<boolean>> | Node<CellProperties<boolean>>[]

Renders Cell scene output.

Inherited members 4

Inherited from Cell.

classCell
class Cell<T>

Base render node for a projected Sheet cell.

constructorCell<T>(data: T, positionRect: PositionRectProps, properties: T, context?: CellContext): Cell<T>
propertyreadonly context: CellContext
propertyreadonly data: T
propertyreadonly positionRect: PositionRectProps
propertyreadonly properties: T
methodgetDisplayText(): string

Returns this cell's plain-text representation for:

  • Automatic column-width and row-height measurement (SheetResizePlugin).
  • Non-rendering workflows such as copy/paste and find/replace.

Each subclass implements its own semantics, so callers do not need type switches.

methodrender(): Node<T> | Node<T>[]

Renders Cell scene output.

classEditorCell
class EditorCell extends Cell<CellProperties<SheetDocumentNode[]>>

Rendering-only cell used by the inline rich-text editor overlay.

constructorEditorCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EditorCell
propertyreadonly symbol: symbolstatic

Built-in editor cell type symbol.

methodgetDisplayText(): string

Extracts plain text from the editor document.

methodrender(): Node<CellProperties<Schema[]>> | Node<CellProperties<Schema[]>>[]

Renders editor content, marking edit-mode nodes as overlay content when needed.

Inherited members 4

Inherited from Cell.

classEmptyCell
class EmptyCell extends Cell<CellProperties<null>>

Renderer for empty persisted cells and active empty editor cells.

constructorEmptyCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EmptyCell
propertyreadonly symbol: symbolstatic

Built-in empty cell type symbol.

methodgetDisplayText(): string

Empty cells have no display text.

methodrender(): Node<CellProperties<null>> | Node<CellProperties<null>>[]

Renders an empty box or editable rich-text placeholder.

Inherited members 4

Inherited from Cell.

classFormulaCell
class FormulaCell extends Cell<CellProperties<string>>

Renders the calculated projection of a formula cell.

Inherited members 4

Inherited from Cell.

classNumberCell
class NumberCell extends Cell<CellProperties<number>>

Renders a persisted numeric value without converting its storage type to text.

Inherited members 4

Inherited from Cell.

classRichTextCell
class RichTextCell extends Cell<CellProperties<SheetDocumentNode[]>>

Renderer for persisted rich-text cell values.

constructorRichTextCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): RichTextCell
propertyreadonly symbol: symbolstatic

Built-in rich-text cell type symbol.

methodgetDisplayText(): string

Extracts plain text from the rich-text document.

methodrender(): Node<CellProperties<Schema[]>> | Node<CellProperties<Schema[]>>[]

Renders a rich-text document inside the cell bounds.

Inherited members 4

Inherited from Cell.

classStringCell
class StringCell extends Cell<CellProperties<string>>

Renderer for persisted plain-string cell values.

constructorStringCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): StringCell
propertyreadonly symbol: symbolstatic

Built-in string cell type symbol.

methodgetDisplayText(): string

Returns the stored string value for measurement and formula display.

methodrender(): Node<CellProperties<string>> | Node<CellProperties<string>>[]

Renders text content inside a standard cell box.

Inherited members 4

Inherited from Cell.

interfaceCellContext

Cell construction context injected by callers such as SheetGridRender and SheetResizePlugin. It lets Cell subclasses access external services on demand and avoids caller-side type switches.

Design principle: adding a cell type or external service should not require callers to add if/else branches. Callers add the service to CellContext, and the corresponding Cell subclass reads it.

The current capabilities are explicit read-only rendering dependencies. Do not pass a DI container or generic service locator into Cell; that would make Cell implicitly depend on the entire application service graph.

propertycellFormatLocale?: CellFormatLocale

Sheet-local defaults for formatting numbers and date/time serials.

propertycol?: number

Current cell column index (0-based); optional for non-grid cells.

propertyformulaResultProvider?: IFormulaResultProvider

Read-only access to derived formula results; optional when formulas are disabled.

propertyrow?: number

Current cell row index (0-based); optional for non-grid cells.

typeCellProperties
type CellProperties = NodeProperties & { endColIndex?: number; endRowIndex?: number; format?: unknown; isEdit?: boolean; region?: CellRegion; startColIndex?: number; startRowIndex?: number; type: string | symbol; … }
typeCellRegion
type CellRegion = typeof CellRegion[keyof typeof CellRegion] CellRegion: { ColumnHeader: "column-header"; Corner: "corner"; Grid: "grid"; RowHeader: "row-header" }
typeCellRenderType
type CellRenderType = typeof CellRenderType[keyof typeof CellRenderType] CellRenderType: { Affix: "affix"; Editor: "rich_text" }
functionextractRichText
extractRichText(value: unknown): string

Extracts plain text from persisted rich-text content.

functionformatFormulaValue
formatFormulaValue(value: unknown): string

Formats formula results consistently for rendering and measurement.

interfaceIFormulaResultProvider

Read-only provider for calculated formula results.

Rendering and other consumers use this interface to read per-client derived formula values without depending on a concrete formula plugin implementation.

methodforEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Visits calculated result coordinates in an inclusive range. Providers that project results into cells without persisted data must implement this so range consumers can discover those cells without probing empty positions.

methodgetFormulaResult(row: number, col: number): FormulaValue | undefined

Gets the calculated result for a formula anchor or one of its dynamic-array spill cells.

ReturnsFormulaValue, or undefined when not calculated or not a formula cell.

row

Row index (0-based).

col

Column index (0-based).

Renderer registration

Registries connect cell behavior and visual readers to a Sheet renderer. The coordinator manages those registrations for an editor.

classNodeFactory
class NodeFactory<NodeType>

Factory contract for creating renderable cell/node instances by data type.

constructorNodeFactory<NodeType>(): NodeFactory<NodeType>
propertyreadonly symbol: symbolstatic

DI token for resolving the active node factory.

methodcreate<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeType

Creates a node instance for typed data.

ReturnsCreated node instance.

data

Persisted or rendering-only cell data.

positionRect

Node bounds.

properties

Render properties passed to the node.

context

Optional cell rendering context.

methodregister<DataType, Properties>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeType): (): void

Registers a constructor for a cell or node type.

ReturnsDisposer that restores the previous registration.

type

Type identifier used by incoming data.

ctor

Constructor used to create the node.

classRenderCoordinatorManager

Coordinates cell creation and rendering for a concrete renderer registry.

constructorRenderCoordinatorManager(): RenderCoordinatorManager
propertyreadonly symbol: symbolstatic

DI token for resolving the active render coordinator manager.

methodcreate<T>(): T

Creates a cell instance from registered type metadata.

methodregisterRenderer(): void

Registers renderer functions supported by the coordinator.

methodregisterType(): void

Registers cell/node types supported by the coordinator.

methodrender<T>(): Node<T> | Node<T>[]

Renders an already-created cell or node.

methodrenderCell<T>(): Node<T> | Node<T>[]

Creates and renders a cell from type and render properties.

classRendererRegistry
class RendererRegistry<RegistryProperties>

Registry contract for mapping typed render inputs to scene nodes.

constructorRendererRegistry<RegistryProperties>(): RendererRegistry<RegistryProperties>
propertyreadonly symbol: symbolstatic

DI token for resolving the active renderer registry.

methodregisterRenderer(type: unknown, rendererFn: (input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]): (): void

Registers a renderer function for one input type.

ReturnsDisposer that removes or restores the registration.

type

Type identifier owned by the cell or feature domain.

rendererFn

Function that converts input into scene nodes.

methodrender(input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]

Renders a registered input.

ReturnsScene node or nodes produced by the registered renderer.

input

Input accepted by the concrete registry implementation.

classSheetCellVisualReaderRegistry

Composes editor-local, plugin-owned visual properties for Sheet cells.

constructorSheetCellVisualReaderRegistry(): SheetCellVisualReaderRegistry
propertyreadonly symbol: typeof symbolstatic

DI token for the editor-local registry.

methoddestroy(): void

Removes all editor-local reader registrations.

methodnextConditionalPriority(): number

Allocates an order after every registered conditional rule owner.

methodread(position: SheetCellVisualReadPosition): Partial<CellProperties>

Reads and combines every registered visual contribution for one cell.

methodreadVisual(position: SheetCellVisualReadPosition): { layers: readonly CellVisualLayer[]; properties: Partial<CellProperties> }

Composes base properties, matched rules and visual layers in one pass.

methodregister(reader: SheetCellVisualReader): (): void

Registers one reader and rejects duplicate ids or property ownership.

methodregisterConditional(reader: SheetCellConditionalVisualReader): (): void

Registers a rule source whose matches are composed across feature plugins.

methodregisterOverride(reader: SheetCellVisualOverride): (): void

Registers explicit-priority overrides without acquiring base property ownership.

classSheetNodeFactory
class SheetNodeFactory extends NodeFactory<Cell<CellProperties<unknown>>>

Default NodeFactory implementation for sheet cells.

constructorSheetNodeFactory(): SheetNodeFactory
methodcreate<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>

ReturnsCreated Cell instance.

data

Cell data carrying a type identifier.

positionRect

Cell bounds.

properties

Render properties.

context

Optional cell rendering context.

methodregister<DataType, Properties>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>): (): void

Registers a cell constructor for one sheet cell type.

ReturnsDisposer that restores the previous constructor for this type.

type

Cell type identifier.

ctor

Cell constructor used to create render cells.

classSheetRenderCoordinatorManager

Coordinates cell projection and rendering for a Sheet frame.

constructorSheetRenderCoordinatorManager(nodeFactory: SheetNodeFactory, rendererRegistry: SheetRendererRegistry<CellProperties>, formulaResultProvider: IFormulaResultProvider, platform?: Platform | undefined, cellFormatLocaleProvider?: ICellFormatLocaleProvider): SheetRenderCoordinatorManager
propertyreadonly nodeFactory: SheetNodeFactory
propertyreadonly rendererRegistry: SheetRendererRegistry<CellProperties>
propertyreadonly symbol: symbolstatic

DI token for resolving SheetRenderCoordinatorManager.

methodcreate<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Cell<T> | undefined

Creates the value.

methodcreateCellContext(row?: number, col?: number): CellContext

Builds the explicit, read-only context shared by render and measurement paths.

methodregisterCell<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): void

Registers a cell constructor and its default Cell.render() adapter together.

methodregisterRenderer<T>(type: T["type"], renderer: <U>(cell: Cell<U>): Node<CellProperties> | Node<CellProperties>[]): (): void

Registers the renderer.

methodregisterStoredValueValidator(type: string | symbol, validator: (cell: CellProperties): boolean): (): void

Registers the stored value validator.

methodregisterType<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): void

Registers the type.

methodrender<T>(cell: Cell<T>): Node<CellProperties> | Node<CellProperties>[]

Renders SheetRenderCoordinatorManager scene output.

methodrenderCell<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Node<CellProperties> | Node<CellProperties>[]

Projects and renders one visible Sheet cell.

classSheetRendererRegistry
class SheetRendererRegistry<RegistryProperties> extends RendererRegistry<RegistryProperties>

Renderer registry for sheet cell instances.

constructorSheetRendererRegistry<RegistryProperties>(): SheetRendererRegistry<RegistryProperties>
methodregisterRenderer(type: string | symbol, rendererFn: <T>(input: Cell<T>): Node<RegistryProperties> | Node<RegistryProperties>[]): (): void

Registers a renderer for one sheet cell type.

ReturnsDisposer that restores the previous renderer.

type

Cell type identifier.

rendererFn

Function that renders matching cell instances.

methodrender<T>(input: Cell<T>): Node<RegistryProperties> | Node<RegistryProperties>[]

Renders a cell through its registered renderer.

ReturnsScene node or nodes produced by the renderer.

input

Cell instance to render.

Inherited members 1

Inherited from RendererRegistry.

Cell visuals

Visual readers supply feature-owned details such as labels or conditional appearance without changing stored cell data.

classEmbeddedEditorRenderNode
class EmbeddedEditorRenderNode<T> extends RenderNode<T>

Thin Sheet scene-graph bridge for an embedded rich-text editor.

The embedded editor owns document layout and painting. This node only binds the editor session to the cell geometry and forwards retained draw calls.

constructorEmbeddedEditorRenderNode<T>(document: readonly Schema[], positionRect: { height: number; width: number; x: number; y: number }, properties: T, editSession?: SheetEditSession, editRenderOptions?: SheetEditRenderOptions): EmbeddedEditorRenderNode<T>
methodclear(context: RenderContext): void

Clears state owned by Node.

methoddrawHit(_context: RenderContext): void

Rich-text content is visual-only; the cell box owns hit detection.

methoddrawScene(context: RenderContext, clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation. Must be implemented by subclasses.

context

The rendering context.

clipRegion

Optional clipping region: a PositionRect for axis-aligned rectangular clip, or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.

Inherited members 40

Inherited from RenderNode.

classSheetCellVisualReaderError
class SheetCellVisualReaderError extends SearError

Public error raised for invalid Sheet cell visual-reader contributions.

Inherited members 9

Inherited from SearError.

interfaceSheetCellConditionalVisual

One matched conditional rule; higher priority wins for overlapping properties and layer slots.

interfaceSheetCellVisualOverride
interface SheetCellVisualOverride extends SheetCellVisualReader

Conditional visual overrides applied after base readers, lowest priority first. Omitted or undefined properties preserve the previously composed value. Readers at the same priority must declare disjoint property sets.

Inherited members 3

Inherited from SheetCellVisualReader.

interfaceSheetCellVisualReaderRegistrationContext

Minimal configuration access available while plugins register visual readers.

interfaceSheetCellVisualReadPosition

Coordinates supplied to one visual reader for a rendered Sheet cell.

typeSheetCellVisualLayer
type SheetCellVisualLayer = CellVisualLayer

A rectangle positioned within a cell using fractions of its width and height.

typeSheetCellVisualReaderErrorCode
type SheetCellVisualReaderErrorCode = typeof SheetCellVisualReaderErrorCode[keyof typeof SheetCellVisualReaderErrorCode] SheetCellVisualReaderErrorCode: { DuplicateReader: "SHEET_CELL_VISUAL_READER_DUPLICATE_READER"; InvalidPriority: "SHEET_CELL_VISUAL_READER_INVALID_PRIORITY"; OverrideConflict: "SHEET_CELL_VISUAL_READER_OVERRIDE_CONFLICT"; PropertyConflict: "SHEET_CELL_VISUAL_READER_PROPERTY_CONFLICT"; UndeclaredProperty: "SHEET_CELL_VISUAL_READER_UNDECLARED_PROPERTY" }

Stable failure codes exposed by SheetCellVisualReaderRegistry.