@paged-media/plugin-api 0.2.40-canary.0 → 0.2.42-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/assets.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Disposable } from "./host";
1
2
  /** What `host.assets` can serve. `"fonts"` gates `getFontFace` (W-06);
2
3
  * `"images"` gates `getPlacedImage` (C-5 / I-04 — OPEN since core v42:
3
4
  * the engine serves a placed image's original bytes, so `validate`
@@ -53,7 +54,9 @@ export interface PlacedImageAsset {
53
54
  * the document already holds, and the host answers from that or
54
55
  * `null`. Capability-gated per kind: `getFontFace` requires
55
56
  * `capabilities.assets` ∋ `"fonts"`, `getPlacedImage` ∋ `"images"`
56
- * (the host gate throws in `'enforce'`, warns in `'warn'`).
57
+ * (the host gate throws in `'enforce'`, warns in `'warn'`). One write
58
+ * sits beside the reads — `registerFont`, scene-layer faces only (W-15);
59
+ * it adds nothing the document can see.
57
60
  */
58
61
  export interface AssetSurface {
59
62
  /**
@@ -72,4 +75,22 @@ export interface AssetSurface {
72
75
  * engine door already bounds it to what the document holds.
73
76
  */
74
77
  getPlacedImage(elementId: string): Promise<PlacedImageAsset | null>;
78
+ /**
79
+ * W-15 — the ONE write on this door: hand the engine a face (the bytes
80
+ * the bundle ships or the user supplied) that SCENE-LAYER text — the
81
+ * text a bundle draws through `host.sceneLayer` — resolves by `family`
82
+ * (+ `style`). It never reaches the document: document layout, the
83
+ * Fonts panel's missing flag, preflight and substitution tracing do not
84
+ * see it, so a plugin face named "Inter" cannot hide that a document's
85
+ * own Inter is missing. Registering rebuilds the scene frames whose
86
+ * text names the family.
87
+ *
88
+ * Requires `capabilities.assets` ∋ `"fonts"` (throws in 'enforce').
89
+ * Faces over `ASSET_BUDGETS.maxFontFaceBytes` are refused (rejects).
90
+ * The face lives until the returned `Disposable` is disposed or the
91
+ * bundle is torn down. Probe `supports("assets.registerFont@1")`: on a
92
+ * host without the backend the call logs a warning and resolves an
93
+ * inert `Disposable` — scene text keeps its fallback face.
94
+ */
95
+ registerFont(bytes: Uint8Array, family: string, style?: string): Promise<Disposable>;
75
96
  }
package/dist/editor.d.ts CHANGED
@@ -465,6 +465,15 @@ export interface PagedEditor {
465
465
  ascender: number;
466
466
  descender: number;
467
467
  }>;
468
+ /** D-27 — measure many strings in one face + size in ONE round-trip
469
+ * to the shaper; one entry per input, in order. Optional: absent,
470
+ * `host.text.measureStrings` fans out to `measure` and
471
+ * `supports("text.measureStrings@1")` is false. */
472
+ measureMany?(family: string, style: string | null, texts: readonly string[], sizePt: number): Promise<Array<{
473
+ advance: number;
474
+ ascender: number;
475
+ descender: number;
476
+ }>>;
468
477
  };
469
478
  /** C-1 — in-frame plugin scene layers. The editor routes these to the
470
479
  * canvas-wasm `submitSceneLayer` / `clearSceneLayer` channel (async,
@@ -547,6 +556,18 @@ export interface PagedEditor {
547
556
  * `setToolPreview` — this REPLACES the slot's content with the
548
557
  * list; `null` clears it. */
549
558
  setToolPreviews?(value: readonly ToolPreviewShape[] | null): void;
559
+ /** W-20 — the retained plugin overlay LAYERS, kept apart from the
560
+ * tool-preview slot. `key` is host-wide (the SDK passes
561
+ * `<manifest id>/<layer id>`). The FIRST call for a key fixes the
562
+ * layer's place in the stack (layers draw in first-set order, below
563
+ * the tool-preview slot); later calls replace its shapes, and `[]`
564
+ * empties it without giving up the place. Optional with
565
+ * `removeOverlayLayer`: on a host without both the SDK's
566
+ * `host.overlay.layer` draws nothing and
567
+ * `supports("overlay.layers@1")` is false. */
568
+ setOverlayLayer?(key: string, shapes: readonly ToolPreviewShape[]): void;
569
+ /** W-20 — drop a layer and its place in the stack. */
570
+ removeOverlayLayer?(key: string): void;
550
571
  };
551
572
  tool: {
552
573
  setBaseTool(id: ToolId): void;
package/dist/host.d.ts CHANGED
@@ -194,6 +194,32 @@ export interface EnteredEditContext {
194
194
  type: string;
195
195
  /** The element the context was entered on (the write-scope root). */
196
196
  id: ElementId;
197
+ /**
198
+ * W-19 — WHERE the pointer entered, when the entry was a pointer
199
+ * (the double-click, or the Type-tool click on plugin-owned content).
200
+ * All three are absent for an entry with no pointer
201
+ * (`host.shell.enterEditContext`) and on `onExit`.
202
+ *
203
+ * Without them a context that edits by pointer had to make the user
204
+ * click a SECOND time after the double-click before anything landed
205
+ * where they pointed (a caret in a web frame, a cell in a sheet).
206
+ *
207
+ * Probe `supports("editContext.enterPoint@1")`: true only when the host
208
+ * shell fills these on a pointer entry. On a host where it is false the
209
+ * fields are always absent and the context places its own default.
210
+ */
211
+ /** The page the pointer was on. */
212
+ pageId?: PageId;
213
+ /** The pointer in PAGE-LOCAL points (origin = the page's top-left), the
214
+ * space `hitTest` and the tool-preview shapes use. */
215
+ pagePoint?: [number, number];
216
+ /** The pointer in FRAME-CONTENT points — the same mapping and origin
217
+ * as `ContentPointerEvent.contentPoint` (the frame's content transform
218
+ * inverted, origin = the content-box top-left), so a context hands it
219
+ * straight to the code that handles `onContentPointerDown`. Absent
220
+ * when the point falls outside the content box or the frame's
221
+ * transform is singular. */
222
+ contentPoint?: [number, number];
197
223
  }
198
224
  /** K-1 — a pointer delivered to the ACTIVE edit context, in FRAME-CONTENT
199
225
  * coordinates (the editor inverted the frame's content transform). */
@@ -728,6 +754,17 @@ export interface DocumentChangeEvent {
728
754
  contentBox: [number, number, number, number];
729
755
  };
730
756
  }
757
+ /** W-22 — what `document.onDidOpen` reports: the new document's page
758
+ * structure, a clonable snapshot of the engine's load reply. */
759
+ export interface DocumentOpenedEvent {
760
+ /** The engine's id for the loaded document. */
761
+ docId: string;
762
+ pageCount: number;
763
+ /** Page ids in document order. */
764
+ pageIds: PageId[];
765
+ /** Per-page `[width, height]` in points, the same order as `pageIds`. */
766
+ pageSizesPt: [number, number][];
767
+ }
731
768
  /** One link in a text-frame thread (protocol v38, C-2/S-05). `next` is
732
769
  * the following frame's id (null at the tail); `overflow` marks the tail
733
770
  * frame as overset (story content past the chain end). */
@@ -992,6 +1029,21 @@ export interface DocumentSurface {
992
1029
  * throws `PluginApiNotImplemented` (a visible seam, never a fake value). */
993
1030
  storyContent(storyId: string): Promise<StoryContent | null>;
994
1031
  onDidChange(listener: (e: DocumentChangeEvent) => void): Disposable;
1032
+ /**
1033
+ * W-22 — a document became the active one: opened from a file, created
1034
+ * with File ▸ New, or loaded by a plugin through `host.nativeDocument`.
1035
+ * Fires AFTER the engine holds the new document, so the listener can
1036
+ * read it (parts, metadata, collections) straight away.
1037
+ *
1038
+ * A bundle that keeps per-document state (a render cache, a parts
1039
+ * index) resets it here. Before this door the only way to hear it was
1040
+ * the raw client `documentLoaded` message through `host.editor`.
1041
+ *
1042
+ * Gated on `capabilities.document.read`, like `onDidChange`. Probe
1043
+ * `supports("document.onDidOpen@1")`. A document already open when the
1044
+ * bundle activates is NOT replayed: read it at activation.
1045
+ */
1046
+ onDidOpen(listener: (e: DocumentOpenedEvent) => void): Disposable;
995
1047
  /**
996
1048
  * Called before the host serialises the document to a file; the save
997
1049
  * WAITS for the returned promise, so a bundle can commit pending state
@@ -1016,6 +1068,26 @@ export interface DocumentSurface {
1016
1068
  * `KeyValuePair`, which InDesign preserves verbatim.
1017
1069
  */
1018
1070
  setMetadata(id: ElementId, envelope: PluginMetadataEnvelope | null): Promise<MutationOutcome>;
1071
+ /**
1072
+ * Protocol 69 — read this plugin's DOCUMENT-scoped metadata envelope
1073
+ * (the document's own Label, not a page item's), or `null` when absent
1074
+ * or when the engine predates protocol 69. Same implicit key as
1075
+ * {@link getMetadata}: `x-paged:<manifest id>`. Probe
1076
+ * `supports("document.documentMetadata@1")`.
1077
+ */
1078
+ getDocumentMetadata(): Promise<PluginMetadataEnvelope | null>;
1079
+ /**
1080
+ * Protocol 69 — write (or clear, with `null`) this plugin's
1081
+ * document-scoped metadata: state that belongs to no frame, such as a
1082
+ * data session or the version of this plugin's container parts that is
1083
+ * live. One undoable step through `mutate` (engine op
1084
+ * `setDocumentMetadata`, which also composes inside a `batch`), engine-
1085
+ * gated like {@link setMetadata}. Persisted in a `.paged` document; from
1086
+ * protocol 70 an `.idml` export keeps it as a `Properties/Label` entry
1087
+ * on the designmap's `Document` (InDesign preserves it verbatim). An
1088
+ * engine older than 69 answers `applied: false`.
1089
+ */
1090
+ setDocumentMetadata(envelope: PluginMetadataEnvelope | null): Promise<MutationOutcome>;
1019
1091
  }
