fix(types): restore electron types (#5574)

This commit is contained in:
Joel Einbinder 2021-02-23 20:29:10 -08:00 коммит произвёл GitHub
Родитель 841264c94d
Коммит 180446d20f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 15 добавлений и 9 удалений

11
types/types.d.ts поставляемый
Просмотреть файл

@ -7042,6 +7042,9 @@ type AccessibilityNode = {
export const selectors: Selectors;
export const devices: Devices & DeviceDescriptor[];
//@ts-ignore this will be any if electron is not installed
type ElectronType = typeof import('electron');
/**
* Electron application representation. You can use
* [electron.launch([options])](https://playwright.dev/docs/api/class-electron#electronlaunchoptions) to obtain the
@ -7095,8 +7098,8 @@ export interface ElectronApplication {
* @param pageFunction Function to be evaluated in the worker context.
* @param arg Optional argument to pass to `pageFunction`.
*/
evaluate<R, Arg>(pageFunction: PageFunctionOn<any, Arg, R>, arg: Arg): Promise<R>;
evaluate<R>(pageFunction: PageFunctionOn<any, void, R>, arg?: any): Promise<R>;
evaluate<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<R>;
evaluate<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<R>;
/**
* Returns the return value of `pageFunction` as a [JSHandle].
@ -7117,8 +7120,8 @@ export interface ElectronApplication {
* @param pageFunction Function to be evaluated in the worker context.
* @param arg
*/
evaluateHandle<R, Arg>(pageFunction: PageFunctionOn<any, Arg, R>, arg: Arg): Promise<SmartHandle<R>>;
evaluateHandle<R>(pageFunction: PageFunctionOn<any, void, R>, arg?: any): Promise<SmartHandle<R>>;
evaluateHandle<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<SmartHandle<R>>;
evaluateHandle<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<SmartHandle<R>>;
/**
* This event is issued when the application closes.
*/

13
utils/generate_types/overrides.d.ts поставляемый
Просмотреть файл

@ -222,12 +222,15 @@ type AccessibilityNode = {
export const selectors: Selectors;
export const devices: Devices & DeviceDescriptor[];
export interface ElectronApplication {
evaluate<R, Arg>(pageFunction: PageFunctionOn<any, Arg, R>, arg: Arg): Promise<R>;
evaluate<R>(pageFunction: PageFunctionOn<any, void, R>, arg?: any): Promise<R>;
//@ts-ignore this will be any if electron is not installed
type ElectronType = typeof import('electron');
evaluateHandle<R, Arg>(pageFunction: PageFunctionOn<any, Arg, R>, arg: Arg): Promise<SmartHandle<R>>;
evaluateHandle<R>(pageFunction: PageFunctionOn<any, void, R>, arg?: any): Promise<SmartHandle<R>>;
export interface ElectronApplication {
evaluate<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<R>;
evaluate<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<R>;
evaluateHandle<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<SmartHandle<R>>;
evaluateHandle<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<SmartHandle<R>>;
}
export type AndroidElementInfo = {