@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.
constructor AffixCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): AffixCellproperty readonly symbol: symbolstaticBuilt-in affix cell type symbol.
method getDisplayText(): stringReturns plain display text for numeric/string labels and rich header content.
method render(): Node<CellProperties<string | number | Schema | null>> | Node<CellProperties<string | number | Schema | null>>[]Renders the affix background and optional text content.
- classBooleanCell
-
class BooleanCell extends Cell<CellProperties<boolean>>Draws a persisted logical cell using spreadsheet TRUE/FALSE labels.
constructor BooleanCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): BooleanCellproperty readonly symbol: typeof symbolstaticmethod getDisplayText(): stringReturns 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.
method render(): Node<CellProperties<boolean>> | Node<CellProperties<boolean>>[]Renders Cell scene output.
- classCell
-
class Cell<T>Base render node for a projected Sheet cell.
constructor Cell<T>(data: T, positionRect: PositionRectProps, properties: T, context?: CellContext): Cell<T>property readonly context: CellContextproperty readonly data: Tproperty readonly positionRect: PositionRectPropsproperty readonly properties: Tmethod getDisplayText(): stringReturns 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.
method render(): 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.
constructor EditorCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EditorCellproperty readonly symbol: symbolstaticBuilt-in editor cell type symbol.
method getDisplayText(): stringExtracts plain text from the editor document.
method render(): Node<CellProperties<Schema[]>> | Node<CellProperties<Schema[]>>[]Renders editor content, marking edit-mode nodes as overlay content when needed.
- classEmptyCell
-
class EmptyCell extends Cell<CellProperties<null>>Renderer for empty persisted cells and active empty editor cells.
constructor EmptyCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EmptyCellproperty readonly symbol: symbolstaticBuilt-in empty cell type symbol.
method getDisplayText(): stringEmpty cells have no display text.
method render(): Node<CellProperties<null>> | Node<CellProperties<null>>[]Renders an empty box or editable rich-text placeholder.
- classFormulaCell
-
class FormulaCell extends Cell<CellProperties<string>>Renders the calculated projection of a formula cell.
constructor FormulaCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): FormulaCellproperty readonly symbol: symbolstaticDI token for resolving FormulaCell.
method getDisplayText(): stringReturns the display text.
method render(): Node<CellProperties<string>> | Node<CellProperties<string>>[]Renders FormulaCell scene output.
- classNumberCell
-
class NumberCell extends Cell<CellProperties<number>>Renders a persisted numeric value without converting its storage type to text.
constructor NumberCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): NumberCellproperty readonly symbol: symbolstaticDI token for resolving NumberCell.
method getDisplayText(): stringReturns the display text.
method render(): Node<CellProperties<number>> | Node<CellProperties<number>>[]Renders NumberCell scene output.
- classRichTextCell
-
class RichTextCell extends Cell<CellProperties<SheetDocumentNode[]>>Renderer for persisted rich-text cell values.
constructor RichTextCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): RichTextCellproperty readonly symbol: symbolstaticBuilt-in rich-text cell type symbol.
method getDisplayText(): stringExtracts plain text from the rich-text document.
method render(): Node<CellProperties<Schema[]>> | Node<CellProperties<Schema[]>>[]Renders a rich-text document inside the cell bounds.
- classStringCell
-
class StringCell extends Cell<CellProperties<string>>Renderer for persisted plain-string cell values.
constructor StringCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): StringCellproperty readonly symbol: symbolstaticBuilt-in string cell type symbol.
method getDisplayText(): stringReturns the stored string value for measurement and formula display.
method render(): Node<CellProperties<string>> | Node<CellProperties<string>>[]Renders text content inside a standard cell box.
- 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.
property cellFormatLocale?: CellFormatLocaleSheet-local defaults for formatting numbers and date/time serials.
property col?: numberCurrent cell column index (0-based); optional for non-grid cells.
property formulaResultProvider?: IFormulaResultProviderRead-only access to derived formula results; optional when formulas are disabled.
property row?: numberCurrent 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): stringExtracts plain text from persisted rich-text content.
- functionformatFormulaValue
-
formatFormulaValue(value: unknown): stringFormats 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.
method forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): voidVisits 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.
method getFormulaResult(row: number, col: number): FormulaValue | undefinedGets 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.
rowRow index (0-based).
colColumn 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.
constructor NodeFactory<NodeType>(): NodeFactory<NodeType>property readonly symbol: symbolstaticDI token for resolving the active node factory.
method create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeTypeCreates a node instance for typed data.
ReturnsCreated node instance.
dataPersisted or rendering-only cell data.
positionRectNode bounds.
propertiesRender properties passed to the node.
contextOptional cell rendering context.
method register<DataType, Properties>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeType): (): voidRegisters a constructor for a cell or node type.
ReturnsDisposer that restores the previous registration.
typeType identifier used by incoming data.
ctorConstructor used to create the node.
- classRenderCoordinatorManager
-
Coordinates cell creation and rendering for a concrete renderer registry.
constructor RenderCoordinatorManager(): RenderCoordinatorManagerproperty readonly symbol: symbolstaticDI token for resolving the active render coordinator manager.
method create<T>(): TCreates a cell instance from registered type metadata.
method registerRenderer(): voidRegisters renderer functions supported by the coordinator.
method registerType(): voidRegisters cell/node types supported by the coordinator.
method render<T>(): Node<T> | Node<T>[]Renders an already-created cell or node.
method renderCell<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.
constructor RendererRegistry<RegistryProperties>(): RendererRegistry<RegistryProperties>property readonly symbol: symbolstaticDI token for resolving the active renderer registry.
method registerRenderer(type: unknown, rendererFn: (input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]): (): voidRegisters a renderer function for one input type.
ReturnsDisposer that removes or restores the registration.
typeType identifier owned by the cell or feature domain.
rendererFnFunction that converts input into scene nodes.
method render(input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]Renders a registered input.
ReturnsScene node or nodes produced by the registered renderer.
inputInput accepted by the concrete registry implementation.
- classSheetCellVisualReaderRegistry
-
Composes editor-local, plugin-owned visual properties for Sheet cells.
constructor SheetCellVisualReaderRegistry(): SheetCellVisualReaderRegistryproperty readonly symbol: typeof symbolstaticDI token for the editor-local registry.
method destroy(): voidRemoves all editor-local reader registrations.
method nextConditionalPriority(): numberAllocates an order after every registered conditional rule owner.
method read(position: SheetCellVisualReadPosition): Partial<CellProperties>Reads and combines every registered visual contribution for one cell.
method readVisual(position: SheetCellVisualReadPosition): { layers: readonly CellVisualLayer[]; properties: Partial<CellProperties> }Composes base properties, matched rules and visual layers in one pass.
method register(reader: SheetCellVisualReader): (): voidRegisters one reader and rejects duplicate ids or property ownership.
method registerConditional(reader: SheetCellConditionalVisualReader): (): voidRegisters a rule source whose matches are composed across feature plugins.
method registerOverride(reader: SheetCellVisualOverride): (): voidRegisters explicit-priority overrides without acquiring base property ownership.
- classSheetNodeFactory
-
class SheetNodeFactory extends NodeFactory<Cell<CellProperties<unknown>>>Default NodeFactory implementation for sheet cells.
constructor SheetNodeFactory(): SheetNodeFactorymethod create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>ReturnsCreated Cell instance.
dataCell data carrying a type identifier.
positionRectCell bounds.
propertiesRender properties.
contextOptional cell rendering context.
method register<DataType, Properties>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>): (): voidRegisters a cell constructor for one sheet cell type.
ReturnsDisposer that restores the previous constructor for this type.
typeCell type identifier.
ctorCell constructor used to create render cells.
- classSheetRenderCoordinatorManager
-
Coordinates cell projection and rendering for a Sheet frame.
constructor SheetRenderCoordinatorManager(nodeFactory: SheetNodeFactory, rendererRegistry: SheetRendererRegistry<CellProperties>, formulaResultProvider: IFormulaResultProvider, platform?: Platform | undefined, cellFormatLocaleProvider?: ICellFormatLocaleProvider): SheetRenderCoordinatorManagerproperty readonly nodeFactory: SheetNodeFactoryproperty readonly rendererRegistry: SheetRendererRegistry<CellProperties>property readonly symbol: symbolstaticDI token for resolving SheetRenderCoordinatorManager.
method create<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Cell<T> | undefinedCreates the value.
method createCellContext(row?: number, col?: number): CellContextBuilds the explicit, read-only context shared by render and measurement paths.
method registerCell<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): voidRegisters a cell constructor and its default
Cell.render()adapter together.method registerRenderer<T>(type: T["type"], renderer: <U>(cell: Cell<U>): Node<CellProperties> | Node<CellProperties>[]): (): voidRegisters the renderer.
method registerStoredValueValidator(type: string | symbol, validator: (cell: CellProperties): boolean): (): voidRegisters the stored value validator.
method registerType<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): voidRegisters the type.
method render<T>(cell: Cell<T>): Node<CellProperties> | Node<CellProperties>[]Renders SheetRenderCoordinatorManager scene output.
method renderCell<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.
constructor SheetRendererRegistry<RegistryProperties>(): SheetRendererRegistry<RegistryProperties>method registerRenderer(type: string | symbol, rendererFn: <T>(input: Cell<T>): Node<RegistryProperties> | Node<RegistryProperties>[]): (): voidRegisters a renderer for one sheet cell type.
ReturnsDisposer that restores the previous renderer.
typeCell type identifier.
rendererFnFunction that renders matching cell instances.
method render<T>(input: Cell<T>): Node<RegistryProperties> | Node<RegistryProperties>[]Renders a cell through its registered renderer.
ReturnsScene node or nodes produced by the renderer.
inputCell instance to render.
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.
constructor EmbeddedEditorRenderNode<T>(document: readonly Schema[], positionRect: { height: number; width: number; x: number; y: number }, properties: T, editSession?: SheetEditSession, editRenderOptions?: SheetEditRenderOptions): EmbeddedEditorRenderNode<T>method clear(context: RenderContext): voidClears state owned by Node.
method drawHit(_context: RenderContext): voidRich-text content is visual-only; the cell box owns hit detection.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidAbstract method to draw the node's scene representation. Must be implemented by subclasses.
contextThe rendering context.
clipRegionOptional clipping region: a
PositionRectfor axis-aligned rectangular clip, or aPoint[]polygon (array of[x, y]vertices) for arbitrary shape clip.
Inherited members 40
Inherited from RenderNode.
- 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
- dispose
- draw
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classSheetCellVisualReaderError
-
class SheetCellVisualReaderError extends SearErrorPublic error raised for invalid Sheet cell visual-reader contributions.
constructor SheetCellVisualReaderError(code: SheetCellVisualReaderErrorCode, message: string, details?: SearErrorDetails): SheetCellVisualReaderErrorproperty readonly code: SheetCellVisualReaderErrorCodeStable machine-readable identifier for this error category.
Inherited members 9
Inherited from SearError.
- interfaceSheetCellConditionalVisual
-
One matched conditional rule; higher priority wins for overlapping properties and layer slots.
- interfaceSheetCellConditionalVisualReader
-
property readonly id: stringproperty readonly properties: readonly "value" | "type" | unknown | "region" | "format" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]method read(position: SheetCellVisualReadPosition): readonly SheetCellConditionalVisual[]method readHighestPriority(): numberReads the owner's current rule order after staged transactions commit.
- interfaceSheetCellVisualOverride
-
interface SheetCellVisualOverride extends SheetCellVisualReaderConditional 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.
property readonly priority: number - interfaceSheetCellVisualReader
-
Plugin-owned reader declaring exclusive ownership of base visual properties.
- interfaceSheetCellVisualReaderRegistrationContext
-
Minimal configuration access available while plugins register visual readers.
- interfaceSheetCellVisualReadPosition
-
Coordinates supplied to one visual reader for a rendered Sheet cell.
property readonly columnIndex: numberproperty readonly rowIndex: number - typeSheetCellVisualLayer
-
type SheetCellVisualLayer = CellVisualLayerA 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.
No matching API entries.