unpdf 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +14 -12
  2. package/dist/index.cjs +10 -16
  3. package/dist/index.d.cts +2 -0
  4. package/dist/index.d.mts +2 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.mjs +10 -16
  7. package/dist/pdfjs.mjs +1 -1
  8. package/dist/types/src/display/annotation_layer.d.ts +14 -7
  9. package/dist/types/src/display/annotation_storage.d.ts +4 -4
  10. package/dist/types/src/display/api.d.ts +14 -9
  11. package/dist/types/src/display/content_disposition.d.ts +7 -0
  12. package/dist/types/src/display/display_utils.d.ts +2 -5
  13. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +13 -8
  14. package/dist/types/src/display/editor/editor.d.ts +51 -15
  15. package/dist/types/src/display/editor/freetext.d.ts +2 -9
  16. package/dist/types/src/display/editor/ink.d.ts +6 -12
  17. package/dist/types/src/display/editor/stamp.d.ts +5 -1
  18. package/dist/types/src/display/editor/tools.d.ts +15 -4
  19. package/dist/types/src/display/fetch_stream.d.ts +68 -0
  20. package/dist/types/src/display/font_loader.d.ts +4 -1
  21. package/dist/types/src/display/network.d.ts +83 -0
  22. package/dist/types/src/display/network_utils.d.ts +14 -0
  23. package/dist/types/src/display/node_stream.d.ts +71 -0
  24. package/dist/types/src/display/node_utils.d.ts +27 -0
  25. package/dist/types/src/display/transport_stream.d.ts +3 -0
  26. package/dist/types/src/display/xfa_layer.d.ts +2 -1
  27. package/dist/types/src/display/xfa_text.d.ts +2 -0
  28. package/dist/types/src/interfaces.d.ts +118 -0
  29. package/dist/types/src/pdf.d.ts +3 -3
  30. package/dist/types/src/shared/util.d.ts +1 -0
  31. package/dist/types/web/annotation_editor_layer_builder.d.ts +8 -5
  32. package/dist/types/web/annotation_layer_builder.d.ts +12 -17
  33. package/dist/types/web/app_options.d.ts +2 -1
  34. package/dist/types/web/download_manager.d.ts +1 -1
  35. package/dist/types/web/generic_scripting.d.ts +1 -1
  36. package/dist/types/web/genericl10n.d.ts +14 -7
  37. package/dist/types/web/interfaces.d.ts +16 -8
  38. package/dist/types/web/l10n.d.ts +27 -0
  39. package/dist/types/web/l10n_utils.d.ts +7 -5
  40. package/dist/types/web/pdf_find_controller.d.ts +2 -1
  41. package/dist/types/web/pdf_link_service.d.ts +1 -1
  42. package/dist/types/web/pdf_page_view.d.ts +9 -7
  43. package/dist/types/web/pdf_thumbnail_view.d.ts +8 -15
  44. package/dist/types/web/pdf_thumbnail_viewer.d.ts +2 -8
  45. package/dist/types/web/pdf_viewer.d.ts +20 -14
  46. package/dist/types/web/text_accessibility.d.ts +5 -3
  47. package/dist/types/web/text_layer_builder.d.ts +7 -2
  48. package/dist/types/web/ui_utils.d.ts +5 -9
  49. package/dist/types/web/xfa_layer_builder.d.ts +4 -6
  50. package/package.json +18 -18
  51. package/dist/types/external/webL10n/l10n.d.ts +0 -0
