UNPKG

1.26 kBTypeScriptView Raw
1import { Accelerator, BrowserWindow, NativeImage, MenuItem, Menu } from "electron";
2
3declare module 'testcafe-browser-provider-electron' {
4 interface Modifiers {
5 shift?: boolean;
6 ctrl?: boolean;
7 alt?: boolean;
8 meta?: boolean;
9 }
10
11 type HandlerType =
12 | 'open-dialog'
13 | 'save-dialog'
14 | 'message-box'
15 | 'error-box'
16 | 'certificate-trust-dialog'
17
18 type HandlerFn = (type: HandlerType, browserWindow?: BrowserWindow, ...args: any[]) => any;
19
20 export function getMainMenuItem(menuItemSelector: string[] | string | [string, { label: string, index: number }]): Promise<MenuItem>;
21 export function getMainMenuItems(): Promise<MenuItem[]>;
22
23 export function getContextMenuItem(menuItemSelector: string[] | string | [string, { label: string, index: number }]): Promise<MenuItem>
24 export function getContextMenuItems(): Promise<Menu[]>;
25
26 export function clickOnMainMenuItem(menuItem: string | MenuItem, modifiers?: Modifiers): Promise<void>;
27 export function clickOnContextMenuItem(menuItem: string | MenuItem, modifiers?: Modifiers): Promise<void>;
28
29 export function setElectronDialogHandler(handler: HandlerFn, dependencies: object)
30}
31
\No newline at end of file