Editful
DocsCanvas SDK API

Canvas SDK API.

Every public export from @editful/canvas-sdk.

  • Generated from declarations
  • TSDoc annotations

Functions

Function

definePlugin

#

Identity helper preserving the definition's precise inferred type.

Parameters

Parameters and TSDoc annotations
NameTypeStatusDescription
pluginDefinitionRequiredNo description.
Show raw definition
TypeScript
/** Identity helper preserving the definition's precise inferred type. */
export declare function definePlugin<const Definition extends PluginDefinition>(plugin: Definition): Definition;
Function

encodeLineMarkers

#

Packs independently configurable start/end markers for a line quad.

Parameters

Parameters and TSDoc annotations
NameTypeStatusDescription
startLineMarkerRequiredNo description.
endLineMarkerRequiredNo description.
Show raw definition
TypeScript
/** Packs independently configurable start/end markers for a line quad. */
export declare function encodeLineMarkers(start: LineMarker, end: LineMarker): number;
Function

hexColor

#

Converts `#rgb`, `#rrggbb`, or `#rrggbbaa` to an Editful packed color.

Parameters

Parameters and TSDoc annotations
NameTypeStatusDescription
hexstringRequiredNo description.
Show raw definition
TypeScript
/** Converts `#rgb`, `#rrggbb`, or `#rrggbbaa` to an Editful packed color. */
export declare function hexColor(hex: string): number;
Function

validatePluginActionSchema

#

Validates the complete JSON-Schema subset supported by plugin actions. Registration, desktop execution, and the MCP catalog all use this contract.

Parameters

Parameters and TSDoc annotations
NameTypeStatusDescription
schemaReadonly<Record<string, PluginJson>>RequiredNo description.
pathstringOptionalNo description.
depthnumberOptionalNo description.
Show raw definition
TypeScript
/**
 * Validates the complete JSON-Schema subset supported by plugin actions.
 * Registration, desktop execution, and the MCP catalog all use this contract.
 */
export declare function validatePluginActionSchema(schema: Readonly<Record<string, PluginJson>>, path?: string, depth?: number): void;

Classes

Class

PluginActionCancelledError

#
Show raw definition
TypeScript
export declare class PluginActionCancelledError extends Error {
    constructor(message?: string);
}
Class

PluginActionConflictError

#
Show raw definition
TypeScript
export declare class PluginActionConflictError extends Error {
    constructor(message?: string);
}
Class

PluginConfigurationError

#
Show raw definition
TypeScript
export declare class PluginConfigurationError extends Error {
    constructor(message: string);
}
Class

PluginHostFeatureError

#
Show raw definition
TypeScript
export declare class PluginHostFeatureError extends Error {
    constructor(message: string);
}
Class

PluginNetworkError

#
Show raw definition
TypeScript
export declare class PluginNetworkError extends Error {
    constructor(message: string);
}

Types

Type

CreateContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
labelstringRequired · readonlyNo description.
iconstringOptional · readonlyNo description.
shortcutstringRequired · readonlyNo description.
cursor"crosshair" | "text"Required · readonlyNo description.
gesture"drag" | "place"Required · readonlyNo description.
geometry"box" | "line"Optional · readonly

Geometry authored by the create gesture. Defaults to an axis-aligned box.

ordernumberRequired · readonlyNo description.
defaultSize{ readonly width: number; readonly height: number; }Required · readonlyNo description.
defaultSize.widthnumberRequired · readonlyNo description.
defaultSize.heightnumberRequired · readonlyNo description.
styleSlot"text" | "shape" | "palette"Required · readonlyNo description.
opensTextEditorbooleanOptional · readonlyNo description.
Show raw definition
TypeScript
export interface CreateContribution {
    readonly label: string;
    readonly icon?: string;
    readonly shortcut: string;
    readonly cursor: 'crosshair' | 'text';
    readonly gesture: 'drag' | 'place';
    /** Geometry authored by the create gesture. Defaults to an axis-aligned box. */
    readonly geometry?: 'box' | 'line';
    readonly order: number;
    readonly defaultSize: {
        readonly width: number;
        readonly height: number;
    };
    readonly styleSlot: 'shape' | 'palette' | 'text';
    readonly opensTextEditor?: boolean;
}
Type

FieldHandle

#
Show raw definition
TypeScript
export interface FieldHandle<Value, Kind = unknown> {
    readonly [FIELD_VALUE]: (value: Value) => Value;
    readonly [FIELD_KIND]: (kind: Kind) => Kind;
}
Type

FieldOptions

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
defaultValueOptional · readonlyNo description.
Show raw definition
TypeScript
export interface FieldOptions<Value> {
    readonly default?: Value;
}
Type

KindBuilder

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
fieldKindFieldBuilder<Kind>Required · readonlyNo description.
uiViewBuilder<Kind>Required · readonlyNo description.
create(contribution: CreateContribution) => voidRequiredNo description.
hit(shape: "rect" | "ellipse") => voidRequiredNo description.
text(contribution: TextContribution<Kind>) => voidRequiredNo description.
view(contribution: ViewContribution<Kind>) => voidRequiredNo description.
defaults(contribution: StyleDefaults) => voidRequiredNo description.
agent(contribution: { readonly name: string; readonly description?: string; }) => voidRequiredNo description.
interaction(contribution: PluginInteractionContribution) => voidRequiredNo description.
asset() => voidRequiredNo description.
pack(fn: PackFunction<Kind>) => voidRequiredNo description.
Show raw definition
TypeScript
export interface KindBuilder<Kind = unknown> {
    readonly field: KindFieldBuilder<Kind>;
    readonly ui: ViewBuilder<Kind>;
    create(contribution: CreateContribution): void;
    hit(shape: 'rect' | 'ellipse'): void;
    text(contribution: TextContribution<Kind>): void;
    view(contribution: ViewContribution<Kind>): void;
    defaults(contribution: StyleDefaults): void;
    agent(contribution: {
        readonly name: string;
        readonly description?: string;
    }): void;
    interaction(contribution: PluginInteractionContribution): void;
    asset(): void;
    pack(fn: PackFunction<Kind>): void;
}
Type

KindFieldBuilder

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
f64(name: string, options?: FieldOptions<number>) => FieldHandle<number, Kind>RequiredNo description.
i32(name: string, options?: FieldOptions<number>) => FieldHandle<number, Kind>RequiredNo description.
bool(name: string, options?: FieldOptions<boolean>) => FieldHandle<boolean, Kind>RequiredNo description.
string(name: string, options?: FieldOptions<string>) => FieldHandle<string, Kind>RequiredNo description.
text(name: string) => FieldHandle<string, Kind>RequiredNo description.
Show raw definition
TypeScript
export interface KindFieldBuilder<Kind = unknown> {
    f64(name: string, options?: FieldOptions<number>): FieldHandle<number, Kind>;
    i32(name: string, options?: FieldOptions<number>): FieldHandle<number, Kind>;
    bool(name: string, options?: FieldOptions<boolean>): FieldHandle<boolean, Kind>;
    string(name: string, options?: FieldOptions<string>): FieldHandle<string, Kind>;
    text(name: string): FieldHandle<string, Kind>;
}
Type

PackedNode

#

Read-only node view valid only for the duration of one pack call.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
xnumberRequired · readonlyNo description.
ynumberRequired · readonlyNo description.
halfWnumberRequired · readonlyNo description.
halfHnumberRequired · readonlyNo description.
rotationnumberRequired · readonlyNo description.
cornerRadiusnumberRequired · readonlyNo description.
strokeWidthnumberRequired · readonlyNo description.
fillnumberRequired · readonlyNo description.
strokenumberRequired · readonlyNo description.
assetIdstringRequired · readonlyNo description.
fontFamilynumberRequired · readonlyNo description.
fontSizenumberRequired · readonlyNo description.
fontWeightnumberRequired · readonlyNo description.
fontItalicbooleanRequired · readonlyNo description.
textAlignnumberRequired · readonlyNo description.
textColornumberRequired · readonlyNo description.
lineHeightnumberRequired · readonlyNo description.
letterSpacingnumberRequired · readonlyNo description.
textPaddingnumberRequired · readonlyNo description.
textVerticalAlignnumberRequired · readonlyNo description.
textSizingnumberRequired · readonlyNo description.
recordsVersionnumberRequired · readonlyNo description.
get<Value>(field: FieldHandle<Value, Kind>) => ValueRequiredNo description.
Show raw definition
TypeScript
/** Read-only node view valid only for the duration of one pack call. */
export interface PackedNode<Kind = unknown> {
    readonly x: number;
    readonly y: number;
    readonly halfW: number;
    readonly halfH: number;
    readonly rotation: number;
    readonly cornerRadius: number;
    readonly strokeWidth: number;
    readonly fill: number;
    readonly stroke: number;
    readonly assetId: string;
    readonly fontFamily: number;
    readonly fontSize: number;
    readonly fontWeight: number;
    readonly fontItalic: boolean;
    readonly textAlign: number;
    readonly textColor: number;
    readonly lineHeight: number;
    readonly letterSpacing: number;
    readonly textPadding: number;
    readonly textVerticalAlign: number;
    readonly textSizing: number;
    readonly recordsVersion: number;
    get<Value>(field: FieldHandle<Value, Kind>): Value;
}
Type

PackFunction

#
Show raw definition
TypeScript
export type PackFunction<Kind = unknown> = (node: PackedNode<Kind>, services: PackServices, out: PrimitiveWriter) => void;
Type

PackServices

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
text{ readonly sharedTextStyle: TextStyle; familyOf(font: number): TextStyle["family"]; }Required · readonlyNo description.
text.sharedTextStyleTextStyleRequired · readonlyNo description.
text.familyOf(font: number) => TextStyle["family"]RequiredNo description.
Show raw definition
TypeScript
export interface PackServices {
    readonly text: {
        readonly sharedTextStyle: TextStyle;
        familyOf(font: number): TextStyle['family'];
    };
}
Type

PluginActionContext

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
signalAbortSignalRequired · readonlyNo description.
boardIdstringOptional · readonly

