@embedpdf/engine-core 3.0.0-next.10 → 3.0.0-next.12

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.
Files changed (45) hide show
  1. package/dist/{AnnotationListSnapshot-DDxHpJQU.d.cts → AnnotationListSnapshot-x6tKulNV.d.cts} +461 -114
  2. package/dist/{AnnotationListSnapshot-DDxHpJQU.d.ts → AnnotationListSnapshot-x6tKulNV.d.ts} +461 -114
  3. package/dist/{DocumentSecurityService-o9aeTHwT.d.ts → DocumentSecurityService-9MawYxP-.d.ts} +2 -2
  4. package/dist/{DocumentSecurityService-BV4_YXkU.d.cts → DocumentSecurityService-CK0pejAK.d.cts} +2 -2
  5. package/dist/{Engine-DOoVem7_.d.ts → Engine--0XF0UAK.d.cts} +68 -3
  6. package/dist/{Engine-D9je6GdU.d.cts → Engine-Ds0ytbl6.d.ts} +68 -3
  7. package/dist/{builders-Cp_rlGob.cjs → builders-8Hl1AYNU.cjs} +44 -8
  8. package/dist/builders-8Hl1AYNU.cjs.map +1 -0
  9. package/dist/{builders-B_KufGJ9.js → builders-DOjcKDWQ.js} +39 -9
  10. package/dist/builders-DOjcKDWQ.js.map +1 -0
  11. package/dist/conformance.cjs +769 -101
  12. package/dist/conformance.cjs.map +1 -1
  13. package/dist/conformance.d.cts +56 -3
  14. package/dist/conformance.d.ts +56 -3
  15. package/dist/conformance.js +767 -102
  16. package/dist/conformance.js.map +1 -1
  17. package/dist/index.cjs +3 -2
  18. package/dist/index.d.cts +2 -2
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +3 -3
  21. package/dist/{resolver-DiPMTfcy.js → resolver-CHG4waXL.js} +2 -1
  22. package/dist/resolver-CHG4waXL.js.map +1 -0
  23. package/dist/{resolver-DAZWVoJL.cjs → resolver-D-jumvgM.cjs} +2 -1
  24. package/dist/resolver-D-jumvgM.cjs.map +1 -0
  25. package/dist/runtime.cjs +3 -2
  26. package/dist/runtime.d.cts +66 -5
  27. package/dist/runtime.d.ts +66 -5
  28. package/dist/runtime.js +3 -3
  29. package/dist/{schemas-DAnu8tuW.js → schemas-DOyVEPk7.js} +206 -84
  30. package/dist/schemas-DOyVEPk7.js.map +1 -0
  31. package/dist/{schemas-D1pxEv3t.cjs → schemas-RChsAMWw.cjs} +259 -83
  32. package/dist/schemas-RChsAMWw.cjs.map +1 -0
  33. package/dist/wire.cjs +65 -2
  34. package/dist/wire.cjs.map +1 -1
  35. package/dist/wire.d.cts +210 -8
  36. package/dist/wire.d.ts +210 -8
  37. package/dist/wire.js +54 -3
  38. package/dist/wire.js.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/builders-B_KufGJ9.js.map +0 -1
  41. package/dist/builders-Cp_rlGob.cjs.map +0 -1
  42. package/dist/resolver-DAZWVoJL.cjs.map +0 -1
  43. package/dist/resolver-DiPMTfcy.js.map +0 -1
  44. package/dist/schemas-D1pxEv3t.cjs.map +0 -1
  45. package/dist/schemas-DAnu8tuW.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Cc as IdentityClaims, Sc as DocCapability, kc as PdfBits, rc as CollabTarget } from "./AnnotationListSnapshot-DDxHpJQU.js";
1
+ import { Ic as DocCapability, Lc as IdentityClaims, Uc as PdfBits, _c as CollabTarget } from "./AnnotationListSnapshot-x6tKulNV.js";
2
2
  //#region src/promise/AbortablePromise.d.ts
3
3
  type AbortableExecutor<T, P> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason: unknown) => void, progress: (p: P) => void, signal: AbortSignal) => void;
