From 43593edd3a57a473080fc5dd94a703d0c79c64ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Simon=20Maria=20M=C3=B6llers?= Date: Tue, 12 Jun 2018 18:05:03 +0200 Subject: [PATCH 1/7] [puppeteer] Add @ksm2 to authors --- types/puppeteer/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 9b81adcac7..feefc210ec 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/GoogleChrome/puppeteer#readme // Definitions by: Marvin Hagemeister // Christopher Deutsch +// Konstantin Simon Maria Möllers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From f1a6aba53c00bf4d20b03f3588ce93a137cf1624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Simon=20Maria=20M=C3=B6llers?= Date: Tue, 12 Jun 2018 18:05:47 +0200 Subject: [PATCH 2/7] [puppeteer] Make $eval and $$eval generic --- types/puppeteer/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index feefc210ec..37887d3a4f 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -776,27 +776,27 @@ export interface FrameBase { /** * This method runs document.querySelector within the page and passes it as the first argument to `fn`. * If there's no element matching selector, the method throws an error. - * If `fn` returns a Promise, then $eval would wait for the promise to resolve and return its value. + * If `pageFunction` returns a Promise, then $eval would wait for the promise to resolve and return its value. */ - $eval( + $eval( selector: string, - pageFunction: (element: Element, ...args: any[]) => any, + pageFunction: (element: Element, ...args: any[]) => T, ...args: any[] - ): Promise; + ): Promise; /** * This method runs document.querySelectorAll within the page and passes it as the first argument to `fn`. - * If `fn` returns a Promise, then $$eval would wait for the promise to resolve and return its value. + * If `pageFunction` returns a Promise, then $$eval would wait for the promise to resolve and return its value. * @param selector A selector to query frame for * @param fn Function to be evaluated in browser context * @param args Arguments to pass to pageFunction * @returns Promise which resolves to the return value of pageFunction */ - $$eval( + $$eval( selector: string, - pageFunction: (elements: NodeListOf, ...args: any[]) => any, + pageFunction: (elements: NodeListOf, ...args: any[]) => T, ...args: any[] - ): Promise; + ): Promise; /** Adds a `