Stable board id for constructing declared board-scoped service requests.

documentPluginDocumentRequired · readonlyNo description.
selectionPluginSelectionRequired · readonlyNo description.
settingsPluginSettingsRequired · readonlyNo description.
secretsPluginSecretsRequired · readonlyNo description.
networkPluginNetworkRequired · readonlyNo description.
remoteMediaPluginRemoteMediaRequired · readonlyNo description.
uiPluginActionUiRequired · readonlyNo description.
editorsPluginEditorsRequired · readonlyNo description.
openExternal(url: string) => Promise<void>RequiredNo description.
Show raw definition
TypeScript
export interface PluginActionContext {
    readonly signal: AbortSignal;
    /** Stable board id for constructing declared board-scoped service requests. */
    readonly boardId?: string;
    readonly document: PluginDocument;
    readonly selection: PluginSelection;
    readonly settings: PluginSettings;
    readonly secrets: PluginSecrets;
    readonly network: PluginNetwork;
    readonly remoteMedia: PluginRemoteMedia;
    readonly ui: PluginActionUi;
    readonly editors: PluginEditors;
    openExternal(url: string): Promise<void>;
}
Type

PluginActionUi

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
prompt(options: { readonly label: string; readonly description?: string; readonly initial?: string | number; }) => Promise<string | number | null>RequiredNo description.
confirm(options: { readonly label: string; readonly description?: string; }) => Promise<boolean>RequiredNo description.
pick<Value extends PluginJson>(options: { readonly label: string; readonly description?: string; readonly items: readonly PluginPickerItem<Value>[]; }) => Promise<Value | null>RequiredNo description.
notify(notification: PluginNotification) => voidRequired

Publishes a bounded notice into the host notification tray. Plugins cannot choose its position, duration, markup, or actions.

progress(message: string) => voidRequiredNo description.
error(message: string) => voidRequiredNo description.
Show raw definition
TypeScript
export interface PluginActionUi {
    prompt(options: {
        readonly label: string;
        readonly description?: string;
        readonly initial?: string | number;
    }): Promise<string | number | null>;
    confirm(options: {
        readonly label: string;
        readonly description?: string;
    }): Promise<boolean>;
    pick<Value extends PluginJson>(options: {
        readonly label: string;
        readonly description?: string;
        readonly items: readonly PluginPickerItem<Value>[];
    }): Promise<Value | null>;
    /**
     * Publishes a bounded notice into the host notification tray. Plugins cannot
     * choose its position, duration, markup, or actions.
     */
    notify(notification: PluginNotification): void;
    progress(message: string): void;
    error(message: string): void;
}
Type

PluginAgentActionContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
namestringRequired · readonlyNo description.
descriptionstringRequired · readonlyNo description.
inputSchemaReadonly<Record<string, PluginJson>>Required · readonlyNo description.
outputSchemaReadonly<Record<string, PluginJson>>Required · readonlyNo description.
requiresConfirmationbooleanRequired · readonlyNo description.
run(input: Input, context: PluginActionContext) => Promise<Output>RequiredNo description.
Show raw definition
TypeScript
export interface PluginAgentActionContribution<Input extends PluginJson = PluginJson, Output extends PluginJson = PluginJson> {
    readonly id: string;
    readonly name: string;
    readonly description: string;
    readonly inputSchema: Readonly<Record<string, PluginJson>>;
    readonly outputSchema: Readonly<Record<string, PluginJson>>;
    readonly requiresConfirmation: boolean;
    run(input: Input, context: PluginActionContext): Promise<Output>;
}
Type

PluginBackgroundHandle

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
labelstringRequired · readonlyNo description.
Show raw definition
TypeScript
export interface PluginBackgroundHandle<State extends PluginJson = PluginJson> {
    readonly id: string;
    readonly label: string;
    readonly [BACKGROUND_STATE]: State;
}
Type

PluginBackgroundStatus

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
status"vacant" | "owned" | "occupied"Required · readonlyNo description.
stateStateOptional · readonlyNo description.
pluginIdstringOptional · readonlyNo description.
contributionIdstringOptional · readonlyNo description.
labelstringOptional · readonlyNo description.
Show raw definition
TypeScript
export type PluginBackgroundStatus<State extends PluginJson = PluginJson> = {
    readonly status: 'vacant';
} | {
    readonly status: 'owned';
    readonly state: State;
} | {
    readonly status: 'occupied';
    readonly pluginId: string;
    readonly contributionId: string;
    readonly label: string;
};
Type

PluginBackgroundSurfaceContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
labelstringRequired · readonlyNo description.
stateSchemaReadonly<Record<string, PluginJson>>Required · readonlyNo description.
sourceKindstringRequired · readonlyNo description.
sourceNodeId(state: State) => stringRequiredNo description.
pack(source: PackedNode<Kind>, state: State, services: PackServices, out: PrimitiveWriter) => voidRequiredNo description.
Show raw definition
TypeScript
export interface PluginBackgroundSurfaceContribution<Kind = unknown, State extends PluginJson = PluginJson> {
    readonly id: string;
    readonly label: string;
    readonly stateSchema: Readonly<Record<string, PluginJson>>;
    readonly sourceKind: string;
    sourceNodeId(state: State): string;
    pack(source: PackedNode<Kind>, state: State, services: PackServices, out: PrimitiveWriter): void;
}
Type

PluginBindingChildEdit

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
xnumberRequired · readonlyNo description.
ynumberRequired · readonlyNo description.
widthnumberRequired · readonlyNo description.
heightnumberRequired · readonlyNo description.
rotationnumberRequired · readonlyNo description.
Show raw definition
TypeScript
export interface PluginBindingChildEdit {
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
    readonly rotation: number;
}
Type

PluginBindingDefinition

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
rolesreadonly string[]Required · readonlyNo description.
onParentRemoved"cascade" | "unbind"Required · readonlyNo description.
resolve(child: PluginBindingNodeView, parents: ReadonlyMap<string, PluginBindingNodeView>, payloads: ReadonlyMap<string, PluginJson>) => PluginBindingResolveResult | nullRequiredNo description.
invert(edit: PluginBindingChildEdit, parents: ReadonlyMap<string, PluginBindingNodeView>, payloads: ReadonlyMap<string, PluginJson>) => Readonly<Record<string, PluginJson>> | nullOptionalNo description.
Show raw definition
TypeScript
export interface PluginBindingDefinition {
    readonly roles: readonly string[];
    readonly onParentRemoved: 'cascade' | 'unbind';
    resolve(child: PluginBindingNodeView, parents: ReadonlyMap<string, PluginBindingNodeView>, payloads: ReadonlyMap<string, PluginJson>): PluginBindingResolveResult | null;
    invert?(edit: PluginBindingChildEdit, parents: ReadonlyMap<string, PluginBindingNodeView>, payloads: ReadonlyMap<string, PluginJson>): Readonly<Record<string, PluginJson>> | null;
}
Type

PluginBindingNodeView

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
xnumberRequired · readonlyNo description.
ynumberRequired · readonlyNo description.
widthnumberRequired · readonlyNo description.
heightnumberRequired · readonlyNo description.
rotationnumberRequired · readonlyNo description.
presentation"node" | "background-source"Required · readonlyNo description.
field(key: string) => PluginScalar | nullRequiredNo description.
Show raw definition
TypeScript
export interface PluginBindingNodeView {
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
    readonly rotation: number;
    readonly presentation: 'node' | 'background-source';
    field(key: string): PluginScalar | null;
}
Type

PluginBindingResolveResult

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
xnumberOptional · readonlyNo description.
ynumberOptional · readonlyNo description.
widthnumberOptional · readonlyNo description.
heightnumberOptional · readonlyNo description.
rotationnumberOptional · readonlyNo description.
fieldsReadonly<Record<string, PluginScalar>>Optional · readonlyNo description.
Show raw definition
TypeScript
export interface PluginBindingResolveResult {
    readonly x?: number;
    readonly y?: number;
    readonly width?: number;
    readonly height?: number;
    readonly rotation?: number;
    readonly fields?: Readonly<Record<string, PluginScalar>>;
}
Type

PluginCommandContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
labelstringRequired · readonlyNo description.
descriptionstringOptional · readonlyNo description.
shortcutstringOptional · readonlyNo description.
toolbar{ readonly label?: string; readonly icon?: string; readonly order: number; readonly activeEditor?: string; }Optional · readonly

Exposes this command as a toolbar button in addition to the command palette.

toolbar.labelstringOptional · readonly

Optional toolbar-only label; the command palette keeps the command label.

toolbar.iconstringOptional · readonly

Built-in glyph key or explicit `./path.svg` bundled in the plugin artifact.

toolbar.ordernumberRequired · readonlyNo description.
toolbar.activeEditorstringOptional · readonly

Manual editor whose open state makes this button behave as an active canvas tool. The host dismisses that editor after choosing empty canvas or a different object, while clicks on the current selection keep it open.

selection{ readonly minimum?: number; readonly maximum?: number; readonly kinds?: readonly string[]; }Optional · readonlyNo description.
selection.minimumnumberOptional · readonlyNo description.
selection.maximumnumberOptional · readonlyNo description.
selection.kindsreadonly string[]Optional · readonlyNo description.
contextMenu{ readonly target: "selection"; } | { readonly target: "background"; readonly background: PluginBackgroundHandle; }Optional · readonlyNo description.
background{ readonly handle: PluginBackgroundHandle; readonly status: "vacant" | "owned"; }Optional · readonlyNo description.
background.handlePluginBackgroundHandle<PluginJson>Required · readonlyNo description.
background.status"vacant" | "owned"Required · readonlyNo description.
run(context: PluginActionContext) => Promise<void>RequiredNo description.
Show raw definition
TypeScript
export interface PluginCommandContribution {
    readonly id: string;
    readonly label: string;
    readonly description?: string;
    readonly shortcut?: string;
    /** Exposes this command as a toolbar button in addition to the command palette. */
    readonly toolbar?: {
        /** Optional toolbar-only label; the command palette keeps the command label. */
        readonly label?: string;
        /** Built-in glyph key or explicit `./path.svg` bundled in the plugin artifact. */
        readonly icon?: string;
        readonly order: number;
        /**
         * Manual editor whose open state makes this button behave as an active
         * canvas tool. The host dismisses that editor after choosing empty canvas
         * or a different object, while clicks on the current selection keep it open.
         */
        readonly activeEditor?: string;
    };
    readonly selection?: {
        readonly minimum?: number;
        readonly maximum?: number;
        readonly kinds?: readonly string[];
    };
    readonly contextMenu?: {
        readonly target: 'selection';
    } | {
        readonly target: 'background';
        readonly background: PluginBackgroundHandle;
    };
    readonly background?: {
        readonly handle: PluginBackgroundHandle;
        readonly status: 'vacant' | 'owned';
    };
    run(context: PluginActionContext): Promise<void>;
}
Type