4
4
  /**
@@ -360,4 +360,4 @@ interface DocumentSecurityService {
360
360
  }
361
361
  //#endregion
362
362
  export { DocumentEncryptionState as a, DocumentSecurityState as c, PdfPermissionAdvisory as d, PdfPermissionInfo as f, AbortablePromise as g, AbortableExecutor as h, DocumentAccessReason as i, DocumentUnlockInput as l, passwordPromptFromState as m, CdnAdapter as n, DocumentOpenMode as o, PasswordPrompt as p, DocumentAccessInfo as r, DocumentSecurityService as s, CdnAccessInfo as t, DocumentUnlockResult as u };
363
- //# sourceMappingURL=DocumentSecurityService-o9aeTHwT.d.ts.map
363
+ //# sourceMappingURL=DocumentSecurityService-9MawYxP-.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Cc as IdentityClaims, Sc as DocCapability, kc as PdfBits, rc as CollabTarget } from "./AnnotationListSnapshot-DDxHpJQU.cjs";
1
+ import { Ic as DocCapability, Lc as IdentityClaims, Uc as PdfBits, _c as CollabTarget } from "./AnnotationListSnapshot-x6tKulNV.cjs";
2
2
  //#region src/promise/AbortablePromise.d.ts
3
3
  type AbortableExecutor<T, P> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason: unknown) => void, progress: (p: P) => void, signal: AbortSignal) => void;
4
4
  /**
@@ -360,4 +360,4 @@ interface DocumentSecurityService {
360
360
  }
361
361
  //#endregion
362
362
  export { DocumentEncryptionState as a, DocumentSecurityState as c, PdfPermissionAdvisory as d, PdfPermissionInfo as f, AbortablePromise as g, AbortableExecutor as h, DocumentAccessReason as i, DocumentUnlockInput as l, passwordPromptFromState as m, CdnAdapter as n, DocumentOpenMode as o, PasswordPrompt as p, DocumentAccessInfo as r, DocumentSecurityService as s, CdnAccessInfo as t, DocumentUnlockResult as u };
363
- //# sourceMappingURL=DocumentSecurityService-BV4_YXkU.d.cts.map
363
+ //# sourceMappingURL=DocumentSecurityService-CK0pejAK.d.cts.map
@@ -1,5 +1,5 @@
1
- import { $r as FormEffectsResult, Aa as AttachmentDeleteResult, Ao as FontKey, Bi as FormFieldRef, Di as FormFieldDTO, Dr as SearchRequest, Fn as RedactionApplyScope, Gi as AnnotationDeleteResult, Gn as PageDeleteResult, Gr as FormFieldUpdateResult, Ho as AnnotationAppearanceRenderOptions, Hr as FormDataExport, Io as AnnotationAppearanceImageOptions, Jr as FormSetValueResult, Ka as AttachmentContent, Ki as AnnotationMoveResult, Kr as FormImportResult, Lo as AnnotationAppearanceImagesResult, Mn as MetadataUpdateResult, No as PdfSaveMode, Or as SearchSlice, Pc as PageObjectNumber, Pn as RedactionApplyResult, Qo as PageImageOptions, Un as PageInsertBlankSpec, Ur as FormFieldCreateResult, Us as MetadataPatch, Vi as FormWidgetRef, Vn as PageFlattenUsage, Wi as AnnotationCreateResult, Wn as PageInsertResult, Wo as AnnotationAppearancesResult, Wr as FormFieldDeleteResult, Ws as OpenInput, Xa as EmbeddedFileItem, Xn as PageMoveResult, Xo as PageImageHandle, Xr as FormEffect, Ya as AttachmentFileSource, Yr as FormWidgetLinkResult, Za as EmbeddedFileRef, Zs as OpenOptions, ai as FormFieldPatch, bs as PageTextSnapshot, di as FormFieldDraft, fl as DocumentActionsSnapshot, jc as AnnotationRef, jo as FontSpec, ka as AttachmentCreateResult, ko as FontHandle, l as AnnotationPatch, ll as PdfRotation, ls as PageRenderViewport, n as AnnotationListSnapshotAllPages, ni as FormFieldValue, ns as PageRaster, o as AnnotationDraft, os as PageRenderOptions, ps as PageGeometrySnapshot, qi as AnnotationUpdateResult, qn as PageRotateResult, qr as FormRepairResult, t as AnnotationListPageSnapshot, ti as FormDataFormat, vi as FormSnapshot, xl as DocumentMetadata, zn as PageFlattenResult, zs as PageListSnapshot } from "./AnnotationListSnapshot-DDxHpJQU.js";
2
- import { g as AbortablePromise, s as DocumentSecurityService } from "./DocumentSecurityService-o9aeTHwT.js";
1
+ import { $i as FormFieldRef, $n as PageNameResult, $r as FormImportResult, Bi as FormFieldDTO, Bl as DocumentMetadata, Bn as PageDeleteResult, Fn as RedactionApplyScope, Fr as SearchSlice, Gc as AnnotationRef, Go as PdfSaveMode, Ha as AttachmentDeleteResult, Hn as PageRotateResult, Ho as FontKey, Jo as AnnotationAppearanceImageOptions, Mn as MetadataUpdateResult, Ms as PageTextSnapshot, Pn as RedactionApplyResult, Pr as SearchRequest, Qn as PageFlattenUsage, Qr as FormFieldUpdateResult, Rl as PageObjectNumber, Rn as PageInsertBlankSpec, Ts as PageGeometrySnapshot, Uo as FontSpec, Va as AttachmentCreateResult, Vo as FontHandle, Xn as PageFlattenResult, Xr as FormFieldCreateResult, Yo as AnnotationAppearanceImagesResult, Yr as FormDataExport, Zr as FormFieldDeleteResult, Zs as PageListSnapshot, aa as AnnotationMoveResult, co as EmbeddedFileItem, cs as PageImageHandle, dc as OpenOptions, ea as FormWidgetRef, ei as FormRepairResult, er as PageNameInput, es as AnnotationAppearanceRenderOptions, fi as FormSubmissionRequest, hi as FormFieldValue, ia as AnnotationDeleteResult, ic as OpenInput, io as AttachmentContent, ji as FormSnapshot, l as AnnotationPatch, lo as EmbeddedFileRef, mi as FormDataFormat, ms as PageRaster, n as AnnotationListSnapshotAllPages, ni as FormWidgetLinkResult, ns as AnnotationAppearancesResult, o as AnnotationDraft, oa as AnnotationUpdateResult, oi as FormEffectsResult, qn as AnnotationFlattenResult, ra as AnnotationCreateResult, rc as MetadataPatch, ri as FormEffect, rr as PageMoveResult, so as AttachmentFileSource, t as AnnotationListPageSnapshot, ti as FormSetValueResult, tr as PageRemoveNameInput, ui as FormSubmissionReceipt, us as PageImageOptions, vi as FormFieldPatch, vs as PageRenderOptions, wi as FormFieldDraft, wl as DocumentActionsSnapshot, xl as PdfRotation, xs as PageRenderViewport, zn as PageInsertResult } from "./AnnotationListSnapshot-x6tKulNV.cjs";
2
+ import { g as AbortablePromise, s as DocumentSecurityService } from "./DocumentSecurityService-CK0pejAK.cjs";
3
3
  //#region src/engine/DocumentActionsService.d.ts
4
4
  /** Lazy, catalog-owned PDF action read. This API extracts; it never executes. */
