unpdf 0.12.2 → 1.0.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 +147 -79
- package/dist/index.cjs +118 -73
- package/dist/index.d.cts +24 -41
- package/dist/index.d.mts +24 -41
- package/dist/index.d.ts +24 -41
- package/dist/index.mjs +117 -72
- package/dist/pdfjs.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +25 -1
- package/dist/types/src/display/annotation_storage.d.ts +1 -8
- package/dist/types/src/display/api.d.ts +147 -57
- package/dist/types/src/display/canvas.d.ts +21 -28
- package/dist/types/src/display/canvas_factory.d.ts +27 -0
- package/dist/types/src/display/cmap_reader_factory.d.ts +25 -0
- package/dist/types/src/display/display_utils.d.ts +40 -60
- package/dist/types/src/display/draw_layer.d.ts +7 -19
- package/dist/types/src/display/editor/alt_text.d.ts +3 -2
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +16 -11
- package/dist/types/src/display/editor/color_picker.d.ts +1 -0
- package/dist/types/src/display/editor/draw.d.ts +121 -0
- package/dist/types/src/display/editor/drawers/contour.d.ts +3 -0
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +31 -0
- package/dist/types/src/display/editor/drawers/highlight.d.ts +36 -0
- package/dist/types/src/display/editor/drawers/inkdraw.d.ts +129 -0
- package/dist/types/src/display/editor/drawers/outline.d.ts +19 -0
- package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +79 -0
- package/dist/types/src/display/editor/editor.d.ts +55 -13
- package/dist/types/src/display/editor/freetext.d.ts +5 -16
- package/dist/types/src/display/editor/highlight.d.ts +8 -25
- package/dist/types/src/display/editor/ink.d.ts +21 -74
- package/dist/types/src/display/editor/signature.d.ts +80 -0
- package/dist/types/src/display/editor/stamp.d.ts +16 -22
- package/dist/types/src/display/editor/toolbar.d.ts +5 -2
- package/dist/types/src/display/editor/tools.d.ts +17 -9
- package/dist/types/src/display/fetch_stream.d.ts +6 -13
- package/dist/types/src/display/filter_factory.d.ts +29 -0
- package/dist/types/src/display/font_loader.d.ts +3 -6
- package/dist/types/src/display/metadata.d.ts +1 -2
- package/dist/types/src/display/network.d.ts +11 -7
- package/dist/types/src/display/network_utils.d.ts +7 -6
- package/dist/types/src/display/node_stream.d.ts +6 -22
- package/dist/types/src/display/node_utils.d.ts +15 -11
- package/dist/types/src/display/optional_content_config.d.ts +2 -2
- package/dist/types/src/display/pattern_helper.d.ts +4 -2
- package/dist/types/src/display/standard_fontdata_factory.d.ts +20 -0
- package/dist/types/src/display/svg_factory.d.ts +14 -0
- package/dist/types/src/display/text_layer.d.ts +12 -9
- package/dist/types/src/display/touch_manager.d.ts +18 -0
- package/dist/types/src/display/transport_stream.d.ts +1 -1
- package/dist/types/src/display/wasm_factory.d.ts +20 -0
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/interfaces.d.ts +4 -0
- package/dist/types/src/pdf.d.ts +13 -5
- package/dist/types/src/shared/message_handler.d.ts +9 -4
- package/dist/types/src/shared/util.d.ts +137 -129
- package/dist/types/web/annotation_editor_layer_builder.d.ts +20 -5
- package/dist/types/web/annotation_layer_builder.d.ts +35 -4
- package/dist/types/web/app_options.d.ts +1 -1
- package/dist/types/web/autolinker.d.ts +28 -0
- package/dist/types/web/base_pdf_page_view.d.ts +27 -0
- package/dist/types/web/draw_layer_builder.d.ts +13 -2
- package/dist/types/web/event_utils.d.ts +2 -2
- package/dist/types/web/genericl10n.d.ts +5 -5
- package/dist/types/web/interfaces.d.ts +5 -5
- package/dist/types/web/l10n.d.ts +2 -2
- package/dist/types/web/pdf_find_controller.d.ts +2 -0
- package/dist/types/web/pdf_link_service.d.ts +1 -2
- package/dist/types/web/pdf_page_detail_view.d.ts +32 -0
- package/dist/types/web/pdf_page_view.d.ts +44 -23
- package/dist/types/web/pdf_rendering_queue.d.ts +2 -1
- package/dist/types/web/pdf_thumbnail_view.d.ts +23 -3
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +21 -1
- package/dist/types/web/pdf_viewer.d.ts +44 -16
- package/dist/types/web/struct_tree_layer_builder.d.ts +20 -2
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +25 -17
- package/dist/types/web/ui_utils.d.ts +3 -19
- package/dist/types/web/xfa_layer_builder.d.ts +14 -3
- package/package.json +31 -28
- package/dist/types/src/display/base_factory.d.ts +0 -60
- package/dist/types/src/display/editor/outliner.d.ts +0 -70
|
@@ -9,7 +9,6 @@ export class MessageHandler {
|
|
|
9
9
|
streamControllers: any;
|
|
10
10
|
callbackCapabilities: any;
|
|
11
11
|
actionHandler: any;
|
|
12
|
-
_onComObjOnMessage: (event: any) => void;
|
|
13
12
|
on(actionName: any, handler: any): void;
|
|
14
13
|
/**
|
|
15
14
|
* Sends a message to the comObj to invoke the action with the supplied data.
|
|
@@ -17,7 +16,7 @@ export class MessageHandler {
|
|
|
17
16
|
* @param {JSON} data - JSON data to send.
|
|
18
17
|
* @param {Array} [transfers] - List of transfers/ArrayBuffers.
|
|
19
18
|
*/
|
|
20
|
-
send(actionName: string, data: JSON, transfers?: any[]
|
|
19
|
+
send(actionName: string, data: JSON, transfers?: any[]): void;
|
|
21
20
|
/**
|
|
22
21
|
* Sends a message to the comObj to invoke the action with the supplied data.
|
|
23
22
|
* Expects that the other side will callback with the response.
|
|
@@ -26,7 +25,7 @@ export class MessageHandler {
|
|
|
26
25
|
* @param {Array} [transfers] - List of transfers/ArrayBuffers.
|
|
27
26
|
* @returns {Promise} Promise to be resolved with response data.
|
|
28
27
|
*/
|
|
29
|
-
sendWithPromise(actionName: string, data: JSON, transfers?: any[]
|
|
28
|
+
sendWithPromise(actionName: string, data: JSON, transfers?: any[]): Promise<any>;
|
|
30
29
|
/**
|
|
31
30
|
* Sends a message to the comObj to invoke the action with the supplied data.
|
|
32
31
|
* Expect that the other side will callback to signal 'start_complete'.
|
|
@@ -37,7 +36,13 @@ export class MessageHandler {
|
|
|
37
36
|
* @param {Array} [transfers] - List of transfers/ArrayBuffers.
|
|
38
37
|
* @returns {ReadableStream} ReadableStream to read data in chunks.
|
|
39
38
|
*/
|
|
40
|
-
sendWithStream(actionName: string, data: JSON, queueingStrategy: Object, transfers?: any[]
|
|
39
|
+
sendWithStream(actionName: string, data: JSON, queueingStrategy: Object, transfers?: any[]): ReadableStream;
|
|
41
40
|
destroy(): void;
|
|
42
41
|
#private;
|
|
43
42
|
}
|
|
43
|
+
export function wrapReason(ex: any): PasswordException | UnknownErrorException | InvalidPDFException | ResponseException | AbortException;
|
|
44
|
+
import { PasswordException } from "./util.js";
|
|
45
|
+
import { UnknownErrorException } from "./util.js";
|
|
46
|
+
import { InvalidPDFException } from "./util.js";
|
|
47
|
+
import { ResponseException } from "./util.js";
|
|
48
|
+
import { AbortException } from "./util.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export function _isValidExplicitDest(validRef: any, validName: any, dest: any): boolean;
|
|
1
2
|
declare const AbortException_base: any;
|
|
2
3
|
/**
|
|
3
4
|
* Error used to indicate task cancellation.
|
|
@@ -43,6 +44,7 @@ export namespace AnnotationEditorParamsType {
|
|
|
43
44
|
let HIGHLIGHT_THICKNESS: number;
|
|
44
45
|
let HIGHLIGHT_FREE: number;
|
|
45
46
|
let HIGHLIGHT_SHOW_ALL: number;
|
|
47
|
+
let DRAW_STEP: number;
|
|
46
48
|
}
|
|
47
49
|
export const AnnotationEditorPrefix: "pdfjs_internal_editor_";
|
|
48
50
|
export namespace AnnotationEditorType {
|
|
@@ -52,6 +54,7 @@ export namespace AnnotationEditorType {
|
|
|
52
54
|
let HIGHLIGHT: number;
|
|
53
55
|
let STAMP: number;
|
|
54
56
|
let INK: number;
|
|
57
|
+
let SIGNATURE: number;
|
|
55
58
|
}
|
|
56
59
|
export namespace AnnotationFieldFlag {
|
|
57
60
|
let READONLY: number;
|
|
@@ -139,11 +142,6 @@ export function assert(cond: any, msg: any): void;
|
|
|
139
142
|
export const BaseException: any;
|
|
140
143
|
export const BASELINE_FACTOR: number;
|
|
141
144
|
export function bytesToString(bytes: any): string;
|
|
142
|
-
export namespace CMapCompressionType {
|
|
143
|
-
let NONE_1: number;
|
|
144
|
-
export { NONE_1 as NONE };
|
|
145
|
-
export let BINARY: number;
|
|
146
|
-
}
|
|
147
145
|
/**
|
|
148
146
|
* Attempts to create a valid absolute URL.
|
|
149
147
|
*
|
|
@@ -152,7 +150,7 @@ export namespace CMapCompressionType {
|
|
|
152
150
|
* @param {Object} [options]
|
|
153
151
|
* @returns Either a valid {URL}, or `null` otherwise.
|
|
154
152
|
*/
|
|
155
|
-
export function createValidAbsoluteUrl(url: URL | string, baseUrl?:
|
|
153
|
+
export function createValidAbsoluteUrl(url: URL | string, baseUrl?: URL | string, options?: Object): URL | null;
|
|
156
154
|
export namespace DocumentActionEventType {
|
|
157
155
|
let WC: string;
|
|
158
156
|
let WS: string;
|
|
@@ -160,25 +158,21 @@ export namespace DocumentActionEventType {
|
|
|
160
158
|
let WP: string;
|
|
161
159
|
let DP: string;
|
|
162
160
|
}
|
|
161
|
+
export namespace DrawOPS {
|
|
162
|
+
let moveTo: number;
|
|
163
|
+
let lineTo: number;
|
|
164
|
+
let curveTo: number;
|
|
165
|
+
let closePath: number;
|
|
166
|
+
}
|
|
163
167
|
export class FeatureTest {
|
|
164
168
|
static get isLittleEndian(): any;
|
|
165
169
|
static get isEvalSupported(): any;
|
|
166
170
|
static get isOffscreenCanvasSupported(): any;
|
|
171
|
+
static get isImageDecoderSupported(): any;
|
|
167
172
|
static get platform(): any;
|
|
168
173
|
static get isCSSRoundSupported(): any;
|
|
169
174
|
}
|
|
170
175
|
export const FONT_IDENTITY_MATRIX: number[];
|
|
171
|
-
export namespace FontRenderOps {
|
|
172
|
-
let BEZIER_CURVE_TO: number;
|
|
173
|
-
let MOVE_TO: number;
|
|
174
|
-
let LINE_TO: number;
|
|
175
|
-
let QUADRATIC_CURVE_TO: number;
|
|
176
|
-
let RESTORE: number;
|
|
177
|
-
let SAVE: number;
|
|
178
|
-
let SCALE: number;
|
|
179
|
-
let TRANSFORM: number;
|
|
180
|
-
let TRANSLATE: number;
|
|
181
|
-
}
|
|
182
176
|
declare const FormatError_base: any;
|
|
183
177
|
/**
|
|
184
178
|
* Error caused during parsing PDF data.
|
|
@@ -187,10 +181,11 @@ export class FormatError extends FormatError_base {
|
|
|
187
181
|
[x: string]: any;
|
|
188
182
|
constructor(msg: any);
|
|
189
183
|
}
|
|
184
|
+
export function fromBase64Util(str: any): any;
|
|
190
185
|
export function getModificationDate(date?: Date): string;
|
|
191
186
|
export function getUuid(): string;
|
|
192
187
|
export function getVerbosityLevel(): number;
|
|
193
|
-
export const
|
|
188
|
+
export const hexNumbers: string[];
|
|
194
189
|
export namespace ImageKind {
|
|
195
190
|
let GRAYSCALE_1BPP: number;
|
|
196
191
|
let RGB_24BPP: number;
|
|
@@ -206,106 +201,105 @@ export function isArrayEqual(arr1: any, arr2: any): boolean;
|
|
|
206
201
|
export const isNodeJS: any;
|
|
207
202
|
export const LINE_DESCENT_FACTOR: 0.35;
|
|
208
203
|
export const LINE_FACTOR: 1.35;
|
|
209
|
-
export
|
|
210
|
-
declare const MissingPDFException_base: any;
|
|
211
|
-
export class MissingPDFException extends MissingPDFException_base {
|
|
212
|
-
[x: string]: any;
|
|
213
|
-
constructor(msg: any);
|
|
214
|
-
}
|
|
204
|
+
export function MathClamp(v: any, min: any, max: any): number;
|
|
215
205
|
export function normalizeUnicode(str: any): any;
|
|
216
|
-
export function objectFromMap(map: any): any;
|
|
217
206
|
export function objectSize(obj: any): number;
|
|
218
207
|
export namespace OPS {
|
|
219
|
-
let dependency: number;
|
|
220
|
-
let setLineWidth: number;
|
|
221
|
-
let setLineCap: number;
|
|
222
|
-
let setLineJoin: number;
|
|
223
|
-
let setMiterLimit: number;
|
|
224
|
-
let setDash: number;
|
|
225
|
-
let setRenderingIntent: number;
|
|
226
|
-
let setFlatness: number;
|
|
227
|
-
let setGState: number;
|
|
228
|
-
let save: number;
|
|
229
|
-
let restore: number;
|
|
230
|
-
let transform: number;
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
let
|
|
234
|
-
|
|
235
|
-
let
|
|
236
|
-
|
|
237
|
-
let
|
|
238
|
-
let
|
|
239
|
-
let
|
|
240
|
-
|
|
241
|
-
let
|
|
242
|
-
let
|
|
243
|
-
let
|
|
244
|
-
let
|
|
245
|
-
let
|
|
246
|
-
let
|
|
247
|
-
let
|
|
248
|
-
let
|
|
249
|
-
let
|
|
250
|
-
let
|
|
251
|
-
let
|
|
252
|
-
let
|
|
253
|
-
let
|
|
254
|
-
let
|
|
255
|
-
let
|
|
256
|
-
let
|
|
257
|
-
let
|
|
258
|
-
let
|
|
259
|
-
let
|
|
260
|
-
let
|
|
261
|
-
let
|
|
262
|
-
let
|
|
263
|
-
let
|
|
264
|
-
let
|
|
265
|
-
let
|
|
266
|
-
let
|
|
267
|
-
let
|
|
268
|
-
let
|
|
269
|
-
let
|
|
270
|
-
let
|
|
271
|
-
let
|
|
272
|
-
let
|
|
273
|
-
let
|
|
274
|
-
let
|
|
275
|
-
let
|
|
276
|
-
let
|
|
277
|
-
let
|
|
278
|
-
let
|
|
279
|
-
let
|
|
280
|
-
let
|
|
281
|
-
let
|
|
282
|
-
let
|
|
283
|
-
let
|
|
284
|
-
let
|
|
285
|
-
let
|
|
286
|
-
let
|
|
287
|
-
let
|
|
288
|
-
let
|
|
289
|
-
let
|
|
290
|
-
let
|
|
291
|
-
let
|
|
292
|
-
let
|
|
293
|
-
let
|
|
294
|
-
let
|
|
295
|
-
let
|
|
296
|
-
let
|
|
297
|
-
let
|
|
298
|
-
let
|
|
299
|
-
let
|
|
300
|
-
let
|
|
301
|
-
let
|
|
302
|
-
let
|
|
303
|
-
let
|
|
304
|
-
let
|
|
305
|
-
let
|
|
306
|
-
let
|
|
307
|
-
let
|
|
308
|
-
let
|
|
208
|
+
export let dependency: number;
|
|
209
|
+
export let setLineWidth: number;
|
|
210
|
+
export let setLineCap: number;
|
|
211
|
+
export let setLineJoin: number;
|
|
212
|
+
export let setMiterLimit: number;
|
|
213
|
+
export let setDash: number;
|
|
214
|
+
export let setRenderingIntent: number;
|
|
215
|
+
export let setFlatness: number;
|
|
216
|
+
export let setGState: number;
|
|
217
|
+
export let save: number;
|
|
218
|
+
export let restore: number;
|
|
219
|
+
export let transform: number;
|
|
220
|
+
let moveTo_1: number;
|
|
221
|
+
export { moveTo_1 as moveTo };
|
|
222
|
+
let lineTo_1: number;
|
|
223
|
+
export { lineTo_1 as lineTo };
|
|
224
|
+
let curveTo_1: number;
|
|
225
|
+
export { curveTo_1 as curveTo };
|
|
226
|
+
export let curveTo2: number;
|
|
227
|
+
export let curveTo3: number;
|
|
228
|
+
let closePath_1: number;
|
|
229
|
+
export { closePath_1 as closePath };
|
|
230
|
+
export let rectangle: number;
|
|
231
|
+
export let stroke: number;
|
|
232
|
+
export let closeStroke: number;
|
|
233
|
+
export let fill: number;
|
|
234
|
+
export let eoFill: number;
|
|
235
|
+
export let fillStroke: number;
|
|
236
|
+
export let eoFillStroke: number;
|
|
237
|
+
export let closeFillStroke: number;
|
|
238
|
+
export let closeEOFillStroke: number;
|
|
239
|
+
export let endPath: number;
|
|
240
|
+
export let clip: number;
|
|
241
|
+
export let eoClip: number;
|
|
242
|
+
export let beginText: number;
|
|
243
|
+
export let endText: number;
|
|
244
|
+
export let setCharSpacing: number;
|
|
245
|
+
export let setWordSpacing: number;
|
|
246
|
+
export let setHScale: number;
|
|
247
|
+
export let setLeading: number;
|
|
248
|
+
export let setFont: number;
|
|
249
|
+
export let setTextRenderingMode: number;
|
|
250
|
+
export let setTextRise: number;
|
|
251
|
+
export let moveText: number;
|
|
252
|
+
export let setLeadingMoveText: number;
|
|
253
|
+
export let setTextMatrix: number;
|
|
254
|
+
export let nextLine: number;
|
|
255
|
+
export let showText: number;
|
|
256
|
+
export let showSpacedText: number;
|
|
257
|
+
export let nextLineShowText: number;
|
|
258
|
+
export let nextLineSetSpacingShowText: number;
|
|
259
|
+
export let setCharWidth: number;
|
|
260
|
+
export let setCharWidthAndBounds: number;
|
|
261
|
+
export let setStrokeColorSpace: number;
|
|
262
|
+
export let setFillColorSpace: number;
|
|
263
|
+
export let setStrokeColor: number;
|
|
264
|
+
export let setStrokeColorN: number;
|
|
265
|
+
export let setFillColor: number;
|
|
266
|
+
export let setFillColorN: number;
|
|
267
|
+
export let setStrokeGray: number;
|
|
268
|
+
export let setFillGray: number;
|
|
269
|
+
export let setStrokeRGBColor: number;
|
|
270
|
+
export let setFillRGBColor: number;
|
|
271
|
+
export let setStrokeCMYKColor: number;
|
|
272
|
+
export let setFillCMYKColor: number;
|
|
273
|
+
export let shadingFill: number;
|
|
274
|
+
export let beginInlineImage: number;
|
|
275
|
+
export let beginImageData: number;
|
|
276
|
+
export let endInlineImage: number;
|
|
277
|
+
export let paintXObject: number;
|
|
278
|
+
export let markPoint: number;
|
|
279
|
+
export let markPointProps: number;
|
|
280
|
+
export let beginMarkedContent: number;
|
|
281
|
+
export let beginMarkedContentProps: number;
|
|
282
|
+
export let endMarkedContent: number;
|
|
283
|
+
export let beginCompat: number;
|
|
284
|
+
export let endCompat: number;
|
|
285
|
+
export let paintFormXObjectBegin: number;
|
|
286
|
+
export let paintFormXObjectEnd: number;
|
|
287
|
+
export let beginGroup: number;
|
|
288
|
+
export let endGroup: number;
|
|
289
|
+
export let beginAnnotation: number;
|
|
290
|
+
export let endAnnotation: number;
|
|
291
|
+
export let paintImageMaskXObject: number;
|
|
292
|
+
export let paintImageMaskXObjectGroup: number;
|
|
293
|
+
export let paintImageXObject: number;
|
|
294
|
+
export let paintInlineImageXObject: number;
|
|
295
|
+
export let paintInlineImageXObjectGroup: number;
|
|
296
|
+
export let paintImageXObjectRepeat: number;
|
|
297
|
+
export let paintImageMaskXObjectRepeat: number;
|
|
298
|
+
export let paintSolidColorImageMask: number;
|
|
299
|
+
export let constructPath: number;
|
|
300
|
+
export let setStrokeTransparent: number;
|
|
301
|
+
export let setFillTransparent: number;
|
|
302
|
+
export let rawFillPath: number;
|
|
309
303
|
}
|
|
310
304
|
export namespace PageActionEventType {
|
|
311
305
|
export let O: string;
|
|
@@ -338,18 +332,24 @@ export namespace RenderingIntentFlag {
|
|
|
338
332
|
export let DISPLAY: number;
|
|
339
333
|
let PRINT_2: number;
|
|
340
334
|
export { PRINT_2 as PRINT };
|
|
341
|
-
let
|
|
342
|
-
export { SAVE_1 as SAVE };
|
|
335
|
+
export let SAVE: number;
|
|
343
336
|
export let ANNOTATIONS_FORMS: number;
|
|
344
337
|
export let ANNOTATIONS_STORAGE: number;
|
|
345
338
|
export let ANNOTATIONS_DISABLE: number;
|
|
346
339
|
export let IS_EDITING: number;
|
|
347
340
|
export let OPLIST: number;
|
|
348
341
|
}
|
|
342
|
+
declare const ResponseException_base: any;
|
|
343
|
+
export class ResponseException extends ResponseException_base {
|
|
344
|
+
[x: string]: any;
|
|
345
|
+
constructor(msg: any, status: any, missing: any);
|
|
346
|
+
status: any;
|
|
347
|
+
missing: any;
|
|
348
|
+
}
|
|
349
349
|
export function setVerbosityLevel(level: any): void;
|
|
350
350
|
export function shadow(obj: any, prop: any, value: any, nonSerializable?: boolean): any;
|
|
351
351
|
export function string32(value: any): string;
|
|
352
|
-
export function stringToBytes(str: any): Uint8Array
|
|
352
|
+
export function stringToBytes(str: any): Uint8Array<any>;
|
|
353
353
|
export function stringToPDFString(str: any): string;
|
|
354
354
|
export function stringToUTF8String(str: any): string;
|
|
355
355
|
export namespace TextRenderingMode {
|
|
@@ -365,12 +365,8 @@ export namespace TextRenderingMode {
|
|
|
365
365
|
export let FILL_STROKE_MASK: number;
|
|
366
366
|
export let ADD_TO_PATH_FLAG: number;
|
|
367
367
|
}
|
|
368
|
-
|
|
369
|
-
export
|
|
370
|
-
[x: string]: any;
|
|
371
|
-
constructor(msg: any, status: any);
|
|
372
|
-
status: any;
|
|
373
|
-
}
|
|
368
|
+
export function toBase64Util(arr: any): any;
|
|
369
|
+
export function toHexUtil(arr: any): any;
|
|
374
370
|
declare const UnknownErrorException_base: any;
|
|
375
371
|
export class UnknownErrorException extends UnknownErrorException_base {
|
|
376
372
|
[x: string]: any;
|
|
@@ -378,21 +374,33 @@ export class UnknownErrorException extends UnknownErrorException_base {
|
|
|
378
374
|
details: any;
|
|
379
375
|
}
|
|
380
376
|
export function unreachable(msg: any): void;
|
|
377
|
+
/**
|
|
378
|
+
* Remove, or replace, the hash property of the URL.
|
|
379
|
+
*
|
|
380
|
+
* @param {URL|string} url - The absolute, or relative, URL.
|
|
381
|
+
* @param {string} hash - The hash property (use an empty string to remove it).
|
|
382
|
+
* @param {boolean} [allowRel] - Allow relative URLs.
|
|
383
|
+
* @returns {string} The resulting URL string.
|
|
384
|
+
*/
|
|
385
|
+
export function updateUrlHash(url: URL | string, hash: string, allowRel?: boolean): string;
|
|
381
386
|
export function utf8StringToString(str: any): string;
|
|
382
387
|
export class Util {
|
|
383
388
|
static makeHexColor(r: any, g: any, b: any): string;
|
|
384
389
|
static scaleMinMax(transform: any, minMax: any): void;
|
|
385
390
|
static transform(m1: any, m2: any): any[];
|
|
386
|
-
static applyTransform(p: any, m: any):
|
|
387
|
-
static
|
|
388
|
-
static
|
|
391
|
+
static applyTransform(p: any, m: any, pos?: number): void;
|
|
392
|
+
static applyTransformToBezier(p: any, transform: any, pos?: number): void;
|
|
393
|
+
static applyInverseTransform(p: any, m: any): void;
|
|
394
|
+
static axialAlignedBoundingBox(rect: any, transform: any, output: any): void;
|
|
389
395
|
static inverseTransform(m: any): number[];
|
|
390
|
-
static singularValueDecompose2dScale(
|
|
396
|
+
static singularValueDecompose2dScale(matrix: any, output: any): void;
|
|
391
397
|
static normalizeRect(rect: any): any;
|
|
392
398
|
static intersect(rect1: any, rect2: any): number[] | null;
|
|
399
|
+
static pointBoundingBox(x: any, y: any, minMax: any): void;
|
|
400
|
+
static rectBoundingBox(x0: any, y0: any, x1: any, y1: any, minMax: any): void;
|
|
393
401
|
static "__#1@#getExtremumOnCurve"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
|
|
394
402
|
static "__#1@#getExtremum"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, a: any, b: any, c: any, minMax: any): void;
|
|
395
|
-
static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any):
|
|
403
|
+
static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): void;
|
|
396
404
|
}
|
|
397
405
|
export namespace VerbosityLevel {
|
|
398
406
|
let ERRORS: number;
|
|
@@ -4,27 +4,42 @@ export type AnnotationEditorUIManager = import("../src/display/editor/tools.js")
|
|
|
4
4
|
export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
|
|
5
5
|
export type IL10n = import("./interfaces").IL10n;
|
|
6
6
|
export type AnnotationLayer = import("../src/display/annotation_layer.js").AnnotationLayer;
|
|
7
|
+
export type StructTreeLayerBuilder = any;
|
|
7
8
|
export type AnnotationEditorLayerBuilderOptions = {
|
|
8
9
|
uiManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
|
|
9
10
|
pdfPage: PDFPageProxy;
|
|
10
11
|
l10n?: import("./interfaces").IL10n | undefined;
|
|
12
|
+
structTreeLayer?: StructTreeLayerBuilder;
|
|
11
13
|
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
12
14
|
annotationLayer?: import("../src/pdf").AnnotationLayer | undefined;
|
|
13
|
-
textLayer?:
|
|
14
|
-
drawLayer?:
|
|
15
|
+
textLayer?: TextLayer;
|
|
16
|
+
drawLayer?: DrawLayer;
|
|
15
17
|
onAppend?: Function | undefined;
|
|
16
18
|
};
|
|
19
|
+
export type AnnotationEditorLayerBuilderRenderOptions = {
|
|
20
|
+
viewport: PageViewport;
|
|
21
|
+
/**
|
|
22
|
+
* - The default value is "display".
|
|
23
|
+
*/
|
|
24
|
+
intent?: string | undefined;
|
|
25
|
+
};
|
|
17
26
|
/**
|
|
18
27
|
* @typedef {Object} AnnotationEditorLayerBuilderOptions
|
|
19
28
|
* @property {AnnotationEditorUIManager} [uiManager]
|
|
20
29
|
* @property {PDFPageProxy} pdfPage
|
|
21
30
|
* @property {IL10n} [l10n]
|
|
31
|
+
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
22
32
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
23
33
|
* @property {AnnotationLayer} [annotationLayer]
|
|
24
34
|
* @property {TextLayer} [textLayer]
|
|
25
35
|
* @property {DrawLayer} [drawLayer]
|
|
26
36
|
* @property {function} [onAppend]
|
|
27
37
|
*/
|
|
38
|
+
/**
|
|
39
|
+
* @typedef {Object} AnnotationEditorLayerBuilderRenderOptions
|
|
40
|
+
* @property {PageViewport} viewport
|
|
41
|
+
* @property {string} [intent] - The default value is "display".
|
|
42
|
+
*/
|
|
28
43
|
export class AnnotationEditorLayerBuilder {
|
|
29
44
|
/**
|
|
30
45
|
* @param {AnnotationEditorLayerBuilderOptions} options
|
|
@@ -37,10 +52,10 @@ export class AnnotationEditorLayerBuilder {
|
|
|
37
52
|
div: HTMLDivElement | null;
|
|
38
53
|
_cancelled: boolean;
|
|
39
54
|
/**
|
|
40
|
-
* @param {
|
|
41
|
-
* @
|
|
55
|
+
* @param {AnnotationEditorLayerBuilderRenderOptions} options
|
|
56
|
+
* @returns {Promise<void>}
|
|
42
57
|
*/
|
|
43
|
-
render(viewport
|
|
58
|
+
render({ viewport, intent }: AnnotationEditorLayerBuilderRenderOptions): Promise<void>;
|
|
44
59
|
cancel(): void;
|
|
45
60
|
hide(): void;
|
|
46
61
|
show(): void;
|
|
@@ -3,6 +3,7 @@ export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
|
3
3
|
export type AnnotationStorage = import("../src/display/annotation_storage").AnnotationStorage;
|
|
4
4
|
export type IDownloadManager = import("./interfaces").IDownloadManager;
|
|
5
5
|
export type IPDFLinkService = import("./interfaces").IPDFLinkService;
|
|
6
|
+
export type StructTreeLayerBuilder = import("./struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
6
7
|
export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
|
|
7
8
|
export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
|
|
8
9
|
export type AnnotationLayerBuilderOptions = {
|
|
@@ -26,6 +27,19 @@ export type AnnotationLayerBuilderOptions = {
|
|
|
26
27
|
annotationEditorUIManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
|
|
27
28
|
onAppend?: Function | undefined;
|
|
28
29
|
};
|
|
30
|
+
export type AnnotationLayerBuilderRenderOptions = {
|
|
31
|
+
viewport: PageViewport;
|
|
32
|
+
/**
|
|
33
|
+
* - The default value is "display".
|
|
34
|
+
*/
|
|
35
|
+
intent?: string | undefined;
|
|
36
|
+
structTreeLayer?: import("./struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
|
37
|
+
};
|
|
38
|
+
export type InjectLinkAnnotationsOptions = {
|
|
39
|
+
inferredLinks: Array<Object>;
|
|
40
|
+
viewport: PageViewport;
|
|
41
|
+
structTreeLayer?: import("./struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
|
42
|
+
};
|
|
29
43
|
/**
|
|
30
44
|
* @typedef {Object} AnnotationLayerBuilderOptions
|
|
31
45
|
* @property {PDFPageProxy} pdfPage
|
|
@@ -44,6 +58,18 @@ export type AnnotationLayerBuilderOptions = {
|
|
|
44
58
|
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
|
45
59
|
* @property {function} [onAppend]
|
|
46
60
|
*/
|
|
61
|
+
/**
|
|
62
|
+
* @typedef {Object} AnnotationLayerBuilderRenderOptions
|
|
63
|
+
* @property {PageViewport} viewport
|
|
64
|
+
* @property {string} [intent] - The default value is "display".
|
|
65
|
+
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* @typedef {Object} InjectLinkAnnotationsOptions
|
|
69
|
+
* @property {Array<Object>} inferredLinks
|
|
70
|
+
* @property {PageViewport} viewport
|
|
71
|
+
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
72
|
+
*/
|
|
47
73
|
export class AnnotationLayerBuilder {
|
|
48
74
|
/**
|
|
49
75
|
* @param {AnnotationLayerBuilderOptions} options
|
|
@@ -68,15 +94,20 @@ export class AnnotationLayerBuilder {
|
|
|
68
94
|
_cancelled: boolean;
|
|
69
95
|
_eventBus: any;
|
|
70
96
|
/**
|
|
71
|
-
* @param {
|
|
72
|
-
* @param {string} intent (default value is 'display')
|
|
97
|
+
* @param {AnnotationLayerBuilderRenderOptions} options
|
|
73
98
|
* @returns {Promise<void>} A promise that is resolved when rendering of the
|
|
74
99
|
* annotations is complete.
|
|
75
100
|
*/
|
|
76
|
-
render(viewport
|
|
101
|
+
render({ viewport, intent, structTreeLayer }: AnnotationLayerBuilderRenderOptions): Promise<void>;
|
|
77
102
|
cancel(): void;
|
|
78
|
-
hide(): void;
|
|
103
|
+
hide(internal?: boolean): void;
|
|
79
104
|
hasEditableAnnotations(): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* @param {InjectLinkAnnotationsOptions} options
|
|
107
|
+
* @returns {Promise<void>} A promise that is resolved when the inferred links
|
|
108
|
+
* are added to the annotation layer.
|
|
109
|
+
*/
|
|
110
|
+
injectLinkAnnotations({ inferredLinks, viewport, structTreeLayer, }: InjectLinkAnnotationsOptions): Promise<void>;
|
|
80
111
|
#private;
|
|
81
112
|
}
|
|
82
113
|
import { AnnotationLayer } from "../src/pdf";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class Autolinker {
|
|
2
|
+
static "__#73@#index": number;
|
|
3
|
+
static "__#73@#regex": any;
|
|
4
|
+
static findLinks(text: any): {
|
|
5
|
+
url: string;
|
|
6
|
+
index: any;
|
|
7
|
+
length: any;
|
|
8
|
+
}[];
|
|
9
|
+
static processLinks(pdfPageView: any): ({
|
|
10
|
+
borderStyle: null;
|
|
11
|
+
rect: any;
|
|
12
|
+
quadPoints?: undefined;
|
|
13
|
+
id: string;
|
|
14
|
+
unsafeUrl: any;
|
|
15
|
+
url: any;
|
|
16
|
+
annotationType: number;
|
|
17
|
+
rotation: number;
|
|
18
|
+
} | {
|
|
19
|
+
borderStyle: null;
|
|
20
|
+
quadPoints: any[];
|
|
21
|
+
rect: number[];
|
|
22
|
+
id: string;
|
|
23
|
+
unsafeUrl: any;
|
|
24
|
+
url: any;
|
|
25
|
+
annotationType: number;
|
|
26
|
+
rotation: number;
|
|
27
|
+
})[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class BasePDFPageView {
|
|
2
|
+
constructor(options: any);
|
|
3
|
+
canvas: null;
|
|
4
|
+
/** @type {null | HTMLDivElement} */
|
|
5
|
+
div: null | HTMLDivElement;
|
|
6
|
+
eventBus: null;
|
|
7
|
+
id: null;
|
|
8
|
+
pageColors: null;
|
|
9
|
+
renderingQueue: null;
|
|
10
|
+
renderTask: null;
|
|
11
|
+
resume: null;
|
|
12
|
+
set renderingState(state: number);
|
|
13
|
+
get renderingState(): number;
|
|
14
|
+
_createCanvas(onShow: any, hideUntilComplete?: boolean): {
|
|
15
|
+
canvas: HTMLCanvasElement;
|
|
16
|
+
prevCanvas: null;
|
|
17
|
+
ctx: CanvasRenderingContext2D | null;
|
|
18
|
+
};
|
|
19
|
+
_resetCanvas(): void;
|
|
20
|
+
_drawCanvas(options: any, onCancel: any, onFinish: any): Promise<void>;
|
|
21
|
+
cancelRendering({ cancelExtraDelay }?: {
|
|
22
|
+
cancelExtraDelay?: number | undefined;
|
|
23
|
+
}): void;
|
|
24
|
+
dispatchPageRender(): void;
|
|
25
|
+
dispatchPageRendered(cssTransform: any, isDetailView: any): void;
|
|
26
|
+
#private;
|
|
27
|
+
}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
export type DrawLayerBuilderOptions = {
|
|
2
2
|
pageIndex: number;
|
|
3
3
|
};
|
|
4
|
+
export type DrawLayerBuilderRenderOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* - The default value is "display".
|
|
7
|
+
*/
|
|
8
|
+
intent?: string | undefined;
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
11
|
* @typedef {Object} DrawLayerBuilderOptions
|
|
6
12
|
* @property {number} pageIndex
|
|
7
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {Object} DrawLayerBuilderRenderOptions
|
|
16
|
+
* @property {string} [intent] - The default value is "display".
|
|
17
|
+
*/
|
|
8
18
|
export class DrawLayerBuilder {
|
|
9
19
|
/**
|
|
10
20
|
* @param {DrawLayerBuilderOptions} options
|
|
@@ -12,9 +22,10 @@ export class DrawLayerBuilder {
|
|
|
12
22
|
constructor(options: DrawLayerBuilderOptions);
|
|
13
23
|
pageIndex: number;
|
|
14
24
|
/**
|
|
15
|
-
* @param {
|
|
25
|
+
* @param {DrawLayerBuilderRenderOptions} options
|
|
26
|
+
* @returns {Promise<void>}
|
|
16
27
|
*/
|
|
17
|
-
render(intent
|
|
28
|
+
render({ intent }: DrawLayerBuilderRenderOptions): Promise<void>;
|
|
18
29
|
cancel(): void;
|
|
19
30
|
_cancelled: boolean | undefined;
|
|
20
31
|
setParent(parent: any): void;
|
|
@@ -24,13 +24,13 @@ export class EventBus {
|
|
|
24
24
|
* @param {function} listener
|
|
25
25
|
* @param {Object} [options]
|
|
26
26
|
*/
|
|
27
|
-
on(eventName: string, listener: Function, options?: Object
|
|
27
|
+
on(eventName: string, listener: Function, options?: Object): void;
|
|
28
28
|
/**
|
|
29
29
|
* @param {string} eventName
|
|
30
30
|
* @param {function} listener
|
|
31
31
|
* @param {Object} [options]
|
|
32
32
|
*/
|
|
33
|
-
off(eventName: string, listener: Function, options?: Object
|
|
33
|
+
off(eventName: string, listener: Function, options?: Object): void;
|
|
34
34
|
/**
|
|
35
35
|
* @param {string} eventName
|
|
36
36
|
* @param {Object} data
|