pdf-skryba 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +173 -0
  2. package/LICENSE +661 -661
  3. package/README.md +169 -115
  4. package/THIRD-PARTY.md +134 -134
  5. package/dist/index.js.map +1 -1
  6. package/dist/light.js.map +1 -1
  7. package/dist/types/packages/doc-ir/src/extractor/image-pixel-width.d.ts +1 -1
  8. package/dist/types/packages/doc-ir/src/layout/aligned-grid.d.ts +1 -1
  9. package/dist/types/packages/doc-ir/src/layout/baseline-lines.d.ts +1 -1
  10. package/dist/types/packages/doc-ir/src/layout/cell-text.d.ts +1 -1
  11. package/dist/types/packages/doc-ir/src/layout/column-discriminant.d.ts +1 -1
  12. package/dist/types/packages/doc-ir/src/layout/column-grid.d.ts +1 -1
  13. package/dist/types/packages/doc-ir/src/layout/cut-word.d.ts +2 -2
  14. package/dist/types/packages/doc-ir/src/layout/fragment-cells.d.ts +1 -1
  15. package/dist/types/packages/doc-ir/src/layout/geometry.d.ts +9 -9
  16. package/dist/types/packages/doc-ir/src/layout/gutter.d.ts +1 -1
  17. package/dist/types/packages/doc-ir/src/layout/hyphenation.d.ts +1 -1
  18. package/dist/types/packages/doc-ir/src/layout/intersection-cells.d.ts +1 -1
  19. package/dist/types/packages/doc-ir/src/layout/merged-cells.d.ts +1 -1
  20. package/dist/types/packages/doc-ir/src/layout/page-furniture.d.ts +1 -1
  21. package/dist/types/packages/doc-ir/src/layout/painted-paths.d.ts +1 -1
  22. package/dist/types/packages/doc-ir/src/layout/rect-rules.d.ts +1 -1
  23. package/dist/types/packages/doc-ir/src/layout/text-size.d.ts +1 -1
  24. package/dist/types/packages/doc-ir/src/layout/vector-grid.d.ts +1 -1
  25. package/dist/types/packages/doc-ir/src/lib/ir-walk.d.ts +1 -1
  26. package/dist/types/packages/doc-ir/src/lib/page-labels.d.ts +1 -1
  27. package/dist/types/packages/doc-ir/src/lib/reader-limits.d.ts +1 -1
  28. package/dist/types/packages/doc-ir/src/lib/table-empty-parts.d.ts +1 -1
  29. package/dist/types/packages/doc-ir/src/lib/table-width-cap.d.ts +2 -2
  30. package/dist/types/packages/doc-ir/src/lib/vision-port.d.ts +1 -1
  31. package/dist/types/packages/doc-ir/src/pipeline/detect-language.d.ts +1 -1
  32. package/dist/types/packages/doc-read/src/extractor/glyph-accents.d.ts +1 -1
  33. package/dist/types/packages/doc-read/src/extractor/glyph-double-draw.d.ts +1 -1
  34. package/dist/types/packages/doc-read/src/extractor/glyph-positions.d.ts +3 -3
  35. package/dist/types/packages/doc-read/src/extractor/glyph-runs.d.ts +2 -2
  36. package/dist/types/packages/doc-read/src/extractor/glyph-window.d.ts +1 -1
  37. package/dist/types/packages/doc-read/src/extractor/pdf-aside-figures.d.ts +3 -3
  38. package/dist/types/packages/doc-read/src/extractor/pdf-bands.d.ts +1 -1
  39. package/dist/types/packages/doc-read/src/extractor/pdf-ccitt-images.d.ts +2 -2
  40. package/dist/types/packages/doc-read/src/extractor/pdf-cell-paragraphs.d.ts +2 -2
  41. package/dist/types/packages/doc-read/src/extractor/pdf-column-cut.d.ts +1 -1
  42. package/dist/types/packages/doc-read/src/extractor/pdf-document-info.d.ts +1 -1
  43. package/dist/types/packages/doc-read/src/extractor/pdf-document-scale.d.ts +4 -4
  44. package/dist/types/packages/doc-read/src/extractor/pdf-embedded-images.d.ts +3 -3
  45. package/dist/types/packages/doc-read/src/extractor/pdf-facts.d.ts +2 -2
  46. package/dist/types/packages/doc-read/src/extractor/pdf-flate-images.d.ts +3 -3
  47. package/dist/types/packages/doc-read/src/extractor/pdf-font-bridge.d.ts +1 -1
  48. package/dist/types/packages/doc-read/src/extractor/pdf-font-objects.d.ts +2 -2
  49. package/dist/types/packages/doc-read/src/extractor/pdf-fonts/font-text.d.ts +4 -4
  50. package/dist/types/packages/doc-read/src/extractor/pdf-fonts/widths.d.ts +3 -3
  51. package/dist/types/packages/doc-read/src/extractor/pdf-framed-blocks.d.ts +2 -2
  52. package/dist/types/packages/doc-read/src/extractor/pdf-glyph-source.d.ts +4 -4
  53. package/dist/types/packages/doc-read/src/extractor/pdf-hidden-text.d.ts +1 -1
  54. package/dist/types/packages/doc-read/src/extractor/pdf-image-anchors.d.ts +6 -6
  55. package/dist/types/packages/doc-read/src/extractor/pdf-image-pixels.d.ts +2 -2
  56. package/dist/types/packages/doc-read/src/extractor/pdf-image-refusal.d.ts +3 -3
  57. package/dist/types/packages/doc-read/src/extractor/pdf-image-store.d.ts +2 -2
  58. package/dist/types/packages/doc-read/src/extractor/pdf-images.d.ts +1 -1
  59. package/dist/types/packages/doc-read/src/extractor/pdf-jpeg-images.d.ts +3 -3
  60. package/dist/types/packages/doc-read/src/extractor/pdf-layers.d.ts +1 -1
  61. package/dist/types/packages/doc-read/src/extractor/pdf-letter-spacing.d.ts +2 -2
  62. package/dist/types/packages/doc-read/src/extractor/pdf-line-breaks.d.ts +2 -2
  63. package/dist/types/packages/doc-read/src/extractor/pdf-lines.d.ts +3 -3
  64. package/dist/types/packages/doc-read/src/extractor/pdf-links-ours.d.ts +2 -2
  65. package/dist/types/packages/doc-read/src/extractor/pdf-links.d.ts +3 -3
  66. package/dist/types/packages/doc-read/src/extractor/pdf-model.d.ts +8 -8
  67. package/dist/types/packages/doc-read/src/extractor/pdf-objects/content.d.ts +1 -1
  68. package/dist/types/packages/doc-read/src/extractor/pdf-objects/document.d.ts +1 -1
  69. package/dist/types/packages/doc-read/src/extractor/pdf-objects/parse.d.ts +1 -1
  70. package/dist/types/packages/doc-read/src/extractor/pdf-objects/refusal.d.ts +1 -1
  71. package/dist/types/packages/doc-read/src/extractor/pdf-objects/streams.d.ts +1 -1
  72. package/dist/types/packages/doc-read/src/extractor/pdf-objects/xref.d.ts +1 -1
  73. package/dist/types/packages/doc-read/src/extractor/pdf-objstm-source.d.ts +2 -2
  74. package/dist/types/packages/doc-read/src/extractor/pdf-open.d.ts +4 -4
  75. package/dist/types/packages/doc-read/src/extractor/pdf-ops-ours.d.ts +3 -3
  76. package/dist/types/packages/doc-read/src/extractor/pdf-ops.d.ts +1 -1
  77. package/dist/types/packages/doc-read/src/extractor/pdf-outline.d.ts +1 -1
  78. package/dist/types/packages/doc-read/src/extractor/pdf-page-content.d.ts +3 -3
  79. package/dist/types/packages/doc-read/src/extractor/pdf-page-figures.d.ts +7 -7
  80. package/dist/types/packages/doc-read/src/extractor/pdf-page-markers.d.ts +5 -5
  81. package/dist/types/packages/doc-read/src/extractor/pdf-page-plan.d.ts +4 -4
  82. package/dist/types/packages/doc-read/src/extractor/pdf-page-stages.d.ts +13 -13
  83. package/dist/types/packages/doc-read/src/extractor/pdf-page-tables.d.ts +7 -7
  84. package/dist/types/packages/doc-read/src/extractor/pdf-page-tabs.d.ts +3 -3
  85. package/dist/types/packages/doc-read/src/extractor/pdf-paragraphs.d.ts +3 -3
  86. package/dist/types/packages/doc-read/src/extractor/pdf-paths-ours.d.ts +2 -2
  87. package/dist/types/packages/doc-read/src/extractor/pdf-reading-order.d.ts +2 -2
  88. package/dist/types/packages/doc-read/src/extractor/pdf-reference-ours.d.ts +2 -2
  89. package/dist/types/packages/doc-read/src/extractor/pdf-region-order.d.ts +3 -3
  90. package/dist/types/packages/doc-read/src/extractor/pdf-rotated-lines.d.ts +1 -1
  91. package/dist/types/packages/doc-read/src/extractor/pdf-rotated-words.d.ts +1 -1
  92. package/dist/types/packages/doc-read/src/extractor/pdf-row-url-join.d.ts +1 -1
  93. package/dist/types/packages/doc-read/src/extractor/pdf-scanned.d.ts +8 -8
  94. package/dist/types/packages/doc-read/src/extractor/pdf-smask.d.ts +2 -2
  95. package/dist/types/packages/doc-read/src/extractor/pdf-source.d.ts +13 -13
  96. package/dist/types/packages/doc-read/src/extractor/pdf-stencil-images.d.ts +3 -3
  97. package/dist/types/packages/doc-read/src/extractor/pdf-structure.d.ts +1 -1
  98. package/dist/types/packages/doc-read/src/extractor/pdf-symbol-page.d.ts +2 -2
  99. package/dist/types/packages/doc-read/src/extractor/pdf-symbol-verdict.d.ts +1 -1
  100. package/dist/types/packages/doc-read/src/extractor/pdf-table-detector.d.ts +7 -7
  101. package/dist/types/packages/doc-read/src/extractor/pdf-table-render.d.ts +3 -3
  102. package/dist/types/packages/doc-read/src/extractor/pdf.d.ts +14 -14
  103. package/dist/types/packages/doc-read/src/lib/pdf-light.d.ts +15 -15
  104. package/dist/types/packages/doc-read/src/lib/pdf.d.ts +5 -5
  105. package/dist/types/packages/doc-read/src/lib/reader-options.d.ts +3 -3
  106. package/dist/types/packages/doc-read/src/pipeline/cut-paragraph-repair.d.ts +1 -1
  107. package/dist/types/packages/doc-read/src/pipeline/glued-word-repair.d.ts +1 -1
  108. package/dist/types/packages/doc-read/src/pipeline/lost-text-repair.d.ts +1 -1
  109. package/dist/types/packages/doc-read/src/pipeline/pdf-conservation-source.d.ts +1 -1
  110. package/package.json +7 -6
