-
Notifications
You must be signed in to change notification settings - Fork 55
/
index.d.ts
59 lines (55 loc) · 1.54 KB
/
index.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
// 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/>
import { PathLike } from "fs-extra";
declare module "pdf-merger-js" {
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<void>;
/**
* Save the merged PDF to the given path.
*
* @async
* @param {string | PathLike} fileName
* @returns {Promise<void>}
*/
save(fileName: string): Promise<void>;
/**
* Return the merged PDF as a Buffer.
*
* @async
* @returns {Promise<Buffer>}
*/
saveAsBuffer(): Promise<Buffer>;
/**
* Set the metadata of the merged PDF.
*
* @async
* @param {Metadata} metadata
* @returns {Promise<void>}
*/
setMetadata(metadata: Metadata): Promise<void>;
}
export default PDFMerger;
}
declare type PdfInput = Uint8Array | ArrayBuffer | Blob | URL | Buffer | String | PathLike | string;
declare interface Metadata {
producer?: string
author?: string
title?: string
creator?: string
}