tuil
ReferencePackages

@mwillbanks/tuil-cell

Pure Bun cell renderer with an explicit native diff profiling boundary.

View rawEdit

Overview

Pure Bun cell renderer with an explicit native diff profiling boundary.

@mwillbanks/tuil-cell is independently installable and also participates in the umbrella @mwillbanks/tuil runtime where applicable.

Installation

npm install @mwillbanks/tuil-cell

How it operates

The cell backend composes grapheme-aware buffers, preserves wide-character continuation cells, diffs frames, and emits minimal ANSI output. The TypeScript path is the default. Zig prebuilds expose an explicit conformance and profiling prototype, and applications must opt in because the prototype does not replace the complete diff and encoding workload.

Documentation flow diagram. compose buffer; snapshot frame; diff; emit; restore session; S0 leads to S1; S1 leads to S2; S2 leads to S3
Documentation flow diagram. compose buffer; snapshot frame; diff; emit; restore session; S0 leads to S1; S1 leads to S2; S2 leads to S3

API

APISignatureDescription
Cellinterface CellPublic interface Cell.
CellAcceleratorinterface CellAcceleratorPublic interface CellAccelerator.
CellAttributesinterface CellAttributesPublic interface CellAttributes.
CellBufferclass CellBufferPublic class CellBuffer.
CellFrameinterface CellFramePublic interface CellFrame.
CellOutputModetype CellOutputModePublic type CellOutputMode.
CellRendererBackendclass CellRendererBackendPublic class CellRendererBackend.
CellRendererBackendOptionsinterface CellRendererBackendOptionsPublic interface CellRendererBackendOptions.
CellSceneNodeinterface CellSceneNodePublic interface CellSceneNode.
CellTreetype CellTreePublic type CellTree.
Colortype ColorPublic type Color.
composeCellScenefunction composeCellScenePublic function composeCellScene.
CursorStateinterface CursorStatePublic interface CursorState.
defaultColorconstant defaultColorPublic constant defaultColor.
diffCellFramesfunction diffCellFramesPublic function diffCellFrames.
emptyCellconstant emptyCellPublic constant emptyCell.
encodeCellOutputfunction encodeCellOutputPublic function encodeCellOutput.
loadNativeCellAcceleratorfunction loadNativeCellAcceleratorPublic function loadNativeCellAccelerator.
loadOptionalCellAcceleratorfunction loadOptionalCellAcceleratorPublic function loadOptionalCellAccelerator.
NativeCellAcceleratorOptionsinterface NativeCellAcceleratorOptionsPublic interface NativeCellAcceleratorOptions.
typescriptCellAcceleratorconstant typescriptCellAcceleratorPublic constant typescriptCellAccelerator.

Events and lifecycle

The backend consumes renderer lifecycle and input contracts; it does not introduce an application event bus.

All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.

Example

import { CellBuffer } from "@mwillbanks/tuil-cell";

const buffer = new CellBuffer(80, 24);
buffer.write(0, 0, "Ready");

On this page