@embedpdf/engine-core 3.0.0-next.4 → 3.0.0-next.5
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/{AbortError-D0w0N4pJ.js → AbortError-BsHuCO1S.js} +2 -2
- package/dist/{AbortError-D0w0N4pJ.js.map → AbortError-BsHuCO1S.js.map} +1 -1
- package/dist/{AbortError-BFwCIKC6.cjs → AbortError-DmWeq9sx.cjs} +2 -2
- package/dist/{AbortError-BFwCIKC6.cjs.map → AbortError-DmWeq9sx.cjs.map} +1 -1
- package/dist/{AnnotationListSnapshot-_Z600IzD.d.ts → AnnotationListSnapshot-CHjkcIaL.d.cts} +132 -19
- package/dist/{AnnotationListSnapshot-_Z600IzD.d.cts → AnnotationListSnapshot-CHjkcIaL.d.ts} +132 -19
- package/dist/{DocumentSecurityService-CoHQf0Ju.d.cts → DocumentSecurityService-B1uv4FaK.d.cts} +2 -2
- package/dist/{DocumentSecurityService-BR4tesJK.d.ts → DocumentSecurityService-CrxGktMI.d.ts} +2 -2
- package/dist/{Engine-h_6P4pjM.d.ts → Engine-BE6r06QI.d.ts} +3 -3
- package/dist/{Engine-LHgbW5z-.d.cts → Engine-BOaRwtKa.d.cts} +3 -3
- package/dist/{builders-CBK8k_cn.cjs → builders-BsUc2A1U.cjs} +6 -6
- package/dist/{builders-CBK8k_cn.cjs.map → builders-BsUc2A1U.cjs.map} +1 -1
- package/dist/{builders-BWgXkLKd.js → builders-CF5gKkOa.js} +3 -3
- package/dist/{builders-BWgXkLKd.js.map → builders-CF5gKkOa.js.map} +1 -1
- package/dist/{subtype-DsxZbJtP.js → charmap-CUukAMhR.js} +132 -2
- package/dist/charmap-CUukAMhR.js.map +1 -0
- package/dist/{subtype-C4XA7C16.cjs → charmap-D6PLtRiC.cjs} +161 -1
- package/dist/charmap-D6PLtRiC.cjs.map +1 -0
- package/dist/conformance.cjs +338 -172
- package/dist/conformance.cjs.map +1 -1
- package/dist/conformance.d.cts +65 -3
- package/dist/conformance.d.ts +65 -3
- package/dist/conformance.js +295 -131
- package/dist/conformance.js.map +1 -1
- package/dist/{fold-M6iEyY8X.cjs → fold-BeT1GxLP.cjs} +4 -4
- package/dist/{fold-M6iEyY8X.cjs.map → fold-BeT1GxLP.cjs.map} +1 -1
- package/dist/{fold-D3_ZiKOg.js → fold-DemV94jf.js} +2 -2
- package/dist/{fold-D3_ZiKOg.js.map → fold-DemV94jf.js.map} +1 -1
- package/dist/index.cjs +14 -9
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/runtime.cjs +19 -14
- package/dist/runtime.d.cts +4 -4
- package/dist/runtime.d.ts +4 -4
- package/dist/runtime.js +5 -5
- package/dist/{schemas-CLByd6ze.cjs → schemas-CyWwm0Zf.cjs} +37 -28
- package/dist/schemas-CyWwm0Zf.cjs.map +1 -0
- package/dist/{schemas-C32v81cE.js → schemas-ES6-TkIl.js} +17 -8
- package/dist/{schemas-C32v81cE.js.map → schemas-ES6-TkIl.js.map} +1 -1
- package/dist/wire.cjs +1 -1
- package/dist/wire.d.cts +8 -7
- package/dist/wire.d.ts +8 -7
- package/dist/wire.js +1 -1
- package/package.json +1 -1
- package/dist/schemas-CLByd6ze.cjs.map +0 -1
- package/dist/subtype-C4XA7C16.cjs.map +0 -1
- package/dist/subtype-DsxZbJtP.js.map +0 -1
package/dist/conformance.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { An as HighlightDraft,
|
|
2
|
-
import { t as Engine } from "./Engine-
|
|
1
|
+
import { An as HighlightDraft, Qc as PdfPoint, Yc as InkList, Zc as LinePoints, el as PdfRect, ms as CharMapAnchor, n as AnnotationListSnapshotAllPages, pl as DocumentMetadata, t as AnnotationListPageSnapshot } from "./AnnotationListSnapshot-CHjkcIaL.cjs";
|
|
2
|
+
import { t as Engine } from "./Engine-BOaRwtKa.cjs";
|
|
3
3
|
//#region src/conformance/runMetadataConformance.d.ts
|
|
4
4
|
interface ConformanceTestRunner {
|
|
5
5
|
describe(name: string, fn: () => void): void;
|
|
@@ -489,6 +489,68 @@ interface PageTextConformanceOptions extends Omit<ConformanceOptions, 'fixture'>
|
|
|
489
489
|
}
|
|
490
490
|
declare function runPageTextConformance(runner: ConformanceTestRunner, opts: PageTextConformanceOptions): void;
|
|
491
491
|
//#endregion
|
|
492
|
+
//#region src/conformance/runTextDivergenceConformance.d.ts
|
|
493
|
+
/**
|
|
494
|
+
* Index-space divergence conformance: the cases where a page's CHARACTER
|
|
495
|
+
* space (what geometry tiles and selection/search ranges address) and its
|
|
496
|
+
* extracted TEXT differ — and the `charMap` contract that bridges them.
|
|
497
|
+
*
|
|
498
|
+
* Fixtures pin EXACT values (text, charCount, anchors) verified against the
|
|
499
|
+
* wasm runtime, so both engines must produce byte-identical snapshots:
|
|
500
|
+
*
|
|
501
|
+
* - a non-printing character occupying a character slot with no text unit
|
|
502
|
+
* (`bug_1139.pdf` — every text offset shifts by one);
|
|
503
|
+
* - `/ActualText` replacement (`bug_384770169.pdf` — synthetic `kPiece`
|
|
504
|
+
* characters in lockstep with the text, identity map, real segments);
|
|
505
|
+
* - supplementary-plane text via a ToUnicode surrogate pair
|
|
506
|
+
* (`embedpdf_astral_tounicode.pdf` — two lockstep surrogate entries,
|
|
507
|
+
* identity map, astral content SURVIVES extraction).
|
|
508
|
+
*
|
|
509
|
+
* The search probe closes the loop: a hit's `charStart`/`charCount` must be
|
|
510
|
+
* CHARACTER-space (segments join geometry), and slicing the snapshot by the
|
|
511
|
+
* hit's range must reproduce the matched text exactly — the law that makes
|
|
512
|
+
* select-this-match and copy compose.
|
|
513
|
+
*/
|
|
514
|
+
interface TextDivergenceConformanceFixture extends ConformanceFixture {
|
|
515
|
+
/** PDF indirect object number of the probed page. */
|
|
516
|
+
pageObjectNumber: number;
|
|
517
|
+
/** The EXACT extracted text (UTF-16 faithful). */
|
|
518
|
+
exactText: string;
|
|
519
|
+
/** The character-space size (may differ from `exactText.length`). */
|
|
520
|
+
expectedCharCount: number;
|
|
521
|
+
/** Expected anchors; null asserts identity (no `charMap` on the wire). */
|
|
522
|
+
expectedCharMap: ReadonlyArray<CharMapAnchor> | null;
|
|
523
|
+
/** Char-space slice expectations (half-open). */
|
|
524
|
+
slices?: ReadonlyArray<{
|
|
525
|
+
from: number;
|
|
526
|
+
to: number;
|
|
527
|
+
text: string;
|
|
528
|
+
}>;
|
|
529
|
+
/** Literal search probe with expected CHARACTER-space hit range. */
|
|
530
|
+
search?: {
|
|
531
|
+
query: string;
|
|
532
|
+
charStart: number;
|
|
533
|
+
charCount: number;
|
|
534
|
+
matchedText: string;
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
interface TextDivergenceConformanceOptions extends Omit<ConformanceOptions, 'fixture'> {
|
|
538
|
+
fixture: TextDivergenceConformanceFixture;
|
|
539
|
+
}
|
|
540
|
+
declare function runTextDivergenceConformance(runner: ConformanceTestRunner, opts: TextDivergenceConformanceOptions): void;
|
|
541
|
+
/** One divergence case, minus the per-suite bytes/id wiring. */
|
|
542
|
+
type TextDivergenceCase = Omit<TextDivergenceConformanceFixture, 'id' | 'bytes' | 'expected'> & {
|
|
543
|
+
/** Fixture file name under the fork's `testing/resources/`. */
|
|
544
|
+
resource: string;
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* THE pinned divergence cases — one table, consumed by both engines' suites
|
|
548
|
+
* so expected values cannot drift. Values verified against the wasm runtime
|
|
549
|
+
* (see each case). All fixtures are single-page; the page's indirect object
|
|
550
|
+
* number is 3 in each.
|
|
551
|
+
*/
|
|
552
|
+
declare const TEXT_DIVERGENCE_CASES: Readonly<Record<string, TextDivergenceCase>>;
|
|
553
|
+
//#endregion
|
|
492
554
|
//#region src/conformance/runPageGeometryOrientationConformance.d.ts
|
|
493
555
|
/**
|
|
494
556
|
* Per-fixture expectations for the oriented-text geometry harness. One
|
|
@@ -560,5 +622,5 @@ declare function runSearchConformance(runner: ConformanceTestRunner, opts: Searc
|
|
|
560
622
|
declare function diffAnnotationListSnapshot(a: AnnotationListPageSnapshot, b: AnnotationListPageSnapshot): string[];
|
|
561
623
|
declare function diffAnnotationListSnapshotAll(a: AnnotationListSnapshotAllPages, b: AnnotationListSnapshotAllPages): string[];
|
|
562
624
|
//#endregion
|
|
563
|
-
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, diffAnnotationListSnapshot, diffAnnotationListSnapshotAll, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationMutationConformance, runAnnotationReadConformance, runAttachmentConformance, runDocumentEventsConformance, runFormConformance, runMetadataConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageGeometryOrientationConformance, runPageInsertConformance, runPageReorderConformance, runPageRotateConformance, runPageTextConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance };
|
|
625
|
+
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, runPageInsertConformance, runPageReorderConformance, runPageRotateConformance, runPageTextConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance, runTextDivergenceConformance };
|
|
564
626
|
//# sourceMappingURL=conformance.d.cts.map
|
package/dist/conformance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { An as HighlightDraft,
|
|
2
|
-
import { t as Engine } from "./Engine-
|
|
1
|
+
import { An as HighlightDraft, Qc as PdfPoint, Yc as InkList, Zc as LinePoints, el as PdfRect, ms as CharMapAnchor, n as AnnotationListSnapshotAllPages, pl as DocumentMetadata, t as AnnotationListPageSnapshot } from "./AnnotationListSnapshot-CHjkcIaL.js";
|
|
2
|
+
import { t as Engine } from "./Engine-BE6r06QI.js";
|
|
3
3
|
//#region src/conformance/runMetadataConformance.d.ts
|
|
4
4
|
interface ConformanceTestRunner {
|
|
5
5
|
describe(name: string, fn: () => void): void;
|
|
@@ -489,6 +489,68 @@ interface PageTextConformanceOptions extends Omit<ConformanceOptions, 'fixture'>
|
|
|
489
489
|
}
|
|
490
490
|
declare function runPageTextConformance(runner: ConformanceTestRunner, opts: PageTextConformanceOptions): void;
|
|
491
491
|
//#endregion
|
|
492
|
+
//#region src/conformance/runTextDivergenceConformance.d.ts
|
|
493
|
+
/**
|
|
494
|
+
* Index-space divergence conformance: the cases where a page's CHARACTER
|
|
495
|
+
* space (what geometry tiles and selection/search ranges address) and its
|
|
496
|
+
* extracted TEXT differ — and the `charMap` contract that bridges them.
|
|
497
|
+
*
|
|
498
|
+
* Fixtures pin EXACT values (text, charCount, anchors) verified against the
|
|
499
|
+
* wasm runtime, so both engines must produce byte-identical snapshots:
|
|
500
|
+
*
|
|
501
|
+
* - a non-printing character occupying a character slot with no text unit
|
|
502
|
+
* (`bug_1139.pdf` — every text offset shifts by one);
|
|
503
|
+
* - `/ActualText` replacement (`bug_384770169.pdf` — synthetic `kPiece`
|
|
504
|
+
* characters in lockstep with the text, identity map, real segments);
|
|
505
|
+
* - supplementary-plane text via a ToUnicode surrogate pair
|
|
506
|
+
* (`embedpdf_astral_tounicode.pdf` — two lockstep surrogate entries,
|
|
507
|
+
* identity map, astral content SURVIVES extraction).
|
|
508
|
+
*
|
|
509
|
+
* The search probe closes the loop: a hit's `charStart`/`charCount` must be
|
|
510
|
+
* CHARACTER-space (segments join geometry), and slicing the snapshot by the
|
|
511
|
+
* hit's range must reproduce the matched text exactly — the law that makes
|
|
512
|
+
* select-this-match and copy compose.
|
|
513
|
+
*/
|
|
514
|
+
interface TextDivergenceConformanceFixture extends ConformanceFixture {
|
|
515
|
+
/** PDF indirect object number of the probed page. */
|
|
516
|
+
pageObjectNumber: number;
|
|
517
|
+
/** The EXACT extracted text (UTF-16 faithful). */
|
|
518
|
+
exactText: string;
|
|
519
|
+
/** The character-space size (may differ from `exactText.length`). */
|
|
520
|
+
expectedCharCount: number;
|
|
521
|
+
/** Expected anchors; null asserts identity (no `charMap` on the wire). */
|
|
522
|
+
expectedCharMap: ReadonlyArray<CharMapAnchor> | null;
|
|
523
|
+
/** Char-space slice expectations (half-open). */
|
|
524
|
+
slices?: ReadonlyArray<{
|
|
525
|
+
from: number;
|
|
526
|
+
to: number;
|
|
527
|
+
text: string;
|
|
528
|
+
}>;
|
|
529
|
+
/** Literal search probe with expected CHARACTER-space hit range. */
|
|
530
|
+
search?: {
|
|
531
|
+
query: string;
|
|
532
|
+
charStart: number;
|
|
533
|
+
charCount: number;
|
|
534
|
+
matchedText: string;
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
interface TextDivergenceConformanceOptions extends Omit<ConformanceOptions, 'fixture'> {
|
|
538
|
+
fixture: TextDivergenceConformanceFixture;
|
|
539
|
+
}
|
|
540
|
+
declare function runTextDivergenceConformance(runner: ConformanceTestRunner, opts: TextDivergenceConformanceOptions): void;
|
|
541
|
+
/** One divergence case, minus the per-suite bytes/id wiring. */
|
|
542
|
+
type TextDivergenceCase = Omit<TextDivergenceConformanceFixture, 'id' | 'bytes' | 'expected'> & {
|
|
543
|
+
/** Fixture file name under the fork's `testing/resources/`. */
|
|
544
|
+
resource: string;
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* THE pinned divergence cases — one table, consumed by both engines' suites
|
|
548
|
+
* so expected values cannot drift. Values verified against the wasm runtime
|
|
549
|
+
* (see each case). All fixtures are single-page; the page's indirect object
|
|
550
|
+
* number is 3 in each.
|
|
551
|
+
*/
|
|
552
|
+
declare const TEXT_DIVERGENCE_CASES: Readonly<Record<string, TextDivergenceCase>>;
|
|
553
|
+
//#endregion
|
|
492
554
|
//#region src/conformance/runPageGeometryOrientationConformance.d.ts
|
|
493
555
|
/**
|
|
494
556
|
* Per-fixture expectations for the oriented-text geometry harness. One
|
|
@@ -560,5 +622,5 @@ declare function runSearchConformance(runner: ConformanceTestRunner, opts: Searc
|
|
|
560
622
|
declare function diffAnnotationListSnapshot(a: AnnotationListPageSnapshot, b: AnnotationListPageSnapshot): string[];
|
|
561
623
|
declare function diffAnnotationListSnapshotAll(a: AnnotationListSnapshotAllPages, b: AnnotationListSnapshotAllPages): string[];
|
|
562
624
|
//#endregion
|
|
563
|
-
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, diffAnnotationListSnapshot, diffAnnotationListSnapshotAll, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationMutationConformance, runAnnotationReadConformance, runAttachmentConformance, runDocumentEventsConformance, runFormConformance, runMetadataConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageGeometryOrientationConformance, runPageInsertConformance, runPageReorderConformance, runPageRotateConformance, runPageTextConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance };
|
|
625
|
+
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, runPageInsertConformance, runPageReorderConformance, runPageRotateConformance, runPageTextConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance, runTextDivergenceConformance };
|
|
564
626
|
//# sourceMappingURL=conformance.d.ts.map
|