pdfjs-serverless 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +11 -8
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.mjs +236 -200
  4. package/dist/types/external/webL10n/l10n.d.ts +0 -0
  5. package/dist/types/src/display/annotation_layer.d.ts +203 -0
  6. package/dist/types/src/display/annotation_storage.d.ts +89 -0
  7. package/dist/types/src/display/api.d.ts +1472 -0
  8. package/dist/types/src/display/base_factory.d.ts +54 -0
  9. package/dist/types/src/display/canvas.d.ts +208 -0
  10. package/dist/types/src/display/display_utils.d.ts +277 -0
  11. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +182 -0
  12. package/dist/types/src/display/editor/editor.d.ts +308 -0
  13. package/dist/types/src/display/editor/freetext.d.ts +72 -0
  14. package/dist/types/src/display/editor/ink.d.ts +95 -0
  15. package/dist/types/src/display/editor/stamp.d.ts +22 -0
  16. package/dist/types/src/display/editor/tools.d.ts +324 -0
  17. package/dist/types/src/display/font_loader.d.ts +43 -0
  18. package/dist/types/src/display/metadata.d.ts +11 -0
  19. package/dist/types/src/display/optional_content_config.d.ts +13 -0
  20. package/dist/types/src/display/pattern_helper.d.ts +73 -0
  21. package/dist/types/src/display/text_layer.d.ts +151 -0
  22. package/dist/types/src/display/transport_stream.d.ts +68 -0
  23. package/dist/types/src/display/worker_options.d.ts +27 -0
  24. package/dist/types/src/display/xfa_layer.d.ts +46 -0
  25. package/dist/types/src/display/xfa_text.d.ts +19 -0
  26. package/dist/types/src/pdf.d.ts +50 -0
  27. package/dist/types/src/shared/image_utils.d.ts +17 -0
  28. package/dist/types/src/shared/message_handler.d.ts +43 -0
  29. package/dist/types/src/shared/murmurhash3.d.ts +7 -0
  30. package/dist/types/src/shared/scripting_utils.d.ts +12 -0
  31. package/dist/types/src/shared/util.d.ts +396 -0
  32. package/dist/types/web/annotation_editor_layer_builder.d.ts +50 -0
  33. package/dist/types/web/annotation_layer_builder.d.ts +83 -0
  34. package/dist/types/web/app_options.d.ts +14 -0
  35. package/dist/types/web/download_manager.d.ts +14 -0
  36. package/dist/types/web/event_utils.d.ts +75 -0
  37. package/dist/types/web/generic_scripting.d.ts +8 -0
  38. package/dist/types/web/genericl10n.d.ts +13 -0
  39. package/dist/types/web/interfaces.d.ts +163 -0
  40. package/dist/types/web/l10n_utils.d.ts +7 -0
  41. package/dist/types/web/pdf_find_controller.d.ts +108 -0
  42. package/dist/types/web/pdf_find_utils.d.ts +16 -0
  43. package/dist/types/web/pdf_history.d.ts +168 -0
  44. package/dist/types/web/pdf_link_service.d.ts +243 -0
  45. package/dist/types/web/pdf_page_view.d.ts +209 -0
  46. package/dist/types/web/pdf_rendering_queue.d.ts +53 -0
  47. package/dist/types/web/pdf_scripting_manager.component.d.ts +5 -0
  48. package/dist/types/web/pdf_scripting_manager.d.ts +61 -0
  49. package/dist/types/web/pdf_single_page_viewer.d.ts +7 -0
  50. package/dist/types/web/pdf_thumbnail_view.d.ts +131 -0
  51. package/dist/types/web/pdf_thumbnail_viewer.d.ts +104 -0
  52. package/dist/types/web/pdf_viewer.component.d.ts +24 -0
  53. package/dist/types/web/pdf_viewer.d.ts +455 -0
  54. package/dist/types/web/struct_tree_layer_builder.d.ts +7 -0
  55. package/dist/types/web/text_accessibility.d.ts +42 -0
  56. package/dist/types/web/text_highlighter.d.ts +63 -0
  57. package/dist/types/web/text_layer_builder.d.ts +64 -0
  58. package/dist/types/web/ui_utils.d.ts +288 -0
  59. package/dist/types/web/xfa_layer_builder.d.ts +41 -0
  60. package/package.json +9 -7
