util.d.ts 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. /**
  2. * Promise Capability object.
  3. */
  4. export type PromiseCapability = {
  5. /**
  6. * - A Promise object.
  7. */
  8. promise: Promise<any>;
  9. /**
  10. * - If the Promise has been fulfilled/rejected.
  11. */
  12. settled: boolean;
  13. /**
  14. * - Fulfills the Promise.
  15. */
  16. resolve: Function;
  17. /**
  18. * - Rejects the Promise.
  19. */
  20. reject: Function;
  21. };
  22. /**
  23. * @type {any}
  24. */
  25. export const BaseException: any;
  26. export const FONT_IDENTITY_MATRIX: number[];
  27. export const IDENTITY_MATRIX: number[];
  28. export namespace OPS {
  29. export const dependency: number;
  30. export const setLineWidth: number;
  31. export const setLineCap: number;
  32. export const setLineJoin: number;
  33. export const setMiterLimit: number;
  34. export const setDash: number;
  35. export const setRenderingIntent: number;
  36. export const setFlatness: number;
  37. export const setGState: number;
  38. export const save: number;
  39. export const restore: number;
  40. export const transform: number;
  41. export const moveTo: number;
  42. export const lineTo: number;
  43. export const curveTo: number;
  44. export const curveTo2: number;
  45. export const curveTo3: number;
  46. export const closePath: number;
  47. export const rectangle: number;
  48. export const stroke: number;
  49. export const closeStroke: number;
  50. export const fill: number;
  51. export const eoFill: number;
  52. export const fillStroke: number;
  53. export const eoFillStroke: number;
  54. export const closeFillStroke: number;
  55. export const closeEOFillStroke: number;
  56. export const endPath: number;
  57. export const clip: number;
  58. export const eoClip: number;
  59. export const beginText: number;
  60. export const endText: number;
  61. export const setCharSpacing: number;
  62. export const setWordSpacing: number;
  63. export const setHScale: number;
  64. export const setLeading: number;
  65. export const setFont: number;
  66. export const setTextRenderingMode: number;
  67. export const setTextRise: number;
  68. export const moveText: number;
  69. export const setLeadingMoveText: number;
  70. export const setTextMatrix: number;
  71. export const nextLine: number;
  72. export const showText: number;
  73. export const showSpacedText: number;
  74. export const nextLineShowText: number;
  75. export const nextLineSetSpacingShowText: number;
  76. export const setCharWidth: number;
  77. export const setCharWidthAndBounds: number;
  78. export const setStrokeColorSpace: number;
  79. export const setFillColorSpace: number;
  80. export const setStrokeColor: number;
  81. export const setStrokeColorN: number;
  82. export const setFillColor: number;
  83. export const setFillColorN: number;
  84. export const setStrokeGray: number;
  85. export const setFillGray: number;
  86. export const setStrokeRGBColor: number;
  87. export const setFillRGBColor: number;
  88. export const setStrokeCMYKColor: number;
  89. export const setFillCMYKColor: number;
  90. export const shadingFill: number;
  91. export const beginInlineImage: number;
  92. export const beginImageData: number;
  93. export const endInlineImage: number;
  94. export const paintXObject: number;
  95. export const markPoint: number;
  96. export const markPointProps: number;
  97. export const beginMarkedContent: number;
  98. export const beginMarkedContentProps: number;
  99. export const endMarkedContent: number;
  100. export const beginCompat: number;
  101. export const endCompat: number;
  102. export const paintFormXObjectBegin: number;
  103. export const paintFormXObjectEnd: number;
  104. export const beginGroup: number;
  105. export const endGroup: number;
  106. export const beginAnnotations: number;
  107. export const endAnnotations: number;
  108. export const beginAnnotation: number;
  109. export const endAnnotation: number;
  110. export const paintJpegXObject: number;
  111. export const paintImageMaskXObject: number;
  112. export const paintImageMaskXObjectGroup: number;
  113. export const paintImageXObject: number;
  114. export const paintInlineImageXObject: number;
  115. export const paintInlineImageXObjectGroup: number;
  116. export const paintImageXObjectRepeat: number;
  117. export const paintImageMaskXObjectRepeat: number;
  118. export const paintSolidColorImageMask: number;
  119. export const constructPath: number;
  120. }
  121. export namespace VerbosityLevel {
  122. export const ERRORS: number;
  123. export const WARNINGS: number;
  124. export const INFOS: number;
  125. }
  126. export const UNSUPPORTED_FEATURES: {
  127. /** @deprecated unused */
  128. unknown: string;
  129. forms: string;
  130. javaScript: string;
  131. smask: string;
  132. shadingPattern: string;
  133. /** @deprecated unused */
  134. font: string;
  135. errorTilingPattern: string;
  136. errorExtGState: string;
  137. errorXObject: string;
  138. errorFontLoadType3: string;
  139. errorFontState: string;
  140. errorFontMissing: string;
  141. errorFontTranslate: string;
  142. errorColorSpace: string;
  143. errorOperatorList: string;
  144. errorFontToUnicode: string;
  145. errorFontLoadNative: string;
  146. errorFontGetPath: string;
  147. errorMarkedContent: string;
  148. };
  149. export namespace AnnotationBorderStyleType {
  150. export const SOLID: number;
  151. export const DASHED: number;
  152. export const BEVELED: number;
  153. export const INSET: number;
  154. export const UNDERLINE: number;
  155. }
  156. export namespace AnnotationFieldFlag {
  157. export const READONLY: number;
  158. export const REQUIRED: number;
  159. export const NOEXPORT: number;
  160. export const MULTILINE: number;
  161. export const PASSWORD: number;
  162. export const NOTOGGLETOOFF: number;
  163. export const RADIO: number;
  164. export const PUSHBUTTON: number;
  165. export const COMBO: number;
  166. export const EDIT: number;
  167. export const SORT: number;
  168. export const FILESELECT: number;
  169. export const MULTISELECT: number;
  170. export const DONOTSPELLCHECK: number;
  171. export const DONOTSCROLL: number;
  172. export const COMB: number;
  173. export const RICHTEXT: number;
  174. export const RADIOSINUNISON: number;
  175. export const COMMITONSELCHANGE: number;
  176. }
  177. export namespace AnnotationFlag {
  178. export const INVISIBLE: number;
  179. export const HIDDEN: number;
  180. export const PRINT: number;
  181. export const NOZOOM: number;
  182. export const NOROTATE: number;
  183. export const NOVIEW: number;
  184. const READONLY_1: number;
  185. export { READONLY_1 as READONLY };
  186. export const LOCKED: number;
  187. export const TOGGLENOVIEW: number;
  188. export const LOCKEDCONTENTS: number;
  189. }
  190. export namespace AnnotationMarkedState {
  191. export const MARKED: string;
  192. export const UNMARKED: string;
  193. }
  194. export namespace AnnotationReplyType {
  195. export const GROUP: string;
  196. export const REPLY: string;
  197. }
  198. export namespace AnnotationReviewState {
  199. export const ACCEPTED: string;
  200. export const REJECTED: string;
  201. export const CANCELLED: string;
  202. export const COMPLETED: string;
  203. export const NONE: string;
  204. }
  205. export namespace AnnotationStateModelType {
  206. const MARKED_1: string;
  207. export { MARKED_1 as MARKED };
  208. export const REVIEW: string;
  209. }
  210. export namespace AnnotationType {
  211. export const TEXT: number;
  212. export const LINK: number;
  213. export const FREETEXT: number;
  214. export const LINE: number;
  215. export const SQUARE: number;
  216. export const CIRCLE: number;
  217. export const POLYGON: number;
  218. export const POLYLINE: number;
  219. export const HIGHLIGHT: number;
  220. const UNDERLINE_1: number;
  221. export { UNDERLINE_1 as UNDERLINE };
  222. export const SQUIGGLY: number;
  223. export const STRIKEOUT: number;
  224. export const STAMP: number;
  225. export const CARET: number;
  226. export const INK: number;
  227. export const POPUP: number;
  228. export const FILEATTACHMENT: number;
  229. export const SOUND: number;
  230. export const MOVIE: number;
  231. export const WIDGET: number;
  232. export const SCREEN: number;
  233. export const PRINTERMARK: number;
  234. export const TRAPNET: number;
  235. export const WATERMARK: number;
  236. export const THREED: number;
  237. export const REDACT: number;
  238. }
  239. export namespace FontType {
  240. export const UNKNOWN: string;
  241. export const TYPE1: string;
  242. export const TYPE1C: string;
  243. export const CIDFONTTYPE0: string;
  244. export const CIDFONTTYPE0C: string;
  245. export const TRUETYPE: string;
  246. export const CIDFONTTYPE2: string;
  247. export const TYPE3: string;
  248. export const OPENTYPE: string;
  249. export const TYPE0: string;
  250. export const MMTYPE1: string;
  251. }
  252. export namespace ImageKind {
  253. export const GRAYSCALE_1BPP: number;
  254. export const RGB_24BPP: number;
  255. export const RGBA_32BPP: number;
  256. }
  257. export namespace CMapCompressionType {
  258. const NONE_1: number;
  259. export { NONE_1 as NONE };
  260. export const BINARY: number;
  261. export const STREAM: number;
  262. }
  263. declare const AbortException_base: any;
  264. /**
  265. * Error used to indicate task cancellation.
  266. */
  267. export class AbortException extends AbortException_base {
  268. [x: string]: any;
  269. }
  270. declare const InvalidPDFException_base: any;
  271. export class InvalidPDFException extends InvalidPDFException_base {
  272. [x: string]: any;
  273. }
  274. declare const MissingPDFException_base: any;
  275. export class MissingPDFException extends MissingPDFException_base {
  276. [x: string]: any;
  277. }
  278. declare const PasswordException_base: any;
  279. export class PasswordException extends PasswordException_base {
  280. [x: string]: any;
  281. constructor(msg: any, code: any);
  282. code: any;
  283. }
  284. export namespace PasswordResponses {
  285. export const NEED_PASSWORD: number;
  286. export const INCORRECT_PASSWORD: number;
  287. }
  288. export namespace PermissionFlag {
  289. const PRINT_1: number;
  290. export { PRINT_1 as PRINT };
  291. export const MODIFY_CONTENTS: number;
  292. export const COPY: number;
  293. export const MODIFY_ANNOTATIONS: number;
  294. export const FILL_INTERACTIVE_FORMS: number;
  295. export const COPY_FOR_ACCESSIBILITY: number;
  296. export const ASSEMBLE: number;
  297. export const PRINT_HIGH_QUALITY: number;
  298. }
  299. export namespace StreamType {
  300. const UNKNOWN_1: string;
  301. export { UNKNOWN_1 as UNKNOWN };
  302. export const FLATE: string;
  303. export const LZW: string;
  304. export const DCT: string;
  305. export const JPX: string;
  306. export const JBIG: string;
  307. export const A85: string;
  308. export const AHX: string;
  309. export const CCF: string;
  310. export const RLX: string;
  311. }
  312. export namespace TextRenderingMode {
  313. export const FILL: number;
  314. export const STROKE: number;
  315. export const FILL_STROKE: number;
  316. const INVISIBLE_1: number;
  317. export { INVISIBLE_1 as INVISIBLE };
  318. export const FILL_ADD_TO_PATH: number;
  319. export const STROKE_ADD_TO_PATH: number;
  320. export const FILL_STROKE_ADD_TO_PATH: number;
  321. export const ADD_TO_PATH: number;
  322. export const FILL_STROKE_MASK: number;
  323. export const ADD_TO_PATH_FLAG: number;
  324. }
  325. declare const UnexpectedResponseException_base: any;
  326. export class UnexpectedResponseException extends UnexpectedResponseException_base {
  327. [x: string]: any;
  328. constructor(msg: any, status: any);
  329. status: any;
  330. }
  331. declare const UnknownErrorException_base: any;
  332. export class UnknownErrorException extends UnknownErrorException_base {
  333. [x: string]: any;
  334. constructor(msg: any, details: any);
  335. details: any;
  336. }
  337. export class Util {
  338. static makeCssRgb(r: any, g: any, b: any): string;
  339. static transform(m1: any, m2: any): any[];
  340. static applyTransform(p: any, m: any): any[];
  341. static applyInverseTransform(p: any, m: any): number[];
  342. static getAxialAlignedBoundingBox(r: any, m: any): number[];
  343. static inverseTransform(m: any): number[];
  344. static apply3dTransform(m: any, v: any): number[];
  345. static singularValueDecompose2dScale(m: any): number[];
  346. static normalizeRect(rect: any): any;
  347. static intersect(rect1: any, rect2: any): any[] | null;
  348. }
  349. declare const FormatError_base: any;
  350. /**
  351. * Error caused during parsing PDF data.
  352. */
  353. export class FormatError extends FormatError_base {
  354. [x: string]: any;
  355. }
  356. /**
  357. * Gets length of the array (Array, Uint8Array, or string) in bytes.
  358. * @param {Array<any>|Uint8Array|string} arr
  359. * @returns {number}
  360. */
  361. export function arrayByteLength(arr: Array<any> | Uint8Array | string): number;
  362. /**
  363. * Combines array items (arrays) into single Uint8Array object.
  364. * @param {Array<Array<any>|Uint8Array|string>} arr - the array of the arrays
  365. * (Array, Uint8Array, or string).
  366. * @returns {Uint8Array}
  367. */
  368. export function arraysToBytes(arr: Array<Array<any> | Uint8Array | string>): Uint8Array;
  369. export function assert(cond: any, msg: any): void;
  370. export function bytesToString(bytes: any): string;
  371. /**
  372. * Promise Capability object.
  373. *
  374. * @typedef {Object} PromiseCapability
  375. * @property {Promise<any>} promise - A Promise object.
  376. * @property {boolean} settled - If the Promise has been fulfilled/rejected.
  377. * @property {function} resolve - Fulfills the Promise.
  378. * @property {function} reject - Rejects the Promise.
  379. */
  380. /**
  381. * Creates a promise capability object.
  382. * @alias createPromiseCapability
  383. *
  384. * @returns {PromiseCapability}
  385. */
  386. export function createPromiseCapability(): PromiseCapability;
  387. export function createObjectURL(data: any, contentType: any, forceDataSchema?: boolean): string;
  388. export function escapeString(str: any): any;
  389. export function getModificationDate(date?: Date): string;
  390. export function getVerbosityLevel(): number;
  391. export function info(msg: any): void;
  392. export function isArrayBuffer(v: any): boolean;
  393. export function isArrayEqual(arr1: any, arr2: any): any;
  394. export function isBool(v: any): boolean;
  395. export function isNum(v: any): boolean;
  396. export function isString(v: any): boolean;
  397. export function isSameOrigin(baseUrl: any, otherUrl: any): boolean;
  398. /**
  399. * Attempts to create a valid absolute URL.
  400. *
  401. * @param {URL|string} url - An absolute, or relative, URL.
  402. * @param {URL|string} baseUrl - An absolute URL.
  403. * @returns Either a valid {URL}, or `null` otherwise.
  404. */
  405. export function createValidAbsoluteUrl(url: URL | string, baseUrl: URL | string): URL | null;
  406. export namespace IsLittleEndianCached { }
  407. export namespace IsEvalSupportedCached { }
  408. /**
  409. * @param {string} str
  410. */
  411. export function removeNullCharacters(str: string): string;
  412. export function setVerbosityLevel(level: any): void;
  413. export function shadow(obj: any, prop: any, value: any): any;
  414. export function string32(value: any): string;
  415. export function stringToBytes(str: any): Uint8Array;
  416. export function stringToPDFString(str: any): string;
  417. export function stringToUTF8String(str: any): string;
  418. export function utf8StringToString(str: any): string;
  419. export function warn(msg: any): void;
  420. export function unreachable(msg: any): void;
  421. export {};