5
5
  interface DocumentActionsService {
@@ -139,6 +139,18 @@ interface DocumentFormsService {
139
139
  * skipped and any landed state is finalized as one artifact/event/version.
140
140
  */
141
141
  applyEffects?(effects: FormEffect[]): AbortablePromise<FormEffectsResult>;
142
+ /**
143
+ * Deliver a resolved form submission to the document's HOME. Present only
144
+ * where the document HAS a home that accepts submissions — the cloud
145
+ * engine when the deployment advertises the capability; the local engine
146
+ * truthfully lacks it (an in-process document has no home, and this
147
+ * contract is never a callback trampoline). Gated by `doc.forms.submit`
148
+ * (grant-minted; no PDF permission bit exists for submission), asserted
149
+ * at the home's boundary where enforcement is real. The home stores the
150
+ * dataset with the declared intent as metadata and derives WHO submitted
151
+ * from its own verified session — it never fetches the PDF's URL.
152
+ */
153
+ submit?(request: FormSubmissionRequest): AbortablePromise<FormSubmissionReceipt>;
142
154
  /**
143
155
  * Serialize the form data for interchange. Defaults to `'xfdf'` (the
144
156
  * XML sibling; UTF-8, friendliest to web pipelines) — pass `'fdf'` for
@@ -250,6 +262,25 @@ interface DocumentPagesService {
250
262
  * recycled; surviving pages keep their identity and revisions.
251
263
  */
252
264
  delete(pageObjectNumbers: PageObjectNumber[]): AbortablePromise<PageDeleteResult>;
265
+ /**
266
+ * Register `name` → page in the catalog's `/Names /Pages` tree (create,
267
+ * or replace what an existing key points at); with `replace`, drop that
268
+ * other key in the same job (rename). Named pages are LAYOUT — read them
269
+ * back from `list().namedPages` — so this is a page-structure mutation:
270
+ * `docVersion` + `layoutVersion` advance, per-page pins do not. Gated like
271
+ * `move` (`doc.pages.assemble`). Optional while transports ship;
272
+ * feature-detect with `pages.setName !== undefined`.
273
+ *
274
+ * Rejects with `InvalidArg` for an empty name and `NotFound` for a page
275
+ * that is not in the page tree (hidden templates included).
276
+ */
277
+ setName?(input: PageNameInput): AbortablePromise<PageNameResult>;
278
+ /**
279
+ * Remove one `/Names /Pages` registration; the page itself is untouched.
280
+ * `NotFound` when no registration has that decoded key. Page DELETION
281
+ * removes registrations by itself — callers never need to pair the two.
282
+ */
283
+ removeName?(input: PageRemoveNameInput): AbortablePromise<PageNameResult>;
253
284
  /**
254
285
  * Paint eligible annotation appearances into page content and remove only
255
286
  * those annotations that were painted. This changes content and annotation
@@ -527,6 +558,30 @@ interface PageAnnotationsService {
527
558
  * space, in `[0, count - refs.length]`.
528
559
  */
529
560
  move(refs: AnnotationRef[], toIndex: number): AbortablePromise<AnnotationMoveResult>;
561
+ /**
562
+ * Flatten the given annotations of THIS page into its content —
563
+ * `pages.flatten` for a chosen set. Painted annotations are removed from
564
+ * the page; ones that are ineligible (hidden for `usage`, Popups, no
565
+ * usable appearance) stay and report `skipped`, so a caller can say
566
+ * "2 of 3 flattened". A content + annotation MUTATION of this page: its
567
+ * content and annotation pins advance, layout does not; a
568
+ * `annotations.flattened` event is published when anything was applied.
569
+ * Gated like `pages.flatten` (`doc.pages.modify` + `doc.annotate.modify`).
570
+ * `InvalidArg` for a ref on another page; `NotFound` for an unknown ref.
571
+ * Optional while transports ship — feature-detect.
572
+ */
573
+ flatten?(refs: AnnotationRef[], usage?: PageFlattenUsage): AbortablePromise<AnnotationFlattenResult>;
574
+ /**
575
+ * Flatten the normal appearances of the given annotations of this page
576
+ * into a NEW single-page PDF sized to their union `/Rect` — vector,
577
+ * positions preserved, exactly as this page shows them. The same plan as
578
+ * `flatten` aimed at a fresh page; the source document is untouched. A
579
+ * derived READ that egresses content, so it is gated by `doc.download`
580
+ * like `pages.extract`. All-or-nothing: `InvalidArg` when any ref is not
581
+ * on this page, hidden, or has no appearance (a stamp silently missing a
582
+ * part would be worse than an error). Optional — feature-detect.
583
+ */
584
+ exportAppearance?(refs: AnnotationRef[]): AbortablePromise<Uint8Array>;
530
585
  }
531
586
  //#endregion
532
587
  //#region src/engine/PageGeometryService.d.ts
@@ -733,6 +788,9 @@ type DocumentEvent = ({
733
788
  pageObjectNumber: PageObjectNumber;
734
789
  origin: EventOrigin;
735
790
  } & AnnotationMoveResult) | ({
791
+ type: 'annotations.flattened';
792
+ origin: EventOrigin;
793
+ } & AnnotationFlattenResult) | ({
736
794
  type: 'pages.moved';
737
795
  /** Locally: the moved block. Remotely the audit row only records the
738
796
  * outcome, so this is the full new order — consumers should read
@@ -757,6 +815,13 @@ type DocumentEvent = ({
757
815
  destIndex?: number;
758
816
  origin: EventOrigin;
759
817
  } & PageInsertResult) | ({
818
+ type: 'pages.named';
819
+ /** The decoded key that was registered, renamed, or removed. */
820
+ name: string;
821
+ /** The page it now points at; `null` when the registration was removed. */
822
+ pageObjectNumber: PageObjectNumber | null;
823
+ origin: EventOrigin;
824
+ } & PageNameResult) | ({
760
825
  type: 'attachment.created';
761
826
  origin: EventOrigin;
762
827
  } & AttachmentCreateResult) | ({
@@ -1041,4 +1106,4 @@ interface Engine {
1041
1106
  type EngineFactory = () => Engine;
1042
1107
  //#endregion
1043
1108
  export { DocumentPagesService as A, CONTINUOUS_RENDER_POLICY as C, snapFullPageViewport as D, snapAppearanceScale as E, WeakAnnotationEditSession as F, DocumentActionsService as I, FormRepairOptions as M, DocumentAttachmentsService as N, snapTileScale as O, DocumentAnnotationsService as P, DocumentSearchService as S, EngineRenderPolicy as T, PageTextService as _, DocumentHandle as a, PageAnnotationsService as b, DocumentEventInit as c, PageHandle as d, PieceInfoService as f, PieceInfoSnapshot as g, PieceInfoPatchValue as h, DocumentCapabilities as i, DocumentFormsService as j, DocumentRedactionService as k, DocumentEventType as l, PieceInfoPatch as m, EngineFactory as n, DocumentEventStream as o, PieceInfoEntry as p, FontService as r, DocumentEvent as s, Engine as t, EventOrigin as u, PageRenderService as v, DocumentRenderService as w, MetadataService as x, PageGeometryService as y };
1044
- //# sourceMappingURL=Engine-DOoVem7_.d.ts.map
1109
+ //# sourceMappingURL=Engine--0XF0UAK.d.cts.map
@@ -1,5 +1,5 @@
1
- import { $r as FormEffectsResult, Aa as AttachmentDeleteResult, Ao as FontKey, Bi as FormFieldRef, Di as FormFieldDTO, Dr as SearchRequest, Fn as RedactionApplyScope, Gi as AnnotationDeleteResult, Gn as PageDeleteResult, Gr as FormFieldUpdateResult, Ho as AnnotationAppearanceRenderOptions, Hr as FormDataExport, Io as AnnotationAppearanceImageOptions, Jr as FormSetValueResult, Ka as AttachmentContent, Ki as AnnotationMoveResult, Kr as FormImportResult, Lo as AnnotationAppearanceImagesResult, Mn as MetadataUpdateResult, No as PdfSaveMode, Or as SearchSlice, Pc as PageObjectNumber, Pn as RedactionApplyResult, Qo as PageImageOptions, Un as PageInsertBlankSpec, Ur as FormFieldCreateResult, Us as MetadataPatch, Vi as FormWidgetRef, Vn as PageFlattenUsage, Wi as AnnotationCreateResult, Wn as PageInsertResult, Wo as AnnotationAppearancesResult, Wr as FormFieldDeleteResult, Ws as OpenInput, Xa as EmbeddedFileItem, Xn as PageMoveResult, Xo as PageImageHandle, Xr as FormEffect, Ya as AttachmentFileSource, Yr as FormWidgetLinkResult, Za as EmbeddedFileRef, Zs as OpenOptions, ai as FormFieldPatch, bs as PageTextSnapshot, di as FormFieldDraft, fl as DocumentActionsSnapshot, jc as AnnotationRef, jo as FontSpec, ka as AttachmentCreateResult, ko as FontHandle, l as AnnotationPatch, ll as PdfRotation, ls as PageRenderViewport, n as AnnotationListSnapshotAllPages, ni as FormFieldValue, ns as PageRaster, o as AnnotationDraft, os as PageRenderOptions, ps as PageGeometrySnapshot, qi as AnnotationUpdateResult, qn as PageRotateResult, qr as FormRepairResult, t as AnnotationListPageSnapshot, ti as FormDataFormat, vi as FormSnapshot, xl as DocumentMetadata, zn as PageFlattenResult, zs as PageListSnapshot } from "./AnnotationListSnapshot-DDxHpJQU.cjs";
2
- import { g as AbortablePromise, s as DocumentSecurityService } from "./DocumentSecurityService-BV4_YXkU.cjs";
1
+ import { $i as FormFieldRef, $n as PageNameResult, $r as FormImportResult, Bi as FormFieldDTO, Bl as DocumentMetadata, Bn as PageDeleteResult, Fn as RedactionApplyScope, Fr as SearchSlice, Gc as AnnotationRef, Go as PdfSaveMode, Ha as AttachmentDeleteResult, Hn as PageRotateResult, Ho as FontKey, Jo as AnnotationAppearanceImageOptions, Mn as MetadataUpdateResult, Ms as PageTextSnapshot, Pn as RedactionApplyResult, Pr as SearchRequest, Qn as PageFlattenUsage, Qr as FormFieldUpdateResult, Rl as PageObjectNumber, Rn as PageInsertBlankSpec, Ts as PageGeometrySnapshot, Uo as FontSpec, Va as AttachmentCreateResult, Vo as FontHandle, Xn as PageFlattenResult, Xr as FormFieldCreateResult, Yo as AnnotationAppearanceImagesResult, Yr as FormDataExport, Zr as FormFieldDeleteResult, Zs as PageListSnapshot, aa as AnnotationMoveResult, co as EmbeddedFileItem, cs as PageImageHandle, dc as OpenOptions, ea as FormWidgetRef, ei as FormRepairResult, er as PageNameInput, es as AnnotationAppearanceRenderOptions, fi as FormSubmissionRequest, hi as FormFieldValue, ia as AnnotationDeleteResult, ic as OpenInput, io as AttachmentContent, ji as FormSnapshot, l as AnnotationPatch, lo as EmbeddedFileRef, mi as FormDataFormat, ms as PageRaster, n as AnnotationListSnapshotAllPages, ni as FormWidgetLinkResult, ns as AnnotationAppearancesResult, o as AnnotationDraft, oa as AnnotationUpdateResult, oi as FormEffectsResult, qn as AnnotationFlattenResult, ra as AnnotationCreateResult, rc as MetadataPatch, ri as FormEffect, rr as PageMoveResult, so as AttachmentFileSource, t as AnnotationListPageSnapshot, ti as FormSetValueResult, tr as PageRemoveNameInput, ui as FormSubmissionReceipt, us as PageImageOptions, vi as FormFieldPatch, vs as PageRenderOptions, wi as FormFieldDraft, wl as DocumentActionsSnapshot, xl as PdfRotation, xs as PageRenderViewport, zn as PageInsertResult } from "./AnnotationListSnapshot-x6tKulNV.js";
2
+ import { g as AbortablePromise, s as DocumentSecurityService } from "./DocumentSecurityService-9MawYxP-.js";
3
3
  //#region src/engine/DocumentActionsService.d.ts
4
4
  /** Lazy, catalog-owned PDF action read. This API extracts; it never executes. */
5
5
  interface DocumentActionsService {
@@ -139,6 +139,18 @@ interface DocumentFormsService {
139
139
  * skipped and any landed state is finalized as one artifact/event/version.
140
140
  */
141
141
  applyEffects?(effects: FormEffect[]): AbortablePromise<FormEffectsResult>;
142
+ /**
143
+ * Deliver a resolved form submission to the document's HOME. Present only
144
+ * where the document HAS a home that accepts submissions — the cloud
145
+ * engine when the deployment advertises the capability; the local engine
146
+ * truthfully lacks it (an in-process document has no home, and this
147
+ * contract is never a callback trampoline). Gated by `doc.forms.submit`
148
+ * (grant-minted; no PDF permission bit exists for submission), asserted
149
+ * at the home's boundary where enforcement is real. The home stores the
150
+ * dataset with the declared intent as metadata and derives WHO submitted
151
+ * from its own verified session — it never fetches the PDF's URL.
152
+ */
153
+ submit?(request: FormSubmissionRequest): AbortablePromise<FormSubmissionReceipt>;
142
154
  /**
143
155
  * Serialize the form data for interchange. Defaults to `'xfdf'` (the
144
156
  * XML sibling; UTF-8, friendliest to web pipelines) — pass `'fdf'` for
@@ -250,6 +262,25 @@ interface DocumentPagesService {
250
262
  * recycled; surviving pages keep their identity and revisions.
251
263
  */
252
264
  delete(pageObjectNumbers: PageObjectNumber[]): AbortablePromise<PageDeleteResult>;
265
+ /**
266
+ * Register `name` → page in the catalog's `/Names /Pages` tree (create,
267
+ * or replace what an existing key points at); with `replace`, drop that
268
+ * other key in the same job (rename). Named pages are LAYOUT — read them
269
+ * back from `list().namedPages` — so this is a page-structure mutation:
270
+ * `docVersion` + `layoutVersion` advance, per-page pins do not. Gated like
271
+ * `move` (`doc.pages.assemble`). Optional while transports ship;
272
+ * feature-detect with `pages.setName !== undefined`.
273
+ *
274
+ * Rejects with `InvalidArg` for an empty name and `NotFound` for a page
275
+ * that is not in the page tree (hidden templates included).
276
+ */
277
+ setName?(input: PageNameInput): AbortablePromise<PageNameResult>;
278
+ /**
279
+ * Remove one `/Names /Pages` registration; the page itself is untouched.
280
+ * `NotFound` when no registration has that decoded key. Page DELETION
281
+ * removes registrations by itself — callers never need to pair the two.
282
+ */
283
+ removeName?(input: PageRemoveNameInput): AbortablePromise<PageNameResult>;
253
284
  /**
254
285
  * Paint eligible annotation appearances into page content and remove only
255
286
  * those annotations that were painted. This changes content and annotation
@@ -527,6 +558,30 @@ interface PageAnnotationsService {
527
558
  * space, in `[0, count - refs.length]`.
528
559
  */
529
560
  move(refs: AnnotationRef[], toIndex: number): AbortablePromise<AnnotationMoveResult>;
561
+ /**
562
+ * Flatten the given annotations of THIS page into its content —
563
+ * `pages.flatten` for a chosen set. Painted annotations are removed from
564
+ * the page; ones that are ineligible (hidden for `usage`, Popups, no
565
+ * usable appearance) stay and report `skipped`, so a caller can say
566
+ * "2 of 3 flattened". A content + annotation MUTATION of this page: its
567
+ * content and annotation pins advance, layout does not; a
568
+ * `annotations.flattened` event is published when anything was applied.
569
+ * Gated like `pages.flatten` (`doc.pages.modify` + `doc.annotate.modify`).
570
+ * `InvalidArg` for a ref on another page; `NotFound` for an unknown ref.
571
+ * Optional while transports ship — feature-detect.
572
+ */
573
+ flatten?(refs: AnnotationRef[], usage?: PageFlattenUsage): AbortablePromise<AnnotationFlattenResult>;
574
+ /**
575
+ * Flatten the normal appearances of the given annotations of this page
576
+ * into a NEW single-page PDF sized to their union `/Rect` — vector,
577
+ * positions preserved, exactly as this page shows them. The same plan as
578
+ * `flatten` aimed at a fresh page; the source document is untouched. A
579
+ * derived READ that egresses content, so it is gated by `doc.download`
580
+ * like `pages.extract`. All-or-nothing: `InvalidArg` when any ref is not
581
+ * on this page, hidden, or has no appearance (a stamp silently missing a
582
+ * part would be worse than an error). Optional — feature-detect.
583
+ */
584
+ exportAppearance?(refs: AnnotationRef[]): AbortablePromise<Uint8Array>;
530
585
  }
531
586
  //#endregion
532
587
  //#region src/engine/PageGeometryService.d.ts
@@ -733,6 +788,9 @@ type DocumentEvent = ({
733
788
  pageObjectNumber: PageObjectNumber;
734
789
  origin: EventOrigin;
735
790
  } & AnnotationMoveResult) | ({
791
+ type: 'annotations.flattened';
792
+ origin: EventOrigin;
793
+ } & AnnotationFlattenResult) | ({
736
794
  type: 'pages.moved';
737
795
  /** Locally: the moved block. Remotely the audit row only records the
738
796
  * outcome, so this is the full new order — consumers should read
@@ -757,6 +815,13 @@ type DocumentEvent = ({
757
815
  destIndex?: number;
758
816
  origin: EventOrigin;
759
817
  } & PageInsertResult) | ({
818
+ type: 'pages.named';
819
+ /** The decoded key that was registered, renamed, or removed. */
820
+ name: string;
821
+ /** The page it now points at; `null` when the registration was removed. */
822
+ pageObjectNumber: PageObjectNumber | null;
823
+ origin: EventOrigin;
824
+ } & PageNameResult) | ({
760
825
  type: 'attachment.created';
761
826
  origin: EventOrigin;
762
827
  } & AttachmentCreateResult) | ({
@@ -1041,4 +1106,4 @@ interface Engine {
1041
1106
  type EngineFactory = () => Engine;
1042
1107
  //#endregion
1043
1108
  export { DocumentPagesService as A, CONTINUOUS_RENDER_POLICY as C, snapFullPageViewport as D, snapAppearanceScale as E, WeakAnnotationEditSession as F, DocumentActionsService as I, FormRepairOptions as M, DocumentAttachmentsService as N, snapTileScale as O, DocumentAnnotationsService as P, DocumentSearchService as S, EngineRenderPolicy as T, PageTextService as _, DocumentHandle as a, PageAnnotationsService as b, DocumentEventInit as c, PageHandle as d, PieceInfoService as f, PieceInfoSnapshot as g, PieceInfoPatchValue as h, DocumentCapabilities as i, DocumentFormsService as j, DocumentRedactionService as k, DocumentEventType as l, PieceInfoPatch as m, EngineFactory as n, DocumentEventStream as o, PieceInfoEntry as p, FontService as r, DocumentEvent as s, Engine as t, EventOrigin as u, PageRenderService as v, DocumentRenderService as w, MetadataService as x, PageGeometryService as y };
1044
- //# sourceMappingURL=Engine-D9je6GdU.d.cts.map
1109
+ //# sourceMappingURL=Engine-Ds0ytbl6.d.ts.map
@@ -1,5 +1,29 @@
1
1
  const require_fold = require("./fold-C7I5GpBz.cjs");
2
2
  const require_PageInsertBlankInput = require("./PageInsertBlankInput-CzShuSJI.cjs");
3
+ //#region src/dto/PdfAction.ts
4
+ /**
5
+ * The one Table-240 decode, shared by the reader, the schema's producers,
6
+ * and tests — so bit semantics cannot fork.
7
+ */
8
+ const decodeSubmitFormFlags = (raw) => {
9
+ const bit = (n) => (raw & 1 << n - 1) !== 0;
10
+ const format = bit(9) ? "pdf" : bit(6) ? "xfdf" : bit(3) ? "html" : "fdf";
11
+ return {
12
+ raw,
13
+ exclude: bit(1),
14
+ includeNoValueFields: bit(2),
15
+ format,
16
+ method: bit(4) && (format === "html" || format === "pdf") ? "get" : "post",
17
+ submitCoordinates: bit(5),
18
+ includeAppendSaves: bit(7),
19
+ includeAnnotations: bit(8),
20
+ canonicalFormat: bit(10),
21
+ exclNonUserAnnots: bit(11),
22
+ exclFKey: bit(12),
23
+ embedForm: bit(14)
24
+ };
25
+ };
26
+ //#endregion
3
27
  //#region src/dto/PageRender.ts
4
28
  function createPageImageHandle(result, blobSource) {
5
29
  return {
@@ -115,19 +139,25 @@ function isBlob(value) {
115
139
  return typeof Blob !== "undefined" && value instanceof Blob;
116
140
  }
117
141
  /**
118
- * Detach a Uint8Array view into a standalone ArrayBuffer without copying
119
- * when the view already spans its whole buffer.
142
+ * Copy a Uint8Array view into a fresh, exactly-sized ArrayBuffer the call
143
+ * owns. Always copies — even when the view spans its whole buffer — because
144
+ * the result may be transferred to a worker (detaching it), and the view is
145
+ * the caller's. Returning `view.buffer` here would let one transfer zero
146
+ * the caller's bytes (a stamp library's Uint8Array became single-use).
147
+ * Callers wanting a zero-copy hand-off need an explicit "give" form, as
148
+ * `pages.insert` has for bare ArrayBuffers; `BinarySource` has none.
120
149
  */
121
- function toStandaloneArrayBuffer(view) {
122
- if (view.byteOffset === 0 && view.buffer instanceof ArrayBuffer && view.byteLength === view.buffer.byteLength) return view.buffer;
123
- return view.slice().buffer;
150
+ function toOwnedArrayBuffer(view) {
151
+ const copy = new ArrayBuffer(view.byteLength);
152
+ new Uint8Array(copy).set(view);
153
+ return copy;
124
154
  }
125
155
  /**
126
156
  * Resolve any accepted `BinarySource` form into a `WireResource`.
127
157
  * Async because Blob bytes can only be read asynchronously.
128
158
  */
129
159
  async function resolveBinarySource(source) {
130
- if (source instanceof Uint8Array) return { bytes: toStandaloneArrayBuffer(source) };
160
+ if (source instanceof Uint8Array) return { bytes: toOwnedArrayBuffer(source) };
131
161
  if (isBlob(source)) {
132
162
  const blobName = blobFileName(source);
133
163
  return {
@@ -138,7 +168,7 @@ async function resolveBinarySource(source) {
138
168
  }
139
169
  const { data, mimeType, name } = source;
140
170
  const inner = data instanceof Uint8Array ? {
141
- bytes: toStandaloneArrayBuffer(data),
171
+ bytes: toOwnedArrayBuffer(data),
142
172
  mimeType: void 0,
143
173
  name: void 0
144
174
  } : {
@@ -1860,6 +1890,12 @@ Object.defineProperty(exports, "decodeStableIdKey", {
1860
1890
  return decodeStableIdKey;
1861
1891
  }
1862
1892
  });
1893
+ Object.defineProperty(exports, "decodeSubmitFormFlags", {
1894
+ enumerable: true,
1895
+ get: function() {
1896
+ return decodeSubmitFormFlags;
1897
+ }
1898
+ });
1863
1899
  Object.defineProperty(exports, "encodeFieldRefKey", {
1864
1900
  enumerable: true,
1865
1901
  get: function() {
@@ -2059,4 +2095,4 @@ Object.defineProperty(exports, "wordBefore", {
2059
2095
  }
2060
2096
  });
2061
2097
 
2062
- //# sourceMappingURL=builders-Cp_rlGob.cjs.map
2098
+ //# sourceMappingURL=builders-8Hl1AYNU.cjs.map