Skip to content

Commit

Permalink
fix: expose ScreenshotOptions type in type defs (#6869)
Browse files Browse the repository at this point in the history
Fixes #6866.
  • Loading branch information
jackfranklin committed Feb 11, 2021
1 parent df41b87 commit 63d48b2
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions src/common/Page.ts
Expand Up @@ -135,21 +135,54 @@ interface MediaFeature {
value: string;
}

interface ScreenshotClip {
/**
* @public
*/
export interface ScreenshotClip {
x: number;
y: number;
width: number;
height: number;
}

interface ScreenshotOptions {
/**
* @public
*/
export interface ScreenshotOptions {
/**
* @default 'png'
*/
type?: 'png' | 'jpeg';
/**
* The file path to save the image to. The screenshot type will be inferred
* from file extension. If path is a relative path, then it is resolved
* relative to current working directory. If no path is provided, the image
* won't be saved to the disk.
*/
path?: string;
/**
* When true, takes a screenshot of the full page.
* @default false
*/
fullPage?: boolean;
/**
* An object which specifies the clipping region of the page.
*/
clip?: ScreenshotClip;
/**
* Quality of the image, between 0-100. Not applicable to `png` images.
*/
quality?: number;
/**
* Hides default white background and allows capturing screenshots with transparency.
* @default false
*/
omitBackground?: boolean;
encoding?: string;
/**
* Encoding of the image.
* @default 'binary'
*/
encoding?: 'base64' | 'binary';
}

/**
Expand Down

0 comments on commit 63d48b2

Please sign in to comment.