mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
fixes Puppeteer evaluateHandle parameters (#39020)
This commit is contained in:
committed by
Armando Aguirre
parent
0a3c43f606
commit
83d8ffc9c6
Vendored
+3
-2
@@ -7,6 +7,7 @@
|
||||
// Serban Ghita <https://github.com/SerbanGhita>
|
||||
// Jason Kaczmarsky <https://github.com/JasonKaz>
|
||||
// Dave Cardwell <https://github.com/davecardwell>
|
||||
// Andrés Ortiz <https://github.com/angrykoala>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -242,10 +243,10 @@ export interface JSEvalable<A = any> {
|
||||
* @param args Arguments to pass to `fn`
|
||||
*/
|
||||
evaluateHandle(
|
||||
pageFunction: (arg1: A, ...args: any[]) => any,
|
||||
pageFunction: string | ((arg1: A, ...args: any[]) => any),
|
||||
...args: SerializableOrJSHandle[],
|
||||
): Promise<JSHandle>;
|
||||
}
|
||||
}
|
||||
|
||||
/** Keyboard provides an api for managing a virtual keyboard. */
|
||||
export interface Keyboard {
|
||||
|
||||
@@ -309,6 +309,7 @@ puppeteer.launch().then(async browser => {
|
||||
|
||||
// evaluateHandle example
|
||||
const aHandle = await page.evaluateHandle(() => document.body);
|
||||
await page.evaluateHandle('document.body');
|
||||
const resultHandle = await page.evaluateHandle(body => body.innerHTML, aHandle);
|
||||
console.log(await resultHandle.jsonValue());
|
||||
await resultHandle.dispose();
|
||||
|
||||
Reference in New Issue
Block a user