-
Notifications
You must be signed in to change notification settings - Fork 55
/
browser.d.ts
68 lines (64 loc) · 1.83 KB
/
browser.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Type definitions for pdf-merger-js v5.0.0
// Project: https://github.com/nbesli/pdf-merger-js
// Definitions by: Alexander Wunschik <https://github.com/mojoaxel/>
// Daniel Hammer <https://github.com/danmhammer/>
// Lukas Loeffler <https://github.com/LukasLoeffler>
declare module "pdf-merger-js/browser" {
class PDFMerger {
constructor();
/**
* Resets the internal state of the document, to start again.
*
* @returns {void}
*/
reset(): void;
/**
* Add pages from a PDF document to the end of the merged document.
*
* @async
* @param {PdfInput} input - a pdf source
* @param {string | string[] | number | number[] | undefined | null} [pages]
* @returns {Promise<void>}
*/
add(inputFile: PdfInput, pages?: string | string[] | number | number[] | undefined | null): Promise<undefined>;
/**
* Download the PDF as a file with the given name.
* The extension ".pdf" is appended automatically.
*
* @async
* @param {string} fileName
* @returns {Promise<void>}
*/
save(fileName: string): Promise<void>;
/**
* Return the merged PDF as a Uint8Array.
*
* @async
* @returns {Promise<Uint8Array>}
*/
saveAsBuffer(): Promise<Uint8Array>;
/**
* Return the merged PDF as a Blob.
*
* @async
* @returns {Promise<Blob>}
*/
saveAsBlob(): Promise<Blob>;
/**
* Set the metadata of the merged PDF.
*
* @async
* @param {Metadata} metadata
* @returns {Promise<void>}
*/
setMetadata(metadata: Metadata): Promise<void>;
}
export = PDFMerger;
}
declare type PdfInput = Uint8Array | ArrayBuffer | Blob | URL | File | String | string;
declare interface Metadata {
producer?: string
author?: string
title?: string
creator?: string
}