1020
1092
  /**
1021
1093
  * The schema'd value of one `x-paged:*` Label entry (facility design
@@ -1087,6 +1159,12 @@ export interface TextMetrics {
1087
1159
  * `deleteRange.start/end` — the `ContentSelection` addressing: run
1088
1160
  * bytes plus one synthetic `\n` per inter-paragraph boundary), so the
1089
1161
  * value can be passed straight to `host.document.mutate`.
1162
+ *
1163
+ * The field operations (`insertField.offset`, `setFieldValue`,
1164
+ * `placeholders()`) count CHARACTERS with no paragraph separator; the two
1165
+ * units agree only inside the first paragraph of ASCII text. To place a
1166
+ * field at the caret, pass the caret as `insertField.contentOffset`
1167
+ * (protocol 69): the engine converts it against the story at apply time.
1090
1168
  */
1091
1169
  export interface TextCaret {
1092
1170
  storyId: string;
@@ -1115,6 +1193,22 @@ export interface TextSurface {
1115
1193
  * would be misread as story-local body offsets.
1116
1194
  */
1117
1195
  caret(): TextCaret | null;
1196
+ /**
1197
+ * D-27 — measure MANY strings in one face + size in one host call: the
1198
+ * batched {@link measureString}. Resolves one {@link TextMetrics} per
1199
+ * input, in input order (an empty input answers `[]` without a host
1200
+ * call). Each entry is exactly what `measureString(family, style,
1201
+ * texts[i], sizePt)` would answer — same shaper, same fallback face —
1202
+ * so a bundle may switch between the two freely.
1203
+ *
1204
+ * Probe `supports("text.measureStrings@1")`: true when the host serves
1205
+ * the batch in ONE round-trip to its shaper. Without it the door still
1206
+ * answers (the host fans out to `measureString`, or to the estimate
1207
+ * when `text.measure@1` is false), only without the call saving.
1208
+ * Measuring once per word was 133 of the 148 host calls of a 57-record
1209
+ * paged.data merge.
1210
+ */
1211
+ measureStrings(family: string, style: string | null, texts: readonly string[], sizePt: number): Promise<TextMetrics[]>;
1118
1212
  }
1119
1213
  /** The v0 overlay channel: the shared tool-preview signal (polyline /
1120
1214
  * rect / path — and, with `supports("overlay.text@1")`, the TEXT
@@ -1149,6 +1243,41 @@ export interface OverlaySurface {
1149
1243
  * is precisely the pre-K-9 behaviour a bundle used to hand-code.
1150
1244
  */
1151
1245
  setToolPreviews(shapes: readonly ToolPreviewShape[] | null): void;
1246
+ /**
1247
+ * W-20 — a RETAINED overlay layer of this bundle's own: preview shapes
1248
+ * that stay on the canvas until the bundle changes or clears them,
1249
+ * independent of the tool-preview slot and of every other layer.
1250
+ *
1251
+ * The tool-preview slot is ONE slot for whichever tool is active, so a
1252
+ * bundle drawing two persistent things (a text caret and an outline
1253
+ * highlight) had them overwrite each other, and an active tool's
1254
+ * preview wiped both. A layer is data only (the same `ToolPreviewShape`
1255
+ * vocabulary, no React component), so it works where
1256
+ * `contribute.overlay` cannot reach.
1257
+ *
1258
+ * A bundle may hold several layers. They stack in the order they were
1259
+ * CREATED (first = bottom-most) and keep that place across `set` and
1260
+ * `clear`; all of them draw below the tool-preview slot. `id` names the
1261
+ * layer within the bundle (generated when omitted); asking for an id
1262
+ * that is already live throws. Every layer is disposed with the bundle.
1263
+ *
1264
+ * Same `capabilities.rendering` ∋ `"overlay"` gate as `setToolPreview`.
1265
+ * Probe `supports("overlay.layers@1")`: true only when the host renders
1266
+ * layers. Without it the handle still works and never throws, but
1267
+ * draws nothing.
1268
+ */
1269
+ layer(id?: string): OverlayLayer;
1270
+ }
1271
+ /** W-20 — one retained overlay layer (`host.overlay.layer`). */
1272
+ export interface OverlayLayer extends Disposable {
1273
+ /** The layer's id within the bundle. */
1274
+ readonly id: string;
1275
+ /** REPLACE the layer's shapes, drawn in array order (first =
1276
+ * bottom-most within the layer). Shapes may address different pages.
1277
+ * An empty array clears the layer. */
1278
+ set(shapes: readonly ToolPreviewShape[]): void;
1279
+ /** Remove the layer's shapes; the layer keeps its place in the stack. */
1280
+ clear(): void;
1152
1281
  }
1153
1282
  /**
1154
1283
  * Shell actions the HOST APP injects at `loadBundle` time (the
@@ -1320,6 +1449,41 @@ export interface NativeDocumentSurface {
1320
1449
  * (an importer plugin produces these bytes, e.g. from IDML). */
1321
1450
  open(bytes: Uint8Array): Promise<void>;
1322
1451
  }
1452
+ /** Options for {@link DocumentsSurface.open}. */
1453
+ export interface OpenDocumentOptions {
1454
+ /** The opened document's display name (title bar, the Save default)
1455
+ * when its own metadata carries none, e.g. `"Catalog (merged)"`. The
1456
+ * host falls back to a generic name when omitted. */
1457
+ name?: string;
1458
+ }
1459
+ /** The answer of {@link DocumentsSurface.open}. `declined` means the user
1460
+ * kept the active document (it had unsaved edits and they chose not to
1461
+ * discard them); nothing changed. */
1462
+ export type OpenDocumentResult = {
1463
+ opened: true;
1464
+ pageIds: string[];
1465
+ } | {
1466
+ opened: false;
1467
+ reason: "declined";
1468
+ };
1469
+ export interface DocumentsSurface {
1470
+ /** Serialize the ACTIVE document to `.paged` bytes (the same container
1471
+ * File > Save writes: the IDML entries plus the core model and every
1472
+ * plugin's `paged/<id>/` parts). Feed the bytes to `open` to work on a
1473
+ * copy. Gated on `capabilities.documents.export`. Rejects when no
1474
+ * document is loaded or the host wired no backend. */
1475
+ exportPaged(): Promise<Uint8Array>;
1476
+ /** Replace the active document with `bytes` (`.paged` or `.idml`).
1477
+ * When the active document has unsaved edits the HOST asks the user to
1478
+ * keep or discard them first and resolves `{ opened: false, reason:
1479
+ * "declined" }` if they keep them. On success the host broadcasts
1480
+ * `documentLoaded` (every bundle sees a document switch, the caller
1481
+ * included) and the opened document starts with an empty undo history
1482
+ * and NO unsaved edits: mutations the caller makes next are what mark
1483
+ * it edited. Gated on `capabilities.documents.open`. Rejects when the
1484
+ * bytes do not load or the host wired no backend. */
1485
+ open(bytes: Uint8Array, options?: OpenDocumentOptions): Promise<OpenDocumentResult>;
1486
+ }
1323
1487
  /** The per-origin outcome of a consent request. */
