unpdf 1.6.2 → 1.7.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.
- package/README.md +60 -24
- package/dist/index.cjs +145 -110
- package/dist/index.d.cts +13 -6
- package/dist/index.d.mts +13 -6
- package/dist/index.d.ts +13 -6
- package/dist/index.mjs +145 -110
- package/dist/pdfjs.d.mts +1 -1
- package/dist/pdfjs.d.ts +1 -1
- package/dist/pdfjs.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +2 -2
- package/dist/types/src/display/text_layer.d.ts +4 -4
- package/dist/types/src/display/xfa_layer.d.ts +3 -3
- package/dist/types/src/display/xfa_text.d.ts +2 -2
- package/dist/types/src/pdf.d.ts +6 -6
- package/dist/types/web/annotation_editor_layer_builder.d.ts +5 -5
- package/dist/types/web/annotation_layer_builder.d.ts +9 -9
- package/dist/types/web/pdf_find_controller.d.ts +4 -4
- package/dist/types/web/pdf_history.d.ts +1 -1
- package/dist/types/web/pdf_link_service.d.ts +2 -2
- package/dist/types/web/pdf_page_view.d.ts +12 -12
- package/dist/types/web/pdf_rendering_queue.d.ts +3 -3
- package/dist/types/web/pdf_scripting_manager.d.ts +1 -1
- package/dist/types/web/pdf_thumbnail_view.d.ts +9 -9
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +7 -7
- package/dist/types/web/pdf_viewer.d.ts +14 -14
- package/dist/types/web/renderable_view.d.ts +2 -2
- package/dist/types/web/struct_tree_layer_builder.d.ts +1 -1
- package/dist/types/web/text_highlighter.d.ts +6 -6
- package/dist/types/web/text_layer_builder.d.ts +6 -6
- package/dist/types/web/xfa_layer_builder.d.ts +6 -6
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type PDFPageProxy = import("./api").PDFPageProxy;
|
|
2
|
-
export type PageViewport = import("./display_utils").PageViewport;
|
|
1
|
+
export type PDFPageProxy = import("./api.js").PDFPageProxy;
|
|
2
|
+
export type PageViewport = import("./display_utils.js").PageViewport;
|
|
3
3
|
export type TextAccessibilityManager = import("../../web/text_accessibility.js").TextAccessibilityManager;
|
|
4
4
|
export type AnnotationEditorUIManager = any;
|
|
5
5
|
export type StructTreeLayerBuilder = import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type PageViewport = import("./display_utils").PageViewport;
|
|
2
|
-
export type TextContent = import("./api").TextContent;
|
|
3
|
-
export type TextLayerImages = import("./text_layer_images").TextLayerImages;
|
|
1
|
+
export type PageViewport = import("./display_utils.js").PageViewport;
|
|
2
|
+
export type TextContent = import("./api.js").TextContent;
|
|
3
|
+
export type TextLayerImages = import("./text_layer_images.js").TextLayerImages;
|
|
4
4
|
export type TextLayerParameters = {
|
|
5
5
|
/**
|
|
6
6
|
* - Text content to
|
|
@@ -22,7 +22,7 @@ export type TextLayerParameters = {
|
|
|
22
22
|
* - An optional TextLayerImages instance
|
|
23
23
|
* that handles right clicking on images.
|
|
24
24
|
*/
|
|
25
|
-
images?: import("./text_layer_images").TextLayerImages | undefined;
|
|
25
|
+
images?: import("./text_layer_images.js").TextLayerImages | undefined;
|
|
26
26
|
};
|
|
27
27
|
export type TextLayerUpdateParameters = {
|
|
28
28
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export type AnnotationStorage = import("./annotation_storage").AnnotationStorage;
|
|
2
|
-
export type PageViewport = import("./display_utils").PageViewport;
|
|
1
|
+
export type AnnotationStorage = import("./annotation_storage.js").AnnotationStorage;
|
|
2
|
+
export type PageViewport = import("./display_utils.js").PageViewport;
|
|
3
3
|
export type PDFLinkService = import("../../web/pdf_link_service.js").PDFLinkService;
|
|
4
4
|
export type XfaLayerParameters = {
|
|
5
5
|
viewport: PageViewport;
|
|
6
6
|
div: HTMLDivElement;
|
|
7
7
|
xfaHtml: Object;
|
|
8
|
-
annotationStorage?: import("./annotation_storage").AnnotationStorage | undefined;
|
|
8
|
+
annotationStorage?: import("./annotation_storage.js").AnnotationStorage | undefined;
|
|
9
9
|
linkService: PDFLinkService;
|
|
10
10
|
/**
|
|
11
11
|
* - (default value is 'display').
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type TextContent = import("./api").TextContent;
|
|
2
|
-
/** @typedef {import("./api").TextContent} TextContent */
|
|
1
|
+
export type TextContent = import("./api.js").TextContent;
|
|
2
|
+
/** @typedef {import("./api.js").TextContent} TextContent */
|
|
3
3
|
export class XfaText {
|
|
4
4
|
/**
|
|
5
5
|
* Walk an XFA tree and create an array of text nodes that is compatible
|
package/dist/types/src/pdf.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type OnProgressParameters = import("./display/api").OnProgressParameters;
|
|
2
|
-
export type PDFDocumentLoadingTask = import("./display/api").PDFDocumentLoadingTask;
|
|
3
|
-
export type PDFDocumentProxy = import("./display/api").PDFDocumentProxy;
|
|
4
|
-
export type PDFPageProxy = import("./display/api").PDFPageProxy;
|
|
5
|
-
export type RenderTask = import("./display/api").RenderTask;
|
|
6
|
-
export type PageViewport = import("./display/display_utils").PageViewport;
|
|
1
|
+
export type OnProgressParameters = import("./display/api.js").OnProgressParameters;
|
|
2
|
+
export type PDFDocumentLoadingTask = import("./display/api.js").PDFDocumentLoadingTask;
|
|
3
|
+
export type PDFDocumentProxy = import("./display/api.js").PDFDocumentProxy;
|
|
4
|
+
export type PDFPageProxy = import("./display/api.js").PDFPageProxy;
|
|
5
|
+
export type RenderTask = import("./display/api.js").RenderTask;
|
|
6
|
+
export type PageViewport = import("./display/display_utils.js").PageViewport;
|
|
7
7
|
import { AbortException } from "./shared/util.js";
|
|
8
8
|
import { AnnotationEditorLayer } from "./display/editor/annotation_editor_layer.js";
|
|
9
9
|
import { AnnotationEditorParamsType } from "./shared/util.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
2
|
-
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
1
|
+
export type PDFPageProxy = import("../src/display/api.js").PDFPageProxy;
|
|
2
|
+
export type PageViewport = import("../src/display/display_utils.js").PageViewport;
|
|
3
3
|
export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
|
|
4
4
|
export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
|
|
5
5
|
export type AnnotationLayer = import("../src/display/annotation_layer.js").AnnotationLayer;
|
|
6
6
|
export type StructTreeLayerBuilder = any;
|
|
7
7
|
export type AnnotationEditorLayerBuilderOptions = {
|
|
8
|
-
uiManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
|
|
8
|
+
uiManager?: import("../src/pdf.js").AnnotationEditorUIManager | undefined;
|
|
9
9
|
pageIndex: number;
|
|
10
10
|
l10n?: L10n;
|
|
11
11
|
structTreeLayer?: StructTreeLayerBuilder;
|
|
12
12
|
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
13
|
-
annotationLayer?: import("../src/pdf").AnnotationLayer | undefined;
|
|
13
|
+
annotationLayer?: import("../src/pdf.js").AnnotationLayer | undefined;
|
|
14
14
|
textLayer?: TextLayer;
|
|
15
15
|
drawLayer?: DrawLayer;
|
|
16
16
|
onAppend?: Function | undefined;
|
|
@@ -61,4 +61,4 @@ export class AnnotationEditorLayerBuilder {
|
|
|
61
61
|
show(): void;
|
|
62
62
|
#private;
|
|
63
63
|
}
|
|
64
|
-
import { AnnotationEditorLayer } from "../src/pdf";
|
|
64
|
+
import { AnnotationEditorLayer } from "../src/pdf.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
2
|
-
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
3
|
-
export type AnnotationStorage = import("../src/display/annotation_storage").AnnotationStorage;
|
|
1
|
+
export type PDFPageProxy = import("../src/display/api.js").PDFPageProxy;
|
|
2
|
+
export type PageViewport = import("../src/display/display_utils.js").PageViewport;
|
|
3
|
+
export type AnnotationStorage = import("../src/display/annotation_storage.js").AnnotationStorage;
|
|
4
4
|
export type StructTreeLayerBuilder = import("./struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
5
5
|
export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
|
|
6
6
|
export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
|
|
@@ -9,7 +9,7 @@ export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
|
9
9
|
export type BaseDownloadManager = import("./base_download_manager.js").BaseDownloadManager;
|
|
10
10
|
export type AnnotationLayerBuilderOptions = {
|
|
11
11
|
pdfPage: PDFPageProxy;
|
|
12
|
-
annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
|
|
12
|
+
annotationStorage?: import("../src/display/annotation_storage.js").AnnotationStorage | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* - Path for image resources, mainly
|
|
15
15
|
* for annotation icons. Include trailing slash.
|
|
@@ -26,7 +26,7 @@ export type AnnotationLayerBuilderOptions = {
|
|
|
26
26
|
} | null> | undefined;
|
|
27
27
|
annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
|
|
28
28
|
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
29
|
-
annotationEditorUIManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
|
|
29
|
+
annotationEditorUIManager?: import("../src/pdf.js").AnnotationEditorUIManager | undefined;
|
|
30
30
|
onAppend?: Function | undefined;
|
|
31
31
|
commentManager?: import("./comment_manager.js").CommentManager | undefined;
|
|
32
32
|
};
|
|
@@ -69,12 +69,12 @@ export class AnnotationLayerBuilder {
|
|
|
69
69
|
* @param {AnnotationLayerBuilderOptions} options
|
|
70
70
|
*/
|
|
71
71
|
constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableComment, commentManager, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
|
|
72
|
-
pdfPage: import("../src/display/api").PDFPageProxy;
|
|
72
|
+
pdfPage: import("../src/display/api.js").PDFPageProxy;
|
|
73
73
|
linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
74
74
|
downloadManager: import("./base_download_manager.js").BaseDownloadManager | undefined;
|
|
75
75
|
imageResourcesPath: string;
|
|
76
76
|
renderForms: boolean;
|
|
77
|
-
annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
|
|
77
|
+
annotationStorage: import("../src/display/annotation_storage.js").AnnotationStorage;
|
|
78
78
|
enableComment: boolean;
|
|
79
79
|
enableScripting: boolean;
|
|
80
80
|
_hasJSActionsPromise: Promise<boolean>;
|
|
@@ -83,7 +83,7 @@ export class AnnotationLayerBuilder {
|
|
|
83
83
|
} | null>;
|
|
84
84
|
_annotationCanvasMap: Map<string, HTMLCanvasElement>;
|
|
85
85
|
_accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager;
|
|
86
|
-
_annotationEditorUIManager: import("../src/pdf").AnnotationEditorUIManager;
|
|
86
|
+
_annotationEditorUIManager: import("../src/pdf.js").AnnotationEditorUIManager;
|
|
87
87
|
annotationLayer: AnnotationLayer | null;
|
|
88
88
|
div: HTMLDivElement | null;
|
|
89
89
|
_cancelled: boolean;
|
|
@@ -105,4 +105,4 @@ export class AnnotationLayerBuilder {
|
|
|
105
105
|
injectLinkAnnotations(inferredLinks: Array<Object>): Promise<void>;
|
|
106
106
|
#private;
|
|
107
107
|
}
|
|
108
|
-
import { AnnotationLayer } from "../src/pdf";
|
|
108
|
+
import { AnnotationLayer } from "../src/pdf.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
|
|
2
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
1
|
+
export type PDFDocumentProxy = import("../src/display/api.js").PDFDocumentProxy;
|
|
2
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
3
3
|
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
4
4
|
export type PDFFindControllerOptions = {
|
|
5
5
|
/**
|
|
@@ -42,7 +42,7 @@ export class PDFFindController {
|
|
|
42
42
|
*/
|
|
43
43
|
constructor({ linkService, eventBus, updateMatchesCountOnProgress }: PDFFindControllerOptions);
|
|
44
44
|
_linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
45
|
-
_eventBus: import("./event_utils").EventBus;
|
|
45
|
+
_eventBus: import("./event_utils.js").EventBus;
|
|
46
46
|
/**
|
|
47
47
|
* Callback used to check if a `pageNumber` is currently visible.
|
|
48
48
|
* @type {function}
|
|
@@ -63,7 +63,7 @@ export class PDFFindController {
|
|
|
63
63
|
* @param {PDFDocumentProxy} pdfDocument - The PDF document to search.
|
|
64
64
|
*/
|
|
65
65
|
setDocument(pdfDocument: PDFDocumentProxy): void;
|
|
66
|
-
_pdfDocument: import("../src/display/api").PDFDocumentProxy | null | undefined;
|
|
66
|
+
_pdfDocument: import("../src/display/api.js").PDFDocumentProxy | null | undefined;
|
|
67
67
|
_dirtyMatch: boolean | undefined;
|
|
68
68
|
_findTimeout: any;
|
|
69
69
|
_highlightMatches: boolean | undefined;
|
|
@@ -38,7 +38,7 @@ export type PushParameters = {
|
|
|
38
38
|
*/
|
|
39
39
|
pageNumber: number;
|
|
40
40
|
};
|
|
41
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
41
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
42
42
|
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
43
43
|
export function isDestArraysEqual(firstDest: any, secondDest: any): boolean;
|
|
44
44
|
export function isDestHashesEqual(destHash: any, pushHash: any): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
1
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
2
2
|
export type PDFLinkServiceOptions = {
|
|
3
3
|
/**
|
|
4
4
|
* - The application event bus.
|
|
@@ -51,7 +51,7 @@ export class PDFLinkService {
|
|
|
51
51
|
*/
|
|
52
52
|
constructor({ eventBus, externalLinkTarget, externalLinkRel, ignoreDestinationZoom, }?: PDFLinkServiceOptions);
|
|
53
53
|
externalLinkEnabled: boolean;
|
|
54
|
-
eventBus: import("./event_utils").EventBus;
|
|
54
|
+
eventBus: import("./event_utils.js").EventBus;
|
|
55
55
|
externalLinkTarget: number;
|
|
56
56
|
externalLinkRel: string;
|
|
57
57
|
_ignoreDestinationZoom: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
2
|
-
export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
|
|
3
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
4
|
-
export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
1
|
+
export type PageViewport = import("../src/display/display_utils.js").PageViewport;
|
|
2
|
+
export type OptionalContentConfig = import("../src/display/optional_content_config.js").OptionalContentConfig;
|
|
3
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
4
|
+
export type PDFRenderingQueue = import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
5
5
|
export type CommentManager = import("./comment_manager.js").CommentManager;
|
|
6
6
|
export type L10n = import("./l10n.js").L10n;
|
|
7
7
|
export type PDFPageViewOptions = {
|
|
@@ -30,11 +30,11 @@ export type PDFPageViewOptions = {
|
|
|
30
30
|
* A promise that is resolved with an {@link OptionalContentConfig} instance.
|
|
31
31
|
* The default value is `null`.
|
|
32
32
|
*/
|
|
33
|
-
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
|
|
33
|
+
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* - The rendering queue object.
|
|
36
36
|
*/
|
|
37
|
-
renderingQueue?: import("./pdf_rendering_queue").PDFRenderingQueue | undefined;
|
|
37
|
+
renderingQueue?: import("./pdf_rendering_queue.js").PDFRenderingQueue | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* - Controls if the text layer used for
|
|
40
40
|
* selection and searching is created. The constants from {TextLayerMode}
|
|
@@ -130,9 +130,9 @@ export class PDFPageView extends BasePDFPageView {
|
|
|
130
130
|
pageLabel: string | null;
|
|
131
131
|
rotation: number;
|
|
132
132
|
scale: number;
|
|
133
|
-
viewport: import("../src/display/display_utils").PageViewport;
|
|
133
|
+
viewport: import("../src/display/display_utils.js").PageViewport;
|
|
134
134
|
pdfPageRotate: number;
|
|
135
|
-
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
135
|
+
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | null;
|
|
136
136
|
imageResourcesPath: string;
|
|
137
137
|
enableDetailCanvas: boolean;
|
|
138
138
|
maxCanvasPixels: any;
|
|
@@ -192,7 +192,7 @@ export class PDFPageView extends BasePDFPageView {
|
|
|
192
192
|
/**
|
|
193
193
|
* A promise that is resolved with an {@link OptionalContentConfig}instance. The default value is `null`.
|
|
194
194
|
*/
|
|
195
|
-
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
|
|
195
|
+
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | undefined;
|
|
196
196
|
drawingDelay?: number | undefined;
|
|
197
197
|
}): void;
|
|
198
198
|
outputScale: OutputScale | undefined;
|
|
@@ -221,9 +221,9 @@ export class PDFPageView extends BasePDFPageView {
|
|
|
221
221
|
_getRenderingContext(canvas: any, transform: any, recordOperations: any, recordImages: any): {
|
|
222
222
|
canvas: any;
|
|
223
223
|
transform: any;
|
|
224
|
-
viewport: import("../src/display/display_utils").PageViewport;
|
|
224
|
+
viewport: import("../src/display/display_utils.js").PageViewport;
|
|
225
225
|
annotationMode: number;
|
|
226
|
-
optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
226
|
+
optionalContentConfigPromise: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | null;
|
|
227
227
|
annotationCanvasMap: any;
|
|
228
228
|
pageColors: null;
|
|
229
229
|
isEditing: boolean;
|
|
@@ -246,4 +246,4 @@ import { BasePDFPageView } from "./base_pdf_page_view.js";
|
|
|
246
246
|
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
|
|
247
247
|
import { TextLayerBuilder } from "./text_layer_builder.js";
|
|
248
248
|
import { XfaLayerBuilder } from "./xfa_layer_builder.js";
|
|
249
|
-
import { OutputScale } from "../src/pdf";
|
|
249
|
+
import { OutputScale } from "../src/pdf.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type PDFViewer = import("./pdf_viewer").PDFViewer;
|
|
2
|
-
export type PDFThumbnailViewer = import("./pdf_thumbnail_viewer").PDFThumbnailViewer;
|
|
3
|
-
export type RenderableView = import("./renderable_view").RenderableView;
|
|
1
|
+
export type PDFViewer = import("./pdf_viewer.js").PDFViewer;
|
|
2
|
+
export type PDFThumbnailViewer = import("./pdf_thumbnail_viewer.js").PDFThumbnailViewer;
|
|
3
|
+
export type RenderableView = import("./renderable_view.js").RenderableView;
|
|
4
4
|
/**
|
|
5
5
|
* Controls rendering of the views for pages and thumbnails.
|
|
6
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
|
|
2
|
-
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
3
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
4
|
-
export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
1
|
+
export type OptionalContentConfig = import("../src/display/optional_content_config.js").OptionalContentConfig;
|
|
2
|
+
export type PageViewport = import("../src/display/display_utils.js").PageViewport;
|
|
3
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
4
|
+
export type PDFRenderingQueue = import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
5
5
|
export type PDFThumbnailViewOptions = {
|
|
6
6
|
/**
|
|
7
7
|
* - The viewer element.
|
|
@@ -24,7 +24,7 @@ export type PDFThumbnailViewOptions = {
|
|
|
24
24
|
* A promise that is resolved with an {@link OptionalContentConfig} instance.
|
|
25
25
|
* The default value is `null`.
|
|
26
26
|
*/
|
|
27
|
-
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
|
|
27
|
+
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* - The navigation/linking service.
|
|
30
30
|
*/
|
|
@@ -61,15 +61,15 @@ export class PDFThumbnailView extends RenderableView {
|
|
|
61
61
|
pageLabel: string | null;
|
|
62
62
|
pdfPage: any;
|
|
63
63
|
rotation: number;
|
|
64
|
-
viewport: import("../src/display/display_utils").PageViewport;
|
|
64
|
+
viewport: import("../src/display/display_utils.js").PageViewport;
|
|
65
65
|
pdfPageRotate: number;
|
|
66
|
-
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
66
|
+
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | null;
|
|
67
67
|
maxCanvasPixels: any;
|
|
68
68
|
maxCanvasDim: any;
|
|
69
69
|
pageColors: Object | null;
|
|
70
|
-
eventBus: import("./event_utils").EventBus;
|
|
70
|
+
eventBus: import("./event_utils.js").EventBus;
|
|
71
71
|
linkService: PDFLinkService;
|
|
72
|
-
renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
72
|
+
renderingQueue: import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
73
73
|
placeholder: any;
|
|
74
74
|
div: HTMLDivElement;
|
|
75
75
|
imageContainer: HTMLDivElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
|
|
2
|
-
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
3
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
4
|
-
export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
1
|
+
export type PDFDocumentProxy = import("../src/display/api.js").PDFDocumentProxy;
|
|
2
|
+
export type PDFPageProxy = import("../src/display/api.js").PDFPageProxy;
|
|
3
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
4
|
+
export type PDFRenderingQueue = import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
5
5
|
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
6
6
|
export type PDFThumbnailViewerOptions = {
|
|
7
7
|
/**
|
|
@@ -121,9 +121,9 @@ export class PDFThumbnailViewer {
|
|
|
121
121
|
constructor({ container, eventBus, linkService, renderingQueue, maxCanvasPixels, maxCanvasDim, pageColors, abortSignal, enableSplitMerge, enableNewBadge, statusBar, undoBar, manageMenu, addFileButton, }: PDFThumbnailViewerOptions);
|
|
122
122
|
scrollableContainer: HTMLElement | null;
|
|
123
123
|
container: HTMLDivElement;
|
|
124
|
-
eventBus: import("./event_utils").EventBus;
|
|
124
|
+
eventBus: import("./event_utils.js").EventBus;
|
|
125
125
|
linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
126
|
-
renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
126
|
+
renderingQueue: import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
127
127
|
maxCanvasPixels: number | undefined;
|
|
128
128
|
maxCanvasDim: number | undefined;
|
|
129
129
|
pageColors: Object | null;
|
|
@@ -148,7 +148,7 @@ export class PDFThumbnailViewer {
|
|
|
148
148
|
* @param {PDFDocumentProxy} pdfDocument
|
|
149
149
|
*/
|
|
150
150
|
setDocument(pdfDocument: PDFDocumentProxy): void;
|
|
151
|
-
pdfDocument: import("../src/display/api").PDFDocumentProxy | undefined;
|
|
151
|
+
pdfDocument: import("../src/display/api.js").PDFDocumentProxy | undefined;
|
|
152
152
|
/**
|
|
153
153
|
* @param {Array|null} labels
|
|
154
154
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
|
|
2
|
-
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
3
|
-
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
4
|
-
export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
|
|
5
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
6
|
-
export type PDFFindController = import("./pdf_find_controller").PDFFindController;
|
|
7
|
-
export type PDFScriptingManager = import("./pdf_scripting_manager").PDFScriptingManager;
|
|
1
|
+
export type PDFDocumentProxy = import("../src/display/api.js").PDFDocumentProxy;
|
|
2
|
+
export type PDFPageProxy = import("../src/display/api.js").PDFPageProxy;
|
|
3
|
+
export type PageViewport = import("../src/display/display_utils.js").PageViewport;
|
|
4
|
+
export type OptionalContentConfig = import("../src/display/optional_content_config.js").OptionalContentConfig;
|
|
5
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
6
|
+
export type PDFFindController = import("./pdf_find_controller.js").PDFFindController;
|
|
7
|
+
export type PDFScriptingManager = import("./pdf_scripting_manager.js").PDFScriptingManager;
|
|
8
8
|
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
9
9
|
export type BaseDownloadManager = import("./base_download_manager.js").BaseDownloadManager;
|
|
10
10
|
export type L10n = import("./l10n.js").L10n;
|
|
@@ -34,12 +34,12 @@ export type PDFViewerOptions = {
|
|
|
34
34
|
* - The find controller
|
|
35
35
|
* component.
|
|
36
36
|
*/
|
|
37
|
-
findController?: import("./pdf_find_controller").PDFFindController | undefined;
|
|
37
|
+
findController?: import("./pdf_find_controller.js").PDFFindController | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* - The scripting manager
|
|
40
40
|
* component.
|
|
41
41
|
*/
|
|
42
|
-
scriptingManager?: import("./pdf_scripting_manager").PDFScriptingManager | undefined;
|
|
42
|
+
scriptingManager?: import("./pdf_scripting_manager.js").PDFScriptingManager | undefined;
|
|
43
43
|
/**
|
|
44
44
|
* - The rendering queue object.
|
|
45
45
|
*/
|
|
@@ -250,11 +250,11 @@ export class PDFViewer {
|
|
|
250
250
|
constructor(options: PDFViewerOptions);
|
|
251
251
|
container: HTMLDivElement;
|
|
252
252
|
viewer: Element | null;
|
|
253
|
-
eventBus: import("./event_utils").EventBus;
|
|
253
|
+
eventBus: import("./event_utils.js").EventBus;
|
|
254
254
|
linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
255
255
|
downloadManager: import("./base_download_manager.js").BaseDownloadManager | null;
|
|
256
|
-
findController: import("./pdf_find_controller").PDFFindController | null;
|
|
257
|
-
_scriptingManager: import("./pdf_scripting_manager").PDFScriptingManager | null;
|
|
256
|
+
findController: import("./pdf_find_controller.js").PDFFindController | null;
|
|
257
|
+
_scriptingManager: import("./pdf_scripting_manager.js").PDFScriptingManager | null;
|
|
258
258
|
imageResourcesPath: string;
|
|
259
259
|
enablePrintAutoRotate: boolean;
|
|
260
260
|
removePageBorders: boolean | undefined;
|
|
@@ -349,9 +349,9 @@ export class PDFViewer {
|
|
|
349
349
|
* @param {PDFDocumentProxy} pdfDocument
|
|
350
350
|
*/
|
|
351
351
|
setDocument(pdfDocument: PDFDocumentProxy): void;
|
|
352
|
-
pdfDocument: import("../src/display/api").PDFDocumentProxy | undefined;
|
|
352
|
+
pdfDocument: import("../src/display/api.js").PDFDocumentProxy | undefined;
|
|
353
353
|
_scrollMode: any;
|
|
354
|
-
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null | undefined;
|
|
354
|
+
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | null | undefined;
|
|
355
355
|
onPagesEdited({ pagesMapper, type, hasBeenCut, pageNumbers }: {
|
|
356
356
|
pagesMapper: any;
|
|
357
357
|
type: any;
|
|
@@ -5,9 +5,9 @@ export class RenderableView {
|
|
|
5
5
|
*/
|
|
6
6
|
renderingId: string;
|
|
7
7
|
/**
|
|
8
|
-
* @type {import("../src/display/api").RenderTask | null}
|
|
8
|
+
* @type {import("../src/display/api.js").RenderTask | null}
|
|
9
9
|
*/
|
|
10
|
-
renderTask: import("../src/display/api").RenderTask | null;
|
|
10
|
+
renderTask: import("../src/display/api.js").RenderTask | null;
|
|
11
11
|
/**
|
|
12
12
|
* @type {function | null}
|
|
13
13
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
2
|
-
export type PDFFindController = import("./pdf_find_controller").PDFFindController;
|
|
1
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
2
|
+
export type PDFFindController = import("./pdf_find_controller.js").PDFFindController;
|
|
3
3
|
export type TextHighlighterOptions = {
|
|
4
4
|
findController: PDFFindController;
|
|
5
5
|
/**
|
|
@@ -11,8 +11,8 @@ export type TextHighlighterOptions = {
|
|
|
11
11
|
*/
|
|
12
12
|
pageIndex: number;
|
|
13
13
|
};
|
|
14
|
-
/** @typedef {import("./event_utils").EventBus} EventBus */
|
|
15
|
-
/** @typedef {import("./pdf_find_controller").PDFFindController} PDFFindController */
|
|
14
|
+
/** @typedef {import("./event_utils.js").EventBus} EventBus */
|
|
15
|
+
/** @typedef {import("./pdf_find_controller.js").PDFFindController} PDFFindController */
|
|
16
16
|
/**
|
|
17
17
|
* @typedef {Object} TextHighlighterOptions
|
|
18
18
|
* @property {PDFFindController} findController
|
|
@@ -28,9 +28,9 @@ export class TextHighlighter {
|
|
|
28
28
|
* @param {TextHighlighterOptions} options
|
|
29
29
|
*/
|
|
30
30
|
constructor({ findController, eventBus, pageIndex }: TextHighlighterOptions);
|
|
31
|
-
findController: import("./pdf_find_controller").PDFFindController;
|
|
31
|
+
findController: import("./pdf_find_controller.js").PDFFindController;
|
|
32
32
|
matches: any[];
|
|
33
|
-
eventBus: import("./event_utils").EventBus;
|
|
33
|
+
eventBus: import("./event_utils.js").EventBus;
|
|
34
34
|
pageIdx: number;
|
|
35
35
|
textDivs: Node[] | null;
|
|
36
36
|
textContentItemsStr: string[] | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
2
|
-
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
1
|
+
export type PDFPageProxy = import("../src/display/api.js").PDFPageProxy;
|
|
2
|
+
export type PageViewport = import("../src/display/display_utils.js").PageViewport;
|
|
3
3
|
export type TextLayerImages = import("../src/display/text_layer_images.js").TextLayerImages;
|
|
4
|
-
export type TextHighlighter = import("./text_highlighter").TextHighlighter;
|
|
4
|
+
export type TextHighlighter = import("./text_highlighter.js").TextHighlighter;
|
|
5
5
|
export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
|
|
6
6
|
export type TextLayerBuilderOptions = {
|
|
7
7
|
pdfPage: PDFPageProxy;
|
|
@@ -9,7 +9,7 @@ export type TextLayerBuilderOptions = {
|
|
|
9
9
|
* - Optional object that will handle
|
|
10
10
|
* highlighting text from the find controller.
|
|
11
11
|
*/
|
|
12
|
-
highlighter?: import("./text_highlighter").TextHighlighter | undefined;
|
|
12
|
+
highlighter?: import("./text_highlighter.js").TextHighlighter | undefined;
|
|
13
13
|
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
14
14
|
enablePermissions?: boolean | undefined;
|
|
15
15
|
onAppend?: Function | undefined;
|
|
@@ -50,8 +50,8 @@ export class TextLayerBuilder {
|
|
|
50
50
|
* @param {TextLayerBuilderOptions} options
|
|
51
51
|
*/
|
|
52
52
|
constructor({ pdfPage, highlighter, accessibilityManager, enablePermissions, onAppend, abortSignal, }: TextLayerBuilderOptions);
|
|
53
|
-
pdfPage: import("../src/display/api").PDFPageProxy;
|
|
54
|
-
highlighter: import("./text_highlighter").TextHighlighter;
|
|
53
|
+
pdfPage: import("../src/display/api.js").PDFPageProxy;
|
|
54
|
+
highlighter: import("./text_highlighter.js").TextHighlighter;
|
|
55
55
|
accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager;
|
|
56
56
|
div: HTMLDivElement;
|
|
57
57
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
2
|
-
export type AnnotationStorage = import("../src/display/annotation_storage").AnnotationStorage;
|
|
3
|
-
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
1
|
+
export type PDFPageProxy = import("../src/display/api.js").PDFPageProxy;
|
|
2
|
+
export type AnnotationStorage = import("../src/display/annotation_storage.js").AnnotationStorage;
|
|
3
|
+
export type PageViewport = import("../src/display/display_utils.js").PageViewport;
|
|
4
4
|
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
5
5
|
export type XfaLayerBuilderOptions = {
|
|
6
6
|
pdfPage: PDFPageProxy;
|
|
7
|
-
annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
|
|
7
|
+
annotationStorage?: import("../src/display/annotation_storage.js").AnnotationStorage | undefined;
|
|
8
8
|
linkService: PDFLinkService;
|
|
9
9
|
xfaHtml?: Object | undefined;
|
|
10
10
|
};
|
|
@@ -32,8 +32,8 @@ export class XfaLayerBuilder {
|
|
|
32
32
|
* @param {XfaLayerBuilderOptions} options
|
|
33
33
|
*/
|
|
34
34
|
constructor({ pdfPage, annotationStorage, linkService, xfaHtml, }: XfaLayerBuilderOptions);
|
|
35
|
-
pdfPage: import("../src/display/api").PDFPageProxy;
|
|
36
|
-
annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
|
|
35
|
+
pdfPage: import("../src/display/api.js").PDFPageProxy;
|
|
36
|
+
annotationStorage: import("../src/display/annotation_storage.js").AnnotationStorage;
|
|
37
37
|
linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
38
38
|
xfaHtml: Object;
|
|
39
39
|
div: HTMLDivElement | null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unpdf",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"packageManager": "pnpm@10.33.0",
|
|
6
6
|
"description": "PDF extraction and rendering across all JavaScript runtimes",
|
|
7
7
|
"author": "Johann Schopplich <hello@johannschopplich.com>",
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
"lint:fix": "eslint . --fix",
|
|
67
67
|
"release": "bumpp",
|
|
68
68
|
"test": "vitest",
|
|
69
|
-
"test:types": "tsc --noEmit"
|
|
69
|
+
"test:types": "tsc --noEmit",
|
|
70
|
+
"test:types:dist": "tsc -p test/types/tsconfig.json"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
73
|
"@napi-rs/canvas": "^0.1.69"
|