unpdf 1.3.2 → 1.5.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 +22 -38
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/pdfjs.mjs +107 -1
- package/dist/types/src/display/annotation_layer.d.ts +42 -17
- package/dist/types/src/display/annotation_storage.d.ts +10 -8
- package/dist/types/src/display/api.d.ts +93 -63
- package/dist/types/src/display/api_utils.d.ts +1 -1
- package/dist/types/src/display/binary_data_factory.d.ts +26 -0
- package/dist/types/src/display/canvas.d.ts +19 -16
- package/dist/types/src/display/canvas_dependency_tracker.d.ts +99 -27
- package/dist/types/src/display/canvas_factory.d.ts +3 -1
- package/dist/types/src/display/display_utils.d.ts +25 -2
- package/dist/types/src/display/draw_layer.d.ts +2 -6
- package/dist/types/src/display/editor/alt_text.d.ts +1 -1
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +11 -14
- package/dist/types/src/display/editor/color_picker.d.ts +2 -2
- package/dist/types/src/display/editor/comment.d.ts +32 -5
- package/dist/types/src/display/editor/draw.d.ts +3 -7
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +4 -3
- package/dist/types/src/display/editor/drawers/highlight.d.ts +2 -1
- package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
- package/dist/types/src/display/editor/editor.d.ts +81 -26
- package/dist/types/src/display/editor/freetext.d.ts +3 -3
- package/dist/types/src/display/editor/highlight.d.ts +6 -4
- package/dist/types/src/display/editor/ink.d.ts +2 -1
- package/dist/types/src/display/editor/signature.d.ts +0 -5
- package/dist/types/src/display/editor/toolbar.d.ts +5 -3
- package/dist/types/src/display/editor/tools.d.ts +58 -4
- package/dist/types/src/display/fetch_stream.d.ts +3 -56
- package/dist/types/src/display/font_loader.d.ts +28 -1
- package/dist/types/src/display/network.d.ts +14 -80
- package/dist/types/src/display/network_stream.d.ts +2 -0
- package/dist/types/src/display/network_utils.d.ts +3 -3
- package/dist/types/src/display/node_stream.d.ts +2 -52
- package/dist/types/src/display/node_utils.d.ts +5 -19
- package/dist/types/src/display/obj_bin_transform_display.d.ts +67 -0
- package/dist/types/src/display/pages_mapper.d.ts +72 -0
- package/dist/types/src/display/pattern_helper.d.ts +9 -4
- package/dist/types/src/display/text_layer.d.ts +16 -10
- package/dist/types/src/display/text_layer_images.d.ts +10 -0
- package/dist/types/src/display/transport_stream.d.ts +8 -64
- package/dist/types/src/display/webgpu_mesh.d.ts +3 -0
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/display/xfa_layer.d.ts +3 -3
- package/dist/types/src/pdf.d.ts +9 -1
- package/dist/types/src/{interfaces.d.ts → shared/base_pdf_stream.d.ts} +26 -27
- package/dist/types/src/shared/obj_bin_transform_utils.d.ts +26 -0
- package/dist/types/src/shared/util.d.ts +14 -5
- package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
- package/dist/types/web/annotation_layer_builder.d.ts +15 -23
- package/dist/types/web/app_options.d.ts +1 -1
- package/dist/types/web/autolinker.d.ts +3 -2
- package/dist/types/web/base_download_manager.d.ts +24 -0
- package/dist/types/web/base_pdf_page_view.d.ts +6 -6
- package/dist/types/web/comment_manager.d.ts +20 -0
- package/dist/types/web/download_manager.d.ts +3 -12
- package/dist/types/web/draw_layer_builder.d.ts +0 -12
- package/dist/types/web/genericl10n.d.ts +6 -10
- package/dist/types/web/l10n.d.ts +3 -6
- package/dist/types/web/menu.d.ts +11 -0
- package/dist/types/web/pdf_find_controller.d.ts +9 -11
- package/dist/types/web/pdf_history.d.ts +3 -3
- package/dist/types/web/pdf_link_service.d.ts +4 -8
- package/dist/types/web/pdf_page_detail_view.d.ts +1 -7
- package/dist/types/web/pdf_page_view.d.ts +23 -12
- package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
- package/dist/types/web/pdf_thumbnail_view.d.ts +18 -42
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +57 -13
- package/dist/types/web/pdf_viewer.component.d.ts +1 -1
- package/dist/types/web/pdf_viewer.d.ts +40 -28
- package/dist/types/web/renderable_view.d.ts +33 -0
- package/dist/types/web/sidebar.d.ts +65 -0
- package/dist/types/web/struct_tree_layer_builder.d.ts +1 -1
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +11 -6
- package/dist/types/web/ui_utils.d.ts +3 -11
- package/dist/types/web/xfa_layer_builder.d.ts +4 -4
- package/package.json +25 -20
- package/dist/types/src/display/cmap_reader_factory.d.ts +0 -25
- package/dist/types/src/display/standard_fontdata_factory.d.ts +0 -20
- package/dist/types/src/display/wasm_factory.d.ts +0 -20
- package/dist/types/web/interfaces.d.ts +0 -174
|
@@ -2,14 +2,12 @@ export class CanvasGraphics {
|
|
|
2
2
|
constructor(canvasCtx: any, commonObjs: any, objs: any, canvasFactory: any, filterFactory: any, { optionalContentConfig, markedContentStack }: {
|
|
3
3
|
optionalContentConfig: any;
|
|
4
4
|
markedContentStack?: null | undefined;
|
|
5
|
-
}, annotationCanvasMap: any, pageColors: any, dependencyTracker: any);
|
|
5
|
+
}, annotationCanvasMap: any, pageColors: any, dependencyTracker: any, imagesTracker: any);
|
|
6
6
|
ctx: any;
|
|
7
7
|
current: CanvasExtraState;
|
|
8
8
|
stateStack: any[];
|
|
9
9
|
pendingClip: {} | {} | null;
|
|
10
10
|
pendingEOFill: boolean;
|
|
11
|
-
res: any;
|
|
12
|
-
xobjs: any;
|
|
13
11
|
commonObjs: any;
|
|
14
12
|
objs: any;
|
|
15
13
|
canvasFactory: any;
|
|
@@ -21,11 +19,11 @@ export class CanvasGraphics {
|
|
|
21
19
|
smaskStack: any[];
|
|
22
20
|
smaskCounter: number;
|
|
23
21
|
tempSMask: any;
|
|
22
|
+
smaskGroupCanvases: any[];
|
|
24
23
|
suspendedCtx: any;
|
|
25
24
|
contentVisible: boolean;
|
|
26
25
|
markedContentStack: never[];
|
|
27
26
|
optionalContentConfig: any;
|
|
28
|
-
cachedCanvases: CachedCanvases;
|
|
29
27
|
cachedPatterns: Map<any, any>;
|
|
30
28
|
annotationCanvasMap: any;
|
|
31
29
|
viewportScale: number;
|
|
@@ -36,6 +34,7 @@ export class CanvasGraphics {
|
|
|
36
34
|
_cachedGetSinglePixelWidth: number | null;
|
|
37
35
|
_cachedBitmapsMap: Map<any, any>;
|
|
38
36
|
dependencyTracker: any;
|
|
37
|
+
imagesTracker: any;
|
|
39
38
|
getObject(opIdx: any, data: any, fallback?: null): any;
|
|
40
39
|
beginDrawing({ transform, viewport, transparency, background, }: {
|
|
41
40
|
transform: any;
|
|
@@ -43,19 +42,27 @@ export class CanvasGraphics {
|
|
|
43
42
|
transparency?: boolean | undefined;
|
|
44
43
|
background?: null | undefined;
|
|
45
44
|
}): void;
|
|
45
|
+
transparentCanvasEntry: any;
|
|
46
46
|
compositeCtx: any;
|
|
47
|
+
executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any, operationsFilter: any): any;
|
|
47
48
|
transparentCanvas: any;
|
|
48
|
-
executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any, filteredOperationIndexes: any): any;
|
|
49
49
|
endDrawing(): void;
|
|
50
50
|
_scaleImage(img: any, inverseTransform: any): {
|
|
51
51
|
img: any;
|
|
52
52
|
paintWidth: any;
|
|
53
53
|
paintHeight: any;
|
|
54
|
+
tmpCanvas: any;
|
|
54
55
|
};
|
|
55
56
|
_createMaskCanvas(opIdx: any, img: any): {
|
|
56
57
|
canvas: any;
|
|
57
58
|
offsetX: number;
|
|
58
59
|
offsetY: number;
|
|
60
|
+
canvasEntry?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
canvas: any;
|
|
63
|
+
canvasEntry: any;
|
|
64
|
+
offsetX: number;
|
|
65
|
+
offsetY: number;
|
|
59
66
|
};
|
|
60
67
|
setLineWidth(opIdx: any, width: any): void;
|
|
61
68
|
setLineCap(opIdx: any, style: any): void;
|
|
@@ -77,6 +84,7 @@ export class CanvasGraphics {
|
|
|
77
84
|
* the right order on the canvas' graphics state stack.
|
|
78
85
|
*/
|
|
79
86
|
beginSMaskMode(opIdx: any): void;
|
|
87
|
+
smaskScratchCanvas: any;
|
|
80
88
|
endSMaskMode(): void;
|
|
81
89
|
compose(dirtyBox: any): void;
|
|
82
90
|
composeSMask(ctx: any, smask: any, layerCtx: any, layerBox: any): void;
|
|
@@ -142,7 +150,10 @@ export class CanvasGraphics {
|
|
|
142
150
|
paintImageXObject(opIdx: any, objId: any): void;
|
|
143
151
|
paintImageXObjectRepeat(opIdx: any, objId: any, scaleX: any, scaleY: any, positions: any): void;
|
|
144
152
|
applyTransferMapsToCanvas(ctx: any): any;
|
|
145
|
-
applyTransferMapsToBitmap(imgData: any):
|
|
153
|
+
applyTransferMapsToBitmap(imgData: any): {
|
|
154
|
+
img: any;
|
|
155
|
+
canvasEntry: any;
|
|
156
|
+
};
|
|
146
157
|
paintInlineImageXObject(opIdx: any, imgData: any): void;
|
|
147
158
|
paintInlineImageXObjectGroup(opIdx: any, imgData: any, map: any): void;
|
|
148
159
|
paintSolidColorImageMask(opIdx: any): void;
|
|
@@ -161,7 +172,7 @@ export class CanvasGraphics {
|
|
|
161
172
|
#private;
|
|
162
173
|
}
|
|
163
174
|
declare class CanvasExtraState {
|
|
164
|
-
constructor(width: any, height: any
|
|
175
|
+
constructor(width: any, height: any);
|
|
165
176
|
alphaIsShape: boolean;
|
|
166
177
|
fontSize: number;
|
|
167
178
|
fontSizeScale: number;
|
|
@@ -187,8 +198,8 @@ declare class CanvasExtraState {
|
|
|
187
198
|
lineWidth: number;
|
|
188
199
|
activeSMask: null;
|
|
189
200
|
transferMaps: string;
|
|
190
|
-
clipBox: Float32Array<ArrayBuffer>;
|
|
191
201
|
minMax: Float32Array<ArrayBuffer>;
|
|
202
|
+
clipBox: Float32Array<ArrayBuffer>;
|
|
192
203
|
clone(): any;
|
|
193
204
|
getPathBoundingBox(pathType?: string, transform?: null): Float32Array<ArrayBuffer>;
|
|
194
205
|
updateClipFromPath(): void;
|
|
@@ -196,12 +207,4 @@ declare class CanvasExtraState {
|
|
|
196
207
|
startNewPathAndClipBox(box: any): void;
|
|
197
208
|
getClippedPathBoundingBox(pathType?: string, transform?: null): number[] | null;
|
|
198
209
|
}
|
|
199
|
-
declare class CachedCanvases {
|
|
200
|
-
constructor(canvasFactory: any);
|
|
201
|
-
canvasFactory: any;
|
|
202
|
-
cache: any;
|
|
203
|
-
getCanvas(id: any, width: any, height: any): any;
|
|
204
|
-
delete(id: any): void;
|
|
205
|
-
clear(): void;
|
|
206
|
-
}
|
|
207
210
|
export {};
|
|
@@ -1,10 +1,55 @@
|
|
|
1
|
-
export type SimpleDependency = "lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" | "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" | "path" | "filter";
|
|
1
|
+
export type SimpleDependency = "lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" | "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" | "path" | "filter" | "font" | "fontObj";
|
|
2
2
|
export type IncrementalDependency = "transform" | "moveText" | "sameLineText";
|
|
3
3
|
export type InternalIncrementalDependency = IncrementalDependency | typeof FORCED_DEPENDENCY_LABEL;
|
|
4
|
+
export class CanvasBBoxTracker {
|
|
5
|
+
constructor(canvas: any, operationsCount: any);
|
|
6
|
+
_pendingBBoxIdx: number;
|
|
7
|
+
_savesStack: any[];
|
|
8
|
+
_markedContentStack: any[];
|
|
9
|
+
growOperationsCount(operationsCount: any): void;
|
|
10
|
+
get clipBox(): number[];
|
|
11
|
+
save(opIdx: any): this;
|
|
12
|
+
restore(opIdx: any, onSavePopped: any): this;
|
|
13
|
+
/**
|
|
14
|
+
* @param {number} idx
|
|
15
|
+
*/
|
|
16
|
+
recordOpenMarker(idx: number): this;
|
|
17
|
+
getOpenMarker(): any;
|
|
18
|
+
recordCloseMarker(opIdx: any, onSavePopped: any): this;
|
|
19
|
+
beginMarkedContent(opIdx: any): this;
|
|
20
|
+
endMarkedContent(opIdx: any, onSavePopped: any): this;
|
|
21
|
+
pushBaseTransform(ctx: any): this;
|
|
22
|
+
popBaseTransform(): this;
|
|
23
|
+
resetBBox(idx: any): this;
|
|
24
|
+
recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
25
|
+
recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
26
|
+
recordFullPageBBox(idx: any): this;
|
|
27
|
+
/**
|
|
28
|
+
* @param {number} idx
|
|
29
|
+
*/
|
|
30
|
+
recordOperation(idx: number, preserve: boolean | undefined, dependencyLists: any): this;
|
|
31
|
+
bboxToClipBoxDropOperation(idx: any): this;
|
|
32
|
+
take(): BBoxReader;
|
|
33
|
+
takeDebugMetadata(): void;
|
|
34
|
+
recordSimpleData(name: any, idx: any): this;
|
|
35
|
+
recordIncrementalData(name: any, idx: any): this;
|
|
36
|
+
resetIncrementalData(name: any, idx: any): this;
|
|
37
|
+
recordNamedData(name: any, idx: any): this;
|
|
38
|
+
recordSimpleDataFromNamed(name: any, depName: any, fallbackIdx: any): this;
|
|
39
|
+
recordFutureForcedDependency(name: any, idx: any): this;
|
|
40
|
+
inheritSimpleDataAsFutureForcedDependencies(names: any): this;
|
|
41
|
+
inheritPendingDependenciesAsFutureForcedDependencies(): this;
|
|
42
|
+
recordCharacterBBox(idx: any, ctx: any, font: any, scale: number | undefined, x: number | undefined, y: number | undefined, getMeasure: any): this;
|
|
43
|
+
getSimpleIndex(dependencyName: any): undefined;
|
|
44
|
+
recordDependencies(idx: any, dependencyNames: any): this;
|
|
45
|
+
recordNamedDependency(idx: any, name: any): this;
|
|
46
|
+
recordShowTextOperation(idx: any, preserve?: boolean): this;
|
|
47
|
+
#private;
|
|
48
|
+
}
|
|
4
49
|
/**
|
|
5
50
|
* @typedef {"lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" |
|
|
6
51
|
* "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" |
|
|
7
|
-
* "path" | "filter"} SimpleDependency
|
|
52
|
+
* "path" | "filter" | "font" | "fontObj"} SimpleDependency
|
|
8
53
|
*/
|
|
9
54
|
/**
|
|
10
55
|
* @typedef {"transform" | "moveText" | "sameLineText"} IncrementalDependency
|
|
@@ -14,16 +59,18 @@ export type InternalIncrementalDependency = IncrementalDependency | typeof FORCE
|
|
|
14
59
|
* typeof FORCED_DEPENDENCY_LABEL} InternalIncrementalDependency
|
|
15
60
|
*/
|
|
16
61
|
export class CanvasDependencyTracker {
|
|
17
|
-
constructor(
|
|
62
|
+
constructor(bboxTracker: any, recordDebugMetadata?: boolean);
|
|
63
|
+
get clipBox(): any;
|
|
64
|
+
growOperationsCount(operationsCount: any): void;
|
|
18
65
|
save(opIdx: any): this;
|
|
19
66
|
restore(opIdx: any): this;
|
|
67
|
+
recordOpenMarker(opIdx: any): this;
|
|
68
|
+
getOpenMarker(): any;
|
|
69
|
+
recordCloseMarker(opIdx: any): this;
|
|
20
70
|
/**
|
|
21
|
-
* @param {number}
|
|
71
|
+
* @param {number} opIdx
|
|
22
72
|
*/
|
|
23
|
-
|
|
24
|
-
getOpenMarker(): any;
|
|
25
|
-
recordCloseMarker(idx: any): this;
|
|
26
|
-
beginMarkedContent(opIdx: any): this;
|
|
73
|
+
beginMarkedContent(opIdx: number): this;
|
|
27
74
|
endMarkedContent(opIdx: any): this;
|
|
28
75
|
pushBaseTransform(ctx: any): this;
|
|
29
76
|
popBaseTransform(): this;
|
|
@@ -43,35 +90,43 @@ export class CanvasDependencyTracker {
|
|
|
43
90
|
*/
|
|
44
91
|
resetIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
45
92
|
recordNamedData(name: any, idx: any): this;
|
|
93
|
+
/**
|
|
94
|
+
* @param {SimpleDependency} name
|
|
95
|
+
* @param {string} depName
|
|
96
|
+
* @param {number} fallbackIdx
|
|
97
|
+
*/
|
|
98
|
+
recordSimpleDataFromNamed(name: SimpleDependency, depName: string, fallbackIdx: number): void;
|
|
46
99
|
recordFutureForcedDependency(name: any, idx: any): this;
|
|
47
100
|
inheritSimpleDataAsFutureForcedDependencies(names: any): this;
|
|
48
101
|
inheritPendingDependenciesAsFutureForcedDependencies(): this;
|
|
49
102
|
resetBBox(idx: any): this;
|
|
50
|
-
get hasPendingBBox(): boolean;
|
|
51
103
|
recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
52
104
|
recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
53
105
|
recordCharacterBBox(idx: any, ctx: any, font: any, scale: number | undefined, x: number | undefined, y: number | undefined, getMeasure: any): this;
|
|
54
106
|
recordFullPageBBox(idx: any): this;
|
|
55
107
|
getSimpleIndex(dependencyName: any): any;
|
|
56
108
|
recordDependencies(idx: any, dependencyNames: any): this;
|
|
57
|
-
copyDependenciesFromIncrementalOperation(idx: any, name: any): this;
|
|
58
109
|
recordNamedDependency(idx: any, name: any): this;
|
|
59
110
|
/**
|
|
60
111
|
* @param {number} idx
|
|
61
112
|
*/
|
|
62
|
-
recordOperation(idx: number,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
113
|
+
recordOperation(idx: number, preserve?: boolean): this;
|
|
114
|
+
recordShowTextOperation(idx: any, preserve?: boolean): this;
|
|
115
|
+
bboxToClipBoxDropOperation(idx: any, preserve?: boolean): this;
|
|
116
|
+
take(): any;
|
|
117
|
+
takeDebugMetadata(): Map<any, any> | undefined;
|
|
118
|
+
#private;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Track the locations of images in the canvas. For each image it computes
|
|
122
|
+
* a bounding box as a potentially rotated rectangle, matching the rotation of
|
|
123
|
+
* the current canvas transform.
|
|
124
|
+
*/
|
|
125
|
+
export class CanvasImagesTracker {
|
|
126
|
+
static "__#private@#CoordsArray": Float32ArrayConstructor | Float16ArrayConstructor;
|
|
127
|
+
constructor(canvas: any);
|
|
128
|
+
record(ctx: any, width: any, height: any, clipBox: any): void;
|
|
129
|
+
take(): Float32Array<ArrayBuffer> | Float16Array<ArrayBuffer>;
|
|
75
130
|
#private;
|
|
76
131
|
}
|
|
77
132
|
/**
|
|
@@ -82,7 +137,9 @@ export class CanvasDependencyTracker {
|
|
|
82
137
|
* @implements {CanvasDependencyTracker}
|
|
83
138
|
*/
|
|
84
139
|
export class CanvasNestedDependencyTracker implements CanvasDependencyTracker {
|
|
85
|
-
constructor(dependencyTracker: any, opIdx: any);
|
|
140
|
+
constructor(dependencyTracker: any, opIdx: any, ignoreBBoxes: any);
|
|
141
|
+
get clipBox(): any;
|
|
142
|
+
growOperationsCount(): void;
|
|
86
143
|
save(opIdx: any): this;
|
|
87
144
|
restore(opIdx: any): this;
|
|
88
145
|
recordOpenMarker(idx: any): this;
|
|
@@ -108,27 +165,32 @@ export class CanvasNestedDependencyTracker implements CanvasDependencyTracker {
|
|
|
108
165
|
*/
|
|
109
166
|
resetIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
110
167
|
recordNamedData(name: any, idx: any): this;
|
|
168
|
+
/**
|
|
169
|
+
* @param {SimpleDependency} name
|
|
170
|
+
* @param {string} depName
|
|
171
|
+
* @param {number} fallbackIdx
|
|
172
|
+
*/
|
|
173
|
+
recordSimpleDataFromNamed(name: SimpleDependency, depName: string, fallbackIdx: number): this;
|
|
111
174
|
recordFutureForcedDependency(name: any, idx: any): this;
|
|
112
175
|
inheritSimpleDataAsFutureForcedDependencies(names: any): this;
|
|
113
176
|
inheritPendingDependenciesAsFutureForcedDependencies(): this;
|
|
114
177
|
resetBBox(idx: any): this;
|
|
115
|
-
get hasPendingBBox(): boolean;
|
|
116
178
|
recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
117
179
|
recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
118
180
|
recordCharacterBBox(idx: any, ctx: any, font: any, scale: any, x: any, y: any, getMeasure: any): this;
|
|
119
181
|
recordFullPageBBox(idx: any): this;
|
|
120
182
|
getSimpleIndex(dependencyName: any): any;
|
|
121
183
|
recordDependencies(idx: any, dependencyNames: any): this;
|
|
122
|
-
copyDependenciesFromIncrementalOperation(idx: any, name: any): this;
|
|
123
184
|
recordNamedDependency(idx: any, name: any): this;
|
|
124
185
|
/**
|
|
125
186
|
* @param {number} idx
|
|
126
187
|
* @param {SimpleDependency[]} dependencyNames
|
|
127
188
|
*/
|
|
128
189
|
recordOperation(idx: number): this;
|
|
190
|
+
recordShowTextOperation(idx: any): this;
|
|
129
191
|
bboxToClipBoxDropOperation(idx: any): this;
|
|
130
|
-
recordNestedDependencies(): void;
|
|
131
192
|
take(): void;
|
|
193
|
+
takeDebugMetadata(): void;
|
|
132
194
|
#private;
|
|
133
195
|
}
|
|
134
196
|
export namespace Dependencies {
|
|
@@ -141,4 +203,14 @@ export namespace Dependencies {
|
|
|
141
203
|
let transformAndFill: string[];
|
|
142
204
|
}
|
|
143
205
|
declare const FORCED_DEPENDENCY_LABEL: "__forcedDependency";
|
|
206
|
+
declare class BBoxReader {
|
|
207
|
+
constructor(bboxes: any, coords: any);
|
|
208
|
+
get length(): any;
|
|
209
|
+
isEmpty(i: any): boolean;
|
|
210
|
+
minX(i: any): number;
|
|
211
|
+
minY(i: any): number;
|
|
212
|
+
maxX(i: any): number;
|
|
213
|
+
maxY(i: any): number;
|
|
214
|
+
#private;
|
|
215
|
+
}
|
|
144
216
|
export {};
|
|
@@ -6,7 +6,9 @@ export class BaseCanvasFactory {
|
|
|
6
6
|
canvas: void;
|
|
7
7
|
context: any;
|
|
8
8
|
};
|
|
9
|
-
reset(
|
|
9
|
+
reset({ canvas }: {
|
|
10
|
+
canvas: any;
|
|
11
|
+
}, width: any, height: any): void;
|
|
10
12
|
destroy(canvasAndContext: any): void;
|
|
11
13
|
/**
|
|
12
14
|
* @ignore
|
|
@@ -59,8 +59,25 @@ export type PageViewportCloneParameters = {
|
|
|
59
59
|
*/
|
|
60
60
|
dontFlip?: boolean | undefined;
|
|
61
61
|
};
|
|
62
|
+
export function applyOpacity(color: any, opacity: any): any;
|
|
63
|
+
export class ColorScheme {
|
|
64
|
+
static get isDarkMode(): any;
|
|
65
|
+
}
|
|
66
|
+
export class CSSConstants {
|
|
67
|
+
static get commentForegroundColor(): any;
|
|
68
|
+
}
|
|
62
69
|
export function deprecated(details: any): void;
|
|
63
70
|
export function fetchData(url: any, type?: string): Promise<any>;
|
|
71
|
+
/**
|
|
72
|
+
* Find a color that has sufficient contrast against a fixed color.
|
|
73
|
+
* The luminance (in HSL color space) of the base color is adjusted
|
|
74
|
+
* until the contrast ratio between the base color and the fixed color
|
|
75
|
+
* is at least the minimum contrast ratio required by WCAG 2.1.
|
|
76
|
+
* @param {Array<number>} baseColor
|
|
77
|
+
* @param {Array<number>} fixedColor
|
|
78
|
+
* @returns {string}
|
|
79
|
+
*/
|
|
80
|
+
export function findContrastColor(baseColor: Array<number>, fixedColor: Array<number>): string;
|
|
64
81
|
export function getColorValues(colors: any): void;
|
|
65
82
|
export function getCurrentTransform(ctx: any): any[];
|
|
66
83
|
export function getCurrentTransformInverse(ctx: any): any[];
|
|
@@ -89,6 +106,7 @@ export function getXfaPageViewport(xfaPage: any, { scale, rotation }: {
|
|
|
89
106
|
export function isDataScheme(url: any): boolean;
|
|
90
107
|
export function isPdfFile(filename: any): boolean;
|
|
91
108
|
export function isValidFetchUrl(url: any, baseUrl: any): boolean;
|
|
109
|
+
export function makePathFromDrawOPS(data: any): Path2D;
|
|
92
110
|
/**
|
|
93
111
|
* Event handler to suppress context menu.
|
|
94
112
|
*/
|
|
@@ -208,7 +226,7 @@ export class PageViewport {
|
|
|
208
226
|
convertToPdfPoint(x: number, y: number): any[];
|
|
209
227
|
}
|
|
210
228
|
export class PDFDateString {
|
|
211
|
-
static #regex: any;
|
|
229
|
+
static "__#private@#regex": any;
|
|
212
230
|
/**
|
|
213
231
|
* Convert a PDF date string to a JavaScript `Date` object.
|
|
214
232
|
*
|
|
@@ -238,6 +256,11 @@ export class RenderingCancelledException extends RenderingCancelledException_bas
|
|
|
238
256
|
constructor(msg: any, extraDelay?: number);
|
|
239
257
|
extraDelay: number;
|
|
240
258
|
}
|
|
259
|
+
export function renderRichText({ html, dir, className }: {
|
|
260
|
+
html: any;
|
|
261
|
+
dir: any;
|
|
262
|
+
className: any;
|
|
263
|
+
}, container: any): void;
|
|
241
264
|
/**
|
|
242
265
|
* @param {HTMLDivElement} div
|
|
243
266
|
* @param {PageViewport} viewport
|
|
@@ -246,11 +269,11 @@ export class RenderingCancelledException extends RenderingCancelledException_bas
|
|
|
246
269
|
*/
|
|
247
270
|
export function setLayerDimensions(div: HTMLDivElement, viewport: PageViewport, mustFlip?: boolean, mustRotate?: boolean): void;
|
|
248
271
|
export class StatTimer {
|
|
249
|
-
started: any;
|
|
250
272
|
times: any[];
|
|
251
273
|
time(name: any): void;
|
|
252
274
|
timeEnd(name: any): void;
|
|
253
275
|
toString(): string;
|
|
276
|
+
#private;
|
|
254
277
|
}
|
|
255
278
|
export function stopEvent(e: any): void;
|
|
256
279
|
export const SupportedImageMimeTypes: string[];
|
|
@@ -4,13 +4,9 @@
|
|
|
4
4
|
* be able to use mix-blend-mode for some of them.
|
|
5
5
|
*/
|
|
6
6
|
export class DrawLayer {
|
|
7
|
-
static #id: number;
|
|
7
|
+
static "__#private@#id": number;
|
|
8
8
|
static get _svgFactory(): any;
|
|
9
|
-
static #setBox(element: any, [x, y, width, height]: [any, any, any, any]): void;
|
|
10
|
-
constructor({ pageIndex }: {
|
|
11
|
-
pageIndex: any;
|
|
12
|
-
});
|
|
13
|
-
pageIndex: any;
|
|
9
|
+
static "__#private@#setBox"(element: any, [x, y, width, height]: [any, any, any, any]): void;
|
|
14
10
|
setParent(parent: any): void;
|
|
15
11
|
draw(properties: any, isPathUpdatable?: boolean, hasClip?: boolean): {
|
|
16
12
|
id: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type AnnotationEditorUIManager = import("./tools.js").AnnotationEditorUIManager;
|
|
2
2
|
export type PageViewport = import("../display_utils.js").PageViewport;
|
|
3
3
|
export type TextAccessibilityManager = import("../../../web/text_accessibility.js").TextAccessibilityManager;
|
|
4
|
-
export type IL10n = import("../../../web/interfaces").IL10n;
|
|
5
4
|
export type AnnotationLayer = import("../annotation_layer.js").AnnotationLayer;
|
|
6
5
|
export type DrawLayer = import("../draw_layer.js").DrawLayer;
|
|
7
|
-
export type StructTreeLayerBuilder =
|
|
6
|
+
export type StructTreeLayerBuilder = import("../../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
7
|
+
export type L10n = import("../../../web/l10n.js").L10n;
|
|
8
8
|
export type AnnotationEditorLayerOptions = {
|
|
9
9
|
mode: Object;
|
|
10
10
|
div: HTMLDivElement;
|
|
@@ -13,7 +13,7 @@ export type AnnotationEditorLayerOptions = {
|
|
|
13
13
|
enabled: boolean;
|
|
14
14
|
accessibilityManager?: import("../../../web/text_accessibility.js").TextAccessibilityManager | undefined;
|
|
15
15
|
pageIndex: number;
|
|
16
|
-
l10n:
|
|
16
|
+
l10n: L10n;
|
|
17
17
|
annotationLayer?: import("../annotation_layer.js").AnnotationLayer | undefined;
|
|
18
18
|
textLayer?: HTMLDivElement | undefined;
|
|
19
19
|
drawLayer: DrawLayer;
|
|
@@ -31,7 +31,7 @@ export type RenderEditorLayerOptions = {
|
|
|
31
31
|
* @property {boolean} enabled
|
|
32
32
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
33
33
|
* @property {number} pageIndex
|
|
34
|
-
* @property {
|
|
34
|
+
* @property {L10n} l10n
|
|
35
35
|
* @property {AnnotationLayer} [annotationLayer]
|
|
36
36
|
* @property {HTMLDivElement} [textLayer]
|
|
37
37
|
* @property {DrawLayer} drawLayer
|
|
@@ -46,7 +46,7 @@ export type RenderEditorLayerOptions = {
|
|
|
46
46
|
*/
|
|
47
47
|
export class AnnotationEditorLayer {
|
|
48
48
|
static _initialized: boolean;
|
|
49
|
-
static #editorTypes: Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof SignatureEditor | typeof StampEditor>;
|
|
49
|
+
static "__#private@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof SignatureEditor | typeof StampEditor>;
|
|
50
50
|
/**
|
|
51
51
|
* @param {AnnotationEditorLayerOptions} options
|
|
52
52
|
*/
|
|
@@ -55,7 +55,7 @@ export class AnnotationEditorLayer {
|
|
|
55
55
|
div: HTMLDivElement;
|
|
56
56
|
viewport: import("../display_utils.js").PageViewport;
|
|
57
57
|
drawLayer: import("../draw_layer.js").DrawLayer;
|
|
58
|
-
_structTree:
|
|
58
|
+
_structTree: import("../../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
59
59
|
get isEmpty(): boolean;
|
|
60
60
|
get isInvisible(): boolean;
|
|
61
61
|
/**
|
|
@@ -131,11 +131,7 @@ export class AnnotationEditorLayer {
|
|
|
131
131
|
* @param {AnnotationEditor} editor
|
|
132
132
|
*/
|
|
133
133
|
addUndoableEditor(editor: AnnotationEditor): void;
|
|
134
|
-
|
|
135
|
-
* Get an id for an editor.
|
|
136
|
-
* @returns {string}
|
|
137
|
-
*/
|
|
138
|
-
getNextId(): string;
|
|
134
|
+
getEditorByUID(uid: any): any;
|
|
139
135
|
combinedSignal(ac: any): AbortSignal;
|
|
140
136
|
canCreateNewEmptyEditor(): boolean | undefined;
|
|
141
137
|
/**
|
|
@@ -147,9 +143,9 @@ export class AnnotationEditorLayer {
|
|
|
147
143
|
/**
|
|
148
144
|
* Create a new editor
|
|
149
145
|
* @param {Object} data
|
|
150
|
-
* @returns {AnnotationEditor | null}
|
|
146
|
+
* @returns {Promise<AnnotationEditor | null>}
|
|
151
147
|
*/
|
|
152
|
-
deserialize(data: Object): AnnotationEditor | null
|
|
148
|
+
deserialize(data: Object): Promise<AnnotationEditor | null>;
|
|
153
149
|
/**
|
|
154
150
|
* Create and add a new editor.
|
|
155
151
|
* @param {PointerEvent} event
|
|
@@ -158,6 +154,7 @@ export class AnnotationEditorLayer {
|
|
|
158
154
|
* @returns {AnnotationEditor}
|
|
159
155
|
*/
|
|
160
156
|
createAndAddNewEditor(event: PointerEvent, isCentered: boolean, data?: {}): AnnotationEditor;
|
|
157
|
+
get boundingClientRect(): DOMRect;
|
|
161
158
|
/**
|
|
162
159
|
* Create and add a new editor.
|
|
163
160
|
*/
|
|
@@ -208,7 +205,7 @@ export class AnnotationEditorLayer {
|
|
|
208
205
|
* Render the main editor.
|
|
209
206
|
* @param {RenderEditorLayerOptions} parameters
|
|
210
207
|
*/
|
|
211
|
-
render({ viewport }: RenderEditorLayerOptions): void
|
|
208
|
+
render({ viewport }: RenderEditorLayerOptions): Promise<void>;
|
|
212
209
|
/**
|
|
213
210
|
* Update the main editor.
|
|
214
211
|
* @param {RenderEditorLayerOptions} parameters
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* to select a color for the annotation.
|
|
5
5
|
*/
|
|
6
6
|
export class BasicColorPicker {
|
|
7
|
-
static #l10nColor: null;
|
|
7
|
+
static "__#private@#l10nColor": null;
|
|
8
8
|
constructor(editor: any);
|
|
9
9
|
renderButton(): HTMLInputElement;
|
|
10
10
|
update(value: any): void;
|
|
@@ -18,7 +18,7 @@ export class BasicColorPicker {
|
|
|
18
18
|
* to select a color for the annotation.
|
|
19
19
|
*/
|
|
20
20
|
export class ColorPicker {
|
|
21
|
-
static #l10nColor: null;
|
|
21
|
+
static "__#private@#l10nColor": null;
|
|
22
22
|
static get _keyboardManager(): any;
|
|
23
23
|
constructor({ editor, uiManager }: {
|
|
24
24
|
editor?: null | undefined;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
export class Comment {
|
|
2
2
|
constructor(editor: any);
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
renderForToolbar(): any;
|
|
4
|
+
renderForStandalone(): any;
|
|
5
|
+
focusButton(): void;
|
|
6
|
+
onUpdatedColor(): void;
|
|
7
|
+
get commentButtonWidth(): number;
|
|
8
|
+
set commentPopupPositionInLayer(pos: number[] | null);
|
|
9
|
+
get commentPopupPositionInLayer(): number[] | null;
|
|
10
|
+
hasDefaultPopupPosition(): boolean;
|
|
11
|
+
removeStandaloneCommentButton(): void;
|
|
12
|
+
removeToolbarCommentButton(): void;
|
|
13
|
+
setCommentButtonStates({ selected, hasPopup }: {
|
|
14
|
+
selected: any;
|
|
15
|
+
hasPopup: any;
|
|
16
|
+
}): void;
|
|
17
|
+
edit(options: any): void;
|
|
6
18
|
finish(): void;
|
|
7
19
|
isDeleted(): boolean;
|
|
20
|
+
isEmpty(): boolean;
|
|
8
21
|
hasBeenEdited(): boolean;
|
|
9
22
|
serialize(): {
|
|
10
23
|
text: null;
|
|
24
|
+
richText: null;
|
|
11
25
|
date: null;
|
|
12
26
|
deleted: boolean;
|
|
13
27
|
};
|
|
@@ -16,16 +30,29 @@ export class Comment {
|
|
|
16
30
|
*/
|
|
17
31
|
set data(text: {
|
|
18
32
|
text: null;
|
|
33
|
+
richText: null;
|
|
19
34
|
date: null;
|
|
20
35
|
deleted: boolean;
|
|
21
36
|
});
|
|
22
37
|
get data(): {
|
|
23
38
|
text: null;
|
|
39
|
+
richText: null;
|
|
24
40
|
date: null;
|
|
25
41
|
deleted: boolean;
|
|
26
42
|
};
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Restore the comment data (used for undo).
|
|
45
|
+
* @param {Object} data - The comment data to restore.
|
|
46
|
+
* @param {string} data.text - The comment text.
|
|
47
|
+
* @param {string|null} data.richText - The rich text content.
|
|
48
|
+
* @param {Date|null} data.date - The original date.
|
|
49
|
+
*/
|
|
50
|
+
restoreData({ text, richText, date }: {
|
|
51
|
+
text: string;
|
|
52
|
+
richText: string | null;
|
|
53
|
+
date: Date | null;
|
|
54
|
+
}): void;
|
|
55
|
+
setInitialText(text: any, richText?: null): void;
|
|
29
56
|
shown(): void;
|
|
30
57
|
destroy(): void;
|
|
31
58
|
#private;
|
|
@@ -4,13 +4,9 @@
|
|
|
4
4
|
export class DrawingEditor extends AnnotationEditor {
|
|
5
5
|
static _currentDrawId: number;
|
|
6
6
|
static _currentParent: null;
|
|
7
|
-
static #currentDraw: null;
|
|
8
|
-
static #currentDrawingAC: null;
|
|
9
|
-
static #currentDrawingOptions: null;
|
|
10
|
-
static #currentPointerId: number;
|
|
11
|
-
static #currentPointerType: null;
|
|
12
|
-
static #currentPointerIds: null;
|
|
13
|
-
static #currentMoveTimestamp: number;
|
|
7
|
+
static "__#private@#currentDraw": null;
|
|
8
|
+
static "__#private@#currentDrawingAC": null;
|
|
9
|
+
static "__#private@#currentDrawingOptions": null;
|
|
14
10
|
static _INNER_MARGIN: number;
|
|
15
11
|
static _mergeSVGProperties(p1: any, p2: any): any;
|
|
16
12
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export class FreeDrawOutline extends Outline {
|
|
2
2
|
constructor(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any);
|
|
3
|
+
firstPoint: number[];
|
|
3
4
|
lastPoint: number[];
|
|
4
5
|
serialize([blX, blY, trX, trY]: [any, any, any, any], rotation: any): {
|
|
5
6
|
outline: any[];
|
|
@@ -11,9 +12,9 @@ export class FreeDrawOutline extends Outline {
|
|
|
11
12
|
#private;
|
|
12
13
|
}
|
|
13
14
|
export class FreeDrawOutliner {
|
|
14
|
-
static #MIN_DIST: number;
|
|
15
|
-
static #MIN_DIFF: number;
|
|
16
|
-
static #MIN: number;
|
|
15
|
+
static "__#private@#MIN_DIST": number;
|
|
16
|
+
static "__#private@#MIN_DIFF": number;
|
|
17
|
+
static "__#private@#MIN": number;
|
|
17
18
|
constructor({ x, y }: {
|
|
18
19
|
x: any;
|
|
19
20
|
y: any;
|
|
@@ -19,7 +19,8 @@ export class HighlightOutliner {
|
|
|
19
19
|
}
|
|
20
20
|
import { FreeDrawOutliner } from "./freedraw.js";
|
|
21
21
|
declare class HighlightOutline extends Outline {
|
|
22
|
-
constructor(outlines: any, box: any, lastPoint: any);
|
|
22
|
+
constructor(outlines: any, box: any, firstPoint: any, lastPoint: any);
|
|
23
|
+
firstPoint: any;
|
|
23
24
|
lastPoint: any;
|
|
24
25
|
/**
|
|
25
26
|
* Serialize the outlines into the PDF page coordinate system.
|