Canvas SDK API.
Every public export from @editful/canvas-sdk.
Functions
definePlugin
Identity helper preserving the definition's precise inferred type.
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
plugin | Definition | Required | No description. |
Show raw definition+
/** Identity helper preserving the definition's precise inferred type. */
export declare function definePlugin<const Definition extends PluginDefinition>(plugin: Definition): Definition;encodeLineMarkers
Packs independently configurable start/end markers for a line quad.
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
start | LineMarker | Required | No description. |
end | LineMarker | Required | No description. |
Show raw definition+
/** Packs independently configurable start/end markers for a line quad. */
export declare function encodeLineMarkers(start: LineMarker, end: LineMarker): number;hexColor
Converts `#rgb`, `#rrggbb`, or `#rrggbbaa` to an Editful packed color.
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
hex | string | Required | No description. |
Show raw definition+
/** Converts `#rgb`, `#rrggbb`, or `#rrggbbaa` to an Editful packed color. */
export declare function hexColor(hex: string): number;validatePluginActionSchema
Validates the complete JSON-Schema subset supported by plugin actions. Registration, desktop execution, and the MCP catalog all use this contract.
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
schema | Readonly<Record<string, PluginJson>> | Required | No description. |
path | string | Optional | No description. |
depth | number | Optional | No description. |
Show raw definition+
/**
* 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
PluginActionCancelledError
Show raw definition+
export declare class PluginActionCancelledError extends Error {
constructor(message?: string);
}PluginActionConflictError
Show raw definition+
export declare class PluginActionConflictError extends Error {
constructor(message?: string);
}PluginConfigurationError
Show raw definition+
export declare class PluginConfigurationError extends Error {
constructor(message: string);
}PluginHostFeatureError
Show raw definition+
export declare class PluginHostFeatureError extends Error {
constructor(message: string);
}PluginNetworkError
Show raw definition+
export declare class PluginNetworkError extends Error {
constructor(message: string);
}Types
CreateContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
label | string | Required · readonly | No description. |
icon | string | Optional · readonly | No description. |
shortcut | string | Required · readonly | No description. |
cursor | "crosshair" | "text" | Required · readonly | No description. |
gesture | "drag" | "place" | Required · readonly | No description. |
geometry | "box" | "line" | Optional · readonly | Geometry authored by the create gesture. Defaults to an axis-aligned box. |
order | number | Required · readonly | No description. |
defaultSize | { readonly width: number; readonly height: number; } | Required · readonly | No description. |
defaultSize.width | number | Required · readonly | No description. |
defaultSize.height | number | Required · readonly | No description. |
styleSlot | "text" | "shape" | "palette" | Required · readonly | No description. |
opensTextEditor | boolean | Optional · readonly | No description. |
Show raw definition+
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;
}FieldHandle
Show raw definition+
export interface FieldHandle<Value, Kind = unknown> {
readonly [FIELD_VALUE]: (value: Value) => Value;
readonly [FIELD_KIND]: (kind: Kind) => Kind;
}FieldOptions
Properties
| Name | Type | Status | Description |
|---|---|---|---|
default | Value | Optional · readonly | No description. |
Show raw definition+
export interface FieldOptions<Value> {
readonly default?: Value;
}KindBuilder
Properties
| Name | Type | Status | Description |
|---|---|---|---|
field | KindFieldBuilder<Kind> | Required · readonly | No description. |
ui | ViewBuilder<Kind> | Required · readonly | No description. |
create | (contribution: CreateContribution) => void | Required | No description. |
hit | (shape: "rect" | "ellipse") => void | Required | No description. |
text | (contribution: TextContribution<Kind>) => void | Required | No description. |
view | (contribution: ViewContribution<Kind>) => void | Required | No description. |
defaults | (contribution: StyleDefaults) => void | Required | No description. |
agent | (contribution: { readonly name: string; readonly description?: string; }) => void | Required | No description. |
interaction | (contribution: PluginInteractionContribution) => void | Required | No description. |
asset | () => void | Required | No description. |
pack | (fn: PackFunction<Kind>) => void | Required | No description. |
Show raw definition+
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;
}KindFieldBuilder
Properties
| Name | Type | Status | Description |
|---|---|---|---|
f64 | (name: string, options?: FieldOptions<number>) => FieldHandle<number, Kind> | Required | No description. |
i32 | (name: string, options?: FieldOptions<number>) => FieldHandle<number, Kind> | Required | No description. |
bool | (name: string, options?: FieldOptions<boolean>) => FieldHandle<boolean, Kind> | Required | No description. |
string | (name: string, options?: FieldOptions<string>) => FieldHandle<string, Kind> | Required | No description. |
text | (name: string) => FieldHandle<string, Kind> | Required | No description. |
Show raw definition+
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>;
}PackedNode
Read-only node view valid only for the duration of one pack call.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
x | number | Required · readonly | No description. |
y | number | Required · readonly | No description. |
halfW | number | Required · readonly | No description. |
halfH | number | Required · readonly | No description. |
rotation | number | Required · readonly | No description. |
cornerRadius | number | Required · readonly | No description. |
strokeWidth | number | Required · readonly | No description. |
fill | number | Required · readonly | No description. |
stroke | number | Required · readonly | No description. |
assetId | string | Required · readonly | No description. |
fontFamily | number | Required · readonly | No description. |
fontSize | number | Required · readonly | No description. |
fontWeight | number | Required · readonly | No description. |
fontItalic | boolean | Required · readonly | No description. |
textAlign | number | Required · readonly | No description. |
textColor | number | Required · readonly | No description. |
lineHeight | number | Required · readonly | No description. |
letterSpacing | number | Required · readonly | No description. |
textPadding | number | Required · readonly | No description. |
textVerticalAlign | number | Required · readonly | No description. |
textSizing | number | Required · readonly | No description. |
recordsVersion | number | Required · readonly | No description. |
get | <Value>(field: FieldHandle<Value, Kind>) => Value | Required | No description. |
Show raw definition+
/** 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;
}PackFunction
Show raw definition+
export type PackFunction<Kind = unknown> = (node: PackedNode<Kind>, services: PackServices, out: PrimitiveWriter) => void;PackServices
Properties
| Name | Type | Status | Description |
|---|---|---|---|
text | { readonly sharedTextStyle: TextStyle; familyOf(font: number): TextStyle["family"]; } | Required · readonly | No description. |
text.sharedTextStyle | TextStyle | Required · readonly | No description. |
text.familyOf | (font: number) => TextStyle["family"] | Required | No description. |
Show raw definition+
export interface PackServices {
readonly text: {
readonly sharedTextStyle: TextStyle;
familyOf(font: number): TextStyle['family'];
};
}PluginActionContext
Properties
| Name | Type | Status | Description |
|---|---|---|---|
signal | AbortSignal | Required · readonly | No description. |
boardId | string | Optional · readonly | Stable board id for constructing declared board-scoped service requests. |
document | PluginDocument | Required · readonly | No description. |
selection | PluginSelection | Required · readonly | No description. |
settings | PluginSettings | Required · readonly | No description. |
secrets | PluginSecrets | Required · readonly | No description. |
network | PluginNetwork | Required · readonly | No description. |
remoteMedia | PluginRemoteMedia | Required · readonly | No description. |
ui | PluginActionUi | Required · readonly | No description. |
editors | PluginEditors | Required · readonly | No description. |
openExternal | (url: string) => Promise<void> | Required | No description. |
Show raw definition+
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>;
}PluginActionUi
Properties
| Name | Type | Status | Description |
|---|---|---|---|
prompt | (options: { readonly label: string; readonly description?: string; readonly initial?: string | number; }) => Promise<string | number | null> | Required | No description. |
confirm | (options: { readonly label: string; readonly description?: string; }) => Promise<boolean> | Required | No description. |
pick | <Value extends PluginJson>(options: { readonly label: string; readonly description?: string; readonly items: readonly PluginPickerItem<Value>[]; }) => Promise<Value | null> | Required | No description. |
notify | (notification: PluginNotification) => void | Required | Publishes a bounded notice into the host notification tray. Plugins cannot choose its position, duration, markup, or actions. |
progress | (message: string) => void | Required | No description. |
error | (message: string) => void | Required | No description. |
Show raw definition+
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;
}PluginAgentActionContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
name | string | Required · readonly | No description. |
description | string | Required · readonly | No description. |
inputSchema | Readonly<Record<string, PluginJson>> | Required · readonly | No description. |
outputSchema | Readonly<Record<string, PluginJson>> | Required · readonly | No description. |
requiresConfirmation | boolean | Required · readonly | No description. |
run | (input: Input, context: PluginActionContext) => Promise<Output> | Required | No description. |
Show raw definition+
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>;
}PluginBackgroundHandle
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
label | string | Required · readonly | No description. |
Show raw definition+
export interface PluginBackgroundHandle<State extends PluginJson = PluginJson> {
readonly id: string;
readonly label: string;
readonly [BACKGROUND_STATE]: State;
}PluginBackgroundStatus
Properties
| Name | Type | Status | Description |
|---|---|---|---|
status | "vacant" | "owned" | "occupied" | Required · readonly | No description. |
state | State | Optional · readonly | No description. |
pluginId | string | Optional · readonly | No description. |
contributionId | string | Optional · readonly | No description. |
label | string | Optional · readonly | No description. |
Show raw definition+
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;
};PluginBackgroundSurfaceContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
label | string | Required · readonly | No description. |
stateSchema | Readonly<Record<string, PluginJson>> | Required · readonly | No description. |
sourceKind | string | Required · readonly | No description. |
sourceNodeId | (state: State) => string | Required | No description. |
pack | (source: PackedNode<Kind>, state: State, services: PackServices, out: PrimitiveWriter) => void | Required | No description. |
Show raw definition+
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;
}PluginBindingChildEdit
Properties
| Name | Type | Status | Description |
|---|---|---|---|
x | number | Required · readonly | No description. |
y | number | Required · readonly | No description. |
width | number | Required · readonly | No description. |
height | number | Required · readonly | No description. |
rotation | number | Required · readonly | No description. |
Show raw definition+
export interface PluginBindingChildEdit {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
readonly rotation: number;
}PluginBindingDefinition
Properties
| Name | Type | Status | Description |
|---|---|---|---|
roles | readonly string[] | Required · readonly | No description. |
onParentRemoved | "cascade" | "unbind" | Required · readonly | No description. |
resolve | (child: PluginBindingNodeView, parents: ReadonlyMap<string, PluginBindingNodeView>, payloads: ReadonlyMap<string, PluginJson>) => PluginBindingResolveResult | null | Required | No description. |
invert | (edit: PluginBindingChildEdit, parents: ReadonlyMap<string, PluginBindingNodeView>, payloads: ReadonlyMap<string, PluginJson>) => Readonly<Record<string, PluginJson>> | null | Optional | No description. |
Show raw definition+
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;
}PluginBindingNodeView
Properties
| Name | Type | Status | Description |
|---|---|---|---|
x | number | Required · readonly | No description. |
y | number | Required · readonly | No description. |
width | number | Required · readonly | No description. |
height | number | Required · readonly | No description. |
rotation | number | Required · readonly | No description. |
presentation | "node" | "background-source" | Required · readonly | No description. |
field | (key: string) => PluginScalar | null | Required | No description. |
Show raw definition+
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;
}PluginBindingResolveResult
Properties
| Name | Type | Status | Description |
|---|---|---|---|
x | number | Optional · readonly | No description. |
y | number | Optional · readonly | No description. |
width | number | Optional · readonly | No description. |
height | number | Optional · readonly | No description. |
rotation | number | Optional · readonly | No description. |
fields | Readonly<Record<string, PluginScalar>> | Optional · readonly | No description. |
Show raw definition+
export interface PluginBindingResolveResult {
readonly x?: number;
readonly y?: number;
readonly width?: number;
readonly height?: number;
readonly rotation?: number;
readonly fields?: Readonly<Record<string, PluginScalar>>;
}PluginCommandContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
label | string | Required · readonly | No description. |
description | string | Optional · readonly | No description. |
shortcut | string | Optional · readonly | No 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.label | string | Optional · readonly | Optional toolbar-only label; the command palette keeps the command label. |
toolbar.icon | string | Optional · readonly | Built-in glyph key or explicit `./path.svg` bundled in the plugin artifact. |
toolbar.order | number | Required · readonly | No description. |
toolbar.activeEditor | string | Optional · 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 · readonly | No description. |
selection.minimum | number | Optional · readonly | No description. |
selection.maximum | number | Optional · readonly | No description. |
selection.kinds | readonly string[] | Optional · readonly | No description. |
contextMenu | { readonly target: "selection"; } | { readonly target: "background"; readonly background: PluginBackgroundHandle; } | Optional · readonly | No description. |
background | { readonly handle: PluginBackgroundHandle; readonly status: "vacant" | "owned"; } | Optional · readonly | No description. |
background.handle | PluginBackgroundHandle<PluginJson> | Required · readonly | No description. |
background.status | "vacant" | "owned" | Required · readonly | No description. |
run | (context: PluginActionContext) => Promise<void> | Required | No description. |
Show raw definition+
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>;
}PluginContext
Properties
| Name | Type | Status | Description |
|---|---|---|---|
pluginId | string | Required · readonly | No description. |
kind | <const Id extends string>(id: Id) => KindBuilder<Id> | Required | No description. |
command | (contribution: PluginCommandContribution) => void | Required | No description. |
editor | (contribution: PluginEditorContribution) => void | Required | No description. |
importer | (contribution: PluginImporterContribution) => void | Required | No description. |
action | (contribution: PluginAgentActionContribution) => void | Required | No description. |
binding | (type: string, definition: PluginBindingDefinition) => void | Required | No description. |
backgroundSurface | <Kind = unknown, State extends PluginJson = PluginJson>(contribution: PluginBackgroundSurfaceContribution<Kind, State>) => PluginBackgroundHandle<State> | Required | No description. |
migration | (contribution: PluginMigrationContribution) => void | Required | No description. |
renderer | (contribution: PluginRendererContribution) => void | Required | Registers trusted same-context rendering under `gpu-renderer`. |
Show raw definition+
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;
}PluginDefinition
Properties
| Name | Type | Status | Description |
|---|---|---|---|
register | (context: PluginContext) => void | Required | No description. |
Show raw definition+
export interface PluginDefinition {
register(context: PluginContext): void;
}PluginDocument
Properties
| Name | Type | Status | Description |
|---|---|---|---|
revision | number | Required · readonly | No description. |
inspect | (nodeIds: readonly string[]) => readonly PluginNodeSnapshot[] | Required | No description. |
inspectKind | (kindId: string, limit?: number) => readonly PluginNodeSnapshot[] | Required | Reads a bounded projection of one declared kind. |
recordCollection | (collectionId: string, ownerKind: string) => PluginRecordCollection | null | Required | Reads one opaque document-scoped collaborative collection. |
background | <State extends PluginJson>(handle: PluginBackgroundHandle<State>) => PluginBackgroundStatus<State> | Required | No description. |
transaction | (label: string) => PluginDocumentTransaction | Required | No description. |
Show raw definition+
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;
}PluginDocumentTransaction
Properties
| Name | Type | Status | Description |
|---|---|---|---|
create | (node: PluginNodeCreate) => string | Required | Stages a node and returns a transaction-local id usable by bind. |
update | (node: PluginNodeUpdate) => void | Required | No description. |
delete | (nodeId: string) => void | Required | No description. |
bind | (options: { readonly child: string; readonly role: string; readonly type: string; readonly parent: string; readonly payload: PluginJson; }) => PluginDocumentTransaction | Required | No description. |
unbind | (options: { readonly child: string; readonly role: string; }) => PluginDocumentTransaction | Required | No description. |
setRecord | (options: { readonly node: string; readonly recordId: string; readonly value: PluginJson | null; }) => PluginDocumentTransaction | Required | No description. |
setCollectionRecord | (options: { readonly collectionId: string; readonly ownerKind: string; readonly recordId: string; readonly value: PluginJson | null; }) => PluginDocumentTransaction | Required | No description. |
claimBackground | <State extends PluginJson>(handle: PluginBackgroundHandle<State>, state: NoInfer<State>) => PluginDocumentTransaction | Required | No description. |
releaseBackground | (handle: PluginBackgroundHandle) => PluginDocumentTransaction | Required | No description. |
commit | () => void | Required | No description. |
Show raw definition+
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;
}PluginEditorContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
label | string | Required · readonly | No description. |
surface | PluginEditorSurface | Required · readonly | No description. |
order | number | Optional · readonly | No 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.minimum | number | Optional · readonly | No description. |
selection.maximum | number | Optional · readonly | No description. |
selection.kinds | readonly string[] | Optional · readonly | No description. |
background | PluginBackgroundHandle<PluginJson> | Optional · readonly | No description. |
mount | (container: HTMLElement, context: PluginActionContext) => void | (() => void) | PluginEditorInstance | Required | 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+
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;
}PluginEditorInstance
Properties
| Name | Type | Status | Description |
|---|---|---|---|
update | (context: PluginActionContext) => void | Optional | No description. |
dispose | () => void | Required | No description. |
Show raw definition+
export interface PluginEditorInstance {
update?(context: PluginActionContext): void;
dispose(): void;
}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
| Name | Type | Status | Description |
|---|---|---|---|
open | (editorId: string, state?: PluginJson) => void | Required | No description. |
close | (editorId: string) => void | Required | No description. |
state | (editorId: string) => PluginJson | undefined | Required | No description. |
Show raw definition+
/**
* 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;
}PluginEditorSurface
Show raw definition+
export type PluginEditorSurface = 'toolbar' | 'left-sidebar' | 'right-sidebar';PluginImporterContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
label | string | Required · readonly | No description. |
priority | number | Optional · readonly | No description. |
match | { readonly mediaTypes?: readonly string[]; readonly extensions?: readonly string[]; readonly urlSchemes?: readonly string[]; readonly urlHosts?: readonly string[]; } | Required · readonly | No description. |
match.mediaTypes | readonly string[] | Optional · readonly | No description. |
match.extensions | readonly string[] | Optional · readonly | No description. |
match.urlSchemes | readonly string[] | Optional · readonly | No description. |
match.urlHosts | readonly string[] | Optional · readonly | No description. |
import | (input: PluginImporterInput, context: PluginActionContext) => Promise<"handled" | "rejected"> | Required | No description. |
Show raw definition+
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'>;
}PluginImporterInput
Properties
| Name | Type | Status | Description |
|---|---|---|---|
operation | "paste" | "drop" | Required · readonly | No description. |
text | string | Optional · readonly | No description. |
uriList | readonly string[] | Optional · readonly | No description. |
files | readonly { readonly name: string; readonly mediaType: string; readonly byteLength: number; readBytes(): Promise<Uint8Array>; }[] | Required · readonly | No description. |
point | { readonly x: number; readonly y: number; } | Required · readonly | No description. |
point.x | number | Required · readonly | No description. |
point.y | number | Required · readonly | No description. |
Show raw definition+
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;
};
}PluginInteractionContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
label | string | Required · readonly | No description. |
cursor | "default" | "pointer" | Required · readonly | No description. |
activate | (node: PluginNodeSnapshot, context: PluginActionContext) => Promise<void> | Required | No description. |
Show raw definition+
export interface PluginInteractionContribution {
readonly id: string;
readonly label: string;
readonly cursor: 'pointer' | 'default';
activate(node: PluginNodeSnapshot, context: PluginActionContext): Promise<void>;
}PluginJson
Show raw definition+
export type PluginJson = null | PluginScalar | readonly PluginJson[] | {
readonly [key: string]: PluginJson;
};PluginMigrationContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
run | (context: PluginActionContext) => Promise<"unchanged" | "migrated"> | Required | No description. |
Show raw definition+
export interface PluginMigrationContribution {
readonly id: string;
run(context: PluginActionContext): Promise<'unchanged' | 'migrated'>;
}PluginNetwork
Properties
| Name | Type | Status | Description |
|---|---|---|---|
request | (request: PluginNetworkRequest) => Promise<PluginNetworkResponse> | Required | No description. |
Show raw definition+
export interface PluginNetwork {
request(request: PluginNetworkRequest): Promise<PluginNetworkResponse>;
}PluginNetworkRequest
Properties
| Name | Type | Status | Description |
|---|---|---|---|
url | string | Required · readonly | No description. |
method | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | Optional · readonly | No description. |
headers | Readonly<Record<string, string>> | Optional · readonly | No description. |
body | string | Uint8Array<ArrayBufferLike> | Optional · readonly | No description. |
response | "text" | "json" | "bytes" | Optional · readonly | No description. |
timeoutMs | number | Optional · readonly | No description. |
auth | "board" | Optional · readonly | Host-injected board credential, available only for the first-party service. |
Show raw definition+
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';
}PluginNetworkResponse
Properties
| Name | Type | Status | Description |
|---|---|---|---|
status | number | Required · readonly | No description. |
headers | Readonly<Record<string, string>> | Required · readonly | No description. |
body | PluginJson | Uint8Array<ArrayBufferLike> | Required · readonly | No description. |
Show raw definition+
export interface PluginNetworkResponse {
readonly status: number;
readonly headers: Readonly<Record<string, string>>;
readonly body: PluginJson | string | Uint8Array;
}PluginNodeCreate
Properties
| Name | Type | Status | Description |
|---|---|---|---|
kind | string | Required · readonly | No description. |
x | number | Required · readonly | No description. |
y | number | Required · readonly | No description. |
width | number | Required · readonly | No description. |
height | number | Required · readonly | No description. |
rotation | number | Optional · readonly | No description. |
fill | number | Optional · readonly | No description. |
stroke | number | Optional · readonly | No description. |
strokeWidth | number | Optional · readonly | No description. |
fontFamily | number | Optional · readonly | No description. |
fontSize | number | Optional · readonly | No description. |
fontWeight | number | Optional · readonly | No description. |
fontItalic | boolean | Optional · readonly | No description. |
textAlign | TextAlign | Optional · readonly | No description. |
textColor | number | Optional · readonly | No description. |
lineHeight | number | Optional · readonly | No description. |
letterSpacing | number | Optional · readonly | No description. |
textPadding | number | Optional · readonly | No description. |
textVerticalAlign | TextVerticalAlign | Optional · readonly | No description. |
fields | Readonly<Record<string, PluginScalar>> | Optional · readonly | No description. |
Show raw definition+
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>>;
}PluginNodeSnapshot
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
kind | string | Required · readonly | No description. |
x | number | Required · readonly | No description. |
y | number | Required · readonly | No description. |
width | number | Required · readonly | No description. |
height | number | Required · readonly | No description. |
rotation | number | Required · readonly | No description. |
locked | boolean | Required · readonly | No description. |
fill | number | Required · readonly | No description. |
stroke | number | Required · readonly | No description. |
strokeWidth | number | Required · readonly | No description. |
fontFamily | number | Required · readonly | No description. |
fontSize | number | Required · readonly | No description. |
fontWeight | number | Required · readonly | No description. |
fontItalic | boolean | Required · readonly | No description. |
textAlign | TextAlign | Required · readonly | No description. |
textColor | number | Required · readonly | No description. |
lineHeight | number | Required · readonly | No description. |
letterSpacing | number | Required · readonly | No description. |
textPadding | number | Required · readonly | No description. |
textVerticalAlign | TextVerticalAlign | Required · readonly | No description. |
bindings | readonly { readonly role: string; readonly type: string; readonly parent: string; readonly payload: PluginJson; }[] | Required · readonly | No description. |
records | { readonly version: number; readonly count: number; } | Required · readonly | No description. |
records.version | number | Required · readonly | No description. |
records.count | number | Required · readonly | No description. |
field | <Value extends PluginScalar>(name: string) => Value | undefined | Required | No description. |
Show raw definition+
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;
}PluginNodeUpdate
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
x | number | Optional · readonly | No description. |
y | number | Optional · readonly | No description. |
width | number | Optional · readonly | No description. |
height | number | Optional · readonly | No description. |
rotation | number | Optional · readonly | No description. |
locked | boolean | Optional · readonly | No description. |
sendToBack | boolean | Optional · readonly | No description. |
fill | number | Optional · readonly | No description. |
stroke | number | Optional · readonly | No description. |
strokeWidth | number | Optional · readonly | No description. |
fontFamily | number | Optional · readonly | No description. |
fontSize | number | Optional · readonly | No description. |
fontWeight | number | Optional · readonly | No description. |
fontItalic | boolean | Optional · readonly | No description. |
textAlign | TextAlign | Optional · readonly | No description. |
textColor | number | Optional · readonly | No description. |
lineHeight | number | Optional · readonly | No description. |
letterSpacing | number | Optional · readonly | No description. |
textPadding | number | Optional · readonly | No description. |
textVerticalAlign | TextVerticalAlign | Optional · readonly | No description. |
fields | Readonly<Record<string, PluginScalar>> | Optional · readonly | No description. |
Show raw definition+
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>>;
}PluginNotification
Properties
| Name | Type | Status | Description |
|---|---|---|---|
title | string | Required · readonly | Short notification heading rendered as text by the host. |
message | string | Optional · readonly | Optional supporting copy rendered as text by the host. |
tone | PluginNotificationTone | Optional · readonly | The host owns placement and lifetime. Info, success, and warning notices leave automatically; errors remain until resolved or dismissed. |
Show raw definition+
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;
}PluginNotificationTone
Show raw definition+
export type PluginNotificationTone = 'info' | 'success' | 'warning' | 'error';PluginPickerItem
Properties
| Name | Type | Status | Description |
|---|---|---|---|
value | Value | Required · readonly | No description. |
label | string | Required · readonly | No description. |
description | string | Optional · readonly | No description. |
imageUrl | string | Optional · readonly | No description. |
links | readonly PluginPickerLink[] | Optional · readonly | No description. |
Show raw definition+
export interface PluginPickerItem<Value extends PluginJson = PluginJson> {
readonly value: Value;
readonly label: string;
readonly description?: string;
readonly imageUrl?: string;
readonly links?: readonly PluginPickerLink[];
}PluginPickerLink
Properties
| Name | Type | Status | Description |
|---|---|---|---|
label | string | Required · readonly | No description. |
href | string | Required · readonly | No description. |
Show raw definition+
export interface PluginPickerLink {
readonly label: string;
readonly href: string;
}PluginRecordCollection
Properties
| Name | Type | Status | Description |
|---|---|---|---|
ownerId | string | Required · readonly | Stable document node id used when a user action needs history. |
records | ReadonlyMap<string, string> | Required · readonly | No description. |
version | number | Required · readonly | No description. |
Show raw definition+
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;
}PluginRemoteImageDimensions
Properties
| Name | Type | Status | Description |
|---|---|---|---|
width | number | Required · readonly | No description. |
height | number | Required · readonly | No description. |
Show raw definition+
export interface PluginRemoteImageDimensions {
readonly width: number;
readonly height: number;
}PluginRemoteMedia
Properties
| Name | Type | Status | Description |
|---|---|---|---|
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+
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>;
}PluginRendererContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
create | (host: PluginRendererHost) => PluginRendererInstance | Required | No description. |
Show raw definition+
export interface PluginRendererContribution {
readonly id: string;
create(host: PluginRendererHost): PluginRendererInstance;
}PluginRendererHeaders
A case-insensitive response-header snapshot returned by renderer I/O.
Show raw definition+
/** A case-insensitive response-header snapshot returned by renderer I/O. */
export type PluginRendererHeaders = Readonly<Record<string, string>>;PluginRendererHost
Services retained for one renderer contribution's complete lifetime.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
gl | WebGL2RenderingContext | Required · readonly | The Editful-owned context. The host restores its state after each call. |
boardId | string | Optional · readonly | Active collaborative board identity; absent for a local-only document. |
network | PluginRendererNetwork | Required · readonly | No description. |
workers | PluginRendererWorkers | Required · readonly | No description. |
requestFrame | () => void | Required | Schedules another host canvas frame without starting a private loop. |
assetUrl | (asset: string) => string | Required | Resolves a validated plugin artifact asset to a retained URL. |
records | (surfaceId: string) => ReadonlyMap<string, string> | null | Required | Current document records owned by a visible surface node. |
setRecord | (surfaceId: string, recordId: string, value: PluginJson | null) => boolean | Required | Writes an automatic renderer-owned cache record without adding user history. |
recordCollection | (collectionId: string, ownerKind: string) => PluginRecordCollection | null | Required | Resolves an opaque document-scoped collection to its collaborative owner. |
setCollectionRecord | (collectionId: string, ownerKind: string, recordId: string, value: PluginJson | null) => boolean | Required | Writes an automatic record in a document-scoped collaborative collection. |
Show raw definition+
/** 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;
}PluginRendererInstance
One renderer runtime shared by every surface emitted for its contribution.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
render | (frame: PluginSurfaceFrame, target: PluginSurfaceRenderTarget) => void | boolean | Required | Return true when another frame is required after this one. |
query | (query: PluginSurfaceQuery) => PluginSurfaceQueryResult | null | Optional | No description. |
featureDrag | (surfaceId: string, phase: PluginSurfaceFeatureDragPhase, point: PluginSurfacePoint) => PluginSurfaceFeatureDragResult | Optional | No description. |
place | (surfaceId: string, nodeId: string, kindId: string, point: PluginSurfacePoint) => PluginSurfacePlacementResult | false | Optional | Handles a create-tool placement without exposing domain data to core. |
clearFeatureSelection | (surfaceId: string) => void | Optional | Clears renderer-owned selection visuals for one surface. |
chrome | (surfaceId: string) => PluginSurfaceChrome | null | Optional | Returns domain-owned labels/links positioned by generic host chrome. |
surfaceDisposed | (surfaceId: string) => void | Optional | No description. |
contextLost | () => void | Optional | No description. |
contextRestored | () => void | Optional | No description. |
dispose | () => void | Required | No description. |
Show raw definition+
/** 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;
}PluginRendererNetwork
Renderer-lifetime, policy-checked network access for tiles and style data.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
request | (request: PluginRendererRequest) => Promise<PluginRendererResponse> | Required | No description. |
Show raw definition+
/** Renderer-lifetime, policy-checked network access for tiles and style data. */
export interface PluginRendererNetwork {
request(request: PluginRendererRequest): Promise<PluginRendererResponse>;
}PluginRendererRequest
Properties
| Name | Type | Status | Description |
|---|---|---|---|
url | string | Required · readonly | No description. |
method | "GET" | "POST" | Optional · readonly | No description. |
headers | Readonly<Record<string, string>> | Optional · readonly | No description. |
body | ArrayBuffer | Optional · readonly | No description. |
signal | AbortSignal | Optional · readonly | No description. |
auth | "board" | Optional · readonly | Host-injected active-board credential for a declared first-party origin. |
priority | number | Optional · readonly | Lower values are more urgent. |
Show raw definition+
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;
}PluginRendererResponse
Properties
| Name | Type | Status | Description |
|---|---|---|---|
url | string | Required · readonly | No description. |
status | number | Required · readonly | No description. |
headers | Readonly<Record<string, string>> | Required · readonly | No description. |
body | ArrayBuffer | Required · readonly | No description. |
Show raw definition+
export interface PluginRendererResponse {
readonly url: string;
readonly status: number;
readonly headers: PluginRendererHeaders;
readonly body: ArrayBuffer;
}PluginRendererWorker
A validated plugin-relative worker owned and terminated by the host.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
postMessage | (message: unknown, transfer?: readonly Transferable[]) => void | Required | No description. |
onMessage | (listener: (message: unknown) => void) => () => void | Required | No description. |
onError | (listener: (error: ErrorEvent) => void) => () => void | Required | No description. |
terminate | () => void | Required | No description. |
Show raw definition+
/** 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;
}PluginRendererWorkers
Properties
| Name | Type | Status | Description |
|---|---|---|---|
create | (asset: string, options?: { readonly name?: string; }) => PluginRendererWorker | Required | No description. |
Show raw definition+
export interface PluginRendererWorkers {
create(asset: string, options?: {
readonly name?: string;
}): PluginRendererWorker;
}PluginScalar
Show raw definition+
export type PluginScalar = string | number | boolean;PluginSecrets
Properties
| Name | Type | Status | Description |
|---|---|---|---|
get | (name: string) => Promise<string | undefined> | Required | No description. |
Show raw definition+
export interface PluginSecrets {
get(name: string): Promise<string | undefined>;
}PluginSelection
Properties
| Name | Type | Status | Description |
|---|---|---|---|
snapshot | () => PluginSelectionSummary | Required | No description. |
nodeIds | () => readonly string[] | Required | No description. |
Show raw definition+
export interface PluginSelection {
snapshot(): PluginSelectionSummary;
nodeIds(): readonly string[];
}PluginSelectionSummary
Properties
| Name | Type | Status | Description |
|---|---|---|---|
count | number | Required · readonly | No description. |
kindIds | readonly string[] | Required · readonly | No description. |
Show raw definition+
export interface PluginSelectionSummary {
readonly count: number;
readonly kindIds: readonly string[];
}PluginSettings
Properties
| Name | Type | Status | Description |
|---|---|---|---|
get | (key: string) => PluginScalar | undefined | Required | No description. |
Show raw definition+
export interface PluginSettings {
get(key: string): PluginScalar | undefined;
}PluginSurfaceChrome
Properties
| Name | Type | Status | Description |
|---|---|---|---|
badges | readonly PluginSurfaceChromeBadge[] | Optional · readonly | No description. |
Show raw definition+
export interface PluginSurfaceChrome {
readonly badges?: readonly PluginSurfaceChromeBadge[];
}PluginSurfaceChromeBadge
Properties
| Name | Type | Status | Description |
|---|---|---|---|
id | string | Required · readonly | No description. |
label | string | Required · readonly | No description. |
details | string | Optional · readonly | No description. |
href | string | Optional · readonly | No description. |
corner | "bottom-right" | Required · readonly | No description. |
Show raw definition+
export interface PluginSurfaceChromeBadge {
readonly id: string;
readonly label: string;
readonly details?: string;
readonly href?: string;
readonly corner: 'bottom-right';
}PluginSurfaceEditorRequest
Properties
| Name | Type | Status | Description |
|---|---|---|---|
editorId | string | Required · readonly | Manual editor contribution owned by the surface renderer's plugin. |
state | PluginJson | Optional · readonly | Opaque transient state copied and passed back to that editor. |
Show raw definition+
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;
}PluginSurfaceFeatureDragPhase
Show raw definition+
export type PluginSurfaceFeatureDragPhase = 'start' | 'move' | 'end' | 'cancel';PluginSurfaceFeatureDragResult
Properties
| Name | Type | Status | Description |
|---|---|---|---|
mutation | PluginSurfaceRecordMutation | Required · readonly | No description. |
editor | PluginSurfaceEditorRequest | Optional · readonly | No description. |
Show raw definition+
export type PluginSurfaceFeatureDragResult = boolean | {
readonly mutation: PluginSurfaceRecordMutation;
readonly editor?: PluginSurfaceEditorRequest;
};PluginSurfaceFeatureInteraction
Properties
| Name | Type | Status | Description |
|---|---|---|---|
featureId | string | Required · readonly | Stable plugin-owned identity for the interactive feature. |
draggable | boolean | Optional · readonly | No description. |
record | Omit<PluginSurfaceRecordMutation, "historyLabel"> | Optional · readonly | Current record state used to begin an undoable gesture. |
record.recordId | string | Required · readonly | No description. |
record.value | PluginJson | Required · readonly | No description. |
record.recordOwnerId | string | Optional · readonly | Collaborative record owner; omitted for a surface-local record. |
editor | PluginSurfaceEditorRequest | Optional · readonly | No description. |
Show raw definition+
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;
}PluginSurfaceFrame
Immutable state for one visible retained surface in the current frame.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
surfaceId | string | Required · readonly | Stable for this document node while the renderer runtime is alive. |
nodeId | string | Required · readonly | Stable public document node id that emitted this retained surface. |
state | Readonly<Record<string, PluginJson>> | Required · readonly | No description. |
cssWidth | number | Required · readonly | No description. |
cssHeight | number | Required · readonly | No description. |
viewportCenter | PluginSurfacePoint | Required · 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. |
renderScale | number | Required · 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. |
canvasZoom | number | Required · readonly | No description. |
time | number | Required · readonly | No description. |
Show raw definition+
/** 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;
}PluginSurfacePlacementResult
Properties
| Name | Type | Status | Description |
|---|---|---|---|
mutation | PluginSurfaceRecordMutation | Required · readonly | No description. |
selection | PluginSurfaceFeatureInteraction | Optional · readonly | No description. |
Show raw definition+
export interface PluginSurfacePlacementResult {
readonly mutation: PluginSurfaceRecordMutation;
readonly selection?: PluginSurfaceFeatureInteraction;
}PluginSurfacePoint
Properties
| Name | Type | Status | Description |
|---|---|---|---|
x | number | Required · readonly | No description. |
y | number | Required · readonly | No description. |
Show raw definition+
export interface PluginSurfacePoint {
readonly x: number;
readonly y: number;
}PluginSurfaceQuery
Properties
| Name | Type | Status | Description |
|---|---|---|---|
surfaceId | string | Required · readonly | No description. |
nodeId | string | Required · readonly | No description. |
state | Readonly<Record<string, PluginJson>> | Required · readonly | No description. |
point | PluginSurfacePoint | Required · readonly | Surface-local CSS pixels from its top-left corner. |
Show raw definition+
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;
}PluginSurfaceQueryResult
Properties
| Name | Type | Status | Description |
|---|---|---|---|
cursor | "default" | "pointer" | "grab" | "crosshair" | Optional · readonly | No description. |
features | readonly PluginJson[] | Optional · readonly | No description. |
statusText | string | Optional · readonly | Optional short pointer-local status rendered in host chrome. |
interaction | PluginSurfaceFeatureInteraction | Optional · 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+
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;
}PluginSurfaceRecordMutation
Properties
| Name | Type | Status | Description |
|---|---|---|---|
recordId | string | Required · readonly | No description. |
value | PluginJson | Required · readonly | No description. |
recordOwnerId | string | Optional · readonly | Collaborative record owner; omitted for a surface-local record. |
historyLabel | string | Required · readonly | User-facing undo label owned by the plugin's domain vocabulary. |
Show raw definition+
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;
}PluginSurfaceRenderTarget
Host-owned framebuffer and dimensions supplied for one surface render.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
framebuffer | WebGLFramebuffer | Required · readonly | No description. |
width | number | Required · readonly | No description. |
height | number | Required · readonly | No description. |
devicePixelRatio | number | Required · readonly | No description. |
Show raw definition+
/** 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;
}PrimitiveWriter
Properties
| Name | Type | Status | Description |
|---|---|---|---|
quad | (x: number, y: number, halfW: number, halfH: number, rotation: number, cornerRadius: number, strokeWidth: number, primitive: Primitive, fill: number, stroke: number) => void | Required | No 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; }; }) => void | Required | No 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; } | Required | No description. |
interactionRegion | (interactionId: string, x: number, y: number, width: number, height: number, semantics: { readonly role: "button" | "link"; readonly label: string; }) => void | Required | No description. |
surface | (rendererId: string, state: Readonly<Record<string, PluginJson>>, x: number, y: number, halfW: number, halfH: number, rotation: number) => void | Required | 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+
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;
}StyleDefaults
Properties
| Name | Type | Status | Description |
|---|---|---|---|
fill | number | Optional · readonly | No description. |
stroke | number | Optional · readonly | No description. |
strokeWidth | number | Optional · readonly | No description. |
cornerRadius | number | Optional · readonly | No description. |
fontSize | number | Optional · readonly | No description. |
textColor | number | Optional · readonly | No description. |
lineHeight | number | Optional · readonly | No description. |
textSizing | number | Optional · readonly | No description. |
Show raw definition+
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;
}TextContribution
Properties
| Name | Type | Status | Description |
|---|---|---|---|
field | FieldHandle<string, Kind> | Required · readonly | No description. |
padding | number | "node" | Required · readonly | No description. |
verticalAlign | "center" | "node" | "top" | Required · readonly | No description. |
font | "node" | "shared" | Required · readonly | No description. |
width | "user" | "auto" | "derived" | Required · readonly | No description. |
height | "user" | "auto" | "derived" | Required · readonly | No description. |
minWidth | number | Optional · readonly | No description. |
minHeight | number | Optional · readonly | No description. |
Show raw definition+
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;
}TextStyle
Properties
| Name | Type | Status | Description |
|---|---|---|---|
family | "sans" | "serif" | "mono" | Required · readonly | No description. |
weight | number | Required · readonly | No description. |
italic | boolean | Required · readonly | No description. |
size | number | Required · readonly | No description. |
lineHeight | number | Required · readonly | No description. |
letterSpacing | number | Required · readonly | No description. |
align | "left" | "center" | "right" | Required · readonly | No description. |
color | number | Required · readonly | No description. |
Show raw definition+
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;
}ViewBoxOptions
Paint, padding, and optional child content for a container.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
child | ViewNode<Kind> | Optional · readonly | The single child inside the box. |
padding | number | ViewInsets | Optional · 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. |
strokeWidth | number | "node" | Optional · readonly | Stroke width in canvas units, or the node's stroke width. |
cornerRadius | number | "node" | "full" | Optional · readonly | Corner radius, the node's radius, or a full pill radius. |
Show raw definition+
/** 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';
}ViewBuilder
Kind-scoped factory for declarative view primitives.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
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+
/** 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>;
}ViewContribution
Root view and host-owned sizing policy registered with a node kind.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
root | ViewNode<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 · readonly | No description. |
width.min | number | Optional · readonly | No description. |
height | { readonly mode: "fit-content"; } | Required · readonly | Height derived from the measured root content. |
height.mode | "fit-content" | Required · readonly | No description. |
Show raw definition+
/** 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';
};
}ViewImageOptions
Fixed image dimensions within a declarative view.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
width | number | "fill" | Required · readonly | Fixed width, or all available block width. |
height | number | Required · readonly | Fixed height in canvas units. |
Show raw definition+
/** 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;
}ViewImageSource
Remote or document-backed source for an image primitive.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
url | ViewValue<string, Kind> | Optional · readonly | No description. |
asset | ViewValue<string, Kind> | Optional · readonly | No description. |
Show raw definition+
/** Remote or document-backed source for an image primitive. */
export type ViewImageSource<Kind = unknown> = {
readonly url: ViewValue<string, Kind>;
} | {
readonly asset: ViewValue<string, Kind>;
};ViewInsets
Logical and physical insets for a view box. Physical sides take precedence.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
inline | number | Optional · readonly | Left and right inset. |
block | number | Optional · readonly | Top and bottom inset. |
top | number | Optional · readonly | Top inset. |
right | number | Optional · readonly | Right inset. |
bottom | number | Optional · readonly | Bottom inset. |
left | number | Optional · readonly | Left inset. |
Show raw definition+
/** 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;
}ViewNode
Opaque declarative view node created by a kind's {@link ViewBuilder}.
Show raw definition+
/** Opaque declarative view node created by a kind's {@link ViewBuilder}. */
export interface ViewNode<Kind = unknown> {
readonly [VIEW_NODE_KIND]: (kind: Kind) => Kind;
}ViewStackOptions
Ordered children on the inline or block axis.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
axis | "inline" | "block" | Required · readonly | Inline lays out left to right. Block lays out top to bottom. |
children | readonly ViewNode<Kind>[] | Required · readonly | Ordered view nodes owned by the same kind. |
gap | number | Optional · readonly | Defaults to zero. |
align | "center" | "start" | "end" | Optional · readonly | Inline cross-axis alignment. Defaults to center. |
Show raw definition+
/** 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';
}ViewTextFont
Font metrics used by both text measurement and paint.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
family | number | Required · readonly | Bundled font family. |
size | number | "node" | Required · readonly | Font size in canvas units, or the node's font size. |
weight | number | "node" | Required · readonly | Numeric font weight, or the node's font weight. |
italic | boolean | "node" | Optional · readonly | Italic state, or the node's italic state. |
lineHeight | number | "node" | Required · readonly | Unitless line height, or the node's line height. |
letterSpacing | number | "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+
/** 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';
}ViewTextOptions
Options for a display-only text primitive.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
font | ViewTextFont | Required · 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. |
wrap | boolean | Optional · 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.id | string | Required · readonly | Identifier reported to the plugin interaction handler. |
interaction.role | "button" | "link" | Required · readonly | Accessible interaction role. |
interaction.label | string | Required · readonly | Accessible label for the interaction region. |
Show raw definition+
/** 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;
};
}ViewValue
A fixed value or a field handle resolved from the rendered canvas node.
Show raw definition+
/** A fixed value or a field handle resolved from the rendered canvas node. */
export type ViewValue<Value, Kind = unknown> = Value | FieldHandle<Value, Kind>;Constants
EDITFUL_PLUGIN_API_VERSION
Runtime plugin contract implemented by compatible Editful 0.9.x releases.
Show raw definition+
/** Runtime plugin contract implemented by compatible Editful 0.9.x releases. */
export declare const EDITFUL_PLUGIN_API_VERSION: "0.9.0";LineMarker
Endpoint decoration understood by {@link Primitive.Line}.
Properties
| Name | Type | Status | Description |
|---|---|---|---|
None | 0 | Required · readonly | No description. |
OpenArrow | 1 | Required · readonly | No description. |
SolidArrow | 2 | Required · readonly | No description. |
Cap | 3 | Required · readonly | No description. |
Show raw definition+
/** 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];Primitive
Properties
| Name | Type | Status | Description |
|---|---|---|---|
RoundRect | 0 | Required · readonly | No description. |
Ellipse | 1 | Required · readonly | No description. |
None | 2 | Required · readonly | No description. |
Line | 3 | Required · readonly | Procedural straight line. `cornerRadius` carries `encodeLineMarkers(...)`. |
TextBlock | 100 | Required · readonly | No description. |
ImageQuad | 101 | Required · readonly | No description. |
Show raw definition+
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];TextAlign
Properties
| Name | Type | Status | Description |
|---|---|---|---|
Left | 0 | Required · readonly | No description. |
Center | 1 | Required · readonly | No description. |
Right | 2 | Required · readonly | No description. |
Show raw definition+
export declare const TextAlign: {
readonly Left: 0;
readonly Center: 1;
readonly Right: 2;
};
export type TextAlign = (typeof TextAlign)[keyof typeof TextAlign];TextFont
Properties
| Name | Type | Status | Description |
|---|---|---|---|
Sans | 0 | Required · readonly | No description. |
Serif | 1 | Required · readonly | No description. |
Mono | 2 | Required · readonly | No description. |
Show raw definition+
export declare const TextFont: {
readonly Sans: 0;
readonly Serif: 1;
readonly Mono: 2;
};
export type TextFont = number;TextSizing
Properties
| Name | Type | Status | Description |
|---|---|---|---|
Fixed | 0 | Required · readonly | No description. |
AutoWidth | 1 | Required · readonly | No description. |
AutoHeight | 2 | Required · readonly | No description. |
Auto | 3 | Required · readonly | No description. |
Show raw definition+
export declare const TextSizing: {
readonly Fixed: 0;
readonly AutoWidth: 1;
readonly AutoHeight: 2;
readonly Auto: 3;
};TextVerticalAlign
Properties
| Name | Type | Status | Description |
|---|---|---|---|
Top | 0 | Required · readonly | No description. |
Middle | 1 | Required · readonly | No description. |
Bottom | 2 | Required · readonly | No description. |
Show raw definition+
export declare const TextVerticalAlign: {
readonly Top: 0;
readonly Middle: 1;
readonly Bottom: 2;
};
export type TextVerticalAlign = (typeof TextVerticalAlign)[keyof typeof TextVerticalAlign];UNBOUNDED_WRAP
Sentinel used by text layout when wrapping is disabled.
Show raw definition+
/** Sentinel used by text layout when wrapping is disabled. */
export declare const UNBOUNDED_WRAP: number;