/
types.ts
29 lines (25 loc) · 903 Bytes
/
types.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
import type { PuppeteerLifeCycleEvent, Page, PuppeteerNodeLaunchOptions } from "puppeteer";
import type { Screenshot } from "./models/Screenshot";
export type Content = Array<{ output: string; selector?: string }> | object;
export type Encoding = "base64" | "binary";
export type ImageType = "png" | "jpeg";
export interface ScreenshotParams {
html: string;
encoding?: Encoding;
transparent?: boolean;
type?: ImageType;
quality?: number;
selector?: string;
content?: Content;
output?: string;
}
export interface Options extends ScreenshotParams {
puppeteerArgs?: PuppeteerNodeLaunchOptions;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
beforeScreenshot?: (page: Page) => void;
}
export interface MakeScreenshotParams {
screenshot: Screenshot;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
beforeScreenshot?: (page: Page) => void;
}