@embedpdf/engine-core 3.0.0-next.1 → 3.0.0-next.11

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 (62) hide show
  1. package/dist/{AbortError-CjSasIlL.js → AbortError-8-9JAX1Y.js} +2 -2
  2. package/dist/{AbortError-CjSasIlL.js.map → AbortError-8-9JAX1Y.js.map} +1 -1
  3. package/dist/{AbortError-ByBflvEl.cjs → AbortError-CRSooKsk.cjs} +2 -2
  4. package/dist/{AbortError-ByBflvEl.cjs.map → AbortError-CRSooKsk.cjs.map} +1 -1
  5. package/dist/{AnnotationListSnapshot-W0RCsyDE.d.cts → AnnotationListSnapshot-C1U3XUxP.d.cts} +846 -127
  6. package/dist/{AnnotationListSnapshot-W0RCsyDE.d.ts → AnnotationListSnapshot-C1U3XUxP.d.ts} +846 -127
  7. package/dist/{DocumentSecurityService-Df79fgpe.d.cts → DocumentSecurityService-6rhztZlz.d.cts} +33 -2
  8. package/dist/{DocumentSecurityService-B-tULKNY.d.ts → DocumentSecurityService-7nL9aY75.d.ts} +33 -2
  9. package/dist/{Engine-B7Oe7f5i.d.ts → Engine-CWnAKccD.d.ts} +62 -19
  10. package/dist/{Engine-D9loFZc1.d.cts → Engine-D3868xIU.d.cts} +62 -19
  11. package/dist/{subtype-qejjVr6h.cjs → PageInsertBlankInput-CzShuSJI.cjs} +184 -1
  12. package/dist/PageInsertBlankInput-CzShuSJI.cjs.map +1 -0
  13. package/dist/{subtype-BvAzLCGC.js → PageInsertBlankInput-WKY0tr6S.js} +149 -2
  14. package/dist/PageInsertBlankInput-WKY0tr6S.js.map +1 -0
  15. package/dist/{builders-C548U47M.js → builders-Cdz34nbF.js} +566 -164
  16. package/dist/builders-Cdz34nbF.js.map +1 -0
  17. package/dist/{builders-BvikWRuO.cjs → builders-Do6_4KnS.cjs} +628 -220
  18. package/dist/builders-Do6_4KnS.cjs.map +1 -0
  19. package/dist/conformance.cjs +1039 -204
  20. package/dist/conformance.cjs.map +1 -1
  21. package/dist/conformance.d.cts +130 -6
  22. package/dist/conformance.d.ts +130 -6
  23. package/dist/conformance.js +994 -163
  24. package/dist/conformance.js.map +1 -1
  25. package/dist/{fold-CB4fAOOy.js → fold-BfyxxwS6.js} +162 -3
  26. package/dist/fold-BfyxxwS6.js.map +1 -0
  27. package/dist/{fold-IaMph3CO.cjs → fold-C7I5GpBz.cjs} +235 -4
  28. package/dist/fold-C7I5GpBz.cjs.map +1 -0
  29. package/dist/index.cjs +38 -19
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.js +5 -5
  33. package/dist/{resolver-DiPMTfcy.js → resolver-CHG4waXL.js} +2 -1
  34. package/dist/resolver-CHG4waXL.js.map +1 -0
  35. package/dist/{resolver-DAZWVoJL.cjs → resolver-D-jumvgM.cjs} +2 -1
  36. package/dist/resolver-D-jumvgM.cjs.map +1 -0
  37. package/dist/runtime.cjs +43 -24
  38. package/dist/runtime.cjs.map +1 -1
  39. package/dist/runtime.d.cts +103 -5
  40. package/dist/runtime.d.ts +103 -5
  41. package/dist/runtime.js +6 -6
  42. package/dist/{schemas-B_1VyFsm.cjs → schemas-CS5iPpX5.cjs} +305 -111
  43. package/dist/schemas-CS5iPpX5.cjs.map +1 -0
  44. package/dist/{schemas-9OpSSeM6.js → schemas-XGrNVMDd.js} +250 -92
  45. package/dist/schemas-XGrNVMDd.js.map +1 -0
  46. package/dist/wire.cjs +131 -4
  47. package/dist/wire.cjs.map +1 -1
  48. package/dist/wire.d.cts +277 -20
  49. package/dist/wire.d.ts +277 -20
  50. package/dist/wire.js +120 -5
  51. package/dist/wire.js.map +1 -1
  52. package/package.json +1 -1
  53. package/dist/builders-BvikWRuO.cjs.map +0 -1
  54. package/dist/builders-C548U47M.js.map +0 -1
  55. package/dist/fold-CB4fAOOy.js.map +0 -1
  56. package/dist/fold-IaMph3CO.cjs.map +0 -1
  57. package/dist/resolver-DAZWVoJL.cjs.map +0 -1
  58. package/dist/resolver-DiPMTfcy.js.map +0 -1
  59. package/dist/schemas-9OpSSeM6.js.map +0 -1
  60. package/dist/schemas-B_1VyFsm.cjs.map +0 -1
  61. package/dist/subtype-BvAzLCGC.js.map +0 -1
  62. package/dist/subtype-qejjVr6h.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { An as HighlightDraft, Cc as InkList, Ec as PdfPoint, Oc as PdfRect, Tc as LinePoints, Vc as DocumentMetadata, n as AnnotationListSnapshotAllPages, t as AnnotationListPageSnapshot } from "./AnnotationListSnapshot-W0RCsyDE.cjs";