@@ -0,0 +1,324 @@
1
+ export type AnnotationEditor = import("./editor.js").AnnotationEditor;
2
+ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;
3
+ /**
4
+ * A pdf has several pages and each of them when it will rendered
5
+ * will have an AnnotationEditorLayer which will contain the some
6
+ * new Annotations associated to an editor in order to modify them.
7
+ *
8
+ * This class is used to manage all the different layers, editors and
9
+ * some action like copy/paste, undo/redo, ...
10
+ */
11
+ export class AnnotationEditorUIManager {
12
+ static TRANSLATE_SMALL: number;
13
+ static TRANSLATE_BIG: number;
14
+ static get _keyboardManager(): any;
15
+ constructor(container: any, eventBus: any, pdfDocument: any, pageColors: any);
16
+ viewParameters: {
17
+ realScale: number;
18
+ rotation: number;
19
+ };
20
+ destroy(): void;
21
+ get hcmFilter(): any;
22
+ onPageChanging({ pageNumber }: {
23
+ pageNumber: any;
24
+ }): void;
25
+ focusMainContainer(): void;
26
+ addShouldRescale(editor: any): void;
27
+ removeShouldRescale(editor: any): void;
28
+ onScaleChanging({ scale }: {
29
+ scale: any;
30
+ }): void;
31
+ onRotationChanging({ pagesRotation }: {
32
+ pagesRotation: any;
33
+ }): void;
34
+ /**
35
+ * Add an editor in the annotation storage.
36
+ * @param {AnnotationEditor} editor
37
+ */
38
+ addToAnnotationStorage(editor: AnnotationEditor): void;
39
+ /**
40
+ * Copy callback.
41
+ * @param {ClipboardEvent} event
42
+ */
43
+ copy(event: ClipboardEvent): void;
44
+ /**
45
+ * Cut callback.
46
+ * @param {ClipboardEvent} event
47
+ */
48
+ cut(event: ClipboardEvent): void;
49
+ /**
50
+ * Paste callback.
51
+ * @param {ClipboardEvent} event
52
+ */
53
+ paste(event: ClipboardEvent): void;
54
+ /**
55
+ * Keydown callback.
56
+ * @param {KeyboardEvent} event
57
+ */
58
+ keydown(event: KeyboardEvent): void;
59
+ /**
60
+ * Execute an action for a given name.
61
+ * For example, the user can click on the "Undo" entry in the context menu
62
+ * and it'll trigger the undo action.
63
+ * @param {Object} details
64
+ */
65
+ onEditingAction(details: Object): void;
66
+ /**
67
+ * Set the editing state.
68
+ * It can be useful to temporarily disable it when the user is editing a
69
+ * FreeText annotation.
70
+ * @param {boolean} isEditing
71
+ */
72
+ setEditingState(isEditing: boolean): void;
73
+ registerEditorTypes(types: any): void;
74
+ /**
75
+ * Get an id.
76
+ * @returns {string}
77
+ */
78
+ getId(): string;
79
+ get currentLayer(): any;
80
+ get currentPageIndex(): number;
81
+ /**
82
+ * Add a new layer for a page which will contains the editors.
83
+ * @param {AnnotationEditorLayer} layer
84
+ */
85
+ addLayer(layer: AnnotationEditorLayer): void;
86
+ /**
87
+ * Remove a layer.
88
+ * @param {AnnotationEditorLayer} layer
89
+ */
90
+ removeLayer(layer: AnnotationEditorLayer): void;
91
+ /**
92
+ * Change the editor mode (None, FreeText, Ink, ...)
93
+ * @param {number} mode
94
+ * @param {string|null} editId
95
+ */
96
+ updateMode(mode: number, editId?: string | null): void;
97
+ /**
98
+ * Update the toolbar if it's required to reflect the tool currently used.
99
+ * @param {number} mode
100
+ * @returns {undefined}
101
+ */
102
+ updateToolbar(mode: number): undefined;
103
+ /**
104
+ * Update a parameter in the current editor or globally.
105
+ * @param {number} type
106
+ * @param {*} value
107
+ */
108
+ updateParams(type: number, value: any): void;
109
+ /**
110
+ * Get all the editors belonging to a give page.
111
+ * @param {number} pageIndex
112
+ * @returns {Array<AnnotationEditor>}
113
+ */
114
+ getEditors(pageIndex: number): Array<AnnotationEditor>;
115
+ /**
116
+ * Get an editor with the given id.
117
+ * @param {string} id
118
+ * @returns {AnnotationEditor}
119
+ */
120
+ getEditor(id: string): AnnotationEditor;
121
+ /**
122
+ * Add a new editor.
123
+ * @param {AnnotationEditor} editor
124
+ */
125
+ addEditor(editor: AnnotationEditor): void;
126
+ /**
127
+ * Remove an editor.
128
+ * @param {AnnotationEditor} editor
129
+ */
130
+ removeEditor(editor: AnnotationEditor): void;
131
+ /**
132
+ * The annotation element with the given id has been deleted.
133
+ * @param {AnnotationEditor} editor
134
+ */
135
+ addDeletedAnnotationElement(editor: AnnotationEditor): void;
136
+ /**
137
+ * Check if the annotation element with the given id has been deleted.
138
+ * @param {string} annotationElementId
139
+ * @returns {boolean}
140
+ */
141
+ isDeletedAnnotationElement(annotationElementId: string): boolean;
142
+ /**
143
+ * The annotation element with the given id have been restored.
144
+ * @param {AnnotationEditor} editor
145
+ */
146
+ removeDeletedAnnotationElement(editor: AnnotationEditor): void;
147
+ /**
148
+ * Set the given editor as the active one.
149
+ * @param {AnnotationEditor} editor
150
+ */
151
+ setActiveEditor(editor: AnnotationEditor): void;
152
+ /**
153
+ * Add or remove an editor the current selection.
154
+ * @param {AnnotationEditor} editor
155
+ */
156
+ toggleSelected(editor: AnnotationEditor): void;
157
+ /**
158
+ * Set the last selected editor.
159
+ * @param {AnnotationEditor} editor
160
+ */
161
+ setSelected(editor: AnnotationEditor): void;
162
+ /**
163
+ * Check if the editor is selected.
164
+ * @param {AnnotationEditor} editor
165
+ */
166
+ isSelected(editor: AnnotationEditor): boolean;
167
+ /**
168
+ * Unselect an editor.
169
+ * @param {AnnotationEditor} editor
170
+ */
171
+ unselect(editor: AnnotationEditor): void;
172
+ get hasSelection(): boolean;
173
+ stopUndoAccumulation(): void;
174
+ /**
175
+ * Undo the last command.
176
+ */
177
+ undo(): void;
178
+ /**
179
+ * Redo the last undoed command.
180
+ */
181
+ redo(): void;
182
+ /**
183
+ * Add a command to execute (cmd) and another one to undo it.
184
+ * @param {Object} params
185
+ */
186
+ addCommands(params: Object): void;
187
+ /**
188
+ * Delete the current editor or all.
189
+ */
190
+ delete(): void;
191
+ commitOrRemove(): void;
192
+ hasSomethingToControl(): boolean;
193
+ /**
194
+ * Select all the editors.
195
+ */
196
+ selectAll(): void;
197
+ /**
198
+ * Unselect all the selected editors.
199
+ */
200
+ unselectAll(): void;
201
+ translateSelectedEditors(x: any, y: any, noCommit?: boolean): void;
202
+ /**
203
+ * Is the current editor the one passed as argument?
204
+ * @param {AnnotationEditor} editor
205
+ * @returns
206
+ */
207
+ isActive(editor: AnnotationEditor): boolean;
208
+ /**
209
+ * Get the current active editor.
210
+ * @returns {AnnotationEditor|null}
211
+ */
212
+ getActive(): AnnotationEditor | null;
213
+ /**
214
+ * Get the current editor mode.
215
+ * @returns {number}
216
+ */
217
+ getMode(): number;
218
+ get imageManager(): any;
219
+ #private;
220
+ }
221
+ export function bindEvents(obj: any, element: any, names: any): void;
222
+ export class ColorManager {
223
+ static _colorsMapping: Map<string, number[]>;
224
+ get _colors(): any;
225
+ /**
226
+ * In High Contrast Mode, the color on the screen is not always the
227
+ * real color used in the pdf.
228
+ * For example in some cases white can appear to be black but when saving
229
+ * we want to have white.
230
+ * @param {string} color
231
+ * @returns {Array<number>}
232
+ */
233
+ convert(color: string): Array<number>;
234
+ /**
235
+ * An input element must have its color value as a hex string
236
+ * and not as color name.
237
+ * So this function converts a name into an hex string.
238
+ * @param {string} name
239
+ * @returns {string}
240
+ */
241
+ getHexCode(name: string): string;
242
+ }
243
+ /**
244
+ * Class to handle undo/redo.
245
+ * Commands are just saved in a buffer.
246
+ * If we hit some memory issues we could likely use a circular buffer.
247
+ * It has to be used as a singleton.
248
+ */
249
+ export class CommandManager {
250
+ constructor(maxSize?: number);
251
+ /**
252
+ * @typedef {Object} addOptions
253
+ * @property {function} cmd
254
+ * @property {function} undo
255
+ * @property {boolean} mustExec
256
+ * @property {number} type
257
+ * @property {boolean} overwriteIfSameType
258
+ * @property {boolean} keepUndo
259
+ */
260
+ /**
261
+ * Add a new couple of commands to be used in case of redo/undo.
262
+ * @param {addOptions} options
263
+ */
264
+ add({ cmd, undo, mustExec, type, overwriteIfSameType, keepUndo, }: {
265
+ cmd: Function;
266
+ undo: Function;
267
+ mustExec: boolean;
268
+ type: number;
269
+ overwriteIfSameType: boolean;
270
+ keepUndo: boolean;
271
+ }): void;
272
+ stopUndoAccumulation(): void;
273
+ /**
274
+ * Undo the last command.
275
+ */
276
+ undo(): void;
277
+ /**
278
+ * Redo the last command.
279
+ */
280
+ redo(): void;
281
+ /**
282
+ * Check if there is something to undo.
283
+ * @returns {boolean}
284
+ */
285
+ hasSomethingToUndo(): boolean;
286
+ /**
287
+ * Check if there is something to redo.
288
+ * @returns {boolean}
289
+ */
290
+ hasSomethingToRedo(): boolean;
291
+ destroy(): void;
292
+ #private;
293
+ }
294
+ /**
295
+ * Class to handle the different keyboards shortcuts we can have on mac or
296
+ * non-mac OSes.
297
+ */
298
+ export class KeyboardManager {
299
+ /**
300
+ * Create a new keyboard manager class.
301
+ * @param {Array<Array>} callbacks - an array containing an array of shortcuts
302
+ * and a callback to call.
303
+ * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.
304
+ */
305
+ constructor(callbacks: Array<any[]>);
306
+ buffer: any[];
307
+ callbacks: Map<any, any>;
308
+ allKeys: Set<any>;
309
+ /**
310
+ * Execute a callback, if any, for a given keyboard event.
311
+ * The self is used as `this` in the callback.
312
+ * @param {Object} self.
313
+ * @param {KeyboardEvent} event
314
+ * @returns
315
+ */
316
+ exec(self: any, event: KeyboardEvent): void;
317
+ #private;
318
+ }
319
+ /**
320
+ * Convert a number between 0 and 100 into an hex number between 0 and 255.
321
+ * @param {number} opacity
322
+ * @return {string}
323
+ */
324
+ export function opacityToHex(opacity: number): string;
@@ -0,0 +1,43 @@
1
+ export class FontFaceObject {
2
+ constructor(translatedData: any, { isEvalSupported, disableFontFace, ignoreErrors, inspectFont, }: {
3
+ isEvalSupported?: boolean | undefined;
4
+ disableFontFace?: boolean | undefined;
5
+ ignoreErrors?: boolean | undefined;
6
+ inspectFont?: null | undefined;
7
+ });
8
+ compiledGlyphs: any;
9
+ isEvalSupported: boolean;
10
+ disableFontFace: boolean;
11
+ ignoreErrors: boolean;
12
+ _inspectFont: any;
13
+ createNativeFontFace(): FontFace | null;
14
+ createFontFaceRule(): string | null;
15
+ getPathGenerator(objs: any, character: any): any;
16
+ }
17
+ export class FontLoader {
18
+ constructor({ ownerDocument, styleElement, }: {
19
+ ownerDocument?: Document | undefined;
20
+ styleElement?: null | undefined;
21
+ });
22
+ _document: Document;
23
+ nativeFontFaces: Set<any>;
24
+ styleElement: HTMLStyleElement | null;
25
+ loadingRequests: any[] | undefined;
26
+ loadTestFontId: number | undefined;
27
+ addNativeFontFace(nativeFontFace: any): void;
28
+ removeNativeFontFace(nativeFontFace: any): void;
29
+ insertRule(rule: any): void;
30
+ clear(): void;
31
+ loadSystemFont(info: any): Promise<void>;
32
+ bind(font: any): Promise<void>;
33
+ get isFontLoadingAPISupported(): any;
34
+ get isSyncFontLoadingSupported(): any;
35
+ _queueLoadingCallback(callback: any): {
36
+ done: boolean;
37
+ complete: () => void;
38
+ callback: any;
39
+ };
40
+ get _loadTestFont(): any;
41
+ _prepareFontLoadEvent(font: any, request: any): void;
42
+ #private;
43
+ }
@@ -0,0 +1,11 @@
1
+ export class Metadata {
2
+ constructor({ parsedData, rawData }: {
3
+ parsedData: any;
4
+ rawData: any;
5
+ });
6
+ getRaw(): any;
7
+ get(name: any): any;
8
+ getAll(): any;
9
+ has(name: any): any;
10
+ #private;
11
+ }
@@ -0,0 +1,13 @@
1
+ export class OptionalContentConfig {
2
+ constructor(data: any);
3
+ name: any;
4
+ creator: any;
5
+ isVisible(group: any): any;
6
+ setVisibility(id: any, visible?: boolean): void;
7
+ get hasInitialVisibility(): boolean;
8
+ getOrder(): any;
9
+ getGroups(): any;
10
+ getGroup(id: any): any;
11
+ getHash(): string;
12
+ #private;
13
+ }
@@ -0,0 +1,73 @@
1
+ export function getShadingPattern(IR: any): RadialAxialShadingPattern | MeshShadingPattern | DummyShadingPattern;
2
+ export namespace PathType {
3
+ let FILL: string;
4
+ let STROKE: string;
5
+ let SHADING: string;
6
+ }
7
+ export class TilingPattern {
8
+ static MAX_PATTERN_SIZE: number;
9
+ constructor(IR: any, color: any, ctx: any, canvasGraphicsFactory: any, baseTransform: any);
10
+ operatorList: any;
11
+ matrix: any;
12
+ bbox: any;
13
+ xstep: any;
14
+ ystep: any;
15
+ paintType: any;
16
+ tilingType: any;
17
+ color: any;
18
+ ctx: any;
19
+ canvasGraphicsFactory: any;
20
+ baseTransform: any;
21
+ createPatternCanvas(owner: any): {
22
+ canvas: any;
23
+ scaleX: any;
24
+ scaleY: any;
25
+ offsetX: any;
26
+ offsetY: any;
27
+ };
28
+ getSizeAndScale(step: any, realOutputSize: any, scale: any): {
29
+ scale: any;
30
+ size: number;
31
+ };
32
+ clipBbox(graphics: any, x0: any, y0: any, x1: any, y1: any): void;
33
+ setFillAndStrokeStyleToContext(graphics: any, paintType: any, color: any): void;
34
+ getPattern(ctx: any, owner: any, inverse: any, pathType: any): any;
35
+ }
36
+ declare class RadialAxialShadingPattern extends BaseShadingPattern {
37
+ constructor(IR: any);
38
+ _type: any;
39
+ _bbox: any;
40
+ _colorStops: any;
41
+ _p0: any;
42
+ _p1: any;
43
+ _r0: any;
44
+ _r1: any;
45
+ matrix: any;
46
+ _createGradient(ctx: any): any;
47
+ getPattern(ctx: any, owner: any, inverse: any, pathType: any): any;
48
+ }
49
+ declare class MeshShadingPattern extends BaseShadingPattern {
50
+ constructor(IR: any);
51
+ _coords: any;
52
+ _colors: any;
53
+ _figures: any;
54
+ _bounds: any;
55
+ _bbox: any;
56
+ _background: any;
57
+ matrix: any;
58
+ _createMeshCanvas(combinedScale: any, backgroundColor: any, cachedCanvases: any): {
59
+ canvas: any;
60
+ offsetX: number;
61
+ offsetY: number;
62
+ scaleX: number;
63
+ scaleY: number;
64
+ };
65
+ getPattern(ctx: any, owner: any, inverse: any, pathType: any): any;
66
+ }
67
+ declare class DummyShadingPattern extends BaseShadingPattern {
68
+ getPattern(): string;
69
+ }
70
+ declare class BaseShadingPattern {
71
+ getPattern(): void;
72
+ }
73
+ export {};
@@ -0,0 +1,151 @@
1
+ export type PageViewport = import("./display_utils").PageViewport;
2
+ export type TextContent = import("./api").TextContent;
3
+ /**
4
+ * Text layer render parameters.
5
+ */
6
+ export type TextLayerRenderParameters = {
7
+ /**
8
+ * - Text content to
9
+ * render, i.e. the value returned by the page's `streamTextContent` or
10
+ * `getTextContent` method.
11
+ */
12
+ textContentSource: ReadableStream | TextContent;
13
+ /**
14
+ * - The DOM node that will contain the text
15
+ * runs.
16
+ */
17
+ container: HTMLElement;
18
+ /**
19
+ * - The target viewport to properly layout
20
+ * the text runs.
21
+ */
22
+ viewport: PageViewport;
23
+ /**
24
+ * - HTML elements that correspond to
25
+ * the text items of the textContent input.
26
+ * This is output and shall initially be set to an empty array.
27
+ */
28
+ textDivs?: HTMLElement[] | undefined;
29
+ /**
30
+ * - Some properties
31
+ * weakly mapped to the HTML elements used to render the text.
32
+ */
33
+ textDivProperties?: WeakMap<HTMLElement, Object> | undefined;
34
+ /**
35
+ * - Strings that correspond to
36
+ * the `str` property of the text items of the textContent input.
37
+ * This is output and shall initially be set to an empty array.
38
+ */
39
+ textContentItemsStr?: string[] | undefined;
40
+ /**
41
+ * true if we can use
42
+ * OffscreenCanvas to measure string widths.
43
+ */
44
+ isOffscreenCanvasSupported?: boolean | undefined;
45
+ };
46
+ /**
47
+ * Text layer update parameters.
48
+ */
49
+ export type TextLayerUpdateParameters = {
50
+ /**
51
+ * - The DOM node that will contain the text
52
+ * runs.
53
+ */
54
+ container: HTMLElement;
55
+ /**
56
+ * - The target viewport to properly layout
57
+ * the text runs.
58
+ */
59
+ viewport: PageViewport;
60
+ /**
61
+ * - HTML elements that correspond to
62
+ * the text items of the textContent input.
63
+ * This is output and shall initially be set to an empty array.
64
+ */
65
+ textDivs?: HTMLElement[] | undefined;
66
+ /**
67
+ * - Some properties
68
+ * weakly mapped to the HTML elements used to render the text.
69
+ */
70
+ textDivProperties?: WeakMap<HTMLElement, Object> | undefined;
71
+ /**
72
+ * true if we can use
73
+ * OffscreenCanvas to measure string widths.
74
+ */
75
+ isOffscreenCanvasSupported?: boolean | undefined;
76
+ /**
77
+ * true if the text layer must be rotated.
78
+ */
79
+ mustRotate?: boolean | undefined;
80
+ /**
81
+ * true if the text layer contents must be
82
+ * rescaled.
83
+ */
84
+ mustRescale?: boolean | undefined;
85
+ };
86
+ /**
87
+ * @param {TextLayerRenderParameters} params
88
+ * @returns {TextLayerRenderTask}
89
+ */
90
+ export function renderTextLayer(params: TextLayerRenderParameters): TextLayerRenderTask;
91
+ export class TextLayerRenderTask {
92
+ constructor({ textContentSource, container, viewport, textDivs, textDivProperties, textContentItemsStr, isOffscreenCanvasSupported, }: {
93
+ textContentSource: any;
94
+ container: any;
95
+ viewport: any;
96
+ textDivs: any;
97
+ textDivProperties: any;
98
+ textContentItemsStr: any;
99
+ isOffscreenCanvasSupported: any;
100
+ });
101
+ _textContentSource: any;
102
+ _isReadableStream: boolean;
103
+ _container: any;
104
+ _rootContainer: any;
105
+ _textDivs: any;
106
+ _textContentItemsStr: any;
107
+ _isOffscreenCanvasSupported: any;
108
+ _fontInspectorEnabled: boolean;
109
+ _reader: any;
110
+ _textDivProperties: any;
111
+ _canceled: boolean;
112
+ _capability: PromiseCapability;
113
+ _layoutTextParams: {
114
+ prevFontSize: null;
115
+ prevFontFamily: null;
116
+ div: null;
117
+ scale: number;
118
+ properties: null;
119
+ ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null;
120
+ };
121
+ _transform: any[];
122
+ _pageWidth: any;
123
+ _pageHeight: any;
124
+ /**
125
+ * Promise for textLayer rendering task completion.
126
+ * @type {Promise<void>}
127
+ */
128
+ get promise(): Promise<void>;
129
+ /**
130
+ * Cancel rendering of the textLayer.
131
+ */
132
+ cancel(): void;
133
+ /**
134
+ * @private
135
+ */
136
+ private _processItems;
137
+ /**
138
+ * @private
139
+ */
140
+ private _layoutText;
141
+ /**
142
+ * @private
143
+ */
144
+ private _render;
145
+ }
146
+ /**
147
+ * @param {TextLayerUpdateParameters} params
148
+ * @returns {undefined}
149
+ */
150
+ export function updateTextLayer({ container, viewport, textDivs, textDivProperties, isOffscreenCanvasSupported, mustRotate, mustRescale, }: TextLayerUpdateParameters): undefined;
151
+ import { PromiseCapability } from "../shared/util.js";
@@ -0,0 +1,68 @@
1
+ /** @implements {IPDFStream} */
2
+ export class PDFDataTransportStream implements IPDFStream {
3
+ constructor({ length, initialData, progressiveDone, contentDispositionFilename, disableRange, disableStream, }: {
4
+ length: any;
5
+ initialData: any;
6
+ progressiveDone?: boolean | undefined;
7
+ contentDispositionFilename?: null | undefined;
8
+ disableRange?: boolean | undefined;
9
+ disableStream?: boolean | undefined;
10
+ }, pdfDataRangeTransport: any);
11
+ _queuedChunks: ArrayBuffer[];
12
+ _progressiveDone: boolean;
13
+ _contentDispositionFilename: any;
14
+ _pdfDataRangeTransport: any;
15
+ _isStreamingSupported: boolean;
16
+ _isRangeSupported: boolean;
17
+ _contentLength: any;
18
+ _fullRequestReader: any;
19
+ _rangeReaders: any[];
20
+ _onReceiveData({ begin, chunk }: {
21
+ begin: any;
22
+ chunk: any;
23
+ }): void;
24
+ get _progressiveDataLength(): any;
25
+ _onProgress(evt: any): void;
26
+ _onProgressiveDone(): void;
27
+ _removeRangeReader(reader: any): void;
28
+ getFullReader(): PDFDataTransportStreamReader;
29
+ getRangeReader(begin: any, end: any): PDFDataTransportStreamRangeReader | null;
30
+ cancelAllRequests(reason: any): void;
31
+ }
32
+ /** @implements {IPDFStreamReader} */
33
+ declare class PDFDataTransportStreamReader implements IPDFStreamReader {
34
+ constructor(stream: any, queuedChunks: any, progressiveDone?: boolean, contentDispositionFilename?: null);
35
+ _stream: any;
36
+ _done: boolean;
37
+ _filename: any;
38
+ _queuedChunks: any;
39
+ _loaded: number;
40
+ _requests: any[];
41
+ _headersReady: Promise<void>;
42
+ onProgress: any;
43
+ _enqueue(chunk: any): void;
44
+ get headersReady(): Promise<void>;
45
+ get filename(): any;
46
+ get isRangeSupported(): any;
47
+ get isStreamingSupported(): any;
48
+ get contentLength(): any;
49
+ read(): Promise<any>;
50
+ cancel(reason: any): void;
51
+ progressiveDone(): void;
52
+ }
53
+ /** @implements {IPDFStreamRangeReader} */
54
+ declare class PDFDataTransportStreamRangeReader implements IPDFStreamRangeReader {
55
+ constructor(stream: any, begin: any, end: any);
56
+ _stream: any;
57
+ _begin: any;
58
+ _end: any;
59
+ _queuedChunk: any;
60
+ _requests: any[];
61
+ _done: boolean;
62
+ onProgress: any;
63
+ _enqueue(chunk: any): void;
64
+ get isStreamingSupported(): boolean;
65
+ read(): Promise<any>;
66
+ cancel(reason: any): void;
67
+ }
68
+ export {};