PluginContext

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
pluginIdstringRequired · readonlyNo description.
kind<const Id extends string>(id: Id) => KindBuilder<Id>RequiredNo description.
command(contribution: PluginCommandContribution) => voidRequiredNo description.
editor(contribution: PluginEditorContribution) => voidRequiredNo description.
importer(contribution: PluginImporterContribution) => voidRequiredNo description.
action(contribution: PluginAgentActionContribution) => voidRequiredNo description.
binding(type: string, definition: PluginBindingDefinition) => voidRequiredNo description.
backgroundSurface<Kind = unknown, State extends PluginJson = PluginJson>(contribution: PluginBackgroundSurfaceContribution<Kind, State>) => PluginBackgroundHandle<State>RequiredNo description.
migration(contribution: PluginMigrationContribution) => voidRequiredNo description.
renderer(contribution: PluginRendererContribution) => voidRequired

Registers trusted same-context rendering under `gpu-renderer`.

Show raw definition
TypeScript
export interface PluginContext {
    readonly pluginId: string;
    kind<const Id extends string>(id: Id): KindBuilder<Id>;
    command(contribution: PluginCommandContribution): void;
    editor(contribution: PluginEditorContribution): void;
    importer(contribution: PluginImporterContribution): void;
    action(contribution: PluginAgentActionContribution): void;
    binding(type: string, definition: PluginBindingDefinition): void;
    backgroundSurface<Kind = unknown, State extends PluginJson = PluginJson>(contribution: PluginBackgroundSurfaceContribution<Kind, State>): PluginBackgroundHandle<State>;
    migration(contribution: PluginMigrationContribution): void;
    /** Registers trusted same-context rendering under `gpu-renderer`. */
    renderer(contribution: PluginRendererContribution): void;
}
Type

PluginDefinition

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
register(context: PluginContext) => voidRequiredNo description.
Show raw definition
TypeScript
export interface PluginDefinition {
    register(context: PluginContext): void;
}
Type

PluginDocument

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
revisionnumberRequired · readonlyNo description.
inspect(nodeIds: readonly string[]) => readonly PluginNodeSnapshot[]RequiredNo description.
inspectKind(kindId: string, limit?: number) => readonly PluginNodeSnapshot[]Required

Reads a bounded projection of one declared kind.

recordCollection(collectionId: string, ownerKind: string) => PluginRecordCollection | nullRequired

Reads one opaque document-scoped collaborative collection.

background<State extends PluginJson>(handle: PluginBackgroundHandle<State>) => PluginBackgroundStatus<State>RequiredNo description.
transaction(label: string) => PluginDocumentTransactionRequiredNo description.
Show raw definition
TypeScript
export interface PluginDocument {
    readonly revision: number;
    inspect(nodeIds: readonly string[]): readonly PluginNodeSnapshot[];
    /** Reads a bounded projection of one declared kind. */
    inspectKind(kindId: string, limit?: number): readonly PluginNodeSnapshot[];
    /** Reads one opaque document-scoped collaborative collection. */
    recordCollection(collectionId: string, ownerKind: string): PluginRecordCollection | null;
    background<State extends PluginJson>(handle: PluginBackgroundHandle<State>): PluginBackgroundStatus<State>;
    transaction(label: string): PluginDocumentTransaction;
}
Type

PluginDocumentTransaction

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
create(node: PluginNodeCreate) => stringRequired

Stages a node and returns a transaction-local id usable by bind.

update(node: PluginNodeUpdate) => voidRequiredNo description.
delete(nodeId: string) => voidRequiredNo description.
bind(options: { readonly child: string; readonly role: string; readonly type: string; readonly parent: string; readonly payload: PluginJson; }) => PluginDocumentTransactionRequiredNo description.
unbind(options: { readonly child: string; readonly role: string; }) => PluginDocumentTransactionRequiredNo description.
setRecord(options: { readonly node: string; readonly recordId: string; readonly value: PluginJson | null; }) => PluginDocumentTransactionRequiredNo description.
setCollectionRecord(options: { readonly collectionId: string; readonly ownerKind: string; readonly recordId: string; readonly value: PluginJson | null; }) => PluginDocumentTransactionRequiredNo description.
claimBackground<State extends PluginJson>(handle: PluginBackgroundHandle<State>, state: NoInfer<State>) => PluginDocumentTransactionRequiredNo description.
releaseBackground(handle: PluginBackgroundHandle) => PluginDocumentTransactionRequiredNo description.
commit() => voidRequiredNo description.
Show raw definition
TypeScript
export interface PluginDocumentTransaction {
    /** Stages a node and returns a transaction-local id usable by bind. */
    create(node: PluginNodeCreate): string;
    update(node: PluginNodeUpdate): void;
    delete(nodeId: string): void;
    bind(options: {
        readonly child: string;
        readonly role: string;
        readonly type: string;
        readonly parent: string;
        readonly payload: PluginJson;
    }): this;
    unbind(options: {
        readonly child: string;
        readonly role: string;
    }): this;
    setRecord(options: {
        readonly node: string;
        readonly recordId: string;
        readonly value: PluginJson | null;
    }): this;
    setCollectionRecord(options: {
        readonly collectionId: string;
        readonly ownerKind: string;
        readonly recordId: string;
        readonly value: PluginJson | null;
    }): this;
    claimBackground<State extends PluginJson>(handle: PluginBackgroundHandle<State>, state: NoInfer<State>): this;
    releaseBackground(handle: PluginBackgroundHandle): this;
    commit(): void;
}
Type

PluginEditorContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
labelstringRequired · readonlyNo description.
surfacePluginEditorSurfaceRequired · readonlyNo description.
ordernumberOptional · readonlyNo description.
activation"automatic" | "manual"Optional · readonly

Automatic editors follow their selection requirement. Manual editors are hidden until this plugin opens them through `context.editors`.

selection{ readonly minimum?: number; readonly maximum?: number; readonly kinds?: readonly string[]; }Optional · readonly

Omit to allow any selection. When present, every selected node must match the declared kinds. This applies after the activation requirement.

selection.minimumnumberOptional · readonlyNo description.
selection.maximumnumberOptional · readonlyNo description.
selection.kindsreadonly string[]Optional · readonlyNo description.
backgroundPluginBackgroundHandle<PluginJson>Optional · readonlyNo description.
mount(container: HTMLElement, context: PluginActionContext) => void | (() => void) | PluginEditorInstanceRequired

Mounts trusted plugin UI directly into Editful's renderer. Plugins may use plain DOM or mount a bundled React root and must release owned resources.

Show raw definition
TypeScript
export interface PluginEditorContribution {
    readonly id: string;
    readonly label: string;
    readonly surface: PluginEditorSurface;
    readonly order?: number;
    /**
     * Automatic editors follow their selection requirement. Manual editors are
     * hidden until this plugin opens them through `context.editors`.
     */
    readonly activation?: 'automatic' | 'manual';
    /**
     * Omit to allow any selection. When present, every selected node must match
     * the declared kinds. This applies after the activation requirement.
     */
    readonly selection?: {
        readonly minimum?: number;
        readonly maximum?: number;
        readonly kinds?: readonly string[];
    };
    readonly background?: PluginBackgroundHandle;
    /**
     * Mounts trusted plugin UI directly into Editful's renderer. Plugins may use
     * plain DOM or mount a bundled React root and must release owned resources.
     */
    mount(container: HTMLElement, context: PluginActionContext): void | (() => void) | PluginEditorInstance;
}
Type

PluginEditorInstance

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
update(context: PluginActionContext) => voidOptionalNo description.
dispose() => voidRequiredNo description.
Show raw definition
TypeScript
export interface PluginEditorInstance {
    update?(context: PluginActionContext): void;
    dispose(): void;
}
Type

PluginEditors

#

Controls trusted plugin editor surfaces owned by the current plugin. Manual editor state is transient host UI state: it is bounded JSON, is not written to the canvas document, and disappears with the current runtime.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
open(editorId: string, state?: PluginJson) => voidRequiredNo description.
close(editorId: string) => voidRequiredNo description.
state(editorId: string) => PluginJson | undefinedRequiredNo description.
Show raw definition
TypeScript
/**
 * Controls trusted plugin editor surfaces owned by the current plugin.
 *
 * Manual editor state is transient host UI state: it is bounded JSON, is not
 * written to the canvas document, and disappears with the current runtime.
 */
export interface PluginEditors {
    open(editorId: string, state?: PluginJson): void;
    close(editorId: string): void;
    state(editorId: string): PluginJson | undefined;
}
Type

PluginEditorSurface

#
Show raw definition
TypeScript
export type PluginEditorSurface = 'toolbar' | 'left-sidebar' | 'right-sidebar';
Type

PluginImporterContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
labelstringRequired · readonlyNo description.
prioritynumberOptional · readonlyNo description.
match{ readonly mediaTypes?: readonly string[]; readonly extensions?: readonly string[]; readonly urlSchemes?: readonly string[]; readonly urlHosts?: readonly string[]; }Required · readonlyNo description.
match.mediaTypesreadonly string[]Optional · readonlyNo description.
match.extensionsreadonly string[]Optional · readonlyNo description.
match.urlSchemesreadonly string[]Optional · readonlyNo description.
match.urlHostsreadonly string[]Optional · readonlyNo description.
import(input: PluginImporterInput, context: PluginActionContext) => Promise<"handled" | "rejected">RequiredNo description.
Show raw definition
TypeScript
export interface PluginImporterContribution {
    readonly id: string;
    readonly label: string;
    readonly priority?: number;
    readonly match: {
        readonly mediaTypes?: readonly string[];
        readonly extensions?: readonly string[];
        readonly urlSchemes?: readonly string[];
        readonly urlHosts?: readonly string[];
    };
    import(input: PluginImporterInput, context: PluginActionContext): Promise<'handled' | 'rejected'>;
}
Type

PluginImporterInput

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
operation"paste" | "drop"Required · readonlyNo description.
textstringOptional · readonlyNo description.
uriListreadonly string[]Optional · readonlyNo description.
filesreadonly { readonly name: string; readonly mediaType: string; readonly byteLength: number; readBytes(): Promise<Uint8Array>; }[]Required · readonlyNo description.
point{ readonly x: number; readonly y: number; }Required · readonlyNo description.
point.xnumberRequired · readonlyNo description.
point.ynumberRequired · readonlyNo description.
Show raw definition
TypeScript
export interface PluginImporterInput {
    readonly operation: 'paste' | 'drop';
    readonly text?: string;
    readonly uriList?: readonly string[];
    readonly files: readonly {
        readonly name: string;
        readonly mediaType: string;
        readonly byteLength: number;
        readBytes(): Promise<Uint8Array>;
    }[];
    readonly point: {
        readonly x: number;
        readonly y: number;
    };
}
Type

PluginInteractionContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
labelstringRequired · readonlyNo description.
cursor"default" | "pointer"Required · readonlyNo description.
activate(node: PluginNodeSnapshot, context: PluginActionContext) => Promise<void>RequiredNo description.
Show raw definition
TypeScript
export interface PluginInteractionContribution {
    readonly id: string;
    readonly label: string;
    readonly cursor: 'pointer' | 'default';
    activate(node: PluginNodeSnapshot, context: PluginActionContext): Promise<void>;
}
Type

PluginJson

#
Show raw definition
TypeScript
export type PluginJson = null | PluginScalar | readonly PluginJson[] | {
    readonly [key: string]: PluginJson;
};
Type

PluginMigrationContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
run(context: PluginActionContext) => Promise<"unchanged" | "migrated">RequiredNo description.
Show raw definition
TypeScript
export interface PluginMigrationContribution {
    readonly id: string;
    run(context: PluginActionContext): Promise<'unchanged' | 'migrated'>;
}
Type

PluginNetwork

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
request(request: PluginNetworkRequest) => Promise<PluginNetworkResponse>RequiredNo description.
Show raw definition
TypeScript
export interface PluginNetwork {
    request(request: PluginNetworkRequest): Promise<PluginNetworkResponse>;
}
Type

PluginNetworkRequest

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
urlstringRequired · readonlyNo description.
method"GET" | "POST" | "PUT" | "PATCH" | "DELETE"Optional · readonlyNo description.
headersReadonly<Record<string, string>>Optional · readonlyNo description.
bodystring | Uint8Array<ArrayBufferLike>Optional · readonlyNo description.
response"text" | "json" | "bytes"Optional · readonlyNo description.
timeoutMsnumberOptional · readonlyNo description.
auth"board"Optional · readonly

Host-injected board credential, available only for the first-party service.

Show raw definition
TypeScript
export interface PluginNetworkRequest {
    readonly url: string;
    readonly method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
    readonly headers?: Readonly<Record<string, string>>;
    readonly body?: string | Uint8Array;
    readonly response?: 'json' | 'text' | 'bytes';
    readonly timeoutMs?: number;
    /** Host-injected board credential, available only for the first-party service. */
    readonly auth?: 'board';
}
Type

PluginNetworkResponse

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
statusnumberRequired · readonlyNo description.
headersReadonly<Record<string, string>>Required · readonlyNo description.
bodyPluginJson | Uint8Array<ArrayBufferLike>Required · readonlyNo description.
Show raw definition
TypeScript
export interface PluginNetworkResponse {
    readonly status: number;
    readonly headers: Readonly<Record<string, string>>;
    readonly body: PluginJson | string | Uint8Array;
}
Type

PluginNodeCreate

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
kindstringRequired · readonlyNo description.
xnumberRequired · readonlyNo description.
ynumberRequired · readonlyNo description.
widthnumberRequired · readonlyNo description.
heightnumberRequired · readonlyNo description.
rotationnumberOptional · readonlyNo description.
fillnumberOptional · readonlyNo description.
strokenumberOptional · readonlyNo description.
strokeWidthnumberOptional · readonlyNo description.
fontFamilynumberOptional · readonlyNo description.
fontSizenumberOptional · readonlyNo description.
fontWeightnumberOptional · readonlyNo description.
fontItalicbooleanOptional · readonlyNo description.
textAlignTextAlignOptional · readonlyNo description.
textColornumberOptional · readonlyNo description.
lineHeightnumberOptional · readonlyNo description.
letterSpacingnumberOptional · readonlyNo description.
textPaddingnumberOptional · readonlyNo description.
textVerticalAlignTextVerticalAlignOptional · readonlyNo description.
fieldsReadonly<Record<string, PluginScalar>>Optional · readonlyNo description.
Show raw definition
TypeScript
export interface PluginNodeCreate {
    readonly kind: string;
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
    readonly rotation?: number;
    readonly fill?: number;
    readonly stroke?: number;
    readonly strokeWidth?: number;
    readonly fontFamily?: TextFont;
    readonly fontSize?: number;
    readonly fontWeight?: number;
    readonly fontItalic?: boolean;
    readonly textAlign?: TextAlign;
    readonly textColor?: number;
    readonly lineHeight?: number;
    readonly letterSpacing?: number;
    readonly textPadding?: number;
    readonly textVerticalAlign?: TextVerticalAlign;
    readonly fields?: Readonly<Record<string, PluginScalar>>;
}
Type

PluginNodeSnapshot

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
kindstringRequired · readonlyNo description.
xnumberRequired · readonlyNo description.
ynumberRequired · readonlyNo description.
widthnumberRequired · readonlyNo description.
heightnumberRequired · readonlyNo description.
rotationnumberRequired · readonlyNo description.
lockedbooleanRequired · readonlyNo description.
fillnumberRequired · readonlyNo description.
strokenumberRequired · readonlyNo description.
strokeWidthnumberRequired · readonlyNo description.
fontFamilynumberRequired · readonlyNo description.
fontSizenumberRequired · readonlyNo description.
fontWeightnumberRequired · readonlyNo description.
fontItalicbooleanRequired · readonlyNo description.
textAlignTextAlignRequired · readonlyNo description.
textColornumberRequired · readonlyNo description.
lineHeightnumberRequired · readonlyNo description.
letterSpacingnumberRequired · readonlyNo description.
textPaddingnumberRequired · readonlyNo description.
textVerticalAlignTextVerticalAlignRequired · readonlyNo description.
bindingsreadonly { readonly role: string; readonly type: string; readonly parent: string; readonly payload: PluginJson; }[]Required · readonlyNo description.
records{ readonly version: number; readonly count: number; }Required · readonlyNo description.
records.versionnumberRequired · readonlyNo description.
records.countnumberRequired · readonlyNo description.
field<Value extends PluginScalar>(name: string) => Value | undefinedRequiredNo description.
Show raw definition
TypeScript
export interface PluginNodeSnapshot {
    readonly id: string;
    readonly kind: string;
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
    readonly rotation: number;
    readonly locked: boolean;
    readonly fill: number;
    readonly stroke: number;
    readonly strokeWidth: number;
    readonly fontFamily: TextFont;
    readonly fontSize: number;
    readonly fontWeight: number;
    readonly fontItalic: boolean;
    readonly textAlign: TextAlign;
    readonly textColor: number;
    readonly lineHeight: number;
    readonly letterSpacing: number;
    readonly textPadding: number;
    readonly textVerticalAlign: TextVerticalAlign;
    readonly bindings: readonly {
        readonly role: string;
        readonly type: string;
        readonly parent: string;
        readonly payload: PluginJson;
    }[];
    readonly records: {
        readonly version: number;
        readonly count: number;
    };
    field<Value extends PluginScalar>(name: string): Value | undefined;
}
Type

PluginNodeUpdate

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
xnumberOptional · readonlyNo description.
ynumberOptional · readonlyNo description.
widthnumberOptional · readonlyNo description.
heightnumberOptional · readonlyNo description.
rotationnumberOptional · readonlyNo description.
lockedbooleanOptional · readonlyNo description.
sendToBackbooleanOptional · readonlyNo description.
fillnumberOptional · readonlyNo description.
strokenumberOptional · readonlyNo description.
strokeWidthnumberOptional · readonlyNo description.
fontFamilynumberOptional · readonlyNo description.
fontSizenumberOptional · readonlyNo description.
fontWeightnumberOptional · readonlyNo description.
fontItalicbooleanOptional · readonlyNo description.
textAlignTextAlignOptional · readonlyNo description.
textColornumberOptional · readonlyNo description.
lineHeightnumberOptional · readonlyNo description.
letterSpacingnumberOptional · readonlyNo description.
textPaddingnumberOptional · readonlyNo description.
textVerticalAlignTextVerticalAlignOptional · readonlyNo description.
fieldsReadonly<Record<string, PluginScalar>>Optional · readonlyNo description.
Show raw definition
TypeScript
export interface PluginNodeUpdate {
    readonly id: string;
    readonly x?: number;
    readonly y?: number;
    readonly width?: number;
    readonly height?: number;
    readonly rotation?: number;
    readonly locked?: boolean;
    readonly sendToBack?: boolean;
    readonly fill?: number;
    readonly stroke?: number;
    readonly strokeWidth?: number;
    readonly fontFamily?: TextFont;
    readonly fontSize?: number;
    readonly fontWeight?: number;
    readonly fontItalic?: boolean;
    readonly textAlign?: TextAlign;
    readonly textColor?: number;
    readonly lineHeight?: number;
    readonly letterSpacing?: number;
    readonly textPadding?: number;
    readonly textVerticalAlign?: TextVerticalAlign;
    readonly fields?: Readonly<Record<string, PluginScalar>>;
}
Type

