Skip to content

Interface: SealpixelPlugin<Id, Doc, Options> ​

Defined in: core/dist/plugin.d.ts:142

Type Parameters ​

Id ​

Id extends string = string

Doc ​

Doc = unknown

Options ​

Options = unknown

Properties ​

assets? ​

optional assets?: AssetDeclaration[]

Defined in: core/dist/plugin.d.ts:157


configure? ​

optional configure?: (partial) => SealpixelPlugin<Id, Doc, Options>

Defined in: core/dist/plugin.d.ts:171

Returns a new plugin instance with partial merged over the current options.

Parameters ​

partial ​

Partial<Options>

Returns ​

SealpixelPlugin<Id, Doc, Options>


id ​

id: Id

Defined in: core/dist/plugin.d.ts:144

Namespaced id such as acme.invert. Op types are <id>.<verb>.


initialDocument ​

initialDocument: Doc

Defined in: core/dist/plugin.d.ts:148


initialOps? ​

optional initialOps?: (ctx) => Omit<OperationBase<string>, "id">[]

Defined in: core/dist/plugin.d.ts:188

Operations the editor dispatches when a source loads with an empty log, so option defaults (a default preset, a locked watermark) become part of the log instead of hidden state. Ids are assigned by the caller.

Parameters ​

ctx ​
options ​

Options

source ​

SourceDescriptor

Returns ​

Omit<OperationBase<string>, "id">[]


kernel ​

kernel: KernelDef

Defined in: core/dist/plugin.d.ts:155


operations ​

operations: readonly OperationDef<Doc, any>[]

Defined in: core/dist/plugin.d.ts:147


options? ​

optional options?: Options

Defined in: core/dist/plugin.d.ts:163

Resolved options: defaults merged with what configure() received. Options tune behaviour and constrain edits; they never carry pixel data so a render never depends on them.


optionsDefaults? ​

optional optionsDefaults?: Options

Defined in: core/dist/plugin.d.ts:169

The defaults configure() merges over.


optionsDescribe? ​

optional optionsDescribe?: Readonly<Record<string, string>>

Defined in: core/dist/plugin.d.ts:167

One-line descriptions per top-level option key, for generated documentation.


optionsSchema? ​

optional optionsSchema?: OptionsSchema<Options>

Defined in: core/dist/plugin.d.ts:165

Validates a full options object. Used by configure() and the docs generator.


stage ​

stage: object

Defined in: core/dist/plugin.d.ts:149

name ​

name: string

order ​

order: number


tool? ​

optional tool?: () => Promise<ToolDef>

Defined in: core/dist/plugin.d.ts:156

Returns ​

Promise<ToolDef>


toPlan ​

toPlan: (slice, ctx) => StageParams | null

Defined in: core/dist/plugin.d.ts:154

Returns this plugin's stage parameters, or null to contribute nothing.

Parameters ​

slice ​

Doc

ctx ​

PlanContext

Returns ​

StageParams | null


validate? ​

optional validate?: (op, ctx) => string | null

Defined in: core/dist/plugin.d.ts:177

Constraint check for one operation against the options. Return a message to reject the op (OPTION_VIOLATION), or null to accept. Runs in parseEditLog, in session.dispatch and on the server.

Parameters ​

op ​

OperationBase

ctx ​

ValidateContext<Doc, Options>

Returns ​

string | null


validateDocument? ​

optional validateDocument?: (slice, ctx) => string | null

Defined in: core/dist/plugin.d.ts:182

Constraint check for the final state, for example a locked watermark that must be present. Runs before export and before every server render.

Parameters ​

slice ​

Doc

ctx ​

ValidateDocumentContext<Options>

Returns ​

string | null


version ​

version: number

Defined in: core/dist/plugin.d.ts:146

Bumped when the op schema or the kernel output changes.