@cloudpdf/engine 3.0.0-next.15 → 3.0.0-next.16

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/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { AbortablePromise, AnnotationAppearanceImageOptions, AnnotationAppearanceImagesResult, AnnotationBundle, AnnotationCreateOptions, AnnotationCreateResult, AnnotationDeleteResult, AnnotationDraft, AnnotationExportSelection, AnnotationFlattenResult, AnnotationImportOptions, AnnotationImportResult, AnnotationList, AnnotationListOptions, AnnotationPatch, AnnotationPosition, AnnotationRef, AnnotationReorderResult, AnnotationResourceRole, AnnotationUpdateOptions, AnnotationUpdateResult, BundleLimits, CallFacts, Change, ChangeAnswer, ChangeResult, CustomMetadataService, DocumentActionsService, DocumentAnnotationsService, DocumentAttachmentsService, DocumentEventStream, DocumentFormsService, DocumentHandle, DocumentMetadata, DocumentPagesService, DocumentRedactionService, DocumentRenderService, DocumentSearchService, DocumentSecurityService, DocumentSignaturesService, DownloadOptions, EditSessionAccess, EditSessionStatus, Engine, EngineError, FlattenWriteOptions, MetadataPatch, MetadataService, MetadataUpdateResult, MutationMeta, ObjectNumberPool, ObjectNumberRange, ObjectNumbersLost, OpenInput, OpenOptions, PageAnnotationsService, PageCoordinates, PageDeleteResult, PageFlattenResult, PageFormsService, PageHandle, PageImageOptions, PageInsertBlankOptions, PageInsertBlankSpec, PageInsertResult, PageLayerRights, PageLayout, PageListSnapshot, PageMeasureService, PageMeasurementViewportList, PageNameInput, PageNameResult, PagePosition, PageRef, PageRemoveNameInput, PageRenderImage, PageRenderService, PageReorderResult, PageRotateResult, PageScaleResult, PageTextService, PageTextSnapshot, PdfMeasure, PdfRotation, SearchRequest, SearchSlice, SessionEventPublisher, TextLayout, TextRange, TokenSource, WireAnnotationResources, WorkingSetPage, WriteOptions } from "@embedpdf/engine-core/runtime";
1
+ import { AbortablePromise, AnnotationAppearanceImageOptions, AnnotationAppearanceImagesResult, AnnotationBundle, AnnotationCreateOptions, AnnotationCreateResult, AnnotationDeleteResult, AnnotationDraft, AnnotationExportSelection, AnnotationFlattenResult, AnnotationImportOptions, AnnotationImportResult, AnnotationList, AnnotationListOptions, AnnotationPatch, AnnotationPosition, AnnotationRef, AnnotationReorderResult, AnnotationResourceRole, AnnotationUpdateOptions, AnnotationUpdateResult, BundleLimits, CallFacts, Change, ChangeAnswer, ChangeResult, CustomMetadataService, DocumentActionsService, DocumentAnnotationsService, DocumentAttachmentsService, DocumentEventStream, DocumentFormsService, DocumentHandle, DocumentMetadata, DocumentOutlineService, DocumentPagesService, DocumentRedactionService, DocumentRenderService, DocumentSearchService, DocumentSecurityService, DocumentSignaturesService, DownloadOptions, EditSessionAccess, EditSessionStatus, Engine, EngineError, FlattenWriteOptions, MetadataPatch, MetadataService, MetadataUpdateResult, MutationMeta, ObjectNumberPool, ObjectNumberRange, ObjectNumbersLost, OpenInput, OpenOptions, PageAnnotationsService, PageCoordinates, PageExtractOptions, PageFlattenResult, PageFormsService, PageHandle, PageImageOptions, PageLayerRights, PageLayout, PageListSnapshot, PageMeasureService, PageMeasurementViewportList, PageNameInput, PageNameResult, PagePrintRights, PageRef, PageRemoveNameInput, PageRenderImage, PageRenderService, PageScaleResult, PageStructureVerb, PageTextService, PageTextSnapshot, PdfMeasure, SearchRequest, SearchSlice, SessionEventPublisher, TextLayout, TextRange, TokenSource, WireAnnotationResources, WorkingSetPage, WriteOptions } from "@embedpdf/engine-core/runtime";
2
2
  import { CdnAccessInfoForApply, DocumentHead, DocumentManifest, LayerScopePlane } from "@embedpdf/engine-core/wire";
3
3
  export * from "@embedpdf/engine-core/public";
4
4
  //#region src/transport/HttpClient.d.ts
@@ -93,11 +93,7 @@ interface RequestOptions {
93
93
  /** Sent as the editing session though not a write: `/access`, the bulk reservation. */
94
94
  readonly session?: boolean;
95
95
  }