PluginNotification

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
titlestringRequired · readonly

Short notification heading rendered as text by the host.

messagestringOptional · readonly

Optional supporting copy rendered as text by the host.

tonePluginNotificationToneOptional · readonly

The host owns placement and lifetime. Info, success, and warning notices leave automatically; errors remain until resolved or dismissed.

Show raw definition
TypeScript
export interface PluginNotification {
    /** Short notification heading rendered as text by the host. */
    readonly title: string;
    /** Optional supporting copy rendered as text by the host. */
    readonly message?: string;
    /**
     * The host owns placement and lifetime. Info, success, and warning notices
     * leave automatically; errors remain until resolved or dismissed.
     */
    readonly tone?: PluginNotificationTone;
}
Type

PluginNotificationTone

#
Show raw definition
TypeScript
export type PluginNotificationTone = 'info' | 'success' | 'warning' | 'error';
Type

PluginPickerItem

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
valueValueRequired · readonlyNo description.
labelstringRequired · readonlyNo description.
descriptionstringOptional · readonlyNo description.
imageUrlstringOptional · readonlyNo description.
linksreadonly PluginPickerLink[]Optional · readonlyNo description.
Show raw definition
TypeScript
export interface PluginPickerItem<Value extends PluginJson = PluginJson> {
    readonly value: Value;
    readonly label: string;
    readonly description?: string;
    readonly imageUrl?: string;
    readonly links?: readonly PluginPickerLink[];
}
Type

PluginRecordCollection

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
ownerIdstringRequired · readonly

Stable document node id used when a user action needs history.

recordsReadonlyMap<string, string>Required · readonlyNo description.
versionnumberRequired · readonlyNo description.
Show raw definition
TypeScript
export interface PluginRecordCollection {
    /** Stable document node id used when a user action needs history. */
    readonly ownerId: string;
    readonly records: ReadonlyMap<string, string>;
    readonly version: number;
}
Type

PluginRemoteImageDimensions

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
widthnumberRequired · readonlyNo description.
heightnumberRequired · readonlyNo description.
Show raw definition
TypeScript
export interface PluginRemoteImageDimensions {
    readonly width: number;
    readonly height: number;
}
Type

PluginRemoteMedia

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
probe(url: string) => Promise<PluginRemoteImageDimensions>Required

Decodes an exact URL under this plugin's declared remote-media policy and leaves the result warm in the host image cache.

Show raw definition
TypeScript
export interface PluginRemoteMedia {
    /**
     * Decodes an exact URL under this plugin's declared remote-media policy and
     * leaves the result warm in the host image cache.
     */
    probe(url: string): Promise<PluginRemoteImageDimensions>;
}
Type

PluginRendererContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
create(host: PluginRendererHost) => PluginRendererInstanceRequiredNo description.
Show raw definition
TypeScript
export interface PluginRendererContribution {
    readonly id: string;
    create(host: PluginRendererHost): PluginRendererInstance;
}
Type

PluginRendererHeaders

#

A case-insensitive response-header snapshot returned by renderer I/O.

Show raw definition
TypeScript
/** A case-insensitive response-header snapshot returned by renderer I/O. */
export type PluginRendererHeaders = Readonly<Record<string, string>>;
Type

PluginRendererHost

#

Services retained for one renderer contribution's complete lifetime.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
glWebGL2RenderingContextRequired · readonly

The Editful-owned context. The host restores its state after each call.

boardIdstringOptional · readonly

Active collaborative board identity; absent for a local-only document.

networkPluginRendererNetworkRequired · readonlyNo description.
workersPluginRendererWorkersRequired · readonlyNo description.
requestFrame() => voidRequired

Schedules another host canvas frame without starting a private loop.

assetUrl(asset: string) => stringRequired

Resolves a validated plugin artifact asset to a retained URL.

records(surfaceId: string) => ReadonlyMap<string, string> | nullRequired

Current document records owned by a visible surface node.

setRecord(surfaceId: string, recordId: string, value: PluginJson | null) => booleanRequired

Writes an automatic renderer-owned cache record without adding user history.

recordCollection(collectionId: string, ownerKind: string) => PluginRecordCollection | nullRequired

Resolves an opaque document-scoped collection to its collaborative owner.

setCollectionRecord(collectionId: string, ownerKind: string, recordId: string, value: PluginJson | null) => booleanRequired

Writes an automatic record in a document-scoped collaborative collection.

Show raw definition
TypeScript
/** Services retained for one renderer contribution's complete lifetime. */
export interface PluginRendererHost {
    /** The Editful-owned context. The host restores its state after each call. */
    readonly gl: WebGL2RenderingContext;
    /** Active collaborative board identity; absent for a local-only document. */
    readonly boardId?: string;
    readonly network: PluginRendererNetwork;
    readonly workers: PluginRendererWorkers;
    /** Schedules another host canvas frame without starting a private loop. */
    requestFrame(): void;
    /** Resolves a validated plugin artifact asset to a retained URL. */
    assetUrl(asset: string): string;
    /** Current document records owned by a visible surface node. */
    records(surfaceId: string): ReadonlyMap<string, string> | null;
    /** Writes an automatic renderer-owned cache record without adding user history. */
    setRecord(surfaceId: string, recordId: string, value: PluginJson | null): boolean;
    /** Resolves an opaque document-scoped collection to its collaborative owner. */
    recordCollection(collectionId: string, ownerKind: string): PluginRecordCollection | null;
    /** Writes an automatic record in a document-scoped collaborative collection. */
    setCollectionRecord(collectionId: string, ownerKind: string, recordId: string, value: PluginJson | null): boolean;
}
Type

PluginRendererInstance

#

One renderer runtime shared by every surface emitted for its contribution.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
render(frame: PluginSurfaceFrame, target: PluginSurfaceRenderTarget) => void | booleanRequired

Return true when another frame is required after this one.

query(query: PluginSurfaceQuery) => PluginSurfaceQueryResult | nullOptionalNo description.
featureDrag(surfaceId: string, phase: PluginSurfaceFeatureDragPhase, point: PluginSurfacePoint) => PluginSurfaceFeatureDragResultOptionalNo description.
place(surfaceId: string, nodeId: string, kindId: string, point: PluginSurfacePoint) => PluginSurfacePlacementResult | falseOptional

Handles a create-tool placement without exposing domain data to core.

clearFeatureSelection(surfaceId: string) => voidOptional

Clears renderer-owned selection visuals for one surface.

chrome(surfaceId: string) => PluginSurfaceChrome | nullOptional

Returns domain-owned labels/links positioned by generic host chrome.

surfaceDisposed(surfaceId: string) => voidOptionalNo description.
contextLost() => voidOptionalNo description.
contextRestored() => voidOptionalNo description.
dispose() => voidRequiredNo description.
Show raw definition
TypeScript
/** One renderer runtime shared by every surface emitted for its contribution. */
export interface PluginRendererInstance {
    /** Return true when another frame is required after this one. */
    render(frame: PluginSurfaceFrame, target: PluginSurfaceRenderTarget): void | boolean;
    query?(query: PluginSurfaceQuery): PluginSurfaceQueryResult | null;
    featureDrag?(surfaceId: string, phase: PluginSurfaceFeatureDragPhase, point: PluginSurfacePoint): PluginSurfaceFeatureDragResult;
    /** Handles a create-tool placement without exposing domain data to core. */
    place?(surfaceId: string, nodeId: string, kindId: string, point: PluginSurfacePoint): PluginSurfacePlacementResult | false;
    /** Clears renderer-owned selection visuals for one surface. */
    clearFeatureSelection?(surfaceId: string): void;
    /** Returns domain-owned labels/links positioned by generic host chrome. */
    chrome?(surfaceId: string): PluginSurfaceChrome | null;
    surfaceDisposed?(surfaceId: string): void;
    contextLost?(): void;
    contextRestored?(): void;
    dispose(): void;
}
Type

PluginRendererNetwork

#

Renderer-lifetime, policy-checked network access for tiles and style data.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
request(request: PluginRendererRequest) => Promise<PluginRendererResponse>RequiredNo description.
Show raw definition
TypeScript
/** Renderer-lifetime, policy-checked network access for tiles and style data. */
export interface PluginRendererNetwork {
    request(request: PluginRendererRequest): Promise<PluginRendererResponse>;
}
Type

PluginRendererRequest

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
urlstringRequired · readonlyNo description.
method"GET" | "POST"Optional · readonlyNo description.
headersReadonly<Record<string, string>>Optional · readonlyNo description.
bodyArrayBufferOptional · readonlyNo description.
signalAbortSignalOptional · readonlyNo description.
auth"board"Optional · readonly

Host-injected active-board credential for a declared first-party origin.

prioritynumberOptional · readonly

Lower values are more urgent.

Show raw definition
TypeScript
export interface PluginRendererRequest {
    readonly url: string;
    readonly method?: 'GET' | 'POST';
    readonly headers?: PluginRendererHeaders;
    readonly body?: ArrayBuffer;
    readonly signal?: AbortSignal;
    /** Host-injected active-board credential for a declared first-party origin. */
    readonly auth?: 'board';
    /** Lower values are more urgent. */
    readonly priority?: number;
}
Type

PluginRendererResponse

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
urlstringRequired · readonlyNo description.
statusnumberRequired · readonlyNo description.
headersReadonly<Record<string, string>>Required · readonlyNo description.
bodyArrayBufferRequired · readonlyNo description.
Show raw definition
TypeScript
export interface PluginRendererResponse {
    readonly url: string;
    readonly status: number;
    readonly headers: PluginRendererHeaders;
    readonly body: ArrayBuffer;
}
Type