1324
1488
  export interface ConsentResult {
1325
1489
  /** Origins the user granted (a subset of the requested set). */
@@ -1530,6 +1694,14 @@ export interface BundleHost {
1530
1694
  * `supports("document.readNative@1")` / `supports("document.openNative@1")`
1531
1695
  * are false. */
1532
1696
  readonly nativeDocument: NativeDocumentSurface;
1697
+ /** D-26 — the capability-gated DOCUMENTS door: serialize the active
1698
+ * document (`exportPaged`) and replace it with plugin-built bytes
1699
+ * (`open`), the host asking the user before unsaved edits are discarded.
1700
+ * Gated on `capabilities.documents` (`export` / `open`). Always present;
1701
+ * when the host wires no backend both doors reject and
1702
+ * `supports("documents.open@1")` / `supports("documents.exportPaged@1")`
1703
+ * are false. */
1704
+ readonly documents: DocumentsSurface;
1533
1705
  /** The capability-gated NETWORK CONSENT door (D-03; base-idea §11). Always
1534
1706
  * present; gated on `capabilities.network` and per-origin user consent.
1535
1707
  * When the host injects no consent backend, every request is DENIED (the
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export type { PluginId, PluginManifest, PluginCapabilities, PluginContributions, NetworkCapability, DataProvidersCapability, StorageCapability, WasmArtifact, WasmPurpose, WorkersCapability, SecretsCapability, GpuCapability, } from "./manifest";
1
+ export type { PluginId, PluginManifest, PluginCapabilities, PluginContributions, NetworkCapability, DataProvidersCapability, StorageCapability, WasmArtifact, WasmPurpose, WorkersCapability, SecretsCapability, DocumentsCapability, GpuCapability, } from "./manifest";
2
2
  export type { BundleHandle, PagedBundle } from "./bundle";
3
- export type { BundleHost, ContributionSurface, SceneLayerSurface, SceneLayerSubmitResult, SceneImage, SceneImageTile, SceneImageSubmitOptions, WillSaveEvent, ToolsSurface, ToolSettingValue, ImagesSurface, ImageResourceClaimOptions, TileBytes, WorkersSurface, BundleWorker, SpawnWorkerOptions, SecretsSurface, SecretMaterial, DocumentSurface, MutateWithBytesOptions, SelectionSurface, ViewportSurface, TextSurface, TextMetrics, TextCaret, FrameChainLink, PlanarFace, PlanarRegionsResult, StoryContent, ParagraphContent, RunContent, OverlaySurface, ShellSurface, FilePickerOptions, PickedFile, SaveFileOptions, StorageSurface, BlobSurface, BlobUsage, PartsSurface, NativeDocumentSurface, NetworkSurface, ConsentResult, DataProvidersSurface, DataProviderRegistration, DataProviderHandle, DataProviderInfo, DataProviderSnapshot, ProviderSchema, ProviderField, ProviderRecordSet, DiagnosticsSurface, JournalSurface, JournalRecord, BindingsSurface, Diagnostic, DocumentChangeEvent, MutationOutcome, Disposable, PluginLogger, EditContextContribution, ObjectTypeContribution, EditContextCandidate, EnteredEditContext, ContentPointerEvent, ContentWheelEvent, EditContextDescriptor, ObjectTypeDescriptor, PluginMetadataEnvelope, ObjectTypeBaker, BakeContext, MenuContribution, } from "./host";
3
+ export type { BundleHost, ContributionSurface, SceneLayerSurface, SceneLayerSubmitResult, SceneImage, SceneImageTile, SceneImageSubmitOptions, WillSaveEvent, ToolsSurface, ToolSettingValue, ImagesSurface, ImageResourceClaimOptions, TileBytes, WorkersSurface, BundleWorker, SpawnWorkerOptions, SecretsSurface, SecretMaterial, DocumentSurface, MutateWithBytesOptions, SelectionSurface, ViewportSurface, TextSurface, TextMetrics, TextCaret, FrameChainLink, PlanarFace, PlanarRegionsResult, StoryContent, ParagraphContent, RunContent, OverlaySurface, OverlayLayer, ShellSurface, FilePickerOptions, PickedFile, SaveFileOptions, StorageSurface, BlobSurface, BlobUsage, PartsSurface, NativeDocumentSurface, DocumentsSurface, OpenDocumentOptions, OpenDocumentResult, NetworkSurface, ConsentResult, DataProvidersSurface, DataProviderRegistration, DataProviderHandle, DataProviderInfo, DataProviderSnapshot, ProviderSchema, ProviderField, ProviderRecordSet, DiagnosticsSurface, JournalSurface, JournalRecord, BindingsSurface, Diagnostic, DocumentChangeEvent, DocumentOpenedEvent, MutationOutcome, Disposable, PluginLogger, EditContextContribution, ObjectTypeContribution, EditContextCandidate, EnteredEditContext, ContentPointerEvent, ContentWheelEvent, EditContextDescriptor, ObjectTypeDescriptor, PluginMetadataEnvelope, ObjectTypeBaker, BakeContext, MenuContribution, } from "./host";
4
4
  export type { PanelSchema, PanelSchemaSection, PanelSchemaRow, SchemaPanelContribution, SchemaPanelRenderer, SchemaPanelRendererProps, WidgetValueBinding, BindingRef, SchemaGate, WidgetCollectionBinding, SchemaRowAction, SchemaListAction, SchemaListSpec, } from "./panel-schema";
5
5
  export type { WidgetSurface, ColorPickerProps, CodeEditorProps, CodeEditorDiagnostic, CodeEditorLanguage, } from "./widgets";
6
6
  export type { BindingTarget, BindingPropertyRequest, BindingPropertyWrite, BindingCollectionRequest, BindingRead, BindingResolved, BindingDecline, BindingWrite, BindingCollection, BindingOp, BindingProvider, BindingProviderScope, BindingProviderHandle, BindingReadResult, BindingWriteResult, BindingCollectionResult, ActiveBindingProvider, } from "./binding-provider";
@@ -158,6 +158,14 @@ export interface PluginCapabilities {
158
158
  * and DESIGN.md §16.
159
159
  */
160
160
  secrets?: SecretsCapability;
161
+ /**
162
+ * D-26 — the DOCUMENTS door's grant (`host.documents`). `export` gates
163
+ * `exportPaged` (a read of the WHOLE container, other plugins' parts
164
+ * included); `open` gates `open` (replacing the active document with
165
+ * plugin-built bytes, after the host asks the user about unsaved
166
+ * edits). An absent field denies that door.
167
+ */
168
+ documents?: DocumentsCapability;
161
169
  /**
162
170
  * GPU (WebGPU) usage the bundle declares (I-07 / C-1 Stage B — the
163
171
  * buildable, realm-local half; ADR-018). DECLARE-ONLY: this does NOT hand
@@ -195,6 +203,13 @@ export interface GpuCapability {
195
203
  * gates the `host.secrets` door for authenticated DB-attach / remote
196
204
  * sources — the v1 (and only) grant. A closed vocabulary so the host can
197
205
  * reason about it; an absent/false `sources` denies the door. */
206
+ /** D-26 — `capabilities.documents`. Closed object vocabulary. */
207
+ export interface DocumentsCapability {
208
+ /** Grant `host.documents.exportPaged` (serialize the active document). */
209
+ export?: boolean;
210
+ /** Grant `host.documents.open` (replace the active document, user-guarded). */
211
+ open?: boolean;
212
+ }
198
213
  export interface SecretsCapability {
199
214
  /** Grant the credential store for data sources (DB-attach / remote). */
200
215
  sources: boolean;
package/dist/wire.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // GENERATED — do not edit. Vendored verbatim from the published
2
2
  // @paged-media/canvas-wasm .d.ts (tsify output from paged-media/core,
3
3
  // MPL-2.0 OR PMEL). Sync: node scripts/sync-wire.mjs · Check: --check.
4
- // Synced from @paged-media/canvas-wasm@0.68.0
4
+ // Synced from @paged-media/canvas-wasm@0.70.0
5
5
  /* tslint:disable */
6
6
  /* eslint-disable */
7
7
 
@@ -51,7 +51,7 @@ export type SceneBlendMode = "multiply" | "screen" | "overlay" | "darken" | "lig
51
51
  * `paged-mutate`, and the read-only viewer SDK must not link that.
52
52
  * See the crate docs.
53
53
  */
54
- export type Mutation = { op: "insertText"; args: { storyId: string; offset: number; text: string; cell?: TextCellAddr | null } } | { op: "deleteRange"; args: { storyId: string; start: number; end: number; cell?: TextCellAddr | null } } | { op: "applyStyle"; args: { storyId: string; start: number; end: number; style: string; scope: StyleScope; cell?: TextCellAddr | null; paragraph?: number | null } } | { op: "insertField"; args: { storyId: string; offset: number; field: FieldKind } } | { op: "insertAnchoredFrame"; args: { storyId: string; offset: number; width: number; height: number; imageUri?: string | null; paragraph?: number | null } } | { op: "insertHyperlink"; args: { storyId: string; start: number; end: number; url: string } } | { op: "setFieldValue"; args: { storyId: string; offset: number; value?: string | null } } | { op: "placeImage"; args: { elementId: string; uri: string; fit?: string | null } } | { op: "replaceImageBytes"; args: { elementId: string; bytes?: number[] | null } } | { op: "moveFrame"; args: { frameId: string; transform: [number, number, number, number, number, number] } } | { op: "resizeFrame"; args: { frameId: string; bounds: [number, number, number, number] } } | { op: "linkFrames"; args: { from: string; to: string } } | { op: "unlinkFrames"; args: { frame: string } } | { op: "insertPage"; args: { afterPageId: PageId | null; masterId: string | null } } | { op: "deletePage"; args: { pageId: PageId } } | { op: "resizePage"; args: { pageId: PageId; bounds: [number, number, number, number] } } | { op: "insertFrame"; args: { pageId: PageId; bounds: [number, number, number, number] } } | { op: "insertTextFrame"; args: { pageId: PageId; bounds: [number, number, number, number] } } | { op: "deleteFrame"; args: { frameId: string } } | { op: "insertLine"; args: { pageId: PageId; start: [number, number]; end: [number, number] } } | { op: "insertPath"; args: { pageId: PageId; anchors: PathAnchorSpec[]; open: boolean; smooth?: boolean } } | { op: "setDocumentDefaults"; args: { fillColor: string | null; strokeColor: string | null; strokeWeight: number | null } } | { op: "setColorSettings"; args: { cmykProfileName: string | null; rgbPolicy: string | null; intent: string | null; bpc: boolean | null } } | { op: "setProofSetup"; args: { profileName: string | null; simulatePaperWhite?: boolean; intent: string | null } } | { op: "importSwatchLibrary"; args: { bytes: number[]; groupName?: string | null } } | { op: "setInkSetting"; args: { spotId: string; convertToProcess?: boolean; aliasTo?: string | null } } | { op: "setUseStandardLabForSpots"; args: { enabled: boolean } } | { op: "pathPointInsert"; args: { elementId: ElementId; index: number; anchor: PathAnchorSpec; prevSubpathStarts?: number[] | null } } | { op: "pathPointRemove"; args: { elementId: ElementId; index: number } } | { op: "pathOpenAt"; args: { elementId: ElementId; index: number } } | { op: "outlineStroke"; args: { elementId: ElementId; width: number; cap: string; join: string; miterLimit: number } } | { op: "offsetPath"; args: { elementId: ElementId; delta: number; join: string; miterLimit: number } } | { op: "simplifyPath"; args: { elementId: ElementId; tolerance: number } } | { op: "closePath"; args: { elementId: ElementId; subpath?: number | null } } | { op: "joinPaths"; args: { elementId: ElementId; otherId: ElementId } } | { op: "pasteInto"; args: { containerId: ElementId; childId: ElementId } } | { op: "releaseFrom"; args: { childId: ElementId } } | { op: "reorderElement"; args: { elementId: ElementId; to: ZOrderTarget } } | { op: "applyOpacityMask"; args: { targetId: ElementId; maskId: ElementId; maskType?: string | null; invert?: boolean | null } } | { op: "releaseOpacityMask"; args: { targetId: ElementId } } | { op: "attachTextToPath"; args: { elementId: ElementId; storyId: string; pathTypeAlignment?: string | null; flipPathEffect?: string | null; startBracket?: number | null; endBracket?: number | null } } | { op: "detachTextFromPath"; args: { elementId: ElementId } } | { op: "createGroup"; args: { memberIds: ElementId[] } } | { op: "dissolveGroup"; args: { groupId: string } } | { op: "duplicateElements"; args: { elementIds: ElementId[]; offset: [number, number] } } | { op: "setGroupTransform"; args: { groupId: string; transform?: [number, number, number, number, number, number] | null } } | { op: "setPluginMetadata"; args: { elementId: ElementId; key: string; value?: string | null; caller?: string | null } } | { op: "pathPointCurveType"; args: { elementId: ElementId; index: number; smooth: boolean } } | { op: "pathPointSet"; args: { elementId: ElementId; index: number; role: PathPointRole; position: [number, number] } } | { op: "batch"; args: { ops: Mutation[] } } | { op: "bindCreated"; args: { handle: string } } | { op: "layerSetVisible"; args: { layerId: string; visible: boolean } } | { op: "layerSetLocked"; args: { layerId: string; locked: boolean } } | { op: "layerSetPrintable"; args: { layerId: string; printable: boolean } } | { op: "layerSetName"; args: { layerId: string; name: string } } | { op: "layerMove"; args: { layerId: string; newIndex: number } } | { op: "layerInsert"; args: { position: number; name: string } } | { op: "layerRemove"; args: { layerId: string } } | { op: "setElementProperty"; args: { elementId: ElementId; path: PropertyPath; value: Value } } | { op: "pathfinderBoolean"; args: { kept: ElementId; others: ElementId[]; kind: PathfinderKind } } | { op: "pathfinderDivide"; args: { elementIds: ElementId[] } } | { op: "pathfinderTrim"; args: { elementIds: ElementId[] } } | { op: "pathfinderMerge"; args: { elementIds: ElementId[] } } | { op: "pathfinderCrop"; args: { elementIds: ElementId[] } } | { op: "pathfinderOutline"; args: { elementIds: ElementId[] } } | { op: "pathfinderMinusBack"; args: { elementIds: ElementId[] } } | { op: "pathfinderFaces"; args: { elementIds: ElementId[]; faces: string[]; mode: FaceSelectMode } } | { op: "createSwatch"; args: { spec: SwatchSpec } } | { op: "editSwatch"; args: { swatchId: string; spec: SwatchSpec } } | { op: "deleteSwatch"; args: { swatchId: string } } | { op: "createGradient"; args: { spec: GradientSpec } } | { op: "editGradient"; args: { gradientId: string; spec: GradientSpec } } | { op: "deleteGradient"; args: { gradientId: string } } | { op: "createColorGroup"; args: { spec: ColorGroupSpec } } | { op: "editColorGroup"; args: { groupId: string; spec: ColorGroupSpec } } | { op: "deleteColorGroup"; args: { groupId: string } } | { op: "createNumberingList"; args: { spec: NumberingListSpec } } | { op: "editNumberingList"; args: { listId: string; spec: NumberingListSpec } } | { op: "deleteNumberingList"; args: { listId: string } } | { op: "createParagraphStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameParagraphStyle"; args: { styleId: string; name: string } } | { op: "deleteParagraphStyle"; args: { styleId: string } } | { op: "createCharacterStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameCharacterStyle"; args: { styleId: string; name: string } } | { op: "deleteCharacterStyle"; args: { styleId: string } } | { op: "createObjectStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameObjectStyle"; args: { styleId: string; name: string } } | { op: "deleteObjectStyle"; args: { styleId: string } } | { op: "createCellStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameCellStyle"; args: { styleId: string; name: string } } | { op: "deleteCellStyle"; args: { styleId: string } } | { op: "createTableStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameTableStyle"; args: { styleId: string; name: string } } | { op: "deleteTableStyle"; args: { styleId: string } } | { op: "setStyleProperty"; args: { collection: StyleCollection; styleId: string; path: PropertyPath; value: Value } } | { op: "insertOval"; args: { pageId: PageId; bounds: [number, number, number, number] } } | { op: "insertGuide"; args: { spreadId: string; orientation: GuideOrientationSpec; position: number; pageIndex?: number } } | { op: "moveGuide"; args: { guideId: string; position: number } } | { op: "deleteGuide"; args: { guideId: string } } | { op: "setConditionVisible"; args: { condition: string; visible: boolean } } | { op: "setFlowGrowRule"; args: { storyId: string; grow: boolean; maxPages?: number | null; copyFrameOptions?: boolean | null } } | { op: "activateConditionSet"; args: { set: string } } | { op: "applyMasterToPage"; args: { page: PageId; master?: string | null } } | { op: "duplicatePage"; args: { page: PageId } } | { op: "insertSection"; args: { atPage: PageId; prefix?: string | null; numberingStyle?: string | null; startAt?: number | null } } | { op: "editSection"; args: { sectionId: string; prefix?: string | null | null; numberingStyle?: string | null; startAt?: number | null | null } } | { op: "deleteSection"; args: { sectionId: string } } | { op: "setRowHeight"; args: { storyId: string; tableId: string; row: number; height?: number | null } } | { op: "setColumnWidth"; args: { storyId: string; tableId: string; col: number; width?: number | null } } | { op: "insertTableRow"; args: { storyId: string; tableId: string; at: number } } | { op: "deleteTableRow"; args: { storyId: string; tableId: string; at: number } } | { op: "insertTableColumn"; args: { storyId: string; tableId: string; at: number } } | { op: "deleteTableColumn"; args: { storyId: string; tableId: string; at: number } } | { op: "insertHeaderRow"; args: { storyId: string; tableId: string } } | { op: "removeHeaderRow"; args: { storyId: string; tableId: string } } | { op: "insertFooterRow"; args: { storyId: string; tableId: string } } | { op: "removeFooterRow"; args: { storyId: string; tableId: string } } | { op: "setCellSpan"; args: { storyId: string; tableId: string; row: number; col: number; rowSpan: number; columnSpan: number } } | { op: "insertTable"; args: { storyId: string; rows: number; cols: number; headerRows?: number; footerRows?: number; columnWidths?: number[]; rowHeights?: number[] } } | { op: "deleteTable"; args: { storyId: string; tableId: string } };
54
+ export type Mutation = { op: "insertText"; args: { storyId: string; offset: number; text: string; cell?: TextCellAddr | null } } | { op: "deleteRange"; args: { storyId: string; start: number; end: number; cell?: TextCellAddr | null } } | { op: "applyStyle"; args: { storyId: string; start: number; end: number; style: string; scope: StyleScope; cell?: TextCellAddr | null; paragraph?: number | null } } | { op: "insertField"; args: { storyId: string; offset: number; field: FieldKind; contentOffset?: number } } | { op: "insertAnchoredFrame"; args: { storyId: string; offset: number; width: number; height: number; imageUri?: string | null; paragraph?: number | null } } | { op: "insertHyperlink"; args: { storyId: string; start: number; end: number; url: string; page?: PageId | null } } | { op: "setFieldValue"; args: { storyId: string; offset: number; value?: string | null } } | { op: "placeImage"; args: { elementId: string; uri: string; fit?: string | null } } | { op: "replaceImageBytes"; args: { elementId: string; bytes?: number[] | null } } | { op: "moveFrame"; args: { frameId: string; transform: [number, number, number, number, number, number] } } | { op: "resizeFrame"; args: { frameId: string; bounds: [number, number, number, number] } } | { op: "linkFrames"; args: { from: string; to: string } } | { op: "unlinkFrames"; args: { frame: string } } | { op: "insertPage"; args: { afterPageId: PageId | null; masterId: string | null } } | { op: "deletePage"; args: { pageId: PageId } } | { op: "resizePage"; args: { pageId: PageId; bounds: [number, number, number, number] } } | { op: "insertFrame"; args: { pageId: PageId; bounds: [number, number, number, number] } } | { op: "insertTextFrame"; args: { pageId: PageId; bounds: [number, number, number, number] } } | { op: "deleteFrame"; args: { frameId: string } } | { op: "insertLine"; args: { pageId: PageId; start: [number, number]; end: [number, number] } } | { op: "insertPath"; args: { pageId: PageId; anchors: PathAnchorSpec[]; open: boolean; smooth?: boolean } } | { op: "setDocumentDefaults"; args: { fillColor: string | null; strokeColor: string | null; strokeWeight: number | null } } | { op: "setColorSettings"; args: { cmykProfileName: string | null; rgbPolicy: string | null; intent: string | null; bpc: boolean | null } } | { op: "setProofSetup"; args: { profileName: string | null; simulatePaperWhite?: boolean; intent: string | null } } | { op: "importSwatchLibrary"; args: { bytes: number[]; groupName?: string | null } } | { op: "setInkSetting"; args: { spotId: string; convertToProcess?: boolean; aliasTo?: string | null } } | { op: "setUseStandardLabForSpots"; args: { enabled: boolean } } | { op: "pathPointInsert"; args: { elementId: ElementId; index: number; anchor: PathAnchorSpec; prevSubpathStarts?: number[] | null } } | { op: "pathPointRemove"; args: { elementId: ElementId; index: number } } | { op: "pathOpenAt"; args: { elementId: ElementId; index: number } } | { op: "outlineStroke"; args: { elementId: ElementId; width: number; cap: string; join: string; miterLimit: number } } | { op: "offsetPath"; args: { elementId: ElementId; delta: number; join: string; miterLimit: number } } | { op: "simplifyPath"; args: { elementId: ElementId; tolerance: number } } | { op: "closePath"; args: { elementId: ElementId; subpath?: number | null } } | { op: "joinPaths"; args: { elementId: ElementId; otherId: ElementId } } | { op: "pasteInto"; args: { containerId: ElementId; childId: ElementId } } | { op: "releaseFrom"; args: { childId: ElementId } } | { op: "reorderElement"; args: { elementId: ElementId; to: ZOrderTarget } } | { op: "applyOpacityMask"; args: { targetId: ElementId; maskId: ElementId; maskType?: string | null; invert?: boolean | null } } | { op: "releaseOpacityMask"; args: { targetId: ElementId } } | { op: "attachTextToPath"; args: { elementId: ElementId; storyId: string; pathTypeAlignment?: string | null; flipPathEffect?: string | null; startBracket?: number | null; endBracket?: number | null } } | { op: "detachTextFromPath"; args: { elementId: ElementId } } | { op: "createGroup"; args: { memberIds: ElementId[] } } | { op: "dissolveGroup"; args: { groupId: string } } | { op: "duplicateElements"; args: { elementIds: ElementId[]; offset: [number, number] } } | { op: "setGroupTransform"; args: { groupId: string; transform?: [number, number, number, number, number, number] | null } } | { op: "setPluginMetadata"; args: { elementId: ElementId; key: string; value?: string | null; caller?: string | null } } | { op: "setPageMetadata"; args: { page: PageId; key: string; value?: string | null; caller?: string | null } } | { op: "setDocumentMetadata"; args: { key: string; value?: string | null; caller?: string | null } } | { op: "pathPointCurveType"; args: { elementId: ElementId; index: number; smooth: boolean } } | { op: "pathPointSet"; args: { elementId: ElementId; index: number; role: PathPointRole; position: [number, number] } } | { op: "batch"; args: { ops: Mutation[] } } | { op: "bindCreated"; args: { handle: string } } | { op: "layerSetVisible"; args: { layerId: string; visible: boolean } } | { op: "layerSetLocked"; args: { layerId: string; locked: boolean } } | { op: "layerSetPrintable"; args: { layerId: string; printable: boolean } } | { op: "layerSetName"; args: { layerId: string; name: string } } | { op: "layerMove"; args: { layerId: string; newIndex: number } } | { op: "layerInsert"; args: { position: number; name: string } } | { op: "layerRemove"; args: { layerId: string } } | { op: "setElementProperty"; args: { elementId: ElementId; path: PropertyPath; value: Value } } | { op: "pathfinderBoolean"; args: { kept: ElementId; others: ElementId[]; kind: PathfinderKind } } | { op: "pathfinderDivide"; args: { elementIds: ElementId[] } } | { op: "pathfinderTrim"; args: { elementIds: ElementId[] } } | { op: "pathfinderMerge"; args: { elementIds: ElementId[] } } | { op: "pathfinderCrop"; args: { elementIds: ElementId[] } } | { op: "pathfinderOutline"; args: { elementIds: ElementId[] } } | { op: "pathfinderMinusBack"; args: { elementIds: ElementId[] } } | { op: "pathfinderFaces"; args: { elementIds: ElementId[]; faces: string[]; mode: FaceSelectMode } } | { op: "createSwatch"; args: { spec: SwatchSpec } } | { op: "editSwatch"; args: { swatchId: string; spec: SwatchSpec } } | { op: "deleteSwatch"; args: { swatchId: string } } | { op: "createGradient"; args: { spec: GradientSpec } } | { op: "editGradient"; args: { gradientId: string; spec: GradientSpec } } | { op: "deleteGradient"; args: { gradientId: string } } | { op: "createColorGroup"; args: { spec: ColorGroupSpec } } | { op: "editColorGroup"; args: { groupId: string; spec: ColorGroupSpec } } | { op: "deleteColorGroup"; args: { groupId: string } } | { op: "createNumberingList"; args: { spec: NumberingListSpec } } | { op: "editNumberingList"; args: { listId: string; spec: NumberingListSpec } } | { op: "deleteNumberingList"; args: { listId: string } } | { op: "createParagraphStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameParagraphStyle"; args: { styleId: string; name: string } } | { op: "deleteParagraphStyle"; args: { styleId: string } } | { op: "createCharacterStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameCharacterStyle"; args: { styleId: string; name: string } } | { op: "deleteCharacterStyle"; args: { styleId: string } } | { op: "createObjectStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameObjectStyle"; args: { styleId: string; name: string } } | { op: "deleteObjectStyle"; args: { styleId: string } } | { op: "createCellStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameCellStyle"; args: { styleId: string; name: string } } | { op: "deleteCellStyle"; args: { styleId: string } } | { op: "createTableStyle"; args: { selfId?: string | null; name?: string | null; basedOn?: string | null } } | { op: "renameTableStyle"; args: { styleId: string; name: string } } | { op: "deleteTableStyle"; args: { styleId: string } } | { op: "setStyleProperty"; args: { collection: StyleCollection; styleId: string; path: PropertyPath; value: Value } } | { op: "insertOval"; args: { pageId: PageId; bounds: [number, number, number, number] } } | { op: "insertGuide"; args: { spreadId: string; orientation: GuideOrientationSpec; position: number; pageIndex?: number } } | { op: "moveGuide"; args: { guideId: string; position: number } } | { op: "deleteGuide"; args: { guideId: string } } | { op: "setConditionVisible"; args: { condition: string; visible: boolean } } | { op: "setFlowGrowRule"; args: { storyId: string; grow: boolean; maxPages?: number | null; copyFrameOptions?: boolean | null } } | { op: "activateConditionSet"; args: { set: string } } | { op: "applyMasterToPage"; args: { page: PageId; master?: string | null } } | { op: "duplicatePage"; args: { page: PageId } } | { op: "onMaster"; args: { master: string; mutation: Mutation } } | { op: "createMaster"; args: { master: string; name?: string | null; widthPt?: number; heightPt?: number; duplicateOf?: string | null } } | { op: "deleteMaster"; args: { master: string } } | { op: "renameMaster"; args: { master: string; name?: string | null } } | { op: "movePage"; args: { page: PageId; after?: PageId | null } } | { op: "insertSection"; args: { atPage: PageId; prefix?: string | null; numberingStyle?: string | null; startAt?: number | null } } | { op: "editSection"; args: { sectionId: string; prefix?: string | null | null; numberingStyle?: string | null; startAt?: number | null | null } } | { op: "deleteSection"; args: { sectionId: string } } | { op: "setRowHeight"; args: { storyId: string; tableId: string; row: number; height?: number | null } } | { op: "setColumnWidth"; args: { storyId: string; tableId: string; col: number; width?: number | null } } | { op: "insertTableRow"; args: { storyId: string; tableId: string; at: number } } | { op: "deleteTableRow"; args: { storyId: string; tableId: string; at: number } } | { op: "insertTableColumn"; args: { storyId: string; tableId: string; at: number } } | { op: "deleteTableColumn"; args: { storyId: string; tableId: string; at: number } } | { op: "insertHeaderRow"; args: { storyId: string; tableId: string } } | { op: "removeHeaderRow"; args: { storyId: string; tableId: string } } | { op: "insertFooterRow"; args: { storyId: string; tableId: string } } | { op: "removeFooterRow"; args: { storyId: string; tableId: string } } | { op: "setCellSpan"; args: { storyId: string; tableId: string; row: number; col: number; rowSpan: number; columnSpan: number } } | { op: "insertTable"; args: { storyId: string; rows: number; cols: number; headerRows?: number; footerRows?: number; columnWidths?: number[]; rowHeights?: number[] } } | { op: "deleteTable"; args: { storyId: string; tableId: string } };
55
55
 
56
56
  /**
57
57
  * A per-run script budget on the wire (v63). Every field is optional
@@ -175,6 +175,14 @@ export interface ScenePaint {
175
175
  a: number;
176
176
  }
177
177
 
178
+ /**
179
+ * A spread\'s place in the document: its id and transform.
180
+ */
181
+ export interface SpreadPlacement {
182
+ selfId: string;
183
+ itemTransform?: [number, number, number, number, number, number] | null;
184
+ }
185
+
178
186
  /**
179
187
  * Aftercare-A — `RequestWordBounds` reply payload. Story-local byte
180
188
  * offsets of the `[start, end)` span the word (or whitespace run)
@@ -1525,6 +1533,13 @@ export interface DocumentMeta {
1525
1533
  * `BaselineColor` — grid-line colour ref / named colour.
1526
1534
  */
1527
1535
  baselineGridColor?: string | null;
1536
+ /**
1537
+ * v69 — the document\'s own plugin metadata (`SetDocumentMetadata`
1538
+ * entries, write order). PRESENT (possibly empty) from a v69 worker,
1539
+ * absent from an older one, so a reader can tell \"none\" from \"this
1540
+ * engine has no document labels\".
1541
+ */
1542
+ pluginMetadata?: PluginMetadataEntry[];
1528
1543
  }
1529
1544
 
1530
1545
  /**
@@ -1618,6 +1633,12 @@ export interface HyperlinkSummary {
1618
1633
  name: string;
1619
1634
  source: string;
1620
1635
  destination: string;
1636
+ /**
1637
+ * v70 — where the destination goes: a URL, or a page (its `Self`
1638
+ * id). Both absent for a text-anchor destination.
1639
+ */
1640
+ destinationUrl?: string | null;
1641
+ destinationPage?: string | null;
1621
1642
  }
1622
1643
 
1623
1644
  /**
@@ -1760,6 +1781,12 @@ export interface PageSummary {
1760
1781
  bleedLeftPt?: number;
1761
1782
  bleedBottomPt?: number;
1762
1783
  bleedRightPt?: number;
1784
+ /**
1785
+ * v70 — the page\'s own `x-paged:` plugin-metadata entries
1786
+ * (`SetPageMetadata`): a slide\'s notes, transition, hidden flag. Empty
1787
+ * when it has none.
1788
+ */
1789
+ pluginMetadata?: PluginMetadataEntry[];
1763
1790
  }