96
- /**
97
- * A raw-bytes response plus its headers. The attachment-file leaves carry
98
- * their metadata as headers (`Content-Type`, `X-EmbedPDF-File-Name`), so
99
- * unlike `getBytes` the caller needs the `Headers` object back.
100
- */
96
+ /** A raw-bytes response plus its headers. */
101
97
  interface HttpFileResponse {
102
98
  bytes: Uint8Array;
103
99
  headers: Headers;
@@ -271,6 +267,33 @@ declare class CloudEngine implements Engine {
271
267
  destroy(): AbortablePromise<void>;
272
268
  }
273
269
  //#endregion
270
+ //#region src/document/CloudDocumentSearchService.d.ts
271
+ /**
272
+ * Cloud search transport: versioned GETs, one per budgeted slice.
273
+ *
274
+ * Every slice URL is a canonical cache key — the search token pins the
275
+ * layer's content epoch (computed from the cached manifest), the
276
+ * canonical query (default-fold literals collapse case/diacritic
277
+ * variants into one entry), and the resume position. Identical searches
278
+ * from any reader of the document hit the same CDN entry; matches are
279
+ * all that ever crosses the trust boundary, and the rects/full endpoint
280
+ * split keeps permission tiers in disjoint cache namespaces.
281
+ *
282
+ * Staleness rides the standard versioned-read signal: a first slice
283
+ * answered `NotFound` means our manifest is stale → refresh and retry
284
+ * once; a continuation answered `NotFound` means the document changed
285
+ * mid-search → `InvalidArg`, same contract as the local engine's cursor.
286
+ */
287
+ declare class CloudDocumentSearchService implements DocumentSearchService {
288
+ private readonly http;
289
+ private readonly docId;
290
+ private readonly layerName;
291
+ private readonly isClosed;
292
+ private readonly manifest;
293
+ constructor(http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor);
294
+ query(request: SearchRequest): AbortablePromise<SearchSlice>;
295
+ }
296
+ //#endregion
274
297
  //#region src/document/CloudObjectNumberPool.d.ts
275
298
  interface CloudObjectNumberPoolOptions {
276
299
  /** `POST …/object-numbers`: `count` more numbers for this editing session. */
@@ -447,101 +470,6 @@ declare class CloudWrites {
447
470
  private send;
448
471
  }
449
472
  //#endregion
450
- //#region src/document/CloudDocumentPagesService.d.ts
451
- /**
452
- * Cloud-side document pages service. Mirrors `LocalDocumentPagesService`
453
- * over HTTP: GET /pages for `list`, POST /pages/reorder for the reorder.
454
- *
455
- * Page identity rule (locked with the user, do not change):
456
- * - Pages are addressed exclusively by `PageRef` (their indirect
457
- * `pageObjectNumber`); mutation bodies ship `{ pages: PageRef[] }`.
458
- * The wire never sends a page index for a mutation. This keeps
459
- * multi-call client logic from having to account for index drift
460
- * between requests.
461
- * - Successful `reorder()` returns the new `layout` (order + geometry) plus
462
- * cloud coherence pins. A page reorder bumps only `docVersion` +
463
- * `layoutVersion`; every per-page pin stays warm.
464
- */
465
- declare class CloudDocumentPagesService implements DocumentPagesService {
466
- private readonly http;
467
- private readonly docId;
468
- private readonly layerName;
469
- private readonly isClosed;
470
- private readonly manifest;
471
- private readonly publisher;
472
- private readonly writes;
473
- /** The last layout leaf read by {@link pageLayout}, keyed by its URL path. */
474
- private layoutMemo;
475
- constructor(http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher, writes: CloudWrites);
476
- /**
477
- * Page-geometry list. The geometry bytes live at the content-addressed
478
- * `/layout@layoutVersion=N` leaf (not in the manifest); the manifest only
479
- * publishes the `layoutVersion` pointer. So `list()` reads `layoutVersion`
480
- * from the cached manifest, fetches the layout leaf, and on a 404 (stale
481
- * pointer) transparently refreshes the manifest and retries once — the
482
- * same ladder the per-page text/geometry reads use. `layoutVersion` bumps
483
- * only on structural page ops, so this leaf stays cached across content
484
- * and annotation edits.
485
- */
486
- list(): AbortablePromise<PageListSnapshot>;
487
- /**
488
- * One page's layout, for renders to size their image without a round
489
- * trip per tile. The layout leaf never changes at a given URL, so the
490
- * last one read is kept and shared until the manifest points elsewhere.
491
- */
492
- pageLayout(ref: PageRef, signal: AbortSignal): Promise<PageLayout>;
493
- /**
494
- * Plane-scope rule: the layout leaf depends on the `layout` plane —
495
- * while inherited (no reorder/rotate/insert/delete ever ran), every
496
- * visitor's page list is one doc-level URL served from the base
497
- * session; the SDK open sequence creates no layer session.
498
- */
499
- private layoutPath;
500
- private fetchLayout;
501
- reorder(pages: PageRef[], position: PagePosition, options?: WriteOptions): AbortablePromise<PageReorderResult>;
502
- setName(input: PageNameInput, options?: WriteOptions): AbortablePromise<PageNameResult>;
503
- removeName(input: PageRemoveNameInput, options?: WriteOptions): AbortablePromise<PageNameResult>;
504
- /**
505
- * Named pages are layout: both verbs share the page-reorder patch exactly —
506
- * docVersion + layoutVersion advance, no per-page pin changes, so the
507
- * cached manifest is patched in place and the fresh layout is published.
508
- */
509
- private runNameMutation;
510
- rotate(pages: PageRef[], rotation: PdfRotation, options?: WriteOptions): AbortablePromise<PageRotateResult>;
511
- delete(pages: PageRef[], options?: WriteOptions): AbortablePromise<PageDeleteResult>;
512
- insert(bytes: Uint8Array | ArrayBuffer, position?: PagePosition, options?: WriteOptions): AbortablePromise<PageInsertResult>;
513
- insertBlank(spec: PageInsertBlankSpec, position?: PagePosition, options?: PageInsertBlankOptions): AbortablePromise<PageInsertResult>;
514
- extract(pages: PageRef[]): AbortablePromise<Uint8Array>;
515
- flatten(pages: PageRef[], options?: FlattenWriteOptions): AbortablePromise<PageFlattenResult>;
516
- }
517
- //#endregion
518
- //#region src/document/CloudDocumentSearchService.d.ts
519
- /**
520
- * Cloud search transport: versioned GETs, one per budgeted slice.
521
- *
522
- * Every slice URL is a canonical cache key — the search token pins the
523
- * layer's content epoch (computed from the cached manifest), the
524
- * canonical query (default-fold literals collapse case/diacritic
525
- * variants into one entry), and the resume position. Identical searches
526
- * from any reader of the document hit the same CDN entry; matches are
527
- * all that ever crosses the trust boundary, and the rects/full endpoint
528
- * split keeps permission tiers in disjoint cache namespaces.
529
- *
530
- * Staleness rides the standard versioned-read signal: a first slice
531
- * answered `NotFound` means our manifest is stale → refresh and retry
532
- * once; a continuation answered `NotFound` means the document changed
533
- * mid-search → `InvalidArg`, same contract as the local engine's cursor.
534
- */
535
- declare class CloudDocumentSearchService implements DocumentSearchService {
536
- private readonly http;
537
- private readonly docId;
538
- private readonly layerName;
539
- private readonly isClosed;
540
- private readonly manifest;
541
- constructor(http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor);
542
- query(request: SearchRequest): AbortablePromise<SearchSlice>;
543
- }
544
- //#endregion
545
473
  //#region src/document/CloudMetadataService.d.ts
546
474
  declare class CloudMetadataService implements MetadataService {
547
475
  readonly custom: CustomMetadataService;
@@ -589,11 +517,14 @@ declare class CloudDocumentHandle implements DocumentHandle {
589
517
  readonly metadata: CloudMetadataService;
590
518
  readonly annotations: DocumentAnnotationsService;
591
519
  readonly actions: DocumentActionsService;
520
+ readonly outline: DocumentOutlineService;
592
521
  readonly attachments: DocumentAttachmentsService;
593
522
  readonly signatures: DocumentSignaturesService;
594
523
  readonly forms: DocumentFormsService;
595
524
  readonly search: CloudDocumentSearchService;
596
- readonly pages: CloudDocumentPagesService;
525
+ readonly pages: DocumentPagesService;
526
+ /** The page reads behind `pages`, the layout per page among them. */
527
+ private readonly pageReads;
597
528
  readonly redaction: DocumentRedactionService;
598
529
  readonly security: DocumentSecurityService;
599
530
  readonly render: DocumentRenderService;
@@ -709,7 +640,9 @@ declare class CloudDocumentHandle implements DocumentHandle {
709
640
  private releaseRemoteStream;
710
641
  /** Patch the cached manifest from a remote event's coherence pins — the
711
642
  * same absorb rails local mutations use, so reads stay warm no matter
712
- * whose hand caused the change. */
643
+ * whose hand caused the change. Every event kind is named below, so a new
644
+ * one can't be forgotten: a missed one leaves this client reading the
645
+ * old version from an immutable, cached URL. */
713
646
  private absorbRemoteEvent;
714
647
  }
715
648
  //#endregion
@@ -777,6 +710,70 @@ declare class CloudDocumentAnnotationsService implements DocumentAnnotationsServ
777
710
  private versionedPagePath;
778
711
  }
779
712
  //#endregion
713
+ //#region src/document/CloudDocumentPagesService.d.ts
714
+ /**
715
+ * Cloud-side document pages service: the reads, extract, flatten and the page
716
+ * names, over HTTP, as `LocalDocumentPagesService` has them. The structure
717
+ * verbs are changes (`pageVerbs`), so they can be undone.
718
+ *
719
+ * Page identity rule (locked with the user, do not change):
720
+ * - Pages are addressed exclusively by `PageRef` (their indirect
721
+ * `pageObjectNumber`); mutation bodies ship `{ pages: PageRef[] }`.
722
+ * The wire never sends a page index for a mutation. This keeps
723
+ * multi-call client logic from having to account for index drift
724
+ * between requests.
725
+ * - A page reorder (a change) returns the new `layout` (order + geometry)
726
+ * plus cloud coherence pins. It bumps only `docVersion` +
727
+ * `layoutVersion`; every per-page pin stays warm.
728
+ */
729
+ declare class CloudDocumentPagesService implements Omit<DocumentPagesService, PageStructureVerb> {
730
+ private readonly http;
731
+ private readonly docId;
732
+ private readonly layerName;
733
+ private readonly isClosed;
734
+ private readonly manifest;
735
+ private readonly publisher;
736
+ private readonly writes;
737
+ /** The last layout leaf read by {@link pageLayout}, keyed by its URL path. */
738
+ private layoutMemo;
739
+ constructor(http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher, writes: CloudWrites);
740
+ /**
741
+ * Page-geometry list. The geometry bytes live at the content-addressed
742
+ * `/layout@layoutVersion=N` leaf (not in the manifest); the manifest only
743
+ * publishes the `layoutVersion` pointer. So `list()` reads `layoutVersion`
744
+ * from the cached manifest, fetches the layout leaf, and on a 404 (stale
745
+ * pointer) transparently refreshes the manifest and retries once — the
746
+ * same ladder the per-page text/geometry reads use. `layoutVersion` bumps
747
+ * only on structural page ops, so this leaf stays cached across content
748
+ * and annotation edits.
749
+ */
750
+ list(): AbortablePromise<PageListSnapshot>;
751
+ /**
752
+ * One page's layout, for renders to size their image without a round
753
+ * trip per tile. The layout leaf never changes at a given URL, so the
754
+ * last one read is kept and shared until the manifest points elsewhere.
755
+ */
756
+ pageLayout(ref: PageRef, signal: AbortSignal): Promise<PageLayout>;
757
+ /**
758
+ * Plane-scope rule: the layout leaf depends on the `layout` plane —
759
+ * while inherited (no reorder/rotate/insert/delete ever ran), every
760
+ * visitor's page list is one doc-level URL served from the base
761
+ * session; the SDK open sequence creates no layer session.
762
+ */
763
+ private layoutPath;
764
+ private fetchLayout;
765
+ setName(input: PageNameInput, options?: WriteOptions): AbortablePromise<PageNameResult>;
766
+ removeName(input: PageRemoveNameInput, options?: WriteOptions): AbortablePromise<PageNameResult>;
767
+ /**
768
+ * Named pages are layout: both verbs share the page-reorder patch exactly —
769
+ * docVersion + layoutVersion advance, no per-page pin changes, so the
770
+ * cached manifest is patched in place and the fresh layout is published.
771
+ */
772
+ private runNameMutation;
773
+ extract(pages: PageRef[], options?: PageExtractOptions): AbortablePromise<Uint8Array>;
774
+ flatten(pages: PageRef[], options?: FlattenWriteOptions): AbortablePromise<PageFlattenResult>;
775
+ }
776
+ //#endregion
780
777
  //#region src/document/CloudPageAnnotationsService.d.ts
781
778
  /**
782
779
  * Cloud-side page annotation service. Mirrors the local wiring: each
@@ -856,9 +853,13 @@ declare class CloudPageRenderService implements PageRenderService {
856
853
  private readonly layout;
857
854
  /** What the caller may read, when the client can know it; null leaves it to the server. */
858
855
  private readonly layerRights;
856
+ /** What the caller may print, when the client can know it; null leaves it to the server. */
857
+ private readonly printRights;
859
858
  constructor(http: HttpClient, docId: string, layerName: string, pageRef: PageRef, isClosed: () => boolean, manifest: ManifestAccessor, layout: (signal: AbortSignal) => Promise<PageLayout>,
860
859
  /** What the caller may read, when the client can know it; null leaves it to the server. */
861
- layerRights: () => PageLayerRights | null);
860
+ layerRights: () => PageLayerRights | null,
861
+ /** What the caller may print, when the client can know it; null leaves it to the server. */
862
+ printRights: () => PagePrintRights | null);
862
863
  image(options?: PageImageOptions): AbortablePromise<PageRenderImage>;
863
864
  /**
864
865
  * The image's transform, computed like the server's render (the same
@@ -923,7 +924,7 @@ declare class CloudPageHandle implements PageHandle {
923
924
  readonly text: CloudPageTextService;
924
925
  readonly render: CloudPageRenderService;
925
926
  readonly measure: CloudPageMeasureService;
926
- constructor(ref: PageRef, http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher, writes: CloudWrites, layout: (signal: AbortSignal) => Promise<PageLayout>, layerRights: () => PageLayerRights | null);
927
+ constructor(ref: PageRef, http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher, writes: CloudWrites, layout: (signal: AbortSignal) => Promise<PageLayout>, layerRights: () => PageLayerRights | null, printRights: () => PagePrintRights | null);
927
928
  }
928
929
  //#endregion
929
930
  //#region src/transport/decodeUnverifiedClaims.d.ts
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AbortablePromise, AnnotationAppearanceImageOptions, AnnotationAppearanceImagesResult, AnnotationBundle, AnnotationCreateOptions, AnnotationCreateResult, AnnotationDeleteResult, AnnotationDraft, AnnotationExportSelection, AnnotationFlattenResult, AnnotationImportOptions, AnnotationImportResult, AnnotationList, AnnotationListOptions, AnnotationPatch, AnnotationPosition, AnnotationRef, AnnotationReorderResult, AnnotationResourceRole, AnnotationUpdateOptions, AnnotationUpdateResult, BundleLimits, CallFacts, Change, ChangeAnswer, ChangeResult, CustomMetadataService, DocumentActionsService, DocumentAnnotationsService, DocumentAttachmentsService, DocumentEventStream, DocumentFormsService, DocumentHandle, DocumentMetadata, DocumentPagesService, DocumentRedactionService, DocumentRenderService, DocumentSearchService, DocumentSecurityService, DocumentSignaturesService, DownloadOptions, EditSessionAccess, EditSessionStatus, Engine, EngineError, FlattenWriteOptions, MetadataPatch, MetadataService, MetadataUpdateResult, MutationMeta, ObjectNumberPool, ObjectNumberRange, ObjectNumbersLost, OpenInput, OpenOptions, PageAnnotationsService, PageCoordinates, PageDeleteResult, PageFlattenResult, PageFormsService, PageHandle, PageImageOptions, PageInsertBlankOptions, PageInsertBlankSpec, PageInsertResult, PageLayerRights, PageLayout, PageListSnapshot, PageMeasureService, PageMeasurementViewportList, PageNameInput, PageNameResult, PagePosition, PageRef, PageRemoveNameInput, PageRenderImage, PageRenderService, PageReorderResult, PageRotateResult, PageScaleResult, PageTextService, PageTextSnapshot, PdfMeasure, PdfRotation, SearchRequest, SearchSlice, SessionEventPublisher, TextLayout, TextRange, TokenSource, WireAnnotationResources, WorkingSetPage, WriteOptions } from "@embedpdf/engine-core/runtime";
1
+ import { AbortablePromise, AnnotationAppearanceImageOptions, AnnotationAppearanceImagesResult, AnnotationBundle, AnnotationCreateOptions, AnnotationCreateResult, AnnotationDeleteResult, AnnotationDraft, AnnotationExportSelection, AnnotationFlattenResult, AnnotationImportOptions, AnnotationImportResult, AnnotationList, AnnotationListOptions, AnnotationPatch, AnnotationPosition, AnnotationRef, AnnotationReorderResult, AnnotationResourceRole, AnnotationUpdateOptions, AnnotationUpdateResult, BundleLimits, CallFacts, Change, ChangeAnswer, ChangeResult, CustomMetadataService, DocumentActionsService, DocumentAnnotationsService, DocumentAttachmentsService, DocumentEventStream, DocumentFormsService, DocumentHandle, DocumentMetadata, DocumentOutlineService, DocumentPagesService, DocumentRedactionService, DocumentRenderService, DocumentSearchService, DocumentSecurityService, DocumentSignaturesService, DownloadOptions, EditSessionAccess, EditSessionStatus, Engine, EngineError, FlattenWriteOptions, MetadataPatch, MetadataService, MetadataUpdateResult, MutationMeta, ObjectNumberPool, ObjectNumberRange, ObjectNumbersLost, OpenInput, OpenOptions, PageAnnotationsService, PageCoordinates, PageExtractOptions, PageFlattenResult, PageFormsService, PageHandle, PageImageOptions, PageLayerRights, PageLayout, PageListSnapshot, PageMeasureService, PageMeasurementViewportList, PageNameInput, PageNameResult, PagePrintRights, PageRef, PageRemoveNameInput, PageRenderImage, PageRenderService, PageScaleResult, PageStructureVerb, PageTextService, PageTextSnapshot, PdfMeasure, SearchRequest, SearchSlice, SessionEventPublisher, TextLayout, TextRange, TokenSource, WireAnnotationResources, WorkingSetPage, WriteOptions } from "@embedpdf/engine-core/runtime";
2
2
  import { CdnAccessInfoForApply, DocumentHead, DocumentManifest, LayerScopePlane } from "@embedpdf/engine-core/wire";
3
3
  export * from "@embedpdf/engine-core/public";
4
4
  //#region src/transport/HttpClient.d.ts
@@ -93,11 +93,7 @@ interface RequestOptions {
93
93
  /** Sent as the editing session though not a write: `/access`, the bulk reservation. */
94
94
  readonly session?: boolean;
95
95
  }
96
- /**
97
- * A raw-bytes response plus its headers. The attachment-file leaves carry
98
- * their metadata as headers (`Content-Type`, `X-EmbedPDF-File-Name`), so
99
- * unlike `getBytes` the caller needs the `Headers` object back.
100
- */
96
+ /** A raw-bytes response plus its headers. */
101
97
  interface HttpFileResponse {
102
98
  bytes: Uint8Array;
103
99
  headers: Headers;
@@ -271,6 +267,33 @@ declare class CloudEngine implements Engine {
271
267
  destroy(): AbortablePromise<void>;
272
268
  }
273
269
  //#endregion
270
+ //#region src/document/CloudDocumentSearchService.d.ts
271
+ /**
272
+ * Cloud search transport: versioned GETs, one per budgeted slice.
273
+ *
274
+ * Every slice URL is a canonical cache key — the search token pins the
275
+ * layer's content epoch (computed from the cached manifest), the
276
+ * canonical query (default-fold literals collapse case/diacritic
277
+ * variants into one entry), and the resume position. Identical searches
278
+ * from any reader of the document hit the same CDN entry; matches are
279
+ * all that ever crosses the trust boundary, and the rects/full endpoint
280
+ * split keeps permission tiers in disjoint cache namespaces.
281
+ *
282
+ * Staleness rides the standard versioned-read signal: a first slice
283
+ * answered `NotFound` means our manifest is stale → refresh and retry
284
+ * once; a continuation answered `NotFound` means the document changed
285
+ * mid-search → `InvalidArg`, same contract as the local engine's cursor.
286
+ */
287
+ declare class CloudDocumentSearchService implements DocumentSearchService {
288
+ private readonly http;
289
+ private readonly docId;
290
+ private readonly layerName;
291
+ private readonly isClosed;
292
+ private readonly manifest;
293
+ constructor(http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor);
294
+ query(request: SearchRequest): AbortablePromise<SearchSlice>;
295
+ }
296
+ //#endregion
274
297
  //#region src/document/CloudObjectNumberPool.d.ts
275
298
  interface CloudObjectNumberPoolOptions {
276
299
  /** `POST …/object-numbers`: `count` more numbers for this editing session. */
@@ -447,101 +470,6 @@ declare class CloudWrites {
447
470
  private send;
448
471
  }
449
472
  //#endregion
450
- //#region src/document/CloudDocumentPagesService.d.ts
451
- /**
452
- * Cloud-side document pages service. Mirrors `LocalDocumentPagesService`
453
- * over HTTP: GET /pages for `list`, POST /pages/reorder for the reorder.
454
- *
455
- * Page identity rule (locked with the user, do not change):
456
- * - Pages are addressed exclusively by `PageRef` (their indirect
457
- * `pageObjectNumber`); mutation bodies ship `{ pages: PageRef[] }`.
458
- * The wire never sends a page index for a mutation. This keeps
459
- * multi-call client logic from having to account for index drift
460
- * between requests.
461
- * - Successful `reorder()` returns the new `layout` (order + geometry) plus
462
- * cloud coherence pins. A page reorder bumps only `docVersion` +
463
- * `layoutVersion`; every per-page pin stays warm.
464
- */
465
- declare class CloudDocumentPagesService implements DocumentPagesService {
466
- private readonly http;
467
- private readonly docId;
468
- private readonly layerName;
469
- private readonly isClosed;
470
- private readonly manifest;
471
- private readonly publisher;
472
- private readonly writes;
473
- /** The last layout leaf read by {@link pageLayout}, keyed by its URL path. */
474
- private layoutMemo;
475
- constructor(http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher, writes: CloudWrites);
476
- /**
477
- * Page-geometry list. The geometry bytes live at the content-addressed
478
- * `/layout@layoutVersion=N` leaf (not in the manifest); the manifest only
479
- * publishes the `layoutVersion` pointer. So `list()` reads `layoutVersion`
480
- * from the cached manifest, fetches the layout leaf, and on a 404 (stale
481
- * pointer) transparently refreshes the manifest and retries once — the
482
- * same ladder the per-page text/geometry reads use. `layoutVersion` bumps
483
- * only on structural page ops, so this leaf stays cached across content
484
- * and annotation edits.
485
- */
486
- list(): AbortablePromise<PageListSnapshot>;
487
- /**
488
- * One page's layout, for renders to size their image without a round
489
- * trip per tile. The layout leaf never changes at a given URL, so the
490
- * last one read is kept and shared until the manifest points elsewhere.
491
- */
492
- pageLayout(ref: PageRef, signal: AbortSignal): Promise<PageLayout>;
493
- /**
494
- * Plane-scope rule: the layout leaf depends on the `layout` plane —
495
- * while inherited (no reorder/rotate/insert/delete ever ran), every
496
- * visitor's page list is one doc-level URL served from the base
497
- * session; the SDK open sequence creates no layer session.
498
- */
499
- private layoutPath;
500
- private fetchLayout;
501
- reorder(pages: PageRef[], position: PagePosition, options?: WriteOptions): AbortablePromise<PageReorderResult>;
502
- setName(input: PageNameInput, options?: WriteOptions): AbortablePromise<PageNameResult>;
503
- removeName(input: PageRemoveNameInput, options?: WriteOptions): AbortablePromise<PageNameResult>;
504
- /**
505
- * Named pages are layout: both verbs share the page-reorder patch exactly —
506
- * docVersion + layoutVersion advance, no per-page pin changes, so the
507
- * cached manifest is patched in place and the fresh layout is published.
508
- */
509
- private runNameMutation;
510
- rotate(pages: PageRef[], rotation: PdfRotation, options?: WriteOptions): AbortablePromise<PageRotateResult>;
511
- delete(pages: PageRef[], options?: WriteOptions): AbortablePromise<PageDeleteResult>;
512
- insert(bytes: Uint8Array | ArrayBuffer, position?: PagePosition, options?: WriteOptions): AbortablePromise<PageInsertResult>;
513
- insertBlank(spec: PageInsertBlankSpec, position?: PagePosition, options?: PageInsertBlankOptions): AbortablePromise<PageInsertResult>;
514
- extract(pages: PageRef[]): AbortablePromise<Uint8Array>;
515
- flatten(pages: PageRef[], options?: FlattenWriteOptions): AbortablePromise<PageFlattenResult>;
516
- }
517
- //#endregion
518
- //#region src/document/CloudDocumentSearchService.d.ts
519
- /**
520
- * Cloud search transport: versioned GETs, one per budgeted slice.
521
- *
522
- * Every slice URL is a canonical cache key — the search token pins the
523
- * layer's content epoch (computed from the cached manifest), the
524
- * canonical query (default-fold literals collapse case/diacritic
525
- * variants into one entry), and the resume position. Identical searches
526
- * from any reader of the document hit the same CDN entry; matches are
527
- * all that ever crosses the trust boundary, and the rects/full endpoint
528
- * split keeps permission tiers in disjoint cache namespaces.
529
- *
530
- * Staleness rides the standard versioned-read signal: a first slice
531
- * answered `NotFound` means our manifest is stale → refresh and retry
532
- * once; a continuation answered `NotFound` means the document changed
533
- * mid-search → `InvalidArg`, same contract as the local engine's cursor.
534
- */
535
- declare class CloudDocumentSearchService implements DocumentSearchService {
536
- private readonly http;
537
- private readonly docId;
538
- private readonly layerName;
539
- private readonly isClosed;
540
- private readonly manifest;
541
- constructor(http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor);
542
- query(request: SearchRequest): AbortablePromise<SearchSlice>;
543
- }
544
- //#endregion
545
473
  //#region src/document/CloudMetadataService.d.ts
546
474
  declare class CloudMetadataService implements MetadataService {
547
475
  readonly custom: CustomMetadataService;
@@ -589,11 +517,14 @@ declare class CloudDocumentHandle implements DocumentHandle {
589
517
  readonly metadata: CloudMetadataService;
590
518
  readonly annotations: DocumentAnnotationsService;
591
519
  readonly actions: DocumentActionsService;
520
+ readonly outline: DocumentOutlineService;
592
521
  readonly attachments: DocumentAttachmentsService;
593
522
  readonly signatures: DocumentSignaturesService;
594
523
  readonly forms: DocumentFormsService;
595
524
  readonly search: CloudDocumentSearchService;
596
- readonly pages: CloudDocumentPagesService;
525
+ readonly pages: DocumentPagesService;
526
+ /** The page reads behind `pages`, the layout per page among them. */
527
+ private readonly pageReads;
597
528
  readonly redaction: DocumentRedactionService;
598
529
  readonly security: DocumentSecurityService;
599
530
  readonly render: DocumentRenderService;
@@ -709,7 +640,9 @@ declare class CloudDocumentHandle implements DocumentHandle {
709
640
  private releaseRemoteStream;
710
641
  /** Patch the cached manifest from a remote event's coherence pins — the
711
642
  * same absorb rails local mutations use, so reads stay warm no matter
712
- * whose hand caused the change. */
643
+ * whose hand caused the change. Every event kind is named below, so a new
644
+ * one can't be forgotten: a missed one leaves this client reading the
645
+ * old version from an immutable, cached URL. */
713
646
  private absorbRemoteEvent;
714
647
  }
715
648
  //#endregion
@@ -777,6 +710,70 @@ declare class CloudDocumentAnnotationsService implements DocumentAnnotationsServ
777
710
  private versionedPagePath;
778
711
  }
779
712
  //#endregion
713
+ //#region src/document/CloudDocumentPagesService.d.ts
714
+ /**
715
+ * Cloud-side document pages service: the reads, extract, flatten and the page
716
+ * names, over HTTP, as `LocalDocumentPagesService` has them. The structure
717
+ * verbs are changes (`pageVerbs`), so they can be undone.
718
+ *
719
+ * Page identity rule (locked with the user, do not change):
720
+ * - Pages are addressed exclusively by `PageRef` (their indirect
721
+ * `pageObjectNumber`); mutation bodies ship `{ pages: PageRef[] }`.
722
+ * The wire never sends a page index for a mutation. This keeps
723
+ * multi-call client logic from having to account for index drift
724
+ * between requests.
725
+ * - A page reorder (a change) returns the new `layout` (order + geometry)
726
+ * plus cloud coherence pins. It bumps only `docVersion` +
727
+ * `layoutVersion`; every per-page pin stays warm.
728
+ */
729
+ declare class CloudDocumentPagesService implements Omit<DocumentPagesService, PageStructureVerb> {
730
+ private readonly http;
731
+ private readonly docId;
732
+ private readonly layerName;
733
+ private readonly isClosed;
734
+ private readonly manifest;
735
+ private readonly publisher;
736
+ private readonly writes;
737
+ /** The last layout leaf read by {@link pageLayout}, keyed by its URL path. */
738
+ private layoutMemo;
739
+ constructor(http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher, writes: CloudWrites);
740
+ /**
741
+ * Page-geometry list. The geometry bytes live at the content-addressed
742
+ * `/layout@layoutVersion=N` leaf (not in the manifest); the manifest only
743
+ * publishes the `layoutVersion` pointer. So `list()` reads `layoutVersion`
744
+ * from the cached manifest, fetches the layout leaf, and on a 404 (stale
745
+ * pointer) transparently refreshes the manifest and retries once — the
746
+ * same ladder the per-page text/geometry reads use. `layoutVersion` bumps
747
+ * only on structural page ops, so this leaf stays cached across content
748
+ * and annotation edits.
749
+ */
750
+ list(): AbortablePromise<PageListSnapshot>;
751
+ /**
752
+ * One page's layout, for renders to size their image without a round
753
+ * trip per tile. The layout leaf never changes at a given URL, so the
754
+ * last one read is kept and shared until the manifest points elsewhere.
755
+ */
756
+ pageLayout(ref: PageRef, signal: AbortSignal): Promise<PageLayout>;
757
+ /**
758
+ * Plane-scope rule: the layout leaf depends on the `layout` plane —
759
+ * while inherited (no reorder/rotate/insert/delete ever ran), every
760
+ * visitor's page list is one doc-level URL served from the base
761
+ * session; the SDK open sequence creates no layer session.
762
+ */
763
+ private layoutPath;
764
+ private fetchLayout;
765
+ setName(input: PageNameInput, options?: WriteOptions): AbortablePromise<PageNameResult>;
766
+ removeName(input: PageRemoveNameInput, options?: WriteOptions): AbortablePromise<PageNameResult>;
767
+ /**
768
+ * Named pages are layout: both verbs share the page-reorder patch exactly —
769
+ * docVersion + layoutVersion advance, no per-page pin changes, so the
770
+ * cached manifest is patched in place and the fresh layout is published.
771
+ */
772
+ private runNameMutation;
773
+ extract(pages: PageRef[], options?: PageExtractOptions): AbortablePromise<Uint8Array>;
774
+ flatten(pages: PageRef[], options?: FlattenWriteOptions): AbortablePromise<PageFlattenResult>;
775
+ }
776
+ //#endregion
780
777
  //#region src/document/CloudPageAnnotationsService.d.ts
781
778
  /**
782
779
  * Cloud-side page annotation service. Mirrors the local wiring: each
@@ -856,9 +853,13 @@ declare class CloudPageRenderService implements PageRenderService {
856
853
  private readonly layout;
857
854
  /** What the caller may read, when the client can know it; null leaves it to the server. */
858
855
  private readonly layerRights;
856
+ /** What the caller may print, when the client can know it; null leaves it to the server. */
857
+ private readonly printRights;
859
858
  constructor(http: HttpClient, docId: string, layerName: string, pageRef: PageRef, isClosed: () => boolean, manifest: ManifestAccessor, layout: (signal: AbortSignal) => Promise<PageLayout>,
860
859
  /** What the caller may read, when the client can know it; null leaves it to the server. */
861
- layerRights: () => PageLayerRights | null);
860
+ layerRights: () => PageLayerRights | null,
861
+ /** What the caller may print, when the client can know it; null leaves it to the server. */
862
+ printRights: () => PagePrintRights | null);
862
863
  image(options?: PageImageOptions): AbortablePromise<PageRenderImage>;
863
864
  /**
864
865
  * The image's transform, computed like the server's render (the same
@@ -923,7 +924,7 @@ declare class CloudPageHandle implements PageHandle {
923
924
  readonly text: CloudPageTextService;
924
925
  readonly render: CloudPageRenderService;
925
926
  readonly measure: CloudPageMeasureService;
926
- constructor(ref: PageRef, http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher, writes: CloudWrites, layout: (signal: AbortSignal) => Promise<PageLayout>, layerRights: () => PageLayerRights | null);
927
+ constructor(ref: PageRef, http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher, writes: CloudWrites, layout: (signal: AbortSignal) => Promise<PageLayout>, layerRights: () => PageLayerRights | null, printRights: () => PagePrintRights | null);
927
928
  }
928
929
  //#endregion
929
930
  //#region src/transport/decodeUnverifiedClaims.d.ts