PluginRendererWorker

#

A validated plugin-relative worker owned and terminated by the host.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
postMessage(message: unknown, transfer?: readonly Transferable[]) => voidRequiredNo description.
onMessage(listener: (message: unknown) => void) => () => voidRequiredNo description.
onError(listener: (error: ErrorEvent) => void) => () => voidRequiredNo description.
terminate() => voidRequiredNo description.
Show raw definition
TypeScript
/** A validated plugin-relative worker owned and terminated by the host. */
export interface PluginRendererWorker {
    postMessage(message: unknown, transfer?: readonly Transferable[]): void;
    onMessage(listener: (message: unknown) => void): () => void;
    onError(listener: (error: ErrorEvent) => void): () => void;
    terminate(): void;
}
Type

PluginRendererWorkers

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
create(asset: string, options?: { readonly name?: string; }) => PluginRendererWorkerRequiredNo description.
Show raw definition
TypeScript
export interface PluginRendererWorkers {
    create(asset: string, options?: {
        readonly name?: string;
    }): PluginRendererWorker;
}
Type

PluginScalar

#
Show raw definition
TypeScript
export type PluginScalar = string | number | boolean;
Type

PluginSecrets

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
get(name: string) => Promise<string | undefined>RequiredNo description.
Show raw definition
TypeScript
export interface PluginSecrets {
    get(name: string): Promise<string | undefined>;
}
Type

PluginSelection

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
snapshot() => PluginSelectionSummaryRequiredNo description.
nodeIds() => readonly string[]RequiredNo description.
Show raw definition
TypeScript
export interface PluginSelection {
    snapshot(): PluginSelectionSummary;
    nodeIds(): readonly string[];
}
Type

PluginSelectionSummary

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
countnumberRequired · readonlyNo description.
kindIdsreadonly string[]Required · readonlyNo description.
Show raw definition
TypeScript
export interface PluginSelectionSummary {
    readonly count: number;
    readonly kindIds: readonly string[];
}
Type

PluginSettings

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
get(key: string) => PluginScalar | undefinedRequiredNo description.
Show raw definition
TypeScript
export interface PluginSettings {
    get(key: string): PluginScalar | undefined;
}
Type

PluginSurfaceChrome

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
badgesreadonly PluginSurfaceChromeBadge[]Optional · readonlyNo description.
Show raw definition
TypeScript
export interface PluginSurfaceChrome {
    readonly badges?: readonly PluginSurfaceChromeBadge[];
}
Type

PluginSurfaceChromeBadge

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
idstringRequired · readonlyNo description.
labelstringRequired · readonlyNo description.
detailsstringOptional · readonlyNo description.
hrefstringOptional · readonlyNo description.
corner"bottom-right"Required · readonlyNo description.
Show raw definition
TypeScript
export interface PluginSurfaceChromeBadge {
    readonly id: string;
    readonly label: string;
    readonly details?: string;
    readonly href?: string;
    readonly corner: 'bottom-right';
}
Type

PluginSurfaceEditorRequest

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
editorIdstringRequired · readonly

Manual editor contribution owned by the surface renderer's plugin.

statePluginJsonOptional · readonly

Opaque transient state copied and passed back to that editor.

Show raw definition
TypeScript
export interface PluginSurfaceEditorRequest {
    /** Manual editor contribution owned by the surface renderer's plugin. */
    readonly editorId: string;
    /** Opaque transient state copied and passed back to that editor. */
    readonly state?: PluginJson;
}
Type

PluginSurfaceFeatureDragPhase

#
Show raw definition
TypeScript
export type PluginSurfaceFeatureDragPhase = 'start' | 'move' | 'end' | 'cancel';
Type

PluginSurfaceFeatureDragResult

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
mutationPluginSurfaceRecordMutationRequired · readonlyNo description.
editorPluginSurfaceEditorRequestOptional · readonlyNo description.
Show raw definition
TypeScript
export type PluginSurfaceFeatureDragResult = boolean | {
    readonly mutation: PluginSurfaceRecordMutation;
    readonly editor?: PluginSurfaceEditorRequest;
};
Type

PluginSurfaceFeatureInteraction

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
featureIdstringRequired · readonly

Stable plugin-owned identity for the interactive feature.

draggablebooleanOptional · readonlyNo description.
recordOmit<PluginSurfaceRecordMutation, "historyLabel">Optional · readonly

Current record state used to begin an undoable gesture.

record.recordIdstringRequired · readonlyNo description.
record.valuePluginJsonRequired · readonlyNo description.
record.recordOwnerIdstringOptional · readonly

Collaborative record owner; omitted for a surface-local record.

editorPluginSurfaceEditorRequestOptional · readonlyNo description.
Show raw definition
TypeScript
export interface PluginSurfaceFeatureInteraction {
    /** Stable plugin-owned identity for the interactive feature. */
    readonly featureId: string;
    readonly draggable?: boolean;
    /** Current record state used to begin an undoable gesture. */
    readonly record?: Omit<PluginSurfaceRecordMutation, 'historyLabel'>;
    readonly editor?: PluginSurfaceEditorRequest;
}
Type

PluginSurfaceFrame

#

Immutable state for one visible retained surface in the current frame.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
surfaceIdstringRequired · readonly

Stable for this document node while the renderer runtime is alive.

nodeIdstringRequired · readonly

Stable public document node id that emitted this retained surface.

stateReadonly<Record<string, PluginJson>>Required · readonlyNo description.
cssWidthnumberRequired · readonlyNo description.
cssHeightnumberRequired · readonlyNo description.
viewportCenterPluginSurfacePointRequired · readonly

CSS-pixel displacement of this retained viewport's center from the center of the complete surface. Large surfaces may be cropped to the host camera so renderers do not allocate pixels for offscreen content.

renderScalenumberRequired · readonly

Realized surface pixels per world unit after host GPU limits and budgeting. Equals `canvasZoom` while the retained target can render at full DPR. A renderer should derive projection scale from this value so subsequent compositor scaling cannot change the surface's logical bounds.

canvasZoomnumberRequired · readonlyNo description.
timenumberRequired · readonlyNo description.
Show raw definition
TypeScript
/** Immutable state for one visible retained surface in the current frame. */
export interface PluginSurfaceFrame {
    /** Stable for this document node while the renderer runtime is alive. */
    readonly surfaceId: string;
    /** Stable public document node id that emitted this retained surface. */
    readonly nodeId: string;
    readonly state: Readonly<Record<string, PluginJson>>;
    readonly cssWidth: number;
    readonly cssHeight: number;
    /**
     * CSS-pixel displacement of this retained viewport's center from the center
     * of the complete surface. Large surfaces may be cropped to the host camera
     * so renderers do not allocate pixels for offscreen content.
     */
    readonly viewportCenter: PluginSurfacePoint;
    /**
     * Realized surface pixels per world unit after host GPU limits and budgeting.
     * Equals `canvasZoom` while the retained target can render at full DPR. A
     * renderer should derive projection scale from this value so subsequent
     * compositor scaling cannot change the surface's logical bounds.
     */
    readonly renderScale: number;
    readonly canvasZoom: number;
    readonly time: number;
}
Type

PluginSurfacePlacementResult

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
mutationPluginSurfaceRecordMutationRequired · readonlyNo description.
selectionPluginSurfaceFeatureInteractionOptional · readonlyNo description.
Show raw definition
TypeScript
export interface PluginSurfacePlacementResult {
    readonly mutation: PluginSurfaceRecordMutation;
    readonly selection?: PluginSurfaceFeatureInteraction;
}
Type

PluginSurfacePoint

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
xnumberRequired · readonlyNo description.
ynumberRequired · readonlyNo description.
Show raw definition
TypeScript
export interface PluginSurfacePoint {
    readonly x: number;
    readonly y: number;
}
Type

PluginSurfaceQuery

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
surfaceIdstringRequired · readonlyNo description.
nodeIdstringRequired · readonlyNo description.
stateReadonly<Record<string, PluginJson>>Required · readonlyNo description.
pointPluginSurfacePointRequired · readonly

Surface-local CSS pixels from its top-left corner.

Show raw definition
TypeScript
export interface PluginSurfaceQuery {
    readonly surfaceId: string;
    readonly nodeId: string;
    readonly state: Readonly<Record<string, PluginJson>>;
    /** Surface-local CSS pixels from its top-left corner. */
    readonly point: PluginSurfacePoint;
}
Type

PluginSurfaceQueryResult

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
cursor"default" | "pointer" | "grab" | "crosshair"Optional · readonlyNo description.
featuresreadonly PluginJson[]Optional · readonlyNo description.
statusTextstringOptional · readonly

Optional short pointer-local status rendered in host chrome.

interactionPluginSurfaceFeatureInteractionOptional · readonly

Optional host interaction for the topmost feature at the query point. The host treats the feature identity and editor state as opaque plugin data; it only coordinates selection, document writes, history and UI.

Show raw definition
TypeScript
export interface PluginSurfaceQueryResult {
    readonly cursor?: 'default' | 'pointer' | 'grab' | 'crosshair';
    readonly features?: readonly PluginJson[];
    /** Optional short pointer-local status rendered in host chrome. */
    readonly statusText?: string;
    /**
     * Optional host interaction for the topmost feature at the query point.
     * The host treats the feature identity and editor state as opaque plugin
     * data; it only coordinates selection, document writes, history and UI.
     */
    readonly interaction?: PluginSurfaceFeatureInteraction;
}
Type

PluginSurfaceRecordMutation

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
recordIdstringRequired · readonlyNo description.
valuePluginJsonRequired · readonlyNo description.
recordOwnerIdstringOptional · readonly

Collaborative record owner; omitted for a surface-local record.

historyLabelstringRequired · readonly

User-facing undo label owned by the plugin's domain vocabulary.

