-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
74 lines (66 loc) · 1.55 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
declare function create_pdf(html: string): Buffer | null;
export { create_pdf };
declare function configure_module(options: ConfigureOptions): void;
export { configure_module };
interface ConfigureOptions {
DEV_MODE?: boolean;
pdfConfig?: PdfConfig;
puppeteerConfig?: PuppeteerConfig;
}
interface PdfConfig {
displayHeaderFooter?: boolean;
headerTemplate?: string;
footerTemplate?: string;
format?: PdfFormat;
height?: string | number;
width?: string | number;
landscape?: boolean;
margin?: PdfMargin;
omitBackground?: boolean;
printBackground?: boolean;
scale?: number;
outline?: boolean;
pageRanges?: string;
path?: string;
preferCSSPageSize?: boolean;
tagged?: boolean;
timeout?: number;
}
type PdfFormat =
| "A0"
| "A1"
| "A2"
| "A3"
| "A4"
| "A5"
| "A6"
| "Letter"
| "Legal"
| "Tabloid"
| "Ledger";
interface PdfMargin {
top?: string | number;
right?: string | number;
bottom?: string | number;
left?: string | number;
}
interface PuppeteerConfig {
channel?: "chrome" | "chrome-beta" | "chrome-dev" | "chrome-canary";
dumpio?: boolean;
env?: Record<string, string | undefined>;
executablePath?: string;
extraPrefsFirefox?: Record<string, unknown>;
handleSIGINT?: boolean;
handleSIGTERM?: boolean;
handleSIGHUP?: boolean;
ignoreDefaultArgs?: boolean | string[];
pipe?: boolean;
product?: "chrome" | "firefox";
timeout?: number;
waitForInitialPage?: boolean;
args?: string[];
debuggingPort?: number;
devtools?: boolean;
headless?: boolean | "shell";
userDataDir?: string;
}