@chialab/pdfjs-lib 1.0.0-alpha.3 → 1.0.0-alpha.30

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 (161) hide show
  1. package/README.md +15 -7
  2. package/dist/browser/{FoxitDingbats-SB6TO3S5.js → FoxitDingbats-XZTZYAP6.js} +1 -1
  3. package/dist/browser/{FoxitFixed-UIGSMBQB.js → FoxitFixed-DRWD6QNM.js} +1 -1
  4. package/dist/browser/{FoxitFixedBold-2PAEIZAT.js → FoxitFixedBold-A3IBPIFC.js} +1 -1
  5. package/dist/browser/{FoxitFixedBoldItalic-OSQUQDEE.js → FoxitFixedBoldItalic-V4ORMFGL.js} +1 -1
  6. package/dist/browser/{FoxitFixedItalic-W73RDK22.js → FoxitFixedItalic-Z7BSNTJA.js} +1 -1
  7. package/dist/browser/{FoxitSerif-3HH3SOZF.js → FoxitSerif-Y34FHWHO.js} +1 -1
  8. package/dist/browser/{FoxitSerifBold-HXP2QOO7.js → FoxitSerifBold-NCWBT4GX.js} +1 -1
  9. package/dist/browser/{FoxitSerifBoldItalic-FZXLNWD7.js → FoxitSerifBoldItalic-YTEOG5ZU.js} +1 -1
  10. package/dist/browser/{FoxitSerifItalic-WQFHUBI2.js → FoxitSerifItalic-3H547RIJ.js} +1 -1
  11. package/dist/browser/{FoxitSymbol-OVWU7LKS.js → FoxitSymbol-EMTQEYPB.js} +1 -1
  12. package/dist/browser/{LiberationSans-Bold-GSJN42N5.js → LiberationSans-Bold-MGX34QV4.js} +1 -1
  13. package/dist/browser/LiberationSans-Bold-PQY5JZAT.js +9 -0
  14. package/dist/browser/LiberationSans-BoldItalic-PBNZJX4S.js +9 -0
  15. package/dist/browser/{LiberationSans-BoldItalic-UCPQJ3L2.js → LiberationSans-BoldItalic-WSEQ5LH5.js} +1 -1
  16. package/dist/browser/{LiberationSans-Italic-6CIHEALY.js → LiberationSans-Italic-E4SLDR4M.js} +1 -1
  17. package/dist/browser/LiberationSans-Italic-NAYVQTNG.js +9 -0
  18. package/dist/browser/{LiberationSans-Regular-KIF3IRJY.js → LiberationSans-Regular-3SH5NGZO.js} +1 -1
  19. package/dist/browser/LiberationSans-Regular-FMNBW2LE.js +9 -0
  20. package/dist/browser/NodeUtilsStabs-AQQCOPNR.js +19 -0
  21. package/dist/browser/chunk-3ZTAZS2X.js +25 -0
  22. package/dist/browser/{chunk-O4UKW7AD.js → chunk-7YYVRRNF.js} +5 -0
  23. package/dist/browser/{chunk-DYHYQ33L.js → chunk-R7G44NYV.js} +834 -84
  24. package/dist/browser/index.js +21400 -4931
  25. package/dist/browser/openjpeg-Q27OVS4T.js +9 -0
  26. package/dist/browser/qcms_bg-BCJEADMU.js +9 -0
  27. package/dist/browser/worker.js +8311 -7089
  28. package/dist/index.d.ts +11 -1
  29. package/dist/lib/AnnotationData.d.ts +8 -8
  30. package/dist/lib/AnnotationOperatorsList.d.ts +21 -0
  31. package/dist/lib/Canvas.d.ts +0 -5
  32. package/dist/lib/CanvasGraphics.d.ts +1 -0
  33. package/dist/lib/NodeCanvasFactory.d.ts +9 -0
  34. package/dist/lib/NodeFilterFactory.d.ts +10 -0
  35. package/dist/lib/NodeUtils.d.ts +24 -0
  36. package/dist/lib/Path2D.d.ts +9 -49
  37. package/dist/lib/StandardFontDataFactory.d.ts +2 -2
  38. package/dist/lib/StructTreePage.d.ts +5 -0
  39. package/dist/lib/Svg.d.ts +144 -0
  40. package/dist/lib/SvgCanvasContext.d.ts +36 -22
  41. package/dist/lib/TextLayer.d.ts +48 -10
  42. package/dist/lib/TextLayer_v2.d.ts +8 -0
  43. package/dist/lib/WasmFactory.d.ts +5 -0
  44. package/dist/lib/utils.d.ts +29 -3
  45. package/dist/node/{FoxitDingbats-65AZ2Z2V.js → FoxitDingbats-UZC34T4F.js} +1 -1
  46. package/dist/node/{FoxitFixed-OZGLVVOQ.js → FoxitFixed-DSJVG3IJ.js} +1 -1
  47. package/dist/node/{FoxitFixedBold-37OOYMV7.js → FoxitFixedBold-YSX4X5NA.js} +1 -1
  48. package/dist/node/{FoxitFixedBoldItalic-XYFHEG2V.js → FoxitFixedBoldItalic-IFYYA6RR.js} +1 -1
  49. package/dist/node/{FoxitFixedItalic-MM7OSGS6.js → FoxitFixedItalic-4PEFPCQV.js} +1 -1
  50. package/dist/node/{FoxitSerif-MLMJQPRP.js → FoxitSerif-7SSP2H2U.js} +1 -1
  51. package/dist/node/{FoxitSerifBold-AC7RJQWJ.js → FoxitSerifBold-KLMURJ6N.js} +1 -1
  52. package/dist/node/{FoxitSerifBoldItalic-YCQ4CLKE.js → FoxitSerifBoldItalic-VSYHWLRM.js} +1 -1
  53. package/dist/node/{FoxitSerifItalic-CXVTCST4.js → FoxitSerifItalic-NTOPMQDD.js} +1 -1
  54. package/dist/node/{FoxitSymbol-VUGMZN5C.js → FoxitSymbol-QPUM74UN.js} +1 -1
  55. package/dist/node/{LiberationSans-Bold-XSHQQBWB.js → LiberationSans-Bold-BXFYN4PV.js} +1 -1
  56. package/dist/node/LiberationSans-Bold-VIZ4XT4N.js +9 -0
  57. package/dist/node/{LiberationSans-BoldItalic-CTAZRFRL.js → LiberationSans-BoldItalic-DQQC5TNJ.js} +1 -1
  58. package/dist/node/LiberationSans-BoldItalic-WXMOSICD.js +9 -0
  59. package/dist/node/LiberationSans-Italic-34IBVQZ4.js +9 -0
  60. package/dist/node/{LiberationSans-Italic-WIOTUKLC.js → LiberationSans-Italic-Z4MFN6PY.js} +1 -1
  61. package/dist/node/LiberationSans-Regular-JOSGNSW5.js +9 -0
  62. package/dist/node/{LiberationSans-Regular-CDMMZL5S.js → LiberationSans-Regular-MACKS2VL.js} +1 -1
  63. package/dist/node/NodeUtils-PVXQMWFJ.js +20 -0
  64. package/dist/node/chunk-4Y7OZIIX.js +1319 -0
  65. package/dist/node/chunk-O74KGUUC.js +2093 -0
  66. package/dist/node/chunk-T2JWSGAF.js +1225 -0
  67. package/dist/node/chunk-ZFIGV5OT.js +63 -0
  68. package/dist/node/index.js +23520 -8727
  69. package/dist/node/openjpeg-QFJSFVSJ.js +9 -0
  70. package/dist/node/qcms_bg-PRPVJQFC.js +9 -0
  71. package/dist/node/worker.js +8320 -7096
  72. package/dist/pdf.js/external/openjpeg/openjpeg.d.ts +2 -0
  73. package/dist/pdf.js/external/qcms/qcms.d.ts +92 -0
  74. package/dist/pdf.js/external/qcms/qcms_utils.d.ts +14 -0
  75. package/dist/pdf.js/src/core/arithmetic_decoder.d.ts +21 -0
  76. package/dist/pdf.js/src/core/ascii_85_stream.d.ts +8 -0
  77. package/dist/pdf.js/src/core/ascii_hex_stream.d.ts +8 -0
  78. package/dist/pdf.js/src/core/base_stream.d.ts +32 -0
  79. package/dist/pdf.js/src/core/binary_cmap.d.ts +3 -0
  80. package/dist/pdf.js/src/core/ccitt.d.ts +72 -0
  81. package/dist/pdf.js/src/core/ccitt_stream.d.ts +9 -0
  82. package/dist/pdf.js/src/core/cff_font.d.ts +15 -0
  83. package/dist/pdf.js/src/core/cff_parser.d.ts +166 -0
  84. package/dist/pdf.js/src/core/charsets.d.ts +3 -0
  85. package/dist/pdf.js/src/core/cmap.d.ts +37 -0
  86. package/dist/pdf.js/src/core/colorspace.d.ts +177 -0
  87. package/dist/pdf.js/src/core/colorspace_utils.d.ts +21 -0
  88. package/dist/pdf.js/src/core/core_utils.d.ts +140 -0
  89. package/dist/pdf.js/src/core/decode_stream.d.ts +25 -0
  90. package/dist/pdf.js/src/core/encodings.d.ts +7 -0
  91. package/dist/pdf.js/src/core/flate_stream.d.ts +15 -0
  92. package/dist/pdf.js/src/core/font_renderer.d.ts +34 -0
  93. package/dist/pdf.js/src/core/fonts.d.ts +98 -0
  94. package/dist/pdf.js/src/core/fonts_utils.d.ts +32 -0
  95. package/dist/pdf.js/src/core/glyf.d.ts +44 -0
  96. package/dist/pdf.js/src/core/glyphlist.d.ts +2 -0
  97. package/dist/pdf.js/src/core/icc_colorspace.d.ts +22 -0
  98. package/dist/pdf.js/src/core/jbig2.d.ts +12 -0
  99. package/dist/pdf.js/src/core/jbig2_stream.d.ts +17 -0
  100. package/dist/pdf.js/src/core/jpeg_stream.d.ts +25 -0
  101. package/dist/pdf.js/src/core/jpg.d.ts +62 -0
  102. package/dist/pdf.js/src/core/jpx.d.ts +35 -0
  103. package/dist/pdf.js/src/core/jpx_stream.d.ts +17 -0
  104. package/dist/pdf.js/src/core/lzw_stream.d.ts +21 -0
  105. package/dist/pdf.js/src/core/metrics.d.ts +2 -0
  106. package/dist/pdf.js/src/core/name_number_tree.d.ts +21 -0
  107. package/dist/pdf.js/src/core/opentype_file_builder.d.ts +12 -0
  108. package/dist/pdf.js/src/core/parser.d.ts +81 -0
  109. package/dist/pdf.js/src/core/predictor_stream.d.ts +15 -0
  110. package/dist/pdf.js/src/core/primitives.d.ts +78 -0
  111. package/dist/pdf.js/src/core/run_length_stream.d.ts +7 -0
  112. package/dist/pdf.js/src/core/standard_fonts.d.ts +18 -0
  113. package/dist/pdf.js/src/core/stream.d.ts +21 -0
  114. package/dist/pdf.js/src/core/struct_tree.d.ts +92 -0
  115. package/dist/pdf.js/src/core/to_unicode_map.d.ts +21 -0
  116. package/dist/pdf.js/src/core/type1_font.d.ts +17 -0
  117. package/dist/pdf.js/src/core/type1_parser.d.ts +29 -0
  118. package/dist/pdf.js/src/core/unicode.d.ts +5 -0
  119. package/dist/pdf.js/src/display/annotation_layer.d.ts +35 -5
  120. package/dist/pdf.js/src/display/annotation_storage.d.ts +3 -8
  121. package/dist/pdf.js/src/display/api.d.ts +86 -77
  122. package/dist/pdf.js/src/display/api_utils.d.ts +13 -0
  123. package/dist/pdf.js/src/display/canvas.d.ts +88 -94
  124. package/dist/pdf.js/src/display/canvas_dependency_tracker.d.ts +160 -0
  125. package/dist/pdf.js/src/display/display_utils.d.ts +34 -1
  126. package/dist/pdf.js/src/display/draw_layer.d.ts +2 -2
  127. package/dist/pdf.js/src/display/editor/alt_text.d.ts +1 -1
  128. package/dist/pdf.js/src/display/editor/annotation_editor_layer.d.ts +10 -8
  129. package/dist/pdf.js/src/display/editor/color_picker.d.ts +20 -1
  130. package/dist/pdf.js/src/display/editor/comment.d.ts +47 -0
  131. package/dist/pdf.js/src/display/editor/draw.d.ts +8 -8
  132. package/dist/pdf.js/src/display/editor/drawers/freedraw.d.ts +4 -3
  133. package/dist/pdf.js/src/display/editor/drawers/highlight.d.ts +2 -1
  134. package/dist/pdf.js/src/display/editor/drawers/signaturedraw.d.ts +13 -13
  135. package/dist/pdf.js/src/display/editor/editor.d.ts +117 -16
  136. package/dist/pdf.js/src/display/editor/freetext.d.ts +11 -7
  137. package/dist/pdf.js/src/display/editor/highlight.d.ts +9 -3
  138. package/dist/pdf.js/src/display/editor/ink.d.ts +6 -0
  139. package/dist/pdf.js/src/display/editor/signature.d.ts +3 -5
  140. package/dist/pdf.js/src/display/editor/stamp.d.ts +4 -3
  141. package/dist/pdf.js/src/display/editor/toolbar.d.ts +8 -3
  142. package/dist/pdf.js/src/display/editor/tools.d.ts +36 -12
  143. package/dist/pdf.js/src/display/font_loader.d.ts +27 -1
  144. package/dist/pdf.js/src/display/metadata.d.ts +1 -2
  145. package/dist/pdf.js/src/display/optional_content_config.d.ts +1 -1
  146. package/dist/pdf.js/src/display/pattern_helper.d.ts +6 -4
  147. package/dist/pdf.js/src/display/pdf_objects.d.ts +40 -0
  148. package/dist/pdf.js/src/display/text_layer.d.ts +9 -9
  149. package/dist/pdf.js/src/display/touch_manager.d.ts +5 -1
  150. package/dist/pdf.js/src/display/worker_options.d.ts +2 -2
  151. package/dist/pdf.js/src/pdf.d.ts +9 -1
  152. package/dist/pdf.js/src/shared/obj-bin-transform.d.ts +64 -0
  153. package/dist/pdf.js/src/shared/scripting_utils.d.ts +2 -0
  154. package/dist/pdf.js/src/shared/util.d.ts +129 -102
  155. package/dist/pdf.js/web/comment_manager.d.ts +20 -0
  156. package/dist/pdf.js/web/interfaces.d.ts +7 -0
  157. package/dist/pdf.js/web/text_accessibility.d.ts +1 -1
  158. package/package.json +16 -4
  159. package/dist/node/chunk-7MW5RQZ5.js +0 -30
  160. package/dist/node/chunk-KTTVPO2G.js +0 -1775
  161. package/dist/pdf.js/src/display/node_utils.d.ts +0 -32
