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

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.
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';
    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.
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;
    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

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.
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[];
    };
    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.
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;
}
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.
transaction(label: string) => PluginDocumentTransactionRequiredNo description.
Show raw definition
TypeScript
export interface PluginDocument {
    readonly revision: number;
    inspect(nodeIds: readonly string[]): readonly PluginNodeSnapshot[];
    transaction(label: string): PluginDocumentTransaction;
}
Type

PluginDocumentTransaction

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
create(node: PluginNodeCreate) => voidRequiredNo description.
update(node: PluginNodeUpdate) => voidRequiredNo description.
delete(nodeId: string) => voidRequiredNo description.
commit() => voidRequiredNo description.
Show raw definition
TypeScript
export interface PluginDocumentTransaction {
    create(node: PluginNodeCreate): void;
    update(node: PluginNodeUpdate): void;
    delete(nodeId: string): void;
    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.
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[];
    };
    /**
     * 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"pointer" | "default"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

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.
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.
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 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;
    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.
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 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

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

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

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.
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;
}
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

Primitive

#

Properties

Properties and TSDoc annotations
NameTypeStatusDescription
RoundRect0Required · readonlyNo description.
Ellipse1Required · readonlyNo description.
None2Required · readonlyNo description.
TextBlock100Required · readonlyNo description.
ImageQuad101Required · readonlyNo description.
Show raw definition
TypeScript
export declare const Primitive: {
    readonly RoundRect: 0;
    readonly Ellipse: 1;
    readonly None: 2;
    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;