1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | type GlobalEvent = Event;
|
9 |
|
10 | declare namespace Electron {
|
11 | class Accelerator extends String {
|
12 |
|
13 | }
|
14 |
|
15 | interface CommonInterface {
|
16 | app: App;
|
17 | autoUpdater: AutoUpdater;
|
18 | BrowserView: typeof BrowserView;
|
19 | BrowserWindowProxy: typeof BrowserWindowProxy;
|
20 | BrowserWindow: typeof BrowserWindow;
|
21 | ClientRequest: typeof ClientRequest;
|
22 | clipboard: Clipboard;
|
23 | CommandLine: typeof CommandLine;
|
24 | contentTracing: ContentTracing;
|
25 | contextBridge: ContextBridge;
|
26 | Cookies: typeof Cookies;
|
27 | crashReporter: CrashReporter;
|
28 | Debugger: typeof Debugger;
|
29 | desktopCapturer: DesktopCapturer;
|
30 | dialog: Dialog;
|
31 | Dock: typeof Dock;
|
32 | DownloadItem: typeof DownloadItem;
|
33 | globalShortcut: GlobalShortcut;
|
34 | inAppPurchase: InAppPurchase;
|
35 | IncomingMessage: typeof IncomingMessage;
|
36 | ipcMain: IpcMain;
|
37 | ipcRenderer: IpcRenderer;
|
38 | MenuItem: typeof MenuItem;
|
39 | Menu: typeof Menu;
|
40 | nativeImage: typeof NativeImage;
|
41 | nativeTheme: NativeTheme;
|
42 | netLog: NetLog;
|
43 | net: Net;
|
44 | Notification: typeof Notification;
|
45 | powerMonitor: PowerMonitor;
|
46 | powerSaveBlocker: PowerSaveBlocker;
|
47 | protocol: Protocol;
|
48 | remote: Remote;
|
49 | screen: Screen;
|
50 | session: typeof Session;
|
51 | shell: Shell;
|
52 | systemPreferences: SystemPreferences;
|
53 | TouchBarButton: typeof TouchBarButton;
|
54 | TouchBarColorPicker: typeof TouchBarColorPicker;
|
55 | TouchBarGroup: typeof TouchBarGroup;
|
56 | TouchBarLabel: typeof TouchBarLabel;
|
57 | TouchBarPopover: typeof TouchBarPopover;
|
58 | TouchBarScrubber: typeof TouchBarScrubber;
|
59 | TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
|
60 | TouchBarSlider: typeof TouchBarSlider;
|
61 | TouchBarSpacer: typeof TouchBarSpacer;
|
62 | TouchBar: typeof TouchBar;
|
63 | Tray: typeof Tray;
|
64 | webContents: typeof WebContents;
|
65 | webFrame: WebFrame;
|
66 | WebRequest: typeof WebRequest;
|
67 | webviewTag: WebviewTag;
|
68 | }
|
69 |
|
70 | interface MainInterface extends CommonInterface {
|
71 | }
|
72 |
|
73 | interface RendererInterface extends CommonInterface {
|
74 | }
|
75 |
|
76 | interface AllElectron extends MainInterface, RendererInterface {}
|
77 |
|
78 | const app: App;
|
79 | const autoUpdater: AutoUpdater;
|
80 | const clipboard: Clipboard;
|
81 | const contentTracing: ContentTracing;
|
82 | const contextBridge: ContextBridge;
|
83 | const crashReporter: CrashReporter;
|
84 | const desktopCapturer: DesktopCapturer;
|
85 | const dialog: Dialog;
|
86 | const globalShortcut: GlobalShortcut;
|
87 | const inAppPurchase: InAppPurchase;
|
88 | const ipcMain: IpcMain;
|
89 | const ipcRenderer: IpcRenderer;
|
90 | type nativeImage = NativeImage;
|
91 | const nativeImage: typeof NativeImage;
|
92 | const nativeTheme: NativeTheme;
|
93 | const netLog: NetLog;
|
94 | const net: Net;
|
95 | const powerMonitor: PowerMonitor;
|
96 | const powerSaveBlocker: PowerSaveBlocker;
|
97 | const protocol: Protocol;
|
98 | const remote: Remote;
|
99 | const screen: Screen;
|
100 | type session = Session;
|
101 | const session: typeof Session;
|
102 | const shell: Shell;
|
103 | const systemPreferences: SystemPreferences;
|
104 | type webContents = WebContents;
|
105 | const webContents: typeof WebContents;
|
106 | const webFrame: WebFrame;
|
107 | const webviewTag: WebviewTag;
|
108 |
|
109 | interface App extends NodeJS.EventEmitter {
|
110 |
|
111 |
|
112 |
|
113 | |
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 | on(event: 'accessibility-support-changed', listener: (event: Event,
|
122 | |
123 |
|
124 |
|
125 | accessibilitySupportEnabled: boolean) => void): this;
|
126 | once(event: 'accessibility-support-changed', listener: (event: Event,
|
127 | |
128 |
|
129 |
|
130 | accessibilitySupportEnabled: boolean) => void): this;
|
131 | addListener(event: 'accessibility-support-changed', listener: (event: Event,
|
132 | |
133 |
|
134 |
|
135 | accessibilitySupportEnabled: boolean) => void): this;
|
136 | removeListener(event: 'accessibility-support-changed', listener: (event: Event,
|
137 | |
138 |
|
139 |
|
140 | accessibilitySupportEnabled: boolean) => void): this;
|
141 | |
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 | on(event: 'activate', listener: (event: Event,
|
150 | hasVisibleWindows: boolean) => void): this;
|
151 | once(event: 'activate', listener: (event: Event,
|
152 | hasVisibleWindows: boolean) => void): this;
|
153 | addListener(event: 'activate', listener: (event: Event,
|
154 | hasVisibleWindows: boolean) => void): this;
|
155 | removeListener(event: 'activate', listener: (event: Event,
|
156 | hasVisibleWindows: boolean) => void): this;
|
157 | |
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 | on(event: 'activity-was-continued', listener: (event: Event,
|
164 | |
165 |
|
166 |
|
167 | type: string,
|
168 | |
169 |
|
170 |
|
171 | userInfo: unknown) => void): this;
|
172 | once(event: 'activity-was-continued', listener: (event: Event,
|
173 | |
174 |
|
175 |
|
176 | type: string,
|
177 | |
178 |
|
179 |
|
180 | userInfo: unknown) => void): this;
|
181 | addListener(event: 'activity-was-continued', listener: (event: Event,
|
182 | |
183 |
|
184 |
|
185 | type: string,
|
186 | |
187 |
|
188 |
|
189 | userInfo: unknown) => void): this;
|
190 | removeListener(event: 'activity-was-continued', listener: (event: Event,
|
191 | |
192 |
|
193 |
|
194 | type: string,
|
195 | |
196 |
|
197 |
|
198 | userInfo: unknown) => void): this;
|
199 | |
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 | on(event: 'before-quit', listener: (event: Event) => void): this;
|
212 | once(event: 'before-quit', listener: (event: Event) => void): this;
|
213 | addListener(event: 'before-quit', listener: (event: Event) => void): this;
|
214 | removeListener(event: 'before-quit', listener: (event: Event) => void): this;
|
215 | |
216 |
|
217 |
|
218 | on(event: 'browser-window-blur', listener: (event: Event,
|
219 | window: BrowserWindow) => void): this;
|
220 | once(event: 'browser-window-blur', listener: (event: Event,
|
221 | window: BrowserWindow) => void): this;
|
222 | addListener(event: 'browser-window-blur', listener: (event: Event,
|
223 | window: BrowserWindow) => void): this;
|
224 | removeListener(event: 'browser-window-blur', listener: (event: Event,
|
225 | window: BrowserWindow) => void): this;
|
226 | |
227 |
|
228 |
|
229 | on(event: 'browser-window-created', listener: (event: Event,
|
230 | window: BrowserWindow) => void): this;
|
231 | once(event: 'browser-window-created', listener: (event: Event,
|
232 | window: BrowserWindow) => void): this;
|
233 | addListener(event: 'browser-window-created', listener: (event: Event,
|
234 | window: BrowserWindow) => void): this;
|
235 | removeListener(event: 'browser-window-created', listener: (event: Event,
|
236 | window: BrowserWindow) => void): this;
|
237 | |
238 |
|
239 |
|
240 | on(event: 'browser-window-focus', listener: (event: Event,
|
241 | window: BrowserWindow) => void): this;
|
242 | once(event: 'browser-window-focus', listener: (event: Event,
|
243 | window: BrowserWindow) => void): this;
|
244 | addListener(event: 'browser-window-focus', listener: (event: Event,
|
245 | window: BrowserWindow) => void): this;
|
246 | removeListener(event: 'browser-window-focus', listener: (event: Event,
|
247 | window: BrowserWindow) => void): this;
|
248 | |
249 |
|
250 |
|
251 |
|
252 |
|
253 | on(event: 'certificate-error', listener: (event: Event,
|
254 | webContents: WebContents,
|
255 | url: string,
|
256 | |
257 |
|
258 |
|
259 | error: string,
|
260 | certificate: Certificate,
|
261 | callback: (isTrusted: boolean) => void) => void): this;
|
262 | once(event: 'certificate-error', listener: (event: Event,
|
263 | webContents: WebContents,
|
264 | url: string,
|
265 | |
266 |
|
267 |
|
268 | error: string,
|
269 | certificate: Certificate,
|
270 | callback: (isTrusted: boolean) => void) => void): this;
|
271 | addListener(event: 'certificate-error', listener: (event: Event,
|
272 | webContents: WebContents,
|
273 | url: string,
|
274 | |
275 |
|
276 |
|
277 | error: string,
|
278 | certificate: Certificate,
|
279 | callback: (isTrusted: boolean) => void) => void): this;
|
280 | removeListener(event: 'certificate-error', listener: (event: Event,
|
281 | webContents: WebContents,
|
282 | url: string,
|
283 | |
284 |
|
285 |
|
286 | error: string,
|
287 | certificate: Certificate,
|
288 | callback: (isTrusted: boolean) => void) => void): this;
|
289 | |
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 | on(event: 'continue-activity', listener: (event: Event,
|
302 | |
303 |
|
304 |
|
305 | type: string,
|
306 | |
307 |
|
308 |
|
309 | userInfo: unknown) => void): this;
|
310 | once(event: 'continue-activity', listener: (event: Event,
|
311 | |
312 |
|
313 |
|
314 | type: string,
|
315 | |
316 |
|
317 |
|
318 | userInfo: unknown) => void): this;
|
319 | addListener(event: 'continue-activity', listener: (event: Event,
|
320 | |
321 |
|
322 |
|
323 | type: string,
|
324 | |
325 |
|
326 |
|
327 | userInfo: unknown) => void): this;
|
328 | removeListener(event: 'continue-activity', listener: (event: Event,
|
329 | |
330 |
|
331 |
|
332 | type: string,
|
333 | |
334 |
|
335 |
|
336 | userInfo: unknown) => void): this;
|
337 | |
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 | on(event: 'continue-activity-error', listener: (event: Event,
|
344 | |
345 |
|
346 |
|
347 | type: string,
|
348 | |
349 |
|
350 |
|
351 | error: string) => void): this;
|
352 | once(event: 'continue-activity-error', listener: (event: Event,
|
353 | |
354 |
|
355 |
|
356 | type: string,
|
357 | |
358 |
|
359 |
|
360 | error: string) => void): this;
|
361 | addListener(event: 'continue-activity-error', listener: (event: Event,
|
362 | |
363 |
|
364 |
|
365 | type: string,
|
366 | |
367 |
|
368 |
|
369 | error: string) => void): this;
|
370 | removeListener(event: 'continue-activity-error', listener: (event: Event,
|
371 | |
372 |
|
373 |
|
374 | type: string,
|
375 | |
376 |
|
377 |
|
378 | error: string) => void): this;
|
379 | |
380 |
|
381 |
|
382 |
|
383 |
|
384 | on(event: 'desktop-capturer-get-sources', listener: (event: Event,
|
385 | webContents: WebContents) => void): this;
|
386 | once(event: 'desktop-capturer-get-sources', listener: (event: Event,
|
387 | webContents: WebContents) => void): this;
|
388 | addListener(event: 'desktop-capturer-get-sources', listener: (event: Event,
|
389 | webContents: WebContents) => void): this;
|
390 | removeListener(event: 'desktop-capturer-get-sources', listener: (event: Event,
|
391 | webContents: WebContents) => void): this;
|
392 | |
393 |
|
394 |
|
395 | on(event: 'gpu-info-update', listener: Function): this;
|
396 | once(event: 'gpu-info-update', listener: Function): this;
|
397 | addListener(event: 'gpu-info-update', listener: Function): this;
|
398 | removeListener(event: 'gpu-info-update', listener: Function): this;
|
399 | |
400 |
|
401 |
|
402 | on(event: 'gpu-process-crashed', listener: (event: Event,
|
403 | killed: boolean) => void): this;
|
404 | once(event: 'gpu-process-crashed', listener: (event: Event,
|
405 | killed: boolean) => void): this;
|
406 | addListener(event: 'gpu-process-crashed', listener: (event: Event,
|
407 | killed: boolean) => void): this;
|
408 | removeListener(event: 'gpu-process-crashed', listener: (event: Event,
|
409 | killed: boolean) => void): this;
|
410 | |
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 | on(event: 'login', listener: (event: Event,
|
422 | webContents: WebContents,
|
423 | authenticationResponseDetails: AuthenticationResponseDetails,
|
424 | authInfo: AuthInfo,
|
425 | callback: (username?: string, password?: string) => void) => void): this;
|
426 | once(event: 'login', listener: (event: Event,
|
427 | webContents: WebContents,
|
428 | authenticationResponseDetails: AuthenticationResponseDetails,
|
429 | authInfo: AuthInfo,
|
430 | callback: (username?: string, password?: string) => void) => void): this;
|
431 | addListener(event: 'login', listener: (event: Event,
|
432 | webContents: WebContents,
|
433 | authenticationResponseDetails: AuthenticationResponseDetails,
|
434 | authInfo: AuthInfo,
|
435 | callback: (username?: string, password?: string) => void) => void): this;
|
436 | removeListener(event: 'login', listener: (event: Event,
|
437 | webContents: WebContents,
|
438 | authenticationResponseDetails: AuthenticationResponseDetails,
|
439 | authInfo: AuthInfo,
|
440 | callback: (username?: string, password?: string) => void) => void): this;
|
441 | |
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 | on(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
448 | once(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
449 | addListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
450 | removeListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
451 | |
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 | on(event: 'open-file', listener: (event: Event,
|
467 | path: string) => void): this;
|
468 | once(event: 'open-file', listener: (event: Event,
|
469 | path: string) => void): this;
|
470 | addListener(event: 'open-file', listener: (event: Event,
|
471 | path: string) => void): this;
|
472 | removeListener(event: 'open-file', listener: (event: Event,
|
473 | path: string) => void): this;
|
474 | |
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 | on(event: 'open-url', listener: (event: Event,
|
484 | url: string) => void): this;
|
485 | once(event: 'open-url', listener: (event: Event,
|
486 | url: string) => void): this;
|
487 | addListener(event: 'open-url', listener: (event: Event,
|
488 | url: string) => void): this;
|
489 | removeListener(event: 'open-url', listener: (event: Event,
|
490 | url: string) => void): this;
|
491 | |
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 | on(event: 'quit', listener: (event: Event,
|
498 | exitCode: number) => void): this;
|
499 | once(event: 'quit', listener: (event: Event,
|
500 | exitCode: number) => void): this;
|
501 | addListener(event: 'quit', listener: (event: Event,
|
502 | exitCode: number) => void): this;
|
503 | removeListener(event: 'quit', listener: (event: Event,
|
504 | exitCode: number) => void): this;
|
505 | |
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 | on(event: 'ready', listener: (launchInfo: unknown) => void): this;
|
512 | once(event: 'ready', listener: (launchInfo: unknown) => void): this;
|
513 | addListener(event: 'ready', listener: (launchInfo: unknown) => void): this;
|
514 | removeListener(event: 'ready', listener: (launchInfo: unknown) => void): this;
|
515 | |
516 |
|
517 |
|
518 |
|
519 |
|
520 | on(event: 'remote-get-builtin', listener: (event: Event,
|
521 | webContents: WebContents,
|
522 | moduleName: string) => void): this;
|
523 | once(event: 'remote-get-builtin', listener: (event: Event,
|
524 | webContents: WebContents,
|
525 | moduleName: string) => void): this;
|
526 | addListener(event: 'remote-get-builtin', listener: (event: Event,
|
527 | webContents: WebContents,
|
528 | moduleName: string) => void): this;
|
529 | removeListener(event: 'remote-get-builtin', listener: (event: Event,
|
530 | webContents: WebContents,
|
531 | moduleName: string) => void): this;
|
532 | |
533 |
|
534 |
|
535 |
|
536 |
|
537 | on(event: 'remote-get-current-web-contents', listener: (event: Event,
|
538 | webContents: WebContents) => void): this;
|
539 | once(event: 'remote-get-current-web-contents', listener: (event: Event,
|
540 | webContents: WebContents) => void): this;
|
541 | addListener(event: 'remote-get-current-web-contents', listener: (event: Event,
|
542 | webContents: WebContents) => void): this;
|
543 | removeListener(event: 'remote-get-current-web-contents', listener: (event: Event,
|
544 | webContents: WebContents) => void): this;
|
545 | |
546 |
|
547 |
|
548 |
|
549 |
|
550 | on(event: 'remote-get-current-window', listener: (event: Event,
|
551 | webContents: WebContents) => void): this;
|
552 | once(event: 'remote-get-current-window', listener: (event: Event,
|
553 | webContents: WebContents) => void): this;
|
554 | addListener(event: 'remote-get-current-window', listener: (event: Event,
|
555 | webContents: WebContents) => void): this;
|
556 | removeListener(event: 'remote-get-current-window', listener: (event: Event,
|
557 | webContents: WebContents) => void): this;
|
558 | |
559 |
|
560 |
|
561 |
|
562 |
|
563 | on(event: 'remote-get-global', listener: (event: Event,
|
564 | webContents: WebContents,
|
565 | globalName: string) => void): this;
|
566 | once(event: 'remote-get-global', listener: (event: Event,
|
567 | webContents: WebContents,
|
568 | globalName: string) => void): this;
|
569 | addListener(event: 'remote-get-global', listener: (event: Event,
|
570 | webContents: WebContents,
|
571 | globalName: string) => void): this;
|
572 | removeListener(event: 'remote-get-global', listener: (event: Event,
|
573 | webContents: WebContents,
|
574 | globalName: string) => void): this;
|
575 | |
576 |
|
577 |
|
578 |
|
579 |
|
580 | on(event: 'remote-get-guest-web-contents', listener: (event: Event,
|
581 | webContents: WebContents,
|
582 | guestWebContents: WebContents) => void): this;
|
583 | once(event: 'remote-get-guest-web-contents', listener: (event: Event,
|
584 | webContents: WebContents,
|
585 | guestWebContents: WebContents) => void): this;
|
586 | addListener(event: 'remote-get-guest-web-contents', listener: (event: Event,
|
587 | webContents: WebContents,
|
588 | guestWebContents: WebContents) => void): this;
|
589 | removeListener(event: 'remote-get-guest-web-contents', listener: (event: Event,
|
590 | webContents: WebContents,
|
591 | guestWebContents: WebContents) => void): this;
|
592 | |
593 |
|
594 |
|
595 |
|
596 |
|
597 | on(event: 'remote-require', listener: (event: Event,
|
598 | webContents: WebContents,
|
599 | moduleName: string) => void): this;
|
600 | once(event: 'remote-require', listener: (event: Event,
|
601 | webContents: WebContents,
|
602 | moduleName: string) => void): this;
|
603 | addListener(event: 'remote-require', listener: (event: Event,
|
604 | webContents: WebContents,
|
605 | moduleName: string) => void): this;
|
606 | removeListener(event: 'remote-require', listener: (event: Event,
|
607 | webContents: WebContents,
|
608 | moduleName: string) => void): this;
|
609 | |
610 |
|
611 |
|
612 | on(event: 'renderer-process-crashed', listener: (event: Event,
|
613 | webContents: WebContents,
|
614 | killed: boolean) => void): this;
|
615 | once(event: 'renderer-process-crashed', listener: (event: Event,
|
616 | webContents: WebContents,
|
617 | killed: boolean) => void): this;
|
618 | addListener(event: 'renderer-process-crashed', listener: (event: Event,
|
619 | webContents: WebContents,
|
620 | killed: boolean) => void): this;
|
621 | removeListener(event: 'renderer-process-crashed', listener: (event: Event,
|
622 | webContents: WebContents,
|
623 | killed: boolean) => void): this;
|
624 | |
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 | on(event: 'second-instance', listener: (event: Event,
|
639 | |
640 |
|
641 |
|
642 | argv: string[],
|
643 | |
644 |
|
645 |
|
646 | workingDirectory: string) => void): this;
|
647 | once(event: 'second-instance', listener: (event: Event,
|
648 | |
649 |
|
650 |
|
651 | argv: string[],
|
652 | |
653 |
|
654 |
|
655 | workingDirectory: string) => void): this;
|
656 | addListener(event: 'second-instance', listener: (event: Event,
|
657 | |
658 |
|
659 |
|
660 | argv: string[],
|
661 | |
662 |
|
663 |
|
664 | workingDirectory: string) => void): this;
|
665 | removeListener(event: 'second-instance', listener: (event: Event,
|
666 | |
667 |
|
668 |
|
669 | argv: string[],
|
670 | |
671 |
|
672 |
|
673 | workingDirectory: string) => void): this;
|
674 | |
675 |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 | on(event: 'select-client-certificate', listener: (event: Event,
|
683 | webContents: WebContents,
|
684 | url: string,
|
685 | certificateList: Certificate[],
|
686 | callback: (certificate?: Certificate) => void) => void): this;
|
687 | once(event: 'select-client-certificate', listener: (event: Event,
|
688 | webContents: WebContents,
|
689 | url: string,
|
690 | certificateList: Certificate[],
|
691 | callback: (certificate?: Certificate) => void) => void): this;
|
692 | addListener(event: 'select-client-certificate', listener: (event: Event,
|
693 | webContents: WebContents,
|
694 | url: string,
|
695 | certificateList: Certificate[],
|
696 | callback: (certificate?: Certificate) => void) => void): this;
|
697 | removeListener(event: 'select-client-certificate', listener: (event: Event,
|
698 | webContents: WebContents,
|
699 | url: string,
|
700 | certificateList: Certificate[],
|
701 | callback: (certificate?: Certificate) => void) => void): this;
|
702 | |
703 |
|
704 |
|
705 | on(event: 'session-created', listener: (session: Session) => void): this;
|
706 | once(event: 'session-created', listener: (session: Session) => void): this;
|
707 | addListener(event: 'session-created', listener: (session: Session) => void): this;
|
708 | removeListener(event: 'session-created', listener: (session: Session) => void): this;
|
709 | |
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 | on(event: 'update-activity-state', listener: (event: Event,
|
719 | |
720 |
|
721 |
|
722 | type: string,
|
723 | |
724 |
|
725 |
|
726 | userInfo: unknown) => void): this;
|
727 | once(event: 'update-activity-state', listener: (event: Event,
|
728 | |
729 |
|
730 |
|
731 | type: string,
|
732 | |
733 |
|
734 |
|
735 | userInfo: unknown) => void): this;
|
736 | addListener(event: 'update-activity-state', listener: (event: Event,
|
737 | |
738 |
|
739 |
|
740 | type: string,
|
741 | |
742 |
|
743 |
|
744 | userInfo: unknown) => void): this;
|
745 | removeListener(event: 'update-activity-state', listener: (event: Event,
|
746 | |
747 |
|
748 |
|
749 | type: string,
|
750 | |
751 |
|
752 |
|
753 | userInfo: unknown) => void): this;
|
754 | |
755 |
|
756 |
|
757 | on(event: 'web-contents-created', listener: (event: Event,
|
758 | webContents: WebContents) => void): this;
|
759 | once(event: 'web-contents-created', listener: (event: Event,
|
760 | webContents: WebContents) => void): this;
|
761 | addListener(event: 'web-contents-created', listener: (event: Event,
|
762 | webContents: WebContents) => void): this;
|
763 | removeListener(event: 'web-contents-created', listener: (event: Event,
|
764 | webContents: WebContents) => void): this;
|
765 | |
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 | on(event: 'will-continue-activity', listener: (event: Event,
|
773 | |
774 |
|
775 |
|
776 | type: string) => void): this;
|
777 | once(event: 'will-continue-activity', listener: (event: Event,
|
778 | |
779 |
|
780 |
|
781 | type: string) => void): this;
|
782 | addListener(event: 'will-continue-activity', listener: (event: Event,
|
783 | |
784 |
|
785 |
|
786 | type: string) => void): this;
|
787 | removeListener(event: 'will-continue-activity', listener: (event: Event,
|
788 | |
789 |
|
790 |
|
791 | type: string) => void): this;
|
792 | |
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 | on(event: 'will-finish-launching', listener: Function): this;
|
802 | once(event: 'will-finish-launching', listener: Function): this;
|
803 | addListener(event: 'will-finish-launching', listener: Function): this;
|
804 | removeListener(event: 'will-finish-launching', listener: Function): this;
|
805 | |
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 |
|
816 | on(event: 'will-quit', listener: (event: Event) => void): this;
|
817 | once(event: 'will-quit', listener: (event: Event) => void): this;
|
818 | addListener(event: 'will-quit', listener: (event: Event) => void): this;
|
819 | removeListener(event: 'will-quit', listener: (event: Event) => void): this;
|
820 | |
821 |
|
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 |
|
830 | on(event: 'window-all-closed', listener: Function): this;
|
831 | once(event: 'window-all-closed', listener: Function): this;
|
832 | addListener(event: 'window-all-closed', listener: Function): this;
|
833 | removeListener(event: 'window-all-closed', listener: Function): this;
|
834 | |
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 |
|
841 |
|
842 | addRecentDocument(path: string): void;
|
843 | |
844 |
|
845 |
|
846 |
|
847 |
|
848 | clearRecentDocuments(): void;
|
849 | |
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 | disableDomainBlockingFor3DAPIs(): void;
|
857 | |
858 |
|
859 |
|
860 |
|
861 |
|
862 | disableHardwareAcceleration(): void;
|
863 | |
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 | enableSandbox(): void;
|
871 | |
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 | exit(exitCode?: number): void;
|
878 | |
879 |
|
880 |
|
881 |
|
882 | focus(): void;
|
883 | |
884 |
|
885 |
|
886 |
|
887 | getAppMetrics(): ProcessMetric[];
|
888 | |
889 |
|
890 |
|
891 | getAppPath(): string;
|
892 | |
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 |
|
899 | getBadgeCount(): number;
|
900 | |
901 |
|
902 |
|
903 |
|
904 |
|
905 | getCurrentActivityType(): string;
|
906 | |
907 |
|
908 |
|
909 |
|
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 | getFileIcon(path: string, options?: FileIconOptions): Promise<Electron.NativeImage>;
|
920 | |
921 |
|
922 |
|
923 |
|
924 |
|
925 |
|
926 | getGPUFeatureStatus(): GPUFeatureStatus;
|
927 | |
928 |
|
929 |
|
930 |
|
931 |
|
932 |
|
933 |
|
934 |
|
935 |
|
936 |
|
937 |
|
938 |
|
939 | getGPUInfo(infoType: 'basic' | 'complete'): Promise<unknown>;
|
940 | |
941 |
|
942 |
|
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 | getJumpListSettings(): JumpListSettings;
|
952 | |
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 | getLocale(): string;
|
964 | |
965 |
|
966 |
|
967 |
|
968 |
|
969 |
|
970 | getLocaleCountryCode(): string;
|
971 | |
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 | getLoginItemSettings(options?: LoginItemSettingsOptions): LoginItemSettings;
|
992 | |
993 |
|
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 | getName(): string;
|
1004 | |
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 | getPath(name: 'home' | 'appData' | 'userData' | 'cache' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'logs' | 'pepperFlashSystemPlugin'): string;
|
1013 | |
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 | getVersion(): string;
|
1019 | |
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 | hasSingleInstanceLock(): boolean;
|
1026 | |
1027 |
|
1028 |
|
1029 |
|
1030 |
|
1031 | hide(): void;
|
1032 | |
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 | importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void;
|
1041 | |
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 | invalidateCurrentActivity(): void;
|
1047 | |
1048 |
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 | isAccessibilitySupportEnabled(): boolean;
|
1059 | |
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 | isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
|
1073 | |
1074 |
|
1075 |
|
1076 | isEmojiPanelSupported(): boolean;
|
1077 | |
1078 |
|
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 | isInApplicationsFolder(): boolean;
|
1084 | |
1085 |
|
1086 |
|
1087 | isReady(): boolean;
|
1088 | |
1089 |
|
1090 |
|
1091 |
|
1092 |
|
1093 | isUnityRunning(): boolean;
|
1094 | |
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 |
|
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 |
|
1120 |
|
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 | moveToApplicationsFolder(options?: MoveToApplicationsFolderOptions): boolean;
|
1127 | |
1128 |
|
1129 |
|
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 |
|
1135 |
|
1136 | quit(): void;
|
1137 | |
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 | relaunch(options?: RelaunchOptions): void;
|
1155 | |
1156 |
|
1157 |
|
1158 |
|
1159 | releaseSingleInstanceLock(): void;
|
1160 | |
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 |
|
1168 | removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
|
1169 | |
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 | requestSingleInstanceLock(): boolean;
|
1190 | |
1191 |
|
1192 |
|
1193 |
|
1194 |
|
1195 | resignCurrentActivity(): void;
|
1196 | |
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 | setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
|
1204 | |
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 | setAccessibilitySupportEnabled(enabled: boolean): void;
|
1219 | |
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 | setAppLogsPath(path?: string): void;
|
1228 | |
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 | setAppUserModelId(id: string): void;
|
1234 | |
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 | setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
|
1262 | |
1263 |
|
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 | setBadgeCount(count: number): boolean;
|
1278 | |
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 |
|
1286 |
|
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 |
|
1293 |
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 |
|
1307 |
|
1308 |
|
1309 |
|
1310 |
|
1311 |
|
1312 | setJumpList(categories: (JumpListCategory[]) | (null)): void;
|
1313 | |
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 |
|
1320 |
|
1321 |
|
1322 | setLoginItemSettings(settings: Settings): void;
|
1323 | |
1324 |
|
1325 |
|
1326 |
|
1327 |
|
1328 | setName(name: string): void;
|
1329 | |
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 | setPath(name: string, path: string): void;
|
1341 | |
1342 |
|
1343 |
|
1344 |
|
1345 |
|
1346 |
|
1347 | setUserActivity(type: string, userInfo: any, webpageURL?: string): void;
|
1348 | |
1349 |
|
1350 |
|
1351 |
|
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 | setUserTasks(tasks: Task[]): boolean;
|
1361 | |
1362 |
|
1363 |
|
1364 |
|
1365 |
|
1366 |
|
1367 | show(): void;
|
1368 | |
1369 |
|
1370 |
|
1371 |
|
1372 |
|
1373 |
|
1374 | showAboutPanel(): void;
|
1375 | |
1376 |
|
1377 |
|
1378 |
|
1379 |
|
1380 | showEmojiPanel(): void;
|
1381 | |
1382 |
|
1383 |
|
1384 |
|
1385 |
|
1386 |
|
1387 |
|
1388 |
|
1389 |
|
1390 |
|
1391 |
|
1392 |
|
1393 |
|
1394 | startAccessingSecurityScopedResource(bookmarkData: string): Function;
|
1395 | |
1396 |
|
1397 |
|
1398 |
|
1399 |
|
1400 |
|
1401 | updateCurrentActivity(type: string, userInfo: any): void;
|
1402 | |
1403 |
|
1404 |
|
1405 |
|
1406 |
|
1407 | whenReady(): Promise<void>;
|
1408 | |
1409 |
|
1410 |
|
1411 |
|
1412 |
|
1413 |
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 |
|
1419 |
|
1420 |
|
1421 |
|
1422 |
|
1423 |
|
1424 | accessibilitySupportEnabled: boolean;
|
1425 | |
1426 |
|
1427 |
|
1428 |
|
1429 |
|
1430 |
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 | allowRendererProcessReuse: boolean;
|
1437 | |
1438 |
|
1439 |
|
1440 |
|
1441 | applicationMenu: (Menu) | (null);
|
1442 | |
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 |
|
1448 |
|
1449 |
|
1450 |
|
1451 |
|
1452 |
|
1453 |
|
1454 | badgeCount: number;
|
1455 | |
1456 |
|
1457 |
|
1458 |
|
1459 |
|
1460 | readonly commandLine: CommandLine;
|
1461 | |
1462 |
|
1463 |
|
1464 |
|
1465 |
|
1466 |
|
1467 | readonly dock: Dock;
|
1468 | |
1469 |
|
1470 |
|
1471 |
|
1472 |
|
1473 |
|
1474 | readonly isPackaged: boolean;
|
1475 | |
1476 |
|
1477 |
|
1478 |
|
1479 |
|
1480 |
|
1481 |
|
1482 |
|
1483 |
|
1484 | name: string;
|
1485 | |
1486 |
|
1487 |
|
1488 |
|
1489 |
|
1490 |
|
1491 |
|
1492 |
|
1493 |
|
1494 | userAgentFallback: string;
|
1495 | }
|
1496 |
|
1497 | interface AutoUpdater extends NodeJS.EventEmitter {
|
1498 |
|
1499 |
|
1500 |
|
1501 | |
1502 |
|
1503 |
|
1504 |
|
1505 |
|
1506 |
|
1507 |
|
1508 |
|
1509 | on(event: 'before-quit-for-update', listener: Function): this;
|
1510 | once(event: 'before-quit-for-update', listener: Function): this;
|
1511 | addListener(event: 'before-quit-for-update', listener: Function): this;
|
1512 | removeListener(event: 'before-quit-for-update', listener: Function): this;
|
1513 | |
1514 |
|
1515 |
|
1516 | on(event: 'checking-for-update', listener: Function): this;
|
1517 | once(event: 'checking-for-update', listener: Function): this;
|
1518 | addListener(event: 'checking-for-update', listener: Function): this;
|
1519 | removeListener(event: 'checking-for-update', listener: Function): this;
|
1520 | |
1521 |
|
1522 |
|
1523 | on(event: 'error', listener: (error: Error) => void): this;
|
1524 | once(event: 'error', listener: (error: Error) => void): this;
|
1525 | addListener(event: 'error', listener: (error: Error) => void): this;
|
1526 | removeListener(event: 'error', listener: (error: Error) => void): this;
|
1527 | |
1528 |
|
1529 |
|
1530 |
|
1531 | on(event: 'update-available', listener: Function): this;
|
1532 | once(event: 'update-available', listener: Function): this;
|
1533 | addListener(event: 'update-available', listener: Function): this;
|
1534 | removeListener(event: 'update-available', listener: Function): this;
|
1535 | |
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 | on(event: 'update-downloaded', listener: (event: Event,
|
1544 | releaseNotes: string,
|
1545 | releaseName: string,
|
1546 | releaseDate: Date,
|
1547 | updateURL: string) => void): this;
|
1548 | once(event: 'update-downloaded', listener: (event: Event,
|
1549 | releaseNotes: string,
|
1550 | releaseName: string,
|
1551 | releaseDate: Date,
|
1552 | updateURL: string) => void): this;
|
1553 | addListener(event: 'update-downloaded', listener: (event: Event,
|
1554 | releaseNotes: string,
|
1555 | releaseName: string,
|
1556 | releaseDate: Date,
|
1557 | updateURL: string) => void): this;
|
1558 | removeListener(event: 'update-downloaded', listener: (event: Event,
|
1559 | releaseNotes: string,
|
1560 | releaseName: string,
|
1561 | releaseDate: Date,
|
1562 | updateURL: string) => void): this;
|
1563 | |
1564 |
|
1565 |
|
1566 | on(event: 'update-not-available', listener: Function): this;
|
1567 | once(event: 'update-not-available', listener: Function): this;
|
1568 | addListener(event: 'update-not-available', listener: Function): this;
|
1569 | removeListener(event: 'update-not-available', listener: Function): this;
|
1570 | |
1571 |
|
1572 |
|
1573 |
|
1574 | checkForUpdates(): void;
|
1575 | |
1576 |
|
1577 |
|
1578 | getFeedURL(): string;
|
1579 | |
1580 |
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 | quitAndInstall(): void;
|
1592 | |
1593 |
|
1594 |
|
1595 | setFeedURL(options: FeedURLOptions): void;
|
1596 | }
|
1597 |
|
1598 | interface BluetoothDevice {
|
1599 |
|
1600 |
|
1601 |
|
1602 | deviceId: string;
|
1603 | deviceName: string;
|
1604 | }
|
1605 |
|
1606 | class BrowserView {
|
1607 |
|
1608 |
|
1609 |
|
1610 | |
1611 |
|
1612 |
|
1613 | constructor(options?: BrowserViewConstructorOptions);
|
1614 | /**
|
1615 | * The view with the given `id`.
|
1616 | */
|
1617 | static fromId(id: number): BrowserView;
|
1618 | /**
|
1619 | * The BrowserView that owns the given `webContents` or `null` if the contents are
|
1620 | * not owned by a BrowserView.
|
1621 | */
|
1622 | static fromWebContents(webContents: WebContents): (BrowserView) | (null);
|
1623 | /**
|
1624 | * An array of all opened BrowserViews.
|
1625 | */
|
1626 | static getAllViews(): BrowserView[];
|
1627 | /**
|
1628 | * Force closing the view, the `unload` and `beforeunload` events won't be emitted
|
1629 | * for the web page. After you're done with a view, call this function in order to
|
1630 | * free memory and other resources as soon as possible.
|
1631 | */
|
1632 | destroy(): void;
|
1633 | /**
|
1634 | * The `bounds` of this BrowserView instance as `Object`.
|
1635 | *
|
1636 | * @experimental
|
1637 | */
|
1638 | getBounds(): Rectangle;
|
1639 | /**
|
1640 | * Whether the view is destroyed.
|
1641 | */
|
1642 | isDestroyed(): boolean;
|
1643 | setAutoResize(options: AutoResizeOptions): void;
|
1644 | setBackgroundColor(color: string): void;
|
1645 | /**
|
1646 | * Resizes and moves the view to the supplied bounds relative to the window.
|
1647 | *
|
1648 | * @experimental
|
1649 | */
|
1650 | setBounds(bounds: Rectangle): void;
|
1651 | id: number;
|
1652 | webContents: WebContents;
|
1653 | }
|
1654 |
|
1655 | class BrowserWindow extends NodeJS.EventEmitter {
|
1656 |
|
1657 |
|
1658 |
|
1659 | |
1660 |
|
1661 |
|
1662 | on(event: 'always-on-top-changed', listener: (event: Event,
|
1663 | isAlwaysOnTop: boolean) => void): this;
|
1664 | once(event: 'always-on-top-changed', listener: (event: Event,
|
1665 | isAlwaysOnTop: boolean) => void): this;
|
1666 | addListener(event: 'always-on-top-changed', listener: (event: Event,
|
1667 | isAlwaysOnTop: boolean) => void): this;
|
1668 | removeListener(event: 'always-on-top-changed', listener: (event: Event,
|
1669 | isAlwaysOnTop: boolean) => void): this;
|
1670 | |
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 | on(event: 'app-command', listener: (event: Event,
|
1687 | command: string) => void): this;
|
1688 | once(event: 'app-command', listener: (event: Event,
|
1689 | command: string) => void): this;
|
1690 | addListener(event: 'app-command', listener: (event: Event,
|
1691 | command: string) => void): this;
|
1692 | removeListener(event: 'app-command', listener: (event: Event,
|
1693 | command: string) => void): this;
|
1694 | |
1695 |
|
1696 |
|
1697 | on(event: 'blur', listener: Function): this;
|
1698 | once(event: 'blur', listener: Function): this;
|
1699 | addListener(event: 'blur', listener: Function): this;
|
1700 | removeListener(event: 'blur', listener: Function): this;
|
1701 | |
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 | on(event: 'close', listener: (event: Event) => void): this;
|
1718 | once(event: 'close', listener: (event: Event) => void): this;
|
1719 | addListener(event: 'close', listener: (event: Event) => void): this;
|
1720 | removeListener(event: 'close', listener: (event: Event) => void): this;
|
1721 | |
1722 |
|
1723 |
|
1724 |
|
1725 | on(event: 'closed', listener: Function): this;
|
1726 | once(event: 'closed', listener: Function): this;
|
1727 | addListener(event: 'closed', listener: Function): this;
|
1728 | removeListener(event: 'closed', listener: Function): this;
|
1729 | |
1730 |
|
1731 |
|
1732 | on(event: 'enter-full-screen', listener: Function): this;
|
1733 | once(event: 'enter-full-screen', listener: Function): this;
|
1734 | addListener(event: 'enter-full-screen', listener: Function): this;
|
1735 | removeListener(event: 'enter-full-screen', listener: Function): this;
|
1736 | |
1737 |
|
1738 |
|
1739 | on(event: 'enter-html-full-screen', listener: Function): this;
|
1740 | once(event: 'enter-html-full-screen', listener: Function): this;
|
1741 | addListener(event: 'enter-html-full-screen', listener: Function): this;
|
1742 | removeListener(event: 'enter-html-full-screen', listener: Function): this;
|
1743 | |
1744 |
|
1745 |
|
1746 | on(event: 'focus', listener: Function): this;
|
1747 | once(event: 'focus', listener: Function): this;
|
1748 | addListener(event: 'focus', listener: Function): this;
|
1749 | removeListener(event: 'focus', listener: Function): this;
|
1750 | |
1751 |
|
1752 |
|
1753 | on(event: 'hide', listener: Function): this;
|
1754 | once(event: 'hide', listener: Function): this;
|
1755 | addListener(event: 'hide', listener: Function): this;
|
1756 | removeListener(event: 'hide', listener: Function): this;
|
1757 | |
1758 |
|
1759 |
|
1760 | on(event: 'leave-full-screen', listener: Function): this;
|
1761 | once(event: 'leave-full-screen', listener: Function): this;
|
1762 | addListener(event: 'leave-full-screen', listener: Function): this;
|
1763 | removeListener(event: 'leave-full-screen', listener: Function): this;
|
1764 | |
1765 |
|
1766 |
|
1767 | on(event: 'leave-html-full-screen', listener: Function): this;
|
1768 | once(event: 'leave-html-full-screen', listener: Function): this;
|
1769 | addListener(event: 'leave-html-full-screen', listener: Function): this;
|
1770 | removeListener(event: 'leave-html-full-screen', listener: Function): this;
|
1771 | |
1772 |
|
1773 |
|
1774 | on(event: 'maximize', listener: Function): this;
|
1775 | once(event: 'maximize', listener: Function): this;
|
1776 | addListener(event: 'maximize', listener: Function): this;
|
1777 | removeListener(event: 'maximize', listener: Function): this;
|
1778 | |
1779 |
|
1780 |
|
1781 | on(event: 'minimize', listener: Function): this;
|
1782 | once(event: 'minimize', listener: Function): this;
|
1783 | addListener(event: 'minimize', listener: Function): this;
|
1784 | removeListener(event: 'minimize', listener: Function): this;
|
1785 | |
1786 |
|
1787 |
|
1788 |
|
1789 |
|
1790 | on(event: 'move', listener: Function): this;
|
1791 | once(event: 'move', listener: Function): this;
|
1792 | addListener(event: 'move', listener: Function): this;
|
1793 | removeListener(event: 'move', listener: Function): this;
|
1794 | |
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 | on(event: 'moved', listener: Function): this;
|
1800 | once(event: 'moved', listener: Function): this;
|
1801 | addListener(event: 'moved', listener: Function): this;
|
1802 | removeListener(event: 'moved', listener: Function): this;
|
1803 | |
1804 |
|
1805 |
|
1806 |
|
1807 |
|
1808 | on(event: 'new-window-for-tab', listener: Function): this;
|
1809 | once(event: 'new-window-for-tab', listener: Function): this;
|
1810 | addListener(event: 'new-window-for-tab', listener: Function): this;
|
1811 | removeListener(event: 'new-window-for-tab', listener: Function): this;
|
1812 | |
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 | on(event: 'page-title-updated', listener: (event: Event,
|
1818 | title: string,
|
1819 | explicitSet: boolean) => void): this;
|
1820 | once(event: 'page-title-updated', listener: (event: Event,
|
1821 | title: string,
|
1822 | explicitSet: boolean) => void): this;
|
1823 | addListener(event: 'page-title-updated', listener: (event: Event,
|
1824 | title: string,
|
1825 | explicitSet: boolean) => void): this;
|
1826 | removeListener(event: 'page-title-updated', listener: (event: Event,
|
1827 | title: string,
|
1828 | explicitSet: boolean) => void): this;
|
1829 | |
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 |
|
1835 |
|
1836 |
|
1837 | on(event: 'ready-to-show', listener: Function): this;
|
1838 | once(event: 'ready-to-show', listener: Function): this;
|
1839 | addListener(event: 'ready-to-show', listener: Function): this;
|
1840 | removeListener(event: 'ready-to-show', listener: Function): this;
|
1841 | |
1842 |
|
1843 |
|
1844 | on(event: 'resize', listener: Function): this;
|
1845 | once(event: 'resize', listener: Function): this;
|
1846 | addListener(event: 'resize', listener: Function): this;
|
1847 | removeListener(event: 'resize', listener: Function): this;
|
1848 | |
1849 |
|
1850 |
|
1851 | on(event: 'responsive', listener: Function): this;
|
1852 | once(event: 'responsive', listener: Function): this;
|
1853 | addListener(event: 'responsive', listener: Function): this;
|
1854 | removeListener(event: 'responsive', listener: Function): this;
|
1855 | |
1856 |
|
1857 |
|
1858 | on(event: 'restore', listener: Function): this;
|
1859 | once(event: 'restore', listener: Function): this;
|
1860 | addListener(event: 'restore', listener: Function): this;
|
1861 | removeListener(event: 'restore', listener: Function): this;
|
1862 | |
1863 |
|
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 |
|
1869 |
|
1870 |
|
1871 | on(event: 'rotate-gesture', listener: (event: Event,
|
1872 | rotation: number) => void): this;
|
1873 | once(event: 'rotate-gesture', listener: (event: Event,
|
1874 | rotation: number) => void): this;
|
1875 | addListener(event: 'rotate-gesture', listener: (event: Event,
|
1876 | rotation: number) => void): this;
|
1877 | removeListener(event: 'rotate-gesture', listener: (event: Event,
|
1878 | rotation: number) => void): this;
|
1879 | |
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 | on(event: 'scroll-touch-begin', listener: Function): this;
|
1885 | once(event: 'scroll-touch-begin', listener: Function): this;
|
1886 | addListener(event: 'scroll-touch-begin', listener: Function): this;
|
1887 | removeListener(event: 'scroll-touch-begin', listener: Function): this;
|
1888 | |
1889 |
|
1890 |
|
1891 |
|
1892 |
|
1893 | on(event: 'scroll-touch-edge', listener: Function): this;
|
1894 | once(event: 'scroll-touch-edge', listener: Function): this;
|
1895 | addListener(event: 'scroll-touch-edge', listener: Function): this;
|
1896 | removeListener(event: 'scroll-touch-edge', listener: Function): this;
|
1897 | |
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 | on(event: 'scroll-touch-end', listener: Function): this;
|
1903 | once(event: 'scroll-touch-end', listener: Function): this;
|
1904 | addListener(event: 'scroll-touch-end', listener: Function): this;
|
1905 | removeListener(event: 'scroll-touch-end', listener: Function): this;
|
1906 | |
1907 |
|
1908 |
|
1909 |
|
1910 |
|
1911 |
|
1912 | on(event: 'session-end', listener: Function): this;
|
1913 | once(event: 'session-end', listener: Function): this;
|
1914 | addListener(event: 'session-end', listener: Function): this;
|
1915 | removeListener(event: 'session-end', listener: Function): this;
|
1916 | |
1917 |
|
1918 |
|
1919 |
|
1920 |
|
1921 | on(event: 'sheet-begin', listener: Function): this;
|
1922 | once(event: 'sheet-begin', listener: Function): this;
|
1923 | addListener(event: 'sheet-begin', listener: Function): this;
|
1924 | removeListener(event: 'sheet-begin', listener: Function): this;
|
1925 | |
1926 |
|
1927 |
|
1928 |
|
1929 |
|
1930 | on(event: 'sheet-end', listener: Function): this;
|
1931 | once(event: 'sheet-end', listener: Function): this;
|
1932 | addListener(event: 'sheet-end', listener: Function): this;
|
1933 | removeListener(event: 'sheet-end', listener: Function): this;
|
1934 | |
1935 |
|
1936 |
|
1937 | on(event: 'show', listener: Function): this;
|
1938 | once(event: 'show', listener: Function): this;
|
1939 | addListener(event: 'show', listener: Function): this;
|
1940 | removeListener(event: 'show', listener: Function): this;
|
1941 | |
1942 |
|
1943 |
|
1944 |
|
1945 |
|
1946 |
|
1947 | on(event: 'swipe', listener: (event: Event,
|
1948 | direction: string) => void): this;
|
1949 | once(event: 'swipe', listener: (event: Event,
|
1950 | direction: string) => void): this;
|
1951 | addListener(event: 'swipe', listener: (event: Event,
|
1952 | direction: string) => void): this;
|
1953 | removeListener(event: 'swipe', listener: (event: Event,
|
1954 | direction: string) => void): this;
|
1955 | |
1956 |
|
1957 |
|
1958 | on(event: 'unmaximize', listener: Function): this;
|
1959 | once(event: 'unmaximize', listener: Function): this;
|
1960 | addListener(event: 'unmaximize', listener: Function): this;
|
1961 | removeListener(event: 'unmaximize', listener: Function): this;
|
1962 | |
1963 |
|
1964 |
|
1965 | on(event: 'unresponsive', listener: Function): this;
|
1966 | once(event: 'unresponsive', listener: Function): this;
|
1967 | addListener(event: 'unresponsive', listener: Function): this;
|
1968 | removeListener(event: 'unresponsive', listener: Function): this;
|
1969 | |
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 | on(event: 'will-move', listener: (event: Event,
|
1979 | |
1980 |
|
1981 |
|
1982 | newBounds: Rectangle) => void): this;
|
1983 | once(event: 'will-move', listener: (event: Event,
|
1984 | |
1985 |
|
1986 |
|
1987 | newBounds: Rectangle) => void): this;
|
1988 | addListener(event: 'will-move', listener: (event: Event,
|
1989 | |
1990 |
|
1991 |
|
1992 | newBounds: Rectangle) => void): this;
|
1993 | removeListener(event: 'will-move', listener: (event: Event,
|
1994 | |
1995 |
|
1996 |
|
1997 | newBounds: Rectangle) => void): this;
|
1998 | |
1999 |
|
2000 |
|
2001 |
|
2002 |
|
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 | on(event: 'will-resize', listener: (event: Event,
|
2008 | |
2009 |
|
2010 |
|
2011 | newBounds: Rectangle) => void): this;
|
2012 | once(event: 'will-resize', listener: (event: Event,
|
2013 | |
2014 |
|
2015 |
|
2016 | newBounds: Rectangle) => void): this;
|
2017 | addListener(event: 'will-resize', listener: (event: Event,
|
2018 | |
2019 |
|
2020 |
|
2021 | newBounds: Rectangle) => void): this;
|
2022 | removeListener(event: 'will-resize', listener: (event: Event,
|
2023 | |
2024 |
|
2025 |
|
2026 | newBounds: Rectangle) => void): this;
|
2027 | |
2028 |
|
2029 |
|
2030 | constructor(options?: BrowserWindowConstructorOptions);
|
2031 | /**
|
2032 | * Adds DevTools extension located at `path`, and returns extension's name.
|
2033 | *
|
2034 | * The extension will be remembered so you only need to call this API once, this
|
2035 | * API is not for programming use. If you try to add an extension that has already
|
2036 | * been loaded, this method will not return and instead log a warning to the
|
2037 | * console.
|
2038 | *
|
2039 | * The method will also not return if the extension's manifest is missing or
|
2040 | * incomplete.
|
2041 | *
|
2042 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
2043 | * is emitted.
|
2044 | */
|
2045 | static addDevToolsExtension(path: string): void;
|
2046 | /**
|
2047 | * Adds Chrome extension located at `path`, and returns extension's name.
|
2048 | *
|
2049 | * The method will also not return if the extension's manifest is missing or
|
2050 | * incomplete.
|
2051 | *
|
2052 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
2053 | * is emitted.
|
2054 | */
|
2055 | static addExtension(path: string): void;
|
2056 | /**
|
2057 | * The window that owns the given `browserView`. If the given view is not attached
|
2058 | * to any window, returns `null`.
|
2059 | */
|
2060 | static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
|
2061 | /**
|
2062 | * The window with the given `id`.
|
2063 | */
|
2064 | static fromId(id: number): BrowserWindow;
|
2065 | /**
|
2066 | * The window that owns the given `webContents`.
|
2067 | */
|
2068 | static fromWebContents(webContents: WebContents): BrowserWindow;
|
2069 | /**
|
2070 | * An array of all opened browser windows.
|
2071 | */
|
2072 | static getAllWindows(): BrowserWindow[];
|
2073 | /**
|
2074 | * The keys are the extension names and each value is an Object containing `name`
|
2075 | * and `version` properties.
|
2076 | *
|
2077 | * To check if a DevTools extension is installed you can run the following:
|
2078 | *
|
2079 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
2080 | * is emitted.
|
2081 | */
|
2082 | static getDevToolsExtensions(): Record<string, ExtensionInfo>;
|
2083 | /**
|
2084 | * The keys are the extension names and each value is an Object containing `name`
|
2085 | * and `version` properties.
|
2086 | *
|
2087 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
2088 | * is emitted.
|
2089 | */
|
2090 | static getExtensions(): Record<string, ExtensionInfo>;
|
2091 | /**
|
2092 | * The window that is focused in this application, otherwise returns `null`.
|
2093 | */
|
2094 | static getFocusedWindow(): (BrowserWindow) | (null);
|
2095 | /**
|
2096 | * Remove a DevTools extension by name.
|
2097 | *
|
2098 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
2099 | * is emitted.
|
2100 | */
|
2101 | static removeDevToolsExtension(name: string): void;
|
2102 | /**
|
2103 | * Remove a Chrome extension by name.
|
2104 | *
|
2105 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
2106 | * is emitted.
|
2107 | */
|
2108 | static removeExtension(name: string): void;
|
2109 | /**
|
2110 | * Replacement API for setBrowserView supporting work with multi browser views.
|
2111 | *
|
2112 | * @experimental
|
2113 | */
|
2114 | addBrowserView(browserView: BrowserView): void;
|
2115 | /**
|
2116 | * Adds a window as a tab on this window, after the tab for the window instance.
|
2117 | *
|
2118 | * @platform darwin
|
2119 | */
|
2120 | addTabbedWindow(browserWindow: BrowserWindow): void;
|
2121 | /**
|
2122 | * Removes focus from the window.
|
2123 | */
|
2124 | blur(): void;
|
2125 | blurWebView(): void;
|
2126 | /**
|
2127 | * Resolves with a NativeImage
|
2128 | *
|
2129 | * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
2130 | * whole visible page.
|
2131 | */
|
2132 | capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
|
2133 | /**
|
2134 | * Moves window to the center of the screen.
|
2135 | */
|
2136 | center(): void;
|
2137 | /**
|
2138 | * Try to close the window. This has the same effect as a user manually clicking
|
2139 | * the close button of the window. The web page may cancel the close though. See
|
2140 | * the close event.
|
2141 | */
|
2142 | close(): void;
|
2143 | /**
|
2144 | * Closes the currently open Quick Look panel.
|
2145 | *
|
2146 | * @platform darwin
|
2147 | */
|
2148 | closeFilePreview(): void;
|
2149 | /**
|
2150 | * Force closing the window, the `unload` and `beforeunload` event won't be emitted
|
2151 | * for the web page, and `close` event will also not be emitted for this window,
|
2152 | * but it guarantees the `closed` event will be emitted.
|
2153 | */
|
2154 | destroy(): void;
|
2155 | /**
|
2156 | * Starts or stops flashing the window to attract user's attention.
|
2157 | */
|
2158 | flashFrame(flag: boolean): void;
|
2159 | /**
|
2160 | * Focuses on the window.
|
2161 | */
|
2162 | focus(): void;
|
2163 | focusOnWebView(): void;
|
2164 | /**
|
2165 | * The `bounds` of the window as `Object`.
|
2166 | */
|
2167 | getBounds(): Rectangle;
|
2168 | /**
|
2169 | * an BrowserView what is attached. Returns `null` if none is attached. Throw error
|
2170 | * if multiple BrowserViews is attached.
|
2171 | *
|
2172 | * @experimental
|
2173 | */
|
2174 | getBrowserView(): (BrowserView) | (null);
|
2175 | /**
|
2176 | * an array of all BrowserViews that have been attached with `addBrowserView` or
|
2177 | * `setBrowserView`.
|
2178 | *
|
2179 | * **Note:** The BrowserView API is currently experimental and may change or be
|
2180 | * removed in future Electron releases.
|
2181 | *
|
2182 | * @experimental
|
2183 | */
|
2184 | getBrowserViews(): BrowserView[];
|
2185 | /**
|
2186 | * All child windows.
|
2187 | */
|
2188 | getChildWindows(): BrowserWindow[];
|
2189 | /**
|
2190 | * The `bounds` of the window's client area as `Object`.
|
2191 | */
|
2192 | getContentBounds(): Rectangle;
|
2193 | /**
|
2194 | * Contains the window's client area's width and height.
|
2195 | */
|
2196 | getContentSize(): number[];
|
2197 | /**
|
2198 | * Contains the window's maximum width and height.
|
2199 | */
|
2200 | getMaximumSize(): number[];
|
2201 | /**
|
2202 | * Contains the window's minimum width and height.
|
2203 | */
|
2204 | getMinimumSize(): number[];
|
2205 | /**
|
2206 | * The platform-specific handle of the window.
|
2207 | *
|
2208 | * The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
|
2209 | * `Window` (`unsigned long`) on Linux.
|
2210 | */
|
2211 | getNativeWindowHandle(): Buffer;
|
2212 | /**
|
2213 | * Contains the window bounds of the normal state
|
2214 | *
|
2215 | * **Note:** whatever the current state of the window : maximized, minimized or in
|
2216 | * fullscreen, this function always returns the position and size of the window in
|
2217 | * normal state. In normal state, getBounds and getNormalBounds returns the same
|
2218 | * `Rectangle`.
|
2219 | */
|
2220 | getNormalBounds(): Rectangle;
|
2221 | /**
|
2222 | * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
|
2223 | * 1.
|
2224 | */
|
2225 | getOpacity(): number;
|
2226 | /**
|
2227 | * The parent window.
|
2228 | */
|
2229 | getParentWindow(): BrowserWindow;
|
2230 | /**
|
2231 | * Contains the window's current position.
|
2232 | */
|
2233 | getPosition(): number[];
|
2234 | /**
|
2235 | * The pathname of the file the window represents.
|
2236 | *
|
2237 | * @platform darwin
|
2238 | */
|
2239 | getRepresentedFilename(): string;
|
2240 | /**
|
2241 | * Contains the window's width and height.
|
2242 | */
|
2243 | getSize(): number[];
|
2244 | /**
|
2245 | * The title of the native window.
|
2246 | *
|
2247 | * **Note:** The title of the web page can be different from the title of the
|
2248 | * native window.
|
2249 | */
|
2250 | getTitle(): string;
|
2251 | /**
|
2252 | * Whether the window has a shadow.
|
2253 | */
|
2254 | hasShadow(): boolean;
|
2255 | /**
|
2256 | * Hides the window.
|
2257 | */
|
2258 | hide(): void;
|
2259 | /**
|
2260 | * Hooks a windows message. The `callback` is called when the message is received
|
2261 | * in the WndProc.
|
2262 | *
|
2263 | * @platform win32
|
2264 | */
|
2265 | hookWindowMessage(message: number, callback: () => void): void;
|
2266 | /**
|
2267 | * Whether the window is always on top of other windows.
|
2268 | */
|
2269 | isAlwaysOnTop(): boolean;
|
2270 | /**
|
2271 | * Whether the window can be manually closed by user.
|
2272 | *
|
2273 | On Linux always returns `true`.
|
2274 |
|
2275 | **Deprecated**
|
2276 | *
|
2277 | * @platform darwin,win32
|
2278 | */
|
2279 | isClosable(): boolean;
|
2280 | /**
|
2281 | * Whether the window is destroyed.
|
2282 | */
|
2283 | isDestroyed(): boolean;
|
2284 | /**
|
2285 | * Whether the window's document has been edited.
|
2286 | *
|
2287 | * @platform darwin
|
2288 | */
|
2289 | isDocumentEdited(): boolean;
|
2290 | /**
|
2291 | * Returns Boolean - whether the window is enabled.
|
2292 | */
|
2293 | isEnabled(): void;
|
2294 | /**
|
2295 | * Whether the window is focused.
|
2296 | */
|
2297 | isFocused(): boolean;
|
2298 | /**
|
2299 | * Whether the window is in fullscreen mode.
|
2300 | */
|
2301 | isFullScreen(): boolean;
|
2302 | /**
|
2303 | * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
|
2304 | * window.
|
2305 |
|
2306 | **Deprecated**
|
2307 | */
|
2308 | isFullScreenable(): boolean;
|
2309 | /**
|
2310 | * Whether the window is in kiosk mode.
|
2311 | */
|
2312 | isKiosk(): boolean;
|
2313 | /**
|
2314 | * Whether the window can be manually maximized by user.
|
2315 | *
|
2316 | On Linux always returns `true`.
|
2317 |
|
2318 | **Deprecated**
|
2319 | *
|
2320 | * @platform darwin,win32
|
2321 | */
|
2322 | isMaximizable(): boolean;
|
2323 | /**
|
2324 | * Whether the window is maximized.
|
2325 | */
|
2326 | isMaximized(): boolean;
|
2327 | /**
|
2328 | * Whether menu bar automatically hides itself.
|
2329 |
|
2330 | **Deprecated**
|
2331 | */
|
2332 | isMenuBarAutoHide(): boolean;
|
2333 | /**
|
2334 | * Whether the menu bar is visible.
|
2335 | */
|
2336 | isMenuBarVisible(): boolean;
|
2337 | /**
|
2338 | * Whether the window can be manually minimized by user
|
2339 | *
|
2340 | On Linux always returns `true`.
|
2341 |
|
2342 | **Deprecated**
|
2343 | *
|
2344 | * @platform darwin,win32
|
2345 | */
|
2346 | isMinimizable(): boolean;
|
2347 | /**
|
2348 | * Whether the window is minimized.
|
2349 | */
|
2350 | isMinimized(): boolean;
|
2351 | /**
|
2352 | * Whether current window is a modal window.
|
2353 | */
|
2354 | isModal(): boolean;
|
2355 | /**
|
2356 | * Whether the window can be moved by user.
|
2357 | *
|
2358 | On Linux always returns `true`.
|
2359 |
|
2360 | **Deprecated**
|
2361 | *
|
2362 | * @platform darwin,win32
|
2363 | */
|
2364 | isMovable(): boolean;
|
2365 | /**
|
2366 | * Whether the window is in normal state (not maximized, not minimized, not in
|
2367 | * fullscreen mode).
|
2368 | */
|
2369 | isNormal(): boolean;
|
2370 | /**
|
2371 | * Whether the window can be manually resized by user.
|
2372 |
|
2373 | **Deprecated**
|
2374 | */
|
2375 | isResizable(): boolean;
|
2376 | /**
|
2377 | * Whether the window is in simple (pre-Lion) fullscreen mode.
|
2378 | *
|
2379 | * @platform darwin
|
2380 | */
|
2381 | isSimpleFullScreen(): boolean;
|
2382 | /**
|
2383 | * Whether the window is visible to the user.
|
2384 | */
|
2385 | isVisible(): boolean;
|
2386 | /**
|
2387 | * Whether the window is visible on all workspaces.
|
2388 | *
|
2389 | **Note:** This API always returns false on Windows.
|
2390 | */
|
2391 | isVisibleOnAllWorkspaces(): boolean;
|
2392 | /**
|
2393 | * `true` or `false` depending on whether the message is hooked.
|
2394 | *
|
2395 | * @platform win32
|
2396 | */
|
2397 | isWindowMessageHooked(message: number): boolean;
|
2398 | /**
|
2399 | * the promise will resolve when the page has finished loading (see
|
2400 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
2401 | *
|
2402 | * Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
|
2403 | * relative to the root of your application. See the `webContents` docs for more
|
2404 | * information.
|
2405 | */
|
2406 | loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
|
2407 | /**
|
2408 | * the promise will resolve when the page has finished loading (see
|
2409 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
2410 | *
|
2411 | * Same as `webContents.loadURL(url[, options])`.
|
2412 | *
|
2413 | * The `url` can be a remote address (e.g. `http:
|
2414 | * file using the `file:
|
2415 | *
|
2416 | * To ensure that file URLs are properly formatted, it is recommended to use Node's
|
2417 | * `url.format` method:
|
2418 | *
|
2419 | * You can load a URL using a `POST` request with URL-encoded data by doing the
|
2420 | * following:
|
2421 | */
|
2422 | loadURL(url: string, options?: LoadURLOptions): Promise<void>;
|
2423 | |
2424 |
|
2425 |
|
2426 |
|
2427 | maximize(): void;
|
2428 | |
2429 |
|
2430 |
|
2431 |
|
2432 |
|
2433 |
|
2434 | mergeAllWindows(): void;
|
2435 | |
2436 |
|
2437 |
|
2438 |
|
2439 | minimize(): void;
|
2440 | |
2441 |
|
2442 |
|
2443 |
|
2444 |
|
2445 |
|
2446 | moveTabToNewWindow(): void;
|
2447 | |
2448 |
|
2449 |
|
2450 | moveTop(): void;
|
2451 | |
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 | previewFile(path: string, displayName?: string): void;
|
2457 | |
2458 |
|
2459 |
|
2460 | reload(): void;
|
2461 | removeBrowserView(browserView: BrowserView): void;
|
2462 | |
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 | removeMenu(): void;
|
2468 | |
2469 |
|
2470 |
|
2471 | restore(): void;
|
2472 | |
2473 |
|
2474 |
|
2475 |
|
2476 |
|
2477 |
|
2478 | selectNextTab(): void;
|
2479 | |
2480 |
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 | selectPreviousTab(): void;
|
2486 | |
2487 |
|
2488 |
|
2489 |
|
2490 |
|
2491 | setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver', relativeLevel?: number): void;
|
2492 | |
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 | setAppDetails(options: AppDetailsOptions): void;
|
2501 | |
2502 |
|
2503 |
|
2504 |
|
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 | setAspectRatio(aspectRatio: number, extraSize?: Size): void;
|
2522 | |
2523 |
|
2524 |
|
2525 |
|
2526 |
|
2527 | setAutoHideCursor(autoHide: boolean): void;
|
2528 | |
2529 |
|
2530 |
|
2531 |
|
2532 |
|
2533 |
|
2534 |
|
2535 |
|
2536 |
|
2537 | setAutoHideMenuBar(hide: boolean): void;
|
2538 | |
2539 |
|
2540 |
|
2541 | setBackgroundColor(backgroundColor: string): void;
|
2542 | |
2543 |
|
2544 |
|
2545 |
|
2546 | setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
|
2547 | setBrowserView(browserView: (BrowserView) | (null)): void;
|
2548 | |
2549 |
|
2550 |
|
2551 |
|
2552 |
|
2553 |
|
2554 |
|
2555 | setClosable(closable: boolean): void;
|
2556 | |
2557 |
|
2558 |
|
2559 |
|
2560 | setContentBounds(bounds: Rectangle, animate?: boolean): void;
|
2561 | |
2562 |
|
2563 |
|
2564 |
|
2565 |
|
2566 |
|
2567 |
|
2568 |
|
2569 | setContentProtection(enable: boolean): void;
|
2570 | |
2571 |
|
2572 |
|
2573 | setContentSize(width: number, height: number, animate?: boolean): void;
|
2574 | |
2575 |
|
2576 |
|
2577 |
|
2578 |
|
2579 |
|
2580 | setDocumentEdited(edited: boolean): void;
|
2581 | |
2582 |
|
2583 |
|
2584 | setEnabled(enable: boolean): void;
|
2585 | |
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 | setFocusable(focusable: boolean): void;
|
2593 | |
2594 |
|
2595 |
|
2596 | setFullScreen(flag: boolean): void;
|
2597 | |
2598 |
|
2599 |
|
2600 |
|
2601 |
|
2602 |
|
2603 | setFullScreenable(fullscreenable: boolean): void;
|
2604 | |
2605 |
|
2606 |
|
2607 | setHasShadow(hasShadow: boolean): void;
|
2608 | |
2609 |
|
2610 |
|
2611 |
|
2612 |
|
2613 | setIcon(icon: (NativeImage) | (string)): void;
|
2614 | |
2615 |
|
2616 |
|
2617 |
|
2618 |
|
2619 |
|
2620 | setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
|
2621 | |
2622 |
|
2623 |
|
2624 | setKiosk(flag: boolean): void;
|
2625 | |
2626 |
|
2627 |
|
2628 |
|
2629 |
|
2630 |
|
2631 |
|
2632 |
|
2633 | setMaximizable(maximizable: boolean): void;
|
2634 | |
2635 |
|
2636 |
|
2637 | setMaximumSize(width: number, height: number): void;
|
2638 | |
2639 |
|
2640 |
|
2641 |
|
2642 |
|
2643 | setMenu(menu: (Menu) | (null)): void;
|
2644 | |
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 | setMenuBarVisibility(visible: boolean): void;
|
2651 | |
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 | setMinimizable(minimizable: boolean): void;
|
2660 | |
2661 |
|
2662 |
|
2663 | setMinimumSize(width: number, height: number): void;
|
2664 | |
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 | setMovable(movable: boolean): void;
|
2672 | |
2673 |
|
2674 |
|
2675 |
|
2676 |
|
2677 |
|
2678 | setOpacity(opacity: number): void;
|
2679 | |
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 | setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
|
2686 | |
2687 |
|
2688 |
|
2689 |
|
2690 | setParentWindow(parent: (BrowserWindow) | (null)): void;
|
2691 | |
2692 |
|
2693 |
|
2694 | setPosition(x: number, y: number, animate?: boolean): void;
|
2695 | |
2696 |
|
2697 |
|
2698 |
|
2699 |
|
2700 |
|
2701 |
|
2702 |
|
2703 |
|
2704 |
|
2705 |
|
2706 |
|
2707 |
|
2708 |
|
2709 | setProgressBar(progress: number, options?: ProgressBarOptions): void;
|
2710 | |
2711 |
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 | setRepresentedFilename(filename: string): void;
|
2717 | |
2718 |
|
2719 |
|
2720 |
|
2721 |
|
2722 | setResizable(resizable: boolean): void;
|
2723 | |
2724 |
|
2725 |
|
2726 |
|
2727 |
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 |
|
2733 | setShape(rects: Rectangle[]): void;
|
2734 | |
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 |
|
2741 | setSheetOffset(offsetY: number, offsetX?: number): void;
|
2742 | |
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 | setSimpleFullScreen(flag: boolean): void;
|
2751 | |
2752 |
|
2753 |
|
2754 |
|
2755 | setSize(width: number, height: number, animate?: boolean): void;
|
2756 | |
2757 |
|
2758 |
|
2759 | setSkipTaskbar(skip: boolean): void;
|
2760 | |
2761 |
|
2762 |
|
2763 |
|
2764 |
|
2765 |
|
2766 |
|
2767 |
|
2768 |
|
2769 |
|
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 | setThumbarButtons(buttons: ThumbarButton[]): boolean;
|
2797 | |
2798 |
|
2799 |
|
2800 |
|
2801 |
|
2802 |
|
2803 |
|
2804 |
|
2805 | setThumbnailClip(region: Rectangle): void;
|
2806 | |
2807 |
|
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 | setThumbnailToolTip(toolTip: string): void;
|
2813 | |
2814 |
|
2815 |
|
2816 | setTitle(title: string): void;
|
2817 | |
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 |
|
2825 |
|
2826 |
|
2827 |
|
2828 | setTouchBar(touchBar: (TouchBar) | (null)): void;
|
2829 | |
2830 |
|
2831 |
|
2832 |
|
2833 |
|
2834 |
|
2835 |
|
2836 |
|
2837 |
|
2838 | setVibrancy(type: (('appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
|
2839 | |
2840 |
|
2841 |
|
2842 |
|
2843 |
|
2844 | setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
|
2845 | |
2846 |
|
2847 |
|
2848 |
|
2849 |
|
2850 |
|
2851 |
|
2852 | setWindowButtonVisibility(visible: boolean): void;
|
2853 | |
2854 |
|
2855 |
|
2856 | show(): void;
|
2857 | |
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 | showDefinitionForSelection(): void;
|
2863 | |
2864 |
|
2865 |
|
2866 | showInactive(): void;
|
2867 | |
2868 |
|
2869 |
|
2870 |
|
2871 |
|
2872 |
|
2873 | toggleTabBar(): void;
|
2874 | |
2875 |
|
2876 |
|
2877 |
|
2878 |
|
2879 | unhookAllWindowMessages(): void;
|
2880 | |
2881 |
|
2882 |
|
2883 |
|
2884 |
|
2885 | unhookWindowMessage(message: number): void;
|
2886 | |
2887 |
|
2888 |
|
2889 | unmaximize(): void;
|
2890 | autoHideMenuBar: boolean;
|
2891 | closable: boolean;
|
2892 | excludedFromShownWindowsMenu: boolean;
|
2893 | fullScreenable: boolean;
|
2894 | readonly id: number;
|
2895 | maximizable: boolean;
|
2896 | minimizable: boolean;
|
2897 | movable: boolean;
|
2898 | resizable: boolean;
|
2899 | readonly webContents: WebContents;
|
2900 | }
|
2901 |
|
2902 | class BrowserWindowProxy {
|
2903 |
|
2904 |
|
2905 |
|
2906 | |
2907 |
|
2908 |
|
2909 | blur(): void;
|
2910 | |
2911 |
|
2912 |
|
2913 | close(): void;
|
2914 | |
2915 |
|
2916 |
|
2917 | eval(code: string): void;
|
2918 | |
2919 |
|
2920 |
|
2921 | focus(): void;
|
2922 | |
2923 |
|
2924 |
|
2925 |
|
2926 |
|
2927 |
|
2928 |
|
2929 | postMessage(message: any, targetOrigin: string): void;
|
2930 | |
2931 |
|
2932 |
|
2933 | print(): void;
|
2934 | closed: boolean;
|
2935 | }
|
2936 |
|
2937 | interface Certificate {
|
2938 |
|
2939 |
|
2940 |
|
2941 | |
2942 |
|
2943 |
|
2944 | data: string;
|
2945 | |
2946 |
|
2947 |
|
2948 | fingerprint: string;
|
2949 | |
2950 |
|
2951 |
|
2952 | issuer: CertificatePrincipal;
|
2953 | |
2954 |
|
2955 |
|
2956 | issuerCert: Certificate;
|
2957 | |
2958 |
|
2959 |
|
2960 | issuerName: string;
|
2961 | |
2962 |
|
2963 |
|
2964 | serialNumber: string;
|
2965 | |
2966 |
|
2967 |
|
2968 | subject: CertificatePrincipal;
|
2969 | |
2970 |
|
2971 |
|
2972 | subjectName: string;
|
2973 | |
2974 |
|
2975 |
|
2976 | validExpiry: number;
|
2977 | |
2978 |
|
2979 |
|
2980 | validStart: number;
|
2981 | }
|
2982 |
|
2983 | interface CertificatePrincipal {
|
2984 |
|
2985 |
|
2986 |
|
2987 | |
2988 |
|
2989 |
|
2990 | commonName: string;
|
2991 | |
2992 |
|
2993 |
|
2994 | country: string;
|
2995 | |
2996 |
|
2997 |
|
2998 | locality: string;
|
2999 | |
3000 |
|
3001 |
|
3002 | organizations: string[];
|
3003 | |
3004 |
|
3005 |
|
3006 | organizationUnits: string[];
|
3007 | |
3008 |
|
3009 |
|
3010 | state: string;
|
3011 | }
|
3012 |
|
3013 | class ClientRequest extends NodeJS.EventEmitter {
|
3014 |
|
3015 |
|
3016 |
|
3017 | |
3018 |
|
3019 |
|
3020 |
|
3021 | on(event: 'abort', listener: Function): this;
|
3022 | once(event: 'abort', listener: Function): this;
|
3023 | addListener(event: 'abort', listener: Function): this;
|
3024 | removeListener(event: 'abort', listener: Function): this;
|
3025 | |
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 | on(event: 'close', listener: Function): this;
|
3031 | once(event: 'close', listener: Function): this;
|
3032 | addListener(event: 'close', listener: Function): this;
|
3033 | removeListener(event: 'close', listener: Function): this;
|
3034 | |
3035 |
|
3036 |
|
3037 |
|
3038 |
|
3039 | on(event: 'error', listener: (
|
3040 | /**
|
3041 | * an error object providing some information about the failure.
|
3042 | */
|
3043 | error: Error) => void): this;
|
3044 | once(event: 'error', listener: (
|
3045 | /**
|
3046 | * an error object providing some information about the failure.
|
3047 | */
|
3048 | error: Error) => void): this;
|
3049 | addListener(event: 'error', listener: (
|
3050 | /**
|
3051 | * an error object providing some information about the failure.
|
3052 | */
|
3053 | error: Error) => void): this;
|
3054 | removeListener(event: 'error', listener: (
|
3055 | /**
|
3056 | * an error object providing some information about the failure.
|
3057 | */
|
3058 | error: Error) => void): this;
|
3059 | |
3060 |
|
3061 |
|
3062 |
|
3063 | on(event: 'finish', listener: Function): this;
|
3064 | once(event: 'finish', listener: Function): this;
|
3065 | addListener(event: 'finish', listener: Function): this;
|
3066 | removeListener(event: 'finish', listener: Function): this;
|
3067 | |
3068 |
|
3069 |
|
3070 |
|
3071 |
|
3072 |
|
3073 |
|
3074 |
|
3075 |
|
3076 |
|
3077 |
|
3078 | on(event: 'login', listener: (authInfo: AuthInfo,
|
3079 | callback: (username?: string, password?: string) => void) => void): this;
|
3080 | once(event: 'login', listener: (authInfo: AuthInfo,
|
3081 | callback: (username?: string, password?: string) => void) => void): this;
|
3082 | addListener(event: 'login', listener: (authInfo: AuthInfo,
|
3083 | callback: (username?: string, password?: string) => void) => void): this;
|
3084 | removeListener(event: 'login', listener: (authInfo: AuthInfo,
|
3085 | callback: (username?: string, password?: string) => void) => void): this;
|
3086 | |
3087 |
|
3088 |
|
3089 |
|
3090 |
|
3091 |
|
3092 | on(event: 'redirect', listener: (statusCode: number,
|
3093 | method: string,
|
3094 | redirectUrl: string,
|
3095 | responseHeaders: Record<string, string[]>) => void): this;
|
3096 | once(event: 'redirect', listener: (statusCode: number,
|
3097 | method: string,
|
3098 | redirectUrl: string,
|
3099 | responseHeaders: Record<string, string[]>) => void): this;
|
3100 | addListener(event: 'redirect', listener: (statusCode: number,
|
3101 | method: string,
|
3102 | redirectUrl: string,
|
3103 | responseHeaders: Record<string, string[]>) => void): this;
|
3104 | removeListener(event: 'redirect', listener: (statusCode: number,
|
3105 | method: string,
|
3106 | redirectUrl: string,
|
3107 | responseHeaders: Record<string, string[]>) => void): this;
|
3108 | on(event: 'response', listener: (
|
3109 | /**
|
3110 | * An object representing the HTTP response message.
|
3111 | */
|
3112 | response: IncomingMessage) => void): this;
|
3113 | once(event: 'response', listener: (
|
3114 | /**
|
3115 | * An object representing the HTTP response message.
|
3116 | */
|
3117 | response: IncomingMessage) => void): this;
|
3118 | addListener(event: 'response', listener: (
|
3119 | /**
|
3120 | * An object representing the HTTP response message.
|
3121 | */
|
3122 | response: IncomingMessage) => void): this;
|
3123 | removeListener(event: 'response', listener: (
|
3124 | /**
|
3125 | * An object representing the HTTP response message.
|
3126 | */
|
3127 | response: IncomingMessage) => void): this;
|
3128 | |
3129 |
|
3130 |
|
3131 | constructor(options: (ClientRequestConstructorOptions) | (string));
|
3132 | |
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 |
|
3138 | abort(): void;
|
3139 | |
3140 |
|
3141 |
|
3142 |
|
3143 | end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): void;
|
3144 | |
3145 |
|
3146 |
|
3147 |
|
3148 | followRedirect(): void;
|
3149 | |
3150 |
|
3151 |
|
3152 | getHeader(name: string): string;
|
3153 | |
3154 |
|
3155 |
|
3156 |
|
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 | getUploadProgress(): UploadProgress;
|
3165 | |
3166 |
|
3167 |
|
3168 |
|
3169 | removeHeader(name: string): void;
|
3170 | |
3171 |
|
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 | setHeader(name: string, value: string): void;
|
3177 | |
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 | write(chunk: (string) | (Buffer), encoding?: string, callback?: () => void): void;
|
3189 | chunkedEncoding: boolean;
|
3190 | }
|
3191 |
|
3192 | interface Clipboard {
|
3193 |
|
3194 |
|
3195 |
|
3196 | |
3197 |
|
3198 |
|
3199 | availableFormats(type?: 'selection' | 'clipboard'): string[];
|
3200 | |
3201 |
|
3202 |
|
3203 | clear(type?: 'selection' | 'clipboard'): void;
|
3204 | |
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 | has(format: string, type?: 'selection' | 'clipboard'): boolean;
|
3210 | |
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 | read(format: string): string;
|
3216 | |
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 |
|
3224 |
|
3225 |
|
3226 | readBookmark(): ReadBookmark;
|
3227 | |
3228 |
|
3229 |
|
3230 |
|
3231 |
|
3232 | readBuffer(format: string): Buffer;
|
3233 | |
3234 |
|
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 |
|
3243 | readFindText(): string;
|
3244 | |
3245 |
|
3246 |
|
3247 | readHTML(type?: 'selection' | 'clipboard'): string;
|
3248 | |
3249 |
|
3250 |
|
3251 | readImage(type?: 'selection' | 'clipboard'): NativeImage;
|
3252 | |
3253 |
|
3254 |
|
3255 | readRTF(type?: 'selection' | 'clipboard'): string;
|
3256 | |
3257 |
|
3258 |
|
3259 | readText(type?: 'selection' | 'clipboard'): string;
|
3260 | |
3261 |
|
3262 |
|
3263 | write(data: Data, type?: 'selection' | 'clipboard'): void;
|
3264 | |
3265 |
|
3266 |
|
3267 |
|
3268 |
|
3269 |
|
3270 |
|
3271 |
|
3272 |
|
3273 | writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
|
3274 | |
3275 |
|
3276 |
|
3277 |
|
3278 |
|
3279 | writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
|
3280 | |
3281 |
|
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 | writeFindText(text: string): void;
|
3289 | |
3290 |
|
3291 |
|
3292 | writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
|
3293 | |
3294 |
|
3295 |
|
3296 | writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
|
3297 | |
3298 |
|
3299 |
|
3300 | writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
|
3301 | |
3302 |
|
3303 |
|
3304 | writeText(text: string, type?: 'selection' | 'clipboard'): void;
|
3305 | }
|
3306 |
|
3307 | class CommandLine {
|
3308 |
|
3309 |
|
3310 |
|
3311 | |
3312 |
|
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 |
|
3319 |
|
3320 |
|
3321 | appendArgument(value: string): void;
|
3322 | |
3323 |
|
3324 |
|
3325 |
|
3326 |
|
3327 |
|
3328 | appendSwitch(the_switch: string, value?: string): void;
|
3329 | |
3330 |
|
3331 |
|
3332 |
|
3333 |
|
3334 |
|
3335 | getSwitchValue(the_switch: string): string;
|
3336 | |
3337 |
|
3338 |
|
3339 | hasSwitch(the_switch: string): boolean;
|
3340 | }
|
3341 |
|
3342 | interface ContentTracing {
|
3343 |
|
3344 |
|
3345 |
|
3346 | |
3347 |
|
3348 |
|
3349 |
|
3350 |
|
3351 |
|
3352 |
|
3353 | getCategories(): Promise<string[]>;
|
3354 | |
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 |
|
3360 |
|
3361 |
|
3362 |
|
3363 |
|
3364 | getTraceBufferUsage(): Promise<Electron.TraceBufferUsageReturnValue>;
|
3365 | |
3366 |
|
3367 |
|
3368 |
|
3369 |
|
3370 |
|
3371 |
|
3372 |
|
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 | startRecording(options: (TraceConfig) | (TraceCategoriesAndOptions)): Promise<void>;
|
3378 | |
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 |
|
3386 |
|
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 | stopRecording(resultFilePath?: string): Promise<string>;
|
3395 | }
|
3396 |
|
3397 | interface ContextBridge extends NodeJS.EventEmitter {
|
3398 |
|
3399 |
|
3400 |
|
3401 | exposeInMainWorld(apiKey: string, api: Record<string, any>): void;
|
3402 | }
|
3403 |
|
3404 | interface Cookie {
|
3405 |
|
3406 |
|
3407 |
|
3408 | |
3409 |
|
3410 |
|
3411 |
|
3412 | domain?: string;
|
3413 | |
3414 |
|
3415 |
|
3416 |
|
3417 | expirationDate?: number;
|
3418 | |
3419 |
|
3420 |
|
3421 |
|
3422 | hostOnly?: boolean;
|
3423 | |
3424 |
|
3425 |
|
3426 | httpOnly?: boolean;
|
3427 | |
3428 |
|
3429 |
|
3430 | name: string;
|
3431 | |
3432 |
|
3433 |
|
3434 | path?: string;
|
3435 | |
3436 |
|
3437 |
|
3438 | secure?: boolean;
|
3439 | |
3440 |
|
3441 |
|
3442 |
|
3443 | session?: boolean;
|
3444 | |
3445 |
|
3446 |
|
3447 | value: string;
|
3448 | }
|
3449 |
|
3450 | class Cookies extends NodeJS.EventEmitter {
|
3451 |
|
3452 |
|
3453 |
|
3454 | |
3455 |
|
3456 |
|
3457 |
|
3458 | on(event: 'changed', listener: Function): this;
|
3459 | once(event: 'changed', listener: Function): this;
|
3460 | addListener(event: 'changed', listener: Function): this;
|
3461 | removeListener(event: 'changed', listener: Function): this;
|
3462 | |
3463 |
|
3464 |
|
3465 |
|
3466 |
|
3467 | flushStore(): Promise<void>;
|
3468 | |
3469 |
|
3470 |
|
3471 |
|
3472 |
|
3473 |
|
3474 | get(filter: CookiesGetFilter): Promise<Electron.Cookie[]>;
|
3475 | |
3476 |
|
3477 |
|
3478 |
|
3479 |
|
3480 | remove(url: string, name: string): Promise<void>;
|
3481 | |
3482 |
|
3483 |
|
3484 |
|
3485 |
|
3486 | set(details: CookiesSetDetails): Promise<void>;
|
3487 | }
|
3488 |
|
3489 | interface CPUUsage {
|
3490 |
|
3491 |
|
3492 |
|
3493 | |
3494 |
|
3495 |
|
3496 |
|
3497 | idleWakeupsPerSecond: number;
|
3498 | |
3499 |
|
3500 |
|
3501 | percentCPUUsage: number;
|
3502 | }
|
3503 |
|
3504 | interface CrashReport {
|
3505 |
|
3506 |
|
3507 |
|
3508 | date: Date;
|
3509 | id: string;
|
3510 | }
|
3511 |
|
3512 | interface CrashReporter {
|
3513 |
|
3514 |
|
3515 |
|
3516 | |
3517 |
|
3518 |
|
3519 |
|
3520 |
|
3521 |
|
3522 |
|
3523 |
|
3524 |
|
3525 | addExtraParameter(key: string, value: string): void;
|
3526 | |
3527 |
|
3528 |
|
3529 |
|
3530 |
|
3531 |
|
3532 | getLastCrashReport(): CrashReport;
|
3533 | |
3534 |
|
3535 |
|
3536 | getParameters(): void;
|
3537 | |
3538 |
|
3539 |
|
3540 |
|
3541 | getUploadedReports(): CrashReport[];
|
3542 | |
3543 |
|
3544 |
|
3545 |
|
3546 |
|
3547 |
|
3548 | getUploadToServer(): boolean;
|
3549 | |
3550 |
|
3551 |
|
3552 |
|
3553 |
|
3554 |
|
3555 | removeExtraParameter(key: string): void;
|
3556 | |
3557 |
|
3558 |
|
3559 |
|
3560 |
|
3561 |
|
3562 | setUploadToServer(uploadToServer: boolean): void;
|
3563 | |
3564 |
|
3565 |
|
3566 |
|
3567 |
|
3568 |
|
3569 |
|
3570 |
|
3571 |
|
3572 |
|
3573 |
|
3574 |
|
3575 |
|
3576 |
|
3577 |
|
3578 |
|
3579 |
|
3580 |
|
3581 |
|
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 |
|
3587 |
|
3588 |
|
3589 | start(options: CrashReporterStartOptions): void;
|
3590 | }
|
3591 |
|
3592 | interface CustomScheme {
|
3593 |
|
3594 |
|
3595 |
|
3596 | privileges?: Privileges;
|
3597 | |
3598 |
|
3599 |
|
3600 | scheme: string;
|
3601 | }
|
3602 |
|
3603 | class Debugger extends NodeJS.EventEmitter {
|
3604 |
|
3605 |
|
3606 |
|
3607 | |
3608 |
|
3609 |
|
3610 |
|
3611 | on(event: 'detach', listener: (event: Event,
|
3612 | /**
|
3613 | * Reason for detaching debugger.
|
3614 | */
|
3615 | reason: string) => void): this;
|
3616 | once(event: 'detach', listener: (event: Event,
|
3617 | /**
|
3618 | * Reason for detaching debugger.
|
3619 | */
|
3620 | reason: string) => void): this;
|
3621 | addListener(event: 'detach', listener: (event: Event,
|
3622 | /**
|
3623 | * Reason for detaching debugger.
|
3624 | */
|
3625 | reason: string) => void): this;
|
3626 | removeListener(event: 'detach', listener: (event: Event,
|
3627 | /**
|
3628 | * Reason for detaching debugger.
|
3629 | */
|
3630 | reason: string) => void): this;
|
3631 | |
3632 |
|
3633 |
|
3634 | on(event: 'message', listener: (event: Event,
|
3635 | /**
|
3636 | * Method name.
|
3637 | */
|
3638 | method: string,
|
3639 | /**
|
3640 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
3641 | * protocol.
|
3642 | */
|
3643 | params: unknown) => void): this;
|
3644 | once(event: 'message', listener: (event: Event,
|
3645 | /**
|
3646 | * Method name.
|
3647 | */
|
3648 | method: string,
|
3649 | /**
|
3650 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
3651 | * protocol.
|
3652 | */
|
3653 | params: unknown) => void): this;
|
3654 | addListener(event: 'message', listener: (event: Event,
|
3655 | /**
|
3656 | * Method name.
|
3657 | */
|
3658 | method: string,
|
3659 | /**
|
3660 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
3661 | * protocol.
|
3662 | */
|
3663 | params: unknown) => void): this;
|
3664 | removeListener(event: 'message', listener: (event: Event,
|
3665 | /**
|
3666 | * Method name.
|
3667 | */
|
3668 | method: string,
|
3669 | /**
|
3670 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
3671 | * protocol.
|
3672 | */
|
3673 | params: unknown) => void): this;
|
3674 | |
3675 |
|
3676 |
|
3677 | attach(protocolVersion?: string): void;
|
3678 | |
3679 |
|
3680 |
|
3681 | detach(): void;
|
3682 | |
3683 |
|
3684 |
|
3685 | isAttached(): boolean;
|
3686 | |
3687 |
|
3688 |
|
3689 |
|
3690 |
|
3691 |
|
3692 |
|
3693 | sendCommand(method: string, commandParams?: any): Promise<any>;
|
3694 | }
|
3695 |
|
3696 | interface DesktopCapturer {
|
3697 |
|
3698 |
|
3699 |
|
3700 | |
3701 |
|
3702 |
|
3703 |
|
3704 |
|
3705 | getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
|
3706 | }
|
3707 |
|
3708 | interface DesktopCapturerSource {
|
3709 |
|
3710 |
|
3711 |
|
3712 | |
3713 |
|
3714 |
|
3715 |
|
3716 |
|
3717 | appIcon: NativeImage;
|
3718 | |
3719 |
|
3720 |
|
3721 |
|
3722 |
|
3723 |
|
3724 | display_id: string;
|
3725 | |
3726 |
|
3727 |
|
3728 |
|
3729 |
|
3730 |
|
3731 | id: string;
|
3732 | |
3733 |
|
3734 |
|
3735 |
|
3736 | name: string;
|
3737 | |
3738 |
|
3739 |
|
3740 |
|
3741 |
|
3742 |
|
3743 | thumbnail: NativeImage;
|
3744 | }
|
3745 |
|
3746 | interface Dialog {
|
3747 |
|
3748 |
|
3749 |
|
3750 | |
3751 |
|
3752 |
|
3753 |
|
3754 |
|
3755 |
|
3756 |
|
3757 |
|
3758 |
|
3759 |
|
3760 |
|
3761 |
|
3762 |
|
3763 |
|
3764 |
|
3765 |
|
3766 |
|
3767 | showCertificateTrustDialog(browserWindow: BrowserWindow, options: CertificateTrustDialogOptions): Promise<void>;
|
3768 | |
3769 |
|
3770 |
|
3771 |
|
3772 |
|
3773 |
|
3774 |
|
3775 |
|
3776 |
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 |
|
3782 |
|
3783 |
|
3784 |
|
3785 | showCertificateTrustDialog(options: CertificateTrustDialogOptions): Promise<void>;
|
3786 | |
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 |
|
3792 |
|
3793 |
|
3794 | showErrorBox(title: string, content: string): void;
|
3795 | |
3796 |
|
3797 |
|
3798 |
|
3799 |
|
3800 |
|
3801 |
|
3802 |
|
3803 |
|
3804 |
|
3805 |
|
3806 |
|
3807 | showMessageBox(browserWindow: BrowserWindow, options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
|
3808 | |
3809 |
|
3810 |
|
3811 |
|
3812 |
|
3813 |
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 |
|
3819 |
|
3820 | showMessageBox(options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
|
3821 | |
3822 |
|
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 |
|
3828 |
|
3829 |
|
3830 | showMessageBoxSync(browserWindow: BrowserWindow, options: MessageBoxSyncOptions): number;
|
3831 | |
3832 |
|
3833 |
|
3834 |
|
3835 |
|
3836 |
|
3837 |
|
3838 |
|
3839 |
|
3840 | showMessageBoxSync(options: MessageBoxSyncOptions): number;
|
3841 | |
3842 |
|
3843 |
|
3844 |
|
3845 |
|
3846 |
|
3847 |
|
3848 |
|
3849 |
|
3850 |
|
3851 |
|
3852 |
|
3853 |
|
3854 |
|
3855 |
|
3856 |
|
3857 |
|
3858 |
|
3859 |
|
3860 |
|
3861 |
|
3862 |
|
3863 |
|
3864 |
|
3865 |
|
3866 | showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
|
3867 | |
3868 |
|
3869 |
|
3870 |
|
3871 |
|
3872 |
|
3873 |
|
3874 |
|
3875 |
|
3876 |
|
3877 |
|
3878 |
|
3879 |
|
3880 |
|
3881 |
|
3882 |
|
3883 |
|
3884 |
|
3885 |
|
3886 |
|
3887 |
|
3888 |
|
3889 |
|
3890 |
|
3891 |
|
3892 | showOpenDialog(options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
|
3893 | |
3894 |
|
3895 |
|
3896 |
|
3897 |
|
3898 |
|
3899 |
|
3900 |
|
3901 |
|
3902 |
|
3903 |
|
3904 |
|
3905 |
|
3906 |
|
3907 |
|
3908 |
|
3909 |
|
3910 |
|
3911 | showOpenDialogSync(options: OpenDialogSyncOptions): (string[]) | (undefined);
|
3912 | |
3913 |
|
3914 |
|
3915 |
|
3916 |
|
3917 |
|
3918 |
|
3919 |
|
3920 |
|
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 |
|
3926 |
|
3927 |
|
3928 |
|
3929 |
|
3930 | showOpenDialogSync(browserWindow: BrowserWindow, options: OpenDialogSyncOptions): (string[]) | (undefined);
|
3931 | |
3932 |
|
3933 |
|
3934 |
|
3935 |
|
3936 |
|
3937 |
|
3938 |
|
3939 |
|
3940 |
|
3941 |
|
3942 |
|
3943 |
|
3944 |
|
3945 |
|
3946 |
|
3947 |
|
3948 |
|
3949 |
|
3950 | showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
3951 | |
3952 |
|
3953 |
|
3954 |
|
3955 |
|
3956 |
|
3957 |
|
3958 |
|
3959 |
|
3960 |
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 |
|
3967 |
|
3968 |
|
3969 |
|
3970 | showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
3971 | |
3972 |
|
3973 |
|
3974 |
|
3975 |
|
3976 |
|
3977 |
|
3978 |
|
3979 |
|
3980 |
|
3981 | showSaveDialogSync(options: SaveDialogSyncOptions): (string) | (undefined);
|
3982 | |
3983 |
|
3984 |
|
3985 |
|
3986 |
|
3987 |
|
3988 |
|
3989 |
|
3990 |
|
3991 |
|
3992 | showSaveDialogSync(browserWindow: BrowserWindow, options: SaveDialogSyncOptions): (string) | (undefined);
|
3993 | }
|
3994 |
|
3995 | interface Display {
|
3996 |
|
3997 |
|
3998 |
|
3999 | |
4000 |
|
4001 |
|
4002 | accelerometerSupport: ('available' | 'unavailable' | 'unknown');
|
4003 | bounds: Rectangle;
|
4004 | |
4005 |
|
4006 |
|
4007 | colorDepth: number;
|
4008 | |
4009 |
|
4010 |
|
4011 |
|
4012 | colorSpace: string;
|
4013 | |
4014 |
|
4015 |
|
4016 | depthPerComponent: number;
|
4017 | |
4018 |
|
4019 |
|
4020 | id: number;
|
4021 | |
4022 |
|
4023 |
|
4024 | internal: boolean;
|
4025 | |
4026 |
|
4027 |
|
4028 | monochrome: boolean;
|
4029 | |
4030 |
|
4031 |
|
4032 | rotation: number;
|
4033 | |
4034 |
|
4035 |
|
4036 | scaleFactor: number;
|
4037 | size: Size;
|
4038 | |
4039 |
|
4040 |
|
4041 | touchSupport: ('available' | 'unavailable' | 'unknown');
|
4042 | workArea: Rectangle;
|
4043 | workAreaSize: Size;
|
4044 | }
|
4045 |
|
4046 | class Dock {
|
4047 |
|
4048 |
|
4049 |
|
4050 | |
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 |
|
4056 |
|
4057 |
|
4058 |
|
4059 |
|
4060 |
|
4061 |
|
4062 |
|
4063 |
|
4064 |
|
4065 | bounce(type?: 'critical' | 'informational'): number;
|
4066 | |
4067 |
|
4068 |
|
4069 |
|
4070 |
|
4071 | cancelBounce(id: number): void;
|
4072 | |
4073 |
|
4074 |
|
4075 |
|
4076 |
|
4077 | downloadFinished(filePath: string): void;
|
4078 | |
4079 |
|
4080 |
|
4081 |
|
4082 |
|
4083 | getBadge(): string;
|
4084 | |
4085 |
|
4086 |
|
4087 |
|
4088 |
|
4089 | getMenu(): (Menu) | (null);
|
4090 | |
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 | hide(): void;
|
4096 | |
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 | isVisible(): boolean;
|
4102 | |
4103 |
|
4104 |
|
4105 |
|
4106 |
|
4107 | setBadge(text: string): void;
|
4108 | |
4109 |
|
4110 |
|
4111 |
|
4112 |
|
4113 | setIcon(image: (NativeImage) | (string)): void;
|
4114 | |
4115 |
|
4116 |
|
4117 |
|
4118 |
|
4119 | setMenu(menu: Menu): void;
|
4120 | |
4121 |
|
4122 |
|
4123 |
|
4124 |
|
4125 | show(): Promise<void>;
|
4126 | }
|
4127 |
|
4128 | class DownloadItem extends NodeJS.EventEmitter {
|
4129 |
|
4130 |
|
4131 |
|
4132 | |
4133 |
|
4134 |
|
4135 |
|
4136 |
|
4137 |
|
4138 |
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 | on(event: 'done', listener: (event: Event,
|
4144 | /**
|
4145 | * Can be `completed`, `cancelled` or `interrupted`.
|
4146 | */
|
4147 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
4148 | once(event: 'done', listener: (event: Event,
|
4149 | /**
|
4150 | * Can be `completed`, `cancelled` or `interrupted`.
|
4151 | */
|
4152 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
4153 | addListener(event: 'done', listener: (event: Event,
|
4154 | /**
|
4155 | * Can be `completed`, `cancelled` or `interrupted`.
|
4156 | */
|
4157 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
4158 | removeListener(event: 'done', listener: (event: Event,
|
4159 | /**
|
4160 | * Can be `completed`, `cancelled` or `interrupted`.
|
4161 | */
|
4162 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
4163 | |
4164 |
|
4165 |
|
4166 |
|
4167 |
|
4168 |
|
4169 |
|
4170 |
|
4171 | on(event: 'updated', listener: (event: Event,
|
4172 | /**
|
4173 | * Can be `progressing` or `interrupted`.
|
4174 | */
|
4175 | state: ('progressing' | 'interrupted')) => void): this;
|
4176 | once(event: 'updated', listener: (event: Event,
|
4177 | /**
|
4178 | * Can be `progressing` or `interrupted`.
|
4179 | */
|
4180 | state: ('progressing' | 'interrupted')) => void): this;
|
4181 | addListener(event: 'updated', listener: (event: Event,
|
4182 | /**
|
4183 | * Can be `progressing` or `interrupted`.
|
4184 | */
|
4185 | state: ('progressing' | 'interrupted')) => void): this;
|
4186 | removeListener(event: 'updated', listener: (event: Event,
|
4187 | /**
|
4188 | * Can be `progressing` or `interrupted`.
|
4189 | */
|
4190 | state: ('progressing' | 'interrupted')) => void): this;
|
4191 | |
4192 |
|
4193 |
|
4194 | cancel(): void;
|
4195 | |
4196 |
|
4197 |
|
4198 | canResume(): boolean;
|
4199 | |
4200 |
|
4201 |
|
4202 | getContentDisposition(): string;
|
4203 | |
4204 |
|
4205 |
|
4206 | getETag(): string;
|
4207 | |
4208 |
|
4209 |
|
4210 |
|
4211 |
|
4212 |
|
4213 |
|
4214 | getFilename(): string;
|
4215 | |
4216 |
|
4217 |
|
4218 | getLastModifiedTime(): string;
|
4219 | |
4220 |
|
4221 |
|
4222 | getMimeType(): string;
|
4223 | |
4224 |
|
4225 |
|
4226 | getReceivedBytes(): number;
|
4227 | |
4228 |
|
4229 |
|
4230 |
|
4231 | getSaveDialogOptions(): SaveDialogOptions;
|
4232 | |
4233 |
|
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 |
|
4239 | getSavePath(): string;
|
4240 | |
4241 |
|
4242 |
|
4243 | getStartTime(): number;
|
4244 | |
4245 |
|
4246 |
|
4247 |
|
4248 |
|
4249 |
|
4250 |
|
4251 | getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
|
4252 | |
4253 |
|
4254 |
|
4255 |
|
4256 |
|
4257 | getTotalBytes(): number;
|
4258 | |
4259 |
|
4260 |
|
4261 | getURL(): string;
|
4262 | |
4263 |
|
4264 |
|
4265 | getURLChain(): string[];
|
4266 | |
4267 |
|
4268 |
|
4269 | hasUserGesture(): boolean;
|
4270 | |
4271 |
|
4272 |
|
4273 | isPaused(): boolean;
|
4274 | |
4275 |
|
4276 |
|
4277 | pause(): void;
|
4278 | |
4279 |
|
4280 |
|
4281 |
|
4282 |
|
4283 |
|
4284 |
|
4285 |
|
4286 | resume(): void;
|
4287 | |
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 | setSaveDialogOptions(options: SaveDialogOptions): void;
|
4293 | |
4294 |
|
4295 |
|
4296 |
|
4297 |
|
4298 |
|
4299 |
|
4300 | setSavePath(path: string): void;
|
4301 | savePath: string;
|
4302 | }
|
4303 |
|
4304 | interface Event extends GlobalEvent {
|
4305 |
|
4306 |
|
4307 |
|
4308 | preventDefault: (() => void);
|
4309 | }
|
4310 |
|
4311 | interface ExtensionInfo {
|
4312 |
|
4313 |
|
4314 |
|
4315 | name: string;
|
4316 | version: string;
|
4317 | }
|
4318 |
|
4319 | interface FileFilter {
|
4320 |
|
4321 |
|
4322 |
|
4323 | extensions: string[];
|
4324 | name: string;
|
4325 | }
|
4326 |
|
4327 | interface FilePathWithHeaders {
|
4328 |
|
4329 |
|
4330 |
|
4331 | |
4332 |
|
4333 |
|
4334 | headers?: Record<string, string>;
|
4335 | |
4336 |
|
4337 |
|
4338 | path: string;
|
4339 | }
|
4340 |
|
4341 | interface GlobalShortcut {
|
4342 |
|
4343 |
|
4344 |
|
4345 | |
4346 |
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 | isRegistered(accelerator: Accelerator): boolean;
|
4353 | |
4354 |
|
4355 |
|
4356 |
|
4357 |
|
4358 |
|
4359 |
|
4360 |
|
4361 |
|
4362 |
|
4363 |
|
4364 |
|
4365 |
|
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 |
|
4371 | register(accelerator: Accelerator, callback: () => void): boolean;
|
4372 | |
4373 |
|
4374 |
|
4375 |
|
4376 |
|
4377 |
|
4378 |
|
4379 |
|
4380 |
|
4381 |
|
4382 |
|
4383 |
|
4384 |
|
4385 |
|
4386 |
|
4387 |
|
4388 |
|
4389 | registerAll(accelerators: string[], callback: () => void): void;
|
4390 | |
4391 |
|
4392 |
|
4393 | unregister(accelerator: Accelerator): void;
|
4394 | |
4395 |
|
4396 |
|
4397 | unregisterAll(): void;
|
4398 | }
|
4399 |
|
4400 | interface GPUFeatureStatus {
|
4401 |
|
4402 |
|
4403 |
|
4404 | |
4405 |
|
4406 |
|
4407 | '2d_canvas': string;
|
4408 | |
4409 |
|
4410 |
|
4411 | flash_3d: string;
|
4412 | |
4413 |
|
4414 |
|
4415 | flash_stage3d: string;
|
4416 | |
4417 |
|
4418 |
|
4419 | flash_stage3d_baseline: string;
|
4420 | |
4421 |
|
4422 |
|
4423 | gpu_compositing: string;
|
4424 | |
4425 |
|
4426 |
|
4427 | multiple_raster_threads: string;
|
4428 | |
4429 |
|
4430 |
|
4431 | native_gpu_memory_buffers: string;
|
4432 | |
4433 |
|
4434 |
|
4435 | rasterization: string;
|
4436 | |
4437 |
|
4438 |
|
4439 | video_decode: string;
|
4440 | |
4441 |
|
4442 |
|
4443 | video_encode: string;
|
4444 | |
4445 |
|
4446 |
|
4447 | vpx_decode: string;
|
4448 | |
4449 |
|
4450 |
|
4451 | webgl: string;
|
4452 | |
4453 |
|
4454 |
|
4455 | webgl2: string;
|
4456 | }
|
4457 |
|
4458 | interface InAppPurchase extends NodeJS.EventEmitter {
|
4459 |
|
4460 |
|
4461 |
|
4462 | on(event: 'transactions-updated', listener: Function): this;
|
4463 | once(event: 'transactions-updated', listener: Function): this;
|
4464 | addListener(event: 'transactions-updated', listener: Function): this;
|
4465 | removeListener(event: 'transactions-updated', listener: Function): this;
|
4466 | |
4467 |
|
4468 |
|
4469 | canMakePayments(): boolean;
|
4470 | |
4471 |
|
4472 |
|
4473 | finishAllTransactions(): void;
|
4474 | |
4475 |
|
4476 |
|
4477 | finishTransactionByDate(date: string): void;
|
4478 | |
4479 |
|
4480 |
|
4481 |
|
4482 |
|
4483 | getProducts(productIDs: string[]): Promise<Electron.Product[]>;
|
4484 | |
4485 |
|
4486 |
|
4487 | getReceiptURL(): string;
|
4488 | |
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 |
|
4494 | purchaseProduct(productID: string, quantity?: number): Promise<boolean>;
|
4495 | }
|
4496 |
|
4497 | class IncomingMessage extends NodeJS.EventEmitter {
|
4498 |
|
4499 |
|
4500 |
|
4501 | |
4502 |
|
4503 |
|
4504 | on(event: 'aborted', listener: Function): this;
|
4505 | once(event: 'aborted', listener: Function): this;
|
4506 | addListener(event: 'aborted', listener: Function): this;
|
4507 | removeListener(event: 'aborted', listener: Function): this;
|
4508 | |
4509 |
|
4510 |
|
4511 |
|
4512 | on(event: 'data', listener: (
|
4513 | /**
|
4514 | * A chunk of response body's data.
|
4515 | */
|
4516 | chunk: Buffer) => void): this;
|
4517 | once(event: 'data', listener: (
|
4518 | |
4519 |
|
4520 |
|
4521 | chunk: Buffer) => void): this;
|
4522 | addListener(event: 'data', listener: (
|
4523 | |
4524 |
|
4525 |
|
4526 | chunk: Buffer) => void): this;
|
4527 | removeListener(event: 'data', listener: (
|
4528 | |
4529 |
|
4530 |
|
4531 | chunk: Buffer) => void): this;
|
4532 | |
4533 |
|
4534 |
|
4535 | on(event: 'end', listener: Function): this;
|
4536 | once(event: 'end', listener: Function): this;
|
4537 | addListener(event: 'end', listener: Function): this;
|
4538 | removeListener(event: 'end', listener: Function): this;
|
4539 | |
4540 |
|
4541 |
|
4542 |
|
4543 |
|
4544 |
|
4545 |
|
4546 |
|
4547 |
|
4548 |
|
4549 | on(event: 'error', listener: Function): this;
|
4550 | once(event: 'error', listener: Function): this;
|
4551 | addListener(event: 'error', listener: Function): this;
|
4552 | removeListener(event: 'error', listener: Function): this;
|
4553 | headers: Record<string, string[]>;
|
4554 | httpVersion: string;
|
4555 | httpVersionMajor: number;
|
4556 | httpVersionMinor: number;
|
4557 | statusCode: number;
|
4558 | statusMessage: string;
|
4559 | }
|
4560 |
|
4561 | interface InputEvent {
|
4562 |
|
4563 |
|
4564 |
|
4565 | |
4566 |
|
4567 |
|
4568 |
|
4569 |
|
4570 | modifiers: Array<'shift' | 'control' | 'alt' | 'meta' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>;
|
4571 | }
|
4572 |
|
4573 | interface IOCounters {
|
4574 |
|
4575 |
|
4576 |
|
4577 | |
4578 |
|
4579 |
|
4580 | otherOperationCount: number;
|
4581 | |
4582 |
|
4583 |
|
4584 | otherTransferCount: number;
|
4585 | |
4586 |
|
4587 |
|
4588 | readOperationCount: number;
|
4589 | |
4590 |
|
4591 |
|
4592 | readTransferCount: number;
|
4593 | |
4594 |
|
4595 |
|
4596 | writeOperationCount: number;
|
4597 | |
4598 |
|
4599 |
|
4600 | writeTransferCount: number;
|
4601 | }
|
4602 |
|
4603 | interface IpcMain extends NodeJS.EventEmitter {
|
4604 |
|
4605 |
|
4606 |
|
4607 | |
4608 |
|
4609 |
|
4610 |
|
4611 |
|
4612 |
|
4613 |
|
4614 |
|
4615 |
|
4616 |
|
4617 |
|
4618 |
|
4619 | handle(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<void>) | (any)): void;
|
4620 | |
4621 |
|
4622 |
|
4623 |
|
4624 | handleOnce(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<void>) | (any)): void;
|
4625 | |
4626 |
|
4627 |
|
4628 |
|
4629 | on(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
|
4630 | |
4631 |
|
4632 |
|
4633 |
|
4634 | once(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
|
4635 | |
4636 |
|
4637 |
|
4638 | removeAllListeners(channel?: string): this;
|
4639 | |
4640 |
|
4641 |
|
4642 | removeHandler(channel: string): void;
|
4643 | |
4644 |
|
4645 |
|
4646 |
|
4647 | removeListener(channel: string, listener: (...args: any[]) => void): this;
|
4648 | }
|
4649 |
|
4650 | interface IpcMainEvent extends Event {
|
4651 |
|
4652 |
|
4653 |
|
4654 | |
4655 |
|
4656 |
|
4657 | frameId: number;
|
4658 | |
4659 |
|
4660 |
|
4661 |
|
4662 |
|
4663 |
|
4664 | reply: Function;
|
4665 | |
4666 |
|
4667 |
|
4668 | returnValue: any;
|
4669 | |
4670 |
|
4671 |
|
4672 | sender: WebContents;
|
4673 | }
|
4674 |
|
4675 | interface IpcMainInvokeEvent extends Event {
|
4676 |
|
4677 |
|
4678 |
|
4679 | |
4680 |
|
4681 |
|
4682 | frameId: number;
|
4683 | |
4684 |
|
4685 |
|
4686 | sender: WebContents;
|
4687 | }
|
4688 |
|
4689 | interface IpcRenderer extends NodeJS.EventEmitter {
|
4690 |
|
4691 |
|
4692 |
|
4693 | |
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 |
|
4699 |
|
4700 |
|
4701 |
|
4702 |
|
4703 |
|
4704 | invoke(channel: string, ...args: any[]): Promise<any>;
|
4705 | |
4706 |
|
4707 |
|
4708 |
|
4709 | on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
|
4710 | |
4711 |
|
4712 |
|
4713 |
|
4714 | once(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
|
4715 | |
4716 |
|
4717 |
|
4718 | removeAllListeners(channel: string): this;
|
4719 | |
4720 |
|
4721 |
|
4722 |
|
4723 | removeListener(channel: string, listener: (...args: any[]) => void): this;
|
4724 | |
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 | send(channel: string, ...args: any[]): void;
|
4733 | |
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 |
|
4739 |
|
4740 |
|
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 |
|
4746 | sendSync(channel: string, ...args: any[]): any;
|
4747 | |
4748 |
|
4749 |
|
4750 | sendTo(webContentsId: number, channel: string, ...args: any[]): void;
|
4751 | |
4752 |
|
4753 |
|
4754 |
|
4755 | sendToHost(channel: string, ...args: any[]): void;
|
4756 | }
|
4757 |
|
4758 | interface IpcRendererEvent extends Event {
|
4759 |
|
4760 |
|
4761 |
|
4762 | |
4763 |
|
4764 |
|
4765 | sender: IpcRenderer;
|
4766 | |
4767 |
|
4768 |
|
4769 |
|
4770 |
|
4771 |
|
4772 |
|
4773 | senderId: number;
|
4774 | }
|
4775 |
|
4776 | interface JumpListCategory {
|
4777 |
|
4778 |
|
4779 |
|
4780 | |
4781 |
|
4782 |
|
4783 |
|
4784 | items?: JumpListItem[];
|
4785 | |
4786 |
|
4787 |
|
4788 | name?: string;
|
4789 | |
4790 |
|
4791 |
|
4792 | type?: ('tasks' | 'frequent' | 'recent' | 'custom');
|
4793 | }
|
4794 |
|
4795 | interface JumpListItem {
|
4796 |
|
4797 |
|
4798 |
|
4799 | |
4800 |
|
4801 |
|
4802 |
|
4803 | args?: string;
|
4804 | |
4805 |
|
4806 |
|
4807 |
|
4808 | description?: string;
|
4809 | |
4810 |
|
4811 |
|
4812 |
|
4813 |
|
4814 |
|
4815 | iconIndex?: number;
|
4816 | |
4817 |
|
4818 |
|
4819 |
|
4820 |
|
4821 | iconPath?: string;
|
4822 | |
4823 |
|
4824 |
|
4825 | path?: string;
|
4826 | |
4827 |
|
4828 |
|
4829 |
|
4830 | program?: string;
|
4831 | |
4832 |
|
4833 |
|
4834 |
|
4835 | title?: string;
|
4836 | |
4837 |
|
4838 |
|
4839 | type?: ('task' | 'separator' | 'file');
|
4840 | |
4841 |
|
4842 |
|
4843 | workingDirectory?: string;
|
4844 | }
|
4845 |
|
4846 | interface KeyboardEvent extends Event {
|
4847 |
|
4848 |
|
4849 |
|
4850 | |
4851 |
|
4852 |
|
4853 | altKey?: boolean;
|
4854 | |
4855 |
|
4856 |
|
4857 | ctrlKey?: boolean;
|
4858 | |
4859 |
|
4860 |
|
4861 | metaKey?: boolean;
|
4862 | |
4863 |
|
4864 |
|
4865 | shiftKey?: boolean;
|
4866 | |
4867 |
|
4868 |
|
4869 |
|
4870 | triggeredByAccelerator?: boolean;
|
4871 | }
|
4872 |
|
4873 | interface KeyboardInputEvent extends InputEvent {
|
4874 |
|
4875 |
|
4876 |
|
4877 | |
4878 |
|
4879 |
|
4880 |
|
4881 | keyCode: string;
|
4882 | |
4883 |
|
4884 |
|
4885 | type: ('keyDown' | 'keyUp' | 'char');
|
4886 | }
|
4887 |
|
4888 | interface MemoryInfo {
|
4889 |
|
4890 |
|
4891 |
|
4892 | |
4893 |
|
4894 |
|
4895 | peakWorkingSetSize: number;
|
4896 | |
4897 |
|
4898 |
|
4899 |
|
4900 |
|
4901 |
|
4902 | privateBytes?: number;
|
4903 | |
4904 |
|
4905 |
|
4906 | workingSetSize: number;
|
4907 | }
|
4908 |
|
4909 | interface MemoryUsageDetails {
|
4910 |
|
4911 |
|
4912 |
|
4913 | count: number;
|
4914 | liveSize: number;
|
4915 | size: number;
|
4916 | }
|
4917 |
|
4918 | class Menu {
|
4919 |
|
4920 |
|
4921 |
|
4922 | |
4923 |
|
4924 |
|
4925 | on(event: 'menu-will-close', listener: (event: Event) => void): this;
|
4926 | once(event: 'menu-will-close', listener: (event: Event) => void): this;
|
4927 | addListener(event: 'menu-will-close', listener: (event: Event) => void): this;
|
4928 | removeListener(event: 'menu-will-close', listener: (event: Event) => void): this;
|
4929 | |
4930 |
|
4931 |
|
4932 | on(event: 'menu-will-show', listener: (event: Event) => void): this;
|
4933 | once(event: 'menu-will-show', listener: (event: Event) => void): this;
|
4934 | addListener(event: 'menu-will-show', listener: (event: Event) => void): this;
|
4935 | removeListener(event: 'menu-will-show', listener: (event: Event) => void): this;
|
4936 | |
4937 |
|
4938 |
|
4939 | constructor();
|
4940 | /**
|
4941 | * Generally, the `template` is an array of `options` for constructing a MenuItem.
|
4942 | * The usage can be referenced above.
|
4943 | *
|
4944 | * You can also attach other fields to the element of the `template` and they will
|
4945 | * become properties of the constructed menu items.
|
4946 | */
|
4947 | static buildFromTemplate(template: Array<(MenuItemConstructorOptions) | (MenuItem)>): Menu;
|
4948 | /**
|
4949 | * The application menu, if set, or `null`, if not set.
|
4950 | *
|
4951 | * **Note:** The returned `Menu` instance doesn't support dynamic addition or
|
4952 | * removal of menu items. Instance properties can still be dynamically modified.
|
4953 | */
|
4954 | static getApplicationMenu(): (Menu) | (null);
|
4955 | /**
|
4956 | * Sends the `action` to the first responder of application. This is used for
|
4957 | * emulating default macOS menu behaviors. Usually you would use the `role`
|
4958 | * property of a `MenuItem`.
|
4959 | *
|
4960 | * See the macOS Cocoa Event Handling Guide for more information on macOS' native
|
4961 | * actions.
|
4962 | *
|
4963 | * @platform darwin
|
4964 | */
|
4965 | static sendActionToFirstResponder(action: string): void;
|
4966 | /**
|
4967 | * Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
|
4968 | * will be set as each window's top menu.
|
4969 | *
|
4970 | * Also on Windows and Linux, you can use a `&` in the top-level item name to
|
4971 | * indicate which letter should get a generated accelerator. For example, using
|
4972 | * `&File` for the file menu would result in a generated `Alt-F` accelerator that
|
4973 | * opens the associated menu. The indicated character in the button label gets an
|
4974 | * underline. The `&` character is not displayed on the button label.
|
4975 | *
|
4976 | * Passing `null` will suppress the default menu. On Windows and Linux, this has
|
4977 | * the additional effect of removing the menu bar from the window.
|
4978 | *
|
4979 | * **Note:** The default menu will be created automatically if the app does not set
|
4980 | * one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
|
4981 | * `Help`.
|
4982 | */
|
4983 | static setApplicationMenu(menu: (Menu) | (null)): void;
|
4984 | /**
|
4985 | * Appends the `menuItem` to the menu.
|
4986 | */
|
4987 | append(menuItem: MenuItem): void;
|
4988 | /**
|
4989 | * Closes the context menu in the `browserWindow`.
|
4990 | */
|
4991 | closePopup(browserWindow?: BrowserWindow): void;
|
4992 | /**
|
4993 | * the item with the specified `id`
|
4994 | */
|
4995 | getMenuItemById(id: string): MenuItem;
|
4996 | /**
|
4997 | * Inserts the `menuItem` to the `pos` position of the menu.
|
4998 | */
|
4999 | insert(pos: number, menuItem: MenuItem): void;
|
5000 | /**
|
5001 | * Pops up this menu as a context menu in the `BrowserWindow`.
|
5002 | */
|
5003 | popup(options?: PopupOptions): void;
|
5004 | items: MenuItem[];
|
5005 | }
|
5006 |
|
5007 | class MenuItem {
|
5008 |
|
5009 |
|
5010 |
|
5011 | |
5012 |
|
5013 |
|
5014 | constructor(options: MenuItemConstructorOptions);
|
5015 | accelerator?: Accelerator;
|
5016 | checked: boolean;
|
5017 | click: Function;
|
5018 | commandId: number;
|
5019 | enabled: boolean;
|
5020 | icon?: (NativeImage) | (string);
|
5021 | id: string;
|
5022 | label: string;
|
5023 | menu: Menu;
|
5024 | registerAccelerator: boolean;
|
5025 | role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'startSpeaking' | 'stopSpeaking' | 'close' | 'minimize' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
|
5026 | sublabel: string;
|
5027 | submenu?: Menu;
|
5028 | toolTip: string;
|
5029 | type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
|
5030 | visible: boolean;
|
5031 | }
|
5032 |
|
5033 | interface MimeTypedBuffer {
|
5034 |
|
5035 |
|
5036 |
|
5037 | |
5038 |
|
5039 |
|
5040 | data: Buffer;
|
5041 | |
5042 |
|
5043 |
|
5044 | mimeType: string;
|
5045 | }
|
5046 |
|
5047 | interface MouseInputEvent extends InputEvent {
|
5048 |
|
5049 |
|
5050 |
|
5051 | |
5052 |
|
5053 |
|
5054 | button?: ('left' | 'middle' | 'right');
|
5055 | clickCount?: number;
|
5056 | globalX?: number;
|
5057 | globalY?: number;
|
5058 | movementX?: number;
|
5059 | movementY?: number;
|
5060 | |
5061 |
|
5062 |
|
5063 |
|
5064 | type: ('mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove');
|
5065 | x: number;
|
5066 | y: number;
|
5067 | }
|
5068 |
|
5069 | interface MouseWheelInputEvent extends MouseInputEvent {
|
5070 |
|
5071 |
|
5072 |
|
5073 | accelerationRatioX?: number;
|
5074 | accelerationRatioY?: number;
|
5075 | canScroll?: boolean;
|
5076 | deltaX?: number;
|
5077 | deltaY?: number;
|
5078 | hasPreciseScrollingDeltas?: boolean;
|
5079 | |
5080 |
|
5081 |
|
5082 | type: ('mouseWheel');
|
5083 | wheelTicksX?: number;
|
5084 | wheelTicksY?: number;
|
5085 | }
|
5086 |
|
5087 | class NativeImage {
|
5088 |
|
5089 |
|
5090 |
|
5091 | |
5092 |
|
5093 |
|
5094 | static createEmpty(): NativeImage;
|
5095 | |
5096 |
|
5097 |
|
5098 |
|
5099 | static createFromBitmap(buffer: Buffer, options: CreateFromBitmapOptions): NativeImage;
|
5100 | |
5101 |
|
5102 |
|
5103 |
|
5104 | static createFromBuffer(buffer: Buffer, options?: CreateFromBufferOptions): NativeImage;
|
5105 | |
5106 |
|
5107 |
|
5108 | static createFromDataURL(dataURL: string): NativeImage;
|
5109 | |
5110 |
|
5111 |
|
5112 |
|
5113 |
|
5114 |
|
5115 |
|
5116 |
|
5117 |
|
5118 |
|
5119 |
|
5120 |
|
5121 |
|
5122 |
|
5123 |
|
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 |
|
5132 |
|
5133 |
|
5134 |
|
5135 |
|
5136 |
|
5137 |
|
5138 |
|
5139 |
|
5140 | static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
|
5141 | |
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 | static createFromPath(path: string): NativeImage;
|
5147 | |
5148 |
|
5149 |
|
5150 |
|
5151 |
|
5152 | addRepresentation(options: AddRepresentationOptions): void;
|
5153 | |
5154 |
|
5155 |
|
5156 | crop(rect: Rectangle): NativeImage;
|
5157 | |
5158 |
|
5159 |
|
5160 | getAspectRatio(): number;
|
5161 | |
5162 |
|
5163 |
|
5164 |
|
5165 |
|
5166 |
|
5167 |
|
5168 | getBitmap(options?: BitmapOptions): Buffer;
|
5169 | |
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 |
|
5178 |
|
5179 | getNativeHandle(): Buffer;
|
5180 | getSize(): Size;
|
5181 | |
5182 |
|
5183 |
|
5184 | isEmpty(): boolean;
|
5185 | |
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 | isTemplateImage(): boolean;
|
5191 | |
5192 |
|
5193 |
|
5194 |
|
5195 |
|
5196 |
|
5197 | resize(options: ResizeOptions): NativeImage;
|
5198 | |
5199 |
|
5200 |
|
5201 |
|
5202 |
|
5203 | setTemplateImage(option: boolean): void;
|
5204 | |
5205 |
|
5206 |
|
5207 | toBitmap(options?: ToBitmapOptions): Buffer;
|
5208 | |
5209 |
|
5210 |
|
5211 | toDataURL(options?: ToDataURLOptions): string;
|
5212 | |
5213 |
|
5214 |
|
5215 | toJPEG(quality: number): Buffer;
|
5216 | |
5217 |
|
5218 |
|
5219 | toPNG(options?: ToPNGOptions): Buffer;
|
5220 | isMacTemplateImage: boolean;
|
5221 | }
|
5222 |
|
5223 | interface NativeTheme extends NodeJS.EventEmitter {
|
5224 |
|
5225 |
|
5226 |
|
5227 | |
5228 |
|
5229 |
|
5230 |
|
5231 |
|
5232 |
|
5233 | on(event: 'updated', listener: Function): this;
|
5234 | once(event: 'updated', listener: Function): this;
|
5235 | addListener(event: 'updated', listener: Function): this;
|
5236 | removeListener(event: 'updated', listener: Function): this;
|
5237 | |
5238 |
|
5239 |
|
5240 |
|
5241 |
|
5242 |
|
5243 | readonly shouldUseDarkColors: boolean;
|
5244 | |
5245 |
|
5246 |
|
5247 |
|
5248 |
|
5249 |
|
5250 | readonly shouldUseHighContrastColors: boolean;
|
5251 | |
5252 |
|
5253 |
|
5254 |
|
5255 |
|
5256 |
|
5257 | readonly shouldUseInvertedColorScheme: boolean;
|
5258 | |
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 |
|
5268 |
|
5269 |
|
5270 |
|
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 |
|
5277 |
|
5278 |
|
5279 |
|
5280 |
|
5281 |
|
5282 |
|
5283 |
|
5284 |
|
5285 |
|
5286 |
|
5287 |
|
5288 |
|
5289 |
|
5290 |
|
5291 |
|
5292 |
|
5293 |
|
5294 |
|
5295 | themeSource: ('system' | 'light' | 'dark');
|
5296 | }
|
5297 |
|
5298 | interface Net {
|
5299 |
|
5300 |
|
5301 |
|
5302 | |
5303 |
|
5304 |
|
5305 |
|
5306 |
|
5307 |
|
5308 | request(options: (ClientRequestConstructorOptions) | (string)): ClientRequest;
|
5309 | }
|
5310 |
|
5311 | interface NetLog {
|
5312 |
|
5313 |
|
5314 |
|
5315 | |
5316 |
|
5317 |
|
5318 |
|
5319 |
|
5320 | startLogging(path: string, options?: StartLoggingOptions): Promise<void>;
|
5321 | |
5322 |
|
5323 |
|
5324 |
|
5325 |
|
5326 |
|
5327 | stopLogging(): Promise<string>;
|
5328 | |
5329 |
|
5330 |
|
5331 |
|
5332 | readonly currentlyLogging: boolean;
|
5333 | |
5334 |
|
5335 |
|
5336 |
|
5337 |
|
5338 | readonly currentlyLoggingPath: string;
|
5339 | }
|
5340 |
|
5341 | class Notification extends NodeJS.EventEmitter {
|
5342 |
|
5343 |
|
5344 |
|
5345 | on(event: 'action', listener: (event: Event,
|
5346 | |
5347 |
|
5348 |
|
5349 | index: number) => void): this;
|
5350 | once(event: 'action', listener: (event: Event,
|
5351 | |
5352 |
|
5353 |
|
5354 | index: number) => void): this;
|
5355 | addListener(event: 'action', listener: (event: Event,
|
5356 | |
5357 |
|
5358 |
|
5359 | index: number) => void): this;
|
5360 | removeListener(event: 'action', listener: (event: Event,
|
5361 | |
5362 |
|
5363 |
|
5364 | index: number) => void): this;
|
5365 | |
5366 |
|
5367 |
|
5368 | on(event: 'click', listener: (event: Event) => void): this;
|
5369 | once(event: 'click', listener: (event: Event) => void): this;
|
5370 | addListener(event: 'click', listener: (event: Event) => void): this;
|
5371 | removeListener(event: 'click', listener: (event: Event) => void): this;
|
5372 | |
5373 |
|
5374 |
|
5375 |
|
5376 |
|
5377 |
|
5378 | on(event: 'close', listener: (event: Event) => void): this;
|
5379 | once(event: 'close', listener: (event: Event) => void): this;
|
5380 | addListener(event: 'close', listener: (event: Event) => void): this;
|
5381 | removeListener(event: 'close', listener: (event: Event) => void): this;
|
5382 | |
5383 |
|
5384 |
|
5385 |
|
5386 |
|
5387 |
|
5388 | on(event: 'reply', listener: (event: Event,
|
5389 | |
5390 |
|
5391 |
|
5392 | reply: string) => void): this;
|
5393 | once(event: 'reply', listener: (event: Event,
|
5394 | |
5395 |
|
5396 |
|
5397 | reply: string) => void): this;
|
5398 | addListener(event: 'reply', listener: (event: Event,
|
5399 | |
5400 |
|
5401 |
|
5402 | reply: string) => void): this;
|
5403 | removeListener(event: 'reply', listener: (event: Event,
|
5404 | |
5405 |
|
5406 |
|
5407 | reply: string) => void): this;
|
5408 | |
5409 |
|
5410 |
|
5411 |
|
5412 |
|
5413 | on(event: 'show', listener: (event: Event) => void): this;
|
5414 | once(event: 'show', listener: (event: Event) => void): this;
|
5415 | addListener(event: 'show', listener: (event: Event) => void): this;
|
5416 | removeListener(event: 'show', listener: (event: Event) => void): this;
|
5417 | |
5418 |
|
5419 |
|
5420 | constructor(options?: NotificationConstructorOptions);
|
5421 | /**
|
5422 | * Whether or not desktop notifications are supported on the current system
|
5423 | */
|
5424 | static isSupported(): boolean;
|
5425 | /**
|
5426 | * Dismisses the notification.
|
5427 | */
|
5428 | close(): void;
|
5429 | /**
|
5430 | * Immediately shows the notification to the user, please note this means unlike
|
5431 | * the HTML5 Notification implementation, instantiating a `new Notification` does
|
5432 | * not immediately show it to the user, you need to call this method before the OS
|
5433 | * will display it.
|
5434 | *
|
5435 | * If the notification has been shown before, this method will dismiss the
|
5436 | * previously shown notification and create a new one with identical properties.
|
5437 | */
|
5438 | show(): void;
|
5439 | actions: NotificationAction[];
|
5440 | body: string;
|
5441 | closeButtonText: string;
|
5442 | hasReply: boolean;
|
5443 | replyPlaceholder: string;
|
5444 | silent: boolean;
|
5445 | sound: string;
|
5446 | subtitle: string;
|
5447 | title: string;
|
5448 | }
|
5449 |
|
5450 | interface NotificationAction {
|
5451 |
|
5452 |
|
5453 |
|
5454 | |
5455 |
|
5456 |
|
5457 | text?: string;
|
5458 | |
5459 |
|
5460 |
|
5461 | type: ('button');
|
5462 | }
|
5463 |
|
5464 | interface Point {
|
5465 |
|
5466 |
|
5467 |
|
5468 | x: number;
|
5469 | y: number;
|
5470 | }
|
5471 |
|
5472 | interface PowerMonitor extends NodeJS.EventEmitter {
|
5473 |
|
5474 |
|
5475 |
|
5476 | |
5477 |
|
5478 |
|
5479 |
|
5480 |
|
5481 | on(event: 'lock-screen', listener: Function): this;
|
5482 | once(event: 'lock-screen', listener: Function): this;
|
5483 | addListener(event: 'lock-screen', listener: Function): this;
|
5484 | removeListener(event: 'lock-screen', listener: Function): this;
|
5485 | |
5486 |
|
5487 |
|
5488 |
|
5489 |
|
5490 | on(event: 'on-ac', listener: Function): this;
|
5491 | once(event: 'on-ac', listener: Function): this;
|
5492 | addListener(event: 'on-ac', listener: Function): this;
|
5493 | removeListener(event: 'on-ac', listener: Function): this;
|
5494 | |
5495 |
|
5496 |
|
5497 |
|
5498 |
|
5499 | on(event: 'on-battery', listener: Function): this;
|
5500 | once(event: 'on-battery', listener: Function): this;
|
5501 | addListener(event: 'on-battery', listener: Function): this;
|
5502 | removeListener(event: 'on-battery', listener: Function): this;
|
5503 | |
5504 |
|
5505 |
|
5506 | on(event: 'resume', listener: Function): this;
|
5507 | once(event: 'resume', listener: Function): this;
|
5508 | addListener(event: 'resume', listener: Function): this;
|
5509 | removeListener(event: 'resume', listener: Function): this;
|
5510 | |
5511 |
|
5512 |
|
5513 |
|
5514 |
|
5515 |
|
5516 |
|
5517 |
|
5518 | on(event: 'shutdown', listener: Function): this;
|
5519 | once(event: 'shutdown', listener: Function): this;
|
5520 | addListener(event: 'shutdown', listener: Function): this;
|
5521 | removeListener(event: 'shutdown', listener: Function): this;
|
5522 | |
5523 |
|
5524 |
|
5525 | on(event: 'suspend', listener: Function): this;
|
5526 | once(event: 'suspend', listener: Function): this;
|
5527 | addListener(event: 'suspend', listener: Function): this;
|
5528 | removeListener(event: 'suspend', listener: Function): this;
|
5529 | |
5530 |
|
5531 |
|
5532 |
|
5533 |
|
5534 | on(event: 'unlock-screen', listener: Function): this;
|
5535 | once(event: 'unlock-screen', listener: Function): this;
|
5536 | addListener(event: 'unlock-screen', listener: Function): this;
|
5537 | removeListener(event: 'unlock-screen', listener: Function): this;
|
5538 | |
5539 |
|
5540 |
|
5541 |
|
5542 |
|
5543 |
|
5544 |
|
5545 | getSystemIdleState(idleThreshold: number): ('active' | 'idle' | 'locked' | 'unknown');
|
5546 | |
5547 |
|
5548 |
|
5549 |
|
5550 |
|
5551 | getSystemIdleTime(): number;
|
5552 | }
|
5553 |
|
5554 | interface PowerSaveBlocker {
|
5555 |
|
5556 |
|
5557 |
|
5558 | |
5559 |
|
5560 |
|
5561 | isStarted(id: number): boolean;
|
5562 | |
5563 |
|
5564 |
|
5565 |
|
5566 |
|
5567 |
|
5568 |
|
5569 |
|
5570 |
|
5571 |
|
5572 |
|
5573 |
|
5574 |
|
5575 |
|
5576 |
|
5577 | start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number;
|
5578 | |
5579 |
|
5580 |
|
5581 | stop(id: number): void;
|
5582 | }
|
5583 |
|
5584 | interface PrinterInfo {
|
5585 |
|
5586 |
|
5587 |
|
5588 | description: string;
|
5589 | isDefault: boolean;
|
5590 | name: string;
|
5591 | status: number;
|
5592 | }
|
5593 |
|
5594 | interface ProcessMemoryInfo {
|
5595 |
|
5596 |
|
5597 |
|
5598 | |
5599 |
|
5600 |
|
5601 |
|
5602 | private: number;
|
5603 | |
5604 |
|
5605 |
|
5606 |
|
5607 |
|
5608 | residentSet: number;
|
5609 | |
5610 |
|
5611 |
|
5612 |
|
5613 | shared: number;
|
5614 | }
|
5615 |
|
5616 | interface ProcessMetric {
|
5617 |
|
5618 |
|
5619 |
|
5620 | |
5621 |
|
5622 |
|
5623 | cpu: CPUUsage;
|
5624 | |
5625 |
|
5626 |
|
5627 |
|
5628 |
|
5629 |
|
5630 | creationTime: number;
|
5631 | |
5632 |
|
5633 |
|
5634 |
|
5635 |
|
5636 | integrityLevel?: ('untrusted' | 'low' | 'medium' | 'high' | 'unknown');
|
5637 | |
5638 |
|
5639 |
|
5640 | memory: MemoryInfo;
|
5641 | |
5642 |
|
5643 |
|
5644 | pid: number;
|
5645 | |
5646 |
|
5647 |
|
5648 |
|
5649 |
|
5650 | sandboxed?: boolean;
|
5651 | |
5652 |
|
5653 |
|
5654 | type: ('Browser' | 'Tab' | 'Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
|
5655 | }
|
5656 |
|
5657 | interface Product {
|
5658 |
|
5659 |
|
5660 |
|
5661 | |
5662 |
|
5663 |
|
5664 | contentLengths: number[];
|
5665 | |
5666 |
|
5667 |
|
5668 | contentVersion: string;
|
5669 | |
5670 |
|
5671 |
|
5672 | formattedPrice: string;
|
5673 | |
5674 |
|
5675 |
|
5676 |
|
5677 |
|
5678 | isDownloadable: boolean;
|
5679 | |
5680 |
|
5681 |
|
5682 | localizedDescription: string;
|
5683 | |
5684 |
|
5685 |
|
5686 | localizedTitle: string;
|
5687 | |
5688 |
|
5689 |
|
5690 | price: number;
|
5691 | |
5692 |
|
5693 |
|
5694 | productIdentifier: string;
|
5695 | }
|
5696 |
|
5697 | interface Protocol {
|
5698 |
|
5699 |
|
5700 |
|
5701 | |
5702 |
|
5703 |
|
5704 |
|
5705 | interceptBufferProtocol(scheme: string, handler: (request: Request, callback: (buffer?: Buffer) => void) => void, completion?: (error: Error) => void): void;
|
5706 | |
5707 |
|
5708 |
|
5709 |
|
5710 | interceptFileProtocol(scheme: string, handler: (request: Request, callback: (filePath: string) => void) => void, completion?: (error: Error) => void): void;
|
5711 | |
5712 |
|
5713 |
|
5714 |
|
5715 | interceptHttpProtocol(scheme: string, handler: (request: Request, callback: (redirectRequest: RedirectRequest) => void) => void, completion?: (error: Error) => void): void;
|
5716 | |
5717 |
|
5718 |
|
5719 |
|
5720 | interceptStreamProtocol(scheme: string, handler: (request: Request, callback: (stream?: (NodeJS.ReadableStream) | (StreamProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
|
5721 | |
5722 |
|
5723 |
|
5724 |
|
5725 | interceptStringProtocol(scheme: string, handler: (request: Request, callback: (data?: (string) | (StringProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
|
5726 | |
5727 |
|
5728 |
|
5729 |
|
5730 | isProtocolHandled(scheme: string): Promise<boolean>;
|
5731 | |
5732 |
|
5733 |
|
5734 |
|
5735 |
|
5736 |
|
5737 |
|
5738 |
|
5739 |
|
5740 | registerBufferProtocol(scheme: string, handler: (request: Request, callback: (buffer?: (Buffer) | (MimeTypedBuffer)) => void) => void, completion?: (error: Error) => void): void;
|
5741 | |
5742 |
|
5743 |
|
5744 |
|
5745 |
|
5746 |
|
5747 |
|
5748 |
|
5749 |
|
5750 |
|
5751 |
|
5752 |
|
5753 |
|
5754 |
|
5755 |
|
5756 |
|
5757 |
|
5758 |
|
5759 |
|
5760 |
|
5761 |
|
5762 | registerFileProtocol(scheme: string, handler: (request: Request, callback: (filePath?: (string) | (FilePathWithHeaders)) => void) => void, completion?: (error: Error) => void): void;
|
5763 | |
5764 |
|
5765 |
|
5766 |
|
5767 |
|
5768 |
|
5769 |
|
5770 |
|
5771 |
|
5772 |
|
5773 |
|
5774 |
|
5775 | registerHttpProtocol(scheme: string, handler: (request: Request, callback: (redirectRequest: RedirectRequest) => void) => void, completion?: (error: Error) => void): void;
|
5776 | |
5777 |
|
5778 |
|
5779 |
|
5780 |
|
5781 |
|
5782 |
|
5783 |
|
5784 |
|
5785 |
|
5786 |
|
5787 |
|
5788 |
|
5789 |
|
5790 |
|
5791 |
|
5792 |
|
5793 |
|
5794 |
|
5795 |
|
5796 |
|
5797 |
|
5798 |
|
5799 |
|
5800 |
|
5801 |
|
5802 |
|
5803 |
|
5804 |
|
5805 |
|
5806 |
|
5807 |
|
5808 |
|
5809 |
|
5810 |
|
5811 |
|
5812 |
|
5813 |
|
5814 |
|
5815 |
|
5816 | registerSchemesAsPrivileged(customSchemes: CustomScheme[]): void;
|
5817 | |
5818 |
|
5819 |
|
5820 |
|
5821 |
|
5822 |
|
5823 |
|
5824 |
|
5825 |
|
5826 |
|
5827 |
|
5828 |
|
5829 | registerStreamProtocol(scheme: string, handler: (request: Request, callback: (stream?: (NodeJS.ReadableStream) | (StreamProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
|
5830 | |
5831 |
|
5832 |
|
5833 |
|
5834 |
|
5835 |
|
5836 |
|
5837 | registerStringProtocol(scheme: string, handler: (request: Request, callback: (data?: (string) | (StringProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
|
5838 | |
5839 |
|
5840 |
|
5841 | uninterceptProtocol(scheme: string, completion?: (error: Error) => void): void;
|
5842 | |
5843 |
|
5844 |
|
5845 | unregisterProtocol(scheme: string, completion?: (error: Error) => void): void;
|
5846 | }
|
5847 |
|
5848 | interface ProtocolRequest {
|
5849 |
|
5850 |
|
5851 |
|
5852 | method: string;
|
5853 | referrer: string;
|
5854 | uploadData?: UploadData[];
|
5855 | url: string;
|
5856 | }
|
5857 |
|
5858 | interface ProtocolResponse {
|
5859 |
|
5860 |
|
5861 |
|
5862 | |
5863 |
|
5864 |
|
5865 | charset?: string;
|
5866 | |
5867 |
|
5868 |
|
5869 |
|
5870 |
|
5871 |
|
5872 | data?: (Buffer) | (string) | (NodeJS.ReadableStream);
|
5873 | |
5874 |
|
5875 |
|
5876 |
|
5877 | error?: number;
|
5878 | |
5879 |
|
5880 |
|
5881 |
|
5882 | headers?: Record<string, (string) | (string[])>;
|
5883 | |
5884 |
|
5885 |
|
5886 | method?: string;
|
5887 | |
5888 |
|
5889 |
|
5890 |
|
5891 |
|
5892 | mimeType?: string;
|
5893 | |
5894 |
|
5895 |
|
5896 |
|
5897 | path?: string;
|
5898 | |
5899 |
|
5900 |
|
5901 | referrer?: string;
|
5902 | |
5903 |
|
5904 |
|
5905 |
|
5906 |
|
5907 | session?: Session;
|
5908 | |
5909 |
|
5910 |
|
5911 | statusCode?: number;
|
5912 | |
5913 |
|
5914 |
|
5915 |
|
5916 | uploadData?: ProtocolResponseUploadData;
|
5917 | |
5918 |
|
5919 |
|
5920 |
|
5921 | url?: string;
|
5922 | }
|
5923 |
|
5924 | interface ProtocolResponseUploadData {
|
5925 |
|
5926 |
|
5927 |
|
5928 | |
5929 |
|
5930 |
|
5931 | contentType: string;
|
5932 | |
5933 |
|
5934 |
|
5935 | data: (string) | (Buffer);
|
5936 | }
|
5937 |
|
5938 | interface Rectangle {
|
5939 |
|
5940 |
|
5941 |
|
5942 | |
5943 |
|
5944 |
|
5945 | height: number;
|
5946 | |
5947 |
|
5948 |
|
5949 | width: number;
|
5950 | |
5951 |
|
5952 |
|
5953 | x: number;
|
5954 | |
5955 |
|
5956 |
|
5957 | y: number;
|
5958 | }
|
5959 |
|
5960 | interface Referrer {
|
5961 |
|
5962 |
|
5963 |
|
5964 | |
5965 |
|
5966 |
|
5967 |
|
5968 |
|
5969 | policy: ('default' | 'unsafe-url' | 'no-referrer-when-downgrade' | 'no-referrer' | 'origin' | 'strict-origin-when-cross-origin' | 'same-origin' | 'strict-origin');
|
5970 | |
5971 |
|
5972 |
|
5973 | url: string;
|
5974 | }
|
5975 |
|
5976 | interface Remote extends MainInterface {
|
5977 |
|
5978 |
|
5979 |
|
5980 | |
5981 |
|
5982 |
|
5983 | getCurrentWebContents(): WebContents;
|
5984 | |
5985 |
|
5986 |
|
5987 |
|
5988 |
|
5989 |
|
5990 |
|
5991 | getCurrentWindow(): BrowserWindow;
|
5992 | |
5993 |
|
5994 |
|
5995 | getGlobal(name: string): any;
|
5996 | |
5997 |
|
5998 |
|
5999 |
|
6000 |
|
6001 |
|
6002 |
|
6003 | require(module: string): any;
|
6004 | /**
|
6005 | * A `NodeJS.Process` object. The `process` object in the main process. This is
|
6006 | * the same as `remote.getGlobal('process')` but is cached.
|
6007 | *
|
6008 | */
|
6009 | readonly process: NodeJS.Process;
|
6010 | }
|
6011 |
|
6012 | interface RemoveClientCertificate {
|
6013 |
|
6014 |
|
6015 |
|
6016 | |
6017 |
|
6018 |
|
6019 |
|
6020 | origin: string;
|
6021 | |
6022 |
|
6023 |
|
6024 | type: string;
|
6025 | }
|
6026 |
|
6027 | interface RemovePassword {
|
6028 |
|
6029 |
|
6030 |
|
6031 | |
6032 |
|
6033 |
|
6034 |
|
6035 | origin?: string;
|
6036 | |
6037 |
|
6038 |
|
6039 | password?: string;
|
6040 | |
6041 |
|
6042 |
|
6043 | realm?: string;
|
6044 | |
6045 |
|
6046 |
|
6047 |
|
6048 | scheme?: ('basic' | 'digest' | 'ntlm' | 'negotiate');
|
6049 | |
6050 |
|
6051 |
|
6052 | type: string;
|
6053 | |
6054 |
|
6055 |
|
6056 | username?: string;
|
6057 | }
|
6058 |
|
6059 | interface Screen extends NodeJS.EventEmitter {
|
6060 |
|
6061 |
|
6062 |
|
6063 | |
6064 |
|
6065 |
|
6066 | on(event: 'display-added', listener: (event: Event,
|
6067 | newDisplay: Display) => void): this;
|
6068 | once(event: 'display-added', listener: (event: Event,
|
6069 | newDisplay: Display) => void): this;
|
6070 | addListener(event: 'display-added', listener: (event: Event,
|
6071 | newDisplay: Display) => void): this;
|
6072 | removeListener(event: 'display-added', listener: (event: Event,
|
6073 | newDisplay: Display) => void): this;
|
6074 | |
6075 |
|
6076 |
|
6077 |
|
6078 |
|
6079 | on(event: 'display-metrics-changed', listener: (event: Event,
|
6080 | display: Display,
|
6081 | changedMetrics: string[]) => void): this;
|
6082 | once(event: 'display-metrics-changed', listener: (event: Event,
|
6083 | display: Display,
|
6084 | changedMetrics: string[]) => void): this;
|
6085 | addListener(event: 'display-metrics-changed', listener: (event: Event,
|
6086 | display: Display,
|
6087 | changedMetrics: string[]) => void): this;
|
6088 | removeListener(event: 'display-metrics-changed', listener: (event: Event,
|
6089 | display: Display,
|
6090 | changedMetrics: string[]) => void): this;
|
6091 | |
6092 |
|
6093 |
|
6094 | on(event: 'display-removed', listener: (event: Event,
|
6095 | oldDisplay: Display) => void): this;
|
6096 | once(event: 'display-removed', listener: (event: Event,
|
6097 | oldDisplay: Display) => void): this;
|
6098 | addListener(event: 'display-removed', listener: (event: Event,
|
6099 | oldDisplay: Display) => void): this;
|
6100 | removeListener(event: 'display-removed', listener: (event: Event,
|
6101 | oldDisplay: Display) => void): this;
|
6102 | |
6103 |
|
6104 |
|
6105 |
|
6106 |
|
6107 |
|
6108 | dipToScreenPoint(point: Point): Point;
|
6109 | |
6110 |
|
6111 |
|
6112 |
|
6113 |
|
6114 |
|
6115 |
|
6116 | dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
|
6117 | |
6118 |
|
6119 |
|
6120 | getAllDisplays(): Display[];
|
6121 | |
6122 |
|
6123 |
|
6124 | getCursorScreenPoint(): Point;
|
6125 | |
6126 |
|
6127 |
|
6128 | getDisplayMatching(rect: Rectangle): Display;
|
6129 | |
6130 |
|
6131 |
|
6132 | getDisplayNearestPoint(point: Point): Display;
|
6133 | |
6134 |
|
6135 |
|
6136 | getPrimaryDisplay(): Display;
|
6137 | |
6138 |
|
6139 |
|
6140 |
|
6141 |
|
6142 |
|
6143 | screenToDipPoint(point: Point): Point;
|
6144 | |
6145 |
|
6146 |
|
6147 |
|
6148 |
|
6149 |
|
6150 |
|
6151 | screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
|
6152 | }
|
6153 |
|
6154 | interface ScrubberItem {
|
6155 |
|
6156 |
|
6157 |
|
6158 | |
6159 |
|
6160 |
|
6161 | icon?: NativeImage;
|
6162 | |
6163 |
|
6164 |
|
6165 | label?: string;
|
6166 | }
|
6167 |
|
6168 | interface SegmentedControlSegment {
|
6169 |
|
6170 |
|
6171 |
|
6172 | |
6173 |
|
6174 |
|
6175 | enabled?: boolean;
|
6176 | |
6177 |
|
6178 |
|
6179 | icon?: NativeImage;
|
6180 | |
6181 |
|
6182 |
|
6183 | label?: string;
|
6184 | }
|
6185 |
|
6186 | class Session extends NodeJS.EventEmitter {
|
6187 |
|
6188 |
|
6189 |
|
6190 | |
6191 |
|
6192 |
|
6193 |
|
6194 |
|
6195 |
|
6196 |
|
6197 |
|
6198 |
|
6199 |
|
6200 |
|
6201 |
|
6202 |
|
6203 |
|
6204 | static fromPartition(partition: string, options?: FromPartitionOptions): Session;
|
6205 | |
6206 |
|
6207 |
|
6208 | static defaultSession: Session;
|
6209 | |
6210 |
|
6211 |
|
6212 |
|
6213 |
|
6214 |
|
6215 | on(event: 'preconnect', listener: (event: Event,
|
6216 | |
6217 |
|
6218 |
|
6219 | preconnectUrl: string,
|
6220 | |
6221 |
|
6222 |
|
6223 |
|
6224 | allowCredentials: boolean) => void): this;
|
6225 | once(event: 'preconnect', listener: (event: Event,
|
6226 | |
6227 |
|
6228 |
|
6229 | preconnectUrl: string,
|
6230 | |
6231 |
|
6232 |
|
6233 |
|
6234 | allowCredentials: boolean) => void): this;
|
6235 | addListener(event: 'preconnect', listener: (event: Event,
|
6236 | |
6237 |
|
6238 |
|
6239 | preconnectUrl: string,
|
6240 | |
6241 |
|
6242 |
|
6243 |
|
6244 | allowCredentials: boolean) => void): this;
|
6245 | removeListener(event: 'preconnect', listener: (event: Event,
|
6246 | |
6247 |
|
6248 |
|
6249 | preconnectUrl: string,
|
6250 | |
6251 |
|
6252 |
|
6253 |
|
6254 | allowCredentials: boolean) => void): this;
|
6255 | |
6256 |
|
6257 |
|
6258 |
|
6259 |
|
6260 |
|
6261 | on(event: 'will-download', listener: (event: Event,
|
6262 | item: DownloadItem,
|
6263 | webContents: WebContents) => void): this;
|
6264 | once(event: 'will-download', listener: (event: Event,
|
6265 | item: DownloadItem,
|
6266 | webContents: WebContents) => void): this;
|
6267 | addListener(event: 'will-download', listener: (event: Event,
|
6268 | item: DownloadItem,
|
6269 | webContents: WebContents) => void): this;
|
6270 | removeListener(event: 'will-download', listener: (event: Event,
|
6271 | item: DownloadItem,
|
6272 | webContents: WebContents) => void): this;
|
6273 | |
6274 |
|
6275 |
|
6276 |
|
6277 | allowNTLMCredentialsForDomains(domains: string): void;
|
6278 | |
6279 |
|
6280 |
|
6281 | clearAuthCache(options: (RemovePassword) | (RemoveClientCertificate)): Promise<void>;
|
6282 | |
6283 |
|
6284 |
|
6285 |
|
6286 |
|
6287 | clearCache(): Promise<void>;
|
6288 | |
6289 |
|
6290 |
|
6291 |
|
6292 |
|
6293 | clearHostResolverCache(): Promise<void>;
|
6294 | |
6295 |
|
6296 |
|
6297 | clearStorageData(options?: ClearStorageDataOptions): Promise<void>;
|
6298 | |
6299 |
|
6300 |
|
6301 |
|
6302 |
|
6303 |
|
6304 |
|
6305 | createInterruptedDownload(options: CreateInterruptedDownloadOptions): void;
|
6306 | |
6307 |
|
6308 |
|
6309 |
|
6310 | disableNetworkEmulation(): void;
|
6311 | |
6312 |
|
6313 |
|
6314 | enableNetworkEmulation(options: EnableNetworkEmulationOptions): void;
|
6315 | |
6316 |
|
6317 |
|
6318 | flushStorageData(): void;
|
6319 | |
6320 |
|
6321 |
|
6322 | getBlobData(identifier: string): Promise<Buffer>;
|
6323 | |
6324 |
|
6325 |
|
6326 | getCacheSize(): Promise<number>;
|
6327 | |
6328 |
|
6329 |
|
6330 | getPreloads(): string[];
|
6331 | |
6332 |
|
6333 |
|
6334 | getUserAgent(): string;
|
6335 | |
6336 |
|
6337 |
|
6338 |
|
6339 |
|
6340 | preconnect(options: PreconnectOptions): void;
|
6341 | |
6342 |
|
6343 |
|
6344 | resolveProxy(url: string): Promise<string>;
|
6345 | |
6346 |
|
6347 |
|
6348 |
|
6349 |
|
6350 |
|
6351 |
|
6352 |
|
6353 |
|
6354 | setCertificateVerifyProc(proc: (request: ProcRequest, callback: (verificationResult: number) => void) => void): void;
|
6355 | |
6356 |
|
6357 |
|
6358 |
|
6359 | setDownloadPath(path: string): void;
|
6360 | |
6361 |
|
6362 |
|
6363 |
|
6364 |
|
6365 | setPermissionCheckHandler(handler: ((webContents: WebContents, permission: string, requestingOrigin: string, details: Details) => boolean) | (null)): void;
|
6366 | /**
|
6367 | * Sets the handler which can be used to respond to permission requests for the
|
6368 | * `session`. Calling `callback(true)` will allow the permission and
|
6369 | * `callback(false)` will reject it. To clear the handler, call
|
6370 | * `setPermissionRequestHandler(null)`.
|
6371 | */
|
6372 | setPermissionRequestHandler(handler: ((webContents: WebContents, permission: string, callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerHandlerDetails) => void) | (null)): void;
|
6373 | /**
|
6374 | * Adds scripts that will be executed on ALL web contents that are associated with
|
6375 | * this session just before normal `preload` scripts run.
|
6376 | */
|
6377 | setPreloads(preloads: string[]): void;
|
6378 | /**
|
6379 | * Resolves when the proxy setting process is complete.
|
6380 | *
|
6381 | * Sets the proxy settings.
|
6382 | *
|
6383 | * When `pacScript` and `proxyRules` are provided together, the `proxyRules` option
|
6384 | * is ignored and `pacScript` configuration is applied.
|
6385 | *
|
6386 | * The `proxyRules` has to follow the rules below:
|
6387 | *
|
6388 | * For example:
|
6389 | *
|
6390 | * * `http=foopy:80;ftp=foopy2` - Use HTTP proxy `foopy:80` for `http://` URLs, and
|
6391 | * HTTP proxy `foopy2:80` for `ftp://` URLs.
|
6392 | * * `foopy:80` - Use HTTP proxy `foopy:80` for all URLs.
|
6393 | * * `foopy:80,bar,direct://` - Use HTTP proxy `foopy:80` for all URLs, failing
|
6394 | * over to `bar` if `foopy:80` is unavailable, and after that using no proxy.
|
6395 | * * `socks4://foopy` - Use SOCKS v4 proxy `foopy:1080` for all URLs.
|
6396 | * * `http=foopy,socks5://bar.com` - Use HTTP proxy `foopy` for http URLs, and fail
|
6397 | * over to the SOCKS5 proxy `bar.com` if `foopy` is unavailable.
|
6398 | * * `http=foopy,direct://` - Use HTTP proxy `foopy` for http URLs, and use no
|
6399 | * proxy if `foopy` is unavailable.
|
6400 | * * `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use
|
6401 | * `socks4://foopy2` for all other URLs.
|
6402 | *
|
6403 | * The `proxyBypassRules` is a comma separated list of rules described below:
|
6404 | *
|
6405 | * * `[ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" <port> ]`
|
6406 | *
|
6407 | * Match all hostnames that match the pattern HOSTNAME_PATTERN.
|
6408 | *
|
6409 | * Examples: "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99",
|
6410 | * "https://x.*.y.com:99"
|
6411 | * * `"." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]`
|
6412 | *
|
6413 | * Match a particular domain suffix.
|
6414 | *
|
6415 | * Examples: ".google.com", ".com", "http://.google.com"
|
6416 | * * `[ SCHEME "://" ] IP_LITERAL [ ":" PORT ]`
|
6417 | *
|
6418 | * Match URLs which are IP address literals.
|
6419 | *
|
6420 | * Examples: "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
|
6421 | * * `IP_LITERAL "/" PREFIX_LENGTH_IN_BITS`
|
6422 | *
|
6423 | * Match any URL that is to an IP literal that falls between the given range. IP
|
6424 | * range is specified using CIDR notation.
|
6425 | *
|
6426 | * Examples: "192.168.1.1/16", "fefe:13::abc/33".
|
6427 | * * `<local>`
|
6428 | *
|
6429 | * Match local addresses. The meaning of `<local>` is whether the host matches one
|
6430 | * of: "127.0.0.1", "::1", "localhost".
|
6431 | */
|
6432 | setProxy(config: Config): Promise<void>;
|
6433 | /**
|
6434 | * Overrides the `userAgent` and `acceptLanguages` for this session.
|
6435 | *
|
6436 | * The `acceptLanguages` must a comma separated ordered list of language codes, for
|
6437 | * example `"en-US,fr,de,ko,zh-CN,ja"`.
|
6438 | *
|
6439 | * This doesn't affect existing `WebContents`, and each `WebContents` can use
|
6440 | * `webContents.setUserAgent` to override the session-wide user agent.
|
6441 | */
|
6442 | setUserAgent(userAgent: string, acceptLanguages?: string): void;
|
6443 | readonly cookies: Cookies;
|
6444 | readonly netLog: NetLog;
|
6445 | readonly protocol: Protocol;
|
6446 | readonly webRequest: WebRequest;
|
6447 | }
|
6448 |
|
6449 | interface Shell {
|
6450 |
|
6451 | // Docs: http://electronjs.org/docs/api/shell
|
6452 |
|
6453 | /**
|
6454 | * Play the beep sound.
|
6455 | */
|
6456 | beep(): void;
|
6457 | /**
|
6458 | * Whether the item was successfully moved to the trash.
|
6459 | *
|
6460 | Move the given file to trash and returns a boolean status for the operation.
|
6461 | */
|
6462 | moveItemToTrash(fullPath: string): boolean;
|
6463 | /**
|
6464 | * Open the given external protocol URL in the desktop's default manner. (For
|
6465 | * example, mailto: URLs in the user's default mail agent).
|
6466 | */
|
6467 | openExternal(url: string, options?: OpenExternalOptions): Promise<void>;
|
6468 | /**
|
6469 | * Whether the item was successfully opened.
|
6470 | *
|
6471 | Open the given file in the desktop's default manner.
|
6472 | */
|
6473 | openItem(fullPath: string): boolean;
|
6474 | /**
|
6475 | * Resolves the shortcut link at `shortcutPath`.
|
6476 | *
|
6477 | An exception will be thrown when any error happens.
|
6478 | *
|
6479 | * @platform win32
|
6480 | */
|
6481 | readShortcutLink(shortcutPath: string): ShortcutDetails;
|
6482 | /**
|
6483 | * Show the given file in a file manager. If possible, select the file.
|
6484 | */
|
6485 | showItemInFolder(fullPath: string): void;
|
6486 | /**
|
6487 | * Whether the shortcut was created successfully.
|
6488 | *
|
6489 | Creates or updates a shortcut link at `shortcutPath`.
|
6490 | *
|
6491 | * @platform win32
|
6492 | */
|
6493 | writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutDetails): boolean;
|
6494 | /**
|
6495 | * Whether the shortcut was created successfully.
|
6496 | *
|
6497 | Creates or updates a shortcut link at `shortcutPath`.
|
6498 | *
|
6499 | * @platform win32
|
6500 | */
|
6501 | writeShortcutLink(shortcutPath: string, options: ShortcutDetails): boolean;
|
6502 | }
|
6503 |
|
6504 | interface ShortcutDetails {
|
6505 |
|
6506 | // Docs: http://electronjs.org/docs/api/structures/shortcut-details
|
6507 |
|
6508 | /**
|
6509 | * The Application User Model ID. Default is empty.
|
6510 | */
|
6511 | appUserModelId?: string;
|
6512 | /**
|
6513 | * The arguments to be applied to `target` when launching from this shortcut.
|
6514 | * Default is empty.
|
6515 | */
|
6516 | args?: string;
|
6517 | /**
|
6518 | * The working directory. Default is empty.
|
6519 | */
|
6520 | cwd?: string;
|
6521 | /**
|
6522 | * The description of the shortcut. Default is empty.
|
6523 | */
|
6524 | description?: string;
|
6525 | /**
|
6526 | * The path to the icon, can be a DLL or EXE. `icon` and `iconIndex` have to be set
|
6527 | * together. Default is empty, which uses the target's icon.
|
6528 | */
|
6529 | icon?: string;
|
6530 | /**
|
6531 | * The resource ID of icon when `icon` is a DLL or EXE. Default is 0.
|
6532 | */
|
6533 | iconIndex?: number;
|
6534 | /**
|
6535 | * The target to launch from this shortcut.
|
6536 | */
|
6537 | target: string;
|
6538 | }
|
6539 |
|
6540 | interface Size {
|
6541 |
|
6542 | // Docs: http://electronjs.org/docs/api/structures/size
|
6543 |
|
6544 | height: number;
|
6545 | width: number;
|
6546 | }
|
6547 |
|
6548 | interface StreamProtocolResponse {
|
6549 |
|
6550 | // Docs: http://electronjs.org/docs/api/structures/stream-protocol-response
|
6551 |
|
6552 | /**
|
6553 | * A Node.js readable stream representing the response body.
|
6554 | */
|
6555 | data: (NodeJS.ReadableStream) | (null);
|
6556 | /**
|
6557 | * An object containing the response headers.
|
6558 | */
|
6559 | headers?: Record<string, (string) | (string[])>;
|
6560 | /**
|
6561 | * The HTTP response code.
|
6562 | */
|
6563 | statusCode?: number;
|
6564 | }
|
6565 |
|
6566 | interface StringProtocolResponse {
|
6567 |
|
6568 | // Docs: http://electronjs.org/docs/api/structures/string-protocol-response
|
6569 |
|
6570 | /**
|
6571 | * Charset of the response.
|
6572 | */
|
6573 | charset?: string;
|
6574 | /**
|
6575 | * A string representing the response body.
|
6576 | */
|
6577 | data: (string) | (null);
|
6578 | /**
|
6579 | * MIME type of the response.
|
6580 | */
|
6581 | mimeType?: string;
|
6582 | }
|
6583 |
|
6584 | interface SystemPreferences extends NodeJS.EventEmitter {
|
6585 |
|
6586 | // Docs: http://electronjs.org/docs/api/system-preferences
|
6587 |
|
6588 | on(event: 'accent-color-changed', listener: (event: Event,
|
6589 | |
6590 |
|
6591 |
|
6592 | newColor: string) => void): this;
|
6593 | once(event: 'accent-color-changed', listener: (event: Event,
|
6594 | |
6595 |
|
6596 |
|
6597 | newColor: string) => void): this;
|
6598 | addListener(event: 'accent-color-changed', listener: (event: Event,
|
6599 | |
6600 |
|
6601 |
|
6602 | newColor: string) => void): this;
|
6603 | removeListener(event: 'accent-color-changed', listener: (event: Event,
|
6604 | |
6605 |
|
6606 |
|
6607 | newColor: string) => void): this;
|
6608 | on(event: 'color-changed', listener: (event: Event) => void): this;
|
6609 | once(event: 'color-changed', listener: (event: Event) => void): this;
|
6610 | addListener(event: 'color-changed', listener: (event: Event) => void): this;
|
6611 | removeListener(event: 'color-changed', listener: (event: Event) => void): this;
|
6612 | /**
|
6613 | * **Deprecated:** Should use the new `updated` event on the `nativeTheme` module.
|
6614 | *
|
6615 | * @deprecated
|
6616 | * @platform win32
|
6617 | */
|
6618 | on(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
|
6619 | |
6620 |
|
6621 |
|
6622 | highContrastColorScheme: boolean) => void): this;
|
6623 | once(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
|
6624 | |
6625 |
|
6626 |
|
6627 | highContrastColorScheme: boolean) => void): this;
|
6628 | addListener(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
|
6629 | |
6630 |
|
6631 |
|
6632 | highContrastColorScheme: boolean) => void): this;
|
6633 | removeListener(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
|
6634 | |
6635 |
|
6636 |
|
6637 | highContrastColorScheme: boolean) => void): this;
|
6638 | /**
|
6639 | * **Deprecated:** Should use the new `updated` event on the `nativeTheme` module.
|
6640 | *
|
6641 | * @deprecated
|
6642 | * @platform win32
|
6643 | */
|
6644 | on(event: 'inverted-color-scheme-changed', listener: (event: Event,
|
6645 | |
6646 |
|
6647 |
|
6648 |
|
6649 | invertedColorScheme: boolean) => void): this;
|
6650 | once(event: 'inverted-color-scheme-changed', listener: (event: Event,
|
6651 | |
6652 |
|
6653 |
|
6654 |
|
6655 | invertedColorScheme: boolean) => void): this;
|
6656 | addListener(event: 'inverted-color-scheme-changed', listener: (event: Event,
|
6657 | |
6658 |
|
6659 |
|
6660 |
|
6661 | invertedColorScheme: boolean) => void): this;
|
6662 | removeListener(event: 'inverted-color-scheme-changed', listener: (event: Event,
|
6663 | |
6664 |
|
6665 |
|
6666 |
|
6667 | invertedColorScheme: boolean) => void): this;
|
6668 | /**
|
6669 | * A promise that resolves with `true` if consent was granted and `false` if it was
|
6670 | * denied. If an invalid `mediaType` is passed, the promise will be rejected. If an
|
6671 | * access request was denied and later is changed through the System Preferences
|
6672 | * pane, a restart of the app will be required for the new permissions to take
|
6673 | * effect. If access has already been requested and denied, it _must_ be changed
|
6674 | * through the preference pane; an alert will not pop up and the promise will
|
6675 | * resolve with the existing access status.
|
6676 | *
|
6677 | * **Important:** In order to properly leverage this API, you must set the
|
6678 | * `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your
|
6679 | * app's `Info.plist` file. The values for these keys will be used to populate the
|
6680 | * permission dialogs so that the user will be properly informed as to the purpose
|
6681 | * of the permission request. See Electron Application Distribution for more
|
6682 | * information about how to set these in the context of Electron.
|
6683 | *
|
6684 | * This user consent was not required until macOS 10.14 Mojave, so this method will
|
6685 | * always return `true` if your system is running 10.13 High Sierra or lower.
|
6686 | *
|
6687 | * @platform darwin
|
6688 | */
|
6689 | askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise<boolean>;
|
6690 | /**
|
6691 | * whether or not this device has the ability to use Touch ID.
|
6692 | *
|
6693 | * **NOTE:** This API will return `false` on macOS systems older than Sierra
|
6694 | * 10.12.2.
|
6695 |
|
6696 | **Deprecated**
|
6697 | *
|
6698 | * @platform darwin
|
6699 | */
|
6700 | canPromptTouchID(): boolean;
|
6701 | /**
|
6702 | * The users current system wide accent color preference in RGBA hexadecimal form.
|
6703 | *
|
6704 | This API is only available on macOS 10.14 Mojave or newer.
|
6705 | *
|
6706 | * @platform win32,darwin
|
6707 | */
|
6708 | getAccentColor(): string;
|
6709 | /**
|
6710 | * * `shouldRenderRichAnimation` Boolean - Returns true if rich animations should
|
6711 | * be rendered. Looks at session type (e.g. remote desktop) and accessibility
|
6712 | * settings to give guidance for heavy animations.
|
6713 | * * `scrollAnimationsEnabledBySystem` Boolean - Determines on a per-platform basis
|
6714 | * whether scroll animations (e.g. produced by home/end key) should be enabled.
|
6715 | * * `prefersReducedMotion` Boolean - Determines whether the user desires reduced
|
6716 | * motion based on platform APIs.
|
6717 | *
|
6718 | Returns an object with system animation settings.
|
6719 | */
|
6720 | getAnimationSettings(): AnimationSettings;
|
6721 | /**
|
6722 | * | `null` - Can be `dark`, `light` or `unknown`.
|
6723 | *
|
6724 | * Gets the macOS appearance setting that you have declared you want for your
|
6725 | * application, maps to NSApplication.appearance. You can use the
|
6726 | * `setAppLevelAppearance` API to set this value.
|
6727 |
|
6728 | **Deprecated**
|
6729 | *
|
6730 | * @deprecated
|
6731 | * @platform darwin
|
6732 | */
|
6733 | getAppLevelAppearance(): ('dark' | 'light' | 'unknown');
|
6734 | /**
|
6735 | * The system color setting in RGB hexadecimal form (`#ABCDEF`). See the Windows
|
6736 | * docs and the MacOS docs for more details.
|
6737 | *
|
6738 | * @platform win32,darwin
|
6739 | */
|
6740 | getColor(color: '3d-dark-shadow' | '3d-face' | '3d-highlight' | '3d-light' | '3d-shadow' | 'active-border' | 'active-caption' | 'active-caption-gradient' | 'app-workspace' | 'button-text' | 'caption-text' | 'desktop' | 'disabled-text' | 'highlight' | 'highlight-text' | 'hotlight' | 'inactive-border' | 'inactive-caption' | 'inactive-caption-gradient' | 'inactive-caption-text' | 'info-background' | 'info-text' | 'menu' | 'menu-highlight' | 'menubar' | 'menu-text' | 'scrollbar' | 'window' | 'window-frame' | 'window-text' | 'alternate-selected-control-text' | 'control-background' | 'control' | 'control-text' | 'disabled-control-text' | 'find-highlight' | 'grid' | 'header-text' | 'highlight' | 'keyboard-focus-indicator' | 'label' | 'link' | 'placeholder-text' | 'quaternary-label' | 'scrubber-textured-background' | 'secondary-label' | 'selected-content-background' | 'selected-control' | 'selected-control-text' | 'selected-menu-item' | 'selected-text-background' | 'selected-text' | 'separator' | 'shadow' | 'tertiary-label' | 'text-background' | 'text' | 'under-page-background' | 'unemphasized-selected-content-background' | 'unemphasized-selected-text-background' | 'unemphasized-selected-text' | 'window-background' | 'window-frame-text'): string;
|
6741 | /**
|
6742 | * Can be `dark`, `light` or `unknown`.
|
6743 | *
|
6744 | * Gets the macOS appearance setting that is currently applied to your application,
|
6745 | * maps to NSApplication.effectiveAppearance
|
6746 | *
|
6747 | * Please note that until Electron is built targeting the 10.14 SDK, your
|
6748 | * application's `effectiveAppearance` will default to 'light' and won't inherit
|
6749 | * the OS preference. In the interim in order for your application to inherit the
|
6750 | * OS preference you must set the `NSRequiresAquaSystemAppearance` key in your apps
|
6751 | * `Info.plist` to `false`. If you are using `electron-packager` or
|
6752 | * `electron-forge` just set the `enableDarwinDarkMode` packager option to `true`.
|
6753 | * See the Electron Packager API for more details.
|
6754 |
|
6755 | **Deprecated**
|
6756 | *
|
6757 | * @platform darwin
|
6758 | */
|
6759 | getEffectiveAppearance(): ('dark' | 'light' | 'unknown');
|
6760 | /**
|
6761 | * Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
|
6762 | *
|
6763 | * This user consent was not required until macOS 10.14 Mojave, so this method will
|
6764 | * always return `granted` if your system is running 10.13 High Sierra or lower.
|
6765 | *
|
6766 | * @platform darwin
|
6767 | */
|
6768 | getMediaAccessStatus(mediaType: string): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown');
|
6769 | /**
|
6770 | * The standard system color formatted as `#RRGGBBAA`.
|
6771 | *
|
6772 | * Returns one of several standard system colors that automatically adapt to
|
6773 | * vibrancy and changes in accessibility settings like 'Increase contrast' and
|
6774 | * 'Reduce transparency'. See Apple Documentation for more details.
|
6775 | *
|
6776 | * @platform darwin
|
6777 | */
|
6778 | getSystemColor(color: 'blue' | 'brown' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow'): string;
|
6779 | /**
|
6780 | * The value of `key` in `NSUserDefaults`.
|
6781 | *
|
6782 | * Some popular `key` and `type`s are:
|
6783 | *
|
6784 | * * `AppleInterfaceStyle`: `string`
|
6785 | * * `AppleAquaColorVariant`: `integer`
|
6786 | * * `AppleHighlightColor`: `string`
|
6787 | * * `AppleShowScrollBars`: `string`
|
6788 | * * `NSNavRecentPlaces`: `array`
|
6789 | * * `NSPreferredWebServices`: `dictionary`
|
6790 | * * `NSUserDictionaryReplacementItems`: `array`
|
6791 | *
|
6792 | * @platform darwin
|
6793 | */
|
6794 | getUserDefault(key: string, type: 'string' | 'boolean' | 'integer' | 'float' | 'double' | 'url' | 'array' | 'dictionary'): any;
|
6795 | /**
|
6796 | * `true` if DWM composition (Aero Glass) is enabled, and `false` otherwise.
|
6797 | *
|
6798 | * An example of using it to determine if you should create a transparent window or
|
6799 | * not (transparent windows won't work correctly when DWM composition is disabled):
|
6800 | *
|
6801 | * @platform win32
|
6802 | */
|
6803 | isAeroGlassEnabled(): boolean;
|
6804 | /**
|
6805 | * Whether the system is in Dark Mode.
|
6806 | *
|
6807 | * **Note:** On macOS 10.15 Catalina in order for this API to return the correct
|
6808 | * value when in the "automatic" dark mode setting you must either have
|
6809 | * `NSRequiresAquaSystemAppearance=false` in your `Info.plist` or be on Electron
|
6810 | * `>=7.0.0`. See the dark mode guide for more information.
|
6811 | *
|
6812 | **Deprecated:** Should use the new `nativeTheme.shouldUseDarkColors` API.
|
6813 | *
|
6814 | * @deprecated
|
6815 | * @platform darwin,win32
|
6816 | */
|
6817 | isDarkMode(): boolean;
|
6818 | /**
|
6819 | * `true` if a high contrast theme is active, `false` otherwise.
|
6820 | *
|
6821 | * **Depreacted:** Should use the new `nativeTheme.shouldUseHighContrastColors`
|
6822 | * API.
|
6823 | *
|
6824 | * @deprecated
|
6825 | * @platform darwin,win32
|
6826 | */
|
6827 | isHighContrastColorScheme(): boolean;
|
6828 | /**
|
6829 | * `true` if an inverted color scheme (a high contrast color scheme with light text
|
6830 | * and dark backgrounds) is active, `false` otherwise.
|
6831 | *
|
6832 | * **Deprecated:** Should use the new `nativeTheme.shouldUseInvertedColorScheme`
|
6833 | * API.
|
6834 | *
|
6835 | * @deprecated
|
6836 | * @platform win32
|
6837 | */
|
6838 | isInvertedColorScheme(): boolean;
|
6839 | /**
|
6840 | * Whether the Swipe between pages setting is on.
|
6841 | *
|
6842 | * @platform darwin
|
6843 | */
|
6844 | isSwipeTrackingFromScrollEventsEnabled(): boolean;
|
6845 | /**
|
6846 | * `true` if the current process is a trusted accessibility client and `false` if
|
6847 | * it is not.
|
6848 | *
|
6849 | * @platform darwin
|
6850 | */
|
6851 | isTrustedAccessibilityClient(prompt: boolean): boolean;
|
6852 | /**
|
6853 | * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
|
6854 | * contains the user information dictionary sent along with the notification.
|
6855 | *
|
6856 | * @platform darwin
|
6857 | */
|
6858 | postLocalNotification(event: string, userInfo: Record<string, any>): void;
|
6859 | /**
|
6860 | * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
|
6861 | * contains the user information dictionary sent along with the notification.
|
6862 | *
|
6863 | * @platform darwin
|
6864 | */
|
6865 | postNotification(event: string, userInfo: Record<string, any>, deliverImmediately?: boolean): void;
|
6866 | /**
|
6867 | * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
|
6868 | * contains the user information dictionary sent along with the notification.
|
6869 | *
|
6870 | * @platform darwin
|
6871 | */
|
6872 | postWorkspaceNotification(event: string, userInfo: Record<string, any>): void;
|
6873 | /**
|
6874 | * resolves if the user has successfully authenticated with Touch ID.
|
6875 | *
|
6876 | * This API itself will not protect your user data; rather, it is a mechanism to
|
6877 | * allow you to do so. Native apps will need to set Access Control Constants like
|
6878 | * `kSecAccessControlUserPresence` on the their keychain entry so that reading it
|
6879 | * would auto-prompt for Touch ID biometric consent. This could be done with
|
6880 | * `node-keytar`, such that one would store an encryption key with `node-keytar`
|
6881 | * and only fetch it if `promptTouchID()` resolves.
|
6882 | *
|
6883 | * **NOTE:** This API will return a rejected Promise on macOS systems older than
|
6884 | * Sierra 10.12.2.
|
6885 | *
|
6886 | * @platform darwin
|
6887 | */
|
6888 | promptTouchID(reason: string): Promise<void>;
|
6889 | /**
|
6890 | * Add the specified defaults to your application's `NSUserDefaults`.
|
6891 | *
|
6892 | * @platform darwin
|
6893 | */
|
6894 | registerDefaults(defaults: Record<string, (string) | (boolean) | (number)>): void;
|
6895 | /**
|
6896 | * Removes the `key` in `NSUserDefaults`. This can be used to restore the default
|
6897 | * or global value of a `key` previously set with `setUserDefault`.
|
6898 | *
|
6899 | * @platform darwin
|
6900 | */
|
6901 | removeUserDefault(key: string): void;
|
6902 | /**
|
6903 | * Sets the appearance setting for your application, this should override the
|
6904 | * system default and override the value of `getEffectiveAppearance`.
|
6905 | *
|
6906 | **Deprecated**
|
6907 | *
|
6908 | * @deprecated
|
6909 | * @platform darwin
|
6910 | */
|
6911 | setAppLevelAppearance(appearance: (('dark' | 'light')) | (null)): void;
|
6912 | /**
|
6913 | * Set the value of `key` in `NSUserDefaults`.
|
6914 | *
|
6915 | * Note that `type` should match actual type of `value`. An exception is thrown if
|
6916 | * they don't.
|
6917 | *
|
6918 | Some popular `key` and `type`s are:
|
6919 |
|
6920 | * `ApplePressAndHoldEnabled`: `boolean`
|
6921 | *
|
6922 | * @platform darwin
|
6923 | */
|
6924 | setUserDefault(key: string, type: string, value: string): void;
|
6925 | /**
|
6926 | * The ID of this subscription
|
6927 | *
|
6928 | * Same as `subscribeNotification`, but uses `NSNotificationCenter` for local
|
6929 | * defaults. This is necessary for events such as
|
6930 | * `NSUserDefaultsDidChangeNotification`.
|
6931 | *
|
6932 | * @platform darwin
|
6933 | */
|
6934 | subscribeLocalNotification(event: string, callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
|
6935 | /**
|
6936 | * The ID of this subscription
|
6937 | *
|
6938 | * Subscribes to native notifications of macOS, `callback` will be called with
|
6939 | * `callback(event, userInfo)` when the corresponding `event` happens. The
|
6940 | * `userInfo` is an Object that contains the user information dictionary sent along
|
6941 | * with the notification. The `object` is the sender of the notification, and only
|
6942 | * supports `NSString` values for now.
|
6943 | *
|
6944 | * The `id` of the subscriber is returned, which can be used to unsubscribe the
|
6945 | * `event`.
|
6946 | *
|
6947 | * Under the hood this API subscribes to `NSDistributedNotificationCenter`, example
|
6948 | * values of `event` are:
|
6949 | *
|
6950 | * * `AppleInterfaceThemeChangedNotification`
|
6951 | * * `AppleAquaColorVariantChanged`
|
6952 | * * `AppleColorPreferencesChangedNotification`
|
6953 | * * `AppleShowScrollBarsSettingChanged`
|
6954 | *
|
6955 | * @platform darwin
|
6956 | */
|
6957 | subscribeNotification(event: string, callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
|
6958 | /**
|
6959 | * Same as `subscribeNotification`, but uses
|
6960 | * `NSWorkspace.sharedWorkspace.notificationCenter`. This is necessary for events
|
6961 | * such as `NSWorkspaceDidActivateApplicationNotification`.
|
6962 | *
|
6963 | * @platform darwin
|
6964 | */
|
6965 | subscribeWorkspaceNotification(event: string, callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): void;
|
6966 | /**
|
6967 | * Same as `unsubscribeNotification`, but removes the subscriber from
|
6968 | * `NSNotificationCenter`.
|
6969 | *
|
6970 | * @platform darwin
|
6971 | */
|
6972 | unsubscribeLocalNotification(id: number): void;
|
6973 | /**
|
6974 | * Removes the subscriber with `id`.
|
6975 | *
|
6976 | * @platform darwin
|
6977 | */
|
6978 | unsubscribeNotification(id: number): void;
|
6979 | /**
|
6980 | * Same as `unsubscribeNotification`, but removes the subscriber from
|
6981 | * `NSWorkspace.sharedWorkspace.notificationCenter`.
|
6982 | *
|
6983 | * @platform darwin
|
6984 | */
|
6985 | unsubscribeWorkspaceNotification(id: number): void;
|
6986 | /**
|
6987 | * A `String` property that can be `dark`, `light` or `unknown`. It determines the
|
6988 | * macOS appearance setting for your application. This maps to values in:
|
6989 | * NSApplication.appearance. Setting this will override the system default as well
|
6990 | * as the value of `getEffectiveAppearance`.
|
6991 | *
|
6992 | * Possible values that can be set are `dark` and `light`, and possible return
|
6993 | * values are `dark`, `light`, and `unknown`.
|
6994 | *
|
6995 | This property is only available on macOS 10.14 Mojave or newer.
|
6996 | *
|
6997 | * @platform darwin
|
6998 | */
|
6999 | appLevelAppearance: ('dark' | 'light' | 'unknown');
|
7000 | /**
|
7001 | * A `String` property that can be `dark`, `light` or `unknown`.
|
7002 | *
|
7003 | * Returns the macOS appearance setting that is currently applied to your
|
7004 | * application, maps to NSApplication.effectiveAppearance
|
7005 | *
|
7006 | * Please note that until Electron is built targeting the 10.14 SDK, your
|
7007 | * application's `effectiveAppearance` will default to 'light' and won't inherit
|
7008 | * the OS preference. In the interim in order for your application to inherit the
|
7009 | * OS preference you must set the `NSRequiresAquaSystemAppearance` key in your apps
|
7010 | * `Info.plist` to `false`. If you are using `electron-packager` or
|
7011 | * `electron-forge` just set the `enableDarwinDarkMode` packager option to `true`.
|
7012 | * See the Electron Packager API for more details.
|
7013 | *
|
7014 | * @platform darwin
|
7015 | */
|
7016 | readonly effectiveAppearance: ('dark' | 'light' | 'unknown');
|
7017 | }
|
7018 |
|
7019 | interface Task {
|
7020 |
|
7021 | // Docs: http://electronjs.org/docs/api/structures/task
|
7022 |
|
7023 | /**
|
7024 | * The command line arguments when `program` is executed.
|
7025 | */
|
7026 | arguments: string;
|
7027 | /**
|
7028 | * Description of this task.
|
7029 | */
|
7030 | description: string;
|
7031 | /**
|
7032 | * The icon index in the icon file. If an icon file consists of two or more icons,
|
7033 | * set this value to identify the icon. If an icon file consists of one icon, this
|
7034 | * value is 0.
|
7035 | */
|
7036 | iconIndex: number;
|
7037 | /**
|
7038 | * The absolute path to an icon to be displayed in a JumpList, which can be an
|
7039 | * arbitrary resource file that contains an icon. You can usually specify
|
7040 | * `process.execPath` to show the icon of the program.
|
7041 | */
|
7042 | iconPath: string;
|
7043 | /**
|
7044 | * Path of the program to execute, usually you should specify `process.execPath`
|
7045 | * which opens the current program.
|
7046 | */
|
7047 | program: string;
|
7048 | /**
|
7049 | * The string to be displayed in a JumpList.
|
7050 | */
|
7051 | title: string;
|
7052 | /**
|
7053 | * The working directory. Default is empty.
|
7054 | */
|
7055 | workingDirectory?: string;
|
7056 | }
|
7057 |
|
7058 | interface ThumbarButton {
|
7059 |
|
7060 | // Docs: http://electronjs.org/docs/api/structures/thumbar-button
|
7061 |
|
7062 | click: Function;
|
7063 | /**
|
7064 | * Control specific states and behaviors of the button. By default, it is
|
7065 | * `['enabled']`.
|
7066 | */
|
7067 | flags?: string[];
|
7068 | /**
|
7069 | * The icon showing in thumbnail toolbar.
|
7070 | */
|
7071 | icon: NativeImage;
|
7072 | /**
|
7073 | * The text of the button's tooltip.
|
7074 | */
|
7075 | tooltip?: string;
|
7076 | }
|
7077 |
|
7078 | class TouchBar {
|
7079 |
|
7080 | // Docs: http://electronjs.org/docs/api/touch-bar
|
7081 |
|
7082 | /**
|
7083 | * TouchBar
|
7084 | */
|
7085 | constructor(options: TouchBarConstructorOptions);
|
7086 | escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null);
|
7087 | static TouchBarButton: typeof TouchBarButton;
|
7088 | static TouchBarColorPicker: typeof TouchBarColorPicker;
|
7089 | static TouchBarGroup: typeof TouchBarGroup;
|
7090 | static TouchBarLabel: typeof TouchBarLabel;
|
7091 | static TouchBarPopover: typeof TouchBarPopover;
|
7092 | static TouchBarScrubber: typeof TouchBarScrubber;
|
7093 | static TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
|
7094 | static TouchBarSlider: typeof TouchBarSlider;
|
7095 | static TouchBarSpacer: typeof TouchBarSpacer;
|
7096 | }
|
7097 |
|
7098 | class TouchBarButton {
|
7099 |
|
7100 | // Docs: http://electronjs.org/docs/api/touch-bar-button
|
7101 |
|
7102 | /**
|
7103 | * TouchBarButton
|
7104 | */
|
7105 | constructor(options: TouchBarButtonConstructorOptions);
|
7106 | backgroundColor: string;
|
7107 | icon: NativeImage;
|
7108 | label: string;
|
7109 | }
|
7110 |
|
7111 | class TouchBarColorPicker extends NodeJS.EventEmitter {
|
7112 |
|
7113 | // Docs: http://electronjs.org/docs/api/touch-bar-color-picker
|
7114 |
|
7115 | /**
|
7116 | * TouchBarColorPicker
|
7117 | */
|
7118 | constructor(options: TouchBarColorPickerConstructorOptions);
|
7119 | availableColors: string[];
|
7120 | selectedColor: string;
|
7121 | }
|
7122 |
|
7123 | class TouchBarGroup extends NodeJS.EventEmitter {
|
7124 |
|
7125 | // Docs: http://electronjs.org/docs/api/touch-bar-group
|
7126 |
|
7127 | /**
|
7128 | * TouchBarGroup
|
7129 | */
|
7130 | constructor(options: TouchBarGroupConstructorOptions);
|
7131 | }
|
7132 |
|
7133 | class TouchBarLabel extends NodeJS.EventEmitter {
|
7134 |
|
7135 | // Docs: http://electronjs.org/docs/api/touch-bar-label
|
7136 |
|
7137 | /**
|
7138 | * TouchBarLabel
|
7139 | */
|
7140 | constructor(options: TouchBarLabelConstructorOptions);
|
7141 | label: string;
|
7142 | textColor: string;
|
7143 | }
|
7144 |
|
7145 | class TouchBarPopover extends NodeJS.EventEmitter {
|
7146 |
|
7147 | // Docs: http://electronjs.org/docs/api/touch-bar-popover
|
7148 |
|
7149 | /**
|
7150 | * TouchBarPopover
|
7151 | */
|
7152 | constructor(options: TouchBarPopoverConstructorOptions);
|
7153 | icon: NativeImage;
|
7154 | label: string;
|
7155 | }
|
7156 |
|
7157 | class TouchBarScrubber extends NodeJS.EventEmitter {
|
7158 |
|
7159 | // Docs: http://electronjs.org/docs/api/touch-bar-scrubber
|
7160 |
|
7161 | /**
|
7162 | * TouchBarScrubber
|
7163 | */
|
7164 | constructor(options: TouchBarScrubberConstructorOptions);
|
7165 | continuous: boolean;
|
7166 | items: ScrubberItem[];
|
7167 | mode: ('fixed' | 'free');
|
7168 | overlayStyle: ('background' | 'outline' | 'null');
|
7169 | selectedStyle: ('background' | 'outline' | 'null');
|
7170 | showArrowButtons: boolean;
|
7171 | }
|
7172 |
|
7173 | class TouchBarSegmentedControl extends NodeJS.EventEmitter {
|
7174 |
|
7175 | // Docs: http://electronjs.org/docs/api/touch-bar-segmented-control
|
7176 |
|
7177 | /**
|
7178 | * TouchBarSegmentedControl
|
7179 | */
|
7180 | constructor(options: TouchBarSegmentedControlConstructorOptions);
|
7181 | segments: SegmentedControlSegment[];
|
7182 | segmentStyle: string;
|
7183 | selectedIndex: number;
|
7184 | }
|
7185 |
|
7186 | class TouchBarSlider extends NodeJS.EventEmitter {
|
7187 |
|
7188 | // Docs: http://electronjs.org/docs/api/touch-bar-slider
|
7189 |
|
7190 | /**
|
7191 | * TouchBarSlider
|
7192 | */
|
7193 | constructor(options: TouchBarSliderConstructorOptions);
|
7194 | label: string;
|
7195 | maxValue: number;
|
7196 | minValue: number;
|
7197 | value: number;
|
7198 | }
|
7199 |
|
7200 | class TouchBarSpacer extends NodeJS.EventEmitter {
|
7201 |
|
7202 | // Docs: http://electronjs.org/docs/api/touch-bar-spacer
|
7203 |
|
7204 | /**
|
7205 | * TouchBarSpacer
|
7206 | */
|
7207 | constructor(options: TouchBarSpacerConstructorOptions);
|
7208 | }
|
7209 |
|
7210 | interface TraceCategoriesAndOptions {
|
7211 |
|
7212 | // Docs: http://electronjs.org/docs/api/structures/trace-categories-and-options
|
7213 |
|
7214 | /**
|
7215 | * A filter to control what category groups should be traced. A filter can have an
|
7216 | * optional '-' prefix to exclude category groups that contain a matching category.
|
7217 | * Having both included and excluded category patterns in the same list is not
|
7218 | * supported. Examples: `test_MyTest*`, `test_MyTest*,test_OtherStuff`,
|
7219 | * `-excluded_category1,-excluded_category2`.
|
7220 | */
|
7221 | categoryFilter: string;
|
7222 | /**
|
7223 | * Controls what kind of tracing is enabled, it is a comma-delimited sequence of
|
7224 | * the following strings: `record-until-full`, `record-continuously`,
|
7225 | * `trace-to-console`, `enable-sampling`, `enable-systrace`, e.g.
|
7226 | * `'record-until-full,enable-sampling'`. The first 3 options are trace recording
|
7227 | * modes and hence mutually exclusive. If more than one trace recording modes
|
7228 | * appear in the `traceOptions` string, the last one takes precedence. If none of
|
7229 | * the trace recording modes are specified, recording mode is `record-until-full`.
|
7230 | * The trace option will first be reset to the default option (`record_mode` set to
|
7231 | * `record-until-full`, `enable_sampling` and `enable_systrace` set to `false`)
|
7232 | * before options parsed from `traceOptions` are applied on it.
|
7233 | */
|
7234 | traceOptions: string;
|
7235 | }
|
7236 |
|
7237 | interface TraceConfig {
|
7238 |
|
7239 | // Docs: http://electronjs.org/docs/api/structures/trace-config
|
7240 |
|
7241 | /**
|
7242 | * if true, filter event data according to a whitelist of events that have been
|
7243 | * manually vetted to not include any PII. See the implementation in Chromium for
|
7244 | * specifics.
|
7245 | */
|
7246 | enable_argument_filter?: boolean;
|
7247 | /**
|
7248 | * a list of tracing categories to exclude. Can include glob-like patterns using
|
7249 | * `*` at the end of the category name. See tracing categories for the list of
|
7250 | * categories.
|
7251 | */
|
7252 | excluded_categories?: string[];
|
7253 | /**
|
7254 | * a list of histogram names to report with the trace.
|
7255 | */
|
7256 | histogram_names?: string[];
|
7257 | /**
|
7258 | * a list of tracing categories to include. Can include glob-like patterns using
|
7259 | * `*` at the end of the category name. See tracing categories for the list of
|
7260 | * categories.
|
7261 | */
|
7262 | included_categories?: string[];
|
7263 | /**
|
7264 | * a list of process IDs to include in the trace. If not specified, trace all
|
7265 | * processes.
|
7266 | */
|
7267 | included_process_ids?: number[];
|
7268 | /**
|
7269 | * if the `disabled-by-default-memory-infra` category is enabled, this contains
|
7270 | * optional additional configuration for data collection. See the Chromium
|
7271 | * memory-infra docs for more information.
|
7272 | */
|
7273 | memory_dump_config?: Record<string, any>;
|
7274 | /**
|
7275 | * Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible`
|
7276 | * or `trace-to-console`. Defaults to `record-until-full`.
|
7277 | */
|
7278 | recording_mode?: ('record-until-full' | 'record-continuously' | 'record-as-much-as-possible' | 'trace-to-console');
|
7279 | /**
|
7280 | * maximum size of the trace recording buffer in events.
|
7281 | */
|
7282 | trace_buffer_size_in_events?: number;
|
7283 | /**
|
7284 | * maximum size of the trace recording buffer in kilobytes. Defaults to 100MB.
|
7285 | */
|
7286 | trace_buffer_size_in_kb?: number;
|
7287 | }
|
7288 |
|
7289 | interface Transaction {
|
7290 |
|
7291 | // Docs: http://electronjs.org/docs/api/structures/transaction
|
7292 |
|
7293 | /**
|
7294 | * The error code if an error occurred while processing the transaction.
|
7295 | */
|
7296 | errorCode: number;
|
7297 | /**
|
7298 | * The error message if an error occurred while processing the transaction.
|
7299 | */
|
7300 | errorMessage: string;
|
7301 | /**
|
7302 | * The identifier of the restored transaction by the App Store.
|
7303 | */
|
7304 | originalTransactionIdentifier: string;
|
7305 | payment: Payment;
|
7306 | /**
|
7307 | * The date the transaction was added to the App Store’s payment queue.
|
7308 | */
|
7309 | transactionDate: string;
|
7310 | /**
|
7311 | * A string that uniquely identifies a successful payment transaction.
|
7312 | */
|
7313 | transactionIdentifier: string;
|
7314 | /**
|
7315 | * The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or
|
7316 | * `deferred`.
|
7317 | */
|
7318 | transactionState: ('purchasing' | 'purchased' | 'failed' | 'restored' | 'deferred');
|
7319 | }
|
7320 |
|
7321 | class Tray extends NodeJS.EventEmitter {
|
7322 |
|
7323 | // Docs: http://electronjs.org/docs/api/tray
|
7324 |
|
7325 | /**
|
7326 | * Emitted when the tray balloon is clicked.
|
7327 | *
|
7328 | * @platform win32
|
7329 | */
|
7330 | on(event: 'balloon-click', listener: Function): this;
|
7331 | once(event: 'balloon-click', listener: Function): this;
|
7332 | addListener(event: 'balloon-click', listener: Function): this;
|
7333 | removeListener(event: 'balloon-click', listener: Function): this;
|
7334 | /**
|
7335 | * Emitted when the tray balloon is closed because of timeout or user manually
|
7336 | * closes it.
|
7337 | *
|
7338 | * @platform win32
|
7339 | */
|
7340 | on(event: 'balloon-closed', listener: Function): this;
|
7341 | once(event: 'balloon-closed', listener: Function): this;
|
7342 | addListener(event: 'balloon-closed', listener: Function): this;
|
7343 | removeListener(event: 'balloon-closed', listener: Function): this;
|
7344 | /**
|
7345 | * Emitted when the tray balloon shows.
|
7346 | *
|
7347 | * @platform win32
|
7348 | */
|
7349 | on(event: 'balloon-show', listener: Function): this;
|
7350 | once(event: 'balloon-show', listener: Function): this;
|
7351 | addListener(event: 'balloon-show', listener: Function): this;
|
7352 | removeListener(event: 'balloon-show', listener: Function): this;
|
7353 | /**
|
7354 | * Emitted when the tray icon is clicked.
|
7355 | */
|
7356 | on(event: 'click', listener: (event: KeyboardEvent,
|
7357 | |
7358 |
|
7359 |
|
7360 | bounds: Rectangle,
|
7361 | |
7362 |
|
7363 |
|
7364 | position: Point) => void): this;
|
7365 | once(event: 'click', listener: (event: KeyboardEvent,
|
7366 | |
7367 |
|
7368 |
|
7369 | bounds: Rectangle,
|
7370 | |
7371 |
|
7372 |
|
7373 | position: Point) => void): this;
|
7374 | addListener(event: 'click', listener: (event: KeyboardEvent,
|
7375 | |
7376 |
|
7377 |
|
7378 | bounds: Rectangle,
|
7379 | |
7380 |
|
7381 |
|
7382 | position: Point) => void): this;
|
7383 | removeListener(event: 'click', listener: (event: KeyboardEvent,
|
7384 | |
7385 |
|
7386 |
|
7387 | bounds: Rectangle,
|
7388 | |
7389 |
|
7390 |
|
7391 | position: Point) => void): this;
|
7392 | /**
|
7393 | * Emitted when the tray icon is double clicked.
|
7394 | *
|
7395 | * @platform darwin,win32
|
7396 | */
|
7397 | on(event: 'double-click', listener: (event: KeyboardEvent,
|
7398 | |
7399 |
|
7400 |
|
7401 | bounds: Rectangle) => void): this;
|
7402 | once(event: 'double-click', listener: (event: KeyboardEvent,
|
7403 | |
7404 |
|
7405 |
|
7406 | bounds: Rectangle) => void): this;
|
7407 | addListener(event: 'double-click', listener: (event: KeyboardEvent,
|
7408 | |
7409 |
|
7410 |
|
7411 | bounds: Rectangle) => void): this;
|
7412 | removeListener(event: 'double-click', listener: (event: KeyboardEvent,
|
7413 | |
7414 |
|
7415 |
|
7416 | bounds: Rectangle) => void): this;
|
7417 | /**
|
7418 | * Emitted when a drag operation ends on the tray or ends at another location.
|
7419 | *
|
7420 | * @platform darwin
|
7421 | */
|
7422 | on(event: 'drag-end', listener: Function): this;
|
7423 | once(event: 'drag-end', listener: Function): this;
|
7424 | addListener(event: 'drag-end', listener: Function): this;
|
7425 | removeListener(event: 'drag-end', listener: Function): this;
|
7426 | /**
|
7427 | * Emitted when a drag operation enters the tray icon.
|
7428 | *
|
7429 | * @platform darwin
|
7430 | */
|
7431 | on(event: 'drag-enter', listener: Function): this;
|
7432 | once(event: 'drag-enter', listener: Function): this;
|
7433 | addListener(event: 'drag-enter', listener: Function): this;
|
7434 | removeListener(event: 'drag-enter', listener: Function): this;
|
7435 | /**
|
7436 | * Emitted when a drag operation exits the tray icon.
|
7437 | *
|
7438 | * @platform darwin
|
7439 | */
|
7440 | on(event: 'drag-leave', listener: Function): this;
|
7441 | once(event: 'drag-leave', listener: Function): this;
|
7442 | addListener(event: 'drag-leave', listener: Function): this;
|
7443 | removeListener(event: 'drag-leave', listener: Function): this;
|
7444 | /**
|
7445 | * Emitted when any dragged items are dropped on the tray icon.
|
7446 | *
|
7447 | * @platform darwin
|
7448 | */
|
7449 | on(event: 'drop', listener: Function): this;
|
7450 | once(event: 'drop', listener: Function): this;
|
7451 | addListener(event: 'drop', listener: Function): this;
|
7452 | removeListener(event: 'drop', listener: Function): this;
|
7453 | /**
|
7454 | * Emitted when dragged files are dropped in the tray icon.
|
7455 | *
|
7456 | * @platform darwin
|
7457 | */
|
7458 | on(event: 'drop-files', listener: (event: Event,
|
7459 | |
7460 |
|
7461 |
|
7462 | files: string[]) => void): this;
|
7463 | once(event: 'drop-files', listener: (event: Event,
|
7464 | |
7465 |
|
7466 |
|
7467 | files: string[]) => void): this;
|
7468 | addListener(event: 'drop-files', listener: (event: Event,
|
7469 | |
7470 |
|
7471 |
|
7472 | files: string[]) => void): this;
|
7473 | removeListener(event: 'drop-files', listener: (event: Event,
|
7474 | |
7475 |
|
7476 |
|
7477 | files: string[]) => void): this;
|
7478 | /**
|
7479 | * Emitted when dragged text is dropped in the tray icon.
|
7480 | *
|
7481 | * @platform darwin
|
7482 | */
|
7483 | on(event: 'drop-text', listener: (event: Event,
|
7484 | |
7485 |
|
7486 |
|
7487 | text: string) => void): this;
|
7488 | once(event: 'drop-text', listener: (event: Event,
|
7489 | |
7490 |
|
7491 |
|
7492 | text: string) => void): this;
|
7493 | addListener(event: 'drop-text', listener: (event: Event,
|
7494 | |
7495 |
|
7496 |
|
7497 | text: string) => void): this;
|
7498 | removeListener(event: 'drop-text', listener: (event: Event,
|
7499 | |
7500 |
|
7501 |
|
7502 | text: string) => void): this;
|
7503 | /**
|
7504 | * Emitted when the mouse enters the tray icon.
|
7505 | *
|
7506 | * @platform darwin
|
7507 | */
|
7508 | on(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
7509 | |
7510 |
|
7511 |
|
7512 | position: Point) => void): this;
|
7513 | once(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
7514 | |
7515 |
|
7516 |
|
7517 | position: Point) => void): this;
|
7518 | addListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
7519 | |
7520 |
|
7521 |
|
7522 | position: Point) => void): this;
|
7523 | removeListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
7524 | |
7525 |
|
7526 |
|
7527 | position: Point) => void): this;
|
7528 | /**
|
7529 | * Emitted when the mouse exits the tray icon.
|
7530 | *
|
7531 | * @platform darwin
|
7532 | */
|
7533 | on(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
7534 | |
7535 |
|
7536 |
|
7537 | position: Point) => void): this;
|
7538 | once(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
7539 | |
7540 |
|
7541 |
|
7542 | position: Point) => void): this;
|
7543 | addListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
7544 | |
7545 |
|
7546 |
|
7547 | position: Point) => void): this;
|
7548 | removeListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
7549 | |
7550 |
|
7551 |
|
7552 | position: Point) => void): this;
|
7553 | /**
|
7554 | * Emitted when the mouse moves in the tray icon.
|
7555 | *
|
7556 | * @platform darwin,win32
|
7557 | */
|
7558 | on(event: 'mouse-move', listener: (event: KeyboardEvent,
|
7559 | |
7560 |
|
7561 |
|
7562 | position: Point) => void): this;
|
7563 | once(event: 'mouse-move', listener: (event: KeyboardEvent,
|
7564 | |
7565 |
|
7566 |
|
7567 | position: Point) => void): this;
|
7568 | addListener(event: 'mouse-move', listener: (event: KeyboardEvent,
|
7569 | |
7570 |
|
7571 |
|
7572 | position: Point) => void): this;
|
7573 | removeListener(event: 'mouse-move', listener: (event: KeyboardEvent,
|
7574 | |
7575 |
|
7576 |
|
7577 | position: Point) => void): this;
|
7578 | /**
|
7579 | * Emitted when the tray icon is right clicked.
|
7580 | *
|
7581 | * @platform darwin,win32
|
7582 | */
|
7583 | on(event: 'right-click', listener: (event: KeyboardEvent,
|
7584 | |
7585 |
|
7586 |
|
7587 | bounds: Rectangle) => void): this;
|
7588 | once(event: 'right-click', listener: (event: KeyboardEvent,
|
7589 | |
7590 |
|
7591 |
|
7592 | bounds: Rectangle) => void): this;
|
7593 | addListener(event: 'right-click', listener: (event: KeyboardEvent,
|
7594 | |
7595 |
|
7596 |
|
7597 | bounds: Rectangle) => void): this;
|
7598 | removeListener(event: 'right-click', listener: (event: KeyboardEvent,
|
7599 | |
7600 |
|
7601 |
|
7602 | bounds: Rectangle) => void): this;
|
7603 | /**
|
7604 | * Tray
|
7605 | */
|
7606 | constructor(image: (NativeImage) | (string));
|
7607 | /**
|
7608 | * Destroys the tray icon immediately.
|
7609 | */
|
7610 | destroy(): void;
|
7611 | /**
|
7612 | * Displays a tray balloon.
|
7613 | *
|
7614 | * @platform win32
|
7615 | */
|
7616 | displayBalloon(options: DisplayBalloonOptions): void;
|
7617 | /**
|
7618 | * The `bounds` of this tray icon as `Object`.
|
7619 | *
|
7620 | * @platform darwin,win32
|
7621 | */
|
7622 | getBounds(): Rectangle;
|
7623 | /**
|
7624 | * Whether double click events will be ignored.
|
7625 | *
|
7626 | * @platform darwin
|
7627 | */
|
7628 | getIgnoreDoubleClickEvents(): boolean;
|
7629 | /**
|
7630 | * the title displayed next to the tray icon in the status bar
|
7631 | *
|
7632 | * @platform darwin
|
7633 | */
|
7634 | getTitle(): string;
|
7635 | /**
|
7636 | * Whether the tray icon is destroyed.
|
7637 | */
|
7638 | isDestroyed(): boolean;
|
7639 | /**
|
7640 | * Pops up the context menu of the tray icon. When `menu` is passed, the `menu`
|
7641 | * will be shown instead of the tray icon's context menu.
|
7642 | *
|
7643 | The `position` is only available on Windows, and it is (0, 0) by default.
|
7644 | *
|
7645 | * @platform darwin,win32
|
7646 | */
|
7647 | popUpContextMenu(menu?: Menu, position?: Point): void;
|
7648 | /**
|
7649 | * Sets the context menu for this icon.
|
7650 | */
|
7651 | setContextMenu(menu: (Menu) | (null)): void;
|
7652 | /**
|
7653 | * Sets the option to ignore double click events. Ignoring these events allows you
|
7654 | * to detect every individual click of the tray icon.
|
7655 | *
|
7656 | This value is set to false by default.
|
7657 | *
|
7658 | * @platform darwin
|
7659 | */
|
7660 | setIgnoreDoubleClickEvents(ignore: boolean): void;
|
7661 | /**
|
7662 | * Sets the `image` associated with this tray icon.
|
7663 | */
|
7664 | setImage(image: (NativeImage) | (string)): void;
|
7665 | /**
|
7666 | * Sets the `image` associated with this tray icon when pressed on macOS.
|
7667 | *
|
7668 | * @platform darwin
|
7669 | */
|
7670 | setPressedImage(image: (NativeImage) | (string)): void;
|
7671 | /**
|
7672 | * Sets the title displayed next to the tray icon in the status bar (Support ANSI
|
7673 | * colors).
|
7674 | *
|
7675 | * @platform darwin
|
7676 | */
|
7677 | setTitle(title: string): void;
|
7678 | /**
|
7679 | * Sets the hover text for this tray icon.
|
7680 | */
|
7681 | setToolTip(toolTip: string): void;
|
7682 | }
|
7683 |
|
7684 | interface UploadBlob {
|
7685 |
|
7686 | // Docs: http://electronjs.org/docs/api/structures/upload-blob
|
7687 |
|
7688 | /**
|
7689 | * UUID of blob data to upload.
|
7690 | */
|
7691 | blobUUID: string;
|
7692 | /**
|
7693 | * `blob`.
|
7694 | */
|
7695 | type: string;
|
7696 | }
|
7697 |
|
7698 | interface UploadData {
|
7699 |
|
7700 | // Docs: http://electronjs.org/docs/api/structures/upload-data
|
7701 |
|
7702 | /**
|
7703 | * UUID of blob data. Use ses.getBlobData method to retrieve the data.
|
7704 | */
|
7705 | blobUUID?: string;
|
7706 | /**
|
7707 | * Content being sent.
|
7708 | */
|
7709 | bytes: Buffer;
|
7710 | /**
|
7711 | * Path of file being uploaded.
|
7712 | */
|
7713 | file?: string;
|
7714 | }
|
7715 |
|
7716 | interface UploadFile {
|
7717 |
|
7718 | // Docs: http://electronjs.org/docs/api/structures/upload-file
|
7719 |
|
7720 | /**
|
7721 | * Path of file to be uploaded.
|
7722 | */
|
7723 | filePath: string;
|
7724 | /**
|
7725 | * Number of bytes to read from `offset`. Defaults to `0`.
|
7726 | */
|
7727 | length: number;
|
7728 | /**
|
7729 | * Last Modification time in number of seconds since the UNIX epoch.
|
7730 | */
|
7731 | modificationTime: number;
|
7732 | /**
|
7733 | * Defaults to `0`.
|
7734 | */
|
7735 | offset: number;
|
7736 | /**
|
7737 | * `file`.
|
7738 | */
|
7739 | type: string;
|
7740 | }
|
7741 |
|
7742 | interface UploadRawData {
|
7743 |
|
7744 | // Docs: http://electronjs.org/docs/api/structures/upload-raw-data
|
7745 |
|
7746 | /**
|
7747 | * Data to be uploaded.
|
7748 | */
|
7749 | bytes: Buffer;
|
7750 | /**
|
7751 | * `rawData`.
|
7752 | */
|
7753 | type: string;
|
7754 | }
|
7755 |
|
7756 | class WebContents extends NodeJS.EventEmitter {
|
7757 |
|
7758 | // Docs: http://electronjs.org/docs/api/web-contents
|
7759 |
|
7760 | /**
|
7761 | * A WebContents instance with the given ID.
|
7762 | */
|
7763 | static fromId(id: number): WebContents;
|
7764 | /**
|
7765 | * An array of all `WebContents` instances. This will contain web contents for all
|
7766 | * windows, webviews, opened devtools, and devtools extension background pages.
|
7767 | */
|
7768 | static getAllWebContents(): WebContents[];
|
7769 | /**
|
7770 | * The web contents that is focused in this application, otherwise returns `null`.
|
7771 | */
|
7772 | static getFocusedWebContents(): WebContents;
|
7773 | /**
|
7774 | * Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
|
7775 | * `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
|
7776 | * menu shortcuts.
|
7777 | *
|
7778 | To only prevent the menu shortcuts, use `setIgnoreMenuShortcuts`:
|
7779 | */
|
7780 | on(event: 'before-input-event', listener: (event: Event,
|
7781 | |
7782 |
|
7783 |
|
7784 | input: Input) => void): this;
|
7785 | once(event: 'before-input-event', listener: (event: Event,
|
7786 | |
7787 |
|
7788 |
|
7789 | input: Input) => void): this;
|
7790 | addListener(event: 'before-input-event', listener: (event: Event,
|
7791 | |
7792 |
|
7793 |
|
7794 | input: Input) => void): this;
|
7795 | removeListener(event: 'before-input-event', listener: (event: Event,
|
7796 | |
7797 |
|
7798 |
|
7799 | input: Input) => void): this;
|
7800 | /**
|
7801 | * Emitted when failed to verify the `certificate` for `url`.
|
7802 | *
|
7803 | The usage is the same with the `certificate-error` event of `app`.
|
7804 | */
|
7805 | on(event: 'certificate-error', listener: (event: Event,
|
7806 | url: string,
|
7807 | |
7808 |
|
7809 |
|
7810 | error: string,
|
7811 | certificate: Certificate,
|
7812 | callback: (isTrusted: boolean) => void) => void): this;
|
7813 | once(event: 'certificate-error', listener: (event: Event,
|
7814 | url: string,
|
7815 | |
7816 |
|
7817 |
|
7818 | error: string,
|
7819 | certificate: Certificate,
|
7820 | callback: (isTrusted: boolean) => void) => void): this;
|
7821 | addListener(event: 'certificate-error', listener: (event: Event,
|
7822 | url: string,
|
7823 | |
7824 |
|
7825 |
|
7826 | error: string,
|
7827 | certificate: Certificate,
|
7828 | callback: (isTrusted: boolean) => void) => void): this;
|
7829 | removeListener(event: 'certificate-error', listener: (event: Event,
|
7830 | url: string,
|
7831 | |
7832 |
|
7833 |
|
7834 | error: string,
|
7835 | certificate: Certificate,
|
7836 | callback: (isTrusted: boolean) => void) => void): this;
|
7837 | /**
|
7838 | * Emitted when the associated window logs a console message. Will not be emitted
|
7839 | * for windows with *offscreen rendering* enabled.
|
7840 | */
|
7841 | on(event: 'console-message', listener: (event: Event,
|
7842 | level: number,
|
7843 | message: string,
|
7844 | line: number,
|
7845 | sourceId: string) => void): this;
|
7846 | once(event: 'console-message', listener: (event: Event,
|
7847 | level: number,
|
7848 | message: string,
|
7849 | line: number,
|
7850 | sourceId: string) => void): this;
|
7851 | addListener(event: 'console-message', listener: (event: Event,
|
7852 | level: number,
|
7853 | message: string,
|
7854 | line: number,
|
7855 | sourceId: string) => void): this;
|
7856 | removeListener(event: 'console-message', listener: (event: Event,
|
7857 | level: number,
|
7858 | message: string,
|
7859 | line: number,
|
7860 | sourceId: string) => void): this;
|
7861 | /**
|
7862 | * Emitted when there is a new context menu that needs to be handled.
|
7863 | */
|
7864 | on(event: 'context-menu', listener: (event: Event,
|
7865 | params: ContextMenuParams) => void): this;
|
7866 | once(event: 'context-menu', listener: (event: Event,
|
7867 | params: ContextMenuParams) => void): this;
|
7868 | addListener(event: 'context-menu', listener: (event: Event,
|
7869 | params: ContextMenuParams) => void): this;
|
7870 | removeListener(event: 'context-menu', listener: (event: Event,
|
7871 | params: ContextMenuParams) => void): this;
|
7872 | /**
|
7873 | * Emitted when the renderer process crashes or is killed.
|
7874 | */
|
7875 | on(event: 'crashed', listener: (event: Event,
|
7876 | killed: boolean) => void): this;
|
7877 | once(event: 'crashed', listener: (event: Event,
|
7878 | killed: boolean) => void): this;
|
7879 | addListener(event: 'crashed', listener: (event: Event,
|
7880 | killed: boolean) => void): this;
|
7881 | removeListener(event: 'crashed', listener: (event: Event,
|
7882 | killed: boolean) => void): this;
|
7883 | /**
|
7884 | * Emitted when the cursor's type changes. The `type` parameter can be `default`,
|
7885 | * `crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
|
7886 | * `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`,
|
7887 | * `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`,
|
7888 | * `row-resize`, `m-panning`, `e-panning`, `n-panning`, `ne-panning`, `nw-panning`,
|
7889 | * `s-panning`, `se-panning`, `sw-panning`, `w-panning`, `move`, `vertical-text`,
|
7890 | * `cell`, `context-menu`, `alias`, `progress`, `nodrop`, `copy`, `none`,
|
7891 | * `not-allowed`, `zoom-in`, `zoom-out`, `grab`, `grabbing` or `custom`.
|
7892 | *
|
7893 | * If the `type` parameter is `custom`, the `image` parameter will hold the custom
|
7894 | * cursor image in a `NativeImage`, and `scale`, `size` and `hotspot` will hold
|
7895 | * additional information about the custom cursor.
|
7896 | */
|
7897 | on(event: 'cursor-changed', listener: (event: Event,
|
7898 | type: string,
|
7899 | image: NativeImage,
|
7900 | |
7901 |
|
7902 |
|
7903 | scale: number,
|
7904 | |
7905 |
|
7906 |
|
7907 | size: Size,
|
7908 | |
7909 |
|
7910 |
|
7911 | hotspot: Point) => void): this;
|
7912 | once(event: 'cursor-changed', listener: (event: Event,
|
7913 | type: string,
|
7914 | image: NativeImage,
|
7915 | |
7916 |
|
7917 |
|
7918 | scale: number,
|
7919 | |
7920 |
|
7921 |
|
7922 | size: Size,
|
7923 | |
7924 |
|
7925 |
|
7926 | hotspot: Point) => void): this;
|
7927 | addListener(event: 'cursor-changed', listener: (event: Event,
|
7928 | type: string,
|
7929 | image: NativeImage,
|
7930 | |
7931 |
|
7932 |
|
7933 | scale: number,
|
7934 | |
7935 |
|
7936 |
|
7937 | size: Size,
|
7938 | |
7939 |
|
7940 |
|
7941 | hotspot: Point) => void): this;
|
7942 | removeListener(event: 'cursor-changed', listener: (event: Event,
|
7943 | type: string,
|
7944 | image: NativeImage,
|
7945 | |
7946 |
|
7947 |
|
7948 | scale: number,
|
7949 | |
7950 |
|
7951 |
|
7952 | size: Size,
|
7953 | |
7954 |
|
7955 |
|
7956 | hotspot: Point) => void): this;
|
7957 | /**
|
7958 | * Emitted when `desktopCapturer.getSources()` is called in the renderer process.
|
7959 | * Calling `event.preventDefault()` will make it return empty sources.
|
7960 | */
|
7961 | on(event: 'desktop-capturer-get-sources', listener: (event: Event) => void): this;
|
7962 | once(event: 'desktop-capturer-get-sources', listener: (event: Event) => void): this;
|
7963 | addListener(event: 'desktop-capturer-get-sources', listener: (event: Event) => void): this;
|
7964 | removeListener(event: 'desktop-capturer-get-sources', listener: (event: Event) => void): this;
|
7965 | /**
|
7966 | * Emitted when `webContents` is destroyed.
|
7967 | */
|
7968 | on(event: 'destroyed', listener: Function): this;
|
7969 | once(event: 'destroyed', listener: Function): this;
|
7970 | addListener(event: 'destroyed', listener: Function): this;
|
7971 | removeListener(event: 'destroyed', listener: Function): this;
|
7972 | /**
|
7973 | * Emitted when DevTools is closed.
|
7974 | */
|
7975 | on(event: 'devtools-closed', listener: Function): this;
|
7976 | once(event: 'devtools-closed', listener: Function): this;
|
7977 | addListener(event: 'devtools-closed', listener: Function): this;
|
7978 | removeListener(event: 'devtools-closed', listener: Function): this;
|
7979 | /**
|
7980 | * Emitted when DevTools is focused / opened.
|
7981 | */
|
7982 | on(event: 'devtools-focused', listener: Function): this;
|
7983 | once(event: 'devtools-focused', listener: Function): this;
|
7984 | addListener(event: 'devtools-focused', listener: Function): this;
|
7985 | removeListener(event: 'devtools-focused', listener: Function): this;
|
7986 | /**
|
7987 | * Emitted when DevTools is opened.
|
7988 | */
|
7989 | on(event: 'devtools-opened', listener: Function): this;
|
7990 | once(event: 'devtools-opened', listener: Function): this;
|
7991 | addListener(event: 'devtools-opened', listener: Function): this;
|
7992 | removeListener(event: 'devtools-opened', listener: Function): this;
|
7993 | /**
|
7994 | * Emitted when the devtools window instructs the webContents to reload
|
7995 | */
|
7996 | on(event: 'devtools-reload-page', listener: Function): this;
|
7997 | once(event: 'devtools-reload-page', listener: Function): this;
|
7998 | addListener(event: 'devtools-reload-page', listener: Function): this;
|
7999 | removeListener(event: 'devtools-reload-page', listener: Function): this;
|
8000 | /**
|
8001 | * Emitted when a `<webview>` has been attached to this web contents.
|
8002 | */
|
8003 | on(event: 'did-attach-webview', listener: (event: Event,
|
8004 | |
8005 |
|
8006 |
|
8007 | webContents: WebContents) => void): this;
|
8008 | once(event: 'did-attach-webview', listener: (event: Event,
|
8009 | |
8010 |
|
8011 |
|
8012 | webContents: WebContents) => void): this;
|
8013 | addListener(event: 'did-attach-webview', listener: (event: Event,
|
8014 | |
8015 |
|
8016 |
|
8017 | webContents: WebContents) => void): this;
|
8018 | removeListener(event: 'did-attach-webview', listener: (event: Event,
|
8019 | |
8020 |
|
8021 |
|
8022 | webContents: WebContents) => void): this;
|
8023 | /**
|
8024 | * Emitted when a page's theme color changes. This is usually due to encountering a
|
8025 | * meta tag:
|
8026 | */
|
8027 | on(event: 'did-change-theme-color', listener: (event: Event,
|
8028 | |
8029 |
|
8030 |
|
8031 | color: (string) | (null)) => void): this;
|
8032 | once(event: 'did-change-theme-color', listener: (event: Event,
|
8033 | |
8034 |
|
8035 |
|
8036 | color: (string) | (null)) => void): this;
|
8037 | addListener(event: 'did-change-theme-color', listener: (event: Event,
|
8038 | |
8039 |
|
8040 |
|
8041 | color: (string) | (null)) => void): this;
|
8042 | removeListener(event: 'did-change-theme-color', listener: (event: Event,
|
8043 | |
8044 |
|
8045 |
|
8046 | color: (string) | (null)) => void): this;
|
8047 | /**
|
8048 | * This event is like `did-finish-load` but emitted when the load failed. The full
|
8049 | * list of error codes and their meaning is available here.
|
8050 | */
|
8051 | on(event: 'did-fail-load', listener: (event: Event,
|
8052 | errorCode: number,
|
8053 | errorDescription: string,
|
8054 | validatedURL: string,
|
8055 | isMainFrame: boolean,
|
8056 | frameProcessId: number,
|
8057 | frameRoutingId: number) => void): this;
|
8058 | once(event: 'did-fail-load', listener: (event: Event,
|
8059 | errorCode: number,
|
8060 | errorDescription: string,
|
8061 | validatedURL: string,
|
8062 | isMainFrame: boolean,
|
8063 | frameProcessId: number,
|
8064 | frameRoutingId: number) => void): this;
|
8065 | addListener(event: 'did-fail-load', listener: (event: Event,
|
8066 | errorCode: number,
|
8067 | errorDescription: string,
|
8068 | validatedURL: string,
|
8069 | isMainFrame: boolean,
|
8070 | frameProcessId: number,
|
8071 | frameRoutingId: number) => void): this;
|
8072 | removeListener(event: 'did-fail-load', listener: (event: Event,
|
8073 | errorCode: number,
|
8074 | errorDescription: string,
|
8075 | validatedURL: string,
|
8076 | isMainFrame: boolean,
|
8077 | frameProcessId: number,
|
8078 | frameRoutingId: number) => void): this;
|
8079 | /**
|
8080 | * This event is like `did-fail-load` but emitted when the load was cancelled (e.g.
|
8081 | * `window.stop()` was invoked).
|
8082 | */
|
8083 | on(event: 'did-fail-provisional-load', listener: (event: Event,
|
8084 | errorCode: number,
|
8085 | errorDescription: string,
|
8086 | validatedURL: string,
|
8087 | isMainFrame: boolean,
|
8088 | frameProcessId: number,
|
8089 | frameRoutingId: number) => void): this;
|
8090 | once(event: 'did-fail-provisional-load', listener: (event: Event,
|
8091 | errorCode: number,
|
8092 | errorDescription: string,
|
8093 | validatedURL: string,
|
8094 | isMainFrame: boolean,
|
8095 | frameProcessId: number,
|
8096 | frameRoutingId: number) => void): this;
|
8097 | addListener(event: 'did-fail-provisional-load', listener: (event: Event,
|
8098 | errorCode: number,
|
8099 | errorDescription: string,
|
8100 | validatedURL: string,
|
8101 | isMainFrame: boolean,
|
8102 | frameProcessId: number,
|
8103 | frameRoutingId: number) => void): this;
|
8104 | removeListener(event: 'did-fail-provisional-load', listener: (event: Event,
|
8105 | errorCode: number,
|
8106 | errorDescription: string,
|
8107 | validatedURL: string,
|
8108 | isMainFrame: boolean,
|
8109 | frameProcessId: number,
|
8110 | frameRoutingId: number) => void): this;
|
8111 | /**
|
8112 | * Emitted when the navigation is done, i.e. the spinner of the tab has stopped
|
8113 | * spinning, and the `onload` event was dispatched.
|
8114 | */
|
8115 | on(event: 'did-finish-load', listener: Function): this;
|
8116 | once(event: 'did-finish-load', listener: Function): this;
|
8117 | addListener(event: 'did-finish-load', listener: Function): this;
|
8118 | removeListener(event: 'did-finish-load', listener: Function): this;
|
8119 | /**
|
8120 | * Emitted when a frame has done navigation.
|
8121 | */
|
8122 | on(event: 'did-frame-finish-load', listener: (event: Event,
|
8123 | isMainFrame: boolean,
|
8124 | frameProcessId: number,
|
8125 | frameRoutingId: number) => void): this;
|
8126 | once(event: 'did-frame-finish-load', listener: (event: Event,
|
8127 | isMainFrame: boolean,
|
8128 | frameProcessId: number,
|
8129 | frameRoutingId: number) => void): this;
|
8130 | addListener(event: 'did-frame-finish-load', listener: (event: Event,
|
8131 | isMainFrame: boolean,
|
8132 | frameProcessId: number,
|
8133 | frameRoutingId: number) => void): this;
|
8134 | removeListener(event: 'did-frame-finish-load', listener: (event: Event,
|
8135 | isMainFrame: boolean,
|
8136 | frameProcessId: number,
|
8137 | frameRoutingId: number) => void): this;
|
8138 | /**
|
8139 | * Emitted when any frame navigation is done.
|
8140 | *
|
8141 | * This event is not emitted for in-page navigations, such as clicking anchor links
|
8142 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
8143 | * this purpose.
|
8144 | */
|
8145 | on(event: 'did-frame-navigate', listener: (event: Event,
|
8146 | url: string,
|
8147 | |
8148 |
|
8149 |
|
8150 | httpResponseCode: number,
|
8151 | |
8152 |
|
8153 |
|
8154 | httpStatusText: string,
|
8155 | isMainFrame: boolean,
|
8156 | frameProcessId: number,
|
8157 | frameRoutingId: number) => void): this;
|
8158 | once(event: 'did-frame-navigate', listener: (event: Event,
|
8159 | url: string,
|
8160 | |
8161 |
|
8162 |
|
8163 | httpResponseCode: number,
|
8164 | |
8165 |
|
8166 |
|
8167 | httpStatusText: string,
|
8168 | isMainFrame: boolean,
|
8169 | frameProcessId: number,
|
8170 | frameRoutingId: number) => void): this;
|
8171 | addListener(event: 'did-frame-navigate', listener: (event: Event,
|
8172 | url: string,
|
8173 | |
8174 |
|
8175 |
|
8176 | httpResponseCode: number,
|
8177 | |
8178 |
|
8179 |
|
8180 | httpStatusText: string,
|
8181 | isMainFrame: boolean,
|
8182 | frameProcessId: number,
|
8183 | frameRoutingId: number) => void): this;
|
8184 | removeListener(event: 'did-frame-navigate', listener: (event: Event,
|
8185 | url: string,
|
8186 | |
8187 |
|
8188 |
|
8189 | httpResponseCode: number,
|
8190 | |
8191 |
|
8192 |
|
8193 | httpStatusText: string,
|
8194 | isMainFrame: boolean,
|
8195 | frameProcessId: number,
|
8196 | frameRoutingId: number) => void): this;
|
8197 | /**
|
8198 | * Emitted when a main frame navigation is done.
|
8199 | *
|
8200 | * This event is not emitted for in-page navigations, such as clicking anchor links
|
8201 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
8202 | * this purpose.
|
8203 | */
|
8204 | on(event: 'did-navigate', listener: (event: Event,
|
8205 | url: string,
|
8206 | |
8207 |
|
8208 |
|
8209 | httpResponseCode: number,
|
8210 | |
8211 |
|
8212 |
|
8213 | httpStatusText: string) => void): this;
|
8214 | once(event: 'did-navigate', listener: (event: Event,
|
8215 | url: string,
|
8216 | |
8217 |
|
8218 |
|
8219 | httpResponseCode: number,
|
8220 | |
8221 |
|
8222 |
|
8223 | httpStatusText: string) => void): this;
|
8224 | addListener(event: 'did-navigate', listener: (event: Event,
|
8225 | url: string,
|
8226 | |
8227 |
|
8228 |
|
8229 | httpResponseCode: number,
|
8230 | |
8231 |
|
8232 |
|
8233 | httpStatusText: string) => void): this;
|
8234 | removeListener(event: 'did-navigate', listener: (event: Event,
|
8235 | url: string,
|
8236 | |
8237 |
|
8238 |
|
8239 | httpResponseCode: number,
|
8240 | |
8241 |
|
8242 |
|
8243 | httpStatusText: string) => void): this;
|
8244 | /**
|
8245 | * Emitted when an in-page navigation happened in any frame.
|
8246 | *
|
8247 | * When in-page navigation happens, the page URL changes but does not cause
|
8248 | * navigation outside of the page. Examples of this occurring are when anchor links
|
8249 | * are clicked or when the DOM `hashchange` event is triggered.
|
8250 | */
|
8251 | on(event: 'did-navigate-in-page', listener: (event: Event,
|
8252 | url: string,
|
8253 | isMainFrame: boolean,
|
8254 | frameProcessId: number,
|
8255 | frameRoutingId: number) => void): this;
|
8256 | once(event: 'did-navigate-in-page', listener: (event: Event,
|
8257 | url: string,
|
8258 | isMainFrame: boolean,
|
8259 | frameProcessId: number,
|
8260 | frameRoutingId: number) => void): this;
|
8261 | addListener(event: 'did-navigate-in-page', listener: (event: Event,
|
8262 | url: string,
|
8263 | isMainFrame: boolean,
|
8264 | frameProcessId: number,
|
8265 | frameRoutingId: number) => void): this;
|
8266 | removeListener(event: 'did-navigate-in-page', listener: (event: Event,
|
8267 | url: string,
|
8268 | isMainFrame: boolean,
|
8269 | frameProcessId: number,
|
8270 | frameRoutingId: number) => void): this;
|
8271 | /**
|
8272 | * Emitted after a server side redirect occurs during navigation. For example a
|
8273 | * 302 redirect.
|
8274 | *
|
8275 | * This event can not be prevented, if you want to prevent redirects you should
|
8276 | * checkout out the `will-redirect` event above.
|
8277 | */
|
8278 | on(event: 'did-redirect-navigation', listener: (event: Event,
|
8279 | url: string,
|
8280 | isInPlace: boolean,
|
8281 | isMainFrame: boolean,
|
8282 | frameProcessId: number,
|
8283 | frameRoutingId: number) => void): this;
|
8284 | once(event: 'did-redirect-navigation', listener: (event: Event,
|
8285 | url: string,
|
8286 | isInPlace: boolean,
|
8287 | isMainFrame: boolean,
|
8288 | frameProcessId: number,
|
8289 | frameRoutingId: number) => void): this;
|
8290 | addListener(event: 'did-redirect-navigation', listener: (event: Event,
|
8291 | url: string,
|
8292 | isInPlace: boolean,
|
8293 | isMainFrame: boolean,
|
8294 | frameProcessId: number,
|
8295 | frameRoutingId: number) => void): this;
|
8296 | removeListener(event: 'did-redirect-navigation', listener: (event: Event,
|
8297 | url: string,
|
8298 | isInPlace: boolean,
|
8299 | isMainFrame: boolean,
|
8300 | frameProcessId: number,
|
8301 | frameRoutingId: number) => void): this;
|
8302 | /**
|
8303 | * Corresponds to the points in time when the spinner of the tab started spinning.
|
8304 | */
|
8305 | on(event: 'did-start-loading', listener: Function): this;
|
8306 | once(event: 'did-start-loading', listener: Function): this;
|
8307 | addListener(event: 'did-start-loading', listener: Function): this;
|
8308 | removeListener(event: 'did-start-loading', listener: Function): this;
|
8309 | /**
|
8310 | * Emitted when any frame (including main) starts navigating. `isInplace` will be
|
8311 | * `true` for in-page navigations.
|
8312 | */
|
8313 | on(event: 'did-start-navigation', listener: (event: Event,
|
8314 | url: string,
|
8315 | isInPlace: boolean,
|
8316 | isMainFrame: boolean,
|
8317 | frameProcessId: number,
|
8318 | frameRoutingId: number) => void): this;
|
8319 | once(event: 'did-start-navigation', listener: (event: Event,
|
8320 | url: string,
|
8321 | isInPlace: boolean,
|
8322 | isMainFrame: boolean,
|
8323 | frameProcessId: number,
|
8324 | frameRoutingId: number) => void): this;
|
8325 | addListener(event: 'did-start-navigation', listener: (event: Event,
|
8326 | url: string,
|
8327 | isInPlace: boolean,
|
8328 | isMainFrame: boolean,
|
8329 | frameProcessId: number,
|
8330 | frameRoutingId: number) => void): this;
|
8331 | removeListener(event: 'did-start-navigation', listener: (event: Event,
|
8332 | url: string,
|
8333 | isInPlace: boolean,
|
8334 | isMainFrame: boolean,
|
8335 | frameProcessId: number,
|
8336 | frameRoutingId: number) => void): this;
|
8337 | /**
|
8338 | * Corresponds to the points in time when the spinner of the tab stopped spinning.
|
8339 | */
|
8340 | on(event: 'did-stop-loading', listener: Function): this;
|
8341 | once(event: 'did-stop-loading', listener: Function): this;
|
8342 | addListener(event: 'did-stop-loading', listener: Function): this;
|
8343 | removeListener(event: 'did-stop-loading', listener: Function): this;
|
8344 | /**
|
8345 | * Emitted when the document in the given frame is loaded.
|
8346 | */
|
8347 | on(event: 'dom-ready', listener: (event: Event) => void): this;
|
8348 | once(event: 'dom-ready', listener: (event: Event) => void): this;
|
8349 | addListener(event: 'dom-ready', listener: (event: Event) => void): this;
|
8350 | removeListener(event: 'dom-ready', listener: (event: Event) => void): this;
|
8351 | /**
|
8352 | * Emitted when the window enters a full-screen state triggered by HTML API.
|
8353 | */
|
8354 | on(event: 'enter-html-full-screen', listener: Function): this;
|
8355 | once(event: 'enter-html-full-screen', listener: Function): this;
|
8356 | addListener(event: 'enter-html-full-screen', listener: Function): this;
|
8357 | removeListener(event: 'enter-html-full-screen', listener: Function): this;
|
8358 | /**
|
8359 | * Emitted when a result is available for [`webContents.findInPage`] request.
|
8360 | */
|
8361 | on(event: 'found-in-page', listener: (event: Event,
|
8362 | result: Result) => void): this;
|
8363 | once(event: 'found-in-page', listener: (event: Event,
|
8364 | result: Result) => void): this;
|
8365 | addListener(event: 'found-in-page', listener: (event: Event,
|
8366 | result: Result) => void): this;
|
8367 | removeListener(event: 'found-in-page', listener: (event: Event,
|
8368 | result: Result) => void): this;
|
8369 | /**
|
8370 | * Emitted when the renderer process sends an asynchronous message via
|
8371 | * `ipcRenderer.send()`.
|
8372 | */
|
8373 | on(event: 'ipc-message', listener: (event: Event,
|
8374 | channel: string,
|
8375 | ...args: any[]) => void): this;
|
8376 | once(event: 'ipc-message', listener: (event: Event,
|
8377 | channel: string,
|
8378 | ...args: any[]) => void): this;
|
8379 | addListener(event: 'ipc-message', listener: (event: Event,
|
8380 | channel: string,
|
8381 | ...args: any[]) => void): this;
|
8382 | removeListener(event: 'ipc-message', listener: (event: Event,
|
8383 | channel: string,
|
8384 | ...args: any[]) => void): this;
|
8385 | /**
|
8386 | * Emitted when the renderer process sends a synchronous message via
|
8387 | * `ipcRenderer.sendSync()`.
|
8388 | */
|
8389 | on(event: 'ipc-message-sync', listener: (event: Event,
|
8390 | channel: string,
|
8391 | ...args: any[]) => void): this;
|
8392 | once(event: 'ipc-message-sync', listener: (event: Event,
|
8393 | channel: string,
|
8394 | ...args: any[]) => void): this;
|
8395 | addListener(event: 'ipc-message-sync', listener: (event: Event,
|
8396 | channel: string,
|
8397 | ...args: any[]) => void): this;
|
8398 | removeListener(event: 'ipc-message-sync', listener: (event: Event,
|
8399 | channel: string,
|
8400 | ...args: any[]) => void): this;
|
8401 | /**
|
8402 | * Emitted when the window leaves a full-screen state triggered by HTML API.
|
8403 | */
|
8404 | on(event: 'leave-html-full-screen', listener: Function): this;
|
8405 | once(event: 'leave-html-full-screen', listener: Function): this;
|
8406 | addListener(event: 'leave-html-full-screen', listener: Function): this;
|
8407 | removeListener(event: 'leave-html-full-screen', listener: Function): this;
|
8408 | /**
|
8409 | * Emitted when `webContents` wants to do basic auth.
|
8410 | *
|
8411 | The usage is the same with the `login` event of `app`.
|
8412 | */
|
8413 | on(event: 'login', listener: (event: Event,
|
8414 | authenticationResponseDetails: AuthenticationResponseDetails,
|
8415 | authInfo: AuthInfo,
|
8416 | callback: (username?: string, password?: string) => void) => void): this;
|
8417 | once(event: 'login', listener: (event: Event,
|
8418 | authenticationResponseDetails: AuthenticationResponseDetails,
|
8419 | authInfo: AuthInfo,
|
8420 | callback: (username?: string, password?: string) => void) => void): this;
|
8421 | addListener(event: 'login', listener: (event: Event,
|
8422 | authenticationResponseDetails: AuthenticationResponseDetails,
|
8423 | authInfo: AuthInfo,
|
8424 | callback: (username?: string, password?: string) => void) => void): this;
|
8425 | removeListener(event: 'login', listener: (event: Event,
|
8426 | authenticationResponseDetails: AuthenticationResponseDetails,
|
8427 | authInfo: AuthInfo,
|
8428 | callback: (username?: string, password?: string) => void) => void): this;
|
8429 | /**
|
8430 | * Emitted when media is paused or done playing.
|
8431 | */
|
8432 | on(event: 'media-paused', listener: Function): this;
|
8433 | once(event: 'media-paused', listener: Function): this;
|
8434 | addListener(event: 'media-paused', listener: Function): this;
|
8435 | removeListener(event: 'media-paused', listener: Function): this;
|
8436 | /**
|
8437 | * Emitted when media starts playing.
|
8438 | */
|
8439 | on(event: 'media-started-playing', listener: Function): this;
|
8440 | once(event: 'media-started-playing', listener: Function): this;
|
8441 | addListener(event: 'media-started-playing', listener: Function): this;
|
8442 | removeListener(event: 'media-started-playing', listener: Function): this;
|
8443 | /**
|
8444 | * Emitted when the page requests to open a new window for a `url`. It could be
|
8445 | * requested by `window.open` or an external link like `<a target='_blank'>`.
|
8446 | *
|
8447 | * By default a new `BrowserWindow` will be created for the `url`.
|
8448 | *
|
8449 | * Calling `event.preventDefault()` will prevent Electron from automatically
|
8450 | * creating a new `BrowserWindow`. If you call `event.preventDefault()` and
|
8451 | * manually create a new `BrowserWindow` then you must set `event.newGuest` to
|
8452 | * reference the new `BrowserWindow` instance, failing to do so may result in
|
8453 | * unexpected behavior. For example:
|
8454 | */
|
8455 | on(event: 'new-window', listener: (event: Event,
|
8456 | url: string,
|
8457 | frameName: string,
|
8458 | |
8459 |
|
8460 |
|
8461 |
|
8462 | disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
|
8463 | |
8464 |
|
8465 |
|
8466 | options: BrowserWindowConstructorOptions,
|
8467 | |
8468 |
|
8469 |
|
8470 |
|
8471 | additionalFeatures: string[],
|
8472 | |
8473 |
|
8474 |
|
8475 |
|
8476 | referrer: Referrer) => void): this;
|
8477 | once(event: 'new-window', listener: (event: Event,
|
8478 | url: string,
|
8479 | frameName: string,
|
8480 | |
8481 |
|
8482 |
|
8483 |
|
8484 | disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
|
8485 | |
8486 |
|
8487 |
|
8488 | options: BrowserWindowConstructorOptions,
|
8489 | |
8490 |
|
8491 |
|
8492 |
|
8493 | additionalFeatures: string[],
|
8494 | |
8495 |
|
8496 |
|
8497 |
|
8498 | referrer: Referrer) => void): this;
|
8499 | addListener(event: 'new-window', listener: (event: Event,
|
8500 | url: string,
|
8501 | frameName: string,
|
8502 | |
8503 |
|
8504 |
|
8505 |
|
8506 | disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
|
8507 | |
8508 |
|
8509 |
|
8510 | options: BrowserWindowConstructorOptions,
|
8511 | |
8512 |
|
8513 |
|
8514 |
|
8515 | additionalFeatures: string[],
|
8516 | |
8517 |
|
8518 |
|
8519 |
|
8520 | referrer: Referrer) => void): this;
|
8521 | removeListener(event: 'new-window', listener: (event: Event,
|
8522 | url: string,
|
8523 | frameName: string,
|
8524 | |
8525 |
|
8526 |
|
8527 |
|
8528 | disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
|
8529 | |
8530 |
|
8531 |
|
8532 | options: BrowserWindowConstructorOptions,
|
8533 | |
8534 |
|
8535 |
|
8536 |
|
8537 | additionalFeatures: string[],
|
8538 | |
8539 |
|
8540 |
|
8541 |
|
8542 | referrer: Referrer) => void): this;
|
8543 | /**
|
8544 | * Emitted when page receives favicon urls.
|
8545 | */
|
8546 | on(event: 'page-favicon-updated', listener: (event: Event,
|
8547 | |
8548 |
|
8549 |
|
8550 | favicons: string[]) => void): this;
|
8551 | once(event: 'page-favicon-updated', listener: (event: Event,
|
8552 | |
8553 |
|
8554 |
|
8555 | favicons: string[]) => void): this;
|
8556 | addListener(event: 'page-favicon-updated', listener: (event: Event,
|
8557 | |
8558 |
|
8559 |
|
8560 | favicons: string[]) => void): this;
|
8561 | removeListener(event: 'page-favicon-updated', listener: (event: Event,
|
8562 | |
8563 |
|
8564 |
|
8565 | favicons: string[]) => void): this;
|
8566 | /**
|
8567 | * Fired when page title is set during navigation. `explicitSet` is false when
|
8568 | * title is synthesized from file url.
|
8569 | */
|
8570 | on(event: 'page-title-updated', listener: (event: Event,
|
8571 | title: string,
|
8572 | explicitSet: boolean) => void): this;
|
8573 | once(event: 'page-title-updated', listener: (event: Event,
|
8574 | title: string,
|
8575 | explicitSet: boolean) => void): this;
|
8576 | addListener(event: 'page-title-updated', listener: (event: Event,
|
8577 | title: string,
|
8578 | explicitSet: boolean) => void): this;
|
8579 | removeListener(event: 'page-title-updated', listener: (event: Event,
|
8580 | title: string,
|
8581 | explicitSet: boolean) => void): this;
|
8582 | /**
|
8583 | * Emitted when a new frame is generated. Only the dirty area is passed in the
|
8584 | * buffer.
|
8585 | */
|
8586 | on(event: 'paint', listener: (event: Event,
|
8587 | dirtyRect: Rectangle,
|
8588 | |
8589 |
|
8590 |
|
8591 | image: NativeImage) => void): this;
|
8592 | once(event: 'paint', listener: (event: Event,
|
8593 | dirtyRect: Rectangle,
|
8594 | |
8595 |
|
8596 |
|
8597 | image: NativeImage) => void): this;
|
8598 | addListener(event: 'paint', listener: (event: Event,
|
8599 | dirtyRect: Rectangle,
|
8600 | |
8601 |
|
8602 |
|
8603 | image: NativeImage) => void): this;
|
8604 | removeListener(event: 'paint', listener: (event: Event,
|
8605 | dirtyRect: Rectangle,
|
8606 | |
8607 |
|
8608 |
|
8609 | image: NativeImage) => void): this;
|
8610 | /**
|
8611 | * Emitted when a plugin process has crashed.
|
8612 | */
|
8613 | on(event: 'plugin-crashed', listener: (event: Event,
|
8614 | name: string,
|
8615 | version: string) => void): this;
|
8616 | once(event: 'plugin-crashed', listener: (event: Event,
|
8617 | name: string,
|
8618 | version: string) => void): this;
|
8619 | addListener(event: 'plugin-crashed', listener: (event: Event,
|
8620 | name: string,
|
8621 | version: string) => void): this;
|
8622 | removeListener(event: 'plugin-crashed', listener: (event: Event,
|
8623 | name: string,
|
8624 | version: string) => void): this;
|
8625 | /**
|
8626 | * Emitted when the preload script `preloadPath` throws an unhandled exception
|
8627 | * `error`.
|
8628 | */
|
8629 | on(event: 'preload-error', listener: (event: Event,
|
8630 | preloadPath: string,
|
8631 | error: Error) => void): this;
|
8632 | once(event: 'preload-error', listener: (event: Event,
|
8633 | preloadPath: string,
|
8634 | error: Error) => void): this;
|
8635 | addListener(event: 'preload-error', listener: (event: Event,
|
8636 | preloadPath: string,
|
8637 | error: Error) => void): this;
|
8638 | removeListener(event: 'preload-error', listener: (event: Event,
|
8639 | preloadPath: string,
|
8640 | error: Error) => void): this;
|
8641 | /**
|
8642 | * Emitted when `remote.getBuiltin()` is called in the renderer process. Calling
|
8643 | * `event.preventDefault()` will prevent the module from being returned. Custom
|
8644 | * value can be returned by setting `event.returnValue`.
|
8645 | */
|
8646 | on(event: 'remote-get-builtin', listener: (event: IpcMainEvent,
|
8647 | moduleName: string) => void): this;
|
8648 | once(event: 'remote-get-builtin', listener: (event: IpcMainEvent,
|
8649 | moduleName: string) => void): this;
|
8650 | addListener(event: 'remote-get-builtin', listener: (event: IpcMainEvent,
|
8651 | moduleName: string) => void): this;
|
8652 | removeListener(event: 'remote-get-builtin', listener: (event: IpcMainEvent,
|
8653 | moduleName: string) => void): this;
|
8654 | /**
|
8655 | * Emitted when `remote.getCurrentWebContents()` is called in the renderer process.
|
8656 | * Calling `event.preventDefault()` will prevent the object from being returned.
|
8657 | * Custom value can be returned by setting `event.returnValue`.
|
8658 | */
|
8659 | on(event: 'remote-get-current-web-contents', listener: (event: IpcMainEvent) => void): this;
|
8660 | once(event: 'remote-get-current-web-contents', listener: (event: IpcMainEvent) => void): this;
|
8661 | addListener(event: 'remote-get-current-web-contents', listener: (event: IpcMainEvent) => void): this;
|
8662 | removeListener(event: 'remote-get-current-web-contents', listener: (event: IpcMainEvent) => void): this;
|
8663 | /**
|
8664 | * Emitted when `remote.getCurrentWindow()` is called in the renderer process.
|
8665 | * Calling `event.preventDefault()` will prevent the object from being returned.
|
8666 | * Custom value can be returned by setting `event.returnValue`.
|
8667 | */
|
8668 | on(event: 'remote-get-current-window', listener: (event: IpcMainEvent) => void): this;
|
8669 | once(event: 'remote-get-current-window', listener: (event: IpcMainEvent) => void): this;
|
8670 | addListener(event: 'remote-get-current-window', listener: (event: IpcMainEvent) => void): this;
|
8671 | removeListener(event: 'remote-get-current-window', listener: (event: IpcMainEvent) => void): this;
|
8672 | /**
|
8673 | * Emitted when `remote.getGlobal()` is called in the renderer process. Calling
|
8674 | * `event.preventDefault()` will prevent the global from being returned. Custom
|
8675 | * value can be returned by setting `event.returnValue`.
|
8676 | */
|
8677 | on(event: 'remote-get-global', listener: (event: IpcMainEvent,
|
8678 | globalName: string) => void): this;
|
8679 | once(event: 'remote-get-global', listener: (event: IpcMainEvent,
|
8680 | globalName: string) => void): this;
|
8681 | addListener(event: 'remote-get-global', listener: (event: IpcMainEvent,
|
8682 | globalName: string) => void): this;
|
8683 | removeListener(event: 'remote-get-global', listener: (event: IpcMainEvent,
|
8684 | globalName: string) => void): this;
|
8685 | /**
|
8686 | * Emitted when `<webview>.getWebContents()` is called in the renderer process.
|
8687 | * Calling `event.preventDefault()` will prevent the object from being returned.
|
8688 | * Custom value can be returned by setting `event.returnValue`.
|
8689 | */
|
8690 | on(event: 'remote-get-guest-web-contents', listener: (event: IpcMainEvent,
|
8691 | guestWebContents: WebContents) => void): this;
|
8692 | once(event: 'remote-get-guest-web-contents', listener: (event: IpcMainEvent,
|
8693 | guestWebContents: WebContents) => void): this;
|
8694 | addListener(event: 'remote-get-guest-web-contents', listener: (event: IpcMainEvent,
|
8695 | guestWebContents: WebContents) => void): this;
|
8696 | removeListener(event: 'remote-get-guest-web-contents', listener: (event: IpcMainEvent,
|
8697 | guestWebContents: WebContents) => void): this;
|
8698 | /**
|
8699 | * Emitted when `remote.require()` is called in the renderer process. Calling
|
8700 | * `event.preventDefault()` will prevent the module from being returned. Custom
|
8701 | * value can be returned by setting `event.returnValue`.
|
8702 | */
|
8703 | on(event: 'remote-require', listener: (event: IpcMainEvent,
|
8704 | moduleName: string) => void): this;
|
8705 | once(event: 'remote-require', listener: (event: IpcMainEvent,
|
8706 | moduleName: string) => void): this;
|
8707 | addListener(event: 'remote-require', listener: (event: IpcMainEvent,
|
8708 | moduleName: string) => void): this;
|
8709 | removeListener(event: 'remote-require', listener: (event: IpcMainEvent,
|
8710 | moduleName: string) => void): this;
|
8711 | /**
|
8712 | * Emitted when the unresponsive web page becomes responsive again.
|
8713 | */
|
8714 | on(event: 'responsive', listener: Function): this;
|
8715 | once(event: 'responsive', listener: Function): this;
|
8716 | addListener(event: 'responsive', listener: Function): this;
|
8717 | removeListener(event: 'responsive', listener: Function): this;
|
8718 | /**
|
8719 | * Emitted when bluetooth device needs to be selected on call to
|
8720 | * `navigator.bluetooth.requestDevice`. To use `navigator.bluetooth` api
|
8721 | * `webBluetooth` should be enabled. If `event.preventDefault` is not called, first
|
8722 | * available device will be selected. `callback` should be called with `deviceId`
|
8723 | * to be selected, passing empty string to `callback` will cancel the request.
|
8724 | */
|
8725 | on(event: 'select-bluetooth-device', listener: (event: Event,
|
8726 | devices: BluetoothDevice[],
|
8727 | callback: (deviceId: string) => void) => void): this;
|
8728 | once(event: 'select-bluetooth-device', listener: (event: Event,
|
8729 | devices: BluetoothDevice[],
|
8730 | callback: (deviceId: string) => void) => void): this;
|
8731 | addListener(event: 'select-bluetooth-device', listener: (event: Event,
|
8732 | devices: BluetoothDevice[],
|
8733 | callback: (deviceId: string) => void) => void): this;
|
8734 | removeListener(event: 'select-bluetooth-device', listener: (event: Event,
|
8735 | devices: BluetoothDevice[],
|
8736 | callback: (deviceId: string) => void) => void): this;
|
8737 | /**
|
8738 | * Emitted when a client certificate is requested.
|
8739 | *
|
8740 | The usage is the same with the `select-client-certificate` event of `app`.
|
8741 | */
|
8742 | on(event: 'select-client-certificate', listener: (event: Event,
|
8743 | url: string,
|
8744 | certificateList: Certificate[],
|
8745 | callback: (certificate: Certificate) => void) => void): this;
|
8746 | once(event: 'select-client-certificate', listener: (event: Event,
|
8747 | url: string,
|
8748 | certificateList: Certificate[],
|
8749 | callback: (certificate: Certificate) => void) => void): this;
|
8750 | addListener(event: 'select-client-certificate', listener: (event: Event,
|
8751 | url: string,
|
8752 | certificateList: Certificate[],
|
8753 | callback: (certificate: Certificate) => void) => void): this;
|
8754 | removeListener(event: 'select-client-certificate', listener: (event: Event,
|
8755 | url: string,
|
8756 | certificateList: Certificate[],
|
8757 | callback: (certificate: Certificate) => void) => void): this;
|
8758 | /**
|
8759 | * Emitted when the web page becomes unresponsive.
|
8760 | */
|
8761 | on(event: 'unresponsive', listener: Function): this;
|
8762 | once(event: 'unresponsive', listener: Function): this;
|
8763 | addListener(event: 'unresponsive', listener: Function): this;
|
8764 | removeListener(event: 'unresponsive', listener: Function): this;
|
8765 | /**
|
8766 | * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
|
8767 | */
|
8768 | on(event: 'update-target-url', listener: (event: Event,
|
8769 | url: string) => void): this;
|
8770 | once(event: 'update-target-url', listener: (event: Event,
|
8771 | url: string) => void): this;
|
8772 | addListener(event: 'update-target-url', listener: (event: Event,
|
8773 | url: string) => void): this;
|
8774 | removeListener(event: 'update-target-url', listener: (event: Event,
|
8775 | url: string) => void): this;
|
8776 | /**
|
8777 | * Emitted when a `<webview>`'s web contents is being attached to this web
|
8778 | * contents. Calling `event.preventDefault()` will destroy the guest page.
|
8779 | *
|
8780 | * This event can be used to configure `webPreferences` for the `webContents` of a
|
8781 | * `<webview>` before it's loaded, and provides the ability to set settings that
|
8782 | * can't be set via `<webview>` attributes.
|
8783 | *
|
8784 | * **Note:** The specified `preload` script option will be appear as `preloadURL`
|
8785 | * (not `preload`) in the `webPreferences` object emitted with this event.
|
8786 | */
|
8787 | on(event: 'will-attach-webview', listener: (event: Event,
|
8788 | |
8789 |
|
8790 |
|
8791 |
|
8792 | webPreferences: WebPreferences,
|
8793 | |
8794 |
|
8795 |
|
8796 |
|
8797 | params: Record<string, string>) => void): this;
|
8798 | once(event: 'will-attach-webview', listener: (event: Event,
|
8799 | |
8800 |
|
8801 |
|
8802 |
|
8803 | webPreferences: WebPreferences,
|
8804 | |
8805 |
|
8806 |
|
8807 |
|
8808 | params: Record<string, string>) => void): this;
|
8809 | addListener(event: 'will-attach-webview', listener: (event: Event,
|
8810 | |
8811 |
|
8812 |
|
8813 |
|
8814 | webPreferences: WebPreferences,
|
8815 | |
8816 |
|
8817 |
|
8818 |
|
8819 | params: Record<string, string>) => void): this;
|
8820 | removeListener(event: 'will-attach-webview', listener: (event: Event,
|
8821 | |
8822 |
|
8823 |
|
8824 |
|
8825 | webPreferences: WebPreferences,
|
8826 | |
8827 |
|
8828 |
|
8829 |
|
8830 | params: Record<string, string>) => void): this;
|
8831 | /**
|
8832 | * Emitted when a user or the page wants to start navigation. It can happen when
|
8833 | * the `window.location` object is changed or a user clicks a link in the page.
|
8834 | *
|
8835 | * This event will not emit when the navigation is started programmatically with
|
8836 | * APIs like `webContents.loadURL` and `webContents.back`.
|
8837 | *
|
8838 | * It is also not emitted for in-page navigations, such as clicking anchor links or
|
8839 | * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
|
8840 | * purpose.
|
8841 |
|
8842 | Calling `event.preventDefault()` will prevent the navigation.
|
8843 | */
|
8844 | on(event: 'will-navigate', listener: (event: Event,
|
8845 | url: string) => void): this;
|
8846 | once(event: 'will-navigate', listener: (event: Event,
|
8847 | url: string) => void): this;
|
8848 | addListener(event: 'will-navigate', listener: (event: Event,
|
8849 | url: string) => void): this;
|
8850 | removeListener(event: 'will-navigate', listener: (event: Event,
|
8851 | url: string) => void): this;
|
8852 | /**
|
8853 | * Emitted when a `beforeunload` event handler is attempting to cancel a page
|
8854 | * unload.
|
8855 | *
|
8856 | * Calling `event.preventDefault()` will ignore the `beforeunload` event handler
|
8857 | * and allow the page to be unloaded.
|
8858 | */
|
8859 | on(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
8860 | once(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
8861 | addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
8862 | removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
8863 | /**
|
8864 | * Emitted as a server side redirect occurs during navigation. For example a 302
|
8865 | * redirect.
|
8866 | *
|
8867 | * This event will be emitted after `did-start-navigation` and always before the
|
8868 | * `did-redirect-navigation` event for the same navigation.
|
8869 | *
|
8870 | * Calling `event.preventDefault()` will prevent the navigation (not just the
|
8871 | * redirect).
|
8872 | */
|
8873 | on(event: 'will-redirect', listener: (event: Event,
|
8874 | url: string,
|
8875 | isInPlace: boolean,
|
8876 | isMainFrame: boolean,
|
8877 | frameProcessId: number,
|
8878 | frameRoutingId: number) => void): this;
|
8879 | once(event: 'will-redirect', listener: (event: Event,
|
8880 | url: string,
|
8881 | isInPlace: boolean,
|
8882 | isMainFrame: boolean,
|
8883 | frameProcessId: number,
|
8884 | frameRoutingId: number) => void): this;
|
8885 | addListener(event: 'will-redirect', listener: (event: Event,
|
8886 | url: string,
|
8887 | isInPlace: boolean,
|
8888 | isMainFrame: boolean,
|
8889 | frameProcessId: number,
|
8890 | frameRoutingId: number) => void): this;
|
8891 | removeListener(event: 'will-redirect', listener: (event: Event,
|
8892 | url: string,
|
8893 | isInPlace: boolean,
|
8894 | isMainFrame: boolean,
|
8895 | frameProcessId: number,
|
8896 | frameRoutingId: number) => void): this;
|
8897 | /**
|
8898 | * Emitted when the user is requesting to change the zoom level using the mouse
|
8899 | * wheel.
|
8900 | */
|
8901 | on(event: 'zoom-changed', listener: (event: Event,
|
8902 | |
8903 |
|
8904 |
|
8905 | zoomDirection: ('in' | 'out')) => void): this;
|
8906 | once(event: 'zoom-changed', listener: (event: Event,
|
8907 | |
8908 |
|
8909 |
|
8910 | zoomDirection: ('in' | 'out')) => void): this;
|
8911 | addListener(event: 'zoom-changed', listener: (event: Event,
|
8912 | |
8913 |
|
8914 |
|
8915 | zoomDirection: ('in' | 'out')) => void): this;
|
8916 | removeListener(event: 'zoom-changed', listener: (event: Event,
|
8917 | |
8918 |
|
8919 |
|
8920 | zoomDirection: ('in' | 'out')) => void): this;
|
8921 | /**
|
8922 | * Adds the specified path to DevTools workspace. Must be used after DevTools
|
8923 | * creation:
|
8924 | */
|
8925 | addWorkSpace(path: string): void;
|
8926 | /**
|
8927 | * Begin subscribing for presentation events and captured frames, the `callback`
|
8928 | * will be called with `callback(image, dirtyRect)` when there is a presentation
|
8929 | * event.
|
8930 | *
|
8931 | * The `image` is an instance of NativeImage that stores the captured frame.
|
8932 | *
|
8933 | * The `dirtyRect` is an object with `x, y, width, height` properties that
|
8934 | * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
|
8935 | * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
|
8936 | */
|
8937 | beginFrameSubscription(callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
|
8938 | /**
|
8939 | * Begin subscribing for presentation events and captured frames, the `callback`
|
8940 | * will be called with `callback(image, dirtyRect)` when there is a presentation
|
8941 | * event.
|
8942 | *
|
8943 | * The `image` is an instance of NativeImage that stores the captured frame.
|
8944 | *
|
8945 | * The `dirtyRect` is an object with `x, y, width, height` properties that
|
8946 | * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
|
8947 | * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
|
8948 | */
|
8949 | beginFrameSubscription(onlyDirty: boolean, callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
|
8950 | /**
|
8951 | * Whether the browser can go back to previous web page.
|
8952 | */
|
8953 | canGoBack(): boolean;
|
8954 | /**
|
8955 | * Whether the browser can go forward to next web page.
|
8956 | */
|
8957 | canGoForward(): boolean;
|
8958 | /**
|
8959 | * Whether the web page can go to `offset`.
|
8960 | */
|
8961 | canGoToOffset(offset: number): boolean;
|
8962 | /**
|
8963 | * Resolves with a NativeImage
|
8964 | *
|
8965 | * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
8966 | * whole visible page.
|
8967 | */
|
8968 | capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
|
8969 | /**
|
8970 | * Clears the navigation history.
|
8971 | */
|
8972 | clearHistory(): void;
|
8973 | /**
|
8974 | * Closes the devtools.
|
8975 | */
|
8976 | closeDevTools(): void;
|
8977 | /**
|
8978 | * Executes the editing command `copy` in web page.
|
8979 | */
|
8980 | copy(): void;
|
8981 | /**
|
8982 | * Copy the image at the given position to the clipboard.
|
8983 | */
|
8984 | copyImageAt(x: number, y: number): void;
|
8985 | /**
|
8986 | * Executes the editing command `cut` in web page.
|
8987 | */
|
8988 | cut(): void;
|
8989 | /**
|
8990 | * Executes the editing command `delete` in web page.
|
8991 | */
|
8992 | delete(): void;
|
8993 | /**
|
8994 | * Disable device emulation enabled by `webContents.enableDeviceEmulation`.
|
8995 | */
|
8996 | disableDeviceEmulation(): void;
|
8997 | /**
|
8998 | * Initiates a download of the resource at `url` without navigating. The
|
8999 | * `will-download` event of `session` will be triggered.
|
9000 | */
|
9001 | downloadURL(url: string): void;
|
9002 | /**
|
9003 | * Enable device emulation with the given parameters.
|
9004 | */
|
9005 | enableDeviceEmulation(parameters: Parameters): void;
|
9006 | /**
|
9007 | * End subscribing for frame presentation events.
|
9008 | */
|
9009 | endFrameSubscription(): void;
|
9010 | /**
|
9011 | * A promise that resolves with the result of the executed code or is rejected if
|
9012 | * the result of the code is a rejected promise.
|
9013 | *
|
9014 | * Evaluates `code` in page.
|
9015 | *
|
9016 | * In the browser window some HTML APIs like `requestFullScreen` can only be
|
9017 | * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
|
9018 | * this limitation.
|
9019 |
|
9020 | Code execution will be suspended until web page stop loading.
|
9021 | */
|
9022 | executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
|
9023 | /**
|
9024 | * The request id used for the request.
|
9025 | *
|
9026 | * Starts a request to find all matches for the `text` in the web page. The result
|
9027 | * of the request can be obtained by subscribing to `found-in-page` event.
|
9028 | */
|
9029 | findInPage(text: string, options?: FindInPageOptions): number;
|
9030 | /**
|
9031 | * Focuses the web page.
|
9032 | */
|
9033 | focus(): void;
|
9034 | /**
|
9035 | * If *offscreen rendering* is enabled returns the current frame rate.
|
9036 | *
|
9037 | **Deprecated**
|
9038 | */
|
9039 | getFrameRate(): number;
|
9040 | /**
|
9041 | * The operating system `pid` of the associated renderer process.
|
9042 | */
|
9043 | getOSProcessId(): number;
|
9044 | /**
|
9045 | * Get the system printer list.
|
9046 | */
|
9047 | getPrinters(): PrinterInfo[];
|
9048 | /**
|
9049 | * The Chromium internal `pid` of the associated renderer. Can be compared to the
|
9050 | * `frameProcessId` passed by frame specific navigation events (e.g.
|
9051 | * `did-frame-navigate`)
|
9052 | */
|
9053 | getProcessId(): number;
|
9054 | /**
|
9055 | * The title of the current web page.
|
9056 | */
|
9057 | getTitle(): string;
|
9058 | /**
|
9059 | * the type of the webContent. Can be `backgroundPage`, `window`, `browserView`,
|
9060 | * `remote`, `webview` or `offscreen`.
|
9061 | */
|
9062 | getType(): ('backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen');
|
9063 | /**
|
9064 | * The URL of the current web page.
|
9065 | */
|
9066 | getURL(): string;
|
9067 | /**
|
9068 | * The user agent for this web page.
|
9069 |
|
9070 | **Deprecated**
|
9071 | */
|
9072 | getUserAgent(): string;
|
9073 | /**
|
9074 | * Returns the WebRTC IP Handling Policy.
|
9075 | */
|
9076 | getWebRTCIPHandlingPolicy(): string;
|
9077 | /**
|
9078 | * the current zoom factor.
|
9079 |
|
9080 | **Deprecated**
|
9081 | */
|
9082 | getZoomFactor(): number;
|
9083 | /**
|
9084 | * the current zoom level.
|
9085 |
|
9086 | **Deprecated**
|
9087 | */
|
9088 | getZoomLevel(): number;
|
9089 | /**
|
9090 | * Makes the browser go back a web page.
|
9091 | */
|
9092 | goBack(): void;
|
9093 | /**
|
9094 | * Makes the browser go forward a web page.
|
9095 | */
|
9096 | goForward(): void;
|
9097 | /**
|
9098 | * Navigates browser to the specified absolute web page index.
|
9099 | */
|
9100 | goToIndex(index: number): void;
|
9101 | /**
|
9102 | * Navigates to the specified offset from the "current entry".
|
9103 | */
|
9104 | goToOffset(offset: number): void;
|
9105 | /**
|
9106 | * A promise that resolves with a key for the inserted CSS that can later be used
|
9107 | * to remove the CSS via `contents.removeInsertedCSS(key)`.
|
9108 | *
|
9109 | * Injects CSS into the current web page and returns a unique key for the inserted
|
9110 | * stylesheet.
|
9111 | */
|
9112 | insertCSS(css: string, options?: InsertCSSOptions): Promise<string>;
|
9113 | /**
|
9114 | * Inserts `text` to the focused element.
|
9115 | */
|
9116 | insertText(text: string): Promise<void>;
|
9117 | /**
|
9118 | * Starts inspecting element at position (`x`, `y`).
|
9119 | */
|
9120 | inspectElement(x: number, y: number): void;
|
9121 | /**
|
9122 | * Opens the developer tools for the service worker context.
|
9123 | */
|
9124 | inspectServiceWorker(): void;
|
9125 | /**
|
9126 | * Opens the developer tools for the shared worker context.
|
9127 | */
|
9128 | inspectSharedWorker(): void;
|
9129 | /**
|
9130 | * Schedules a full repaint of the window this web contents is in.
|
9131 | *
|
9132 | * If *offscreen rendering* is enabled invalidates the frame and generates a new
|
9133 | * one through the `'paint'` event.
|
9134 | */
|
9135 | invalidate(): void;
|
9136 | /**
|
9137 | * Whether this page has been muted.
|
9138 |
|
9139 | **Deprecated**
|
9140 | */
|
9141 | isAudioMuted(): boolean;
|
9142 | /**
|
9143 | * Whether the renderer process has crashed.
|
9144 | */
|
9145 | isCrashed(): boolean;
|
9146 | /**
|
9147 | * Whether audio is currently playing.
|
9148 | */
|
9149 | isCurrentlyAudible(): boolean;
|
9150 | /**
|
9151 | * Whether the web page is destroyed.
|
9152 | */
|
9153 | isDestroyed(): boolean;
|
9154 | /**
|
9155 | * Whether the devtools view is focused .
|
9156 | */
|
9157 | isDevToolsFocused(): boolean;
|
9158 | /**
|
9159 | * Whether the devtools is opened.
|
9160 | */
|
9161 | isDevToolsOpened(): boolean;
|
9162 | /**
|
9163 | * Whether the web page is focused.
|
9164 | */
|
9165 | isFocused(): boolean;
|
9166 | /**
|
9167 | * Whether web page is still loading resources.
|
9168 | */
|
9169 | isLoading(): boolean;
|
9170 | /**
|
9171 | * Whether the main frame (and not just iframes or frames within it) is still
|
9172 | * loading.
|
9173 | */
|
9174 | isLoadingMainFrame(): boolean;
|
9175 | /**
|
9176 | * Indicates whether *offscreen rendering* is enabled.
|
9177 | */
|
9178 | isOffscreen(): boolean;
|
9179 | /**
|
9180 | * If *offscreen rendering* is enabled returns whether it is currently painting.
|
9181 | */
|
9182 | isPainting(): boolean;
|
9183 | /**
|
9184 | * Whether the web page is waiting for a first-response from the main resource of
|
9185 | * the page.
|
9186 | */
|
9187 | isWaitingForResponse(): boolean;
|
9188 | /**
|
9189 | * the promise will resolve when the page has finished loading (see
|
9190 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
9191 | *
|
9192 | * Loads the given file in the window, `filePath` should be a path to an HTML file
|
9193 | * relative to the root of your application. For instance an app structure like
|
9194 | * this:
|
9195 |
|
9196 | Would require code like this
|
9197 | */
|
9198 | loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
|
9199 | /**
|
9200 | * the promise will resolve when the page has finished loading (see
|
9201 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
9202 | * A noop rejection handler is already attached, which avoids unhandled rejection
|
9203 | * errors.
|
9204 | *
|
9205 | * Loads the `url` in the window. The `url` must contain the protocol prefix, e.g.
|
9206 | * the `http://` or `file://`. If the load should bypass http cache then use the
|
9207 | * `pragma` header to achieve it.
|
9208 | */
|
9209 | loadURL(url: string, options?: LoadURLOptions): Promise<void>;
|
9210 | /**
|
9211 | * Opens the devtools.
|
9212 | *
|
9213 | * When `contents` is a `<webview>` tag, the `mode` would be `detach` by default,
|
9214 | * explicitly passing an empty `mode` can force using last used dock state.
|
9215 | */
|
9216 | openDevTools(options?: OpenDevToolsOptions): void;
|
9217 | /**
|
9218 | * Executes the editing command `paste` in web page.
|
9219 | */
|
9220 | paste(): void;
|
9221 | /**
|
9222 | * Executes the editing command `pasteAndMatchStyle` in web page.
|
9223 | */
|
9224 | pasteAndMatchStyle(): void;
|
9225 | /**
|
9226 | * Prints window's web page. When `silent` is set to `true`, Electron will pick the
|
9227 | * system's default printer if `deviceName` is empty and the default settings for
|
9228 | * printing.
|
9229 | *
|
9230 | * Use `page-break-before: always;` CSS style to force to print to a new page.
|
9231 | *
|
9232 | Example usage:
|
9233 | */
|
9234 | print(options?: WebContentsPrintOptions, callback?: (success: boolean, failureReason: 'cancelled' | 'failed') => void): void;
|
9235 | /**
|
9236 | * Resolves with the generated PDF data.
|
9237 | *
|
9238 | * Prints window's web page as PDF with Chromium's preview printing custom
|
9239 | * settings.
|
9240 | *
|
9241 | * The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
|
9242 | *
|
9243 | * By default, an empty `options` will be regarded as:
|
9244 | *
|
9245 | * Use `page-break-before: always;` CSS style to force to print to a new page.
|
9246 | *
|
9247 | An example of `webContents.printToPDF`:
|
9248 | */
|
9249 | printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
|
9250 | /**
|
9251 | * Executes the editing command `redo` in web page.
|
9252 | */
|
9253 | redo(): void;
|
9254 | /**
|
9255 | * Reloads the current web page.
|
9256 | */
|
9257 | reload(): void;
|
9258 | /**
|
9259 | * Reloads current page and ignores cache.
|
9260 | */
|
9261 | reloadIgnoringCache(): void;
|
9262 | /**
|
9263 | * Resolves if the removal was successful.
|
9264 | *
|
9265 | * Removes the inserted CSS from the current web page. The stylesheet is identified
|
9266 | * by its key, which is returned from `contents.insertCSS(css)`.
|
9267 | */
|
9268 | removeInsertedCSS(key: string): Promise<void>;
|
9269 | /**
|
9270 | * Removes the specified path from DevTools workspace.
|
9271 | */
|
9272 | removeWorkSpace(path: string): void;
|
9273 | /**
|
9274 | * Executes the editing command `replace` in web page.
|
9275 | */
|
9276 | replace(text: string): void;
|
9277 | /**
|
9278 | * Executes the editing command `replaceMisspelling` in web page.
|
9279 | */
|
9280 | replaceMisspelling(text: string): void;
|
9281 | /**
|
9282 | * resolves if the page is saved.
|
9283 | */
|
9284 | savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
|
9285 | /**
|
9286 | * Executes the editing command `selectAll` in web page.
|
9287 | */
|
9288 | selectAll(): void;
|
9289 | /**
|
9290 | * Send an asynchronous message to renderer process via `channel`, you can also
|
9291 | * send arbitrary arguments. Arguments will be serialized in JSON internally and
|
9292 | * hence no functions or prototype chain will be included.
|
9293 | *
|
9294 | * The renderer process can handle the message by listening to `channel` with the
|
9295 | * `ipcRenderer` module.
|
9296 | *
|
9297 | An example of sending messages from the main process to the renderer process:
|
9298 | */
|
9299 | send(channel: string, ...args: any[]): void;
|
9300 | /**
|
9301 | * Sends an input `event` to the page. **Note:** The `BrowserWindow` containing the
|
9302 | * contents needs to be focused for `sendInputEvent()` to work.
|
9303 | */
|
9304 | sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
|
9305 | /**
|
9306 | * Send an asynchronous message to a specific frame in a renderer process via
|
9307 | * `channel`. Arguments will be serialized as JSON internally and as such no
|
9308 | * functions or prototype chains will be included.
|
9309 | *
|
9310 | * The renderer process can handle the message by listening to `channel` with the
|
9311 | * `ipcRenderer` module.
|
9312 | *
|
9313 | * If you want to get the `frameId` of a given renderer context you should use the
|
9314 | * `webFrame.routingId` value. E.g.
|
9315 | *
|
9316 | You can also read `frameId` from all incoming IPC messages in the main process.
|
9317 | */
|
9318 | sendToFrame(frameId: number, channel: string, ...args: any[]): void;
|
9319 | /**
|
9320 | * Mute the audio on the current web page.
|
9321 |
|
9322 | **Deprecated**
|
9323 | */
|
9324 | setAudioMuted(muted: boolean): void;
|
9325 | /**
|
9326 | * Controls whether or not this WebContents will throttle animations and timers
|
9327 | * when the page becomes backgrounded. This also affects the Page Visibility API.
|
9328 | */
|
9329 | setBackgroundThrottling(allowed: boolean): void;
|
9330 | /**
|
9331 | * Uses the `devToolsWebContents` as the target `WebContents` to show devtools.
|
9332 | *
|
9333 | * The `devToolsWebContents` must not have done any navigation, and it should not
|
9334 | * be used for other purposes after the call.
|
9335 | *
|
9336 | * By default Electron manages the devtools by creating an internal `WebContents`
|
9337 | * with native view, which developers have very limited control of. With the
|
9338 | * `setDevToolsWebContents` method, developers can use any `WebContents` to show
|
9339 | * the devtools in it, including `BrowserWindow`, `BrowserView` and `<webview>`
|
9340 | * tag.
|
9341 | *
|
9342 | * Note that closing the devtools does not destroy the `devToolsWebContents`, it is
|
9343 | * caller's responsibility to destroy `devToolsWebContents`.
|
9344 | *
|
9345 | * An example of showing devtools in a `<webview>` tag:
|
9346 | *
|
9347 | An example of showing devtools in a `BrowserWindow`:
|
9348 | */
|
9349 | setDevToolsWebContents(devToolsWebContents: WebContents): void;
|
9350 | /**
|
9351 | * If *offscreen rendering* is enabled sets the frame rate to the specified number.
|
9352 | * Only values between 1 and 60 are accepted.
|
9353 |
|
9354 | **Deprecated**
|
9355 | */
|
9356 | setFrameRate(fps: number): void;
|
9357 | /**
|
9358 | * Ignore application menu shortcuts while this web contents is focused.
|
9359 | *
|
9360 | * @experimental
|
9361 | */
|
9362 | setIgnoreMenuShortcuts(ignore: boolean): void;
|
9363 | /**
|
9364 | * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
|
9365 | */
|
9366 | setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
|
9367 | /**
|
9368 | * Overrides the user agent for this web page.
|
9369 |
|
9370 | **Deprecated**
|
9371 | */
|
9372 | setUserAgent(userAgent: string): void;
|
9373 | /**
|
9374 | * Sets the maximum and minimum pinch-to-zoom level.
|
9375 | *
|
9376 | * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
|
9377 | * call:
|
9378 | */
|
9379 | setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
|
9380 | /**
|
9381 | * Setting the WebRTC IP handling policy allows you to control which IPs are
|
9382 | * exposed via WebRTC. See BrowserLeaks for more details.
|
9383 | */
|
9384 | setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
|
9385 | /**
|
9386 | * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
|
9387 | * divided by 100, so 300% = 3.0.
|
9388 |
|
9389 | **Deprecated**
|
9390 | */
|
9391 | setZoomFactor(factor: number): void;
|
9392 | /**
|
9393 | * Changes the zoom level to the specified level. The original size is 0 and each
|
9394 | * increment above or below represents zooming 20% larger or smaller to default
|
9395 | * limits of 300% and 50% of original size, respectively. The formula for this is
|
9396 | * `scale := 1.2 ^ level`.
|
9397 |
|
9398 | **Deprecated**
|
9399 | */
|
9400 | setZoomLevel(level: number): void;
|
9401 | /**
|
9402 | * Shows pop-up dictionary that searches the selected word on the page.
|
9403 | *
|
9404 | * @platform darwin
|
9405 | */
|
9406 | showDefinitionForSelection(): void;
|
9407 | /**
|
9408 | * Sets the `item` as dragging item for current drag-drop operation, `file` is the
|
9409 | * absolute path of the file to be dragged, and `icon` is the image showing under
|
9410 | * the cursor when dragging.
|
9411 | */
|
9412 | startDrag(item: Item): void;
|
9413 | /**
|
9414 | * If *offscreen rendering* is enabled and not painting, start painting.
|
9415 | */
|
9416 | startPainting(): void;
|
9417 | /**
|
9418 | * Stops any pending navigation.
|
9419 | */
|
9420 | stop(): void;
|
9421 | /**
|
9422 | * Stops any `findInPage` request for the `webContents` with the provided `action`.
|
9423 | */
|
9424 | stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
|
9425 | /**
|
9426 | * If *offscreen rendering* is enabled and painting, stop painting.
|
9427 | */
|
9428 | stopPainting(): void;
|
9429 | /**
|
9430 | * Indicates whether the snapshot has been created successfully.
|
9431 | *
|
9432 | Takes a V8 heap snapshot and saves it to `filePath`.
|
9433 | */
|
9434 | takeHeapSnapshot(filePath: string): Promise<void>;
|
9435 | /**
|
9436 | * Toggles the developer tools.
|
9437 | */
|
9438 | toggleDevTools(): void;
|
9439 | /**
|
9440 | * Executes the editing command `undo` in web page.
|
9441 | */
|
9442 | undo(): void;
|
9443 | /**
|
9444 | * Executes the editing command `unselect` in web page.
|
9445 | */
|
9446 | unselect(): void;
|
9447 | audioMuted: boolean;
|
9448 | readonly debugger: Debugger;
|
9449 | readonly devToolsWebContents: WebContents;
|
9450 | frameRate: number;
|
9451 | readonly hostWebContents: WebContents;
|
9452 | readonly id: number;
|
9453 | readonly session: Session;
|
9454 | userAgent: string;
|
9455 | zoomFactor: number;
|
9456 | zoomLevel: number;
|
9457 | }
|
9458 |
|
9459 | interface WebFrame extends NodeJS.EventEmitter {
|
9460 |
|
9461 | // Docs: http://electronjs.org/docs/api/web-frame
|
9462 |
|
9463 | /**
|
9464 | * Attempts to free memory that is no longer being used (like images from a
|
9465 | * previous navigation).
|
9466 | *
|
9467 | * Note that blindly calling this method probably makes Electron slower since it
|
9468 | * will have to refill these emptied caches, you should only call it if an event in
|
9469 | * your app has occurred that makes you think your page is actually using less
|
9470 | * memory (i.e. you have navigated from a super heavy page to a mostly empty one,
|
9471 | * and intend to stay there).
|
9472 | */
|
9473 | clearCache(): void;
|
9474 | /**
|
9475 | * A promise that resolves with the result of the executed code or is rejected if
|
9476 | * the result of the code is a rejected promise.
|
9477 | *
|
9478 | * Evaluates `code` in page.
|
9479 | *
|
9480 | * In the browser window some HTML APIs like `requestFullScreen` can only be
|
9481 | * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
|
9482 | * this limitation.
|
9483 | */
|
9484 | executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
|
9485 | /**
|
9486 | * A promise that resolves with the result of the executed code or is rejected if
|
9487 | * the result of the code is a rejected promise.
|
9488 | *
|
9489 | Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
|
9490 | */
|
9491 | executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean): Promise<any>;
|
9492 | /**
|
9493 | * A child of `webFrame` with the supplied `name`, `null` would be returned if
|
9494 | * there's no such frame or if the frame is not in the current renderer process.
|
9495 | */
|
9496 | findFrameByName(name: string): WebFrame;
|
9497 | /**
|
9498 | * that has the supplied `routingId`, `null` if not found.
|
9499 | */
|
9500 | findFrameByRoutingId(routingId: number): WebFrame;
|
9501 | /**
|
9502 | * The frame element in `webFrame's` document selected by `selector`, `null` would
|
9503 | * be returned if `selector` does not select a frame or if the frame is not in the
|
9504 | * current renderer process.
|
9505 | */
|
9506 | getFrameForSelector(selector: string): WebFrame;
|
9507 | /**
|
9508 | * * `images` MemoryUsageDetails
|
9509 | * * `scripts` MemoryUsageDetails
|
9510 | * * `cssStyleSheets` MemoryUsageDetails
|
9511 | * * `xslStyleSheets` MemoryUsageDetails
|
9512 | * * `fonts` MemoryUsageDetails
|
9513 | * * `other` MemoryUsageDetails
|
9514 | *
|
9515 | * Returns an object describing usage information of Blink's internal memory
|
9516 | * caches.
|
9517 |
|
9518 | This will generate:
|
9519 | */
|
9520 | getResourceUsage(): ResourceUsage;
|
9521 | /**
|
9522 | * The current zoom factor.
|
9523 | */
|
9524 | getZoomFactor(): number;
|
9525 | /**
|
9526 | * The current zoom level.
|
9527 | */
|
9528 | getZoomLevel(): number;
|
9529 | /**
|
9530 | * A key for the inserted CSS that can later be used to remove the CSS via
|
9531 | * `webFrame.removeInsertedCSS(key)`.
|
9532 | *
|
9533 | * Injects CSS into the current web page and returns a unique key for the inserted
|
9534 | * stylesheet.
|
9535 | */
|
9536 | insertCSS(css: string): string;
|
9537 | /**
|
9538 | * Inserts `text` to the focused element.
|
9539 | */
|
9540 | insertText(text: string): void;
|
9541 | /**
|
9542 | * Removes the inserted CSS from the current web page. The stylesheet is identified
|
9543 | * by its key, which is returned from `webFrame.insertCSS(css)`.
|
9544 | */
|
9545 | removeInsertedCSS(key: string): void;
|
9546 | /**
|
9547 | * Set the security origin, content security policy and name of the isolated world.
|
9548 | * Note: If the `csp` is specified, then the `securityOrigin` also has to be
|
9549 | * specified.
|
9550 | */
|
9551 | setIsolatedWorldInfo(worldId: number, info: Info): void;
|
9552 | /**
|
9553 | * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
|
9554 | */
|
9555 | setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
|
9556 | /**
|
9557 | * Sets a provider for spell checking in input fields and text areas.
|
9558 | *
|
9559 | * The `provider` must be an object that has a `spellCheck` method that accepts an
|
9560 | * array of individual words for spellchecking. The `spellCheck` function runs
|
9561 | * asynchronously and calls the `callback` function with an array of misspelt words
|
9562 | * when complete.
|
9563 |
|
9564 | An example of using node-spellchecker as provider:
|
9565 | */
|
9566 | setSpellCheckProvider(language: string, provider: Provider): void;
|
9567 | /**
|
9568 | * Sets the maximum and minimum pinch-to-zoom level.
|
9569 | *
|
9570 | * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
|
9571 | * call:
|
9572 | */
|
9573 | setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
|
9574 | /**
|
9575 | * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
|
9576 | * divided by 100, so 300% = 3.0.
|
9577 | */
|
9578 | setZoomFactor(factor: number): void;
|
9579 | /**
|
9580 | * Changes the zoom level to the specified level. The original size is 0 and each
|
9581 | * increment above or below represents zooming 20% larger or smaller to default
|
9582 | * limits of 300% and 50% of original size, respectively.
|
9583 | */
|
9584 | setZoomLevel(level: number): void;
|
9585 | /**
|
9586 | * A `WebFrame | null` representing the first child frame of `webFrame`, the
|
9587 | * property would be `null` if `webFrame` has no children or if first child is not
|
9588 | * in the current renderer process.
|
9589 | *
|
9590 | */
|
9591 | readonly firstChild: (WebFrame) | (null);
|
9592 | /**
|
9593 | * A `WebFrame | null` representing next sibling frame, the property would be
|
9594 | * `null` if `webFrame` is the last frame in its parent or if the next sibling is
|
9595 | * not in the current renderer process.
|
9596 | *
|
9597 | */
|
9598 | readonly nextSibling: (WebFrame) | (null);
|
9599 | /**
|
9600 | * A `WebFrame | null` representing the frame which opened `webFrame`, the property
|
9601 | * would be `null` if there's no opener or opener is not in the current renderer
|
9602 | * process.
|
9603 | *
|
9604 | */
|
9605 | readonly opener: (WebFrame) | (null);
|
9606 | /**
|
9607 | * A `WebFrame | null` representing parent frame of `webFrame`, the property would
|
9608 | * be `null` if `webFrame` is top or parent is not in the current renderer process.
|
9609 | *
|
9610 | */
|
9611 | readonly parent: (WebFrame) | (null);
|
9612 | /**
|
9613 | * An `Integer` representing the unique frame id in the current renderer process.
|
9614 | * Distinct WebFrame instances that refer to the same underlying frame will have
|
9615 | * the same `routingId`.
|
9616 | *
|
9617 | */
|
9618 | readonly routingId: number;
|
9619 | /**
|
9620 | * A `WebFrame | null` representing top frame in frame hierarchy to which
|
9621 | * `webFrame` belongs, the property would be `null` if top frame is not in the
|
9622 | * current renderer process.
|
9623 | *
|
9624 | */
|
9625 | readonly top: (WebFrame) | (null);
|
9626 | }
|
9627 |
|
9628 | class WebRequest {
|
9629 |
|
9630 | // Docs: http://electronjs.org/docs/api/web-request
|
9631 |
|
9632 | /**
|
9633 | * The `listener` will be called with `listener(details)` when a server initiated
|
9634 | * redirect is about to occur.
|
9635 | */
|
9636 | onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
|
9637 | /**
|
9638 | * The `listener` will be called with `listener(details)` when a server initiated
|
9639 | * redirect is about to occur.
|
9640 | */
|
9641 | onBeforeRedirect(filter: Filter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
|
9642 | /**
|
9643 | * The `listener` will be called with `listener(details, callback)` when a request
|
9644 | * is about to occur.
|
9645 | *
|
9646 | * The `uploadData` is an array of `UploadData` objects.
|
9647 | *
|
9648 | * The `callback` has to be called with an `response` object.
|
9649 | *
|
9650 | Some examples of valid `urls`:
|
9651 | */
|
9652 | onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: Response) => void) => void) | (null)): void;
|
9653 | /**
|
9654 | * The `listener` will be called with `listener(details, callback)` when a request
|
9655 | * is about to occur.
|
9656 | *
|
9657 | * The `uploadData` is an array of `UploadData` objects.
|
9658 | *
|
9659 | * The `callback` has to be called with an `response` object.
|
9660 | *
|
9661 | Some examples of valid `urls`:
|
9662 | */
|
9663 | onBeforeRequest(filter: Filter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: Response) => void) => void) | (null)): void;
|
9664 | /**
|
9665 | * The `listener` will be called with `listener(details, callback)` before sending
|
9666 | * an HTTP request, once the request headers are available. This may occur after a
|
9667 | * TCP connection is made to the server, but before any http data is sent.
|
9668 | *
|
9669 | The `callback` has to be called with a `response` object.
|
9670 | */
|
9671 | onBeforeSendHeaders(filter: Filter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
|
9672 | /**
|
9673 | * The `listener` will be called with `listener(details, callback)` before sending
|
9674 | * an HTTP request, once the request headers are available. This may occur after a
|
9675 | * TCP connection is made to the server, but before any http data is sent.
|
9676 | *
|
9677 | The `callback` has to be called with a `response` object.
|
9678 | */
|
9679 | onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
|
9680 | /**
|
9681 | * The `listener` will be called with `listener(details)` when a request is
|
9682 | * completed.
|
9683 | */
|
9684 | onCompleted(filter: Filter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
|
9685 | /**
|
9686 | * The `listener` will be called with `listener(details)` when a request is
|
9687 | * completed.
|
9688 | */
|
9689 | onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
|
9690 | /**
|
9691 | * The `listener` will be called with `listener(details)` when an error occurs.
|
9692 | */
|
9693 | onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
|
9694 | /**
|
9695 | * The `listener` will be called with `listener(details)` when an error occurs.
|
9696 | */
|
9697 | onErrorOccurred(filter: Filter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
|
9698 | /**
|
9699 | * The `listener` will be called with `listener(details, callback)` when HTTP
|
9700 | * response headers of a request have been received.
|
9701 | *
|
9702 | The `callback` has to be called with a `response` object.
|
9703 | */
|
9704 | onHeadersReceived(filter: Filter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
|
9705 | /**
|
9706 | * The `listener` will be called with `listener(details, callback)` when HTTP
|
9707 | * response headers of a request have been received.
|
9708 | *
|
9709 | The `callback` has to be called with a `response` object.
|
9710 | */
|
9711 | onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
|
9712 | /**
|
9713 | * The `listener` will be called with `listener(details)` when first byte of the
|
9714 | * response body is received. For HTTP requests, this means that the status line
|
9715 | * and response headers are available.
|
9716 | */
|
9717 | onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
|
9718 | /**
|
9719 | * The `listener` will be called with `listener(details)` when first byte of the
|
9720 | * response body is received. For HTTP requests, this means that the status line
|
9721 | * and response headers are available.
|
9722 | */
|
9723 | onResponseStarted(filter: Filter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
|
9724 | /**
|
9725 | * The `listener` will be called with `listener(details)` just before a request is
|
9726 | * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
|
9727 | * response are visible by the time this listener is fired.
|
9728 | */
|
9729 | onSendHeaders(filter: Filter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
|
9730 | /**
|
9731 | * The `listener` will be called with `listener(details)` just before a request is
|
9732 | * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
|
9733 | * response are visible by the time this listener is fired.
|
9734 | */
|
9735 | onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
|
9736 | }
|
9737 |
|
9738 | interface WebSource {
|
9739 |
|
9740 | // Docs: http://electronjs.org/docs/api/structures/web-source
|
9741 |
|
9742 | code: string;
|
9743 | /**
|
9744 | * Default is 1.
|
9745 | */
|
9746 | startLine?: number;
|
9747 | url?: string;
|
9748 | }
|
9749 |
|
9750 | interface WebviewTag extends HTMLElement {
|
9751 |
|
9752 | // Docs: http://electronjs.org/docs/api/webview-tag
|
9753 |
|
9754 | /**
|
9755 | * Fired when a load has committed. This includes navigation within the current
|
9756 | * document as well as subframe document-level loads, but does not include
|
9757 | * asynchronous resource loads.
|
9758 | */
|
9759 | addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
|
9760 | removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
|
9761 | /**
|
9762 | * Fired when the navigation is done, i.e. the spinner of the tab will stop
|
9763 | * spinning, and the `onload` event is dispatched.
|
9764 | */
|
9765 | addEventListener(event: 'did-finish-load', listener: (event: Event) => void, useCapture?: boolean): this;
|
9766 | removeEventListener(event: 'did-finish-load', listener: (event: Event) => void): this;
|
9767 | /**
|
9768 | * This event is like `did-finish-load`, but fired when the load failed or was
|
9769 | * cancelled, e.g. `window.stop()` is invoked.
|
9770 | */
|
9771 | addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
|
9772 | removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
|
9773 | /**
|
9774 | * Fired when a frame has done navigation.
|
9775 | */
|
9776 | addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
|
9777 | removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
|
9778 | /**
|
9779 | * Corresponds to the points in time when the spinner of the tab starts spinning.
|
9780 | */
|
9781 | addEventListener(event: 'did-start-loading', listener: (event: Event) => void, useCapture?: boolean): this;
|
9782 | removeEventListener(event: 'did-start-loading', listener: (event: Event) => void): this;
|
9783 | /**
|
9784 | * Corresponds to the points in time when the spinner of the tab stops spinning.
|
9785 | */
|
9786 | addEventListener(event: 'did-stop-loading', listener: (event: Event) => void, useCapture?: boolean): this;
|
9787 | removeEventListener(event: 'did-stop-loading', listener: (event: Event) => void): this;
|
9788 | /**
|
9789 | * Fired when document in the given frame is loaded.
|
9790 | */
|
9791 | addEventListener(event: 'dom-ready', listener: (event: Event) => void, useCapture?: boolean): this;
|
9792 | removeEventListener(event: 'dom-ready', listener: (event: Event) => void): this;
|
9793 | /**
|
9794 | * Fired when page title is set during navigation. `explicitSet` is false when
|
9795 | * title is synthesized from file url.
|
9796 | */
|
9797 | addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
|
9798 | removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
|
9799 | /**
|
9800 | * Fired when page receives favicon urls.
|
9801 | */
|
9802 | addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
|
9803 | removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
|
9804 | /**
|
9805 | * Fired when page enters fullscreen triggered by HTML API.
|
9806 | */
|
9807 | addEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
|
9808 | removeEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void): this;
|
9809 | /**
|
9810 | * Fired when page leaves fullscreen triggered by HTML API.
|
9811 | */
|
9812 | addEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
|
9813 | removeEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void): this;
|
9814 | /**
|
9815 | * Fired when the guest window logs a console message.
|
9816 | *
|
9817 | * The following example code forwards all log messages to the embedder's console
|
9818 | * without regard for log level or other properties.
|
9819 | */
|
9820 | addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
|
9821 | removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
|
9822 | /**
|
9823 | * Fired when a result is available for `webview.findInPage` request.
|
9824 | */
|
9825 | addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
|
9826 | removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
|
9827 | /**
|
9828 | * Fired when the guest page attempts to open a new browser window.
|
9829 | *
|
9830 | The following example code opens the new url in system's default browser.
|
9831 | */
|
9832 | addEventListener(event: 'new-window', listener: (event: NewWindowEvent) => void, useCapture?: boolean): this;
|
9833 | removeEventListener(event: 'new-window', listener: (event: NewWindowEvent) => void): this;
|
9834 | /**
|
9835 | * Emitted when a user or the page wants to start navigation. It can happen when
|
9836 | * the `window.location` object is changed or a user clicks a link in the page.
|
9837 | *
|
9838 | * This event will not emit when the navigation is started programmatically with
|
9839 | * APIs like `<webview>.loadURL` and `<webview>.back`.
|
9840 | *
|
9841 | * It is also not emitted during in-page navigation, such as clicking anchor links
|
9842 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
9843 | * this purpose.
|
9844 |
|
9845 | Calling `event.preventDefault()` does __NOT__ have any effect.
|
9846 | */
|
9847 | addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
|
9848 | removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
|
9849 | /**
|
9850 | * Emitted when a navigation is done.
|
9851 | *
|
9852 | * This event is not emitted for in-page navigations, such as clicking anchor links
|
9853 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
9854 | * this purpose.
|
9855 | */
|
9856 | addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
|
9857 | removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
|
9858 | /**
|
9859 | * Emitted when an in-page navigation happened.
|
9860 | *
|
9861 | * When in-page navigation happens, the page URL changes but does not cause
|
9862 | * navigation outside of the page. Examples of this occurring are when anchor links
|
9863 | * are clicked or when the DOM `hashchange` event is triggered.
|
9864 | */
|
9865 | addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
|
9866 | removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
|
9867 | /**
|
9868 | * Fired when the guest page attempts to close itself.
|
9869 | *
|
9870 | * The following example code navigates the `webview` to `about:blank` when the
|
9871 | * guest attempts to close itself.
|
9872 | */
|
9873 | addEventListener(event: 'close', listener: (event: Event) => void, useCapture?: boolean): this;
|
9874 | removeEventListener(event: 'close', listener: (event: Event) => void): this;
|
9875 | /**
|
9876 | * Fired when the guest page has sent an asynchronous message to embedder page.
|
9877 | *
|
9878 | * With `sendToHost` method and `ipc-message` event you can communicate between
|
9879 | * guest page and embedder page:
|
9880 | */
|
9881 | addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
|
9882 | removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
|
9883 | /**
|
9884 | * Fired when the renderer process is crashed.
|
9885 | */
|
9886 | addEventListener(event: 'crashed', listener: (event: Event) => void, useCapture?: boolean): this;
|
9887 | removeEventListener(event: 'crashed', listener: (event: Event) => void): this;
|
9888 | /**
|
9889 | * Fired when a plugin process is crashed.
|
9890 | */
|
9891 | addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
|
9892 | removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
|
9893 | /**
|
9894 | * Fired when the WebContents is destroyed.
|
9895 | */
|
9896 | addEventListener(event: 'destroyed', listener: (event: Event) => void, useCapture?: boolean): this;
|
9897 | removeEventListener(event: 'destroyed', listener: (event: Event) => void): this;
|
9898 | /**
|
9899 | * Emitted when media starts playing.
|
9900 | */
|
9901 | addEventListener(event: 'media-started-playing', listener: (event: Event) => void, useCapture?: boolean): this;
|
9902 | removeEventListener(event: 'media-started-playing', listener: (event: Event) => void): this;
|
9903 | /**
|
9904 | * Emitted when media is paused or done playing.
|
9905 | */
|
9906 | addEventListener(event: 'media-paused', listener: (event: Event) => void, useCapture?: boolean): this;
|
9907 | removeEventListener(event: 'media-paused', listener: (event: Event) => void): this;
|
9908 | /**
|
9909 | * Emitted when a page's theme color changes. This is usually due to encountering a
|
9910 | * meta tag:
|
9911 | */
|
9912 | addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
|
9913 | removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
|
9914 | /**
|
9915 | * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
|
9916 | */
|
9917 | addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
|
9918 | removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
|
9919 | /**
|
9920 | * Emitted when DevTools is opened.
|
9921 | */
|
9922 | addEventListener(event: 'devtools-opened', listener: (event: Event) => void, useCapture?: boolean): this;
|
9923 | removeEventListener(event: 'devtools-opened', listener: (event: Event) => void): this;
|
9924 | /**
|
9925 | * Emitted when DevTools is closed.
|
9926 | */
|
9927 | addEventListener(event: 'devtools-closed', listener: (event: Event) => void, useCapture?: boolean): this;
|
9928 | removeEventListener(event: 'devtools-closed', listener: (event: Event) => void): this;
|
9929 | /**
|
9930 | * Emitted when DevTools is focused / opened.
|
9931 | */
|
9932 | addEventListener(event: 'devtools-focused', listener: (event: Event) => void, useCapture?: boolean): this;
|
9933 | removeEventListener(event: 'devtools-focused', listener: (event: Event) => void): this;
|
9934 | addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
|
9935 | addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
9936 | removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
|
9937 | removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
9938 | /**
|
9939 | * Whether the guest page can go back.
|
9940 | */
|
9941 | canGoBack(): boolean;
|
9942 | /**
|
9943 | * Whether the guest page can go forward.
|
9944 | */
|
9945 | canGoForward(): boolean;
|
9946 | /**
|
9947 | * Whether the guest page can go to `offset`.
|
9948 | */
|
9949 | canGoToOffset(offset: number): boolean;
|
9950 | /**
|
9951 | * Resolves with a NativeImage
|
9952 | *
|
9953 | * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
9954 | * whole visible page.
|
9955 | */
|
9956 | capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
|
9957 | /**
|
9958 | * Clears the navigation history.
|
9959 | */
|
9960 | clearHistory(): void;
|
9961 | /**
|
9962 | * Closes the DevTools window of guest page.
|
9963 | */
|
9964 | closeDevTools(): void;
|
9965 | /**
|
9966 | * Executes editing command `copy` in page.
|
9967 | */
|
9968 | copy(): void;
|
9969 | /**
|
9970 | * Executes editing command `cut` in page.
|
9971 | */
|
9972 | cut(): void;
|
9973 | /**
|
9974 | * Executes editing command `delete` in page.
|
9975 | */
|
9976 | delete(): void;
|
9977 | /**
|
9978 | * Initiates a download of the resource at `url` without navigating.
|
9979 | */
|
9980 | downloadURL(url: string): void;
|
9981 | /**
|
9982 | * A promise that resolves with the result of the executed code or is rejected if
|
9983 | * the result of the code is a rejected promise.
|
9984 | *
|
9985 | * Evaluates `code` in page. If `userGesture` is set, it will create the user
|
9986 | * gesture context in the page. HTML APIs like `requestFullScreen`, which require
|
9987 | * user action, can take advantage of this option for automation.
|
9988 | */
|
9989 | executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
|
9990 | /**
|
9991 | * The request id used for the request.
|
9992 | *
|
9993 | * Starts a request to find all matches for the `text` in the web page. The result
|
9994 | * of the request can be obtained by subscribing to `found-in-page` event.
|
9995 | */
|
9996 | findInPage(text: string, options?: FindInPageOptions): number;
|
9997 | /**
|
9998 | * The title of guest page.
|
9999 | */
|
10000 | getTitle(): string;
|
10001 | /**
|
10002 | * The URL of guest page.
|
10003 | */
|
10004 | getURL(): string;
|
10005 | /**
|
10006 | * The user agent for guest page.
|
10007 | */
|
10008 | getUserAgent(): string;
|
10009 | /**
|
10010 | * The web contents associated with this `webview`.
|
10011 | *
|
10012 | * It depends on the `remote` module, it is therefore not available when this
|
10013 | * module is disabled.
|
10014 | */
|
10015 | getWebContents(): WebContents;
|
10016 | /**
|
10017 | * The WebContents ID of this `webview`.
|
10018 | */
|
10019 | getWebContentsId(): number;
|
10020 | /**
|
10021 | * the current zoom factor.
|
10022 | */
|
10023 | getZoomFactor(): number;
|
10024 | /**
|
10025 | * the current zoom level.
|
10026 | */
|
10027 | getZoomLevel(): number;
|
10028 | /**
|
10029 | * Makes the guest page go back.
|
10030 | */
|
10031 | goBack(): void;
|
10032 | /**
|
10033 | * Makes the guest page go forward.
|
10034 | */
|
10035 | goForward(): void;
|
10036 | /**
|
10037 | * Navigates to the specified absolute index.
|
10038 | */
|
10039 | goToIndex(index: number): void;
|
10040 | /**
|
10041 | * Navigates to the specified offset from the "current entry".
|
10042 | */
|
10043 | goToOffset(offset: number): void;
|
10044 | /**
|
10045 | * A promise that resolves with a key for the inserted CSS that can later be used
|
10046 | * to remove the CSS via `<webview>.removeInsertedCSS(key)`.
|
10047 | *
|
10048 | * Injects CSS into the current web page and returns a unique key for the inserted
|
10049 | * stylesheet.
|
10050 | */
|
10051 | insertCSS(css: string): Promise<string>;
|
10052 | /**
|
10053 | * Inserts `text` to the focused element.
|
10054 | */
|
10055 | insertText(text: string): Promise<void>;
|
10056 | /**
|
10057 | * Starts inspecting element at position (`x`, `y`) of guest page.
|
10058 | */
|
10059 | inspectElement(x: number, y: number): void;
|
10060 | /**
|
10061 | * Opens the DevTools for the service worker context present in the guest page.
|
10062 | */
|
10063 | inspectServiceWorker(): void;
|
10064 | /**
|
10065 | * Opens the DevTools for the shared worker context present in the guest page.
|
10066 | */
|
10067 | inspectSharedWorker(): void;
|
10068 | /**
|
10069 | * Whether guest page has been muted.
|
10070 | */
|
10071 | isAudioMuted(): boolean;
|
10072 | /**
|
10073 | * Whether the renderer process has crashed.
|
10074 | */
|
10075 | isCrashed(): boolean;
|
10076 | /**
|
10077 | * Whether audio is currently playing.
|
10078 | */
|
10079 | isCurrentlyAudible(): boolean;
|
10080 | /**
|
10081 | * Whether DevTools window of guest page is focused.
|
10082 | */
|
10083 | isDevToolsFocused(): boolean;
|
10084 | /**
|
10085 | * Whether guest page has a DevTools window attached.
|
10086 | */
|
10087 | isDevToolsOpened(): boolean;
|
10088 | /**
|
10089 | * Whether guest page is still loading resources.
|
10090 | */
|
10091 | isLoading(): boolean;
|
10092 | /**
|
10093 | * Whether the main frame (and not just iframes or frames within it) is still
|
10094 | * loading.
|
10095 | */
|
10096 | isLoadingMainFrame(): boolean;
|
10097 | /**
|
10098 | * Whether the guest page is waiting for a first-response for the main resource of
|
10099 | * the page.
|
10100 | */
|
10101 | isWaitingForResponse(): boolean;
|
10102 | /**
|
10103 | * The promise will resolve when the page has finished loading (see
|
10104 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
10105 | *
|
10106 | * Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
|
10107 | * the `http://` or `file://`.
|
10108 | */
|
10109 | loadURL(url: string, options?: LoadURLOptions): Promise<void>;
|
10110 | /**
|
10111 | * Opens a DevTools window for guest page.
|
10112 | */
|
10113 | openDevTools(): void;
|
10114 | /**
|
10115 | * Executes editing command `paste` in page.
|
10116 | */
|
10117 | paste(): void;
|
10118 | /**
|
10119 | * Executes editing command `pasteAndMatchStyle` in page.
|
10120 | */
|
10121 | pasteAndMatchStyle(): void;
|
10122 | /**
|
10123 | * Prints `webview`'s web page. Same as `webContents.print([options])`.
|
10124 | */
|
10125 | print(options?: WebviewTagPrintOptions): Promise<void>;
|
10126 | /**
|
10127 | * Resolves with the generated PDF data.
|
10128 | *
|
10129 | Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
|
10130 | */
|
10131 | printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
|
10132 | /**
|
10133 | * Executes editing command `redo` in page.
|
10134 | */
|
10135 | redo(): void;
|
10136 | /**
|
10137 | * Reloads the guest page.
|
10138 | */
|
10139 | reload(): void;
|
10140 | /**
|
10141 | * Reloads the guest page and ignores cache.
|
10142 | */
|
10143 | reloadIgnoringCache(): void;
|
10144 | /**
|
10145 | * Resolves if the removal was successful.
|
10146 | *
|
10147 | * Removes the inserted CSS from the current web page. The stylesheet is identified
|
10148 | * by its key, which is returned from `<webview>.insertCSS(css)`.
|
10149 | */
|
10150 | removeInsertedCSS(key: string): Promise<void>;
|
10151 | /**
|
10152 | * Executes editing command `replace` in page.
|
10153 | */
|
10154 | replace(text: string): void;
|
10155 | /**
|
10156 | * Executes editing command `replaceMisspelling` in page.
|
10157 | */
|
10158 | replaceMisspelling(text: string): void;
|
10159 | /**
|
10160 | * Executes editing command `selectAll` in page.
|
10161 | */
|
10162 | selectAll(): void;
|
10163 | /**
|
10164 | * Send an asynchronous message to renderer process via `channel`, you can also
|
10165 | * send arbitrary arguments. The renderer process can handle the message by
|
10166 | * listening to the `channel` event with the `ipcRenderer` module.
|
10167 | *
|
10168 | See webContents.send for examples.
|
10169 | */
|
10170 | send(channel: string, ...args: any[]): Promise<void>;
|
10171 | /**
|
10172 | * Sends an input `event` to the page.
|
10173 | *
|
10174 | See webContents.sendInputEvent for detailed description of `event` object.
|
10175 | */
|
10176 | sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
|
10177 | /**
|
10178 | * Set guest page muted.
|
10179 | */
|
10180 | setAudioMuted(muted: boolean): void;
|
10181 | /**
|
10182 | * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
|
10183 | */
|
10184 | setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
|
10185 | /**
|
10186 | * Overrides the user agent for the guest page.
|
10187 | */
|
10188 | setUserAgent(userAgent: string): void;
|
10189 | /**
|
10190 | * Sets the maximum and minimum pinch-to-zoom level.
|
10191 | */
|
10192 | setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
|
10193 | /**
|
10194 | * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
|
10195 | * divided by 100, so 300% = 3.0.
|
10196 | */
|
10197 | setZoomFactor(factor: number): void;
|
10198 | /**
|
10199 | * Changes the zoom level to the specified level. The original size is 0 and each
|
10200 | * increment above or below represents zooming 20% larger or smaller to default
|
10201 | * limits of 300% and 50% of original size, respectively. The formula for this is
|
10202 | * `scale := 1.2 ^ level`.
|
10203 | */
|
10204 | setZoomLevel(level: number): void;
|
10205 | /**
|
10206 | * Shows pop-up dictionary that searches the selected word on the page.
|
10207 | *
|
10208 | * @platform darwin
|
10209 | */
|
10210 | showDefinitionForSelection(): void;
|
10211 | /**
|
10212 | * Stops any pending navigation.
|
10213 | */
|
10214 | stop(): void;
|
10215 | /**
|
10216 | * Stops any `findInPage` request for the `webview` with the provided `action`.
|
10217 | */
|
10218 | stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
|
10219 | /**
|
10220 | * Executes editing command `undo` in page.
|
10221 | */
|
10222 | undo(): void;
|
10223 | /**
|
10224 | * Executes editing command `unselect` in page.
|
10225 | */
|
10226 | unselect(): void;
|
10227 | /**
|
10228 | * A `Boolean`. When this attribute is present the guest page will be allowed to
|
10229 | * open new windows. Popups are disabled by default.
|
10230 | */
|
10231 | allowpopups: boolean;
|
10232 | /**
|
10233 | * A `String` which is a list of strings which specifies the blink features to be
|
10234 | * disabled separated by `,`. The full list of supported feature strings can be
|
10235 | * found in the RuntimeEnabledFeatures.json5 file.
|
10236 | */
|
10237 | disableblinkfeatures: string;
|
10238 | /**
|
10239 | * A `Boolean`. When this attribute is present the guest page will have web
|
10240 | * security disabled. Web security is enabled by default.
|
10241 | */
|
10242 | disablewebsecurity: boolean;
|
10243 | /**
|
10244 | * A `String` which is a list of strings which specifies the blink features to be
|
10245 | * enabled separated by `,`. The full list of supported feature strings can be
|
10246 | * found in the RuntimeEnabledFeatures.json5 file.
|
10247 | */
|
10248 | enableblinkfeatures: string;
|
10249 | /**
|
10250 | * A `Boolean`. When this attribute is `false` the guest page in `webview` will not
|
10251 | * have access to the `remote` module. The remote module is available by default.
|
10252 | */
|
10253 | enableremotemodule: boolean;
|
10254 | /**
|
10255 | * A `String` that sets the referrer URL for the guest page.
|
10256 | */
|
10257 | httpreferrer: string;
|
10258 | /**
|
10259 | * A `Boolean`. When this attribute is present the guest page in `webview` will
|
10260 | * have node integration and can use node APIs like `require` and `process` to
|
10261 | * access low level system resources. Node integration is disabled by default in
|
10262 | * the guest page.
|
10263 | */
|
10264 | nodeintegration: boolean;
|
10265 | /**
|
10266 | * A `Boolean` for the experimental option for enabling NodeJS support in
|
10267 | * sub-frames such as iframes inside the `webview`. All your preloads will load for
|
10268 | * every iframe, you can use `process.isMainFrame` to determine if you are in the
|
10269 | * main frame or not. This option is disabled by default in the guest page.
|
10270 | */
|
10271 | nodeintegrationinsubframes: boolean;
|
10272 | /**
|
10273 | * A `String` that sets the session used by the page. If `partition` starts with
|
10274 | * `persist:`, the page will use a persistent session available to all pages in the
|
10275 | * app with the same `partition`. if there is no `persist:` prefix, the page will
|
10276 | * use an in-memory session. By assigning the same `partition`, multiple pages can
|
10277 | * share the same session. If the `partition` is unset then default session of the
|
10278 | * app will be used.
|
10279 | *
|
10280 | * This value can only be modified before the first navigation, since the session
|
10281 | * of an active renderer process cannot change. Subsequent attempts to modify the
|
10282 | * value will fail with a DOM exception.
|
10283 | */
|
10284 | partition: string;
|
10285 | /**
|
10286 | * A `Boolean`. When this attribute is present the guest page in `webview` will be
|
10287 | * able to use browser plugins. Plugins are disabled by default.
|
10288 | */
|
10289 | plugins: boolean;
|
10290 | /**
|
10291 | * A `String` that specifies a script that will be loaded before other scripts run
|
10292 | * in the guest page. The protocol of script's URL must be either `file:` or
|
10293 | * `asar:`, because it will be loaded by `require` in guest page under the hood.
|
10294 | *
|
10295 | * When the guest page doesn't have node integration this script will still have
|
10296 | * access to all Node APIs, but global objects injected by Node will be deleted
|
10297 | * after this script has finished executing.
|
10298 | *
|
10299 | * **Note:** This option will appear as `preloadURL` (not `preload`) in the
|
10300 | * `webPreferences` specified to the `will-attach-webview` event.
|
10301 | */
|
10302 | preload: string;
|
10303 | /**
|
10304 | * A `String` representing the visible URL. Writing to this attribute initiates
|
10305 | * top-level navigation.
|
10306 | *
|
10307 | * Assigning `src` its own value will reload the current page.
|
10308 | *
|
10309 | * The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
|
10310 | * world!`.
|
10311 | */
|
10312 | src: string;
|
10313 | /**
|
10314 | * A `String` that sets the user agent for the guest page before the page is
|
10315 | * navigated to. Once the page is loaded, use the `setUserAgent` method to change
|
10316 | * the user agent.
|
10317 | */
|
10318 | useragent: string;
|
10319 | /**
|
10320 | * A `String` which is a comma separated list of strings which specifies the web
|
10321 | * preferences to be set on the webview. The full list of supported preference
|
10322 | * strings can be found in BrowserWindow.
|
10323 | *
|
10324 | * The string follows the same format as the features string in `window.open`. A
|
10325 | * name by itself is given a `true` boolean value. A preference can be set to
|
10326 | * another value by including an `=`, followed by the value. Special values `yes`
|
10327 | * and `1` are interpreted as `true`, while `no` and `0` are interpreted as
|
10328 | * `false`.
|
10329 | */
|
10330 | webpreferences: string;
|
10331 | }
|
10332 |
|
10333 | interface AboutPanelOptionsOptions {
|
10334 | /**
|
10335 | * The app's name.
|
10336 | */
|
10337 | applicationName?: string;
|
10338 | /**
|
10339 | * The app's version.
|
10340 | */
|
10341 | applicationVersion?: string;
|
10342 | /**
|
10343 | * Copyright information.
|
10344 | */
|
10345 | copyright?: string;
|
10346 | /**
|
10347 | * The app's build version number.
|
10348 | *
|
10349 | * @platform darwin
|
10350 | */
|
10351 | version?: string;
|
10352 | /**
|
10353 | * Credit information.
|
10354 | *
|
10355 | * @platform darwin
|
10356 | */
|
10357 | credits?: string;
|
10358 | /**
|
10359 | * List of app authors.
|
10360 | *
|
10361 | * @platform linux
|
10362 | */
|
10363 | authors?: string[];
|
10364 | /**
|
10365 | * The app's website.
|
10366 | *
|
10367 | * @platform linux
|
10368 | */
|
10369 | website?: string;
|
10370 | /**
|
10371 | * Path to the app's icon. Will be shown as 64x64 pixels while retaining aspect
|
10372 | * ratio.
|
10373 | *
|
10374 | * @platform linux
|
10375 | */
|
10376 | iconPath?: string;
|
10377 | }
|
10378 |
|
10379 | interface AddRepresentationOptions {
|
10380 | /**
|
10381 | * The scale factor to add the image representation for.
|
10382 | */
|
10383 | scaleFactor: number;
|
10384 | /**
|
10385 | * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
|
10386 | */
|
10387 | width?: number;
|
10388 | /**
|
10389 | * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
|
10390 | */
|
10391 | height?: number;
|
10392 | /**
|
10393 | * The buffer containing the raw image data.
|
10394 | */
|
10395 | buffer?: Buffer;
|
10396 | /**
|
10397 | * The data URL containing either a base 64 encoded PNG or JPEG image.
|
10398 | */
|
10399 | dataURL?: string;
|
10400 | }
|
10401 |
|
10402 | interface AnimationSettings {
|
10403 | /**
|
10404 | * Returns true if rich animations should be rendered. Looks at session type (e.g.
|
10405 | * remote desktop) and accessibility settings to give guidance for heavy
|
10406 | * animations.
|
10407 | */
|
10408 | shouldRenderRichAnimation: boolean;
|
10409 | /**
|
10410 | * Determines on a per-platform basis whether scroll animations (e.g. produced by
|
10411 | * home/end key) should be enabled.
|
10412 | */
|
10413 | scrollAnimationsEnabledBySystem: boolean;
|
10414 | /**
|
10415 | * Determines whether the user desires reduced motion based on platform APIs.
|
10416 | */
|
10417 | prefersReducedMotion: boolean;
|
10418 | }
|
10419 |
|
10420 | interface AppDetailsOptions {
|
10421 | /**
|
10422 | * Window's App User Model ID. It has to be set, otherwise the other options will
|
10423 | * have no effect.
|
10424 | */
|
10425 | appId?: string;
|
10426 | /**
|
10427 | * Window's Relaunch Icon.
|
10428 | */
|
10429 | appIconPath?: string;
|
10430 | /**
|
10431 | * Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
|
10432 | * Default is `0`.
|
10433 | */
|
10434 | appIconIndex?: number;
|
10435 | /**
|
10436 | * Window's Relaunch Command.
|
10437 | */
|
10438 | relaunchCommand?: string;
|
10439 | /**
|
10440 | * Window's Relaunch Display Name.
|
10441 | */
|
10442 | relaunchDisplayName?: string;
|
10443 | }
|
10444 |
|
10445 | interface AuthenticationResponseDetails {
|
10446 | url: string;
|
10447 | }
|
10448 |
|
10449 | interface AuthInfo {
|
10450 | isProxy: boolean;
|
10451 | scheme: string;
|
10452 | host: string;
|
10453 | port: number;
|
10454 | realm: string;
|
10455 | }
|
10456 |
|
10457 | interface AutoResizeOptions {
|
10458 | /**
|
10459 | * If `true`, the view's width will grow and shrink together with the window.
|
10460 | * `false` by default.
|
10461 | */
|
10462 | width?: boolean;
|
10463 | /**
|
10464 | * If `true`, the view's height will grow and shrink together with the window.
|
10465 | * `false` by default.
|
10466 | */
|
10467 | height?: boolean;
|
10468 | /**
|
10469 | * If `true`, the view's x position and width will grow and shrink proportionally
|
10470 | * with the window. `false` by default.
|
10471 | */
|
10472 | horizontal?: boolean;
|
10473 | /**
|
10474 | * If `true`, the view's y position and height will grow and shrink proportionally
|
10475 | * with the window. `false` by default.
|
10476 | */
|
10477 | vertical?: boolean;
|
10478 | }
|
10479 |
|
10480 | interface BeforeSendResponse {
|
10481 | cancel?: boolean;
|
10482 | /**
|
10483 | * When provided, request will be made with these headers.
|
10484 | */
|
10485 | requestHeaders?: Record<string, (string) | (string[])>;
|
10486 | }
|
10487 |
|
10488 | interface BitmapOptions {
|
10489 | /**
|
10490 | * Defaults to 1.0.
|
10491 | */
|
10492 | scaleFactor?: number;
|
10493 | }
|
10494 |
|
10495 | interface BlinkMemoryInfo {
|
10496 | /**
|
10497 | * Size of all allocated objects in Kilobytes.
|
10498 | */
|
10499 | allocated: number;
|
10500 | /**
|
10501 | * Size of all marked objects in Kilobytes.
|
10502 | */
|
10503 | marked: number;
|
10504 | /**
|
10505 | * Total allocated space in Kilobytes.
|
10506 | */
|
10507 | total: number;
|
10508 | }
|
10509 |
|
10510 | interface BrowserViewConstructorOptions {
|
10511 | /**
|
10512 | * See BrowserWindow.
|
10513 | */
|
10514 | webPreferences?: WebPreferences;
|
10515 | }
|
10516 |
|
10517 | interface BrowserWindowConstructorOptions {
|
10518 | /**
|
10519 | * Window's width in pixels. Default is `800`.
|
10520 | */
|
10521 | width?: number;
|
10522 | /**
|
10523 | * Window's height in pixels. Default is `600`.
|
10524 | */
|
10525 | height?: number;
|
10526 | /**
|
10527 | * (**required** if y is used) Window's left offset from screen. Default is to
|
10528 | * center the window.
|
10529 | */
|
10530 | x?: number;
|
10531 | /**
|
10532 | * (**required** if x is used) Window's top offset from screen. Default is to
|
10533 | * center the window.
|
10534 | */
|
10535 | y?: number;
|
10536 | /**
|
10537 | * The `width` and `height` would be used as web page's size, which means the
|
10538 | * actual window's size will include window frame's size and be slightly larger.
|
10539 | * Default is `false`.
|
10540 | */
|
10541 | useContentSize?: boolean;
|
10542 | /**
|
10543 | * Show window in the center of the screen.
|
10544 | */
|
10545 | center?: boolean;
|
10546 | /**
|
10547 | * Window's minimum width. Default is `0`.
|
10548 | */
|
10549 | minWidth?: number;
|
10550 | /**
|
10551 | * Window's minimum height. Default is `0`.
|
10552 | */
|
10553 | minHeight?: number;
|
10554 | /**
|
10555 | * Window's maximum width. Default is no limit.
|
10556 | */
|
10557 | maxWidth?: number;
|
10558 | /**
|
10559 | * Window's maximum height. Default is no limit.
|
10560 | */
|
10561 | maxHeight?: number;
|
10562 | /**
|
10563 | * Whether window is resizable. Default is `true`.
|
10564 | */
|
10565 | resizable?: boolean;
|
10566 | /**
|
10567 | * Whether window is movable. This is not implemented on Linux. Default is `true`.
|
10568 | */
|
10569 | movable?: boolean;
|
10570 | /**
|
10571 | * Whether window is minimizable. This is not implemented on Linux. Default is
|
10572 | * `true`.
|
10573 | */
|
10574 | minimizable?: boolean;
|
10575 | /**
|
10576 | * Whether window is maximizable. This is not implemented on Linux. Default is
|
10577 | * `true`.
|
10578 | */
|
10579 | maximizable?: boolean;
|
10580 | /**
|
10581 | * Whether window is closable. This is not implemented on Linux. Default is `true`.
|
10582 | */
|
10583 | closable?: boolean;
|
10584 | /**
|
10585 | * Whether the window can be focused. Default is `true`. On Windows setting
|
10586 | * `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
|
10587 | * `focusable: false` makes the window stop interacting with wm, so the window will
|
10588 | * always stay on top in all workspaces.
|
10589 | */
|
10590 | focusable?: boolean;
|
10591 | /**
|
10592 | * Whether the window should always stay on top of other windows. Default is
|
10593 | * `false`.
|
10594 | */
|
10595 | alwaysOnTop?: boolean;
|
10596 | /**
|
10597 | * Whether the window should show in fullscreen. When explicitly set to `false` the
|
10598 | * fullscreen button will be hidden or disabled on macOS. Default is `false`.
|
10599 | */
|
10600 | fullscreen?: boolean;
|
10601 | /**
|
10602 | * Whether the window can be put into fullscreen mode. On macOS, also whether the
|
10603 | * maximize/zoom button should toggle full screen mode or maximize window. Default
|
10604 | * is `true`.
|
10605 | */
|
10606 | fullscreenable?: boolean;
|
10607 | /**
|
10608 | * Use pre-Lion fullscreen on macOS. Default is `false`.
|
10609 | */
|
10610 | simpleFullscreen?: boolean;
|
10611 | /**
|
10612 | * Whether to show the window in taskbar. Default is `false`.
|
10613 | */
|
10614 | skipTaskbar?: boolean;
|
10615 | /**
|
10616 | * The kiosk mode. Default is `false`.
|
10617 | */
|
10618 | kiosk?: boolean;
|
10619 | /**
|
10620 | * Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
|
10621 | * defined in the HTML file loaded by `loadURL()`, this property will be ignored.
|
10622 | */
|
10623 | title?: string;
|
10624 | /**
|
10625 | * The window icon. On Windows it is recommended to use `ICO` icons to get best
|
10626 | * visual effects, you can also leave it undefined so the executable's icon will be
|
10627 | * used.
|
10628 | */
|
10629 | icon?: (NativeImage) | (string);
|
10630 | /**
|
10631 | * Whether window should be shown when created. Default is `true`.
|
10632 | */
|
10633 | show?: boolean;
|
10634 | /**
|
10635 | * Whether the renderer should be active when `show` is `false` and it has just
|
10636 | * been created. In order for `document.visibilityState` to work correctly on
|
10637 | * first load with `show: false` you should set this to `false`. Setting this to
|
10638 | * `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
10639 | */
|
10640 | paintWhenInitiallyHidden?: boolean;
|
10641 | /**
|
10642 | * Specify `false` to create a Frameless Window. Default is `true`.
|
10643 | */
|
10644 | frame?: boolean;
|
10645 | /**
|
10646 | * Specify parent window. Default is `null`.
|
10647 | */
|
10648 | parent?: BrowserWindow;
|
10649 | /**
|
10650 | * Whether this is a modal window. This only works when the window is a child
|
10651 | * window. Default is `false`.
|
10652 | */
|
10653 | modal?: boolean;
|
10654 | /**
|
10655 | * Whether the web view accepts a single mouse-down event that simultaneously
|
10656 | * activates the window. Default is `false`.
|
10657 | */
|
10658 | acceptFirstMouse?: boolean;
|
10659 | /**
|
10660 | * Whether to hide cursor when typing. Default is `false`.
|
10661 | */
|
10662 | disableAutoHideCursor?: boolean;
|
10663 | /**
|
10664 | * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
|
10665 | */
|
10666 | autoHideMenuBar?: boolean;
|
10667 | /**
|
10668 | * Enable the window to be resized larger than screen. Only relevant for macOS, as
|
10669 | * other OSes allow larger-than-screen windows by default. Default is `false`.
|
10670 | */
|
10671 | enableLargerThanScreen?: boolean;
|
10672 | /**
|
10673 | * Window's background color as a hexadecimal value, like `#66CD00` or `#FFF` or
|
10674 | * `#80FFFFFF` (alpha in #AARRGGBB format is supported if `transparent` is set to
|
10675 | * `true`). Default is `#FFF` (white).
|
10676 | */
|
10677 | backgroundColor?: string;
|
10678 | /**
|
10679 | * Whether window should have a shadow. This is only implemented on macOS. Default
|
10680 | * is `true`.
|
10681 | */
|
10682 | hasShadow?: boolean;
|
10683 | /**
|
10684 | * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
|
10685 | * (fully opaque). This is only implemented on Windows and macOS.
|
10686 | */
|
10687 | opacity?: number;
|
10688 | /**
|
10689 | * Forces using dark theme for the window, only works on some GTK+3 desktop
|
10690 | * environments. Default is `false`.
|
10691 | */
|
10692 | darkTheme?: boolean;
|
10693 | /**
|
10694 | * Makes the window transparent. Default is `false`. On Windows, does not work
|
10695 | * unless the window is frameless.
|
10696 | */
|
10697 | transparent?: boolean;
|
10698 | /**
|
10699 | * The type of window, default is normal window. See more about this below.
|
10700 | */
|
10701 | type?: string;
|
10702 | /**
|
10703 | * The style of window title bar. Default is `default`. Possible values are:
|
10704 | */
|
10705 | titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
|
10706 | /**
|
10707 | * Shows the title in the title bar in full screen mode on macOS for all
|
10708 | * `titleBarStyle` options. Default is `false`.
|
10709 | */
|
10710 | fullscreenWindowTitle?: boolean;
|
10711 | /**
|
10712 | * Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
|
10713 | * window frame. Setting it to `false` will remove window shadow and window
|
10714 | * animations. Default is `true`.
|
10715 | */
|
10716 | thickFrame?: boolean;
|
10717 | /**
|
10718 | * Add a type of vibrancy effect to the window, only on macOS. Can be
|
10719 | * `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`,
|
10720 | * `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`,
|
10721 | * `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please
|
10722 | * note that using `frame: false` in combination with a vibrancy value requires
|
10723 | * that you use a non-default `titleBarStyle` as well. Also note that
|
10724 | * `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been
|
10725 | * deprecated and will be removed in an upcoming version of macOS.
|
10726 | */
|
10727 | vibrancy?: ('appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
|
10728 | /**
|
10729 | * Controls the behavior on macOS when option-clicking the green stoplight button
|
10730 | * on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
|
10731 | * will grow to the preferred width of the web page when zoomed, `false` will cause
|
10732 | * it to zoom to the width of the screen. This will also affect the behavior when
|
10733 | * calling `maximize()` directly. Default is `false`.
|
10734 | */
|
10735 | zoomToPageWidth?: boolean;
|
10736 | /**
|
10737 | * Tab group name, allows opening the window as a native tab on macOS 10.12+.
|
10738 | * Windows with the same tabbing identifier will be grouped together. This also
|
10739 | * adds a native new tab button to your window's tab bar and allows your `app` and
|
10740 | * window to receive the `new-window-for-tab` event.
|
10741 | */
|
10742 | tabbingIdentifier?: string;
|
10743 | /**
|
10744 | * Settings of web page's features.
|
10745 | */
|
10746 | webPreferences?: WebPreferences;
|
10747 | }
|
10748 |
|
10749 | interface CertificateTrustDialogOptions {
|
10750 | /**
|
10751 | * The certificate to trust/import.
|
10752 | */
|
10753 | certificate: Certificate;
|
10754 | /**
|
10755 | * The message to display to the user.
|
10756 | */
|
10757 | message: string;
|
10758 | }
|
10759 |
|
10760 | interface ClearStorageDataOptions {
|
10761 | /**
|
10762 | * Should follow `window.location.origin`’s representation `scheme://host:port`.
|
10763 | */
|
10764 | origin?: string;
|
10765 | /**
|
10766 | * The types of storages to clear, can contain: `appcache`, `cookies`,
|
10767 | * `filesystem`, `indexdb`, `localstorage`, `shadercache`, `websql`,
|
10768 | * `serviceworkers`, `cachestorage`.
|
10769 | */
|
10770 | storages?: string[];
|
10771 | /**
|
10772 | * The types of quotas to clear, can contain: `temporary`, `persistent`,
|
10773 | * `syncable`.
|
10774 | */
|
10775 | quotas?: string[];
|
10776 | }
|
10777 |
|
10778 | interface ClientRequestConstructorOptions {
|
10779 | /**
|
10780 | * The HTTP request method. Defaults to the GET method.
|
10781 | */
|
10782 | method?: string;
|
10783 | /**
|
10784 | * The request URL. Must be provided in the absolute form with the protocol scheme
|
10785 | * specified as http or https.
|
10786 | */
|
10787 | url?: string;
|
10788 | /**
|
10789 | * The `Session` instance with which the request is associated.
|
10790 | */
|
10791 | session?: Session;
|
10792 | /**
|
10793 | * The name of the `partition` with which the request is associated. Defaults to
|
10794 | * the empty string. The `session` option prevails on `partition`. Thus if a
|
10795 | * `session` is explicitly specified, `partition` is ignored.
|
10796 | */
|
10797 | partition?: string;
|
10798 | /**
|
10799 | * The protocol scheme in the form 'scheme:'. Currently supported values are
|
10800 | * 'http:' or 'https:'. Defaults to 'http:'.
|
10801 | */
|
10802 | protocol?: string;
|
10803 | /**
|
10804 | * The server host provided as a concatenation of the hostname and the port number
|
10805 | * 'hostname:port'.
|
10806 | */
|
10807 | host?: string;
|
10808 | /**
|
10809 | * The server host name.
|
10810 | */
|
10811 | hostname?: string;
|
10812 | /**
|
10813 | * The server's listening port number.
|
10814 | */
|
10815 | port?: number;
|
10816 | /**
|
10817 | * The path part of the request URL.
|
10818 | */
|
10819 | path?: string;
|
10820 | /**
|
10821 | * The redirect mode for this request. Should be one of `follow`, `error` or
|
10822 | * `manual`. Defaults to `follow`. When mode is `error`, any redirection will be
|
10823 | * aborted. When mode is `manual` the redirection will be cancelled unless
|
10824 | * `request.followRedirect` is invoked synchronously during the `redirect` event.
|
10825 | */
|
10826 | redirect?: string;
|
10827 | }
|
10828 |
|
10829 | interface Config {
|
10830 | /**
|
10831 | * The URL associated with the PAC file.
|
10832 | */
|
10833 | pacScript: string;
|
10834 | /**
|
10835 | * Rules indicating which proxies to use.
|
10836 | */
|
10837 | proxyRules: string;
|
10838 | /**
|
10839 | * Rules indicating which URLs should bypass the proxy settings.
|
10840 | */
|
10841 | proxyBypassRules: string;
|
10842 | }
|
10843 |
|
10844 | interface ConsoleMessageEvent extends Event {
|
10845 | level: number;
|
10846 | message: string;
|
10847 | line: number;
|
10848 | sourceId: string;
|
10849 | }
|
10850 |
|
10851 | interface ContextMenuParams {
|
10852 | /**
|
10853 | * x coordinate.
|
10854 | */
|
10855 | x: number;
|
10856 | /**
|
10857 | * y coordinate.
|
10858 | */
|
10859 | y: number;
|
10860 | /**
|
10861 | * URL of the link that encloses the node the context menu was invoked on.
|
10862 | */
|
10863 | linkURL: string;
|
10864 | /**
|
10865 | * Text associated with the link. May be an empty string if the contents of the
|
10866 | * link are an image.
|
10867 | */
|
10868 | linkText: string;
|
10869 | /**
|
10870 | * URL of the top level page that the context menu was invoked on.
|
10871 | */
|
10872 | pageURL: string;
|
10873 | /**
|
10874 | * URL of the subframe that the context menu was invoked on.
|
10875 | */
|
10876 | frameURL: string;
|
10877 | /**
|
10878 | * Source URL for the element that the context menu was invoked on. Elements with
|
10879 | * source URLs are images, audio and video.
|
10880 | */
|
10881 | srcURL: string;
|
10882 | /**
|
10883 | * Type of the node the context menu was invoked on. Can be `none`, `image`,
|
10884 | * `audio`, `video`, `canvas`, `file` or `plugin`.
|
10885 | */
|
10886 | mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
|
10887 | /**
|
10888 | * Whether the context menu was invoked on an image which has non-empty contents.
|
10889 | */
|
10890 | hasImageContents: boolean;
|
10891 | /**
|
10892 | * Whether the context is editable.
|
10893 | */
|
10894 | isEditable: boolean;
|
10895 | /**
|
10896 | * Text of the selection that the context menu was invoked on.
|
10897 | */
|
10898 | selectionText: string;
|
10899 | /**
|
10900 | * Title or alt text of the selection that the context was invoked on.
|
10901 | */
|
10902 | titleText: string;
|
10903 | /**
|
10904 | * The misspelled word under the cursor, if any.
|
10905 | */
|
10906 | misspelledWord: string;
|
10907 | /**
|
10908 | * The character encoding of the frame on which the menu was invoked.
|
10909 | */
|
10910 | frameCharset: string;
|
10911 | /**
|
10912 | * If the context menu was invoked on an input field, the type of that field.
|
10913 | * Possible values are `none`, `plainText`, `password`, `other`.
|
10914 | */
|
10915 | inputFieldType: string;
|
10916 | /**
|
10917 | * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
|
10918 | * `touch` or `touchMenu`.
|
10919 | */
|
10920 | menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu');
|
10921 | /**
|
10922 | * The flags for the media element the context menu was invoked on.
|
10923 | */
|
10924 | mediaFlags: MediaFlags;
|
10925 | /**
|
10926 | * These flags indicate whether the renderer believes it is able to perform the
|
10927 | * corresponding action.
|
10928 | */
|
10929 | editFlags: EditFlags;
|
10930 | }
|
10931 |
|
10932 | interface CookiesGetFilter {
|
10933 | /**
|
10934 | * Retrieves cookies which are associated with `url`. Empty implies retrieving
|
10935 | * cookies of all URLs.
|
10936 | */
|
10937 | url?: string;
|
10938 | /**
|
10939 | * Filters cookies by name.
|
10940 | */
|
10941 | name?: string;
|
10942 | /**
|
10943 | * Retrieves cookies whose domains match or are subdomains of `domains`.
|
10944 | */
|
10945 | domain?: string;
|
10946 | /**
|
10947 | * Retrieves cookies whose path matches `path`.
|
10948 | */
|
10949 | path?: string;
|
10950 | /**
|
10951 | * Filters cookies by their Secure property.
|
10952 | */
|
10953 | secure?: boolean;
|
10954 | /**
|
10955 | * Filters out session or persistent cookies.
|
10956 | */
|
10957 | session?: boolean;
|
10958 | }
|
10959 |
|
10960 | interface CookiesSetDetails {
|
10961 | /**
|
10962 | * The URL to associate the cookie with. The promise will be rejected if the URL is
|
10963 | * invalid.
|
10964 | */
|
10965 | url: string;
|
10966 | /**
|
10967 | * The name of the cookie. Empty by default if omitted.
|
10968 | */
|
10969 | name?: string;
|
10970 | /**
|
10971 | * The value of the cookie. Empty by default if omitted.
|
10972 | */
|
10973 | value?: string;
|
10974 | /**
|
10975 | * The domain of the cookie; this will be normalized with a preceding dot so that
|
10976 | * it's also valid for subdomains. Empty by default if omitted.
|
10977 | */
|
10978 | domain?: string;
|
10979 | /**
|
10980 | * The path of the cookie. Empty by default if omitted.
|
10981 | */
|
10982 | path?: string;
|
10983 | /**
|
10984 | * Whether the cookie should be marked as Secure. Defaults to false.
|
10985 | */
|
10986 | secure?: boolean;
|
10987 | /**
|
10988 | * Whether the cookie should be marked as HTTP only. Defaults to false.
|
10989 | */
|
10990 | httpOnly?: boolean;
|
10991 | /**
|
10992 | * The expiration date of the cookie as the number of seconds since the UNIX epoch.
|
10993 | * If omitted then the cookie becomes a session cookie and will not be retained
|
10994 | * between sessions.
|
10995 | */
|
10996 | expirationDate?: number;
|
10997 | }
|
10998 |
|
10999 | interface CrashReporterStartOptions {
|
11000 | companyName: string;
|
11001 | /**
|
11002 | * URL that crash reports will be sent to as POST.
|
11003 | */
|
11004 | submitURL: string;
|
11005 | /**
|
11006 | * Defaults to `app.name`.
|
11007 | */
|
11008 | productName?: string;
|
11009 | /**
|
11010 | * Whether crash reports should be sent to the server. Default is `true`.
|
11011 | */
|
11012 | uploadToServer?: boolean;
|
11013 | /**
|
11014 | * Default is `false`.
|
11015 | */
|
11016 | ignoreSystemCrashHandler?: boolean;
|
11017 | /**
|
11018 | * An object you can define that will be sent along with the report. Only string
|
11019 | * properties are sent correctly. Nested objects are not supported. When using
|
11020 | * Windows, the property names and values must be fewer than 64 characters.
|
11021 | */
|
11022 | extra?: Record<string, string>;
|
11023 | /**
|
11024 | * Directory to store the crash reports temporarily (only used when the crash
|
11025 | * reporter is started via `process.crashReporter.start`).
|
11026 | */
|
11027 | crashesDirectory?: string;
|
11028 | }
|
11029 |
|
11030 | interface CreateFromBitmapOptions {
|
11031 | width: number;
|
11032 | height: number;
|
11033 | /**
|
11034 | * Defaults to 1.0.
|
11035 | */
|
11036 | scaleFactor?: number;
|
11037 | }
|
11038 |
|
11039 | interface CreateFromBufferOptions {
|
11040 | /**
|
11041 | * Required for bitmap buffers.
|
11042 | */
|
11043 | width?: number;
|
11044 | /**
|
11045 | * Required for bitmap buffers.
|
11046 | */
|
11047 | height?: number;
|
11048 | /**
|
11049 | * Defaults to 1.0.
|
11050 | */
|
11051 | scaleFactor?: number;
|
11052 | }
|
11053 |
|
11054 | interface CreateInterruptedDownloadOptions {
|
11055 | /**
|
11056 | * Absolute path of the download.
|
11057 | */
|
11058 | path: string;
|
11059 | /**
|
11060 | * Complete URL chain for the download.
|
11061 | */
|
11062 | urlChain: string[];
|
11063 | mimeType?: string;
|
11064 | /**
|
11065 | * Start range for the download.
|
11066 | */
|
11067 | offset: number;
|
11068 | /**
|
11069 | * Total length of the download.
|
11070 | */
|
11071 | length: number;
|
11072 | /**
|
11073 | * Last-Modified header value.
|
11074 | */
|
11075 | lastModified: string;
|
11076 | /**
|
11077 | * ETag header value.
|
11078 | */
|
11079 | eTag: string;
|
11080 | /**
|
11081 | * Time when download was started in number of seconds since UNIX epoch.
|
11082 | */
|
11083 | startTime?: number;
|
11084 | }
|
11085 |
|
11086 | interface Data {
|
11087 | text?: string;
|
11088 | html?: string;
|
11089 | image?: NativeImage;
|
11090 | rtf?: string;
|
11091 | /**
|
11092 | * The title of the URL at `text`.
|
11093 | */
|
11094 | bookmark?: string;
|
11095 | }
|
11096 |
|
11097 | interface Details {
|
11098 | /**
|
11099 | * The security orign of the `media` check.
|
11100 | */
|
11101 | securityOrigin: string;
|
11102 | /**
|
11103 | * The type of media access being requested, can be `video`, `audio` or `unknown`
|
11104 | */
|
11105 | mediaType: ('video' | 'audio' | 'unknown');
|
11106 | /**
|
11107 | * The last URL the requesting frame loaded
|
11108 | */
|
11109 | requestingUrl: string;
|
11110 | /**
|
11111 | * Whether the frame making the request is the main frame
|
11112 | */
|
11113 | isMainFrame: boolean;
|
11114 | }
|
11115 |
|
11116 | interface DidChangeThemeColorEvent extends Event {
|
11117 | themeColor: string;
|
11118 | }
|
11119 |
|
11120 | interface DidFailLoadEvent extends Event {
|
11121 | errorCode: number;
|
11122 | errorDescription: string;
|
11123 | validatedURL: string;
|
11124 | isMainFrame: boolean;
|
11125 | }
|
11126 |
|
11127 | interface DidFrameFinishLoadEvent extends Event {
|
11128 | isMainFrame: boolean;
|
11129 | }
|
11130 |
|
11131 | interface DidNavigateEvent extends Event {
|
11132 | url: string;
|
11133 | }
|
11134 |
|
11135 | interface DidNavigateInPageEvent extends Event {
|
11136 | isMainFrame: boolean;
|
11137 | url: string;
|
11138 | }
|
11139 |
|
11140 | interface DisplayBalloonOptions {
|
11141 | icon?: (NativeImage) | (string);
|
11142 | title: string;
|
11143 | content: string;
|
11144 | }
|
11145 |
|
11146 | interface EnableNetworkEmulationOptions {
|
11147 | /**
|
11148 | * Whether to emulate network outage. Defaults to false.
|
11149 | */
|
11150 | offline?: boolean;
|
11151 | /**
|
11152 | * RTT in ms. Defaults to 0 which will disable latency throttling.
|
11153 | */
|
11154 | latency?: number;
|
11155 | /**
|
11156 | * Download rate in Bps. Defaults to 0 which will disable download throttling.
|
11157 | */
|
11158 | downloadThroughput?: number;
|
11159 | /**
|
11160 | * Upload rate in Bps. Defaults to 0 which will disable upload throttling.
|
11161 | */
|
11162 | uploadThroughput?: number;
|
11163 | }
|
11164 |
|
11165 | interface FeedURLOptions {
|
11166 | url: string;
|
11167 | /**
|
11168 | * HTTP request headers.
|
11169 | *
|
11170 | * @platform darwin
|
11171 | */
|
11172 | headers?: Record<string, string>;
|
11173 | /**
|
11174 | * Either `json` or `default`, see the Squirrel.Mac README for more information.
|
11175 | *
|
11176 | * @platform darwin
|
11177 | */
|
11178 | serverType?: string;
|
11179 | }
|
11180 |
|
11181 | interface FileIconOptions {
|
11182 | size: ('small' | 'normal' | 'large');
|
11183 | }
|
11184 |
|
11185 | interface Filter {
|
11186 | /**
|
11187 | * Array of URL patterns that will be used to filter out the requests that do not
|
11188 | * match the URL patterns.
|
11189 | */
|
11190 | urls: string[];
|
11191 | }
|
11192 |
|
11193 | interface FindInPageOptions {
|
11194 | /**
|
11195 | * Whether to search forward or backward, defaults to `true`.
|
11196 | */
|
11197 | forward?: boolean;
|
11198 | /**
|
11199 | * Whether the operation is first request or a follow up, defaults to `false`.
|
11200 | */
|
11201 | findNext?: boolean;
|
11202 | /**
|
11203 | * Whether search should be case-sensitive, defaults to `false`.
|
11204 | */
|
11205 | matchCase?: boolean;
|
11206 | /**
|
11207 | * Whether to look only at the start of words. defaults to `false`.
|
11208 | */
|
11209 | wordStart?: boolean;
|
11210 | /**
|
11211 | * When combined with `wordStart`, accepts a match in the middle of a word if the
|
11212 | * match begins with an uppercase letter followed by a lowercase or non-letter.
|
11213 | * Accepts several other intra-word matches, defaults to `false`.
|
11214 | */
|
11215 | medialCapitalAsWordStart?: boolean;
|
11216 | }
|
11217 |
|
11218 | interface FoundInPageEvent extends Event {
|
11219 | result: FoundInPageResult;
|
11220 | }
|
11221 |
|
11222 | interface FromPartitionOptions {
|
11223 | /**
|
11224 | * Whether to enable cache.
|
11225 | */
|
11226 | cache: boolean;
|
11227 | }
|
11228 |
|
11229 | interface HeadersReceivedResponse {
|
11230 | cancel?: boolean;
|
11231 | /**
|
11232 | * When provided, the server is assumed to have responded with these headers.
|
11233 | */
|
11234 | responseHeaders?: Record<string, (string) | (string[])>;
|
11235 | /**
|
11236 | * Should be provided when overriding `responseHeaders` to change header status
|
11237 | * otherwise original response header's status will be used.
|
11238 | */
|
11239 | statusLine?: string;
|
11240 | }
|
11241 |
|
11242 | interface HeapStatistics {
|
11243 | totalHeapSize: number;
|
11244 | totalHeapSizeExecutable: number;
|
11245 | totalPhysicalSize: number;
|
11246 | totalAvailableSize: number;
|
11247 | usedHeapSize: number;
|
11248 | heapSizeLimit: number;
|
11249 | mallocedMemory: number;
|
11250 | peakMallocedMemory: number;
|
11251 | doesZapGarbage: boolean;
|
11252 | }
|
11253 |
|
11254 | interface IgnoreMouseEventsOptions {
|
11255 | /**
|
11256 | * If true, forwards mouse move messages to Chromium, enabling mouse related events
|
11257 | * such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false,
|
11258 | * forwarding is always disabled regardless of this value.
|
11259 | *
|
11260 | * @platform darwin,win32
|
11261 | */
|
11262 | forward?: boolean;
|
11263 | }
|
11264 |
|
11265 | interface ImportCertificateOptions {
|
11266 | /**
|
11267 | * Path for the pkcs12 file.
|
11268 | */
|
11269 | certificate: string;
|
11270 | /**
|
11271 | * Passphrase for the certificate.
|
11272 | */
|
11273 | password: string;
|
11274 | }
|
11275 |
|
11276 | interface Info {
|
11277 | /**
|
11278 | * Security origin for the isolated world.
|
11279 | */
|
11280 | securityOrigin?: string;
|
11281 | /**
|
11282 | * Content Security Policy for the isolated world.
|
11283 | */
|
11284 | csp?: string;
|
11285 | /**
|
11286 | * Name for isolated world. Useful in devtools.
|
11287 | */
|
11288 | name?: string;
|
11289 | }
|
11290 |
|
11291 | interface Input {
|
11292 | /**
|
11293 | * Either `keyUp` or `keyDown`.
|
11294 | */
|
11295 | type: string;
|
11296 | /**
|
11297 | * Equivalent to KeyboardEvent.key.
|
11298 | */
|
11299 | key: string;
|
11300 | /**
|
11301 | * Equivalent to KeyboardEvent.code.
|
11302 | */
|
11303 | code: string;
|
11304 | /**
|
11305 | * Equivalent to KeyboardEvent.repeat.
|
11306 | */
|
11307 | isAutoRepeat: boolean;
|
11308 | /**
|
11309 | * Equivalent to KeyboardEvent.shiftKey.
|
11310 | */
|
11311 | shift: boolean;
|
11312 | /**
|
11313 | * Equivalent to KeyboardEvent.controlKey.
|
11314 | */
|
11315 | control: boolean;
|
11316 | /**
|
11317 | * Equivalent to KeyboardEvent.altKey.
|
11318 | */
|
11319 | alt: boolean;
|
11320 | /**
|
11321 | * Equivalent to KeyboardEvent.metaKey.
|
11322 | */
|
11323 | meta: boolean;
|
11324 | }
|
11325 |
|
11326 | interface InsertCSSOptions {
|
11327 | /**
|
11328 | * Can be either 'user' or 'author'; Specifying 'user' enables you to prevent
|
11329 | * websites from overriding the CSS you insert. Default is 'author'.
|
11330 | */
|
11331 | cssOrigin?: string;
|
11332 | }
|
11333 |
|
11334 | interface IpcMessageEvent extends Event {
|
11335 | channel: string;
|
11336 | args: any[];
|
11337 | }
|
11338 |
|
11339 | interface Item {
|
11340 | /**
|
11341 | * The path(s) to the file(s) being dragged.
|
11342 | */
|
11343 | file: (string[]) | (string);
|
11344 | /**
|
11345 | * The image must be non-empty on macOS.
|
11346 | */
|
11347 | icon: NativeImage;
|
11348 | }
|
11349 |
|
11350 | interface JumpListSettings {
|
11351 | /**
|
11352 | * The minimum number of items that will be shown in the Jump List (for a more
|
11353 | * detailed description of this value see the MSDN docs).
|
11354 | */
|
11355 | minItems: number;
|
11356 | /**
|
11357 | * Array of `JumpListItem` objects that correspond to items that the user has
|
11358 | * explicitly removed from custom categories in the Jump List. These items must not
|
11359 | * be re-added to the Jump List in the **next** call to `app.setJumpList()`,
|
11360 | * Windows will not display any custom category that contains any of the removed
|
11361 | * items.
|
11362 | */
|
11363 | removedItems: JumpListItem[];
|
11364 | }
|
11365 |
|
11366 | interface LoadCommitEvent extends Event {
|
11367 | url: string;
|
11368 | isMainFrame: boolean;
|
11369 | }
|
11370 |
|
11371 | interface LoadFileOptions {
|
11372 | /**
|
11373 | * Passed to `url.format()`.
|
11374 | */
|
11375 | query?: Record<string, string>;
|
11376 | /**
|
11377 | * Passed to `url.format()`.
|
11378 | */
|
11379 | search?: string;
|
11380 | /**
|
11381 | * Passed to `url.format()`.
|
11382 | */
|
11383 | hash?: string;
|
11384 | }
|
11385 |
|
11386 | interface LoadURLOptions {
|
11387 | /**
|
11388 | * An HTTP Referrer url.
|
11389 | */
|
11390 | httpReferrer?: (string) | (Referrer);
|
11391 | /**
|
11392 | * A user agent originating the request.
|
11393 | */
|
11394 | userAgent?: string;
|
11395 | /**
|
11396 | * Extra headers separated by "\n"
|
11397 | */
|
11398 | extraHeaders?: string;
|
11399 | postData?: (UploadRawData[]) | (UploadFile[]) | (UploadBlob[]);
|
11400 | /**
|
11401 | * Base url (with trailing path separator) for files to be loaded by the data url.
|
11402 | * This is needed only if the specified `url` is a data url and needs to load other
|
11403 | * files.
|
11404 | */
|
11405 | baseURLForDataURL?: string;
|
11406 | }
|
11407 |
|
11408 | interface LoginItemSettings {
|
11409 | /**
|
11410 | * `true` if the app is set to open at login.
|
11411 | */
|
11412 | openAtLogin: boolean;
|
11413 | /**
|
11414 | * `true` if the app is set to open as hidden at login. This setting is not
|
11415 | * available on MAS builds.
|
11416 | *
|
11417 | * @platform darwin
|
11418 | */
|
11419 | openAsHidden: boolean;
|
11420 | /**
|
11421 | * `true` if the app was opened at login automatically. This setting is not
|
11422 | * available on MAS builds.
|
11423 | *
|
11424 | * @platform darwin
|
11425 | */
|
11426 | wasOpenedAtLogin: boolean;
|
11427 | /**
|
11428 | * `true` if the app was opened as a hidden login item. This indicates that the app
|
11429 | * should not open any windows at startup. This setting is not available on MAS
|
11430 | * builds.
|
11431 | *
|
11432 | * @platform darwin
|
11433 | */
|
11434 | wasOpenedAsHidden: boolean;
|
11435 | /**
|
11436 | * `true` if the app was opened as a login item that should restore the state from
|
11437 | * the previous session. This indicates that the app should restore the windows
|
11438 | * that were open the last time the app was closed. This setting is not available
|
11439 | * on MAS builds.
|
11440 | *
|
11441 | * @platform darwin
|
11442 | */
|
11443 | restoreState: boolean;
|
11444 | }
|
11445 |
|
11446 | interface LoginItemSettingsOptions {
|
11447 | /**
|
11448 | * The executable path to compare against. Defaults to `process.execPath`.
|
11449 | *
|
11450 | * @platform win32
|
11451 | */
|
11452 | path?: string;
|
11453 | /**
|
11454 | * The command-line arguments to compare against. Defaults to an empty array.
|
11455 | *
|
11456 | * @platform win32
|
11457 | */
|
11458 | args?: string[];
|
11459 | }
|
11460 |
|
11461 | interface MenuItemConstructorOptions {
|
11462 | /**
|
11463 | * Will be called with `click(menuItem, browserWindow, event)` when the menu item
|
11464 | * is clicked.
|
11465 | */
|
11466 | click?: (menuItem: MenuItem, browserWindow: BrowserWindow, event: KeyboardEvent) => void;
|
11467 | |
11468 |
|
11469 |
|
11470 |
|
11471 |
|
11472 |
|
11473 |
|
11474 |
|
11475 |
|
11476 |
|
11477 |
|
11478 | role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'startSpeaking' | 'stopSpeaking' | 'close' | 'minimize' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
|
11479 | |
11480 |
|
11481 |
|
11482 | type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
|
11483 | label?: string;
|
11484 | sublabel?: string;
|
11485 | |
11486 |
|
11487 |
|
11488 |
|
11489 |
|
11490 | toolTip?: string;
|
11491 | accelerator?: Accelerator;
|
11492 | icon?: (NativeImage) | (string);
|
11493 | |
11494 |
|
11495 |
|
11496 | enabled?: boolean;
|
11497 | |
11498 |
|
11499 |
|
11500 |
|
11501 |
|
11502 |
|
11503 | acceleratorWorksWhenHidden?: boolean;
|
11504 | |
11505 |
|
11506 |
|
11507 | visible?: boolean;
|
11508 | |
11509 |
|
11510 |
|
11511 | checked?: boolean;
|
11512 | |
11513 |
|
11514 |
|
11515 |
|
11516 |
|
11517 |
|
11518 | registerAccelerator?: boolean;
|
11519 | |
11520 |
|
11521 |
|
11522 |
|
11523 |
|
11524 | submenu?: (MenuItemConstructorOptions[]) | (Menu);
|
11525 | |
11526 |
|
11527 |
|
11528 |
|
11529 | id?: string;
|
11530 | |
11531 |
|
11532 |
|
11533 |
|
11534 |
|
11535 |
|
11536 | before?: string[];
|
11537 | |
11538 |
|
11539 |
|
11540 |
|
11541 | after?: string[];
|
11542 | |
11543 |
|
11544 |
|
11545 |
|
11546 |
|
11547 | beforeGroupContaining?: string[];
|
11548 | |
11549 |
|
11550 |
|
11551 |
|
11552 |
|
11553 | afterGroupContaining?: string[];
|
11554 | }
|
11555 |
|
11556 | interface MessageBoxOptions {
|
11557 | |
11558 |
|
11559 |
|
11560 |
|
11561 |
|
11562 |
|
11563 | type?: string;
|
11564 | |
11565 |
|
11566 |
|
11567 |
|
11568 | buttons?: string[];
|
11569 | |
11570 |
|
11571 |
|
11572 |
|
11573 | defaultId?: number;
|
11574 | |
11575 |
|
11576 |
|
11577 | title?: string;
|
11578 | |
11579 |
|
11580 |
|
11581 | message: string;
|
11582 | |
11583 |
|
11584 |
|
11585 | detail?: string;
|
11586 | |
11587 |
|
11588 |
|
11589 | checkboxLabel?: string;
|
11590 | |
11591 |
|
11592 |
|
11593 | checkboxChecked?: boolean;
|
11594 | icon?: NativeImage;
|
11595 | |
11596 |
|
11597 |
|
11598 |
|
11599 |
|
11600 |
|
11601 | cancelId?: number;
|
11602 | |
11603 |
|
11604 |
|
11605 |
|
11606 |
|
11607 |
|
11608 | noLink?: boolean;
|
11609 | |
11610 |
|
11611 |
|
11612 |
|
11613 |
|
11614 |
|
11615 |
|
11616 |
|
11617 |
|
11618 | normalizeAccessKeys?: boolean;
|
11619 | }
|
11620 |
|
11621 | interface MessageBoxReturnValue {
|
11622 | |
11623 |
|
11624 |
|
11625 | response: number;
|
11626 | |
11627 |
|
11628 |
|
11629 | checkboxChecked: boolean;
|
11630 | }
|
11631 |
|
11632 | interface MessageBoxSyncOptions {
|
11633 | |
11634 |
|
11635 |
|
11636 |
|
11637 |
|
11638 |
|
11639 | type?: string;
|
11640 | |
11641 |
|
11642 |
|
11643 |
|
11644 | buttons?: string[];
|
11645 | |
11646 |
|
11647 |
|
11648 |
|
11649 | defaultId?: number;
|
11650 | |
11651 |
|
11652 |
|
11653 | title?: string;
|
11654 | |
11655 |
|
11656 |
|
11657 | message: string;
|
11658 | |
11659 |
|
11660 |
|
11661 | detail?: string;
|
11662 | |
11663 |
|
11664 |
|
11665 | checkboxLabel?: string;
|
11666 | |
11667 |
|
11668 |
|
11669 | checkboxChecked?: boolean;
|
11670 | icon?: (NativeImage) | (string);
|
11671 | |
11672 |
|
11673 |
|
11674 |
|
11675 |
|
11676 |
|
11677 | cancelId?: number;
|
11678 | |
11679 |
|
11680 |
|
11681 |
|
11682 |
|
11683 |
|
11684 | noLink?: boolean;
|
11685 | |
11686 |
|
11687 |
|
11688 |
|
11689 |
|
11690 |
|
11691 |
|
11692 |
|
11693 |
|
11694 | normalizeAccessKeys?: boolean;
|
11695 | }
|
11696 |
|
11697 | interface MoveToApplicationsFolderOptions {
|
11698 | |
11699 |
|
11700 |
|
11701 | conflictHandler?: (conflictType: 'exists' | 'existsAndRunning') => boolean;
|
11702 | }
|
11703 |
|
11704 | interface NewWindowEvent extends Event {
|
11705 | url: string;
|
11706 | frameName: string;
|
11707 | |
11708 |
|
11709 |
|
11710 |
|
11711 | disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other');
|
11712 | |
11713 |
|
11714 |
|
11715 | options: BrowserWindowConstructorOptions;
|
11716 | }
|
11717 |
|
11718 | interface NotificationConstructorOptions {
|
11719 | |
11720 |
|
11721 |
|
11722 |
|
11723 | title: string;
|
11724 | |
11725 |
|
11726 |
|
11727 |
|
11728 |
|
11729 | subtitle?: string;
|
11730 | |
11731 |
|
11732 |
|
11733 |
|
11734 | body: string;
|
11735 | |
11736 |
|
11737 |
|
11738 | silent?: boolean;
|
11739 | |
11740 |
|
11741 |
|
11742 | icon?: (string) | (NativeImage);
|
11743 | |
11744 |
|
11745 |
|
11746 |
|
11747 |
|
11748 | hasReply?: boolean;
|
11749 | |
11750 |
|
11751 |
|
11752 |
|
11753 |
|
11754 | replyPlaceholder?: string;
|
11755 | |
11756 |
|
11757 |
|
11758 |
|
11759 |
|
11760 | sound?: string;
|
11761 | |
11762 |
|
11763 |
|
11764 |
|
11765 |
|
11766 |
|
11767 | actions?: NotificationAction[];
|
11768 | |
11769 |
|
11770 |
|
11771 |
|
11772 |
|
11773 |
|
11774 | closeButtonText?: string;
|
11775 | }
|
11776 |
|
11777 | interface OnBeforeRedirectListenerDetails {
|
11778 | id: number;
|
11779 | url: string;
|
11780 | method: string;
|
11781 | webContentsId?: number;
|
11782 | resourceType: string;
|
11783 | referrer: string;
|
11784 | timestamp: number;
|
11785 | redirectURL: string;
|
11786 | statusCode: number;
|
11787 | statusLine: string;
|
11788 | |
11789 |
|
11790 |
|
11791 | ip?: string;
|
11792 | fromCache: boolean;
|
11793 | responseHeaders?: Record<string, string>;
|
11794 | }
|
11795 |
|
11796 | interface OnBeforeRequestListenerDetails {
|
11797 | id: number;
|
11798 | url: string;
|
11799 | method: string;
|
11800 | webContentsId?: number;
|
11801 | resourceType: string;
|
11802 | referrer: string;
|
11803 | timestamp: number;
|
11804 | uploadData: UploadData[];
|
11805 | }
|
11806 |
|
11807 | interface OnBeforeSendHeadersListenerDetails {
|
11808 | id: number;
|
11809 | url: string;
|
11810 | method: string;
|
11811 | webContentsId?: number;
|
11812 | resourceType: string;
|
11813 | referrer: string;
|
11814 | timestamp: number;
|
11815 | requestHeaders: Record<string, string>;
|
11816 | }
|
11817 |
|
11818 | interface OnCompletedListenerDetails {
|
11819 | id: number;
|
11820 | url: string;
|
11821 | method: string;
|
11822 | webContentsId?: number;
|
11823 | resourceType: string;
|
11824 | referrer: string;
|
11825 | timestamp: number;
|
11826 | responseHeaders?: Record<string, string>;
|
11827 | fromCache: boolean;
|
11828 | statusCode: number;
|
11829 | statusLine: string;
|
11830 | }
|
11831 |
|
11832 | interface OnErrorOccurredListenerDetails {
|
11833 | id: number;
|
11834 | url: string;
|
11835 | method: string;
|
11836 | webContentsId?: number;
|
11837 | resourceType: string;
|
11838 | referrer: string;
|
11839 | timestamp: number;
|
11840 | fromCache: boolean;
|
11841 | |
11842 |
|
11843 |
|
11844 | error: string;
|
11845 | }
|
11846 |
|
11847 | interface OnHeadersReceivedListenerDetails {
|
11848 | id: number;
|
11849 | url: string;
|
11850 | method: string;
|
11851 | webContentsId?: number;
|
11852 | resourceType: string;
|
11853 | referrer: string;
|
11854 | timestamp: number;
|
11855 | statusLine: string;
|
11856 | statusCode: number;
|
11857 | responseHeaders?: Record<string, string>;
|
11858 | }
|
11859 |
|
11860 | interface OnResponseStartedListenerDetails {
|
11861 | id: number;
|
11862 | url: string;
|
11863 | method: string;
|
11864 | webContentsId?: number;
|
11865 | resourceType: string;
|
11866 | referrer: string;
|
11867 | timestamp: number;
|
11868 | responseHeaders?: Record<string, string>;
|
11869 | |
11870 |
|
11871 |
|
11872 | fromCache: boolean;
|
11873 | statusCode: number;
|
11874 | statusLine: string;
|
11875 | }
|
11876 |
|
11877 | interface OnSendHeadersListenerDetails {
|
11878 | id: number;
|
11879 | url: string;
|
11880 | method: string;
|
11881 | webContentsId?: number;
|
11882 | resourceType: string;
|
11883 | referrer: string;
|
11884 | timestamp: number;
|
11885 | requestHeaders: Record<string, string>;
|
11886 | }
|
11887 |
|
11888 | interface OpenDevToolsOptions {
|
11889 | |
11890 |
|
11891 |
|
11892 |
|
11893 |
|
11894 | mode: ('right' | 'bottom' | 'undocked' | 'detach');
|
11895 | |
11896 |
|
11897 |
|
11898 |
|
11899 | activate?: boolean;
|
11900 | }
|
11901 |
|
11902 | interface OpenDialogOptions {
|
11903 | title?: string;
|
11904 | defaultPath?: string;
|
11905 | |
11906 |
|
11907 |
|
11908 |
|
11909 | buttonLabel?: string;
|
11910 | filters?: FileFilter[];
|
11911 | |
11912 |
|
11913 |
|
11914 |
|
11915 | properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory'>;
|
11916 | |
11917 |
|
11918 |
|
11919 |
|
11920 |
|
11921 | message?: string;
|
11922 | |
11923 |
|
11924 |
|
11925 |
|
11926 |
|
11927 | securityScopedBookmarks?: boolean;
|
11928 | }
|
11929 |
|
11930 | interface OpenDialogReturnValue {
|
11931 | |
11932 |
|
11933 |
|
11934 | canceled: boolean;
|
11935 | |
11936 |
|
11937 |
|
11938 |
|
11939 | filePaths: string[];
|
11940 | |
11941 |
|
11942 |
|
11943 |
|
11944 |
|
11945 |
|
11946 |
|
11947 | bookmarks?: string[];
|
11948 | }
|
11949 |
|
11950 | interface OpenDialogSyncOptions {
|
11951 | title?: string;
|
11952 | defaultPath?: string;
|
11953 | |
11954 |
|
11955 |
|
11956 |
|
11957 | buttonLabel?: string;
|
11958 | filters?: FileFilter[];
|
11959 | |
11960 |
|
11961 |
|
11962 |
|
11963 | properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory'>;
|
11964 | |
11965 |
|
11966 |
|
11967 |
|
11968 |
|
11969 | message?: string;
|
11970 | |
11971 |
|
11972 |
|
11973 |
|
11974 |
|
11975 | securityScopedBookmarks?: boolean;
|
11976 | }
|
11977 |
|
11978 | interface OpenExternalOptions {
|
11979 | |
11980 |
|
11981 |
|
11982 |
|
11983 |
|
11984 | activate?: boolean;
|
11985 | |
11986 |
|
11987 |
|
11988 |
|
11989 |
|
11990 | workingDirectory?: string;
|
11991 | }
|
11992 |
|
11993 | interface PageFaviconUpdatedEvent extends Event {
|
11994 | |
11995 |
|
11996 |
|
11997 | favicons: string[];
|
11998 | }
|
11999 |
|
12000 | interface PageTitleUpdatedEvent extends Event {
|
12001 | title: string;
|
12002 | explicitSet: boolean;
|
12003 | }
|
12004 |
|
12005 | interface Parameters {
|
12006 | |
12007 |
|
12008 |
|
12009 | screenPosition: ('desktop' | 'mobile');
|
12010 | |
12011 |
|
12012 |
|
12013 | screenSize: Size;
|
12014 | |
12015 |
|
12016 |
|
12017 |
|
12018 | viewPosition: Point;
|
12019 | |
12020 |
|
12021 |
|
12022 |
|
12023 | deviceScaleFactor: number;
|
12024 | |
12025 |
|
12026 |
|
12027 | viewSize: Size;
|
12028 | |
12029 |
|
12030 |
|
12031 |
|
12032 | scale: number;
|
12033 | }
|
12034 |
|
12035 | interface Payment {
|
12036 | |
12037 |
|
12038 |
|
12039 | productIdentifier: string;
|
12040 | |
12041 |
|
12042 |
|
12043 | quantity: number;
|
12044 | }
|
12045 |
|
12046 | interface PermissionRequestHandlerHandlerDetails {
|
12047 | |
12048 |
|
12049 |
|
12050 | externalURL?: string;
|
12051 | |
12052 |
|
12053 |
|
12054 | mediaTypes?: Array<'video' | 'audio'>;
|
12055 | |
12056 |
|
12057 |
|
12058 | requestingUrl: string;
|
12059 | |
12060 |
|
12061 |
|
12062 | isMainFrame: boolean;
|
12063 | }
|
12064 |
|
12065 | interface PluginCrashedEvent extends Event {
|
12066 | name: string;
|
12067 | version: string;
|
12068 | }
|
12069 |
|
12070 | interface PopupOptions {
|
12071 | |
12072 |
|
12073 |
|
12074 | window?: BrowserWindow;
|
12075 | |
12076 |
|
12077 |
|
12078 |
|
12079 | x?: number;
|
12080 | |
12081 |
|
12082 |
|
12083 |
|
12084 | y?: number;
|
12085 | |
12086 |
|
12087 |
|
12088 |
|
12089 |
|
12090 |
|
12091 | positioningItem?: number;
|
12092 | |
12093 |
|
12094 |
|
12095 | callback?: () => void;
|
12096 | }
|
12097 |
|
12098 | interface PreconnectOptions {
|
12099 | |
12100 |
|
12101 |
|
12102 | url: string;
|
12103 | |
12104 |
|
12105 |
|
12106 | numSockets?: number;
|
12107 | }
|
12108 |
|
12109 | interface PrintToPDFOptions {
|
12110 | |
12111 |
|
12112 |
|
12113 |
|
12114 | marginsType?: number;
|
12115 | |
12116 |
|
12117 |
|
12118 |
|
12119 | pageSize?: (string) | (Size);
|
12120 | |
12121 |
|
12122 |
|
12123 | printBackground?: boolean;
|
12124 | |
12125 |
|
12126 |
|
12127 | printSelectionOnly?: boolean;
|
12128 | |
12129 |
|
12130 |
|
12131 | landscape?: boolean;
|
12132 | }
|
12133 |
|
12134 | interface Privileges {
|
12135 | |
12136 |
|
12137 |
|
12138 | standard?: boolean;
|
12139 | |
12140 |
|
12141 |
|
12142 | secure?: boolean;
|
12143 | |
12144 |
|
12145 |
|
12146 | bypassCSP?: boolean;
|
12147 | |
12148 |
|
12149 |
|
12150 | allowServiceWorkers?: boolean;
|
12151 | |
12152 |
|
12153 |
|
12154 | supportFetchAPI?: boolean;
|
12155 | |
12156 |
|
12157 |
|
12158 | corsEnabled?: boolean;
|
12159 | }
|
12160 |
|
12161 | interface ProcRequest {
|
12162 | hostname: string;
|
12163 | certificate: Certificate;
|
12164 | |
12165 |
|
12166 |
|
12167 | verificationResult: string;
|
12168 | |
12169 |
|
12170 |
|
12171 | errorCode: number;
|
12172 | }
|
12173 |
|
12174 | interface ProgressBarOptions {
|
12175 | |
12176 |
|
12177 |
|
12178 |
|
12179 |
|
12180 |
|
12181 | mode: ('none' | 'normal' | 'indeterminate' | 'error' | 'paused');
|
12182 | }
|
12183 |
|
12184 | interface Provider {
|
12185 | spellCheck: (words: string[], callback: (misspeltWords: string[]) => void) => void;
|
12186 | }
|
12187 |
|
12188 | interface ReadBookmark {
|
12189 | title: string;
|
12190 | url: string;
|
12191 | }
|
12192 |
|
12193 | interface RedirectRequest {
|
12194 | url: string;
|
12195 | method?: string;
|
12196 | session?: (Session) | (null);
|
12197 | uploadData?: ProtocolResponseUploadData;
|
12198 | }
|
12199 |
|
12200 | interface RelaunchOptions {
|
12201 | args?: string[];
|
12202 | execPath?: string;
|
12203 | }
|
12204 |
|
12205 | interface Request {
|
12206 | url: string;
|
12207 | headers: Record<string, string>;
|
12208 | referrer: string;
|
12209 | method: string;
|
12210 | uploadData: UploadData[];
|
12211 | }
|
12212 |
|
12213 | interface ResizeOptions {
|
12214 | |
12215 |
|
12216 |
|
12217 | width?: number;
|
12218 | |
12219 |
|
12220 |
|
12221 | height?: number;
|
12222 | |
12223 |
|
12224 |
|
12225 |
|
12226 |
|
12227 |
|
12228 |
|
12229 | quality?: string;
|
12230 | }
|
12231 |
|
12232 | interface ResourceUsage {
|
12233 | images: MemoryUsageDetails;
|
12234 | scripts: MemoryUsageDetails;
|
12235 | cssStyleSheets: MemoryUsageDetails;
|
12236 | xslStyleSheets: MemoryUsageDetails;
|
12237 | fonts: MemoryUsageDetails;
|
12238 | other: MemoryUsageDetails;
|
12239 | }
|
12240 |
|
12241 | interface Response {
|
12242 | cancel?: boolean;
|
12243 | |
12244 |
|
12245 |
|
12246 |
|
12247 | redirectURL?: string;
|
12248 | }
|
12249 |
|
12250 | interface Result {
|
12251 | requestId: number;
|
12252 | |
12253 |
|
12254 |
|
12255 | activeMatchOrdinal: number;
|
12256 | |
12257 |
|
12258 |
|
12259 | matches: number;
|
12260 | |
12261 |
|
12262 |
|
12263 | selectionArea: Rectangle;
|
12264 | finalUpdate: boolean;
|
12265 | }
|
12266 |
|
12267 | interface SaveDialogOptions {
|
12268 | title?: string;
|
12269 | |
12270 |
|
12271 |
|
12272 | defaultPath?: string;
|
12273 | |
12274 |
|
12275 |
|
12276 |
|
12277 | buttonLabel?: string;
|
12278 | filters?: FileFilter[];
|
12279 | |
12280 |
|
12281 |
|
12282 |
|
12283 |
|
12284 | message?: string;
|
12285 | |
12286 |
|
12287 |
|
12288 |
|
12289 |
|
12290 | nameFieldLabel?: string;
|
12291 | |
12292 |
|
12293 |
|
12294 |
|
12295 |
|
12296 | showsTagField?: boolean;
|
12297 | |
12298 |
|
12299 |
|
12300 |
|
12301 |
|
12302 |
|
12303 |
|
12304 | securityScopedBookmarks?: boolean;
|
12305 | }
|
12306 |
|
12307 | interface SaveDialogReturnValue {
|
12308 | |
12309 |
|
12310 |
|
12311 | canceled: boolean;
|
12312 | |
12313 |
|
12314 |
|
12315 | filePath?: string;
|
12316 | |
12317 |
|
12318 |
|
12319 |
|
12320 |
|
12321 |
|
12322 | bookmark?: string;
|
12323 | }
|
12324 |
|
12325 | interface SaveDialogSyncOptions {
|
12326 | title?: string;
|
12327 | |
12328 |
|
12329 |
|
12330 | defaultPath?: string;
|
12331 | |
12332 |
|
12333 |
|
12334 |
|
12335 | buttonLabel?: string;
|
12336 | filters?: FileFilter[];
|
12337 | |
12338 |
|
12339 |
|
12340 |
|
12341 |
|
12342 | message?: string;
|
12343 | |
12344 |
|
12345 |
|
12346 |
|
12347 |
|
12348 | nameFieldLabel?: string;
|
12349 | |
12350 |
|
12351 |
|
12352 |
|
12353 |
|
12354 | showsTagField?: boolean;
|
12355 | |
12356 |
|
12357 |
|
12358 |
|
12359 |
|
12360 |
|
12361 |
|
12362 | securityScopedBookmarks?: boolean;
|
12363 | }
|
12364 |
|
12365 | interface Settings {
|
12366 | |
12367 |
|
12368 |
|
12369 |
|
12370 | openAtLogin?: boolean;
|
12371 | |
12372 |
|
12373 |
|
12374 |
|
12375 |
|
12376 |
|
12377 |
|
12378 |
|
12379 | openAsHidden?: boolean;
|
12380 | |
12381 |
|
12382 |
|
12383 |
|
12384 |
|
12385 | path?: string;
|
12386 | |
12387 |
|
12388 |
|
12389 |
|
12390 |
|
12391 |
|
12392 | args?: string[];
|
12393 | }
|
12394 |
|
12395 | interface SourcesOptions {
|
12396 | |
12397 |
|
12398 |
|
12399 |
|
12400 | types: string[];
|
12401 | |
12402 |
|
12403 |
|
12404 |
|
12405 |
|
12406 |
|
12407 | thumbnailSize?: Size;
|
12408 | |
12409 |
|
12410 |
|
12411 |
|
12412 |
|
12413 | fetchWindowIcons?: boolean;
|
12414 | }
|
12415 |
|
12416 | interface StartLoggingOptions {
|
12417 | |
12418 |
|
12419 |
|
12420 |
|
12421 |
|
12422 |
|
12423 | captureMode?: ('default' | 'includeSensitive' | 'everything');
|
12424 | |
12425 |
|
12426 |
|
12427 |
|
12428 | maxFileSize?: number;
|
12429 | }
|
12430 |
|
12431 | interface SystemMemoryInfo {
|
12432 | |
12433 |
|
12434 |
|
12435 | total: number;
|
12436 | |
12437 |
|
12438 |
|
12439 | free: number;
|
12440 | |
12441 |
|
12442 |
|
12443 |
|
12444 |
|
12445 | swapTotal: number;
|
12446 | |
12447 |
|
12448 |
|
12449 |
|
12450 |
|
12451 | swapFree: number;
|
12452 | }
|
12453 |
|
12454 | interface ToBitmapOptions {
|
12455 | |
12456 |
|
12457 |
|
12458 | scaleFactor?: number;
|
12459 | }
|
12460 |
|
12461 | interface ToDataURLOptions {
|
12462 | |
12463 |
|
12464 |
|
12465 | scaleFactor?: number;
|
12466 | }
|
12467 |
|
12468 | interface ToPNGOptions {
|
12469 | |
12470 |
|
12471 |
|
12472 | scaleFactor?: number;
|
12473 | }
|
12474 |
|
12475 | interface TouchBarButtonConstructorOptions {
|
12476 | |
12477 |
|
12478 |
|
12479 | label?: string;
|
12480 | |
12481 |
|
12482 |
|
12483 | backgroundColor?: string;
|
12484 | |
12485 |
|
12486 |
|
12487 | icon?: (NativeImage) | (string);
|
12488 | |
12489 |
|
12490 |
|
12491 | iconPosition?: ('left' | 'right' | 'overlay');
|
12492 | |
12493 |
|
12494 |
|
12495 | click?: () => void;
|
12496 | }
|
12497 |
|
12498 | interface TouchBarColorPickerConstructorOptions {
|
12499 | |
12500 |
|
12501 |
|
12502 | availableColors?: string[];
|
12503 | |
12504 |
|
12505 |
|
12506 | selectedColor?: string;
|
12507 | |
12508 |
|
12509 |
|
12510 | change?: (color: string) => void;
|
12511 | }
|
12512 |
|
12513 | interface TouchBarConstructorOptions {
|
12514 | items?: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>;
|
12515 | escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null);
|
12516 | }
|
12517 |
|
12518 | interface TouchBarGroupConstructorOptions {
|
12519 | |
12520 |
|
12521 |
|
12522 | items: TouchBar;
|
12523 | }
|
12524 |
|
12525 | interface TouchBarLabelConstructorOptions {
|
12526 | |
12527 |
|
12528 |
|
12529 | label?: string;
|
12530 | |
12531 |
|
12532 |
|
12533 | textColor?: string;
|
12534 | }
|
12535 |
|
12536 | interface TouchBarPopoverConstructorOptions {
|
12537 | |
12538 |
|
12539 |
|
12540 | label?: string;
|
12541 | |
12542 |
|
12543 |
|
12544 | icon?: NativeImage;
|
12545 | |
12546 |
|
12547 |
|
12548 | items?: TouchBar;
|
12549 | |
12550 |
|
12551 |
|
12552 |
|
12553 | showCloseButton?: boolean;
|
12554 | }
|
12555 |
|
12556 | interface TouchBarScrubberConstructorOptions {
|
12557 | |
12558 |
|
12559 |
|
12560 | items: ScrubberItem[];
|
12561 | |
12562 |
|
12563 |
|
12564 | select?: (selectedIndex: number) => void;
|
12565 | |
12566 |
|
12567 |
|
12568 | highlight?: (highlightedIndex: number) => void;
|
12569 | |
12570 |
|
12571 |
|
12572 | selectedStyle?: string;
|
12573 | |
12574 |
|
12575 |
|
12576 | overlayStyle?: string;
|
12577 | |
12578 |
|
12579 |
|
12580 | showArrowButtons?: boolean;
|
12581 | |
12582 |
|
12583 |
|
12584 | mode?: string;
|
12585 | |
12586 |
|
12587 |
|
12588 | continuous?: boolean;
|
12589 | }
|
12590 |
|
12591 | interface TouchBarSegmentedControlConstructorOptions {
|
12592 | |
12593 |
|
12594 |
|
12595 | segmentStyle?: ('automatic' | 'rounded' | 'textured-rounded' | 'round-rect' | 'textured-square' | 'capsule' | 'small-square' | 'separated');
|
12596 | |
12597 |
|
12598 |
|
12599 | mode?: ('single' | 'multiple' | 'buttons');
|
12600 | |
12601 |
|
12602 |
|
12603 | segments: SegmentedControlSegment[];
|
12604 | |
12605 |
|
12606 |
|
12607 |
|
12608 | selectedIndex?: number;
|
12609 | |
12610 |
|
12611 |
|
12612 | change?: (selectedIndex: number, isSelected: boolean) => void;
|
12613 | }
|
12614 |
|
12615 | interface TouchBarSliderConstructorOptions {
|
12616 | |
12617 |
|
12618 |
|
12619 | label?: string;
|
12620 | |
12621 |
|
12622 |
|
12623 | value?: number;
|
12624 | |
12625 |
|
12626 |
|
12627 | minValue?: number;
|
12628 | |
12629 |
|
12630 |
|
12631 | maxValue?: number;
|
12632 | |
12633 |
|
12634 |
|
12635 | change?: (newValue: number) => void;
|
12636 | }
|
12637 |
|
12638 | interface TouchBarSpacerConstructorOptions {
|
12639 | |
12640 |
|
12641 |
|
12642 | size?: ('small' | 'large' | 'flexible');
|
12643 | }
|
12644 |
|
12645 | interface TraceBufferUsageReturnValue {
|
12646 | value: number;
|
12647 | percentage: number;
|
12648 | }
|
12649 |
|
12650 | interface UpdateTargetUrlEvent extends Event {
|
12651 | url: string;
|
12652 | }
|
12653 |
|
12654 | interface UploadProgress {
|
12655 | |
12656 |
|
12657 |
|
12658 |
|
12659 | active: boolean;
|
12660 | |
12661 |
|
12662 |
|
12663 |
|
12664 | started: boolean;
|
12665 | |
12666 |
|
12667 |
|
12668 | current: number;
|
12669 | |
12670 |
|
12671 |
|
12672 | total: number;
|
12673 | }
|
12674 |
|
12675 | interface VisibleOnAllWorkspacesOptions {
|
12676 | |
12677 |
|
12678 |
|
12679 |
|
12680 |
|
12681 | visibleOnFullScreen?: boolean;
|
12682 | }
|
12683 |
|
12684 | interface WebContentsPrintOptions {
|
12685 | |
12686 |
|
12687 |
|
12688 | silent?: boolean;
|
12689 | |
12690 |
|
12691 |
|
12692 | printBackground?: boolean;
|
12693 | |
12694 |
|
12695 |
|
12696 | deviceName?: string;
|
12697 | |
12698 |
|
12699 |
|
12700 |
|
12701 | color?: boolean;
|
12702 | margins?: Margins;
|
12703 | |
12704 |
|
12705 |
|
12706 | landscape?: boolean;
|
12707 | |
12708 |
|
12709 |
|
12710 | scaleFactor?: number;
|
12711 | |
12712 |
|
12713 |
|
12714 | pagesPerSheet?: number;
|
12715 | |
12716 |
|
12717 |
|
12718 | collate?: boolean;
|
12719 | |
12720 |
|
12721 |
|
12722 | copies?: number;
|
12723 | |
12724 |
|
12725 |
|
12726 | pageRanges?: Record<string, number>;
|
12727 | |
12728 |
|
12729 |
|
12730 |
|
12731 | duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
|
12732 | dpi?: Dpi;
|
12733 | }
|
12734 |
|
12735 | interface WebviewTagPrintOptions {
|
12736 | |
12737 |
|
12738 |
|
12739 | silent?: boolean;
|
12740 | |
12741 |
|
12742 |
|
12743 | printBackground?: boolean;
|
12744 | |
12745 |
|
12746 |
|
12747 | deviceName?: string;
|
12748 | }
|
12749 |
|
12750 | interface WillNavigateEvent extends Event {
|
12751 | url: string;
|
12752 | }
|
12753 |
|
12754 | interface Dpi {
|
12755 | |
12756 |
|
12757 |
|
12758 | horizontal?: number;
|
12759 | |
12760 |
|
12761 |
|
12762 | vertical?: number;
|
12763 | }
|
12764 |
|
12765 | interface EditFlags {
|
12766 | |
12767 |
|
12768 |
|
12769 | canUndo: boolean;
|
12770 | |
12771 |
|
12772 |
|
12773 | canRedo: boolean;
|
12774 | |
12775 |
|
12776 |
|
12777 | canCut: boolean;
|
12778 | |
12779 |
|
12780 |
|
12781 | canCopy: boolean;
|
12782 | |
12783 |
|
12784 |
|
12785 | canPaste: boolean;
|
12786 | |
12787 |
|
12788 |
|
12789 | canDelete: boolean;
|
12790 | |
12791 |
|
12792 |
|
12793 | canSelectAll: boolean;
|
12794 | }
|
12795 |
|
12796 | interface FoundInPageResult {
|
12797 | requestId: number;
|
12798 | |
12799 |
|
12800 |
|
12801 | activeMatchOrdinal: number;
|
12802 | |
12803 |
|
12804 |
|
12805 | matches: number;
|
12806 | |
12807 |
|
12808 |
|
12809 | selectionArea: Rectangle;
|
12810 | finalUpdate: boolean;
|
12811 | }
|
12812 |
|
12813 | interface Margins {
|
12814 | |
12815 |
|
12816 |
|
12817 |
|
12818 | marginType?: ('default' | 'none' | 'printableArea' | 'custom');
|
12819 | |
12820 |
|
12821 |
|
12822 | top?: number;
|
12823 | |
12824 |
|
12825 |
|
12826 | bottom?: number;
|
12827 | |
12828 |
|
12829 |
|
12830 | left?: number;
|
12831 | |
12832 |
|
12833 |
|
12834 | right?: number;
|
12835 | }
|
12836 |
|
12837 | interface MediaFlags {
|
12838 | |
12839 |
|
12840 |
|
12841 | inError: boolean;
|
12842 | |
12843 |
|
12844 |
|
12845 | isPaused: boolean;
|
12846 | |
12847 |
|
12848 |
|
12849 | isMuted: boolean;
|
12850 | |
12851 |
|
12852 |
|
12853 | hasAudio: boolean;
|
12854 | |
12855 |
|
12856 |
|
12857 | isLooping: boolean;
|
12858 | |
12859 |
|
12860 |
|
12861 | isControlsVisible: boolean;
|
12862 | |
12863 |
|
12864 |
|
12865 | canToggleControls: boolean;
|
12866 | |
12867 |
|
12868 |
|
12869 | canRotate: boolean;
|
12870 | }
|
12871 |
|
12872 | interface WebPreferences {
|
12873 | |
12874 |
|
12875 |
|
12876 |
|
12877 | devTools?: boolean;
|
12878 | |
12879 |
|
12880 |
|
12881 | nodeIntegration?: boolean;
|
12882 | |
12883 |
|
12884 |
|
12885 |
|
12886 | nodeIntegrationInWorker?: boolean;
|
12887 | |
12888 |
|
12889 |
|
12890 |
|
12891 |
|
12892 | nodeIntegrationInSubFrames?: boolean;
|
12893 | |
12894 |
|
12895 |
|
12896 |
|
12897 |
|
12898 |
|
12899 |
|
12900 | preload?: string;
|
12901 | |
12902 |
|
12903 |
|
12904 |
|
12905 |
|
12906 |
|
12907 |
|
12908 |
|
12909 | sandbox?: boolean;
|
12910 | |
12911 |
|
12912 |
|
12913 | enableRemoteModule?: boolean;
|
12914 | |
12915 |
|
12916 |
|
12917 |
|
12918 |
|
12919 |
|
12920 | session?: Session;
|
12921 | |
12922 |
|
12923 |
|
12924 |
|
12925 |
|
12926 |
|
12927 |
|
12928 |
|
12929 | partition?: string;
|
12930 | |
12931 |
|
12932 |
|
12933 |
|
12934 |
|
12935 |
|
12936 |
|
12937 |
|
12938 | affinity?: string;
|
12939 | |
12940 |
|
12941 |
|
12942 | zoomFactor?: number;
|
12943 | |
12944 |
|
12945 |
|
12946 | javascript?: boolean;
|
12947 | |
12948 |
|
12949 |
|
12950 |
|
12951 |
|
12952 | webSecurity?: boolean;
|
12953 | |
12954 |
|
12955 |
|
12956 |
|
12957 | allowRunningInsecureContent?: boolean;
|
12958 | |
12959 |
|
12960 |
|
12961 | images?: boolean;
|
12962 | |
12963 |
|
12964 |
|
12965 | textAreasAreResizable?: boolean;
|
12966 | |
12967 |
|
12968 |
|
12969 | webgl?: boolean;
|
12970 | |
12971 |
|
12972 |
|
12973 | plugins?: boolean;
|
12974 | |
12975 |
|
12976 |
|
12977 | experimentalFeatures?: boolean;
|
12978 | |
12979 |
|
12980 |
|
12981 | scrollBounce?: boolean;
|
12982 | |
12983 |
|
12984 |
|
12985 |
|
12986 |
|
12987 | enableBlinkFeatures?: string;
|
12988 | |
12989 |
|
12990 |
|
12991 |
|
12992 |
|
12993 | disableBlinkFeatures?: string;
|
12994 | |
12995 |
|
12996 |
|
12997 | defaultFontFamily?: DefaultFontFamily;
|
12998 | |
12999 |
|
13000 |
|
13001 | defaultFontSize?: number;
|
13002 | |
13003 |
|
13004 |
|
13005 | defaultMonospaceFontSize?: number;
|
13006 | |
13007 |
|
13008 |
|
13009 | minimumFontSize?: number;
|
13010 | |
13011 |
|
13012 |
|
13013 | defaultEncoding?: string;
|
13014 | |
13015 |
|
13016 |
|
13017 |
|
13018 | backgroundThrottling?: boolean;
|
13019 | |
13020 |
|
13021 |
|
13022 |
|
13023 | offscreen?: boolean;
|
13024 | |
13025 |
|
13026 |
|
13027 |
|
13028 |
|
13029 |
|
13030 |
|
13031 |
|
13032 |
|
13033 |
|
13034 |
|
13035 |
|
13036 |
|
13037 |
|
13038 | contextIsolation?: boolean;
|
13039 | |
13040 |
|
13041 |
|
13042 |
|
13043 |
|
13044 | nativeWindowOpen?: boolean;
|
13045 | |
13046 |
|
13047 |
|
13048 |
|
13049 |
|
13050 |
|
13051 |
|
13052 |
|
13053 | webviewTag?: boolean;
|
13054 | |
13055 |
|
13056 |
|
13057 |
|
13058 |
|
13059 | additionalArguments?: string[];
|
13060 | |
13061 |
|
13062 |
|
13063 |
|
13064 | safeDialogs?: boolean;
|
13065 | |
13066 |
|
13067 |
|
13068 |
|
13069 |
|
13070 | safeDialogsMessage?: string;
|
13071 | |
13072 |
|
13073 |
|
13074 |
|
13075 | navigateOnDragDrop?: boolean;
|
13076 | |
13077 |
|
13078 |
|
13079 |
|
13080 |
|
13081 | autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
|
13082 | |
13083 |
|
13084 |
|
13085 |
|
13086 | disableHtmlFullscreenWindowResize?: boolean;
|
13087 | }
|
13088 |
|
13089 | interface DefaultFontFamily {
|
13090 | |
13091 |
|
13092 |
|
13093 | standard?: string;
|
13094 | |
13095 |
|
13096 |
|
13097 | serif?: string;
|
13098 | |
13099 |
|
13100 |
|
13101 | sansSerif?: string;
|
13102 | |
13103 |
|
13104 |
|
13105 | monospace?: string;
|
13106 | |
13107 |
|
13108 |
|
13109 | cursive?: string;
|
13110 | |
13111 |
|
13112 |
|
13113 | fantasy?: string;
|
13114 | }
|
13115 |
|
13116 | }
|
13117 |
|
13118 | declare module 'electron' {
|
13119 | export = Electron;
|
13120 | }
|
13121 |
|
13122 | interface NodeRequireFunction {
|
13123 | (moduleName: 'electron'): typeof Electron;
|
13124 | }
|
13125 |
|
13126 | interface File {
|
13127 | |
13128 |
|
13129 |
|
13130 | path: string;
|
13131 | }
|
13132 |
|
13133 | declare module 'original-fs' {
|
13134 | import * as fs from 'fs';
|
13135 | export = fs;
|
13136 | }
|
13137 |
|
13138 | interface Document {
|
13139 | createElement(tagName: 'webview'): Electron.WebviewTag;
|
13140 | }
|
13141 |
|
13142 | declare namespace NodeJS {
|
13143 | interface Process extends NodeJS.EventEmitter {
|
13144 |
|
13145 |
|
13146 |
|
13147 | |
13148 |
|
13149 |
|
13150 |
|
13151 |
|
13152 |
|
13153 |
|
13154 | on(event: 'loaded', listener: Function): this;
|
13155 | once(event: 'loaded', listener: Function): this;
|
13156 | addListener(event: 'loaded', listener: Function): this;
|
13157 | removeListener(event: 'loaded', listener: Function): this;
|
13158 | |
13159 |
|
13160 |
|
13161 | crash(): void;
|
13162 | |
13163 |
|
13164 |
|
13165 |
|
13166 |
|
13167 |
|
13168 |
|
13169 |
|
13170 |
|
13171 | getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
|
13172 | getCPUUsage(): Electron.CPUUsage;
|
13173 | |
13174 |
|
13175 |
|
13176 |
|
13177 |
|
13178 |
|
13179 |
|
13180 |
|
13181 | getCreationTime(): (number) | (null);
|
13182 | |
13183 |
|
13184 |
|
13185 |
|
13186 |
|
13187 |
|
13188 |
|
13189 |
|
13190 |
|
13191 |
|
13192 |
|
13193 |
|
13194 |
|
13195 |
|
13196 | getHeapStatistics(): Electron.HeapStatistics;
|
13197 | getIOCounters(): Electron.IOCounters;
|
13198 | |
13199 |
|
13200 |
|
13201 |
|
13202 |
|
13203 |
|
13204 |
|
13205 |
|
13206 |
|
13207 |
|
13208 |
|
13209 |
|
13210 |
|
13211 | getProcessMemoryInfo(): Promise<Electron.ProcessMemoryInfo>;
|
13212 | |
13213 |
|
13214 |
|
13215 |
|
13216 |
|
13217 |
|
13218 |
|
13219 |
|
13220 |
|
13221 |
|
13222 |
|
13223 |
|
13224 |
|
13225 | getSystemMemoryInfo(): Electron.SystemMemoryInfo;
|
13226 | |
13227 |
|
13228 |
|
13229 |
|
13230 |
|
13231 |
|
13232 |
|
13233 |
|
13234 | getSystemVersion(): string;
|
13235 | |
13236 |
|
13237 |
|
13238 | hang(): void;
|
13239 | |
13240 |
|
13241 |
|
13242 |
|
13243 |
|
13244 |
|
13245 | setFdLimit(maxDescriptors: number): void;
|
13246 | |
13247 |
|
13248 |
|
13249 |
|
13250 |
|
13251 | takeHeapSnapshot(filePath: string): boolean;
|
13252 | |
13253 |
|
13254 |
|
13255 |
|
13256 | readonly chrome: string;
|
13257 | |
13258 |
|
13259 |
|
13260 |
|
13261 |
|
13262 | readonly defaultApp: boolean;
|
13263 | |
13264 |
|
13265 |
|
13266 |
|
13267 | readonly electron: string;
|
13268 | |
13269 |
|
13270 |
|
13271 |
|
13272 |
|
13273 | enablePromiseAPIs: boolean;
|
13274 | |
13275 |
|
13276 |
|
13277 |
|
13278 |
|
13279 |
|
13280 | readonly isMainFrame: boolean;
|
13281 | |
13282 |
|
13283 |
|
13284 |
|
13285 |
|
13286 | readonly mas: boolean;
|
13287 | |
13288 |
|
13289 |
|
13290 |
|
13291 | noAsar: boolean;
|
13292 | |
13293 |
|
13294 |
|
13295 |
|
13296 |
|
13297 | noDeprecation: boolean;
|
13298 | |
13299 |
|
13300 |
|
13301 |
|
13302 | readonly resourcesPath: string;
|
13303 | |
13304 |
|
13305 |
|
13306 |
|
13307 |
|
13308 | readonly sandboxed: boolean;
|
13309 | |
13310 |
|
13311 |
|
13312 |
|
13313 |
|
13314 | throwDeprecation: boolean;
|
13315 | |
13316 |
|
13317 |
|
13318 |
|
13319 |
|
13320 |
|
13321 | traceDeprecation: boolean;
|
13322 | |
13323 |
|
13324 |
|
13325 |
|
13326 |
|
13327 |
|
13328 | traceProcessWarnings: boolean;
|
13329 | |
13330 |
|
13331 |
|
13332 |
|
13333 |
|
13334 | readonly type: string;
|
13335 | |
13336 |
|
13337 |
|
13338 |
|
13339 |
|
13340 | readonly windowsStore: boolean;
|
13341 | }
|
13342 | interface ProcessVersions {
|
13343 | readonly electron: string;
|
13344 | readonly chrome: string;
|
13345 | }
|
13346 | } |
\ | No newline at end of file |