Show raw definition
TypeScript
export interface PluginSurfaceRecordMutation {
    readonly recordId: string;
    readonly value: PluginJson;
    /** Collaborative record owner; omitted for a surface-local record. */
    readonly recordOwnerId?: string;
    /** User-facing undo label owned by the plugin's domain vocabulary. */
    readonly historyLabel: string;
}
Type

PluginSurfaceRenderTarget

#

Host-owned framebuffer and dimensions supplied for one surface render.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
framebufferWebGLFramebufferRequired · readonlyNo description.
widthnumberRequired · readonlyNo description.
heightnumberRequired · readonlyNo description.
devicePixelRationumberRequired · readonlyNo description.
Show raw definition
TypeScript
/** Host-owned framebuffer and dimensions supplied for one surface render. */
export interface PluginSurfaceRenderTarget {
    readonly framebuffer: WebGLFramebuffer;
    readonly width: number;
    readonly height: number;
    readonly devicePixelRatio: number;
}
Type

PrimitiveWriter

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
quad(x: number, y: number, halfW: number, halfH: number, rotation: number, cornerRadius: number, strokeWidth: number, primitive: Primitive, fill: number, stroke: number) => voidRequiredNo description.
textBlock(block: { x: number; y: number; halfW: number; halfH: number; text: string; style: TextStyle; font: number; wrapWidth: number; padding: number; verticalPadding?: number; verticalAlign: number; readonly background?: { readonly fill: number; readonly stroke?: number; readonly strokeWidth?: number; readonly cornerRadius: number; }; }) => voidRequiredNo description.
imageQuad{ (assetId: string, x: number, y: number, halfW: number, halfH: number, rotation: number): void; (source: { readonly url: string; }, x: number, y: number, halfW: number, halfH: number, rotation: number): void; }RequiredNo description.
interactionRegion(interactionId: string, x: number, y: number, width: number, height: number, semantics: { readonly role: "button" | "link"; readonly label: string; }) => voidRequiredNo description.
surface(rendererId: string, state: Readonly<Record<string, PluginJson>>, x: number, y: number, halfW: number, halfH: number, rotation: number) => voidRequired

Places a retained GPU surface in this node's paint order. The renderer contribution is resolved by id. `state` is copied when the dirty scene chunk is gathered and must contain only bounded JSON data; fetched resources and mutable renderer state belong to the renderer instance, never the document or pack callback.

Show raw definition
TypeScript
export interface PrimitiveWriter {
    quad(x: number, y: number, halfW: number, halfH: number, rotation: number, cornerRadius: number, strokeWidth: number, primitive: Primitive, fill: number, stroke: number): void;
    textBlock(block: {
        x: number;
        y: number;
        halfW: number;
        halfH: number;
        text: string;
        style: TextStyle;
        font: number;
        wrapWidth: number;
        padding: number;
        /** Overrides vertical inset while preserving `padding` horizontally. */
        verticalPadding?: number;
        verticalAlign: number;
        readonly background?: {
            readonly fill: number;
            readonly stroke?: number;
            readonly strokeWidth?: number;
            readonly cornerRadius: number;
        };
    }): void;
    imageQuad(assetId: string, x: number, y: number, halfW: number, halfH: number, rotation: number): void;
    imageQuad(source: {
        readonly url: string;
    }, x: number, y: number, halfW: number, halfH: number, rotation: number): void;
    interactionRegion(interactionId: string, x: number, y: number, width: number, height: number, semantics: {
        readonly role: 'button' | 'link';
        readonly label: string;
    }): void;
    /**
     * Places a retained GPU surface in this node's paint order.
     *
     * The renderer contribution is resolved by id. `state` is copied when the
     * dirty scene chunk is gathered and must contain only bounded JSON data;
     * fetched resources and mutable renderer state belong to the renderer
     * instance, never the document or pack callback.
     */
    surface(rendererId: string, state: Readonly<Record<string, PluginJson>>, x: number, y: number, halfW: number, halfH: number, rotation: number): void;
}
Type

StyleDefaults

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
fillnumberOptional · readonlyNo description.
strokenumberOptional · readonlyNo description.
strokeWidthnumberOptional · readonlyNo description.
cornerRadiusnumberOptional · readonlyNo description.
fontSizenumberOptional · readonlyNo description.
textColornumberOptional · readonlyNo description.
lineHeightnumberOptional · readonlyNo description.
textSizingnumberOptional · readonlyNo description.
Show raw definition
TypeScript
export interface StyleDefaults {
    readonly fill?: number;
    readonly stroke?: number;
    readonly strokeWidth?: number;
    readonly cornerRadius?: number;
    readonly fontSize?: number;
    readonly textColor?: number;
    readonly lineHeight?: number;
    readonly textSizing?: number;
}
Type

TextContribution

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
fieldFieldHandle<string, Kind>Required · readonlyNo description.
paddingnumber | "node"Required · readonlyNo description.
verticalAlign"center" | "node" | "top"Required · readonlyNo description.
font"node" | "shared"Required · readonlyNo description.
width"user" | "auto" | "derived"Required · readonlyNo description.
height"user" | "auto" | "derived"Required · readonlyNo description.
minWidthnumberOptional · readonlyNo description.
minHeightnumberOptional · readonlyNo description.
Show raw definition
TypeScript
export interface TextContribution<Kind = unknown> {
    readonly field: FieldHandle<string, Kind>;
    readonly padding: number | 'node';
    readonly verticalAlign: 'top' | 'center' | 'node';
    readonly font: 'shared' | 'node';
    readonly width: 'user' | 'auto' | 'derived';
    readonly height: 'user' | 'auto' | 'derived';
    readonly minWidth?: number;
    readonly minHeight?: number;
}
Type

TextStyle

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
family"sans" | "serif" | "mono"Required · readonlyNo description.
weightnumberRequired · readonlyNo description.
italicbooleanRequired · readonlyNo description.
sizenumberRequired · readonlyNo description.
lineHeightnumberRequired · readonlyNo description.
letterSpacingnumberRequired · readonlyNo description.
align"left" | "center" | "right"Required · readonlyNo description.
colornumberRequired · readonlyNo description.
Show raw definition
TypeScript
export interface TextStyle {
    readonly family: 'sans' | 'serif' | 'mono';
    readonly weight: number;
    readonly italic: boolean;
    readonly size: number;
    readonly lineHeight: number;
    readonly letterSpacing: number;
    readonly align: 'left' | 'center' | 'right';
    readonly color: number;
}
Type

ViewBoxOptions

#

Paint, padding, and optional child content for a container.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
childViewNode<Kind>Optional · readonly

The single child inside the box.

paddingnumber | ViewInsetsOptional · readonly

Defaults to zero. Physical sides override their logical axis.

fill"node" | ViewValue<number, Kind>Optional · readonly

Packed fill, field-bound fill, or the node's fill.

stroke"node" | ViewValue<number, Kind>Optional · readonly

Packed stroke, field-bound stroke, or the node's stroke.

strokeWidthnumber | "node"Optional · readonly

Stroke width in canvas units, or the node's stroke width.

cornerRadiusnumber | "node" | "full"Optional · readonly

Corner radius, the node's radius, or a full pill radius.

Show raw definition
TypeScript
/** Paint, padding, and optional child content for a container. */
export interface ViewBoxOptions<Kind = unknown> {
    /** The single child inside the box. */
    readonly child?: ViewNode<Kind>;
    /** Defaults to zero. Physical sides override their logical axis. */
    readonly padding?: number | ViewInsets;
    /** Packed fill, field-bound fill, or the node's fill. */
    readonly fill?: ViewValue<number, Kind> | 'node';
    /** Packed stroke, field-bound stroke, or the node's stroke. */
    readonly stroke?: ViewValue<number, Kind> | 'node';
    /** Stroke width in canvas units, or the node's stroke width. */
    readonly strokeWidth?: number | 'node';
    /** Corner radius, the node's radius, or a full pill radius. */
    readonly cornerRadius?: number | 'node' | 'full';
}
Type

ViewBuilder

#

Kind-scoped factory for declarative view primitives.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
text(value: ViewValue<string, Kind>, options: ViewTextOptions<Kind>) => ViewNode<Kind>Required

Creates measured display text from a literal or field value.

image(source: ViewImageSource<Kind>, options: ViewImageOptions) => ViewNode<Kind>Required

Creates a fixed-height remote or document-backed image.

box(options: ViewBoxOptions<Kind>) => ViewNode<Kind>Required

Creates a painted container with zero or one child.

stack(options: ViewStackOptions<Kind>) => ViewNode<Kind>Required

Creates an inline or block layout container.

spacer() => ViewNode<Kind>Required

Creates flexible space within an inline stack.

Show raw definition
TypeScript
/** Kind-scoped factory for declarative view primitives. */
export interface ViewBuilder<Kind = unknown> {
    /** Creates measured display text from a literal or field value. */
    text(value: ViewValue<string, Kind>, options: ViewTextOptions<Kind>): ViewNode<Kind>;
    /** Creates a fixed-height remote or document-backed image. */
    image(source: ViewImageSource<Kind>, options: ViewImageOptions): ViewNode<Kind>;
    /** Creates a painted container with zero or one child. */
    box(options: ViewBoxOptions<Kind>): ViewNode<Kind>;
    /** Creates an inline or block layout container. */
    stack(options: ViewStackOptions<Kind>): ViewNode<Kind>;
    /** Creates flexible space within an inline stack. */
    spacer(): ViewNode<Kind>;
}
Type

ViewContribution

#

Root view and host-owned sizing policy registered with a node kind.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
rootViewNode<Kind>Required · readonly

Root of the declarative view tree.

width{ readonly mode: "user"; readonly min?: number; }Required · readonly

User-resizable width and optional minimum width.

width.mode"user"Required · readonlyNo description.
width.minnumberOptional · readonlyNo description.
height{ readonly mode: "fit-content"; }Required · readonly

Height derived from the measured root content.

