From b4ba9c803dbbbbdd77d646044bd70f01cbd5dbaf Mon Sep 17 00:00:00 2001 From: s Date: Wed, 29 Sep 2021 11:46:57 -0400 Subject: [PATCH] chore: fix typings for ElementHandle.screenshot() options (#7602) --- src/common/JSHandle.ts | 4 ++-- utils/doclint/check_public_api/index.js | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/common/JSHandle.ts b/src/common/JSHandle.ts index 6dbb253709801..15fcc6d0c64d8 100644 --- a/src/common/JSHandle.ts +++ b/src/common/JSHandle.ts @@ -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'; @@ -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 { + async screenshot(options: ScreenshotOptions = {}): Promise { let needsViewportReset = false; let boundingBox = await this.boundingBox(); diff --git a/utils/doclint/check_public_api/index.js b/utils/doclint/check_public_api/index.js index 45593b53aece6..4e49e53223bcc 100644 --- a/utils/doclint/check_public_api/index.js +++ b/utils/doclint/check_public_api/index.js @@ -428,6 +428,13 @@ function compareDocumentations(actual, expected) { expectedName: 'DragData', }, ], + [ + 'Method ElementHandle.screenshot() options', + { + actualName: 'Object', + expectedName: 'ScreenshotOptions', + }, + ], [ 'Method Keyboard.down() key', {