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 `