Skip to content

Commit

Permalink
chore: fix typings for ElementHandle.screenshot() options (#7602)
Browse files Browse the repository at this point in the history
  • Loading branch information
lostfictions committed Sep 29, 2021
1 parent a271145 commit b4ba9c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/JSHandle.ts
Expand Up @@ -17,7 +17,7 @@
import { assert } from './assert.js';
import { helper, debugError } from './helper.js';
import { ExecutionContext } from './ExecutionContext.js';
import { Page } from './Page.js';
import { Page, ScreenshotOptions } from './Page.js';
import { CDPSession } from './Connection.js';
import { KeyInput } from './USKeyboardLayout.js';
import { FrameManager, Frame } from './FrameManager.js';
Expand Down Expand Up @@ -813,7 +813,7 @@ export class ElementHandle<
* {@link Page.screenshot} to take a screenshot of the element.
* If the element is detached from DOM, the method throws an error.
*/
async screenshot(options = {}): Promise<string | Buffer> {
async screenshot(options: ScreenshotOptions = {}): Promise<string | Buffer> {
let needsViewportReset = false;

let boundingBox = await this.boundingBox();
Expand Down
7 changes: 7 additions & 0 deletions utils/doclint/check_public_api/index.js
Expand Up @@ -428,6 +428,13 @@ function compareDocumentations(actual, expected) {
expectedName: 'DragData',
},
],
[
'Method ElementHandle.screenshot() options',
{
actualName: 'Object',
expectedName: 'ScreenshotOptions',
},
],
[
'Method Keyboard.down() key',
{
Expand Down

0 comments on commit b4ba9c8

Please sign in to comment.