Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add typescript typings; Bump version (v0.0.8) (#35)
- Loading branch information
1 parent
ca705b7
commit 45d213e
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Accelerator, BrowserWindow, NativeImage, MenuItem, Menu } from "electron"; | ||
|
||
declare module 'testcafe-browser-provider-electron' { | ||
interface Modifiers { | ||
shift?: boolean; | ||
ctrl?: boolean; | ||
alt?: boolean; | ||
meta?: boolean; | ||
} | ||
|
||
type HandlerType = | ||
| 'open-dialog' | ||
| 'save-dialog' | ||
| 'message-box' | ||
| 'error-box' | ||
| 'certificate-trust-dialog' | ||
|
||
type HandlerFn = (type: HandlerType, browserWindow?: BrowserWindow, ...args: any[]) => any; | ||
|
||
export function getMainMenuItem(menuItemSelector: string[] | string | [string, { label: string, index: number }]): Promise<MenuItem>; | ||
export function getMainMenuItems(): Promise<MenuItem[]>; | ||
|
||
export function getContextMenuItem(menuItemSelector: string[] | string | [string, { label: string, index: number }]): Promise<MenuItem> | ||
export function getContextMenuItems(): Promise<Menu[]>; | ||
|
||
export function clickOnMainMenuItem(menuItem: string | MenuItem, modifiers?: Modifiers): Promise<void>; | ||
export function clickOnContextMenuItem(menuItem: string | MenuItem, modifiers?: Modifiers): Promise<void>; | ||
|
||
export function setElectronDialogHandler(handler: HandlerFn, dependencies: object) | ||
} |