Skip to content

Interface: SealpixelPlugin<Id, Doc, Options>

Defined in: packages/core/src/plugin.ts:137

Type Parameters

Id

Id extends string = string

Doc

Doc = unknown

Options

Options = unknown

Properties

assets?

optional assets?: AssetDeclaration[]

Defined in: packages/core/src/plugin.ts:150


configure?

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

Defined in: packages/core/src/plugin.ts:164

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: packages/core/src/plugin.ts:139

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


initialDocument

initialDocument: Doc

Defined in: packages/core/src/plugin.ts:144


initialOps?

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

Defined in: packages/core/src/plugin.ts:181

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: packages/core/src/plugin.ts:148


operations

operations: readonly OperationDef<Doc, any>[]

Defined in: packages/core/src/plugin.ts:143


options?

optional options?: Options

Defined in: packages/core/src/plugin.ts:156

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: packages/core/src/plugin.ts:162

The defaults configure() merges over.


optionsDescribe?

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

Defined in: packages/core/src/plugin.ts:160

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


optionsSchema?

optional optionsSchema?: OptionsSchema<Options>

Defined in: packages/core/src/plugin.ts:158

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


stage

stage: object

Defined in: packages/core/src/plugin.ts:145

name

name: string

order

order: number


tool?

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

Defined in: packages/core/src/plugin.ts:149

Returns

Promise<ToolDef>


toPlan

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

Defined in: packages/core/src/plugin.ts:147

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: packages/core/src/plugin.ts:170

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: packages/core/src/plugin.ts:175

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: packages/core/src/plugin.ts:141

Bumped when the op schema or the kernel output changes.