@@ -0,0 +1,2 @@
1
+ export default OpenJPEG;
2
+ declare function OpenJPEG(moduleArg?: {}): Promise<{}>;
@@ -0,0 +1,92 @@
1
+ /**
2
+ * # Safety
3
+ *
4
+ * This function is called directly from JavaScript.
5
+ * @param {number} transformer
6
+ * @param {Uint8Array} src
7
+ */
8
+ export function qcms_convert_array(transformer: number, src: Uint8Array): void;
9
+ /**
10
+ * # Safety
11
+ *
12
+ * This function is called directly from JavaScript.
13
+ * @param {number} transformer
14
+ * @param {number} src
15
+ * @param {boolean} css
16
+ */
17
+ export function qcms_convert_one(transformer: number, src: number, css: boolean): void;
18
+ /**
19
+ * # Safety
20
+ *
21
+ * This function is called directly from JavaScript.
22
+ * @param {number} transformer
23
+ * @param {number} src1
24
+ * @param {number} src2
25
+ * @param {number} src3
26
+ * @param {boolean} css
27
+ */
28
+ export function qcms_convert_three(transformer: number, src1: number, src2: number, src3: number, css: boolean): void;
29
+ /**
30
+ * # Safety
31
+ *
32
+ * This function is called directly from JavaScript.
33
+ * @param {number} transformer
34
+ * @param {number} src1
35
+ * @param {number} src2
36
+ * @param {number} src3
37
+ * @param {number} src4
38
+ * @param {boolean} css
39
+ */
40
+ export function qcms_convert_four(transformer: number, src1: number, src2: number, src3: number, src4: number, css: boolean): void;
41
+ /**
42
+ * # Safety
43
+ *
44
+ * This function is called directly from JavaScript.
45
+ * @param {Uint8Array} mem
46
+ * @param {DataType} in_type
47
+ * @param {Intent} intent
48
+ * @returns {number}
49
+ */
50
+ export function qcms_transformer_from_memory(mem: Uint8Array, in_type: DataType, intent: Intent): number;
51
+ /**
52
+ * # Safety
53
+ *
54
+ * This function is called directly from JavaScript.
55
+ * @param {number} transformer
56
+ */
57
+ export function qcms_drop_transformer(transformer: number): void;
58
+ export type DataType = 0 | 1 | 2 | 3 | 4 | 5;
59
+ /**
60
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
61
+ */
62
+ export const DataType: Readonly<{
63
+ RGB8: 0;
64
+ "0": "RGB8";
65
+ RGBA8: 1;
66
+ "1": "RGBA8";
67
+ BGRA8: 2;
68
+ "2": "BGRA8";
69
+ Gray8: 3;
70
+ "3": "Gray8";
71
+ GrayA8: 4;
72
+ "4": "GrayA8";
73
+ CMYK: 5;
74
+ "5": "CMYK";
75
+ }>;
76
+ export type Intent = 0 | 1 | 2 | 3;
77
+ /**
78
+ * @enum {0 | 1 | 2 | 3}
79
+ */
80
+ export const Intent: Readonly<{
81
+ Perceptual: 0;
82
+ "0": "Perceptual";
83
+ RelativeColorimetric: 1;
84
+ "1": "RelativeColorimetric";
85
+ Saturation: 2;
86
+ "2": "Saturation";
87
+ AbsoluteColorimetric: 3;
88
+ "3": "AbsoluteColorimetric";
89
+ }>;
90
+ export default __wbg_init;
91
+ export function initSync(module: any): any;
92
+ declare function __wbg_init(module_or_path: any): Promise<any>;
@@ -0,0 +1,14 @@
1
+ export function copy_result(ptr: any, len: any): void;
2
+ export function copy_rgb(ptr: any): void;
3
+ export function make_cssRGB(ptr: any): void;
4
+ export class QCMS {
5
+ static "__#private@#memoryArray": null;
6
+ static _memory: null;
7
+ static _mustAddAlpha: boolean;
8
+ static _destBuffer: null;
9
+ static _destOffset: number;
10
+ static _destLength: number;
11
+ static _cssColor: string;
12
+ static _makeHexColor: null;
13
+ static get _memoryArray(): Uint8Array<any>;
14
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This class implements the QM Coder decoding as defined in
3
+ * JPEG 2000 Part I Final Committee Draft Version 1.0
4
+ * Annex C.3 Arithmetic decoding procedure
5
+ * available at http://www.jpeg.org/public/fcd15444-1.pdf
6
+ *
7
+ * The arithmetic decoder is used in conjunction with context models to decode
8
+ * JPEG2000 and JBIG2 streams.
9
+ */
10
+ export class ArithmeticDecoder {
11
+ constructor(data: any, start: any, end: any);
12
+ data: any;
13
+ bp: any;
14
+ dataEnd: any;
15
+ chigh: number;
16
+ clow: number;
17
+ a: number;
18
+ byteIn(): void;
19
+ ct: number | undefined;
20
+ readBit(contexts: any, pos: any): number;
21
+ }
@@ -0,0 +1,8 @@
1
+ export class Ascii85Stream extends DecodeStream {
2
+ constructor(str: any, maybeLength: any);
3
+ str: any;
4
+ dict: any;
5
+ input: Uint8Array<ArrayBuffer>;
6
+ readBlock(): void;
7
+ }
8
+ import { DecodeStream } from "./decode_stream.js";
@@ -0,0 +1,8 @@
1
+ export class AsciiHexStream extends DecodeStream {
2
+ constructor(str: any, maybeLength: any);
3
+ str: any;
4
+ dict: any;
5
+ firstDigit: number;
6
+ readBlock(): void;
7
+ }
8
+ import { DecodeStream } from "./decode_stream.js";
@@ -0,0 +1,32 @@
1
+ export class BaseStream {
2
+ get length(): void;
3
+ get isEmpty(): void;
4
+ get isDataLoaded(): any;
5
+ getByte(): void;
6
+ getBytes(length: any): void;
7
+ /**
8
+ * NOTE: This method can only be used to get image-data that is guaranteed
9
+ * to be fully loaded, since otherwise intermittent errors may occur;
10
+ * note the `ObjectLoader` class.
11
+ */
12
+ getImageData(length: any, decoderOptions: any): Promise<void>;
13
+ asyncGetBytes(): Promise<void>;
14
+ get isAsync(): boolean;
15
+ get isAsyncDecoder(): boolean;
16
+ get canAsyncDecodeImageFromBuffer(): boolean;
17
+ getTransferableImage(): Promise<null>;
18
+ peekByte(): void;
19
+ peekBytes(length: any): void;
20
+ getUint16(): any;
21
+ getInt32(): any;
22
+ getByteRange(begin: any, end: any): void;
23
+ getString(length: any): string;
24
+ skip(n: any): void;
25
+ reset(): void;
26
+ moveStart(): void;
27
+ makeSubStream(start: any, length: any, dict?: null): void;
28
+ /**
29
+ * @returns {Array | null}
30
+ */
31
+ getBaseStreams(): any[] | null;
32
+ }
@@ -0,0 +1,3 @@
1
+ export class BinaryCMapReader {
2
+ process(data: any, cMap: any, extend: any): Promise<any>;
3
+ }
@@ -0,0 +1,72 @@
1
+ export type CCITTFaxDecoderSource = {
2
+ /**
3
+ * - Method that return one byte of data for decoding,
4
+ * or -1 when EOF is reached.
5
+ */
6
+ next: Function;
7
+ };
8
+ /**
9
+ * @param {CCITTFaxDecoderSource} source - The data which should be decoded.
10
+ * @param {Object} [options] - Decoding options.
11
+ */
12
+ export class CCITTFaxDecoder {
13
+ constructor(source: any, options?: {});
14
+ source: any;
15
+ eof: boolean;
16
+ encoding: any;
17
+ eoline: any;
18
+ byteAlign: any;
19
+ columns: any;
20
+ rows: any;
21
+ eoblock: any;
22
+ black: any;
23
+ codingLine: Uint32Array<any>;
24
+ refLine: Uint32Array<any>;
25
+ codingPos: number;
26
+ row: number;
27
+ nextLine2D: boolean;
28
+ inputBits: number;
29
+ inputBuf: number;
30
+ outputBits: number;
31
+ rowsDone: boolean;
32
+ readNextChar(): number;
33
+ err: boolean | undefined;
34
+ /**
35
+ * @private
36
+ */
37
+ private _addPixels;
38
+ /**
39
+ * @private
40
+ */
41
+ private _addPixelsNeg;
42
+ /**
43
+ * This function returns the code found from the table.
44
+ * The start and end parameters set the boundaries for searching the table.
45
+ * The limit parameter is optional. Function returns an array with three
46
+ * values. The first array element indicates whether a valid code is being
47
+ * returned. The second array element is the actual code. The third array
48
+ * element indicates whether EOF was reached.
49
+ * @private
50
+ */
51
+ private _findTableCode;
52
+ /**
53
+ * @private
54
+ */
55
+ private _getTwoDimCode;
56
+ /**
57
+ * @private
58
+ */
59
+ private _getWhiteCode;
60
+ /**
61
+ * @private
62
+ */
63
+ private _getBlackCode;
64
+ /**
65
+ * @private
66
+ */
67
+ private _lookBits;
68
+ /**
69
+ * @private
70
+ */
71
+ private _eatBits;
72
+ }
@@ -0,0 +1,9 @@
1
+ export class CCITTFaxStream extends DecodeStream {
2
+ constructor(str: any, maybeLength: any, params: any);
3
+ str: any;
4
+ dict: any;
5
+ ccittFaxDecoder: CCITTFaxDecoder;
6
+ readBlock(): void;
7
+ }
8
+ import { DecodeStream } from "./decode_stream.js";
9
+ import { CCITTFaxDecoder } from "./ccitt.js";
@@ -0,0 +1,15 @@
1
+ export class CFFFont {
2
+ constructor(file: any, properties: any);
3
+ properties: any;
4
+ cff: import("./cff_parser.js").CFF;
5
+ seacs: any;
6
+ data: any;
7
+ get numGlyphs(): any;
8
+ getCharset(): any;
9
+ getGlyphMapping(): any;
10
+ hasGlyphId(id: any): boolean;
11
+ /**
12
+ * @private
13
+ */
14
+ private _createBuiltInEncoding;
15
+ }
@@ -0,0 +1,166 @@
1
+ export class CFF {
2
+ header: any;
3
+ names: any[];
4
+ topDict: any;
5
+ strings: CFFStrings;
6
+ globalSubrIndex: any;
7
+ encoding: any;
8
+ charset: any;
9
+ charStrings: any;
10
+ fdArray: any[];
11
+ fdSelect: any;
12
+ isCIDFont: boolean;
13
+ duplicateFirstGlyph(): void;
14
+ hasGlyphId(id: any): boolean;
15
+ }
16
+ export class CFFCharset {
17
+ constructor(predefined: any, format: any, charset: any, raw: any);
18
+ predefined: any;
19
+ format: any;
20
+ charset: any;
21
+ raw: any;
22
+ }
23
+ export class CFFCompiler {
24
+ static get EncodeFloatRegExp(): any;
25
+ constructor(cff: any);
26
+ cff: any;
27
+ compile(): never[];
28
+ encodeNumber(value: any): any[];
29
+ encodeFloat(num: any): number[];
30
+ encodeInteger(value: any): any[];
31
+ compileHeader(header: any): any[];
32
+ compileNameIndex(names: any): number[];
33
+ compileTopDicts(dicts: any, length: any, removeCidKeys: any): {
34
+ trackers: CFFOffsetTracker[];
35
+ output: CFFIndex;
36
+ };
37
+ compilePrivateDicts(dicts: any, trackers: any, output: any): void;
38
+ compileDict(dict: any, offsetTracker: any): any[];
39
+ compileStringIndex(strings: any): number[];
40
+ compileCharStrings(charStrings: any): number[];
41
+ compileCharset(charset: any, numGlyphs: any, strings: any, isCIDFont: any): any[];
42
+ compileEncoding(encoding: any): any[];
43
+ compileFDSelect(fdSelect: any): any[];
44
+ compileTypedArray(data: any): any[];
45
+ compileIndex(index: any, trackers?: any[]): number[];
46
+ }
47
+ export class CFFFDSelect {
48
+ constructor(format: any, fdSelect: any);
49
+ format: any;
50
+ fdSelect: any;
51
+ getFDIndex(glyphIndex: any): any;
52
+ }
53
+ export class CFFHeader {
54
+ constructor(major: any, minor: any, hdrSize: any, offSize: any);
55
+ major: any;
56
+ minor: any;
57
+ hdrSize: any;
58
+ offSize: any;
59
+ }
60
+ export class CFFIndex {
61
+ objects: any[];
62
+ length: number;
63
+ add(data: any): void;
64
+ set(index: any, data: any): void;
65
+ get(index: any): any;
66
+ get count(): number;
67
+ }
68
+ export class CFFParser {
69
+ constructor(file: any, properties: any, seacAnalysisEnabled: any);
70
+ bytes: any;
71
+ properties: any;
72
+ seacAnalysisEnabled: boolean;
73
+ parse(): CFF;
74
+ cff: CFF | undefined;
75
+ parseHeader(): {
76
+ obj: CFFHeader;
77
+ endPos: any;
78
+ };
79
+ parseDict(dict: any): any[][];
80
+ parseIndex(pos: any): {
81
+ obj: CFFIndex;
82
+ endPos: any;
83
+ };
84
+ parseNameIndex(index: any): string[];
85
+ parseStringIndex(index: any): CFFStrings;
86
+ createDict(Type: any, dict: any, strings: any): any;
87
+ parseCharString(state: any, data: any, localSubrIndex: any, globalSubrIndex: any): boolean;
88
+ parseCharStrings({ charStrings, localSubrIndex, globalSubrIndex, fdSelect, fdArray, privateDict, }: {
89
+ charStrings: any;
90
+ localSubrIndex: any;
91
+ globalSubrIndex: any;
92
+ fdSelect: any;
93
+ fdArray: any;
94
+ privateDict: any;
95
+ }): {
96
+ charStrings: any;
97
+ seacs: any[];
98
+ widths: any[];
99
+ };
100
+ emptyPrivateDictionary(parentDict: any): void;
101
+ parsePrivateDict(parentDict: any): void;
102
+ parseCharsets(pos: any, length: any, strings: any, cid: any): CFFCharset;
103
+ parseEncoding(pos: any, properties: any, strings: any, charset: any): CFFEncoding;
104
+ parseFDSelect(pos: any, length: any): CFFFDSelect;
105
+ }
106
+ export class CFFPrivateDict extends CFFDict {
107
+ static get tables(): any;
108
+ constructor(strings: any);
109
+ subrsIndex: any;
110
+ }
111
+ /**
112
+ * The CFF class takes a Type1 file and wrap it into a
113
+ * 'Compact Font Format' which itself embed Type2 charstrings.
114
+ */
115
+ export const CFFStandardStrings: string[];
116
+ export class CFFStrings {
117
+ strings: any[];
118
+ get(index: any): any;
119
+ getSID(str: any): number;
120
+ add(value: any): void;
121
+ get count(): number;
122
+ }
123
+ export class CFFTopDict extends CFFDict {
124
+ static get tables(): any;
125
+ constructor(strings: any);
126
+ privateDict: any;
127
+ }
128
+ declare class CFFOffsetTracker {
129
+ offsets: any;
130
+ isTracking(key: any): boolean;
131
+ track(key: any, location: any): void;
132
+ offset(value: any): void;
133
+ setEntryLocation(key: any, values: any, output: any): void;
134
+ }
135
+ declare class CFFEncoding {
136
+ constructor(predefined: any, format: any, encoding: any, raw: any);
137
+ predefined: any;
138
+ format: any;
139
+ encoding: any;
140
+ raw: any;
141
+ }
142
+ declare class CFFDict {
143
+ static createTables(layout: any): {
144
+ keyToNameMap: {};
145
+ nameToKeyMap: {};
146
+ defaults: {};
147
+ types: {};
148
+ opcodes: {};
149
+ order: never[];
150
+ };
151
+ constructor(tables: any, strings: any);
152
+ keyToNameMap: any;
153
+ nameToKeyMap: any;
154
+ defaults: any;
155
+ types: any;
156
+ opcodes: any;
157
+ order: any;
158
+ strings: any;
159
+ values: any;
160
+ setByKey(key: any, value: any): boolean;
161
+ setByName(name: any, value: any): void;
162
+ hasName(name: any): boolean;
163
+ getByName(name: any): any;
164
+ removeByName(name: any): void;
165
+ }
166
+ export {};
@@ -0,0 +1,3 @@
1
+ export const ExpertCharset: string[];
2
+ export const ExpertSubsetCharset: string[];
3
+ export const ISOAdobeCharset: string[];
@@ -0,0 +1,37 @@
1
+ export class CMap {
2
+ constructor(builtInCMap?: boolean);
3
+ codespaceRanges: never[][];
4
+ numCodespaceRanges: number;
5
+ _map: any[];
6
+ name: string;
7
+ vertical: boolean;
8
+ useCMap: any;
9
+ builtInCMap: boolean;
10
+ addCodespaceRange(n: any, low: any, high: any): void;
11
+ mapCidRange(low: any, high: any, dstLow: any): void;
12
+ mapBfRange(low: any, high: any, dstLow: any): void;
13
+ mapBfRangeToArray(low: any, high: any, array: any): void;
14
+ mapOne(src: any, dst: any): void;
15
+ lookup(code: any): any;
16
+ contains(code: any): boolean;
17
+ forEach(callback: any): void;
18
+ charCodeOf(value: any): number;
19
+ getMap(): any[];
20
+ readCharCode(str: any, offset: any, out: any): void;
21
+ getCharCodeLength(charCode: any): number;
22
+ get length(): number;
23
+ get isIdentityCMap(): boolean;
24
+ }
25
+ export class CMapFactory {
26
+ static create({ encoding, fetchBuiltInCMap, useCMap }: {
27
+ encoding: any;
28
+ fetchBuiltInCMap: any;
29
+ useCMap: any;
30
+ }): Promise<any>;
31
+ }
32
+ export class IdentityCMap extends CMap {
33
+ constructor(vertical: any, n: any);
34
+ vertical: any;
35
+ charCodeOf(value: any): any;
36
+ get isIdentityCMap(): void;
37
+ }
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Alternate color space handles both Separation and DeviceN color spaces. A
3
+ * Separation color space is actually just a DeviceN with one color component.
4
+ * Both color spaces use a tinting function to convert colors to a base color
5
+ * space.
6
+ *
7
+ * The default color is `new Float32Array(new Array(numComps).fill(1))`.
8
+ */
9
+ export class AlternateCS extends ColorSpace {
10
+ constructor(numComps: any, base: any, tintFn: any);
11
+ base: any;
12
+ tintFn: any;
13
+ tmpBuf: Float32Array<any>;
14
+ getOutputLength(inputLength: any, alpha01: any): any;
15
+ }
16
+ /**
17
+ * CalGrayCS: Based on "PDF Reference, Sixth Ed", p.245
18
+ *
19
+ * The default color is `new Float32Array([0])`.
20
+ */
21
+ export class CalGrayCS extends ColorSpace {
22
+ constructor(whitePoint: any, blackPoint: any, gamma: any);
23
+ G: any;
24
+ XB: any;
25
+ YB: any;
26
+ ZB: any;
27
+ getOutputLength(inputLength: any, alpha01: any): number;
28
+ #private;
29
+ }
30
+ /**
31
+ * CalRGBCS: Based on "PDF Reference, Sixth Ed", p.247
32
+ *
33
+ * The default color is `new Float32Array([0, 0, 0])`.
34
+ */
35
+ export class CalRGBCS extends ColorSpace {
36
+ static "__#private@#BRADFORD_SCALE_MATRIX": Float32Array<ArrayBuffer>;
37
+ static "__#private@#BRADFORD_SCALE_INVERSE_MATRIX": Float32Array<ArrayBuffer>;
38
+ static "__#private@#SRGB_D65_XYZ_TO_RGB_MATRIX": Float32Array<ArrayBuffer>;
39
+ static "__#private@#FLAT_WHITEPOINT_MATRIX": Float32Array<ArrayBuffer>;
40
+ static "__#private@#tempNormalizeMatrix": Float32Array<ArrayBuffer>;
41
+ static "__#private@#tempConvertMatrix1": Float32Array<ArrayBuffer>;
42
+ static "__#private@#tempConvertMatrix2": Float32Array<ArrayBuffer>;
43
+ static "__#private@#DECODE_L_CONSTANT": number;
44
+ constructor(whitePoint: any, blackPoint: any, gamma: any, matrix: any);
45
+ whitePoint: any;
46
+ blackPoint: any;
47
+ GR: any;
48
+ GG: any;
49
+ GB: any;
50
+ getOutputLength(inputLength: any, alpha01: any): number;
51
+ #private;
52
+ }
53
+ export class ColorSpace {
54
+ static "__#private@#rgbBuf": Uint8ClampedArray<ArrayBuffer>;
55
+ /**
56
+ * Checks if a decode map matches the default decode map for a color space.
57
+ * This handles the general decode maps where there are two values per
58
+ * component, e.g. [0, 1, 0, 1, 0, 1] for a RGB color.
59
+ * This does not handle Lab, Indexed, or Pattern decode maps since they are
60
+ * slightly different.
61
+ * @param {Array} decode - Decode map (usually from an image).
62
+ * @param {number} numComps - Number of components the color space has.
63
+ */
64
+ static isDefaultDecode(decode: any[], numComps: number): boolean;
65
+ constructor(name: any, numComps: any);
66
+ name: any;
67
+ numComps: any;
68
+ /**
69
+ * Converts the color value to the RGB color. The color components are
70
+ * located in the src array starting from the srcOffset. Returns the array
71
+ * of the rgb components, each value ranging from [0,255].
72
+ */
73
+ getRgb(src: any, srcOffset: any, output?: Uint8ClampedArray<ArrayBuffer>): Uint8ClampedArray<ArrayBuffer>;
74
+ getRgbHex(src: any, srcOffset: any): string;
75
+ /**
76
+ * Converts the color value to the RGB color, similar to the getRgb method.
77
+ * The result placed into the dest array starting from the destOffset.
78
+ */
79
+ getRgbItem(src: any, srcOffset: any, dest: any, destOffset: any): void;
80
+ /**
81
+ * Converts the specified number of the color values to the RGB colors.
82
+ * The colors are located in the src array starting from the srcOffset.
83
+ * The result is placed into the dest array starting from the destOffset.
84
+ * The src array items shall be in [0,2^bits) range, the dest array items
85
+ * will be in [0,255] range. alpha01 indicates how many alpha components
86
+ * there are in the dest array; it will be either 0 (RGB array) or 1 (RGBA
87
+ * array).
88
+ */
89
+ getRgbBuffer(src: any, srcOffset: any, count: any, dest: any, destOffset: any, bits: any, alpha01: any): void;
90
+ /**
91
+ * Determines the number of bytes required to store the result of the
92
+ * conversion done by the getRgbBuffer method. As in getRgbBuffer,
93
+ * |alpha01| is either 0 (RGB output) or 1 (RGBA output).
94
+ */
95
+ getOutputLength(inputLength: any, alpha01: any): void;
96
+ /**
97
+ * Returns true if source data will be equal the result/output data.
98
+ */
99
+ isPassthrough(bits: any): boolean;
100
+ /**
101
+ * Refer to the static `ColorSpace.isDefaultDecode` method below.
102
+ */
103
+ isDefaultDecode(decodeMap: any, bpc: any): boolean;
104
+ /**
105
+ * Fills in the RGB colors in the destination buffer. alpha01 indicates
106
+ * how many alpha components there are in the dest array; it will be either
107
+ * 0 (RGB array) or 1 (RGBA array).
108
+ */
109
+ fillRgb(dest: any, originalWidth: any, originalHeight: any, width: any, height: any, actualHeight: any, bpc: any, comps: any, alpha01: any): void;
110
+ /**
111
+ * True if the colorspace has components in the default range of [0, 1].
112
+ * This should be true for all colorspaces except for lab color spaces
113
+ * which are [0,100], [-128, 127], [-128, 127].
114
+ */
115
+ get usesZeroToOneRange(): any;
116
+ }
117
+ /**
118
+ * The default color is `new Float32Array([0, 0, 0, 1])`.
119
+ */
120
+ export class DeviceCmykCS extends ColorSpace {
121
+ constructor();
122
+ getOutputLength(inputLength: any, alpha01: any): number;
123
+ #private;
124
+ }
125
+ /**
126
+ * The default color is `new Float32Array([0])`.
127
+ */
128
+ export class DeviceGrayCS extends ColorSpace {
129
+ constructor();
130
+ getOutputLength(inputLength: any, alpha01: any): number;
131
+ }
132
+ /**
133
+ * The default color is `new Float32Array([0, 0, 0, 1])`.
134
+ */
135
+ export class DeviceRgbaCS extends ColorSpace {
136
+ constructor();
137
+ getOutputLength(inputLength: any, _alpha01: any): number;
138
+ }
139
+ /**
140
+ * The default color is `new Float32Array([0, 0, 0])`.
141
+ */
142
+ export class DeviceRgbCS extends ColorSpace {
143
+ constructor();
144
+ getOutputLength(inputLength: any, alpha01: any): number;
145
+ }
146
+ /**
147
+ * The default color is `new Uint8Array([0])`.
148
+ */
149
+ export class IndexedCS extends ColorSpace {
150
+ constructor(base: any, highVal: any, lookup: any);
151
+ base: any;
152
+ highVal: any;
153
+ lookup: Uint8Array<ArrayBuffer>;
154
+ getOutputLength(inputLength: any, alpha01: any): any;
155
+ }
156
+ /**
157
+ * LabCS: Based on "PDF Reference, Sixth Ed", p.250
158
+ *
159
+ * The default color is `new Float32Array([0, 0, 0])`.
160
+ */
161
+ export class LabCS extends ColorSpace {
162
+ constructor(whitePoint: any, blackPoint: any, range: any);
163
+ XB: any;
164
+ YB: any;
165
+ ZB: any;
166
+ amin: any;
167
+ amax: any;
168
+ bmin: any;
169
+ bmax: any;
170
+ getOutputLength(inputLength: any, alpha01: any): number;
171
+ #private;
172
+ }
173
+ export class PatternCS extends ColorSpace {
174
+ constructor(baseCS: any);
175
+ base: any;
176
+ isDefaultDecode(decodeMap: any, bpc: any): void;
177
+ }