@@ -1,4 +1,4 @@
1
- import type { CellAssignment, Fragment, MergeMap, TableGrid } from "./geometry-types";
1
+ import type { CellAssignment, Fragment, MergeMap, TableGrid } from "./geometry-types.js";
2
2
  export declare function groupFragmentsIntoVisualLines(fragments: readonly Fragment[]): Fragment[][];
3
3
  export declare function groupFragmentsIntoRowBands(fragments: readonly Fragment[], rowBoundaries: readonly number[]): Fragment[][];
4
4
  export declare function assignFragmentsToCells<T extends Fragment>(fragments: readonly T[], grid: TableGrid, merge?: MergeMap): CellAssignment<T>;
@@ -1,9 +1,9 @@
1
- export type { CellRect, ClassifiedLine, Fragment, LineSegment, MergedCell, MergeMap, Matrix2D, PdfTableDetection, PdfTableOrigin, TableGrid, } from "./geometry-types";
2
- export { clusterPositions } from "./position-clusters";
3
- export { applyMatrix, classifyLineSegment, composeMatrix, IDENTITY_MATRIX, positionKey, subpathsToSegments, translateMatrix, } from "./painted-paths";
4
- export { buildGridFromVectorLines, buildGridsFromVectorLines, withoutImageFrames } from "./vector-grid";
5
- export { findCellsByIntersection, isBoxesInVoidsRegion } from "./intersection-cells";
6
- export { buildGridFromAlignedRows, detectAlignedColumns, hasWeakTabularitySignal, identifyAlignedTableLines, } from "./aligned-grid";
7
- export { assignFragmentsToCells, groupFragmentsIntoRowBands, groupFragmentsIntoVisualLines } from "./fragment-cells";
8
- export { dominantTextSize } from "./text-size";
9
- export { detectColumnGutter, hasRepeatedSecondRhythm, looksLikeTextColumns, verticalRhythm, } from "./column-discriminant";
1
+ export type { CellRect, ClassifiedLine, Fragment, LineSegment, MergedCell, MergeMap, Matrix2D, PdfTableDetection, PdfTableOrigin, TableGrid, } from "./geometry-types.js";
2
+ export { clusterPositions } from "./position-clusters.js";
3
+ export { applyMatrix, classifyLineSegment, composeMatrix, IDENTITY_MATRIX, positionKey, subpathsToSegments, translateMatrix, } from "./painted-paths.js";
4
+ export { buildGridFromVectorLines, buildGridsFromVectorLines, withoutImageFrames } from "./vector-grid.js";
5
+ export { findCellsByIntersection, isBoxesInVoidsRegion } from "./intersection-cells.js";
6
+ export { buildGridFromAlignedRows, detectAlignedColumns, hasWeakTabularitySignal, identifyAlignedTableLines, } from "./aligned-grid.js";
7
+ export { assignFragmentsToCells, groupFragmentsIntoRowBands, groupFragmentsIntoVisualLines } from "./fragment-cells.js";
8
+ export { dominantTextSize } from "./text-size.js";
9
+ export { detectColumnGutter, hasRepeatedSecondRhythm, looksLikeTextColumns, verticalRhythm, } from "./column-discriminant.js";
@@ -1,4 +1,4 @@
1
- import { type BandFragment } from "./column-discriminant";
1
+ import { type BandFragment } from "./column-discriminant.js";
2
2
  export type GutterItem = BandFragment;
