@searsuite/sear-sheet-editor-contract
Document and positions
- interfaceSheetDocumentAccessor
-
Reads a cell document and commits a new document through the Sheet boundary.
- interfaceSheetEditorGeometry
-
Cell geometry supplied by Sheet. The editor uses these functions for hit testing and drawing without knowing how the Sheet viewport is implemented.
property readonly cellRect: SheetEditorRectproperty readonly clipRect?: SheetEditorRectproperty readonly containsPoint?: (point: SheetEditorPoint): booleanproperty readonly toLocalPoint: (point: SheetEditorPoint): SheetEditorPointproperty readonly toSheetPoint: (point: SheetEditorPoint): SheetEditorPoint - interfaceSheetEditorPoint
-
A point in Sheet or editor-local coordinates.
property readonly x: numberproperty readonly y: number - interfaceSheetEditorRect
-
A rectangle in Sheet or editor-local coordinates.
property readonly height: numberproperty readonly width: numberproperty readonly x: numberproperty readonly y: number - interfaceSheetPointerHit
-
Result of pointer hit testing against the embedded document.
- interfaceSheetPointerInput
-
interface SheetPointerInput extends SheetInputModifiersPointer input normalized by the Sheet host.
- interfaceSheetTextPosition
-
A position in the rich document represented by a node path and text offset.
property readonly offset: numberproperty readonly path: readonly string | number[] - typeSheetDocument
-
type SheetDocument = readonly SheetDocumentNode[]A rich-document snapshot owned by the Sheet cell boundary.
- typeSheetDocumentNode
-
type SheetDocumentNode = SchemaA document node exchanged between a Sheet cell and an embedded editor.
Input and selection
- interfaceSheetCompositionInput
-
IME composition lifecycle input delivered by the Sheet input adapter.
- interfaceSheetCompositionState
-
Current IME composition state in editor-local coordinates.
property readonly active: booleanproperty readonly rect?: SheetEditorRectproperty readonly text: string - interfaceSheetCursorState
-
A cursor rectangle in editor-local coordinates.
property readonly rect: SheetEditorRectproperty readonly visible?: boolean - interfaceSheetDeleteInput
-
Text deletion delivered by the Sheet input adapter.
property readonly count?: numberproperty readonly direction: "backward" | "forward"property readonly type: "deleteContent" - interfaceSheetEmbeddedInlineStyleStatus
-
Whether one inline style can be applied, is active, and has a common value.
property readonly active: booleanproperty readonly enabled: booleanproperty readonly value: unknownThe common selected value, or null when unset or mixed.
- interfaceSheetInlineStyleUpdate
-
An inline style patch applied to the active text selection.
- interfaceSheetInputModifiers
-
Modifier keys normalized by the Sheet host.
property readonly altKey?: booleanproperty readonly ctrlKey?: booleanproperty readonly metaKey?: booleanproperty readonly shiftKey?: boolean - interfaceSheetKeyInput
-
interface SheetKeyInput extends SheetInputModifiersKeyboard input that the embedded editor may consume for navigation or editing.
- interfaceSheetTextInput
-
Text insertion delivered by the Sheet input adapter.
property readonly text: stringproperty readonly type: "insertText" - interfaceSheetTextSelection
-
A text selection represented by anchor and head positions.
property readonly anchor: SheetTextPositionproperty readonly head: SheetTextPosition - typeSheetEditInput
-
type SheetEditInput = SheetTextInput | SheetDeleteInput | SheetCompositionInput | SheetKeyInputInput accepted by an active Sheet edit session.
- typeSheetEmbeddedInlineStyleState
-
type SheetEmbeddedInlineStyleState = Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>Inline-style state exposed by a Sheet embedded editor while editing a cell.
Keys are plugin-owned persisted style keys (for example,
boldorfontSize). Keeping the state keyed by the stable style key lets third-party inline-style extensions participate without changing this contract. - variableSheetEmbeddedInlineStyleObservation
-
SheetEmbeddedInlineStyleObservation: StateObservationDefinition<Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>>Current inline-style availability and activation for the embedded selection.
Render and editor session
The embedded editor reports render updates and session state to its Sheet host. FakeSheetEmbeddedEditor supports consumers that need a test implementation.
- interfaceSheetEmbeddedEditor
-
interface SheetEmbeddedEditorSheetEmbeddedEditor: unknownStable Sheet-facing embedded editor contract. Implementations own rich-text layout, painting, selection, cursor and IME behavior behind this boundary.
property readonly formatting?: { apply: unknown; capture: unknown }Pure formatting projection; applying it returns a new snapshot without changing editor state.
property readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
method bindTeardownToken(token: object): voidRestricts runtime teardown to the owning Sheet editor when supported.
method createEditSession(context: SheetEmbeddedEditorContext): SheetEditSessionmethod createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSessionmethod dispose(ownerToken?: object): voidmethod initialize(context: SheetEmbeddedEditorContext): voidvariablesymbol symbol: symbol - classFakeSheetEmbeddedEditor
-
class FakeSheetEmbeddedEditor extends SheetEmbeddedEditorSmall deterministic editor used by Sheet tests. It intentionally models only the contract boundary, making no assumptions about a concrete Doc runtime.
constructor FakeSheetEmbeddedEditor(): FakeSheetEmbeddedEditorproperty cancelCount: numberproperty readonly committedDocuments: Schema[][]property disposeCount: numberproperty readonly editContexts: SheetEmbeddedEditorContext[]property initializeCount: numberproperty readonly inputs: SheetEditInput[]property readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
property readonly renderContexts: SheetEmbeddedEditorContext[]property readonly renderSessions: FakeRenderSession[]method bindTeardownToken(token: object): voidRestricts runtime teardown to the owning Sheet editor when supported.
method createEditSession(context: SheetEmbeddedEditorContext): SheetEditSessionmethod createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSessionmethod dispose(ownerToken?: object): voidmethod initialize(context: SheetEmbeddedEditorContext): void - interfaceSheetEditorInvalidation
-
A rectangle or semantic reason that should be redrawn by Sheet.
- interfaceSheetEditRenderOptions
-
Per-frame options for painting an active Sheet edit session.
property readonly cursorVisible?: booleanWhether the caret should be painted during this frame.
- interfaceSheetEditSession
-
An active editing session for one Sheet cell document.
method cancel(): voidmethod commit(): readonly Schema[]method dispose(): voidmethod getComposition(): SheetCompositionState | nullmethod getCursor(): SheetCursorState | nullmethod getDocument(): readonly Schema[]method getSelection(): SheetTextSelection | nullmethod handleInput(input: SheetEditInput): SheetRenderUpdatemethod handlePointer(input: SheetPointerInput): SheetRenderUpdatemethod render(renderContext?: RenderContext, options?: SheetEditRenderOptions): SheetRenderUpdatePaints the current edited document, selection, cursor and composition.
method setInlineStyle(update: SheetInlineStyleUpdate): SheetRenderUpdatemethod setSelection(selection: SheetTextSelection): SheetRenderUpdate - interfaceSheetEmbeddedEditorContext
-
Context in which a Sheet cell editor renders and edits one cell document.
property readonly defaultFontFamily?: stringHost-selected default font family for read-only Sheet cell rendering.
property readonly defaultFontSize?: numberHost-selected default font size for read-only Sheet cell rendering.
property readonly documentAccessor: SheetDocumentAccessorproperty readonly geometry: SheetEditorGeometryproperty readonly invalidate?: (invalidation: SheetEditorInvalidation): voidproperty readonly isCommandExecuting?: (): booleanPresent in assembled Sheets to require command dispatch for edit-session mutations.
property readonly renderContext: RenderContext - interfaceSheetRenderSession
-
A retained render session for one Sheet cell document.
method dispose(): voidmethod hitTest(input: SheetPointerInput): SheetPointerHit | nullmethod render(renderContext?: RenderContext): SheetRenderUpdatePaints the current document into the supplied render target.
- interfaceSheetRenderUpdate
-
State returned after a render or edit operation.
property readonly composition?: SheetCompositionStateproperty readonly contentSize?: { height: number; width: number }property readonly cursor?: SheetCursorStateproperty readonly invalidation?: SheetEditorInvalidationproperty readonly needsRedraw: booleanproperty readonly selection?: SheetTextSelection
No matching API entries.