// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. type Boxed = { [Index in keyof Args]: Args[Index] | Handle }; type PageFunction = string | ((...args: Args) => R | Promise); type PageFunctionOn = string | ((on: On, ...args: Args) => R | Promise); export type Evaluate = (pageFunction: PageFunction, ...args: Boxed) => Promise; export type EvaluateHandle = (pageFunction: PageFunction, ...args: Boxed) => Promise; export type $Eval = (selector: string, pageFunction: PageFunctionOn, ...args: Boxed) => Promise; export type $$Eval = (selector: string, pageFunction: PageFunctionOn, ...args: Boxed) => Promise; export type EvaluateOn = (pageFunction: PageFunctionOn, ...args: Boxed) => Promise; export type EvaluateHandleOn = (pageFunction: PageFunctionOn, ...args: Boxed) => Promise;