@paged-media/plugin-api 0.2.42-canary.0 → 0.2.43-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/host.d.ts +52 -0
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/host.d.ts
CHANGED
|
@@ -1138,6 +1138,55 @@ export interface ViewportSurface {
|
|
|
1138
1138
|
/** Screen px → document pt at the current zoom (the constant-
|
|
1139
1139
|
* screen-tolerance idiom every tool needs). */
|
|
1140
1140
|
pxToPt(px: number): number;
|
|
1141
|
+
/** v70 — bring a page into view, fitted to the viewport (a slide
|
|
1142
|
+
* sorter's click, a link to a page). `false` when the page is unknown
|
|
1143
|
+
* or the host can't navigate: probe `supports("viewport.pages@1")`. */
|
|
1144
|
+
goToPage(pageId: PageId, options?: {
|
|
1145
|
+
fit?: "page" | "width";
|
|
1146
|
+
}): Promise<boolean>;
|
|
1147
|
+
/** v70 — the page the user is on: the one the viewport's centre is
|
|
1148
|
+
* over, else the nearest (the same page `host.document.meta()`
|
|
1149
|
+
* reports as `activePage`). `null` with no document or no host
|
|
1150
|
+
* backend. */
|
|
1151
|
+
activePage(): PageId | null;
|
|
1152
|
+
/** v70 — fires when the active page changes (scrolling, zooming,
|
|
1153
|
+
* `goToPage`, a page deleted under it). Never fires without a host
|
|
1154
|
+
* backend. */
|
|
1155
|
+
onDidChangeActivePage(listener: (pageId: PageId | null) => void): Disposable;
|
|
1156
|
+
}
|
|
1157
|
+
/** v70 — what `host.render.snapshot` renders. */
|
|
1158
|
+
export interface RenderSnapshotOptions {
|
|
1159
|
+
/** Width of the image in device pixels, 1 to 8192; the height follows
|
|
1160
|
+
* the page's aspect. The engine renders at a resolution derived from
|
|
1161
|
+
* it, so the image can be a pixel off: `RenderedPage.widthPx` is exact. */
|
|
1162
|
+
widthPx: number;
|
|
1163
|
+
/** Items to leave out of this image only (a build step whose shapes
|
|
1164
|
+
* have not appeared yet). The document is not changed and no undo
|
|
1165
|
+
* step is recorded. */
|
|
1166
|
+
hideItems?: ElementId[];
|
|
1167
|
+
}
|
|
1168
|
+
/** v70 — one rendered page. */
|
|
1169
|
+
export interface RenderedPage {
|
|
1170
|
+
pageId: PageId;
|
|
1171
|
+
/** The image's own size, within a pixel of the requested width. */
|
|
1172
|
+
widthPx: number;
|
|
1173
|
+
heightPx: number;
|
|
1174
|
+
/** PNG bytes; `createImageBitmap(new Blob([png]))` draws them. */
|
|
1175
|
+
png: Uint8Array;
|
|
1176
|
+
/** The engine's layout generation the image shows: an image with an
|
|
1177
|
+
* older generation than a page's current one is stale. */
|
|
1178
|
+
layoutGeneration: number;
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* v70 — render a page to an image with the engine's own renderer (CPU),
|
|
1182
|
+
* the same pixels the canvas shows: slide thumbnails, a slideshow's
|
|
1183
|
+
* frames, a build step's frames. A READ: gated on
|
|
1184
|
+
* `capabilities.document.read`. `supports("render.snapshot@1")`.
|
|
1185
|
+
*/
|
|
1186
|
+
export interface RenderSurface {
|
|
1187
|
+
/** The page as a PNG, or `null` when the page is unknown or the
|
|
1188
|
+
* engine refused (an invalid width). */
|
|
1189
|
+
snapshot(pageId: PageId, options: RenderSnapshotOptions): Promise<RenderedPage | null>;
|
|
1141
1190
|
}
|
|
1142
1191
|
/** Font advance + vertical metrics, in document points (pt). */
|
|
1143
1192
|
export interface TextMetrics {
|
|
@@ -1660,6 +1709,9 @@ export interface BundleHost {
|
|
|
1660
1709
|
readonly document: DocumentSurface;
|
|
1661
1710
|
readonly selection: SelectionSurface;
|
|
1662
1711
|
readonly viewport: ViewportSurface;
|
|
1712
|
+
/** v70 — page images from the engine's renderer (thumbnails, slideshow
|
|
1713
|
+
* frames). `supports("render.snapshot@1")`; gated on document read. */
|
|
1714
|
+
readonly render: RenderSurface;
|
|
1663
1715
|
/** Font measurement against the document's fonts (S-13). A read door,
|
|
1664
1716
|
* no capability gate; `supports("text.measure@1")` reports whether the
|
|
1665
1717
|
* host wired the engine shaper (it is false under a host that injects
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
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, 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";
|
|
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, RenderSurface, RenderSnapshotOptions, RenderedPage, 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";
|
|
7
7
|
export type { AssetSurface, AssetKind, FontFaceAsset, FontFaceFormat, } from "./assets";
|
|
8
|
-
export type { ProviderTileWire } from "./wire";
|
|
8
|
+
export type { ProviderTileWire, SnapshotPng } from "./wire";
|
|
9
9
|
export type { SnapPointQuery, SnapPointResult, SnapPointHit, SnapAxisHit, SnapSegmentHit, SnapExclude, SnapSource, SnapSettings, } from "./wire";
|
|
10
10
|
export type { MintedElement } from "./wire";
|
|
11
11
|
export type { ClipboardSurface, ClipboardPayload, TabularClipboard, } from "./clipboard";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paged-media/plugin-api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43-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",
|