-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathindex.d.ts
93 lines (72 loc) · 2.18 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import {type BrowserWindow} from 'electron';
export type Options = {
/**
Default: [Only in development](https://github.com/sindresorhus/electron-is-dev)
*/
readonly isEnabled?: boolean;
/**
Show DevTools on each created `BrowserWindow`.
@default true
*/
readonly showDevTools?: boolean;
/**
The dock state to open DevTools in.
@default 'previous'
*/
readonly devToolsMode?:
| 'undocked'
| 'left'
| 'right'
| 'bottom'
| 'previous'
| 'detach';
/**
Specify customized options for each window.
The given function receives the window to apply the filter or new options to.
It must return one of these values:
- `true`: To enable debug with the global options for the given window.
- `false`: Disable debug for the given window (same as returning `{isEnabled: false}`).
- `Partial<Options>`: Object to override global options just for the given window. It does a shallow merge.
@default () => true
@example
```
import debug from 'electron-debug';
debug({
windowSelector: window => window.title !== 'Debug tools',
});
```
*/
windowSelector?: (window: Readonly<BrowserWindow>) => boolean | Partial<Options>;
};
/**
Install keyboard shortcuts and optionally activate DevTools on each created `BrowserWindow`.
@example
```
import {app, BrowserWindow} from 'electron';
import debug from 'electron-debug';
debug();
let mainWindow;
(async () => {
await app.whenReady();
mainWindow = new BrowserWindow();
});
```
*/
export default function debug(options?: Options): void;
/**
Reload the specified `BrowserWindow` instance or the focused one.
@param window - Default: `BrowserWindow.getFocusedWindow()`
*/
export function refresh(window?: BrowserWindow): void;
/**
Toggle DevTools for the specified `BrowserWindow` instance or the focused one.
@param window - Default: `BrowserWindow.getFocusedWindow()`
*/
// eslint-disable-next-line unicorn/prevent-abbreviations
export function devTools(window?: BrowserWindow): void;
/**
Open DevTools for the specified `BrowserWindow` instance or the focused one.
@param window - Default: `BrowserWindow.getFocusedWindow()`
*/
// eslint-disable-next-line unicorn/prevent-abbreviations
export function openDevTools(window?: BrowserWindow): void;