@@ -0,0 +1,68 @@
1
+ /** @implements {IPDFStream} */
2
+ export class PDFFetchStream implements IPDFStream {
3
+ constructor(source: any);
4
+ source: any;
5
+ isHttp: boolean;
6
+ httpHeaders: any;
7
+ _fullRequestReader: PDFFetchStreamReader | null;
8
+ _rangeRequestReaders: any[];
9
+ get _progressiveDataLength(): number;
10
+ getFullReader(): PDFFetchStreamReader;
11
+ getRangeReader(begin: any, end: any): PDFFetchStreamRangeReader | null;
12
+ cancelAllRequests(reason: any): void;
13
+ }
14
+ /** @implements {IPDFStreamReader} */
15
+ declare class PDFFetchStreamReader implements IPDFStreamReader {
16
+ constructor(stream: any);
17
+ _stream: any;
18
+ _reader: ReadableStreamDefaultReader<Uint8Array> | null;
19
+ _loaded: number;
20
+ _filename: string | null;
21
+ _withCredentials: any;
22
+ _contentLength: any;
23
+ _headersCapability: PromiseCapability;
24
+ _disableRange: any;
25
+ _rangeChunkSize: any;
26
+ _abortController: AbortController;
27
+ _isStreamingSupported: boolean;
28
+ _isRangeSupported: boolean;
29
+ _headers: Headers;
30
+ onProgress: any;
31
+ get headersReady(): Promise<any>;
32
+ get filename(): string | null;
33
+ get contentLength(): any;
34
+ get isRangeSupported(): boolean;
35
+ get isStreamingSupported(): boolean;
36
+ read(): Promise<{
37
+ value: Uint8Array | undefined;
38
+ done: true;
39
+ } | {
40
+ value: ArrayBufferLike;
41
+ done: boolean;
42
+ }>;
43
+ cancel(reason: any): void;
44
+ }
45
+ /** @implements {IPDFStreamRangeReader} */
46
+ declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
47
+ constructor(stream: any, begin: any, end: any);
48
+ _stream: any;
49
+ _reader: ReadableStreamDefaultReader<Uint8Array> | null;
50
+ _loaded: number;
51
+ _withCredentials: any;
52
+ _readCapability: PromiseCapability;
53
+ _isStreamingSupported: boolean;
54
+ _abortController: AbortController;
55
+ _headers: Headers;
56
+ onProgress: any;
57
+ get isStreamingSupported(): boolean;
58
+ read(): Promise<{
59
+ value: Uint8Array | undefined;
60
+ done: true;
61
+ } | {
62
+ value: ArrayBufferLike;
63
+ done: boolean;
64
+ }>;
65
+ cancel(reason: any): void;
66
+ }
67
+ import { PromiseCapability } from "../shared/util.js";
68
+ export {};
@@ -28,7 +28,10 @@ export class FontLoader {
28
28
  removeNativeFontFace(nativeFontFace: any): void;
29
29
  insertRule(rule: any): void;
30
30
  clear(): void;
31
- loadSystemFont(info: any): Promise<void>;
31
+ loadSystemFont({ systemFontInfo: info, _inspectFont }: {
32
+ systemFontInfo: any;
33
+ _inspectFont: any;
34
+ }): Promise<void>;
32
35
  bind(font: any): Promise<void>;
33
36
  get isFontLoadingAPISupported(): any;
34
37
  get isSyncFontLoadingSupported(): any;
@@ -0,0 +1,83 @@
1
+ /** @implements {IPDFStream} */
2
+ export class PDFNetworkStream implements IPDFStream {
3
+ constructor(source: any);
4
+ _source: any;
5
+ _manager: NetworkManager;
6
+ _rangeChunkSize: any;
7
+ _fullRequestReader: PDFNetworkStreamFullRequestReader | null;
8
+ _rangeRequestReaders: any[];
9
+ _onRangeRequestReaderClosed(reader: any): void;
10
+ getFullReader(): PDFNetworkStreamFullRequestReader;
11
+ getRangeReader(begin: any, end: any): PDFNetworkStreamRangeRequestReader;
12
+ cancelAllRequests(reason: any): void;
13
+ }
14
+ declare class NetworkManager {
15
+ constructor(url: any, args?: {});
16
+ url: any;
17
+ isHttp: boolean;
18
+ httpHeaders: any;
19
+ withCredentials: any;
20
+ currXhrId: number;
21
+ pendingRequests: any;
22
+ requestRange(begin: any, end: any, listeners: any): number;
23
+ requestFull(listeners: any): number;
24
+ request(args: any): number;
25
+ onProgress(xhrId: any, evt: any): void;
26
+ onStateChange(xhrId: any, evt: any): void;
27
+ getRequestXhr(xhrId: any): any;
28
+ isPendingRequest(xhrId: any): boolean;
29
+ abortRequest(xhrId: any): void;
30
+ }
31
+ /** @implements {IPDFStreamReader} */
32
+ declare class PDFNetworkStreamFullRequestReader implements IPDFStreamReader {
33
+ constructor(manager: any, source: any);
34
+ _manager: any;
35
+ _url: any;
36
+ _fullRequestId: any;
37
+ _headersReceivedCapability: PromiseCapability;
38
+ _disableRange: any;
39
+ _contentLength: any;
40
+ _rangeChunkSize: any;
41
+ _isStreamingSupported: boolean;
42
+ _isRangeSupported: boolean;
43
+ _cachedChunks: any[];
44
+ _requests: any[];
45
+ _done: boolean;
46
+ _storedError: import("../shared/util.js").MissingPDFException | import("../shared/util.js").UnexpectedResponseException | undefined;
47
+ _filename: string | null;
48
+ onProgress: any;
49
+ _onHeadersReceived(): void;
50
+ _onDone(data: any): void;
51
+ _onError(status: any): void;
52
+ _onProgress(evt: any): void;
53
+ get filename(): string | null;
54
+ get isRangeSupported(): boolean;
55
+ get isStreamingSupported(): boolean;
56
+ get contentLength(): any;
57
+ get headersReady(): Promise<any>;
58
+ read(): Promise<any>;
59
+ cancel(reason: any): void;
60
+ _fullRequestReader: any;
61
+ }
62
+ /** @implements {IPDFStreamRangeReader} */
63
+ declare class PDFNetworkStreamRangeRequestReader implements IPDFStreamRangeReader {
64
+ constructor(manager: any, begin: any, end: any);
65
+ _manager: any;
66
+ _url: any;
67
+ _requestId: any;
68
+ _requests: any[];
69
+ _queuedChunk: any;
70
+ _done: boolean;
71
+ _storedError: import("../shared/util.js").MissingPDFException | import("../shared/util.js").UnexpectedResponseException | undefined;
72
+ onProgress: any;
73
+ onClosed: any;
74
+ _close(): void;
75
+ _onDone(data: any): void;
76
+ _onError(status: any): void;
77
+ _onProgress(evt: any): void;
78
+ get isStreamingSupported(): boolean;
79
+ read(): Promise<any>;
80
+ cancel(reason: any): void;
81
+ }
82
+ import { PromiseCapability } from "../shared/util.js";
83
+ export {};
@@ -0,0 +1,14 @@
1
+ export function createResponseStatusError(status: any, url: any): MissingPDFException | UnexpectedResponseException;
2
+ export function extractFilenameFromHeader(getResponseHeader: any): string | null;
3
+ export function validateRangeRequestCapabilities({ getResponseHeader, isHttp, rangeChunkSize, disableRange, }: {
4
+ getResponseHeader: any;
5
+ isHttp: any;
6
+ rangeChunkSize: any;
7
+ disableRange: any;
8
+ }): {
9
+ allowRangeRequests: boolean;
10
+ suggestedLength: undefined;
11
+ };
12
+ export function validateResponseStatus(status: any): boolean;
13
+ import { MissingPDFException } from "../shared/util.js";
14
+ import { UnexpectedResponseException } from "../shared/util.js";
@@ -0,0 +1,71 @@
1
+ export class PDFNodeStream {
2
+ constructor(source: any);
3
+ source: any;
4
+ url: any;
5
+ isHttp: boolean;
6
+ isFsUrl: boolean;
7
+ httpHeaders: any;
8
+ _fullRequestReader: PDFNodeStreamFsFullReader | PDFNodeStreamFullReader | null;
9
+ _rangeRequestReaders: any[];
10
+ get _progressiveDataLength(): number;
11
+ getFullReader(): PDFNodeStreamFsFullReader | PDFNodeStreamFullReader;
12
+ getRangeReader(start: any, end: any): PDFNodeStreamFsRangeReader | PDFNodeStreamRangeReader | null;
13
+ cancelAllRequests(reason: any): void;
14
+ }
15
+ declare class PDFNodeStreamFsFullReader extends BaseFullReader {
16
+ }
17
+ declare class PDFNodeStreamFullReader extends BaseFullReader {
18
+ _request: any;
19
+ }
20
+ declare class PDFNodeStreamFsRangeReader extends BaseRangeReader {
21
+ constructor(stream: any, start: any, end: any);
22
+ }
23
+ declare class PDFNodeStreamRangeReader extends BaseRangeReader {
24
+ constructor(stream: any, start: any, end: any);
25
+ _httpHeaders: {};
26
+ _request: any;
27
+ }
28
+ declare class BaseFullReader {
29
+ constructor(stream: any);
30
+ _url: any;
31
+ _done: boolean;
32
+ _storedError: any;
33
+ onProgress: any;
34
+ _contentLength: any;
35
+ _loaded: number;
36
+ _filename: any;
37
+ _disableRange: any;
38
+ _rangeChunkSize: any;
39
+ _isStreamingSupported: boolean;
40
+ _isRangeSupported: boolean;
41
+ _readableStream: any;
42
+ _readCapability: PromiseCapability;
43
+ _headersCapability: PromiseCapability;
44
+ get headersReady(): Promise<any>;
45
+ get filename(): any;
46
+ get contentLength(): any;
47
+ get isRangeSupported(): boolean;
48
+ get isStreamingSupported(): boolean;
49
+ read(): any;
50
+ cancel(reason: any): void;
51
+ _error(reason: any): void;
52
+ _setReadableStream(readableStream: any): void;
53
+ }
54
+ declare class BaseRangeReader {
55
+ constructor(stream: any);
56
+ _url: any;
57
+ _done: boolean;
58
+ _storedError: any;
59
+ onProgress: any;
60
+ _loaded: number;
61
+ _readableStream: any;
62
+ _readCapability: PromiseCapability;
63
+ _isStreamingSupported: boolean;
64
+ get isStreamingSupported(): boolean;
65
+ read(): any;
66
+ cancel(reason: any): void;
67
+ _error(reason: any): void;
68
+ _setReadableStream(readableStream: any): void;
69
+ }
70
+ import { PromiseCapability } from "../shared/util.js";
71
+ export {};
@@ -0,0 +1,27 @@
1
+ export class NodeCanvasFactory extends BaseCanvasFactory {
2
+ /**
3
+ * @ignore
4
+ */
5
+ _createCanvas(width: any, height: any): any;
6
+ }
7
+ export class NodeCMapReaderFactory extends BaseCMapReaderFactory {
8
+ /**
9
+ * @ignore
10
+ */
11
+ _fetchData(url: any, compressionType: any): Promise<{
12
+ cMapData: any;
13
+ compressionType: any;
14
+ }>;
15
+ }
16
+ export class NodeFilterFactory extends BaseFilterFactory {
17
+ }
18
+ export class NodeStandardFontDataFactory extends BaseStandardFontDataFactory {
19
+ /**
20
+ * @ignore
21
+ */
22
+ _fetchData(url: any): Promise<any>;
23
+ }
24
+ import { BaseCanvasFactory } from "./base_factory.js";
25
+ import { BaseCMapReaderFactory } from "./base_factory.js";
26
+ import { BaseFilterFactory } from "./base_factory.js";
27
+ import { BaseStandardFontDataFactory } from "./base_factory.js";
@@ -1,3 +1,6 @@
1
+ export type IPDFStream = import("../interfaces").IPDFStream;
2
+ export type IPDFStreamReader = import("../interfaces").IPDFStreamReader;
3
+ export type IPDFStreamRangeReader = import("../interfaces").IPDFStreamRangeReader;
1
4
  /** @implements {IPDFStream} */
2
5
  export class PDFDataTransportStream implements IPDFStream {
3
6
  constructor({ length, initialData, progressiveDone, contentDispositionFilename, disableRange, disableStream, }: {
@@ -1,10 +1,11 @@
1
+ export type AnnotationStorage = import("./annotation_storage").AnnotationStorage;
1
2
  export type PageViewport = import("./display_utils").PageViewport;
2
3
  export type IPDFLinkService = import("../../web/interfaces").IPDFLinkService;
3
4
  export type XfaLayerParameters = {
4
5
  viewport: PageViewport;
5
6
  div: HTMLDivElement;
6
7
  xfaHtml: Object;
7
- annotationStorage?: any;
8
+ annotationStorage?: import("./annotation_storage").AnnotationStorage | undefined;
8
9
  linkService: IPDFLinkService;
9
10
  /**
10
11
  * - (default value is 'display').
@@ -1,3 +1,5 @@
1
+ export type TextContent = import("./api").TextContent;
2
+ /** @typedef {import("./api").TextContent} TextContent */
1
3
  export class XfaText {
2
4
  /**
3
5
  * Walk an XFA tree and create an array of text nodes that is compatible
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Interface that represents PDF data transport. If possible, it allows
3
+ * progressively load entire or fragment of the PDF binary data.
4
+ *
5
+ * @interface
6
+ */
7
+ export class IPDFStream {
8
+ /**
9
+ * Gets a reader for the entire PDF data.
10
+ * @returns {IPDFStreamReader}
11
+ */
12
+ getFullReader(): IPDFStreamReader;
13
+ /**
14
+ * Gets a reader for the range of the PDF data.
15
+ * @param {number} begin - the start offset of the data.
16
+ * @param {number} end - the end offset of the data.
17
+ * @returns {IPDFStreamRangeReader}
18
+ */
19
+ getRangeReader(begin: number, end: number): IPDFStreamRangeReader;
20
+ /**
21
+ * Cancels all opened reader and closes all their opened requests.
22
+ * @param {Object} reason - the reason for cancelling
23
+ */
24
+ cancelAllRequests(reason: Object): void;
25
+ }
26
+ /**
27
+ * Interface for a PDF binary data fragment reader.
28
+ *
29
+ * @interface
30
+ */
31
+ export class IPDFStreamRangeReader {
32
+ /**
33
+ * Sets or gets the progress callback. The callback can be useful when the
34
+ * isStreamingSupported property of the object is defined as false.
35
+ * The callback is called with one parameter: an object with the loaded
36
+ * property.
37
+ */
38
+ onProgress: any;
39
+ /**
40
+ * Gets ability of the stream to progressively load binary data.
41
+ * @type {boolean}
42
+ */
43
+ get isStreamingSupported(): boolean;
44
+ /**
45
+ * Requests a chunk of the binary data. The method returns the promise, which
46
+ * is resolved into object with properties "value" and "done". If the done
47
+ * is set to true, then the stream has reached its end, otherwise the value
48
+ * contains binary data. Cancelled requests will be resolved with the done is
49
+ * set to true.
50
+ * @returns {Promise}
51
+ */
52
+ read(): Promise<any>;
53
+ /**
54
+ * Cancels all pending read requests and closes the stream.
55
+ * @param {Object} reason
56
+ */
57
+ cancel(reason: Object): void;
58
+ }
59
+ /**
60
+ * Interface for a PDF binary data reader.
61
+ *
62
+ * @interface
63
+ */
64
+ export class IPDFStreamReader {
65
+ /**
66
+ * Sets or gets the progress callback. The callback can be useful when the
67
+ * isStreamingSupported property of the object is defined as false.
68
+ * The callback is called with one parameter: an object with the loaded and
69
+ * total properties.
70
+ */
71
+ onProgress: any;
72
+ /**
73
+ * Gets a promise that is resolved when the headers and other metadata of
74
+ * the PDF data stream are available.
75
+ * @type {Promise}
76
+ */
77
+ get headersReady(): Promise<any>;
78
+ /**
79
+ * Gets the Content-Disposition filename. It is defined after the headersReady
80
+ * promise is resolved.
81
+ * @type {string|null} The filename, or `null` if the Content-Disposition
82
+ * header is missing/invalid.
83
+ */
84
+ get filename(): string | null;
85
+ /**
86
+ * Gets PDF binary data length. It is defined after the headersReady promise
87
+ * is resolved.
88
+ * @type {number} The data length (or 0 if unknown).
89
+ */
90
+ get contentLength(): number;
91
+ /**
92
+ * Gets ability of the stream to handle range requests. It is defined after
93
+ * the headersReady promise is resolved. Rejected when the reader is cancelled
94
+ * or an error occurs.
95
+ * @type {boolean}
96
+ */
97
+ get isRangeSupported(): boolean;
98
+ /**
99
+ * Gets ability of the stream to progressively load binary data. It is defined
100
+ * after the headersReady promise is resolved.
101
+ * @type {boolean}
102
+ */
103
+ get isStreamingSupported(): boolean;
104
+ /**
105
+ * Requests a chunk of the binary data. The method returns the promise, which
106
+ * is resolved into object with properties "value" and "done". If the done
107
+ * is set to true, then the stream has reached its end, otherwise the value
108
+ * contains binary data. Cancelled requests will be resolved with the done is
109
+ * set to true.
110
+ * @returns {Promise}
111
+ */
112
+ read(): Promise<any>;
113
+ /**
114
+ * Cancels all pending read requests and closes the stream.
115
+ * @param {Object} reason
116
+ */
117
+ cancel(reason: Object): void;
118
+ }
@@ -15,6 +15,7 @@ import { AnnotationMode } from "./shared/util.js";
15
15
  import { build } from "./display/api.js";
16
16
  import { CMapCompressionType } from "./shared/util.js";
17
17
  import { createValidAbsoluteUrl } from "./shared/util.js";
18
+ import { DOMSVGFactory } from "./display/display_utils.js";
18
19
  import { FeatureTest } from "./shared/util.js";
19
20
  import { getDocument } from "./display/api.js";
20
21
  import { getFilenameFromUrl } from "./display/display_utils.js";
@@ -25,8 +26,8 @@ import { ImageKind } from "./shared/util.js";
25
26
  import { InvalidPDFException } from "./shared/util.js";
26
27
  import { isDataScheme } from "./display/display_utils.js";
27
28
  import { isPdfFile } from "./display/display_utils.js";
28
- import { loadScript } from "./display/display_utils.js";
29
29
  import { MissingPDFException } from "./shared/util.js";
30
+ import { noContextMenu } from "./display/display_utils.js";
30
31
  import { normalizeUnicode } from "./shared/util.js";
31
32
  import { OPS } from "./shared/util.js";
32
33
  import { PasswordResponses } from "./shared/util.js";
@@ -40,11 +41,10 @@ import { RenderingCancelledException } from "./display/display_utils.js";
40
41
  import { renderTextLayer } from "./display/text_layer.js";
41
42
  import { setLayerDimensions } from "./display/display_utils.js";
42
43
  import { shadow } from "./shared/util.js";
43
- import { SVGGraphics } from "./display/api.js";
44
44
  import { UnexpectedResponseException } from "./shared/util.js";
45
45
  import { updateTextLayer } from "./display/text_layer.js";
46
46
  import { Util } from "./shared/util.js";
47
47
  import { VerbosityLevel } from "./shared/util.js";
48
48
  import { version } from "./display/api.js";
49
49
  import { XfaLayer } from "./display/xfa_layer.js";
50
- export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, build, CMapCompressionType, createValidAbsoluteUrl, FeatureTest, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, loadScript, MissingPDFException, normalizeUnicode, OPS, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, PromiseCapability, RenderingCancelledException, renderTextLayer, setLayerDimensions, shadow, SVGGraphics, UnexpectedResponseException, updateTextLayer, Util, VerbosityLevel, version, XfaLayer };
50
+ export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, build, CMapCompressionType, createValidAbsoluteUrl, DOMSVGFactory, FeatureTest, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, MissingPDFException, noContextMenu, normalizeUnicode, OPS, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, PromiseCapability, RenderingCancelledException, renderTextLayer, setLayerDimensions, shadow, UnexpectedResponseException, updateTextLayer, Util, VerbosityLevel, version, XfaLayer };
@@ -88,6 +88,7 @@ export namespace AnnotationMode {
88
88
  export let ENABLE_FORMS: number;
89
89
  export let ENABLE_STORAGE: number;
90
90
  }
91
+ export const AnnotationPrefix: "pdfjs_internal_id_";
91
92
  export namespace AnnotationReplyType {
92
93
  let GROUP: string;
93
94
  let REPLY: string;
@@ -30,12 +30,14 @@ export class AnnotationEditorLayerBuilder {
30
30
  pdfPage: import("../src/display/api").PDFPageProxy;
31
31
  accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager | undefined;
32
32
  l10n: {
33
- getLanguage(): Promise<string>;
34
- getDirection(): Promise<string>;
35
- get(key: any, args?: null, fallback?: any): Promise<any>;
36
- translate(element: any): Promise<void>;
33
+ getLanguage(): any;
34
+ getDirection(): any;
35
+ get(ids: any, args: null | undefined, fallback: any): Promise<any>;
36
+ translate(element: any): Promise<any>;
37
+ pause(): any;
38
+ resume(): any;
37
39
  };
38
- annotationEditorLayer: any;
40
+ annotationEditorLayer: AnnotationEditorLayer | null;
39
41
  div: HTMLDivElement | null;
40
42
  _cancelled: boolean;
41
43
  /**
@@ -48,3 +50,4 @@ export class AnnotationEditorLayerBuilder {
48
50
  show(): void;
49
51
  #private;
50
52
  }
53
+ import { AnnotationEditorLayer } from "../src/pdf";
@@ -1,13 +1,13 @@
1
1
  export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
2
  export type PageViewport = import("../src/display/display_utils").PageViewport;
3
+ export type AnnotationStorage = import("../src/display/annotation_storage").AnnotationStorage;
3
4
  export type IDownloadManager = import("./interfaces").IDownloadManager;
4
- export type IL10n = import("./interfaces").IL10n;
5
5
  export type IPDFLinkService = import("./interfaces").IPDFLinkService;
6
- export type TextAccessibilityManager = any;
6
+ export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
7
7
  export type AnnotationLayerBuilderOptions = {
8
8
  pageDiv: HTMLDivElement;
9
9
  pdfPage: PDFPageProxy;
10
- annotationStorage?: any;
10
+ annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
11
11
  /**
12
12
  * - Path for image resources, mainly
13
13
  * for annotation icons. Include trailing slash.
@@ -15,18 +15,14 @@ export type AnnotationLayerBuilderOptions = {
15
15
  imageResourcesPath?: string | undefined;
16
16
  renderForms: boolean;
17
17
  linkService: IPDFLinkService;
18
- downloadManager: IDownloadManager;
19
- /**
20
- * - Localization service.
21
- */
22
- l10n: IL10n;
18
+ downloadManager?: import("./interfaces").IDownloadManager | undefined;
23
19
  enableScripting?: boolean | undefined;
24
20
  hasJSActionsPromise?: Promise<boolean> | undefined;
25
21
  fieldObjectsPromise?: Promise<{
26
22
  [x: string]: Object[];
27
23
  } | null> | undefined;
28
24
  annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
29
- accessibilityManager?: any;
25
+ accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
30
26
  };
31
27
  /**
32
28
  * @typedef {Object} AnnotationLayerBuilderOptions
@@ -37,8 +33,7 @@ export type AnnotationLayerBuilderOptions = {
37
33
  * for annotation icons. Include trailing slash.
38
34
  * @property {boolean} renderForms
39
35
  * @property {IPDFLinkService} linkService
40
- * @property {IDownloadManager} downloadManager
41
- * @property {IL10n} l10n - Localization service.
36
+ * @property {IDownloadManager} [downloadManager]
42
37
  * @property {boolean} [enableScripting]
43
38
  * @property {Promise<boolean>} [hasJSActionsPromise]
44
39
  * @property {Promise<Object<string, Array<Object>> | null>}
@@ -50,23 +45,22 @@ export class AnnotationLayerBuilder {
50
45
  /**
51
46
  * @param {AnnotationLayerBuilderOptions} options
52
47
  */
53
- constructor({ pageDiv, pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, l10n, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, }: AnnotationLayerBuilderOptions);
48
+ constructor({ pageDiv, pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, }: AnnotationLayerBuilderOptions);
54
49
  pageDiv: HTMLDivElement;
55
50
  pdfPage: import("../src/display/api").PDFPageProxy;
56
51
  linkService: import("./interfaces").IPDFLinkService;
57
- downloadManager: import("./interfaces").IDownloadManager;
52
+ downloadManager: import("./interfaces").IDownloadManager | undefined;
58
53
  imageResourcesPath: string;
59
54
  renderForms: boolean;
60
- l10n: import("./interfaces").IL10n;
61
- annotationStorage: any;
55
+ annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
62
56
  enableScripting: boolean;
63
57
  _hasJSActionsPromise: Promise<boolean>;
64
58
  _fieldObjectsPromise: Promise<{
65
59
  [x: string]: Object[];
66
60
  } | null>;
67
61
  _annotationCanvasMap: Map<string, HTMLCanvasElement>;
68
- _accessibilityManager: any;
69
- annotationLayer: any;
62
+ _accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager;
63
+ annotationLayer: AnnotationLayer | null;
70
64
  div: HTMLDivElement | null;
71
65
  _cancelled: boolean;
72
66
  _eventBus: any;
@@ -81,3 +75,4 @@ export class AnnotationLayerBuilder {
81
75
  hide(): void;
82
76
  #private;
83
77
  }
78
+ import { AnnotationLayer } from "../src/pdf";
@@ -2,11 +2,12 @@ export class AppOptions {
2
2
  static get(name: any): any;
3
3
  static getAll(kind?: null): any;
4
4
  static set(name: any, value: any): void;
5
- static setAll(options: any): void;
5
+ static setAll(options: any, init?: boolean): void;
6
6
  static remove(name: any): void;
7
7
  }
8
8
  export const compatibilityParams: any;
9
9
  export namespace OptionKind {
10
+ let BROWSER: number;
10
11
  let VIEWER: number;
11
12
  let API: number;
12
13
  let WORKER: number;
@@ -8,7 +8,7 @@ export class DownloadManager implements IDownloadManager {
8
8
  /**
9
9
  * @returns {boolean} Indicating if the data was opened.
10
10
  */
11
- openOrDownloadData(element: any, data: any, filename: any): boolean;
11
+ openOrDownloadData(data: any, filename: any, dest?: null): boolean;
12
12
  download(blob: any, url: any, filename: any, _options: any): void;
13
13
  #private;
14
14
  }
@@ -1,7 +1,7 @@
1
1
  export function docProperties(pdfDocument: any): Promise<any>;
2
2
  export class GenericScripting {
3
3
  constructor(sandboxBundleSrc: any);
4
- _ready: any;
4
+ _ready: Promise<any>;
5
5
  createSandbox(data: any): Promise<void>;
6
6
  dispatchEventInSandbox(event: any): Promise<void>;
7
7
  destroySandbox(): Promise<void>;
@@ -2,12 +2,19 @@ export type IL10n = import("./interfaces").IL10n;
2
2
  /**
3
3
  * @implements {IL10n}
4
4
  */
5
- export class GenericL10n implements IL10n {
5
+ export class GenericL10n extends L10n implements IL10n {
6
+ /**
7
+ * Generate the bundles for Fluent.
8
+ * @param {String} defaultLang - The fallback language to use for
9
+ * translations.
10
+ * @param {String} baseLang - The base language to use for translations.
11
+ */
12
+ static "__#47@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
13
+ static "__#47@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
14
+ static "__#47@#getPaths"(): Promise<{
15
+ baseURL: any;
16
+ paths: any;
17
+ }>;
6
18
  constructor(lang: any);
7
- _lang: any;
8
- _ready: Promise<any>;
9
- getLanguage(): Promise<any>;
10
- getDirection(): Promise<any>;
11
- get(key: any, args?: null, fallback?: any): Promise<any>;
12
- translate(element: any): Promise<any>;
13
19
  }
20
+ import { L10n } from "./l10n.js";