1764
1791
 
1765
1792
  /**
@@ -1996,7 +2023,7 @@ export interface DocumentStats {
1996
2023
  * document\'s `BTreeMap` palettes/stylesheets rather than the scene
1997
2024
  * tree, so they\'re top-level variants rather than `InsertNode`.
1998
2025
  */
1999
- export type Operation = { kind: "SetProperty"; node: NodeId; path: PropertyPath; value: Value } | { kind: "InsertNode"; parent: NodeId; position: number; node: NodeSpec; z_slot?: number | null } | { kind: "RemoveNode"; node: NodeId } | { kind: "MoveNode"; node: NodeId; new_parent: NodeId; position: number } | { kind: "ReorderNode"; node: NodeId; target: ZOrderTarget } | { kind: "Batch"; ops: Operation[] } | { kind: "RemoveStory"; story_id: string } | { kind: "RestoreStory"; position: number; story_json: string } | { kind: "InsertPage"; after_page_id?: string | null; master_id?: string | null; spread_self_id?: string | null; page_self_id?: string | null; restore_spread_json?: string | null } | { kind: "RemovePage"; page_id: string } | { kind: "MoveLayer"; layer_id: string; new_index: number } | { kind: "InsertLayer"; position: number; name: string; self_id?: string | null } | { kind: "RemoveLayer"; layer_id: string } | { kind: "CreateSwatch"; spec: SwatchSpec } | { kind: "EditSwatch"; swatch_id: string; spec: SwatchSpec } | { kind: "DeleteSwatch"; swatch_id: string } | { kind: "CreateParagraphStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameParagraphStyle"; style_id: string; name: string } | { kind: "DeleteParagraphStyle"; style_id: string } | { kind: "CreateCharacterStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameCharacterStyle"; style_id: string; name: string } | { kind: "DeleteCharacterStyle"; style_id: string } | { kind: "CreateObjectStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameObjectStyle"; style_id: string; name: string } | { kind: "DeleteObjectStyle"; style_id: string } | { kind: "CreateCellStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameCellStyle"; style_id: string; name: string } | { kind: "DeleteCellStyle"; style_id: string } | { kind: "CreateTableStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameTableStyle"; style_id: string; name: string } | { kind: "DeleteTableStyle"; style_id: string } | { kind: "CreateGroup"; spec: GroupSpec } | { kind: "DissolveGroup"; group_id: string; restore_slots?: number[] | null } | { kind: "DuplicateNodes"; sources: NodeId[]; dx: number; dy: number; ids?: string[]; story_ids?: string[] } | { kind: "RemoveDuplicates"; sources: NodeId[]; dx: number; dy: number; ids?: string[]; story_ids?: string[] } | { kind: "SetGroupTransform"; group: string; transform?: [number, number, number, number, number, number] | null; prev?: [number, number, number, number, number, number] | null } | { kind: "CreateGradient"; spec: GradientSpec } | { kind: "EditGradient"; gradient_id: string; spec: GradientSpec } | { kind: "DeleteGradient"; gradient_id: string } | { kind: "CreateColorGroup"; spec: ColorGroupSpec } | { kind: "EditColorGroup"; group_id: string; spec: ColorGroupSpec } | { kind: "DeleteColorGroup"; group_id: string } | { kind: "CreateNumberingList"; spec: NumberingListSpec } | { kind: "EditNumberingList"; list_id: string; spec: NumberingListSpec } | { kind: "DeleteNumberingList"; list_id: string } | { kind: "SetStyleProperty"; collection: StyleCollection; style_id: string; path: PropertyPath; value: Value } | { kind: "PathfinderBoolean"; kept: NodeId; others: NodeId[]; opKind: PathfinderKind } | { kind: "PathfinderRegion"; elements: NodeId[]; verb: PathfinderRegionVerb } | { kind: "PathfinderFaces"; elements: NodeId[]; faces: string[]; mode: FaceSelectMode } | { kind: "JoinPaths"; kept: NodeId; other: NodeId } | { kind: "PasteInto"; container: NodeId; child: NodeId; child_index?: number | null } | { kind: "ReleaseFrom"; child: NodeId; restore_slot?: number | null } | { kind: "ApplyOpacityMask"; target: NodeId; mask: NodeId; mask_type?: OpacityMaskMode; invert?: boolean } | { kind: "ReleaseOpacityMask"; target: NodeId; restore_slot?: number | null } | { kind: "AttachTextToPath"; host: NodeId; story_id: string; spec?: TextPathSpec } | { kind: "DetachTextFromPath"; host: NodeId; index?: number | null; restore?: TextPathSpec | null } | { kind: "LinkFrames"; from: string; to: string } | { kind: "UnlinkFrames"; frame: string; prev_next?: string | null; restore_target?: [string, string | null, string | null] | null } | { kind: "ApplyStyle"; story_id: string; start: number; end: number; style: string; scope: StyleScope; cell?: CellAddr | null; paragraph?: number | null } | { kind: "InsertField"; story_id: string; offset: number; field: FieldKind } | { kind: "DeleteField"; story_id: string; offset: number; field: FieldKind } | { kind: "InsertAnchoredFrame"; story_id: string; offset: number; width: number; height: number; image_uri?: string | null; self_id: string; paragraph?: number | null } | { kind: "RemoveAnchoredFrame"; story_id: string; self_id: string } | { kind: "InsertHyperlink"; story_id: string; start: number; end: number; url: string; source_id: string; dest_id: string; hyperlink_id: string } | { kind: "RemoveHyperlink"; story_id: string; start: number; end: number; url: string; source_id: string; dest_id: string; hyperlink_id: string } | { kind: "SetFieldValue"; story_id: string; offset: number; value?: string | null } | { kind: "PlaceImage"; frame: NodeId; image_uri?: string | null; fit?: string | null } | { kind: "ReplaceImageBytes"; frame: NodeId; bytes?: number[] | null; prior_has_image_element?: boolean | null } | { kind: "InsertGuide"; spread_id: string; orientation: GuideOrientationSpec; position: number; page_index?: number; guide_id?: string | null } | { kind: "MoveGuide"; guide_id: string; position: number } | { kind: "DeleteGuide"; guide_id: string } | { kind: "SetConditionVisible"; condition: string; visible: boolean } | { kind: "SetFlowGrowRule"; story_id: string; rule: FlowGrowRule | null } | { kind: "ActivateConditionSet"; set: string } | { kind: "RestoreConditionVisibility"; states: [string, boolean][] } | { kind: "ApplyMasterToPage"; page: string; master?: string | null } | { kind: "DuplicatePage"; page: string; clone_spread_json?: string | null } | { kind: "InsertSection"; at_page: string; prefix?: string | null; numbering_style?: string | null; start_at?: number | null; self_id?: string | null } | { kind: "EditSection"; section_id: string; prefix?: string | null | null; numbering_style?: string | null; start_at?: number | null | null } | { kind: "DeleteSection"; section_id: string } | { kind: "SetRowHeight"; story_id: string; table_id: string; row: number; height?: number | null } | { kind: "SetColumnWidth"; story_id: string; table_id: string; col: number; width?: number | null } | { kind: "InsertTableRow"; story_id: string; table_id: string; at: number; restore?: TableLineRestoreJson | null } | { kind: "DeleteTableRow"; story_id: string; table_id: string; at: number } | { kind: "InsertTableColumn"; story_id: string; table_id: string; at: number; restore?: TableLineRestoreJson | null } | { kind: "DeleteTableColumn"; story_id: string; table_id: string; at: number } | { kind: "InsertHeaderRow"; story_id: string; table_id: string; restore?: TableLineRestoreJson | null } | { kind: "RemoveHeaderRow"; story_id: string; table_id: string } | { kind: "InsertFooterRow"; story_id: string; table_id: string; restore?: TableLineRestoreJson | null } | { kind: "RemoveFooterRow"; story_id: string; table_id: string } | { kind: "SetCellSpan"; story_id: string; table_id: string; row: number; col: number; row_span: number; column_span: number };
2026
+ export type Operation = { kind: "SetProperty"; node: NodeId; path: PropertyPath; value: Value } | { kind: "InsertNode"; parent: NodeId; position: number; node: NodeSpec; z_slot?: number | null } | { kind: "RemoveNode"; node: NodeId } | { kind: "MoveNode"; node: NodeId; new_parent: NodeId; position: number } | { kind: "ReorderNode"; node: NodeId; target: ZOrderTarget } | { kind: "Batch"; ops: Operation[] } | { kind: "RemoveStory"; story_id: string } | { kind: "RestoreStory"; position: number; story_json: string } | { kind: "InsertPage"; after_page_id?: string | null; master_id?: string | null; spread_self_id?: string | null; page_self_id?: string | null; restore_spread_json?: string | null } | { kind: "RemovePage"; page_id: string } | { kind: "MoveLayer"; layer_id: string; new_index: number } | { kind: "InsertLayer"; position: number; name: string; self_id?: string | null } | { kind: "RemoveLayer"; layer_id: string } | { kind: "CreateSwatch"; spec: SwatchSpec } | { kind: "EditSwatch"; swatch_id: string; spec: SwatchSpec } | { kind: "DeleteSwatch"; swatch_id: string } | { kind: "CreateParagraphStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameParagraphStyle"; style_id: string; name: string } | { kind: "DeleteParagraphStyle"; style_id: string } | { kind: "CreateCharacterStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameCharacterStyle"; style_id: string; name: string } | { kind: "DeleteCharacterStyle"; style_id: string } | { kind: "CreateObjectStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameObjectStyle"; style_id: string; name: string } | { kind: "DeleteObjectStyle"; style_id: string } | { kind: "CreateCellStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameCellStyle"; style_id: string; name: string } | { kind: "DeleteCellStyle"; style_id: string } | { kind: "CreateTableStyle"; self_id?: string | null; name?: string | null; based_on?: string | null; restore_json?: string | null } | { kind: "RenameTableStyle"; style_id: string; name: string } | { kind: "DeleteTableStyle"; style_id: string } | { kind: "CreateGroup"; spec: GroupSpec } | { kind: "DissolveGroup"; group_id: string; restore_slots?: number[] | null } | { kind: "DuplicateNodes"; sources: NodeId[]; dx: number; dy: number; ids?: string[]; story_ids?: string[] } | { kind: "RemoveDuplicates"; sources: NodeId[]; dx: number; dy: number; ids?: string[]; story_ids?: string[] } | { kind: "SetGroupTransform"; group: string; transform?: [number, number, number, number, number, number] | null; prev?: [number, number, number, number, number, number] | null } | { kind: "CreateGradient"; spec: GradientSpec } | { kind: "EditGradient"; gradient_id: string; spec: GradientSpec } | { kind: "DeleteGradient"; gradient_id: string } | { kind: "CreateColorGroup"; spec: ColorGroupSpec } | { kind: "EditColorGroup"; group_id: string; spec: ColorGroupSpec } | { kind: "DeleteColorGroup"; group_id: string } | { kind: "CreateNumberingList"; spec: NumberingListSpec } | { kind: "EditNumberingList"; list_id: string; spec: NumberingListSpec } | { kind: "DeleteNumberingList"; list_id: string } | { kind: "SetStyleProperty"; collection: StyleCollection; style_id: string; path: PropertyPath; value: Value } | { kind: "PathfinderBoolean"; kept: NodeId; others: NodeId[]; opKind: PathfinderKind } | { kind: "PathfinderRegion"; elements: NodeId[]; verb: PathfinderRegionVerb } | { kind: "PathfinderFaces"; elements: NodeId[]; faces: string[]; mode: FaceSelectMode } | { kind: "JoinPaths"; kept: NodeId; other: NodeId } | { kind: "PasteInto"; container: NodeId; child: NodeId; child_index?: number | null } | { kind: "ReleaseFrom"; child: NodeId; restore_slot?: number | null } | { kind: "ApplyOpacityMask"; target: NodeId; mask: NodeId; mask_type?: OpacityMaskMode; invert?: boolean } | { kind: "ReleaseOpacityMask"; target: NodeId; restore_slot?: number | null } | { kind: "AttachTextToPath"; host: NodeId; story_id: string; spec?: TextPathSpec } | { kind: "DetachTextFromPath"; host: NodeId; index?: number | null; restore?: TextPathSpec | null } | { kind: "LinkFrames"; from: string; to: string } | { kind: "UnlinkFrames"; frame: string; prev_next?: string | null; restore_target?: [string, string | null, string | null] | null } | { kind: "ApplyStyle"; story_id: string; start: number; end: number; style: string; scope: StyleScope; cell?: CellAddr | null; paragraph?: number | null } | { kind: "InsertField"; story_id: string; offset: number; field: FieldKind; content_offset?: number } | { kind: "DeleteField"; story_id: string; offset: number; field: FieldKind } | { kind: "InsertAnchoredFrame"; story_id: string; offset: number; width: number; height: number; image_uri?: string | null; self_id: string; paragraph?: number | null } | { kind: "RemoveAnchoredFrame"; story_id: string; self_id: string } | { kind: "InsertHyperlink"; story_id: string; start: number; end: number; url: string; source_id: string; dest_id: string; hyperlink_id: string; page?: string | null } | { kind: "RemoveHyperlink"; story_id: string; start: number; end: number; url: string; source_id: string; dest_id: string; hyperlink_id: string; page?: string | null } | { kind: "SetFieldValue"; story_id: string; offset: number; value?: string | null } | { kind: "PlaceImage"; frame: NodeId; image_uri?: string | null; fit?: string | null } | { kind: "ReplaceImageBytes"; frame: NodeId; bytes?: number[] | null; prior_has_image_element?: boolean | null } | { kind: "InsertGuide"; spread_id: string; orientation: GuideOrientationSpec; position: number; page_index?: number; guide_id?: string | null } | { kind: "MoveGuide"; guide_id: string; position: number } | { kind: "DeleteGuide"; guide_id: string } | { kind: "SetConditionVisible"; condition: string; visible: boolean } | { kind: "SetFlowGrowRule"; story_id: string; rule: FlowGrowRule | null } | { kind: "ActivateConditionSet"; set: string } | { kind: "RestoreConditionVisibility"; states: [string, boolean][] } | { kind: "ApplyMasterToPage"; page: string; master?: string | null } | { kind: "CreateMaster"; master_id: string; name?: string | null; width_pt: number; height_pt: number; duplicate_of?: string | null; restore_json?: string | null } | { kind: "DeleteMaster"; master_id: string } | { kind: "RestoreMaster"; master_json: string } | { kind: "RenameMaster"; master_id: string; name?: string | null } | { kind: "OnMaster"; master_id: string; op: Operation } | { kind: "MovePage"; page_id: string; after_page_id?: string | null } | { kind: "SetSpreadOrder"; spreads: SpreadPlacement[] } | { kind: "DuplicatePage"; page: string; clone_spread_json?: string | null } | { kind: "RemovePageClone"; page: string; cloned_page: string; story_ids?: string[]; hyperlink_ids?: string[] } | { kind: "InsertSection"; at_page: string; prefix?: string | null; numbering_style?: string | null; start_at?: number | null; self_id?: string | null } | { kind: "EditSection"; section_id: string; prefix?: string | null | null; numbering_style?: string | null; start_at?: number | null | null } | { kind: "SetDocumentMetadata"; key: string; value?: string | null; caller?: string | null } | { kind: "DeleteSection"; section_id: string } | { kind: "SetRowHeight"; story_id: string; table_id: string; row: number; height?: number | null } | { kind: "SetColumnWidth"; story_id: string; table_id: string; col: number; width?: number | null } | { kind: "InsertTableRow"; story_id: string; table_id: string; at: number; restore?: TableLineRestoreJson | null } | { kind: "DeleteTableRow"; story_id: string; table_id: string; at: number } | { kind: "InsertTableColumn"; story_id: string; table_id: string; at: number; restore?: TableLineRestoreJson | null } | { kind: "DeleteTableColumn"; story_id: string; table_id: string; at: number } | { kind: "InsertHeaderRow"; story_id: string; table_id: string; restore?: TableLineRestoreJson | null } | { kind: "RemoveHeaderRow"; story_id: string; table_id: string } | { kind: "InsertFooterRow"; story_id: string; table_id: string; restore?: TableLineRestoreJson | null } | { kind: "RemoveFooterRow"; story_id: string; table_id: string } | { kind: "SetCellSpan"; story_id: string; table_id: string; row: number; col: number; row_span: number; column_span: number };
2000
2027
 