2
- import { t as Engine } from "./Engine-D9loFZc1.cjs";
1
+ import { An as HighlightDraft, Ds as CharMapAnchor, cl as LinePoints, dl as PdfRect, jl as DocumentMetadata, ll as PdfPoint, n as AnnotationListSnapshotAllPages, ol as InkList, t as AnnotationListPageSnapshot } from "./AnnotationListSnapshot-C1U3XUxP.cjs";
2
+ import { t as Engine } from "./Engine-D3868xIU.cjs";
3
3
  //#region src/conformance/runMetadataConformance.d.ts
4
4
  interface ConformanceTestRunner {
5
5
  describe(name: string, fn: () => void): void;
@@ -16,6 +16,7 @@ interface ConformanceExpect {
16
16
  toHaveLength(expected: number): void;
17
17
  toMatch(re: RegExp): void;
18
18
  toMatchObject(shape: Record<string, unknown>): void;
19
+ toContain(expected: unknown): void;
19
20
  toBeInstanceOf(ctor: Function): void;
20
21
  toBeTruthy(): void;
21
22
  rejects: {
@@ -101,6 +102,11 @@ interface ActionsConformanceFixtures {
101
102
  page: ConformanceFixture;
102
103
  annotation: ConformanceFixture;
103
104
  field: ConformanceFixture;
105
+ /** `action_payloads.pdf` — every executable payload shape on one page of
106
+ * /NM-keyed links. REQUIRED on both flavours: payload parity is a gate. */
107
+ payloads: ConformanceFixture;
108
+ /** `open_action_dest.pdf` — a destination-form catalog `/OpenAction`. */
109
+ openDestination: ConformanceFixture;
104
110
  /** A page whose only annotation is a Link with a `/S /JavaScript` action.
105
111
  * Optional: the javascript-link classification test skips without it. */
106
112
  javascriptLink?: ConformanceFixture;
@@ -408,9 +414,9 @@ declare function runAttachmentConformance(runner: ConformanceTestRunner, opts: C
408
414
  //#endregion
409
415
  //#region src/conformance/runPageInsertConformance.d.ts
410
416
  /**
411
- * Page insert conformance. `pages.insert?` is optional only until the cloud
412
- * endpoint ships (it is slated REQUIRED-parity — a cloud viewer must be able
413
- * to add pages); the suite runs wherever the implementation exists.
417
+ * Page insert conformance. `pages.insert` is a REQUIRED member — this suite
418
+ * runs unconditionally on every engine, so an implementation that loses the
419
+ * verb fails loudly instead of being skipped past.
414
420
  *
415
421
  * Invariants:
416
422
  * 1. Every page of the source bytes is COPIED in at `destIndex` (omitted →
@@ -424,6 +430,26 @@ declare function runAttachmentConformance(runner: ConformanceTestRunner, opts: C
424
430
  */
425
431
  declare function runPageInsertConformance(runner: ConformanceTestRunner, opts: ConformanceOptions): void;
426
432
  //#endregion
433
+ //#region src/conformance/runPageInsertBlankConformance.d.ts
434
+ /**
435
+ * Blank-page insert conformance. `pages.insertBlank` is a REQUIRED member —
436
+ * the suite runs unconditionally on every engine (no fixture bytes are
437
+ * needed at all, which is the point of the verb), so an implementation that
438
+ * loses the verb fails loudly instead of being skipped past.
439
+ *
440
+ * Invariants:
441
+ * 1. `count` blank pages of exactly `size` appear at `destIndex` (omitted
442
+ * → append), rotation 0; the result lists their fresh PONs in insertion
443
+ * order and they agree with the returned layout.
444
+ * 2. Pre-existing pages keep their identity: same PONs before and after,
445
+ * in the expected positions (an insert never invalidates neighbours).
446
+ * 3. The mutation persists through save → re-open (bytes engines only).
447
+ * 4. Non-positive size / count outside [1, PAGE_INSERT_BLANK_MAX_COUNT] /
448
+ * out-of-range destIndex reject with InvalidArg, leaving the document
449
+ * untouched.
450
+ */
451
+ declare function runPageInsertBlankConformance(runner: ConformanceTestRunner, opts: ConformanceOptions): void;
452
+ //#endregion
427
453
  //#region src/conformance/runPieceInfoConformance.d.ts
428
454
  /**
429
455
  * `/PieceInfo` conformance (doc + page level). The service is OPTIONAL on
@@ -489,6 +515,102 @@ interface PageTextConformanceOptions extends Omit<ConformanceOptions, 'fixture'>
489
515
  }
490
516
  declare function runPageTextConformance(runner: ConformanceTestRunner, opts: PageTextConformanceOptions): void;
491
517
  //#endregion
518
+ //#region src/conformance/runTextDivergenceConformance.d.ts
519
+ /**
520
+ * Index-space divergence conformance: the cases where a page's CHARACTER
521
+ * space (what geometry tiles and selection/search ranges address) and its
522
+ * extracted TEXT differ — and the `charMap` contract that bridges them.
523
+ *
524
+ * Fixtures pin EXACT values (text, charCount, anchors) verified against the
525
+ * wasm runtime, so both engines must produce byte-identical snapshots:
526
+ *
527
+ * - a non-printing character occupying a character slot with no text unit
528
+ * (`bug_1139.pdf` — every text offset shifts by one);
529
+ * - `/ActualText` replacement (`bug_384770169.pdf` — synthetic `kPiece`
530
+ * characters in lockstep with the text, identity map, real segments);
531
+ * - supplementary-plane text via a ToUnicode surrogate pair
532
+ * (`embedpdf_astral_tounicode.pdf` — two lockstep surrogate entries,
533
+ * identity map, astral content SURVIVES extraction).
534
+ *
535
+ * The search probe closes the loop: a hit's `charStart`/`charCount` must be
536
+ * CHARACTER-space (segments join geometry), and slicing the snapshot by the
537
+ * hit's range must reproduce the matched text exactly — the law that makes
538
+ * select-this-match and copy compose.
539
+ */
540
+ interface TextDivergenceConformanceFixture extends ConformanceFixture {
541
+ /** PDF indirect object number of the probed page. */
542
+ pageObjectNumber: number;
543
+ /** The EXACT extracted text (UTF-16 faithful). */
544
+ exactText: string;
545
+ /** The character-space size (may differ from `exactText.length`). */
546
+ expectedCharCount: number;
547
+ /** Expected anchors; null asserts identity (no `charMap` on the wire). */
548
+ expectedCharMap: ReadonlyArray<CharMapAnchor> | null;
549
+ /** Char-space slice expectations (half-open). */
550
+ slices?: ReadonlyArray<{
551
+ from: number;
552
+ to: number;
553
+ text: string;
554
+ }>;
555
+ /** Literal search probe with expected CHARACTER-space hit range. */
556
+ search?: {
557
+ query: string;
558
+ charStart: number;
559
+ charCount: number;
560
+ matchedText: string;
561
+ };
562
+ }
563
+ interface TextDivergenceConformanceOptions extends Omit<ConformanceOptions, 'fixture'> {
564
+ fixture: TextDivergenceConformanceFixture;
565
+ }
566
+ declare function runTextDivergenceConformance(runner: ConformanceTestRunner, opts: TextDivergenceConformanceOptions): void;
567
+ /** One divergence case, minus the per-suite bytes/id wiring. */
568
+ type TextDivergenceCase = Omit<TextDivergenceConformanceFixture, 'id' | 'bytes' | 'expected'> & {
569
+ /** Fixture file name under the fork's `testing/resources/`. */
570
+ resource: string;
571
+ };
572
+ /**
573
+ * THE pinned divergence cases — one table, consumed by both engines' suites
574
+ * so expected values cannot drift. Values verified against the wasm runtime
575
+ * (see each case). All fixtures are single-page; the page's indirect object
576
+ * number is 3 in each.
577
+ */
578
+ declare const TEXT_DIVERGENCE_CASES: Readonly<Record<string, TextDivergenceCase>>;
579
+ //#endregion
580
+ //#region src/conformance/runPageGeometryOrientationConformance.d.ts
581
+ /**
582
+ * Per-fixture expectations for the oriented-text geometry harness. One
583
+ * fixture per call, mirroring the other conformance suites; the fixture
584
+ * declares what its dominant text orientation must read back as.
585
+ */
586
+ interface PageGeometryOrientationFixture extends ConformanceFixture {
587
+ /** PDF indirect object number of the page under test. */
588
+ pageObjectNumber: number;
589
+ expectation: {
590
+ /** Every run is the upright variant; no glyph carries oriented cells. */
591
+ kind: 'upright';
592
+ } | {
593
+ /** The page loads and every glyph is degenerate (zeroed + empty flag). */
594
+ kind: 'empty-only';
595
+ } | {
596
+ kind: 'rotated';
597
+ /** Baseline angles (radians, CCW, PDF y-up) rotated runs may carry. */
598
+ rotations: number[];
599
+ ascentFlip: boolean;
600
+ /**
601
+ * Assert sheared cells: with `rotations` ≈ [0], a non-zero start-edge
602
+ * x-offset proves the parallelogram (an AABB could not express it).
603
+ */
604
+ sheared?: boolean;
605
+ /** Minimum number of rotated runs the page must produce (default 1). */
606
+ minRotatedRuns?: number;
607
+ };
608
+ }
609
+ interface PageGeometryOrientationOptions extends Omit<ConformanceOptions, 'fixture'> {
610
+ fixture: PageGeometryOrientationFixture;
611
+ }
612
+ declare function runPageGeometryOrientationConformance(runner: ConformanceTestRunner, opts: PageGeometryOrientationOptions): void;
613
+ //#endregion
492
614
  //#region src/conformance/runSearchConformance.d.ts
493
615
  /**
494
616
  * Per-fixture expectations for the search harness. Suites supply a
@@ -522,9 +644,11 @@ declare function runSearchConformance(runner: ConformanceTestRunner, opts: Searc
522
644
  * are disjoint. We do compare `pageObjectNumber` and `generation` (which
523
645
  * should be 0 for fresh reads on both sides). Page order is no longer part
524
646
  * of `PageState`; it lives in `PageLayout.index` (see `pages.list()`).
647
+ * `auditHead` is likewise not compared: it is a cloud-only reconciliation
648
+ * cursor, absent on local snapshots by design.
525
649
  */
526
650
  declare function diffAnnotationListSnapshot(a: AnnotationListPageSnapshot, b: AnnotationListPageSnapshot): string[];
527
651
  declare function diffAnnotationListSnapshotAll(a: AnnotationListSnapshotAllPages, b: AnnotationListSnapshotAllPages): string[];
528
652
  //#endregion
529
- export { type ActionsConformanceFixtures, type ActionsConformanceOptions, type AnnotationAppearanceConformanceFixture, type AnnotationAppearanceConformanceOptions, type AnnotationConformanceOptions, type AnnotationMutationConformanceFixture, type AnnotationMutationConformanceOptions, type AnnotationReadConformanceFixture, type ConformanceExpect, type ConformanceFixture, type ConformanceOptions, type ConformanceTestRunner, type FormConformanceFixtures, type FormConformanceOptions, type PageReorderConformanceFixture, type PageReorderConformanceOptions, type PageTextConformanceFixture, type PageTextConformanceOptions, type SearchConformanceFixture, type SearchConformanceOptions, diffAnnotationListSnapshot, diffAnnotationListSnapshotAll, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationMutationConformance, runAnnotationReadConformance, runAttachmentConformance, runDocumentEventsConformance, runFormConformance, runMetadataConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageInsertConformance, runPageReorderConformance, runPageRotateConformance, runPageTextConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance };
653
+ export { type ActionsConformanceFixtures, type ActionsConformanceOptions, type AnnotationAppearanceConformanceFixture, type AnnotationAppearanceConformanceOptions, type AnnotationConformanceOptions, type AnnotationMutationConformanceFixture, type AnnotationMutationConformanceOptions, type AnnotationReadConformanceFixture, type ConformanceExpect, type ConformanceFixture, type ConformanceOptions, type ConformanceTestRunner, type FormConformanceFixtures, type FormConformanceOptions, type PageGeometryOrientationFixture, type PageGeometryOrientationOptions, type PageReorderConformanceFixture, type PageReorderConformanceOptions, type PageTextConformanceFixture, type PageTextConformanceOptions, type SearchConformanceFixture, type SearchConformanceOptions, TEXT_DIVERGENCE_CASES, type TextDivergenceCase, type TextDivergenceConformanceFixture, type TextDivergenceConformanceOptions, diffAnnotationListSnapshot, diffAnnotationListSnapshotAll, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationMutationConformance, runAnnotationReadConformance, runAttachmentConformance, runDocumentEventsConformance, runFormConformance, runMetadataConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageGeometryOrientationConformance, runPageInsertBlankConformance, runPageInsertConformance, runPageReorderConformance, runPageRotateConformance, runPageTextConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance, runTextDivergenceConformance };
530
654
  //# sourceMappingURL=conformance.d.cts.map
@@ -1,5 +1,5 @@
1
- import { An as HighlightDraft, Cc as InkList, Ec as PdfPoint, Oc as PdfRect, Tc as LinePoints, Vc as DocumentMetadata, n as AnnotationListSnapshotAllPages, t as AnnotationListPageSnapshot } from "./AnnotationListSnapshot-W0RCsyDE.js";
2
- import { t as Engine } from "./Engine-B7Oe7f5i.js";
1
+ import { An as HighlightDraft, Ds as CharMapAnchor, cl as LinePoints, dl as PdfRect, jl as DocumentMetadata, ll as PdfPoint, n as AnnotationListSnapshotAllPages, ol as InkList, t as AnnotationListPageSnapshot } from "./AnnotationListSnapshot-C1U3XUxP.js";
2
+ import { t as Engine } from "./Engine-CWnAKccD.js";
3
3
  //#region src/conformance/runMetadataConformance.d.ts
4
4
  interface ConformanceTestRunner {
5
5
  describe(name: string, fn: () => void): void;
@@ -16,6 +16,7 @@ interface ConformanceExpect {
16
16
  toHaveLength(expected: number): void;
17
17
  toMatch(re: RegExp): void;
18
18
  toMatchObject(shape: Record<string, unknown>): void;
19
+ toContain(expected: unknown): void;
19
20
  toBeInstanceOf(ctor: Function): void;
20
21
  toBeTruthy(): void;
21
22
  rejects: {
@@ -101,6 +102,11 @@ interface ActionsConformanceFixtures {
101
102
  page: ConformanceFixture;
102
103
  annotation: ConformanceFixture;
103
104
  field: ConformanceFixture;
105
+ /** `action_payloads.pdf` — every executable payload shape on one page of
106
+ * /NM-keyed links. REQUIRED on both flavours: payload parity is a gate. */
107
+ payloads: ConformanceFixture;
108
+ /** `open_action_dest.pdf` — a destination-form catalog `/OpenAction`. */
109
+ openDestination: ConformanceFixture;
104
110
  /** A page whose only annotation is a Link with a `/S /JavaScript` action.
105
111
  * Optional: the javascript-link classification test skips without it. */
106
112
  javascriptLink?: ConformanceFixture;
@@ -408,9 +414,9 @@ declare function runAttachmentConformance(runner: ConformanceTestRunner, opts: C
408
414
  //#endregion
409
415
  //#region src/conformance/runPageInsertConformance.d.ts
410
416
  /**
411
- * Page insert conformance. `pages.insert?` is optional only until the cloud
412
- * endpoint ships (it is slated REQUIRED-parity — a cloud viewer must be able
413
- * to add pages); the suite runs wherever the implementation exists.
417
+ * Page insert conformance. `pages.insert` is a REQUIRED member — this suite
418
+ * runs unconditionally on every engine, so an implementation that loses the
419
+ * verb fails loudly instead of being skipped past.
414
420
  *
415
421
  * Invariants:
416
422
  * 1. Every page of the source bytes is COPIED in at `destIndex` (omitted →
@@ -424,6 +430,26 @@ declare function runAttachmentConformance(runner: ConformanceTestRunner, opts: C
424
430
  */
425
431
  declare function runPageInsertConformance(runner: ConformanceTestRunner, opts: ConformanceOptions): void;
426
432
  //#endregion
433
+ //#region src/conformance/runPageInsertBlankConformance.d.ts
434
+ /**
435
+ * Blank-page insert conformance. `pages.insertBlank` is a REQUIRED member —
436
+ * the suite runs unconditionally on every engine (no fixture bytes are
437
+ * needed at all, which is the point of the verb), so an implementation that
438
+ * loses the verb fails loudly instead of being skipped past.
439
+ *
440
+ * Invariants:
441
+ * 1. `count` blank pages of exactly `size` appear at `destIndex` (omitted
442
+ * → append), rotation 0; the result lists their fresh PONs in insertion
443
+ * order and they agree with the returned layout.
444
+ * 2. Pre-existing pages keep their identity: same PONs before and after,
445
+ * in the expected positions (an insert never invalidates neighbours).
446
+ * 3. The mutation persists through save → re-open (bytes engines only).
447
+ * 4. Non-positive size / count outside [1, PAGE_INSERT_BLANK_MAX_COUNT] /
448
+ * out-of-range destIndex reject with InvalidArg, leaving the document
449
+ * untouched.
450
+ */
451
+ declare function runPageInsertBlankConformance(runner: ConformanceTestRunner, opts: ConformanceOptions): void;
452
+ //#endregion
427
453
  //#region src/conformance/runPieceInfoConformance.d.ts
428
454
  /**
429
455
  * `/PieceInfo` conformance (doc + page level). The service is OPTIONAL on
@@ -489,6 +515,102 @@ interface PageTextConformanceOptions extends Omit<ConformanceOptions, 'fixture'>
489
515
  }
490
516
  declare function runPageTextConformance(runner: ConformanceTestRunner, opts: PageTextConformanceOptions): void;
491
517
  //#endregion
518
+ //#region src/conformance/runTextDivergenceConformance.d.ts
519
+ /**
520
+ * Index-space divergence conformance: the cases where a page's CHARACTER
521
+ * space (what geometry tiles and selection/search ranges address) and its
522
+ * extracted TEXT differ — and the `charMap` contract that bridges them.
523
+ *
524
+ * Fixtures pin EXACT values (text, charCount, anchors) verified against the
525
+ * wasm runtime, so both engines must produce byte-identical snapshots:
526
+ *
527
+ * - a non-printing character occupying a character slot with no text unit
528
+ * (`bug_1139.pdf` — every text offset shifts by one);
529
+ * - `/ActualText` replacement (`bug_384770169.pdf` — synthetic `kPiece`
530
+ * characters in lockstep with the text, identity map, real segments);
531
+ * - supplementary-plane text via a ToUnicode surrogate pair
532
+ * (`embedpdf_astral_tounicode.pdf` — two lockstep surrogate entries,
533
+ * identity map, astral content SURVIVES extraction).
534
+ *
535
+ * The search probe closes the loop: a hit's `charStart`/`charCount` must be
536
+ * CHARACTER-space (segments join geometry), and slicing the snapshot by the
537
+ * hit's range must reproduce the matched text exactly — the law that makes
538
+ * select-this-match and copy compose.
539
+ */
540
+ interface TextDivergenceConformanceFixture extends ConformanceFixture {
541
+ /** PDF indirect object number of the probed page. */
542
+ pageObjectNumber: number;
543
+ /** The EXACT extracted text (UTF-16 faithful). */
544
+ exactText: string;
545
+ /** The character-space size (may differ from `exactText.length`). */
546
+ expectedCharCount: number;
547
+ /** Expected anchors; null asserts identity (no `charMap` on the wire). */
548
+ expectedCharMap: ReadonlyArray<CharMapAnchor> | null;
549
+ /** Char-space slice expectations (half-open). */
550
+ slices?: ReadonlyArray<{
551
+ from: number;
552
+ to: number;
553
+ text: string;
554
+ }>;
555
+ /** Literal search probe with expected CHARACTER-space hit range. */
556
+ search?: {
557
+ query: string;
558
+ charStart: number;
559
+ charCount: number;
560
+ matchedText: string;
561
+ };
562
+ }
563
+ interface TextDivergenceConformanceOptions extends Omit<ConformanceOptions, 'fixture'> {
564
+ fixture: TextDivergenceConformanceFixture;
565
+ }
566
+ declare function runTextDivergenceConformance(runner: ConformanceTestRunner, opts: TextDivergenceConformanceOptions): void;
567
+ /** One divergence case, minus the per-suite bytes/id wiring. */
568
+ type TextDivergenceCase = Omit<TextDivergenceConformanceFixture, 'id' | 'bytes' | 'expected'> & {
569
+ /** Fixture file name under the fork's `testing/resources/`. */
570
+ resource: string;
571
+ };
572
+ /**
573
+ * THE pinned divergence cases — one table, consumed by both engines' suites
574
+ * so expected values cannot drift. Values verified against the wasm runtime
575
+ * (see each case). All fixtures are single-page; the page's indirect object
576
+ * number is 3 in each.
577
+ */
578
+ declare const TEXT_DIVERGENCE_CASES: Readonly<Record<string, TextDivergenceCase>>;
579
+ //#endregion
580
+ //#region src/conformance/runPageGeometryOrientationConformance.d.ts
581
+ /**
582
+ * Per-fixture expectations for the oriented-text geometry harness. One
583
+ * fixture per call, mirroring the other conformance suites; the fixture
584
+ * declares what its dominant text orientation must read back as.
585
+ */
586
+ interface PageGeometryOrientationFixture extends ConformanceFixture {
587
+ /** PDF indirect object number of the page under test. */
588
+ pageObjectNumber: number;
589
+ expectation: {
590
+ /** Every run is the upright variant; no glyph carries oriented cells. */
591
+ kind: 'upright';
592
+ } | {
593
+ /** The page loads and every glyph is degenerate (zeroed + empty flag). */
594
+ kind: 'empty-only';
595
+ } | {
596
+ kind: 'rotated';
597
+ /** Baseline angles (radians, CCW, PDF y-up) rotated runs may carry. */
598
+ rotations: number[];
599
+ ascentFlip: boolean;
600
+ /**
601
+ * Assert sheared cells: with `rotations` ≈ [0], a non-zero start-edge
602
+ * x-offset proves the parallelogram (an AABB could not express it).
603
+ */
604
+ sheared?: boolean;
605
+ /** Minimum number of rotated runs the page must produce (default 1). */
606
+ minRotatedRuns?: number;
607
+ };
608
+ }
609
+ interface PageGeometryOrientationOptions extends Omit<ConformanceOptions, 'fixture'> {
610
+ fixture: PageGeometryOrientationFixture;
611
+ }
612
+ declare function runPageGeometryOrientationConformance(runner: ConformanceTestRunner, opts: PageGeometryOrientationOptions): void;
613
+ //#endregion
492
614
  //#region src/conformance/runSearchConformance.d.ts
493
615
  /**
494
616
  * Per-fixture expectations for the search harness. Suites supply a
@@ -522,9 +644,11 @@ declare function runSearchConformance(runner: ConformanceTestRunner, opts: Searc
522
644
  * are disjoint. We do compare `pageObjectNumber` and `generation` (which
523
645
  * should be 0 for fresh reads on both sides). Page order is no longer part
524
646
  * of `PageState`; it lives in `PageLayout.index` (see `pages.list()`).
647
+ * `auditHead` is likewise not compared: it is a cloud-only reconciliation
648
+ * cursor, absent on local snapshots by design.
525
649
  */
526
650
  declare function diffAnnotationListSnapshot(a: AnnotationListPageSnapshot, b: AnnotationListPageSnapshot): string[];
527
651
  declare function diffAnnotationListSnapshotAll(a: AnnotationListSnapshotAllPages, b: AnnotationListSnapshotAllPages): string[];
528
652
  //#endregion
529
- export { type ActionsConformanceFixtures, type ActionsConformanceOptions, type AnnotationAppearanceConformanceFixture, type AnnotationAppearanceConformanceOptions, type AnnotationConformanceOptions, type AnnotationMutationConformanceFixture, type AnnotationMutationConformanceOptions, type AnnotationReadConformanceFixture, type ConformanceExpect, type ConformanceFixture, type ConformanceOptions, type ConformanceTestRunner, type FormConformanceFixtures, type FormConformanceOptions, type PageReorderConformanceFixture, type PageReorderConformanceOptions, type PageTextConformanceFixture, type PageTextConformanceOptions, type SearchConformanceFixture, type SearchConformanceOptions, diffAnnotationListSnapshot, diffAnnotationListSnapshotAll, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationMutationConformance, runAnnotationReadConformance, runAttachmentConformance, runDocumentEventsConformance, runFormConformance, runMetadataConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageInsertConformance, runPageReorderConformance, runPageRotateConformance, runPageTextConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance };
653
+ export { type ActionsConformanceFixtures, type ActionsConformanceOptions, type AnnotationAppearanceConformanceFixture, type AnnotationAppearanceConformanceOptions, type AnnotationConformanceOptions, type AnnotationMutationConformanceFixture, type AnnotationMutationConformanceOptions, type AnnotationReadConformanceFixture, type ConformanceExpect, type ConformanceFixture, type ConformanceOptions, type ConformanceTestRunner, type FormConformanceFixtures, type FormConformanceOptions, type PageGeometryOrientationFixture, type PageGeometryOrientationOptions, type PageReorderConformanceFixture, type PageReorderConformanceOptions, type PageTextConformanceFixture, type PageTextConformanceOptions, type SearchConformanceFixture, type SearchConformanceOptions, TEXT_DIVERGENCE_CASES, type TextDivergenceCase, type TextDivergenceConformanceFixture, type TextDivergenceConformanceOptions, diffAnnotationListSnapshot, diffAnnotationListSnapshotAll, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationMutationConformance, runAnnotationReadConformance, runAttachmentConformance, runDocumentEventsConformance, runFormConformance, runMetadataConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageGeometryOrientationConformance, runPageInsertBlankConformance, runPageInsertConformance, runPageReorderConformance, runPageRotateConformance, runPageTextConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance, runTextDivergenceConformance };
530
654
  //# sourceMappingURL=conformance.d.ts.map