height.mode"fit-content"Required · readonlyNo description.
Show raw definition
TypeScript
/** Root view and host-owned sizing policy registered with a node kind. */
export interface ViewContribution<Kind = unknown> {
    /** Root of the declarative view tree. */
    readonly root: ViewNode<Kind>;
    /** User-resizable width and optional minimum width. */
    readonly width: {
        readonly mode: 'user';
        readonly min?: number;
    };
    /** Height derived from the measured root content. */
    readonly height: {
        readonly mode: 'fit-content';
    };
}
Type

ViewImageOptions

#

Fixed image dimensions within a declarative view.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
widthnumber | "fill"Required · readonly

Fixed width, or all available block width.

heightnumberRequired · readonly

Fixed height in canvas units.

Show raw definition
TypeScript
/** Fixed image dimensions within a declarative view. */
export interface ViewImageOptions {
    /** Fixed width, or all available block width. */
    readonly width: number | 'fill';
    /** Fixed height in canvas units. */
    readonly height: number;
}
Type

ViewImageSource

#

Remote or document-backed source for an image primitive.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
urlViewValue<string, Kind>Optional · readonlyNo description.
assetViewValue<string, Kind>Optional · readonlyNo description.
Show raw definition
TypeScript
/** Remote or document-backed source for an image primitive. */
export type ViewImageSource<Kind = unknown> = {
    readonly url: ViewValue<string, Kind>;
} | {
    readonly asset: ViewValue<string, Kind>;
};
Type

ViewInsets

#

Logical and physical insets for a view box. Physical sides take precedence.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
inlinenumberOptional · readonly

Left and right inset.

blocknumberOptional · readonly

Top and bottom inset.

topnumberOptional · readonly

Top inset.

rightnumberOptional · readonly

Right inset.

bottomnumberOptional · readonly

Bottom inset.

leftnumberOptional · readonly

Left inset.

Show raw definition
TypeScript
/** Logical and physical insets for a view box. Physical sides take precedence. */
export interface ViewInsets {
    /** Left and right inset. */
    readonly inline?: number;
    /** Top and bottom inset. */
    readonly block?: number;
    /** Top inset. */
    readonly top?: number;
    /** Right inset. */
    readonly right?: number;
    /** Bottom inset. */
    readonly bottom?: number;
    /** Left inset. */
    readonly left?: number;
}
Type

ViewNode

#

Opaque declarative view node created by a kind's {@link ViewBuilder}.

Show raw definition
TypeScript
/** Opaque declarative view node created by a kind's {@link ViewBuilder}. */
export interface ViewNode<Kind = unknown> {
    readonly [VIEW_NODE_KIND]: (kind: Kind) => Kind;
}
Type

ViewStackOptions

#

Ordered children on the inline or block axis.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
axis"inline" | "block"Required · readonly

Inline lays out left to right. Block lays out top to bottom.

childrenreadonly ViewNode<Kind>[]Required · readonly

Ordered view nodes owned by the same kind.

gapnumberOptional · readonly

Defaults to zero.

align"center" | "start" | "end"Optional · readonly

Inline cross-axis alignment. Defaults to center.

Show raw definition
TypeScript
/** Ordered children on the inline or block axis. */
export interface ViewStackOptions<Kind = unknown> {
    /** Inline lays out left to right. Block lays out top to bottom. */
    readonly axis: 'inline' | 'block';
    /** Ordered view nodes owned by the same kind. */
    readonly children: readonly ViewNode<Kind>[];
    /** Defaults to zero. */
    readonly gap?: number;
    /** Inline cross-axis alignment. Defaults to center. */
    readonly align?: 'start' | 'center' | 'end';
}
Type

ViewTextFont

#

Font metrics used by both text measurement and paint.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
familynumberRequired · readonly

Bundled font family.

sizenumber | "node"Required · readonly

Font size in canvas units, or the node's font size.

weightnumber | "node"Required · readonly

Numeric font weight, or the node's font weight.

italicboolean | "node"Optional · readonly

Italic state, or the node's italic state.

lineHeightnumber | "node"Required · readonly

Unitless line height, or the node's line height.

letterSpacingnumber | "node"Optional · readonly

Letter spacing in canvas units, or the node's letter spacing.

align"left" | "center" | "right"Optional · readonly

Horizontal text alignment.

Show raw definition
TypeScript
/** Font metrics used by both text measurement and paint. */
export interface ViewTextFont {
    /** Bundled font family. */
    readonly family: TextFont;
    /** Font size in canvas units, or the node's font size. */
    readonly size: number | 'node';
    /** Numeric font weight, or the node's font weight. */
    readonly weight: number | 'node';
    /** Italic state, or the node's italic state. */
    readonly italic?: boolean | 'node';
    /** Unitless line height, or the node's line height. */
    readonly lineHeight: number | 'node';
    /** Letter spacing in canvas units, or the node's letter spacing. */
    readonly letterSpacing?: number | 'node';
    /** Horizontal text alignment. */
    readonly align?: 'left' | 'center' | 'right';
}
Type

ViewTextOptions

#

Options for a display-only text primitive.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
fontViewTextFontRequired · readonly

Font metrics shared by measurement and paint.

color"node" | ViewValue<number, Kind>Required · readonly

Packed color, field-bound color, or the node's text color.

wrapbooleanOptional · readonly

Defaults to true. False measures the text at its intrinsic width.

interaction{ readonly id: string; readonly role: "button" | "link"; readonly label: string; }Optional · readonly

Optional pointer semantics for the text bounds.

interaction.idstringRequired · readonly

Identifier reported to the plugin interaction handler.

interaction.role"button" | "link"Required · readonly

Accessible interaction role.

interaction.labelstringRequired · readonly

Accessible label for the interaction region.

Show raw definition
TypeScript
/** Options for a display-only text primitive. */
export interface ViewTextOptions<Kind = unknown> {
    /** Font metrics shared by measurement and paint. */
    readonly font: ViewTextFont;
    /** Packed color, field-bound color, or the node's text color. */
    readonly color: ViewValue<number, Kind> | 'node';
    /** Defaults to true. False measures the text at its intrinsic width. */
    readonly wrap?: boolean;
    /** Optional pointer semantics for the text bounds. */
    readonly interaction?: {
        /** Identifier reported to the plugin interaction handler. */
        readonly id: string;
        /** Accessible interaction role. */
        readonly role: 'button' | 'link';
        /** Accessible label for the interaction region. */
        readonly label: string;
    };
}
Type

ViewValue

#

A fixed value or a field handle resolved from the rendered canvas node.

Show raw definition
TypeScript
/** A fixed value or a field handle resolved from the rendered canvas node. */
export type ViewValue<Value, Kind = unknown> = Value | FieldHandle<Value, Kind>;

Constants

Constant

EDITFUL_PLUGIN_API_VERSION

#

Runtime plugin contract implemented by compatible Editful 0.9.x releases.

Show raw definition
TypeScript
/** Runtime plugin contract implemented by compatible Editful 0.9.x releases. */
export declare const EDITFUL_PLUGIN_API_VERSION: "0.9.0";
Constant

LineMarker

#

Endpoint decoration understood by {@link Primitive.Line}.

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
None0Required · readonlyNo description.
OpenArrow1Required · readonlyNo description.
SolidArrow2Required · readonlyNo description.
Cap3Required · readonlyNo description.
Show raw definition
TypeScript
/** Endpoint decoration understood by {@link Primitive.Line}. */
export declare const LineMarker: {
    readonly None: 0;
    readonly OpenArrow: 1;
    readonly SolidArrow: 2;
    readonly Cap: 3;
};
export type LineMarker = (typeof LineMarker)[keyof typeof LineMarker];
Constant

Primitive

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
RoundRect0Required · readonlyNo description.
Ellipse1Required · readonlyNo description.
None2Required · readonlyNo description.
Line3Required · readonly

Procedural straight line. `cornerRadius` carries `encodeLineMarkers(...)`.

TextBlock100Required · readonlyNo description.
ImageQuad101Required · readonlyNo description.
Show raw definition
TypeScript
export declare const Primitive: {
    readonly RoundRect: 0;
    readonly Ellipse: 1;
    readonly None: 2;
    /** Procedural straight line. `cornerRadius` carries `encodeLineMarkers(...)`. */
    readonly Line: 3;
    readonly TextBlock: 100;
    readonly ImageQuad: 101;
};
export type Primitive = (typeof Primitive)[keyof typeof Primitive];
Constant

TextAlign

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
Left0Required · readonlyNo description.
Center1Required · readonlyNo description.
Right2Required · readonlyNo description.
Show raw definition
TypeScript
export declare const TextAlign: {
    readonly Left: 0;
    readonly Center: 1;
    readonly Right: 2;
};
export type TextAlign = (typeof TextAlign)[keyof typeof TextAlign];
Constant

TextFont

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
Sans0Required · readonlyNo description.
Serif1Required · readonlyNo description.
Mono2Required · readonlyNo description.
Show raw definition
TypeScript
export declare const TextFont: {
    readonly Sans: 0;
    readonly Serif: 1;
    readonly Mono: 2;
};
export type TextFont = number;
Constant

TextSizing

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
Fixed0Required · readonlyNo description.
AutoWidth1Required · readonlyNo description.
AutoHeight2Required · readonlyNo description.
Auto3Required · readonlyNo description.
Show raw definition
TypeScript
export declare const TextSizing: {
    readonly Fixed: 0;
    readonly AutoWidth: 1;
    readonly AutoHeight: 2;
    readonly Auto: 3;
};
Constant

TextVerticalAlign

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
Top0Required · readonlyNo description.
Middle1Required · readonlyNo description.
Bottom2Required · readonlyNo description.
Show raw definition
TypeScript
export declare const TextVerticalAlign: {
    readonly Top: 0;
    readonly Middle: 1;
    readonly Bottom: 2;
};
export type TextVerticalAlign = (typeof TextVerticalAlign)[keyof typeof TextVerticalAlign];
Constant

UNBOUNDED_WRAP

#

Sentinel used by text layout when wrapping is disabled.

Show raw definition
TypeScript
/** Sentinel used by text layout when wrapping is disabled. */
export declare const UNBOUNDED_WRAP: number;