chore: fix typings for ElementHandle.screenshot() options (#7602)

This commit is contained in:
s 2021-09-29 11:46:57 -04:00 committed by GitHub
parent a271145b06
commit b4ba9c803d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -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<string | Buffer> {
async screenshot(options: ScreenshotOptions = {}): Promise<string | Buffer> {
let needsViewportReset = false;
let boundingBox = await this.boundingBox();

View File

@ -428,6 +428,13 @@ function compareDocumentations(actual, expected) {
expectedName: 'DragData',
},
],
[
'Method ElementHandle.screenshot() options',
{
actualName: 'Object',
expectedName: 'ScreenshotOptions',
},
],
[
'Method Keyboard.down() key',
{