2001
2028
  /**
2002
2029
  * The discriminated payload of a `MainToWorker` message. Tagged so
@@ -2005,7 +2032,7 @@ export type Operation = { kind: "SetProperty"; node: NodeId; path: PropertyPath;
2005
2032
  * variants so e.g. `cmyk_icc_profile` becomes `cmykIccProfile` on
2006
2033
  * the wire — the TS protocol mirror locks the camelCase contract.
2007
2034
  */
2008
- export type MainToWorkerKind = { kind: "hello" } | { kind: "loadDocument"; payload: { bytes: number[]; font?: number[] | null; cmykIccProfile?: number[] | null } } | { kind: "newBlankDocument"; payload: { widthPt: number; heightPt: number; font?: number[] | null } } | { kind: "registerFont"; payload: { family: string; style?: string | null; bytes: number[] } } | { kind: "clearFontRegistry" } | { kind: "registerColorProfile"; payload: { name: string; bytes: number[] } } | { kind: "mutate"; payload: Mutation } | { kind: "requestPage"; payload: { pageId: PageId; lod: LodTier } } | { kind: "hitTest"; payload: { pageId: PageId; docPoint: [number, number]; filter: HitFilter } } | { kind: "requestSnapshot"; payload: { pageId: PageId; targetWidthPx: number; dpi?: number | null } } | { kind: "setSelection"; payload: { selection: ContentSelection | null } } | { kind: "requestSelectionGeometry"; payload: { selection: ContentSelection } } | { kind: "requestCaretGeometry"; payload: { selection: ContentSelection } } | { kind: "requestCaretNav"; payload: { storyId: string; offset: number; direction: CaretDirection; cell?: TextCellAddr | null } } | { kind: "requestLineBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "requestWordBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "requestParagraphBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "undo" } | { kind: "redo" } | { kind: "setElementSelection"; payload: { ids: ElementId[]; mode: SelectionMode } } | { kind: "requestMarqueeHits"; payload: { pageId: PageId; rect: [number, number, number, number] } } | { kind: "requestElementGeometry"; payload: { ids: ElementId[] } } | { kind: "requestGroupLeaves"; payload: { groupId: string } } | { kind: "requestPathAnchors"; payload: { id: ElementId } } | { kind: "requestTextOutlines"; payload: { id: ElementId } } | { kind: "requestSnapPoint"; payload: { query: SnapPointQuery } } | { kind: "setSnapSettings"; payload: { settings: SnapSettings } } | { kind: "requestNearestPathPoint"; payload: { id: ElementId; point: [number, number] } } | { kind: "requestPlanarRegions"; payload: { elementIds: ElementId[]; point?: [number, number] | null } } | { kind: "requestLayers" } | { kind: "requestCollection"; payload: { name: CollectionName } } | { kind: "requestFrameChain"; payload: { storyId: string } } | { kind: "requestStoryContent"; payload: { storyId: string } } | { kind: "requestStyleProperties"; payload: { collection: StyleCollection; styleId: string } } | { kind: "requestPlacedAssetBytes"; payload: { elementId: string } } | { kind: "requestFontFaceBytes"; payload: { family: string; style?: string | null } } | { kind: "requestMeasureText"; payload: { family: string; style?: string | null; text: string; sizePt: number } } | { kind: "submitSceneLayer"; payload: { elementId: string; layer: SceneLayer; caller?: string } } | { kind: "clearSceneLayer"; payload: { elementId: string } } | { kind: "submitPixelLayer"; payload: { elementId: string; layer: PixelLayer } } | { kind: "clearPixelLayer"; payload: { elementId: string } } | { kind: "claimImageResource"; payload: { imageId: string; levels: number; tileSize: number; baseWidth: number; baseHeight: number; revision: number } } | { kind: "releaseImageResource"; payload: { imageId: string } } | { kind: "submitResourceTiles"; payload: { imageId: string; level: number; tiles: ProviderTileWire[]; generation: number } } | { kind: "requestDocumentMeta" } | { kind: "requestDocumentPlaceholders" } | { kind: "requestColorPreview"; payload: { swatchId: string } } | { kind: "requestColorCompute"; payload: { space: string; value: number[]; tint?: number | null; model?: string | null; alternateSpace?: string | null; alternateValue?: number[] | null } } | { kind: "requestGradientDetail"; payload: { gradientId: string } } | { kind: "exportSwatchLibrary"; payload: { groupId?: string | null } } | { kind: "executeScript"; payload: { source: string; budget?: ScriptBudgetWire | null } } | { kind: "exportPdfBegin"; payload: { options: ExportPdfWireOptions } } | { kind: "exportPdfPage"; payload: { session: number } } | { kind: "exportPdfFinish"; payload: { session: number } } | { kind: "exportPdfCancel"; payload: { session: number } } | { kind: "exportIdml"; payload: { linkBase?: string | null } } | { kind: "writePagedPart"; payload: { path: string; bytes: number[]; caller?: string } } | { kind: "readPagedPart"; payload: { path: string } } | { kind: "listPagedParts"; payload: { prefix: string } } | { kind: "deletePagedPart"; payload: { path: string; caller?: string } } | { kind: "exportPaged"; payload: {} } | { kind: "requestElementProperties"; payload: { id: ElementId } } | { kind: "requestSceneTree" } | { kind: "beginGesture"; payload: { nodes: ElementId[]; gesture: GestureType; anchor?: GestureAnchor | null; cameraScale?: number | null } } | { kind: "updateGesture"; payload: { handle: GestureHandle; delta: [number, number]; modifiers: GestureModifiers } } | { kind: "commitGesture"; payload: { handle: GestureHandle } } | { kind: "cancelGesture"; payload: { handle: GestureHandle } };
2035
+ export type MainToWorkerKind = { kind: "hello" } | { kind: "loadDocument"; payload: { bytes: number[]; font?: number[] | null; cmykIccProfile?: number[] | null } } | { kind: "newBlankDocument"; payload: { widthPt: number; heightPt: number; font?: number[] | null } } | { kind: "registerFont"; payload: { family: string; style?: string | null; bytes: number[]; scope?: FontScope } } | { kind: "clearFontRegistry"; payload: ClearFontRegistryPayload | null } | { kind: "registerColorProfile"; payload: { name: string; bytes: number[] } } | { kind: "mutate"; payload: Mutation } | { kind: "requestPage"; payload: { pageId: PageId; lod: LodTier } } | { kind: "hitTest"; payload: { pageId: PageId; docPoint: [number, number]; filter: HitFilter } } | { kind: "requestSnapshot"; payload: { pageId: PageId; targetWidthPx: number; dpi?: number | null; hideItems?: ElementId[] } } | { kind: "setSelection"; payload: { selection: ContentSelection | null } } | { kind: "requestSelectionGeometry"; payload: { selection: ContentSelection } } | { kind: "requestCaretGeometry"; payload: { selection: ContentSelection } } | { kind: "requestCaretNav"; payload: { storyId: string; offset: number; direction: CaretDirection; cell?: TextCellAddr | null } } | { kind: "requestLineBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "requestWordBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "requestParagraphBounds"; payload: { storyId: string; offset: number; cell?: TextCellAddr | null } } | { kind: "undo" } | { kind: "redo" } | { kind: "setElementSelection"; payload: { ids: ElementId[]; mode: SelectionMode } } | { kind: "requestMarqueeHits"; payload: { pageId: PageId; rect: [number, number, number, number] } } | { kind: "requestElementGeometry"; payload: { ids: ElementId[] } } | { kind: "requestGroupLeaves"; payload: { groupId: string } } | { kind: "requestPathAnchors"; payload: { id: ElementId } } | { kind: "requestTextOutlines"; payload: { id: ElementId } } | { kind: "requestSnapPoint"; payload: { query: SnapPointQuery } } | { kind: "setSnapSettings"; payload: { settings: SnapSettings } } | { kind: "requestNearestPathPoint"; payload: { id: ElementId; point: [number, number] } } | { kind: "requestPlanarRegions"; payload: { elementIds: ElementId[]; point?: [number, number] | null } } | { kind: "requestLayers" } | { kind: "requestCollection"; payload: { name: CollectionName } } | { kind: "requestFrameChain"; payload: { storyId: string } } | { kind: "requestStoryContent"; payload: { storyId: string } } | { kind: "requestStyleProperties"; payload: { collection: StyleCollection; styleId: string } } | { kind: "requestPlacedAssetBytes"; payload: { elementId: string } } | { kind: "requestFontFaceBytes"; payload: { family: string; style?: string | null } } | { kind: "requestMeasureText"; payload: { family: string; style?: string | null; text: string; sizePt: number } } | { kind: "submitSceneLayer"; payload: { elementId: string; layer: SceneLayer; caller?: string } } | { kind: "clearSceneLayer"; payload: { elementId: string } } | { kind: "submitPixelLayer"; payload: { elementId: string; layer: PixelLayer } } | { kind: "clearPixelLayer"; payload: { elementId: string } } | { kind: "claimImageResource"; payload: { imageId: string; levels: number; tileSize: number; baseWidth: number; baseHeight: number; revision: number } } | { kind: "releaseImageResource"; payload: { imageId: string } } | { kind: "submitResourceTiles"; payload: { imageId: string; level: number; tiles: ProviderTileWire[]; generation: number } } | { kind: "requestDocumentMeta" } | { kind: "requestDocumentPlaceholders" } | { kind: "requestColorPreview"; payload: { swatchId: string } } | { kind: "requestColorCompute"; payload: { space: string; value: number[]; tint?: number | null; model?: string | null; alternateSpace?: string | null; alternateValue?: number[] | null } } | { kind: "requestGradientDetail"; payload: { gradientId: string } } | { kind: "exportSwatchLibrary"; payload: { groupId?: string | null } } | { kind: "executeScript"; payload: { source: string; budget?: ScriptBudgetWire | null } } | { kind: "exportPdfBegin"; payload: { options: ExportPdfWireOptions } } | { kind: "exportPdfPage"; payload: { session: number } } | { kind: "exportPdfFinish"; payload: { session: number } } | { kind: "exportPdfCancel"; payload: { session: number } } | { kind: "exportIdml"; payload: { linkBase?: string | null } } | { kind: "writePagedPart"; payload: { path: string; bytes: number[]; caller?: string } } | { kind: "readPagedPart"; payload: { path: string } } | { kind: "listPagedParts"; payload: { prefix: string } } | { kind: "deletePagedPart"; payload: { path: string; caller?: string } } | { kind: "exportPaged"; payload: {} } | { kind: "requestElementProperties"; payload: { id: ElementId } } | { kind: "requestSceneTree" } | { kind: "beginGesture"; payload: { nodes: ElementId[]; gesture: GestureType; anchor?: GestureAnchor | null; cameraScale?: number | null } } | { kind: "updateGesture"; payload: { handle: GestureHandle; delta: [number, number]; modifiers: GestureModifiers } } | { kind: "commitGesture"; payload: { handle: GestureHandle } } | { kind: "cancelGesture"; payload: { handle: GestureHandle } };
2009
2036
 
2010
2037
  /**
2011
2038
  * The document\'s snapping preferences — one set for every tool and
@@ -2792,6 +2819,21 @@ export interface StyleProperties {
2792
2819
  entries: PropertyEntry[];
2793
2820
  }
2794
2821
 
2822
+ /**
2823
+ * v70 — `ClearFontRegistry`\'s optional payload.
2824
+ */
2825
+ export interface ClearFontRegistryPayload {
2826
+ scope?: FontScope;
2827
+ }
2828
+
2829
+ /**
2830
+ * v70 — which registry a `RegisterFont` / `ClearFontRegistry` addresses.
2831
+ * `document` is the registry document text lays out with (and the one
2832
+ * `FontSummary.isMissing` and substitution tracing read); `sceneLayer` is
2833
+ * consulted by plugin scene-layer text only, ahead of the document\'s.
2834
+ */
2835
+ export type FontScope = "document" | "sceneLayer";
2836
+
2795
2837
  /**
2796
2838
  * §21 advanced prepress — one ink plate\'s coverage on one page.
2797
2839
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/plugin-api",
3
- "version": "0.2.40-canary.0",
3
+ "version": "0.2.42-canary.0",
4
4
  "description": "The Paged plugin contract: manifest, bundle lifecycle, the BundleHost surface, and the contribution + engine wire types. Type-only.",
5
5
  "license": "MPL-2.0 OR LicenseRef-PMEL",
6
6
  "type": "module",
@@ -180,6 +180,19 @@
180
180
  }
181
181
  }
182
182
  },
183
+ "documents": {
184
+ "type": "object",
185
+ "description": "Documents door (D-26; host.documents). 'export' grants exportPaged (serialize the active document, the whole container); 'open' grants open (replace the active document with plugin-built bytes; the host asks the user before discarding unsaved edits). An absent field denies that door.",
186
+ "additionalProperties": false,
187
+ "properties": {
188
+ "export": {
189
+ "type": "boolean"
190
+ },
191
+ "open": {
192
+ "type": "boolean"
193
+ }
194
+ }
195
+ },
183
196
  "gpu": {
184
197
  "type": "object",
185
198
  "description": "WebGPU usage declaration (I-07 / C-1 Stage B realm-local; ADR-018). DECLARE-ONLY: no GPUDevice is handed to the bundle — it legitimizes the realm-local WebGPU usage the bundle already does in its own JS realm (paged.image Engine-B). realm:\"bundle\" is the only value accepted today; realm:\"shared\" (future host-device-sharing) is reserved and REJECTED until the zero-copy walls lift. No requestGpuDevice surface exists.",