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', {