3
3
  export declare const MIN_COLUMN_PT = 40;
4
4
  export interface Gutter {
@@ -1,2 +1,2 @@
1
- import type { PageLanguage } from "../lib/reader-types";
1
+ import type { PageLanguage } from "../lib/reader-types.js";
2
2
  export declare const legalCutOf: (lang: PageLanguage) => ((left: string, right: string) => boolean);
@@ -1,3 +1,3 @@
1
- import type { CellRect, ClassifiedLine, TableGrid } from "./geometry-types";
1
+ import type { CellRect, ClassifiedLine, TableGrid } from "./geometry-types.js";
2
2
  export declare function findCellsByIntersection(lines: readonly ClassifiedLine[]): CellRect[];
3
3
  export declare function isBoxesInVoidsRegion(grid: TableGrid, cells: readonly CellRect[]): boolean;
@@ -1,4 +1,4 @@
1
- import { type ClassifiedLine, type MergeMap, type TableGrid } from "./geometry";
1
+ import { type ClassifiedLine, type MergeMap, type TableGrid } from "./geometry.js";
2
2
  export declare function detectColumnSpans(lines: readonly ClassifiedLine[], grid: TableGrid): number[][];
3
3
  export declare function detectMergedCells(lines: readonly ClassifiedLine[], grid: TableGrid): MergeMap;
4
4
  export declare function buildMergeMap(grid: TableGrid, columnSpans: readonly (readonly number[])[], rowMerges?: readonly (readonly boolean[])[]): MergeMap;
@@ -1,4 +1,4 @@
1
- import { type GridBand } from "./grid-band";
1
+ import { type GridBand } from "./grid-band.js";
2
2
  export interface PageLine {
3
3
  y: number;
4
4
  x: number;
@@ -1,4 +1,4 @@
1
- import type { ClassifiedLine, LineSegment, Matrix2D } from "./geometry-types";
1
+ import type { ClassifiedLine, LineSegment, Matrix2D } from "./geometry-types.js";
2
2
  export declare const IDENTITY_MATRIX: Matrix2D;
3
3
  export declare const translateMatrix: (e: number, f: number) => Matrix2D;
4
4
  export declare function composeMatrix(newM: Matrix2D, old: Matrix2D): Matrix2D;
@@ -1,4 +1,4 @@
1
- import type { Rect } from "./rect";
1
+ import type { Rect } from "./rect.js";
2
2
  export type Degenerate = "raw" | "normalize";
3
3
  type ContainEdges = "inclusive" | "smaller-on-one-axis" | "not-identical";
4
4
  export type RectRule = {
@@ -1,2 +1,2 @@
1
- import type { Fragment } from "./geometry-types";
1
+ import type { Fragment } from "./geometry-types.js";
2
2
  export declare function dominantTextSize(fragments: readonly Fragment[]): number | undefined;
@@ -1,4 +1,4 @@
1
- import type { ClassifiedLine, TableGrid } from "./geometry-types";
1
+ import type { ClassifiedLine, TableGrid } from "./geometry-types.js";
2
2
  export declare function buildGridFromVectorLines(lines: readonly ClassifiedLine[]): TableGrid | undefined;
3
3
  export declare const MAX_MERGED_VERTICALS_PER_PAGE = 2000;
4
4
  export declare function buildGridsFromVectorLines(lines: readonly ClassifiedLine[]): TableGrid[];
@@ -1,4 +1,4 @@
1
- import type { Inline, IRBlock } from "./ir";
1
+ import type { Inline, IRBlock } from "./ir.js";
2
2
  export declare function walkBlocks(blocks: readonly IRBlock[], visit: (block: IRBlock) => boolean | void): void;
3
3
  export declare function walkInlineRuns(blocks: readonly IRBlock[], visit: (run: readonly Inline[]) => void): void;
4
4
  export declare function walkInlines(blocks: readonly IRBlock[], visit: (inline: Inline) => void): void;
@@ -1,4 +1,4 @@
1
- import type { PageLanguage } from "./reader-types";
1
+ import type { PageLanguage } from "./reader-types.js";
2
2
  export interface PageLabels {
3
3
  slideTabTitle: (number: number) => string;
4
4
  pdfPageTabTitle: (number: number) => string;
@@ -1,4 +1,4 @@
1
- import type { DocumentNotice } from "./reader-types";
1
+ import type { DocumentNotice } from "./reader-types.js";
2
2
  export declare const NO_CAP: number;
3
3
  export declare const MAX_PAYLOAD_BYTES = 50000000;
4
4
  export declare const MAX_NOTICE_SHEET_NAMES = 5;
@@ -1,4 +1,4 @@
1
- import type { IRBlock } from "./ir";
1
+ import type { IRBlock } from "./ir.js";
2
2
  type TableBlock = Extract<IRBlock, {
3
3
  kind: "table";
4
4
  }>;
@@ -1,5 +1,5 @@
1
- import type { IRBlock } from "./ir";
2
- import { type ReaderLimits } from "./reader-limits";
1
+ import type { IRBlock } from "./ir.js";
2
+ import { type ReaderLimits } from "./reader-limits.js";
3
3
  export declare const tableExceedsCaps: (gridWidth: number, rows: number, limits?: ReaderLimits) => boolean;
4
4
  export declare const withholdOversizedTables: (blocks: readonly IRBlock[], recordRemoval?: (text: string) => void, limits?: ReaderLimits) => {
5
5
  blocks: IRBlock[];
@@ -1,4 +1,4 @@
1
- import type { TableData } from "./ir";
1
+ import type { TableData } from "./ir.js";
2
2
  export interface BinaryRef {
3
3
  bytes: Uint8Array;
4
4
  mimeType: string;
@@ -1,4 +1,4 @@
1
- import { type IRDoc } from "../lib/ir";
1
+ import { type IRDoc } from "../lib/ir.js";
2
2
  export declare const MIN_SAMPLE_CHARS = 200;
3
3
  export declare const MIN_ALPHA_TOKENS = 40;
4
4
  export declare const MIN_MARGIN_FACTOR = 1.5;
@@ -1,4 +1,4 @@
1
- import type { GlyphFragment } from "./glyph-positions";
1
+ import type { GlyphFragment } from "./glyph-positions.js";
2
2
  export declare const CENTRE_EM = 0.1;
3
3
  export declare const RAISE_EM = 0.5;
4
4
  export declare function composeAccents(glyphs: readonly GlyphFragment[]): GlyphFragment[];
@@ -1,2 +1,2 @@
1
- import type { GlyphFragment } from "./glyph-positions";
1
+ import type { GlyphFragment } from "./glyph-positions.js";
2
2
  export declare function dropDoubleDraws(glyphs: GlyphFragment[]): GlyphFragment[];
@@ -1,6 +1,6 @@
1
- import { ReaderError } from "../../../doc-ir/src/lib/reader-error";
2
- import { type Matrix2D } from "../../../doc-ir/src/layout/geometry";
3
- import { GRAPHICS_STATE_MAX_DEPTH, type PdfOp } from "./pdf-ops";
1
+ import { ReaderError } from "../../../doc-ir/src/lib/reader-error.js";
2
+ import { type Matrix2D } from "../../../doc-ir/src/layout/geometry.js";
3
+ import { GRAPHICS_STATE_MAX_DEPTH, type PdfOp } from "./pdf-ops.js";
4
4
  export { GRAPHICS_STATE_MAX_DEPTH };
5
5
  export type NamedOp = PdfOp;
6
6
  export type GlyphAbstentionTag = "vertical-writing" | "text-operator";
@@ -1,5 +1,5 @@
1
- import { type FontScaleOf, type GlyphFragment, type HidePolicy, type NamedOp, type SymbolFontOf } from "./glyph-positions";
2
- import type { PdfTextRun } from "./pdf-source";
1
+ import { type FontScaleOf, type GlyphFragment, type HidePolicy, type NamedOp, type SymbolFontOf } from "./glyph-positions.js";
2
+ import type { PdfTextRun } from "./pdf-source.js";
3
3
  export interface GlyphRunOptions {
4
4
  pageObjId?: string | undefined;
5
5
  view?: readonly [number, number, number, number] | undefined;
@@ -1,4 +1,4 @@
1
- import type { GlyphFragment } from "./glyph-positions";
1
+ import type { GlyphFragment } from "./glyph-positions.js";
2
2
  export interface GlyphWindowOptions {
3
3
  readonly anchor: "centre" | "start";
4
4
  readonly leftSlackEm: number;
@@ -1,6 +1,6 @@
1
- import type { IRBlock } from "../../../doc-ir/src/lib/ir";
2
- import type { ImageAnchor, PageRegion } from "./pdf-model";
3
- import type { PdfTextRun } from "./pdf-source";
1
+ import type { IRBlock } from "../../../doc-ir/src/lib/ir.js";
2
+ import type { ImageAnchor, PageRegion } from "./pdf-model.js";
3
+ import type { PdfTextRun } from "./pdf-source.js";
4
4
  export interface AsideFigure {
5
5
  readonly anchor: ImageAnchor;
6
6
  readonly lines: readonly PdfTextRun[][];
@@ -1,4 +1,4 @@
1
- import type { PositionedItem } from "./pdf-model";
1
+ import type { PositionedItem } from "./pdf-model.js";
2
2
  export interface BandedSplit<T> {
3
3
  above: T[][];
4
4
  left: T[][];
@@ -1,5 +1,5 @@
1
- import { type PdfObjectsDocument } from "./pdf-objects/document";
2
- import { type PictureScope } from "./pdf-image-pixels";
1
+ import { type PdfObjectsDocument } from "./pdf-objects/document.js";
2
+ import { type PictureScope } from "./pdf-image-pixels.js";
3
3
  export interface DecodedImageObject {
4
4
  readonly ref: string | undefined;
5
5
  readonly width: number;
@@ -1,5 +1,5 @@
1
- import type { CellLine } from "../../../doc-ir/src/layout/cell-text";
2
- import type { Fragment } from "../../../doc-ir/src/layout/geometry";
1
+ import type { CellLine } from "../../../doc-ir/src/layout/cell-text.js";
2
+ import type { Fragment } from "../../../doc-ir/src/layout/geometry.js";
3
3
  export declare const isNumberAlone: (text: string) => boolean;
4
4
  export declare const wouldFabricateNumber: (previous: string, next: string) => boolean;
5
5
  export declare const joinCellLines: (lines: readonly CellLine[], marginRight: number) => CellLine[];
@@ -1,4 +1,4 @@
1
- import type { PdfTextRun } from "./pdf-source";
1
+ import type { PdfTextRun } from "./pdf-source.js";
2
2
  export interface ColumnCut {
3
3
  cut: number;
4
4
  above?: number;
@@ -1,4 +1,4 @@
1
- import type { PdfObjectsDocument } from "./pdf-objects/document";
1
+ import type { PdfObjectsDocument } from "./pdf-objects/document.js";
2
2
  export interface OurDocumentInfo {
3
3
  producer?: string;
4
4
  creator?: string;
@@ -1,7 +1,7 @@
1
- import type { PaintedBox } from "../../../doc-ir/src/layout/hidden-repaints";
2
- import { type HeadingLevel } from "../../../doc-ir/src/layout/heading-sizes";
3
- import { type GridBand } from "../../../doc-ir/src/layout/grid-band";
4
- import type { PdfTextRun } from "./pdf-source";
1
+ import type { PaintedBox } from "../../../doc-ir/src/layout/hidden-repaints.js";
2
+ import { type HeadingLevel } from "../../../doc-ir/src/layout/heading-sizes.js";
3
+ import { type GridBand } from "../../../doc-ir/src/layout/grid-band.js";
4
+ import type { PdfTextRun } from "./pdf-source.js";
5
5
  export type { GridBand };
6
6
  export interface DocumentScale {
7
7
  headingLevelOf: (size: number) => HeadingLevel | undefined;
@@ -1,6 +1,6 @@
1
- import { unfilterPngRows } from "../../../doc-ir/src/extractor/png-decode";
2
- import { type PdfObjectsDocument } from "./pdf-objects/document";
3
- import { MAX_EMBEDDED_IMAGE_PIXELS } from "./pdf-image-pixels";
1
+ import { unfilterPngRows } from "../../../doc-ir/src/extractor/png-decode.js";
2
+ import { type PdfObjectsDocument } from "./pdf-objects/document.js";
3
+ import { MAX_EMBEDDED_IMAGE_PIXELS } from "./pdf-image-pixels.js";
4
4
  export { MAX_EMBEDDED_IMAGE_PIXELS };
5
5
  export interface EmbeddedImage {
6
6
  bytes: Uint8Array;
@@ -1,5 +1,5 @@
1
- import type { PdfToolLabel } from "../../../doc-ir/src/lib/reader-types";
2
- import type { PdfSource } from "./pdf-source";
1
+ import type { PdfToolLabel } from "../../../doc-ir/src/lib/reader-types.js";
2
+ import type { PdfSource } from "./pdf-source.js";
3
3
  export interface PdfDocumentFacts {
4
4
  pages: number;
5
5
  producer?: string;
@@ -1,6 +1,6 @@
1
- import type { PdfObjectsDocument } from "./pdf-objects/document";
2
- import type { PictureScope } from "./pdf-image-pixels";
3
- import type { DecodedImageObject } from "./pdf-ccitt-images";
1
+ import type { PdfObjectsDocument } from "./pdf-objects/document.js";
2
+ import type { PictureScope } from "./pdf-image-pixels.js";
3
+ import type { DecodedImageObject } from "./pdf-ccitt-images.js";
4
4
  export declare function flateImageObjectOf(doc: PdfObjectsDocument, scope: PictureScope, name: string, kinds: {
5
5
  rgb: number;
6
6
  rgba: number;
@@ -1,4 +1,4 @@
1
- import { type ContentOp } from "./pdf-objects/content";
1
+ import { type ContentOp } from "./pdf-objects/content.js";
2
2
  export declare const SCOPE_SEPARATOR = "\0";
3
3
  export type ResolvedForm = {
4
4
  readonly scope: string;
@@ -1,5 +1,5 @@
1
- import type { PdfObjectsDocument } from "./pdf-objects/document";
2
- import type { PdfDict } from "./pdf-objects/objects";
1
+ import type { PdfObjectsDocument } from "./pdf-objects/document.js";
2
+ import type { PdfDict } from "./pdf-objects/objects.js";
3
3
  export interface OurFontObject {
4
4
  readonly weight: "bold" | "normal" | "unknown";
5
5
  readonly italic?: boolean;
@@ -1,7 +1,7 @@
1
- import type { PdfDict, PdfStream, PdfValue } from "../pdf-objects/objects";
2
- import { encodingNames } from "./names";
3
- import { type TableBudget } from "./table-budget";
4
- import { type ToUnicode } from "./to-unicode";
1
+ import type { PdfDict, PdfStream, PdfValue } from "../pdf-objects/objects.js";
2
+ import { encodingNames } from "./names.js";
3
+ import { type TableBudget } from "./table-budget.js";
4
+ import { type ToUnicode } from "./to-unicode.js";
5
5
  export interface FontReader {
6
6
  resolve(value: PdfValue | undefined): PdfValue | undefined;
7
7
  dictOf(value: PdfValue | undefined): PdfDict | undefined;
@@ -1,4 +1,4 @@
1
- import type { PdfDict } from "../pdf-objects/objects";
2
- import { type FontReader } from "./font-text";
3
- import { type TableBudget } from "./table-budget";
1
+ import type { PdfDict } from "../pdf-objects/objects.js";
2
+ import { type FontReader } from "./font-text.js";
3
+ import { type TableBudget } from "./table-budget.js";
4
4
  export declare function fontWidths(reader: FontReader, font: PdfDict, budget?: TableBudget): (code: number) => number | undefined;
@@ -1,5 +1,5 @@
1
- import type { ContainerBox } from "./pdf-line-breaks";
2
- import type { PdfTextRun } from "./pdf-source";
1
+ import type { ContainerBox } from "./pdf-line-breaks.js";
2
+ import type { PdfTextRun } from "./pdf-source.js";
3
3
  export type FramedBlocks = "flat" | "nested" | "below";
4
4
  export declare const DEFAULT_FRAMED_BLOCKS: FramedBlocks;
5
5
  export declare const MAX_FRAME_OVERHANG_PT = 2;
@@ -1,7 +1,7 @@
1
- import { type PdfObjectsDocument } from "./pdf-objects/document";
2
- import type { PdfDict } from "./pdf-objects/objects";
3
- import { type FontTextMemo } from "./pdf-fonts/font-text";
4
- import type { TableBudget } from "./pdf-fonts/table-budget";
1
+ import { type PdfObjectsDocument } from "./pdf-objects/document.js";
2
+ import type { PdfDict } from "./pdf-objects/objects.js";
3
+ import { type FontTextMemo } from "./pdf-fonts/font-text.js";
4
+ import type { TableBudget } from "./pdf-fonts/table-budget.js";
5
5
  export interface OurGlyph {
6
6
  readonly unicode: string | undefined;
7
7
  readonly width: number | undefined;
@@ -1,4 +1,4 @@
1
- import type { GlyphFragment } from "./glyph-positions";
1
+ import type { GlyphFragment } from "./glyph-positions.js";
2
2
  export declare const MAX_FILTERED_GLYPHS = 100000;
3
3
  export declare function countShownGlyphs(ops: readonly {
4
4
  op: string;
@@ -1,9 +1,9 @@
1
- import type { IRBlock } from "../../../doc-ir/src/lib/ir";
2
- import { type FramedBlocks } from "./pdf-framed-blocks";
3
- import type { ContainerBox } from "./pdf-line-breaks";
4
- import type { ImageAnchor, ImageCandidate, PageRegion } from "./pdf-model";
5
- import type { PagePlanReader } from "./pdf-page-plan";
6
- import type { PdfTextRun } from "./pdf-source";
1
+ import type { IRBlock } from "../../../doc-ir/src/lib/ir.js";
2
+ import { type FramedBlocks } from "./pdf-framed-blocks.js";
3
+ import type { ContainerBox } from "./pdf-line-breaks.js";
4
+ import type { ImageAnchor, ImageCandidate, PageRegion } from "./pdf-model.js";
5
+ import type { PagePlanReader } from "./pdf-page-plan.js";
6
+ import type { PdfTextRun } from "./pdf-source.js";
7
7
  export declare function placeImages(candidates: readonly ImageCandidate[]): ImageAnchor[];
8
8
  export declare const imageRegion: (a: ImageAnchor) => PageRegion;
9
9
  export declare function interleaveImages(items: readonly PdfTextRun[], anchors: readonly ImageAnchor[], prose: (items: PdfTextRun[]) => IRBlock[], extra?: readonly PageRegion[]): IRBlock[];
@@ -1,5 +1,5 @@
1
- import type { PdfObjectsDocument } from "./pdf-objects/document";
2
- import { type PdfDict, type PdfValue } from "./pdf-objects/objects";
1
+ import type { PdfObjectsDocument } from "./pdf-objects/document.js";
2
+ import { type PdfDict, type PdfValue } from "./pdf-objects/objects.js";
3
3
  export declare const nameOf: (value: PdfValue | undefined) => string | undefined;
4
4
  export declare const numberOf: (value: PdfValue | undefined) => number | undefined;
5
5
  export declare const entryOf: (doc: PdfObjectsDocument, dict: PdfDict, key: string) => PdfValue | undefined;
@@ -1,4 +1,4 @@
1
- import type { PictureRefusal } from "../../../doc-ir/src/lib/reader-types";
2
- import { type PdfObjectsDocument } from "./pdf-objects/document";
3
- import type { PdfDict } from "./pdf-objects/objects";
1
+ import type { PictureRefusal } from "../../../doc-ir/src/lib/reader-types.js";
2
+ import { type PdfObjectsDocument } from "./pdf-objects/document.js";
3
+ import type { PdfDict } from "./pdf-objects/objects.js";
4
4
  export declare function pictureRefusalOf(doc: PdfObjectsDocument, dict: PdfDict): PictureRefusal;
@@ -1,5 +1,5 @@
1
- import type { ImageRef } from "../../../doc-ir/src/lib/ir";
2
- import type { RawImage } from "../../../doc-ir/src/extractor/raw-image";
1
+ import type { ImageRef } from "../../../doc-ir/src/lib/ir.js";
2
+ import type { RawImage } from "../../../doc-ir/src/extractor/raw-image.js";
3
3
  export interface ImageStore {
4
4
  collect: (bytes: Uint8Array, mimeType: string) => ImageRef;
5
5
  keep: (image: RawImage) => void;
@@ -1,4 +1,4 @@
1
- import type { PixelFormat } from "../../../doc-ir/src/extractor/png";
1
+ import type { PixelFormat } from "../../../doc-ir/src/extractor/png.js";
2
2
  export type { PixelFormat };
3
3
  export interface PdfImageData {
4
4
  width: number;
@@ -1,6 +1,6 @@
1
- import type { PdfObjectsDocument } from "./pdf-objects/document";
2
- import type { PictureScope } from "./pdf-image-pixels";
3
- import type { DecodedImageObject } from "./pdf-ccitt-images";
1
+ import type { PdfObjectsDocument } from "./pdf-objects/document.js";
2
+ import type { PictureScope } from "./pdf-image-pixels.js";
3
+ import type { DecodedImageObject } from "./pdf-ccitt-images.js";
4
4
  export declare function jpegImageObjectOf(doc: PdfObjectsDocument, scope: PictureScope, name: string, kinds: {
5
5
  rgb: number;
6
6
  rgba: number;
@@ -1,4 +1,4 @@
1
- import type { PdfObjectsDocument } from "./pdf-objects/document";
1
+ import type { PdfObjectsDocument } from "./pdf-objects/document.js";
2
2
  export interface LayerGroup {
3
3
  readonly type?: string;
4
4
  readonly id?: string | null;
@@ -1,4 +1,4 @@
1
- import type { GlyphFragment } from "./glyph-positions";
2
- import type { PdfTextRun } from "./pdf-source";
1
+ import type { GlyphFragment } from "./glyph-positions.js";
2
+ import type { PdfTextRun } from "./pdf-source.js";
3
3
  export declare const respacedText: (run: PdfTextRun, glyphs: readonly GlyphFragment[]) => string | undefined;
4
4
  export declare const respaceLetterSpacedRuns: (runs: readonly PdfTextRun[], glyphs: readonly GlyphFragment[], onRespaced?: (copy: PdfTextRun, source: PdfTextRun) => void) => PdfTextRun[];
@@ -1,5 +1,5 @@
1
- import type { GlyphFragment } from "./glyph-positions";
2
- import type { Line } from "./pdf-model";
1
+ import type { GlyphFragment } from "./glyph-positions.js";
2
+ import type { Line } from "./pdf-model.js";
3
3
  export declare const firstWordWidthReader: (glyphs: readonly GlyphFragment[]) => (y: number, left?: number) => number;
4
4
  export declare const isDeliberateBreak: (line: Line, next: Line, marginRight: number) => boolean;
5
5
  export declare const isCentredPair: (line: Line, next: Line) => boolean;
@@ -1,6 +1,6 @@
1
- import type { ImageRef } from "../../../doc-ir/src/lib/ir";
2
- import { SAME_LINE_TOLERANCE } from "../../../doc-ir/src/layout/baseline-lines";
3
- import type { Line, PositionedItem } from "./pdf-model";
1
+ import type { ImageRef } from "../../../doc-ir/src/lib/ir.js";
2
+ import { SAME_LINE_TOLERANCE } from "../../../doc-ir/src/layout/baseline-lines.js";
3
+ import type { Line, PositionedItem } from "./pdf-model.js";
4
4
  export { SAME_LINE_TOLERANCE };
5
5
  export declare const separatorBefore: (group: readonly PositionedItem[], i: number) => string;
6
6
  export declare const groupItemsIntoLines: <T extends PositionedItem>(pageItems: readonly T[]) => T[][];
@@ -1,4 +1,4 @@
1
- import type { PdfObjectsDocument, PdfPageEntry } from "./pdf-objects/document";
2
- import type { PdfLinkAnnotation } from "./pdf-source";
1
+ import type { PdfObjectsDocument, PdfPageEntry } from "./pdf-objects/document.js";
2
+ import type { PdfLinkAnnotation } from "./pdf-source.js";
3
3
  export declare function absoluteTargetOf(raw: string): string | undefined;
4
4
  export declare function linkAnnotationsOfPage(doc: PdfObjectsDocument, page: PdfPageEntry): PdfLinkAnnotation[];
@@ -1,6 +1,6 @@
1
- import type { GlyphFragment } from "./glyph-positions";
2
- import type { PdfLinkSpan } from "./pdf-model";
3
- import type { PdfLinkAnnotation, PdfTextRun } from "./pdf-source";
1
+ import type { GlyphFragment } from "./glyph-positions.js";
2
+ import type { PdfLinkSpan } from "./pdf-model.js";
3
+ import type { PdfLinkAnnotation, PdfTextRun } from "./pdf-source.js";
4
4
  export declare const PDF_MAX_LINKS_PER_PAGE = 500;
5
5
  export declare const fillBetween: (text: string, linkAt: (number | undefined)[], targetOf: (link: number) => string) => void;
6
6
  export declare const linkSpansOfPage: <T extends PdfTextRun>(runs: readonly T[], glyphs: readonly GlyphFragment[], annotations: readonly PdfLinkAnnotation[]) => Map<T, PdfLinkSpan[]>;
@@ -1,11 +1,11 @@
1
- import type { ImageRef, IRBlock } from "../../../doc-ir/src/lib/ir";
2
- import type { DocumentNotice, PdfTextUnreadReason, PictureRefusal } from "../../../doc-ir/src/lib/reader-types";
3
- import type { PdfTableDetection } from "../../../doc-ir/src/layout/geometry";
4
- import type { RawImage } from "../../../doc-ir/src/extractor/raw-image";
5
- import type { ExtractionCost } from "./extraction-cost";
6
- import type { Fragment } from "../../../doc-ir/src/layout/geometry";
7
- import type { PdfDocumentFacts } from "./pdf-facts";
8
- import type { PdfReferenceCycle, PdfTextRun } from "./pdf-source";
1
+ import type { ImageRef, IRBlock } from "../../../doc-ir/src/lib/ir.js";
2
+ import type { DocumentNotice, PdfTextUnreadReason, PictureRefusal } from "../../../doc-ir/src/lib/reader-types.js";
3
+ import type { PdfTableDetection } from "../../../doc-ir/src/layout/geometry.js";
4
+ import type { RawImage } from "../../../doc-ir/src/extractor/raw-image.js";
5
+ import type { ExtractionCost } from "./extraction-cost.js";
6
+ import type { Fragment } from "../../../doc-ir/src/layout/geometry.js";
7
+ import type { PdfDocumentFacts } from "./pdf-facts.js";
8
+ import type { PdfReferenceCycle, PdfTextRun } from "./pdf-source.js";
9
9
  export declare const toFragment: (r: PdfTextRun) => Fragment;
10
10
  export type PositionedItem = {
11
11
  text: string;
@@ -1,4 +1,4 @@
1
- import type { PdfValue } from "./objects";
1
+ import type { PdfValue } from "./objects.js";
2
2
  export interface ContentOp {
3
3
  readonly op: string;
4
4
  readonly operands: readonly PdfValue[];
@@ -1,4 +1,4 @@
1
- import type { PdfDict, PdfRef, PdfStream, PdfValue } from "./objects";
1
+ import type { PdfDict, PdfRef, PdfStream, PdfValue } from "./objects.js";
2
2
  export interface PdfPageEntry {
3
3
  readonly ref: PdfRef;
4
4
  readonly dict: PdfDict;
@@ -1,4 +1,4 @@
1
- import type { PdfRef, PdfValue } from "./objects";
1
+ import type { PdfRef, PdfValue } from "./objects.js";
2
2
  export type ResolveLength = (ref: PdfRef) => number | undefined;
3
3
  export interface ParsedValue {
4
4
  readonly value: PdfValue;
@@ -1,4 +1,4 @@
1
- import { ReaderError } from "../../../../doc-ir/src/lib/reader-error";
1
+ import { ReaderError } from "../../../../doc-ir/src/lib/reader-error.js";
2
2
  export type PdfObjectsRefusalReason = "syntax" | "truncated" | "nesting-too-deep" | "token-too-long" | "string-too-long" | "stream-length" | "stream-end" | "length-unresolved" | "startxref-missing" | "xref-offset" | "xref-syntax" | "xref-chain" | "xref-too-large" | "filter-unsupported" | "predictor" | "stream-decode" | "object-stream" | "xref-stream" | "xref-stale" | "ref-hops" | "page-tree" | "page-box" | "content-syntax" | "content-operands" | "content-too-long" | "inline-image" | "encrypted" | "to-unicode" | "value-too-large" | "document-too-large" | "glyphs-too-many" | "forms-too-many" | "font-tables-too-many" | "page-missing";
3
3
  export declare class PdfObjectsRefusal extends ReaderError {
4
4
  readonly reason: PdfObjectsRefusalReason;
@@ -1,4 +1,4 @@
1
- import type { PdfDict, PdfStream, PdfValue } from "./objects";
1
+ import type { PdfDict, PdfStream, PdfValue } from "./objects.js";
2
2
  export type DecodeStream = (bytes: Uint8Array, stream: PdfStream) => Uint8Array;
3
3
  export declare const IMAGE_FILTERS: ReadonlySet<string>;
4
4
  export declare const decodeStream: DecodeStream;
@@ -1,4 +1,4 @@
1
- import type { PdfDict } from "./objects";
1
+ import type { PdfDict } from "./objects.js";
2
2
  export type XrefEntry = {
3
3
  readonly kind: "offset";
4
4
  readonly offset: number;
@@ -1,3 +1,3 @@
1
- import type { ObjectStreamSource } from "../../../doc-gate/src/extractor/pdf-objstm-guard";
2
- import type { PdfObjectsDocument } from "./pdf-objects/document";
1
+ import type { ObjectStreamSource } from "../../../doc-gate/src/extractor/pdf-objstm-guard.js";
2
+ import type { PdfObjectsDocument } from "./pdf-objects/document.js";
3
3
  export declare const objectStreamSource: (doc?: PdfObjectsDocument) => ObjectStreamSource;
@@ -1,7 +1,7 @@
1
- import type { ExtractionCost } from "./extraction-cost";
2
- import type { GlyphFragment } from "./glyph-positions";
3
- import { type PdfSource, type PdfTextRun } from "./pdf-source";
4
- import { type PdfPageSignals } from "./pdf-table-detector";
1
+ import type { ExtractionCost } from "./extraction-cost.js";
2
+ import type { GlyphFragment } from "./glyph-positions.js";
3
+ import { type PdfSource, type PdfTextRun } from "./pdf-source.js";
4
+ import { type PdfPageSignals } from "./pdf-table-detector.js";
5
5
  export declare const openPdfSource: (bytes: Uint8Array, cost: ExtractionCost, pageLimit?: number, firstPages?: number) => Promise<{
6
6
  source: PdfSource;
7
7
  items: PdfTextRun[][];
@@ -1,4 +1,4 @@
1
- import type { PdfObjectsDocument, PdfPageEntry } from "./pdf-objects/document";
2
- import { type GlyphMemo } from "./pdf-glyph-source";
3
- import type { PdfOp } from "./pdf-ops";
1
+ import type { PdfObjectsDocument, PdfPageEntry } from "./pdf-objects/document.js";
2
+ import { type GlyphMemo } from "./pdf-glyph-source.js";
3
+ import type { PdfOp } from "./pdf-ops.js";
4
4
  export declare function ourOpsOfPage(doc: PdfObjectsDocument, page: PdfPageEntry, memo?: GlyphMemo): PdfOp[];
@@ -1,4 +1,4 @@
1
- import type { Matrix2D } from "../../../doc-ir/src/layout/geometry";
1
+ import type { Matrix2D } from "../../../doc-ir/src/layout/geometry.js";
2
2
  export interface PdfOp {
3
3
  op: string;
4
4
  args: unknown;
@@ -1,4 +1,4 @@
1
- import type { PdfObjectsDocument } from "./pdf-objects/document";
1
+ import type { PdfObjectsDocument } from "./pdf-objects/document.js";
2
2
  export interface PdfOutlineEntry {
3
3
  title: string;
4
4
  depth: number;