UNPKG

969 kBTypeScriptView Raw
1// Type definitions for Electron 30.0.1
2// Project: http://electronjs.org/
3// Definitions by: The Electron Team <https://github.com/electron/electron>
4// Definitions: https://github.com/electron/typescript-definitions
5
6/// <reference types="node" />
7
8type DOMEvent = Event;
9type GlobalResponse = Response;
10type GlobalRequest = Request;
11
12declare namespace Electron {
13 const NodeEventEmitter: typeof import('events').EventEmitter;
14
15 type Accelerator = string;
16 type Event<Params extends object = {}> = {
17 preventDefault: () => void;
18 readonly defaultPrevented: boolean;
19 } & Params;
20
21 interface App extends NodeJS.EventEmitter {
22
23 // Docs: https://electronjs.org/docs/api/app
24
25 /**
26 * Emitted when Chrome's accessibility support changes. This event fires when
27 * assistive technologies, such as screen readers, are enabled or disabled. See
28 * https://www.chromium.org/developers/design-documents/accessibility for more
29 * details.
30 *
31 * @platform darwin,win32
32 */
33 on(event: 'accessibility-support-changed', listener: (event: Event,
34 /**
35 * `true` when Chrome's accessibility support is enabled, `false` otherwise.
36 */
37 accessibilitySupportEnabled: boolean) => void): this;
38 /**
39 * @platform darwin,win32
40 */
41 off(event: 'accessibility-support-changed', listener: (event: Event,
42 /**
43 * `true` when Chrome's accessibility support is enabled, `false` otherwise.
44 */
45 accessibilitySupportEnabled: boolean) => void): this;
46 /**
47 * @platform darwin,win32
48 */
49 once(event: 'accessibility-support-changed', listener: (event: Event,
50 /**
51 * `true` when Chrome's accessibility support is enabled, `false` otherwise.
52 */
53 accessibilitySupportEnabled: boolean) => void): this;
54 /**
55 * @platform darwin,win32
56 */
57 addListener(event: 'accessibility-support-changed', listener: (event: Event,
58 /**
59 * `true` when Chrome's accessibility support is enabled, `false` otherwise.
60 */
61 accessibilitySupportEnabled: boolean) => void): this;
62 /**
63 * @platform darwin,win32
64 */
65 removeListener(event: 'accessibility-support-changed', listener: (event: Event,
66 /**
67 * `true` when Chrome's accessibility support is enabled, `false` otherwise.
68 */
69 accessibilitySupportEnabled: boolean) => void): this;
70 /**
71 * Emitted when the application is activated. Various actions can trigger this
72 * event, such as launching the application for the first time, attempting to
73 * re-launch the application when it's already running, or clicking on the
74 * application's dock or taskbar icon.
75 *
76 * @platform darwin
77 */
78 on(event: 'activate', listener: (event: Event,
79 hasVisibleWindows: boolean) => void): this;
80 /**
81 * @platform darwin
82 */
83 off(event: 'activate', listener: (event: Event,
84 hasVisibleWindows: boolean) => void): this;
85 /**
86 * @platform darwin
87 */
88 once(event: 'activate', listener: (event: Event,
89 hasVisibleWindows: boolean) => void): this;
90 /**
91 * @platform darwin
92 */
93 addListener(event: 'activate', listener: (event: Event,
94 hasVisibleWindows: boolean) => void): this;
95 /**
96 * @platform darwin
97 */
98 removeListener(event: 'activate', listener: (event: Event,
99 hasVisibleWindows: boolean) => void): this;
100 /**
101 * Emitted during Handoff after an activity from this device was successfully
102 * resumed on another one.
103 *
104 * @platform darwin
105 */
106 on(event: 'activity-was-continued', listener: (event: Event,
107 /**
108 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
109 */
110 type: string,
111 /**
112 * Contains app-specific state stored by the activity.
113 */
114 userInfo: unknown) => void): this;
115 /**
116 * @platform darwin
117 */
118 off(event: 'activity-was-continued', listener: (event: Event,
119 /**
120 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
121 */
122 type: string,
123 /**
124 * Contains app-specific state stored by the activity.
125 */
126 userInfo: unknown) => void): this;
127 /**
128 * @platform darwin
129 */
130 once(event: 'activity-was-continued', listener: (event: Event,
131 /**
132 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
133 */
134 type: string,
135 /**
136 * Contains app-specific state stored by the activity.
137 */
138 userInfo: unknown) => void): this;
139 /**
140 * @platform darwin
141 */
142 addListener(event: 'activity-was-continued', listener: (event: Event,
143 /**
144 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
145 */
146 type: string,
147 /**
148 * Contains app-specific state stored by the activity.
149 */
150 userInfo: unknown) => void): this;
151 /**
152 * @platform darwin
153 */
154 removeListener(event: 'activity-was-continued', listener: (event: Event,
155 /**
156 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
157 */
158 type: string,
159 /**
160 * Contains app-specific state stored by the activity.
161 */
162 userInfo: unknown) => void): this;
163 /**
164 * Emitted before the application starts closing its windows. Calling
165 * `event.preventDefault()` will prevent the default behavior, which is terminating
166 * the application.
167 *
168 * **Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
169 * then `before-quit` is emitted _after_ emitting `close` event on all windows and
170 * closing them.
171 *
172 * **Note:** On Windows, this event will not be emitted if the app is closed due to
173 * a shutdown/restart of the system or a user logout.
174 */
175 on(event: 'before-quit', listener: (event: Event) => void): this;
176 off(event: 'before-quit', listener: (event: Event) => void): this;
177 once(event: 'before-quit', listener: (event: Event) => void): this;
178 addListener(event: 'before-quit', listener: (event: Event) => void): this;
179 removeListener(event: 'before-quit', listener: (event: Event) => void): this;
180 /**
181 * Emitted when a browserWindow gets blurred.
182 */
183 on(event: 'browser-window-blur', listener: (event: Event,
184 window: BrowserWindow) => void): this;
185 off(event: 'browser-window-blur', listener: (event: Event,
186 window: BrowserWindow) => void): this;
187 once(event: 'browser-window-blur', listener: (event: Event,
188 window: BrowserWindow) => void): this;
189 addListener(event: 'browser-window-blur', listener: (event: Event,
190 window: BrowserWindow) => void): this;
191 removeListener(event: 'browser-window-blur', listener: (event: Event,
192 window: BrowserWindow) => void): this;
193 /**
194 * Emitted when a new browserWindow is created.
195 */
196 on(event: 'browser-window-created', listener: (event: Event,
197 window: BrowserWindow) => void): this;
198 off(event: 'browser-window-created', listener: (event: Event,
199 window: BrowserWindow) => void): this;
200 once(event: 'browser-window-created', listener: (event: Event,
201 window: BrowserWindow) => void): this;
202 addListener(event: 'browser-window-created', listener: (event: Event,
203 window: BrowserWindow) => void): this;
204 removeListener(event: 'browser-window-created', listener: (event: Event,
205 window: BrowserWindow) => void): this;
206 /**
207 * Emitted when a browserWindow gets focused.
208 */
209 on(event: 'browser-window-focus', listener: (event: Event,
210 window: BrowserWindow) => void): this;
211 off(event: 'browser-window-focus', listener: (event: Event,
212 window: BrowserWindow) => void): this;
213 once(event: 'browser-window-focus', listener: (event: Event,
214 window: BrowserWindow) => void): this;
215 addListener(event: 'browser-window-focus', listener: (event: Event,
216 window: BrowserWindow) => void): this;
217 removeListener(event: 'browser-window-focus', listener: (event: Event,
218 window: BrowserWindow) => void): this;
219 /**
220 * Emitted when failed to verify the `certificate` for `url`, to trust the
221 * certificate you should prevent the default behavior with
222 * `event.preventDefault()` and call `callback(true)`.
223 */
224 on(event: 'certificate-error', listener: (event: Event,
225 webContents: WebContents,
226 url: string,
227 /**
228 * The error code
229 */
230 error: string,
231 certificate: Certificate,
232 callback: (isTrusted: boolean) => void,
233 isMainFrame: boolean) => void): this;
234 off(event: 'certificate-error', listener: (event: Event,
235 webContents: WebContents,
236 url: string,
237 /**
238 * The error code
239 */
240 error: string,
241 certificate: Certificate,
242 callback: (isTrusted: boolean) => void,
243 isMainFrame: boolean) => void): this;
244 once(event: 'certificate-error', listener: (event: Event,
245 webContents: WebContents,
246 url: string,
247 /**
248 * The error code
249 */
250 error: string,
251 certificate: Certificate,
252 callback: (isTrusted: boolean) => void,
253 isMainFrame: boolean) => void): this;
254 addListener(event: 'certificate-error', listener: (event: Event,
255 webContents: WebContents,
256 url: string,
257 /**
258 * The error code
259 */
260 error: string,
261 certificate: Certificate,
262 callback: (isTrusted: boolean) => void,
263 isMainFrame: boolean) => void): this;
264 removeListener(event: 'certificate-error', listener: (event: Event,
265 webContents: WebContents,
266 url: string,
267 /**
268 * The error code
269 */
270 error: string,
271 certificate: Certificate,
272 callback: (isTrusted: boolean) => void,
273 isMainFrame: boolean) => void): this;
274 /**
275 * Emitted when the child process unexpectedly disappears. This is normally because
276 * it was crashed or killed. It does not include renderer processes.
277 */
278 on(event: 'child-process-gone', listener: (event: Event,
279 details: Details) => void): this;
280 off(event: 'child-process-gone', listener: (event: Event,
281 details: Details) => void): this;
282 once(event: 'child-process-gone', listener: (event: Event,
283 details: Details) => void): this;
284 addListener(event: 'child-process-gone', listener: (event: Event,
285 details: Details) => void): this;
286 removeListener(event: 'child-process-gone', listener: (event: Event,
287 details: Details) => void): this;
288 /**
289 * Emitted during Handoff when an activity from a different device wants to be
290 * resumed. You should call `event.preventDefault()` if you want to handle this
291 * event.
292 *
293 * A user activity can be continued only in an app that has the same developer Team
294 * ID as the activity's source app and that supports the activity's type. Supported
295 * activity types are specified in the app's `Info.plist` under the
296 * `NSUserActivityTypes` key.
297 *
298 * @platform darwin
299 */
300 on(event: 'continue-activity', listener: (event: Event,
301 /**
302 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
303 */
304 type: string,
305 /**
306 * Contains app-specific state stored by the activity on another device.
307 */
308 userInfo: unknown,
309 details: ContinueActivityDetails) => void): this;
310 /**
311 * @platform darwin
312 */
313 off(event: 'continue-activity', listener: (event: Event,
314 /**
315 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
316 */
317 type: string,
318 /**
319 * Contains app-specific state stored by the activity on another device.
320 */
321 userInfo: unknown,
322 details: ContinueActivityDetails) => void): this;
323 /**
324 * @platform darwin
325 */
326 once(event: 'continue-activity', listener: (event: Event,
327 /**
328 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
329 */
330 type: string,
331 /**
332 * Contains app-specific state stored by the activity on another device.
333 */
334 userInfo: unknown,
335 details: ContinueActivityDetails) => void): this;
336 /**
337 * @platform darwin
338 */
339 addListener(event: 'continue-activity', listener: (event: Event,
340 /**
341 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
342 */
343 type: string,
344 /**
345 * Contains app-specific state stored by the activity on another device.
346 */
347 userInfo: unknown,
348 details: ContinueActivityDetails) => void): this;
349 /**
350 * @platform darwin
351 */
352 removeListener(event: 'continue-activity', listener: (event: Event,
353 /**
354 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
355 */
356 type: string,
357 /**
358 * Contains app-specific state stored by the activity on another device.
359 */
360 userInfo: unknown,
361 details: ContinueActivityDetails) => void): this;
362 /**
363 * Emitted during Handoff when an activity from a different device fails to be
364 * resumed.
365 *
366 * @platform darwin
367 */
368 on(event: 'continue-activity-error', listener: (event: Event,
369 /**
370 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
371 */
372 type: string,
373 /**
374 * A string with the error's localized description.
375 */
376 error: string) => void): this;
377 /**
378 * @platform darwin
379 */
380 off(event: 'continue-activity-error', listener: (event: Event,
381 /**
382 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
383 */
384 type: string,
385 /**
386 * A string with the error's localized description.
387 */
388 error: string) => void): this;
389 /**
390 * @platform darwin
391 */
392 once(event: 'continue-activity-error', listener: (event: Event,
393 /**
394 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
395 */
396 type: string,
397 /**
398 * A string with the error's localized description.
399 */
400 error: string) => void): this;
401 /**
402 * @platform darwin
403 */
404 addListener(event: 'continue-activity-error', listener: (event: Event,
405 /**
406 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
407 */
408 type: string,
409 /**
410 * A string with the error's localized description.
411 */
412 error: string) => void): this;
413 /**
414 * @platform darwin
415 */
416 removeListener(event: 'continue-activity-error', listener: (event: Event,
417 /**
418 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
419 */
420 type: string,
421 /**
422 * A string with the error's localized description.
423 */
424 error: string) => void): this;
425 /**
426 * Emitted when the application becomes active. This differs from the `activate`
427 * event in that `did-become-active` is emitted every time the app becomes active,
428 * not only when Dock icon is clicked or application is re-launched. It is also
429 * emitted when a user switches to the app via the macOS App Switcher.
430 *
431 * @platform darwin
432 */
433 on(event: 'did-become-active', listener: (event: Event) => void): this;
434 /**
435 * @platform darwin
436 */
437 off(event: 'did-become-active', listener: (event: Event) => void): this;
438 /**
439 * @platform darwin
440 */
441 once(event: 'did-become-active', listener: (event: Event) => void): this;
442 /**
443 * @platform darwin
444 */
445 addListener(event: 'did-become-active', listener: (event: Event) => void): this;
446 /**
447 * @platform darwin
448 */
449 removeListener(event: 'did-become-active', listener: (event: Event) => void): this;
450 /**
451 * Emitted when the app is no longer active and doesn’t have focus. This can be
452 * triggered, for example, by clicking on another application or by using the macOS
453 * App Switcher to switch to another application.
454 *
455 * @platform darwin
456 */
457 on(event: 'did-resign-active', listener: (event: Event) => void): this;
458 /**
459 * @platform darwin
460 */
461 off(event: 'did-resign-active', listener: (event: Event) => void): this;
462 /**
463 * @platform darwin
464 */
465 once(event: 'did-resign-active', listener: (event: Event) => void): this;
466 /**
467 * @platform darwin
468 */
469 addListener(event: 'did-resign-active', listener: (event: Event) => void): this;
470 /**
471 * @platform darwin
472 */
473 removeListener(event: 'did-resign-active', listener: (event: Event) => void): this;
474 /**
475 * Emitted whenever there is a GPU info update.
476 */
477 on(event: 'gpu-info-update', listener: Function): this;
478 off(event: 'gpu-info-update', listener: Function): this;
479 once(event: 'gpu-info-update', listener: Function): this;
480 addListener(event: 'gpu-info-update', listener: Function): this;
481 removeListener(event: 'gpu-info-update', listener: Function): this;
482 /**
483 * Emitted when `webContents` wants to do basic auth.
484 *
485 * The default behavior is to cancel all authentications. To override this you
486 * should prevent the default behavior with `event.preventDefault()` and call
487 * `callback(username, password)` with the credentials.
488 *
489 * If `callback` is called without a username or password, the authentication
490 * request will be cancelled and the authentication error will be returned to the
491 * page.
492 */
493 on(event: 'login', listener: (event: Event,
494 webContents: WebContents,
495 authenticationResponseDetails: AuthenticationResponseDetails,
496 authInfo: AuthInfo,
497 callback: (username?: string, password?: string) => void) => void): this;
498 off(event: 'login', listener: (event: Event,
499 webContents: WebContents,
500 authenticationResponseDetails: AuthenticationResponseDetails,
501 authInfo: AuthInfo,
502 callback: (username?: string, password?: string) => void) => void): this;
503 once(event: 'login', listener: (event: Event,
504 webContents: WebContents,
505 authenticationResponseDetails: AuthenticationResponseDetails,
506 authInfo: AuthInfo,
507 callback: (username?: string, password?: string) => void) => void): this;
508 addListener(event: 'login', listener: (event: Event,
509 webContents: WebContents,
510 authenticationResponseDetails: AuthenticationResponseDetails,
511 authInfo: AuthInfo,
512 callback: (username?: string, password?: string) => void) => void): this;
513 removeListener(event: 'login', listener: (event: Event,
514 webContents: WebContents,
515 authenticationResponseDetails: AuthenticationResponseDetails,
516 authInfo: AuthInfo,
517 callback: (username?: string, password?: string) => void) => void): this;
518 /**
519 * Emitted when the user clicks the native macOS new tab button. The new tab button
520 * is only visible if the current `BrowserWindow` has a `tabbingIdentifier`
521 *
522 * @platform darwin
523 */
524 on(event: 'new-window-for-tab', listener: (event: Event) => void): this;
525 /**
526 * @platform darwin
527 */
528 off(event: 'new-window-for-tab', listener: (event: Event) => void): this;
529 /**
530 * @platform darwin
531 */
532 once(event: 'new-window-for-tab', listener: (event: Event) => void): this;
533 /**
534 * @platform darwin
535 */
536 addListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
537 /**
538 * @platform darwin
539 */
540 removeListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
541 /**
542 * Emitted when the user wants to open a file with the application. The `open-file`
543 * event is usually emitted when the application is already open and the OS wants
544 * to reuse the application to open the file. `open-file` is also emitted when a
545 * file is dropped onto the dock and the application is not yet running. Make sure
546 * to listen for the `open-file` event very early in your application startup to
547 * handle this case (even before the `ready` event is emitted).
548 *
549 * You should call `event.preventDefault()` if you want to handle this event.
550 *
551 * On Windows, you have to parse `process.argv` (in the main process) to get the
552 * filepath.
553 *
554 * @platform darwin
555 */
556 on(event: 'open-file', listener: (event: Event,
557 path: string) => void): this;
558 /**
559 * @platform darwin
560 */
561 off(event: 'open-file', listener: (event: Event,
562 path: string) => void): this;
563 /**
564 * @platform darwin
565 */
566 once(event: 'open-file', listener: (event: Event,
567 path: string) => void): this;
568 /**
569 * @platform darwin
570 */
571 addListener(event: 'open-file', listener: (event: Event,
572 path: string) => void): this;
573 /**
574 * @platform darwin
575 */
576 removeListener(event: 'open-file', listener: (event: Event,
577 path: string) => void): this;
578 /**
579 * Emitted when the user wants to open a URL with the application. Your
580 * application's `Info.plist` file must define the URL scheme within the
581 * `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`.
582 *
583 * As with the `open-file` event, be sure to register a listener for the `open-url`
584 * event early in your application startup to detect if the application is being
585 * opened to handle a URL. If you register the listener in response to a `ready`
586 * event, you'll miss URLs that trigger the launch of your application.
587 *
588 * @platform darwin
589 */
590 on(event: 'open-url', listener: (event: Event,
591 url: string) => void): this;
592 /**
593 * @platform darwin
594 */
595 off(event: 'open-url', listener: (event: Event,
596 url: string) => void): this;
597 /**
598 * @platform darwin
599 */
600 once(event: 'open-url', listener: (event: Event,
601 url: string) => void): this;
602 /**
603 * @platform darwin
604 */
605 addListener(event: 'open-url', listener: (event: Event,
606 url: string) => void): this;
607 /**
608 * @platform darwin
609 */
610 removeListener(event: 'open-url', listener: (event: Event,
611 url: string) => void): this;
612 /**
613 * Emitted when the application is quitting.
614 *
615 * **Note:** On Windows, this event will not be emitted if the app is closed due to
616 * a shutdown/restart of the system or a user logout.
617 */
618 on(event: 'quit', listener: (event: Event,
619 exitCode: number) => void): this;
620 off(event: 'quit', listener: (event: Event,
621 exitCode: number) => void): this;
622 once(event: 'quit', listener: (event: Event,
623 exitCode: number) => void): this;
624 addListener(event: 'quit', listener: (event: Event,
625 exitCode: number) => void): this;
626 removeListener(event: 'quit', listener: (event: Event,
627 exitCode: number) => void): this;
628 /**
629 * Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
630 * holds the `userInfo` of the `NSUserNotification` or information from
631 * `UNNotificationResponse` that was used to open the application, if it was
632 * launched from Notification Center. You can also call `app.isReady()` to check if
633 * this event has already fired and `app.whenReady()` to get a Promise that is
634 * fulfilled when Electron is initialized.
635 *
636 * **Note**: The `ready` event is only fired after the main process has finished
637 * running the first tick of the event loop. If an Electron API needs to be called
638 * before the `ready` event, ensure that it is called synchronously in the
639 * top-level context of the main process.
640 */
641 on(event: 'ready', listener: (event: Event,
642 /**
643 * @platform darwin
644 */
645 launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
646 off(event: 'ready', listener: (event: Event,
647 /**
648 * @platform darwin
649 */
650 launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
651 once(event: 'ready', listener: (event: Event,
652 /**
653 * @platform darwin
654 */
655 launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
656 addListener(event: 'ready', listener: (event: Event,
657 /**
658 * @platform darwin
659 */
660 launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
661 removeListener(event: 'ready', listener: (event: Event,
662 /**
663 * @platform darwin
664 */
665 launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
666 /**
667 * Emitted when the renderer process unexpectedly disappears. This is normally
668 * because it was crashed or killed.
669 */
670 on(event: 'render-process-gone', listener: (event: Event,
671 webContents: WebContents,
672 details: RenderProcessGoneDetails) => void): this;
673 off(event: 'render-process-gone', listener: (event: Event,
674 webContents: WebContents,
675 details: RenderProcessGoneDetails) => void): this;
676 once(event: 'render-process-gone', listener: (event: Event,
677 webContents: WebContents,
678 details: RenderProcessGoneDetails) => void): this;
679 addListener(event: 'render-process-gone', listener: (event: Event,
680 webContents: WebContents,
681 details: RenderProcessGoneDetails) => void): this;
682 removeListener(event: 'render-process-gone', listener: (event: Event,
683 webContents: WebContents,
684 details: RenderProcessGoneDetails) => void): this;
685 /**
686 * This event will be emitted inside the primary instance of your application when
687 * a second instance has been executed and calls `app.requestSingleInstanceLock()`.
688 *
689 * `argv` is an Array of the second instance's command line arguments, and
690 * `workingDirectory` is its current working directory. Usually applications
691 * respond to this by making their primary window focused and non-minimized.
692 *
693 * **Note:** `argv` will not be exactly the same list of arguments as those passed
694 * to the second instance. The order might change and additional arguments might be
695 * appended. If you need to maintain the exact same arguments, it's advised to use
696 * `additionalData` instead.
697 *
698 * **Note:** If the second instance is started by a different user than the first,
699 * the `argv` array will not include the arguments.
700 *
701 * This event is guaranteed to be emitted after the `ready` event of `app` gets
702 * emitted.
703 *
704 * **Note:** Extra command line arguments might be added by Chromium, such as
705 * `--original-process-start-time`.
706 */
707 on(event: 'second-instance', listener: (event: Event,
708 /**
709 * An array of the second instance's command line arguments
710 */
711 argv: string[],
712 /**
713 * The second instance's working directory
714 */
715 workingDirectory: string,
716 /**
717 * A JSON object of additional data passed from the second instance
718 */
719 additionalData: unknown) => void): this;
720 off(event: 'second-instance', listener: (event: Event,
721 /**
722 * An array of the second instance's command line arguments
723 */
724 argv: string[],
725 /**
726 * The second instance's working directory
727 */
728 workingDirectory: string,
729 /**
730 * A JSON object of additional data passed from the second instance
731 */
732 additionalData: unknown) => void): this;
733 once(event: 'second-instance', listener: (event: Event,
734 /**
735 * An array of the second instance's command line arguments
736 */
737 argv: string[],
738 /**
739 * The second instance's working directory
740 */
741 workingDirectory: string,
742 /**
743 * A JSON object of additional data passed from the second instance
744 */
745 additionalData: unknown) => void): this;
746 addListener(event: 'second-instance', listener: (event: Event,
747 /**
748 * An array of the second instance's command line arguments
749 */
750 argv: string[],
751 /**
752 * The second instance's working directory
753 */
754 workingDirectory: string,
755 /**
756 * A JSON object of additional data passed from the second instance
757 */
758 additionalData: unknown) => void): this;
759 removeListener(event: 'second-instance', listener: (event: Event,
760 /**
761 * An array of the second instance's command line arguments
762 */
763 argv: string[],
764 /**
765 * The second instance's working directory
766 */
767 workingDirectory: string,
768 /**
769 * A JSON object of additional data passed from the second instance
770 */
771 additionalData: unknown) => void): this;
772 /**
773 * Emitted when a client certificate is requested.
774 *
775 * The `url` corresponds to the navigation entry requesting the client certificate
776 * and `callback` can be called with an entry filtered from the list. Using
777 * `event.preventDefault()` prevents the application from using the first
778 * certificate from the store.
779 */
780 on(event: 'select-client-certificate', listener: (event: Event,
781 webContents: WebContents,
782 url: string,
783 certificateList: Certificate[],
784 callback: (certificate?: Certificate) => void) => void): this;
785 off(event: 'select-client-certificate', listener: (event: Event,
786 webContents: WebContents,
787 url: string,
788 certificateList: Certificate[],
789 callback: (certificate?: Certificate) => void) => void): this;
790 once(event: 'select-client-certificate', listener: (event: Event,
791 webContents: WebContents,
792 url: string,
793 certificateList: Certificate[],
794 callback: (certificate?: Certificate) => void) => void): this;
795 addListener(event: 'select-client-certificate', listener: (event: Event,
796 webContents: WebContents,
797 url: string,
798 certificateList: Certificate[],
799 callback: (certificate?: Certificate) => void) => void): this;
800 removeListener(event: 'select-client-certificate', listener: (event: Event,
801 webContents: WebContents,
802 url: string,
803 certificateList: Certificate[],
804 callback: (certificate?: Certificate) => void) => void): this;
805 /**
806 * Emitted when Electron has created a new `session`.
807 */
808 on(event: 'session-created', listener: (session: Session) => void): this;
809 off(event: 'session-created', listener: (session: Session) => void): this;
810 once(event: 'session-created', listener: (session: Session) => void): this;
811 addListener(event: 'session-created', listener: (session: Session) => void): this;
812 removeListener(event: 'session-created', listener: (session: Session) => void): this;
813 /**
814 * Emitted when Handoff is about to be resumed on another device. If you need to
815 * update the state to be transferred, you should call `event.preventDefault()`
816 * immediately, construct a new `userInfo` dictionary and call
817 * `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will
818 * fail and `continue-activity-error` will be called.
819 *
820 * @platform darwin
821 */
822 on(event: 'update-activity-state', listener: (event: Event,
823 /**
824 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
825 */
826 type: string,
827 /**
828 * Contains app-specific state stored by the activity.
829 */
830 userInfo: unknown) => void): this;
831 /**
832 * @platform darwin
833 */
834 off(event: 'update-activity-state', listener: (event: Event,
835 /**
836 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
837 */
838 type: string,
839 /**
840 * Contains app-specific state stored by the activity.
841 */
842 userInfo: unknown) => void): this;
843 /**
844 * @platform darwin
845 */
846 once(event: 'update-activity-state', listener: (event: Event,
847 /**
848 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
849 */
850 type: string,
851 /**
852 * Contains app-specific state stored by the activity.
853 */
854 userInfo: unknown) => void): this;
855 /**
856 * @platform darwin
857 */
858 addListener(event: 'update-activity-state', listener: (event: Event,
859 /**
860 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
861 */
862 type: string,
863 /**
864 * Contains app-specific state stored by the activity.
865 */
866 userInfo: unknown) => void): this;
867 /**
868 * @platform darwin
869 */
870 removeListener(event: 'update-activity-state', listener: (event: Event,
871 /**
872 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
873 */
874 type: string,
875 /**
876 * Contains app-specific state stored by the activity.
877 */
878 userInfo: unknown) => void): this;
879 /**
880 * Emitted when a new webContents is created.
881 */
882 on(event: 'web-contents-created', listener: (event: Event,
883 webContents: WebContents) => void): this;
884 off(event: 'web-contents-created', listener: (event: Event,
885 webContents: WebContents) => void): this;
886 once(event: 'web-contents-created', listener: (event: Event,
887 webContents: WebContents) => void): this;
888 addListener(event: 'web-contents-created', listener: (event: Event,
889 webContents: WebContents) => void): this;
890 removeListener(event: 'web-contents-created', listener: (event: Event,
891 webContents: WebContents) => void): this;
892 /**
893 * Emitted during Handoff before an activity from a different device wants to be
894 * resumed. You should call `event.preventDefault()` if you want to handle this
895 * event.
896 *
897 * @platform darwin
898 */
899 on(event: 'will-continue-activity', listener: (event: Event,
900 /**
901 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
902 */
903 type: string) => void): this;
904 /**
905 * @platform darwin
906 */
907 off(event: 'will-continue-activity', listener: (event: Event,
908 /**
909 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
910 */
911 type: string) => void): this;
912 /**
913 * @platform darwin
914 */
915 once(event: 'will-continue-activity', listener: (event: Event,
916 /**
917 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
918 */
919 type: string) => void): this;
920 /**
921 * @platform darwin
922 */
923 addListener(event: 'will-continue-activity', listener: (event: Event,
924 /**
925 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
926 */
927 type: string) => void): this;
928 /**
929 * @platform darwin
930 */
931 removeListener(event: 'will-continue-activity', listener: (event: Event,
932 /**
933 * A string identifying the activity. Maps to `NSUserActivity.activityType`.
934 */
935 type: string) => void): this;
936 /**
937 * Emitted when the application has finished basic startup. On Windows and Linux,
938 * the `will-finish-launching` event is the same as the `ready` event; on macOS,
939 * this event represents the `applicationWillFinishLaunching` notification of
940 * `NSApplication`.
941 *
942 * In most cases, you should do everything in the `ready` event handler.
943 */
944 on(event: 'will-finish-launching', listener: Function): this;
945 off(event: 'will-finish-launching', listener: Function): this;
946 once(event: 'will-finish-launching', listener: Function): this;
947 addListener(event: 'will-finish-launching', listener: Function): this;
948 removeListener(event: 'will-finish-launching', listener: Function): this;
949 /**
950 * Emitted when all windows have been closed and the application will quit. Calling
951 * `event.preventDefault()` will prevent the default behavior, which is terminating
952 * the application.
953 *
954 * See the description of the `window-all-closed` event for the differences between
955 * the `will-quit` and `window-all-closed` events.
956 *
957 * **Note:** On Windows, this event will not be emitted if the app is closed due to
958 * a shutdown/restart of the system or a user logout.
959 */
960 on(event: 'will-quit', listener: (event: Event) => void): this;
961 off(event: 'will-quit', listener: (event: Event) => void): this;
962 once(event: 'will-quit', listener: (event: Event) => void): this;
963 addListener(event: 'will-quit', listener: (event: Event) => void): this;
964 removeListener(event: 'will-quit', listener: (event: Event) => void): this;
965 /**
966 * Emitted when all windows have been closed.
967 *
968 * If you do not subscribe to this event and all windows are closed, the default
969 * behavior is to quit the app; however, if you subscribe, you control whether the
970 * app quits or not. If the user pressed `Cmd + Q`, or the developer called
971 * `app.quit()`, Electron will first try to close all the windows and then emit the
972 * `will-quit` event, and in this case the `window-all-closed` event would not be
973 * emitted.
974 */
975 on(event: 'window-all-closed', listener: Function): this;
976 off(event: 'window-all-closed', listener: Function): this;
977 once(event: 'window-all-closed', listener: Function): this;
978 addListener(event: 'window-all-closed', listener: Function): this;
979 removeListener(event: 'window-all-closed', listener: Function): this;
980 /**
981 * Adds `path` to the recent documents list.
982 *
983 * This list is managed by the OS. On Windows, you can visit the list from the task
984 * bar, and on macOS, you can visit it from dock menu.
985 *
986 * @platform darwin,win32
987 */
988 addRecentDocument(path: string): void;
989 /**
990 * Clears the recent documents list.
991 *
992 * @platform darwin,win32
993 */
994 clearRecentDocuments(): void;
995 /**
996 * Configures host resolution (DNS and DNS-over-HTTPS). By default, the following
997 * resolvers will be used, in order:
998 *
999 * * DNS-over-HTTPS, if the DNS provider supports it, then
1000 * * the built-in resolver (enabled on macOS only by default), then
1001 * * the system's resolver (e.g. `getaddrinfo`).
1002 *
1003 * This can be configured to either restrict usage of non-encrypted DNS
1004 * (`secureDnsMode: "secure"`), or disable DNS-over-HTTPS (`secureDnsMode: "off"`).
1005 * It is also possible to enable or disable the built-in resolver.
1006 *
1007 * To disable insecure DNS, you can specify a `secureDnsMode` of `"secure"`. If you
1008 * do so, you should make sure to provide a list of DNS-over-HTTPS servers to use,
1009 * in case the user's DNS configuration does not include a provider that supports
1010 * DoH.
1011 *
1012 * This API must be called after the `ready` event is emitted.
1013 */
1014 configureHostResolver(options: ConfigureHostResolverOptions): void;
1015 /**
1016 * By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain
1017 * basis if the GPU processes crashes too frequently. This function disables that
1018 * behavior.
1019 *
1020 * This method can only be called before app is ready.
1021 */
1022 disableDomainBlockingFor3DAPIs(): void;
1023 /**
1024 * Disables hardware acceleration for current app.
1025 *
1026 * This method can only be called before app is ready.
1027 */
1028 disableHardwareAcceleration(): void;
1029 /**
1030 * Enables full sandbox mode on the app. This means that all renderers will be
1031 * launched sandboxed, regardless of the value of the `sandbox` flag in
1032 * `WebPreferences`.
1033 *
1034 * This method can only be called before app is ready.
1035 */
1036 enableSandbox(): void;
1037 /**
1038 * Exits immediately with `exitCode`. `exitCode` defaults to 0.
1039 *
1040 * All windows will be closed immediately without asking the user, and the
1041 * `before-quit` and `will-quit` events will not be emitted.
1042 */
1043 exit(exitCode?: number): void;
1044 /**
1045 * On Linux, focuses on the first visible window. On macOS, makes the application
1046 * the active app. On Windows, focuses on the application's first window.
1047 *
1048 * You should seek to use the `steal` option as sparingly as possible.
1049 */
1050 focus(options?: FocusOptions): void;
1051 /**
1052 * Resolve with an object containing the following:
1053 *
1054 * * `icon` NativeImage - the display icon of the app handling the protocol.
1055 * * `path` string - installation path of the app handling the protocol.
1056 * * `name` string - display name of the app handling the protocol.
1057 *
1058 * This method returns a promise that contains the application name, icon and path
1059 * of the default handler for the protocol (aka URI scheme) of a URL.
1060 *
1061 * @platform darwin,win32
1062 */
1063 getApplicationInfoForProtocol(url: string): Promise<Electron.ApplicationInfoForProtocolReturnValue>;
1064 /**
1065 * Name of the application handling the protocol, or an empty string if there is no
1066 * handler. For instance, if Electron is the default handler of the URL, this could
1067 * be `Electron` on Windows and Mac. However, don't rely on the precise format
1068 * which is not guaranteed to remain unchanged. Expect a different format on Linux,
1069 * possibly with a `.desktop` suffix.
1070 *
1071 * This method returns the application name of the default handler for the protocol
1072 * (aka URI scheme) of a URL.
1073 */
1074 getApplicationNameForProtocol(url: string): string;
1075 /**
1076 * Array of `ProcessMetric` objects that correspond to memory and CPU usage
1077 * statistics of all the processes associated with the app.
1078 */
1079 getAppMetrics(): ProcessMetric[];
1080 /**
1081 * The current application directory.
1082 */
1083 getAppPath(): string;
1084 /**
1085 * The current value displayed in the counter badge.
1086 *
1087 * @platform linux,darwin
1088 */
1089 getBadgeCount(): number;
1090 /**
1091 * The type of the currently running activity.
1092 *
1093 * @platform darwin
1094 */
1095 getCurrentActivityType(): string;
1096 /**
1097 * fulfilled with the app's icon, which is a NativeImage.
1098 *
1099 * Fetches a path's associated icon.
1100 *
1101 * On _Windows_, there a 2 kinds of icons:
1102 *
1103 * * Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
1104 * * Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
1105 *
1106 * On _Linux_ and _macOS_, icons depend on the application associated with file
1107 * mime type.
1108 */
1109 getFileIcon(path: string, options?: FileIconOptions): Promise<Electron.NativeImage>;
1110 /**
1111 * The Graphics Feature Status from `chrome://gpu/`.
1112 *
1113 * **Note:** This information is only usable after the `gpu-info-update` event is
1114 * emitted.
1115 */
1116 getGPUFeatureStatus(): GPUFeatureStatus;
1117 /**
1118 * For `infoType` equal to `complete`: Promise is fulfilled with `Object`
1119 * containing all the GPU Information as in chromium's GPUInfo object. This
1120 * includes the version and driver information that's shown on `chrome://gpu` page.
1121 *
1122 * For `infoType` equal to `basic`: Promise is fulfilled with `Object` containing
1123 * fewer attributes than when requested with `complete`. Here's an example of basic
1124 * response:
1125 *
1126 * Using `basic` should be preferred if only basic information like `vendorId` or
1127 * `deviceId` is needed.
1128 */
1129 getGPUInfo(infoType: 'basic' | 'complete'): Promise<unknown>;
1130 /**
1131 * * `minItems` Integer - The minimum number of items that will be shown in the
1132 * Jump List (for a more detailed description of this value see the MSDN docs).
1133 * * `removedItems` JumpListItem[] - Array of `JumpListItem` objects that
1134 * correspond to items that the user has explicitly removed from custom categories
1135 * in the Jump List. These items must not be re-added to the Jump List in the
1136 * **next** call to `app.setJumpList()`, Windows will not display any custom
1137 * category that contains any of the removed items.
1138 *
1139 * @platform win32
1140 */
1141 getJumpListSettings(): JumpListSettings;
1142 /**
1143 * The current application locale, fetched using Chromium's `l10n_util` library.
1144 * Possible return values are documented here.
1145 *
1146 * To set the locale, you'll want to use a command line switch at app startup,
1147 * which may be found here.
1148 *
1149 * **Note:** When distributing your packaged app, you have to also ship the
1150 * `locales` folder.
1151 *
1152 * **Note:** This API must be called after the `ready` event is emitted.
1153 *
1154 * **Note:** To see example return values of this API compared to other locale and
1155 * language APIs, see `app.getPreferredSystemLanguages()`.
1156 */
1157 getLocale(): string;
1158 /**
1159 * User operating system's locale two-letter ISO 3166 country code. The value is
1160 * taken from native OS APIs.
1161 *
1162 * **Note:** When unable to detect locale country code, it returns empty string.
1163 */
1164 getLocaleCountryCode(): string;
1165 /**
1166 * If you provided `path` and `args` options to `app.setLoginItemSettings`, then
1167 * you need to pass the same arguments here for `openAtLogin` to be set correctly.
1168 *
1169 *
1170 * * `openAtLogin` boolean - `true` if the app is set to open at login.
1171 * * `openAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app is set to open
1172 * as hidden at login. This does not work on macOS 13 and up.
1173 * * `wasOpenedAtLogin` boolean _macOS_ _Deprecated_ - `true` if the app was opened
1174 * at login automatically. This setting is not available on MAS builds or on macOS
1175 * 13 and up.
1176 * * `wasOpenedAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app was
1177 * opened as a hidden login item. This indicates that the app should not open any
1178 * windows at startup. This setting is not available on MAS builds or on macOS 13
1179 * and up.
1180 * * `restoreState` boolean _macOS_ _Deprecated_ - `true` if the app was opened as
1181 * a login item that should restore the state from the previous session. This
1182 * indicates that the app should restore the windows that were open the last time
1183 * the app was closed. This setting is not available on MAS builds or on macOS 13
1184 * and up.
1185 * * `status` string _macOS_ - can be one of `not-registered`, `enabled`,
1186 * `requires-approval`, or `not-found`.
1187 * * `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open
1188 * at login and its run key is not deactivated. This differs from `openAtLogin` as
1189 * it ignores the `args` option, this property will be true if the given executable
1190 * would be launched at login with **any** arguments.
1191 * * `launchItems` Object[] _Windows_
1192 * * `name` string _Windows_ - name value of a registry entry.
1193 * * `path` string _Windows_ - The executable to an app that corresponds to a
1194 * registry entry.
1195 * * `args` string[] _Windows_ - the command-line arguments to pass to the
1196 * executable.
1197 * * `scope` string _Windows_ - one of `user` or `machine`. Indicates whether the
1198 * registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
1199 * * `enabled` boolean _Windows_ - `true` if the app registry key is startup
1200 * approved and therefore shows as `enabled` in Task Manager and Windows settings.
1201 *
1202 * @platform darwin,win32
1203 */
1204 getLoginItemSettings(options?: LoginItemSettingsOptions): LoginItemSettings;
1205 /**
1206 * The current application's name, which is the name in the application's
1207 * `package.json` file.
1208 *
1209 * Usually the `name` field of `package.json` is a short lowercase name, according
1210 * to the npm modules spec. You should usually also specify a `productName` field,
1211 * which is your application's full capitalized name, and which will be preferred
1212 * over `name` by Electron.
1213 */
1214 getName(): string;
1215 /**
1216 * A path to a special directory or file associated with `name`. On failure, an
1217 * `Error` is thrown.
1218 *
1219 * If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being
1220 * called first, a default log directory will be created equivalent to calling
1221 * `app.setAppLogsPath()` without a `path` parameter.
1222 */
1223 getPath(name: 'home' | 'appData' | 'userData' | 'sessionData' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'recent' | 'logs' | 'crashDumps'): string;
1224 /**
1225 * The user's preferred system languages from most preferred to least preferred,
1226 * including the country codes if applicable. A user can modify and add to this
1227 * list on Windows or macOS through the Language and Region settings.
1228 *
1229 * The API uses `GlobalizationPreferences` (with a fallback to
1230 * `GetSystemPreferredUILanguages`) on Windows, `\[NSLocale preferredLanguages\]`
1231 * on macOS, and `g_get_language_names` on Linux.
1232 *
1233 * This API can be used for purposes such as deciding what language to present the
1234 * application in.
1235 *
1236 * Here are some examples of return values of the various language and locale APIs
1237 * with different configurations:
1238 *
1239 * On Windows, given application locale is German, the regional format is Finnish
1240 * (Finland), and the preferred system languages from most to least preferred are
1241 * French (Canada), English (US), Simplified Chinese (China), Finnish, and Spanish
1242 * (Latin America):
1243 *
1244 * On macOS, given the application locale is German, the region is Finland, and the
1245 * preferred system languages from most to least preferred are French (Canada),
1246 * English (US), Simplified Chinese, and Spanish (Latin America):
1247 *
1248 * Both the available languages and regions and the possible return values differ
1249 * between the two operating systems.
1250 *
1251 * As can be seen with the example above, on Windows, it is possible that a
1252 * preferred system language has no country code, and that one of the preferred
1253 * system languages corresponds with the language used for the regional format. On
1254 * macOS, the region serves more as a default country code: the user doesn't need
1255 * to have Finnish as a preferred language to use Finland as the region,and the
1256 * country code `FI` is used as the country code for preferred system languages
1257 * that do not have associated countries in the language name.
1258 */
1259 getPreferredSystemLanguages(): string[];
1260 /**
1261 * The current system locale. On Windows and Linux, it is fetched using Chromium's
1262 * `i18n` library. On macOS, `[NSLocale currentLocale]` is used instead. To get the
1263 * user's current system language, which is not always the same as the locale, it
1264 * is better to use `app.getPreferredSystemLanguages()`.
1265 *
1266 * Different operating systems also use the regional data differently:
1267 *
1268 * * Windows 11 uses the regional format for numbers, dates, and times.
1269 * * macOS Monterey uses the region for formatting numbers, dates, times, and for
1270 * selecting the currency symbol to use.
1271 *
1272 * Therefore, this API can be used for purposes such as choosing a format for
1273 * rendering dates and times in a calendar app, especially when the developer wants
1274 * the format to be consistent with the OS.
1275 *
1276 * **Note:** This API must be called after the `ready` event is emitted.
1277 *
1278 * **Note:** To see example return values of this API compared to other locale and
1279 * language APIs, see `app.getPreferredSystemLanguages()`.
1280 */
1281 getSystemLocale(): string;
1282 /**
1283 * The version of the loaded application. If no version is found in the
1284 * application's `package.json` file, the version of the current bundle or
1285 * executable is returned.
1286 */
1287 getVersion(): string;
1288 /**
1289 * This method returns whether or not this instance of your app is currently
1290 * holding the single instance lock. You can request the lock with
1291 * `app.requestSingleInstanceLock()` and release with
1292 * `app.releaseSingleInstanceLock()`
1293 */
1294 hasSingleInstanceLock(): boolean;
1295 /**
1296 * Hides all application windows without minimizing them.
1297 *
1298 * @platform darwin
1299 */
1300 hide(): void;
1301 /**
1302 * Imports the certificate in pkcs12 format into the platform certificate store.
1303 * `callback` is called with the `result` of import operation, a value of `0`
1304 * indicates success while any other value indicates failure according to Chromium
1305 * net_error_list.
1306 *
1307 * @platform linux
1308 */
1309 importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void;
1310 /**
1311 * Invalidates the current Handoff user activity.
1312 *
1313 * @platform darwin
1314 */
1315 invalidateCurrentActivity(): void;
1316 /**
1317 * `true` if Chrome's accessibility support is enabled, `false` otherwise. This API
1318 * will return `true` if the use of assistive technologies, such as screen readers,
1319 * has been detected. See
1320 * https://www.chromium.org/developers/design-documents/accessibility for more
1321 * details.
1322 *
1323 * @platform darwin,win32
1324 */
1325 isAccessibilitySupportEnabled(): boolean;
1326 /**
1327 * Whether the current executable is the default handler for a protocol (aka URI
1328 * scheme).
1329 *
1330 * **Note:** On macOS, you can use this method to check if the app has been
1331 * registered as the default protocol handler for a protocol. You can also verify
1332 * this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
1333 * macOS machine. Please refer to Apple's documentation for details.
1334 *
1335 * The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme`
1336 * internally.
1337 */
1338 isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1339 /**
1340 * whether or not the current OS version allows for native emoji pickers.
1341 */
1342 isEmojiPanelSupported(): boolean;
1343 /**
1344 * `true` if the application—including all of its windows—is hidden (e.g. with
1345 * `Command-H`), `false` otherwise.
1346 *
1347 * @platform darwin
1348 */
1349 isHidden(): boolean;
1350 /**
1351 * Whether the application is currently running from the systems Application
1352 * folder. Use in combination with `app.moveToApplicationsFolder()`
1353 *
1354 * @platform darwin
1355 */
1356 isInApplicationsFolder(): boolean;
1357 /**
1358 * `true` if Electron has finished initializing, `false` otherwise. See also
1359 * `app.whenReady()`.
1360 */
1361 isReady(): boolean;
1362 /**
1363 * whether `Secure Keyboard Entry` is enabled.
1364 *
1365 * By default this API will return `false`.
1366 *
1367 * @platform darwin
1368 */
1369 isSecureKeyboardEntryEnabled(): boolean;
1370 /**
1371 * Whether the current desktop environment is Unity launcher.
1372 *
1373 * @platform linux
1374 */
1375 isUnityRunning(): boolean;
1376 /**
1377 * Whether the move was successful. Please note that if the move is successful,
1378 * your application will quit and relaunch.
1379 *
1380 * No confirmation dialog will be presented by default. If you wish to allow the
1381 * user to confirm the operation, you may do so using the `dialog` API.
1382 *
1383 * **NOTE:** This method throws errors if anything other than the user causes the
1384 * move to fail. For instance if the user cancels the authorization dialog, this
1385 * method returns false. If we fail to perform the copy, then this method will
1386 * throw an error. The message in the error should be informative and tell you
1387 * exactly what went wrong.
1388 *
1389 * By default, if an app of the same name as the one being moved exists in the
1390 * Applications directory and is _not_ running, the existing app will be trashed
1391 * and the active app moved into its place. If it _is_ running, the preexisting
1392 * running app will assume focus and the previously active app will quit itself.
1393 * This behavior can be changed by providing the optional conflict handler, where
1394 * the boolean returned by the handler determines whether or not the move conflict
1395 * is resolved with default behavior. i.e. returning `false` will ensure no
1396 * further action is taken, returning `true` will result in the default behavior
1397 * and the method continuing.
1398 *
1399 * For example:
1400 *
1401 * Would mean that if an app already exists in the user directory, if the user
1402 * chooses to 'Continue Move' then the function would continue with its default
1403 * behavior and the existing app will be trashed and the active app moved into its
1404 * place.
1405 *
1406 * @platform darwin
1407 */
1408 moveToApplicationsFolder(options?: MoveToApplicationsFolderOptions): boolean;
1409 /**
1410 * Try to close all windows. The `before-quit` event will be emitted first. If all
1411 * windows are successfully closed, the `will-quit` event will be emitted and by
1412 * default the application will terminate.
1413 *
1414 * This method guarantees that all `beforeunload` and `unload` event handlers are
1415 * correctly executed. It is possible that a window cancels the quitting by
1416 * returning `false` in the `beforeunload` event handler.
1417 */
1418 quit(): void;
1419 /**
1420 * Relaunches the app when current instance exits.
1421 *
1422 * By default, the new instance will use the same working directory and command
1423 * line arguments with current instance. When `args` is specified, the `args` will
1424 * be passed as command line arguments instead. When `execPath` is specified, the
1425 * `execPath` will be executed for relaunch instead of current app.
1426 *
1427 * Note that this method does not quit the app when executed, you have to call
1428 * `app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.
1429 *
1430 * When `app.relaunch` is called for multiple times, multiple instances will be
1431 * started after current instance exited.
1432 *
1433 * An example of restarting current instance immediately and adding a new command
1434 * line argument to the new instance:
1435 */
1436 relaunch(options?: RelaunchOptions): void;
1437 /**
1438 * Releases all locks that were created by `requestSingleInstanceLock`. This will
1439 * allow multiple instances of the application to once again run side by side.
1440 */
1441 releaseSingleInstanceLock(): void;
1442 /**
1443 * Whether the call succeeded.
1444 *
1445 * This method checks if the current executable as the default handler for a
1446 * protocol (aka URI scheme). If so, it will remove the app as the default handler.
1447 *
1448 * @platform darwin,win32
1449 */
1450 removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1451 /**
1452 * The return value of this method indicates whether or not this instance of your
1453 * application successfully obtained the lock. If it failed to obtain the lock,
1454 * you can assume that another instance of your application is already running with
1455 * the lock and exit immediately.
1456 *
1457 * I.e. This method returns `true` if your process is the primary instance of your
1458 * application and your app should continue loading. It returns `false` if your
1459 * process should immediately quit as it has sent its parameters to another
1460 * instance that has already acquired the lock.
1461 *
1462 * On macOS, the system enforces single instance automatically when users try to
1463 * open a second instance of your app in Finder, and the `open-file` and `open-url`
1464 * events will be emitted for that. However when users start your app in command
1465 * line, the system's single instance mechanism will be bypassed, and you have to
1466 * use this method to ensure single instance.
1467 *
1468 * An example of activating the window of primary instance when a second instance
1469 * starts:
1470 */
1471 requestSingleInstanceLock(additionalData?: Record<any, any>): boolean;
1472 /**
1473 * Marks the current Handoff user activity as inactive without invalidating it.
1474 *
1475 * @platform darwin
1476 */
1477 resignCurrentActivity(): void;
1478 /**
1479 * Resolves with the proxy information for `url` that will be used when attempting
1480 * to make requests using Net in the utility process.
1481 */
1482 resolveProxy(url: string): Promise<string>;
1483 /**
1484 * Set the about panel options. This will override the values defined in the app's
1485 * `.plist` file on macOS. See the Apple docs for more details. On Linux, values
1486 * must be set in order to be shown; there are no defaults.
1487 *
1488 * If you do not set `credits` but still wish to surface them in your app, AppKit
1489 * will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in
1490 * that order, in the bundle returned by the NSBundle class method main. The first
1491 * file found is used, and if none is found, the info area is left blank. See Apple
1492 * documentation for more information.
1493 */
1494 setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
1495 /**
1496 * Manually enables Chrome's accessibility support, allowing to expose
1497 * accessibility switch to users in application settings. See Chromium's
1498 * accessibility docs for more details. Disabled by default.
1499 *
1500 * This API must be called after the `ready` event is emitted.
1501 *
1502 * **Note:** Rendering accessibility tree can significantly affect the performance
1503 * of your app. It should not be enabled by default.
1504 *
1505 * @platform darwin,win32
1506 */
1507 setAccessibilitySupportEnabled(enabled: boolean): void;
1508 /**
1509 * Sets the activation policy for a given app.
1510 *
1511 * Activation policy types:
1512 *
1513 * * 'regular' - The application is an ordinary app that appears in the Dock and
1514 * may have a user interface.
1515 * * 'accessory' - The application doesn’t appear in the Dock and doesn’t have a
1516 * menu bar, but it may be activated programmatically or by clicking on one of its
1517 * windows.
1518 * * 'prohibited' - The application doesn’t appear in the Dock and may not create
1519 * windows or be activated.
1520 *
1521 * @platform darwin
1522 */
1523 setActivationPolicy(policy: 'regular' | 'accessory' | 'prohibited'): void;
1524 /**
1525 * Sets or creates a directory your app's logs which can then be manipulated with
1526 * `app.getPath()` or `app.setPath(pathName, newPath)`.
1527 *
1528 * Calling `app.setAppLogsPath()` without a `path` parameter will result in this
1529 * directory being set to `~/Library/Logs/YourAppName` on _macOS_, and inside the
1530 * `userData` directory on _Linux_ and _Windows_.
1531 */
1532 setAppLogsPath(path?: string): void;
1533 /**
1534 * Changes the Application User Model ID to `id`.
1535 *
1536 * @platform win32
1537 */
1538 setAppUserModelId(id: string): void;
1539 /**
1540 * Whether the call succeeded.
1541 *
1542 * Sets the current executable as the default handler for a protocol (aka URI
1543 * scheme). It allows you to integrate your app deeper into the operating system.
1544 * Once registered, all links with `your-protocol://` will be opened with the
1545 * current executable. The whole link, including protocol, will be passed to your
1546 * application as a parameter.
1547 *
1548 * **Note:** On macOS, you can only register protocols that have been added to your
1549 * app's `info.plist`, which cannot be modified at runtime. However, you can change
1550 * the file during build time via Electron Forge, Electron Packager, or by editing
1551 * `info.plist` with a text editor. Please refer to Apple's documentation for
1552 * details.
1553 *
1554 * **Note:** In a Windows Store environment (when packaged as an `appx`) this API
1555 * will return `true` for all calls but the registry key it sets won't be
1556 * accessible by other applications. In order to register your Windows Store
1557 * application as a default protocol handler you must declare the protocol in your
1558 * manifest.
1559 *
1560 * The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme`
1561 * internally.
1562 */
1563 setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1564 /**
1565 * Whether the call succeeded.
1566 *
1567 * Sets the counter badge for current app. Setting the count to `0` will hide the
1568 * badge.
1569 *
1570 * On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
1571 *
1572 * **Note:** Unity launcher requires a `.desktop` file to work. For more
1573 * information, please read the Unity integration documentation.
1574 *
1575 * **Note:** On macOS, you need to ensure that your application has the permission
1576 * to display notifications for this method to work.
1577 *
1578 * @platform linux,darwin
1579 */
1580 setBadgeCount(count?: number): boolean;
1581 /**
1582 * Sets or removes a custom Jump List for the application, and returns one of the
1583 * following strings:
1584 *
1585 * * `ok` - Nothing went wrong.
1586 * * `error` - One or more errors occurred, enable runtime logging to figure out
1587 * the likely cause.
1588 * * `invalidSeparatorError` - An attempt was made to add a separator to a custom
1589 * category in the Jump List. Separators are only allowed in the standard `Tasks`
1590 * category.
1591 * * `fileTypeRegistrationError` - An attempt was made to add a file link to the
1592 * Jump List for a file type the app isn't registered to handle.
1593 * * `customCategoryAccessDeniedError` - Custom categories can't be added to the
1594 * Jump List due to user privacy or group policy settings.
1595 *
1596 * If `categories` is `null` the previously set custom Jump List (if any) will be
1597 * replaced by the standard Jump List for the app (managed by Windows).
1598 *
1599 * **Note:** If a `JumpListCategory` object has neither the `type` nor the `name`
1600 * property set then its `type` is assumed to be `tasks`. If the `name` property is
1601 * set but the `type` property is omitted then the `type` is assumed to be
1602 * `custom`.
1603 *
1604 * **Note:** Users can remove items from custom categories, and Windows will not
1605 * allow a removed item to be added back into a custom category until **after** the
1606 * next successful call to `app.setJumpList(categories)`. Any attempt to re-add a
1607 * removed item to a custom category earlier than that will result in the entire
1608 * custom category being omitted from the Jump List. The list of removed items can
1609 * be obtained using `app.getJumpListSettings()`.
1610 *
1611 * **Note:** The maximum length of a Jump List item's `description` property is 260
1612 * characters. Beyond this limit, the item will not be added to the Jump List, nor
1613 * will it be displayed.
1614 *
1615 * Here's a very simple example of creating a custom Jump List:
1616 *
1617 * @platform win32
1618 */
1619 setJumpList(categories: (JumpListCategory[]) | (null)): ('ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError');
1620 /**
1621 * Set the app's login item settings.
1622 *
1623 * To work with Electron's `autoUpdater` on Windows, which uses Squirrel, you'll
1624 * want to set the launch path to Update.exe, and pass arguments that specify your
1625 * application name. For example:
1626 *
1627 * For more information about setting different services as login items on macOS 13
1628 * and up, see `SMAppService`.
1629 *
1630 * @platform darwin,win32
1631 */
1632 setLoginItemSettings(settings: Settings): void;
1633 /**
1634 * Overrides the current application's name.
1635 *
1636 * **Note:** This function overrides the name used internally by Electron; it does
1637 * not affect the name that the OS uses.
1638 */
1639 setName(name: string): void;
1640 /**
1641 * Overrides the `path` to a special directory or file associated with `name`. If
1642 * the path specifies a directory that does not exist, an `Error` is thrown. In
1643 * that case, the directory should be created with `fs.mkdirSync` or similar.
1644 *
1645 * You can only override paths of a `name` defined in `app.getPath`.
1646 *
1647 * By default, web pages' cookies and caches will be stored under the `sessionData`
1648 * directory. If you want to change this location, you have to override the
1649 * `sessionData` path before the `ready` event of the `app` module is emitted.
1650 */
1651 setPath(name: string, path: string): void;
1652 setProxy(config: ProxyConfig): void;
1653 /**
1654 * Set the `Secure Keyboard Entry` is enabled in your application.
1655 *
1656 * By using this API, important information such as password and other sensitive
1657 * information can be prevented from being intercepted by other processes.
1658 *
1659 * See Apple's documentation for more details.
1660 *
1661 * **Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it
1662 * when it is no longer needed.
1663 *
1664 * @platform darwin
1665 */
1666 setSecureKeyboardEntryEnabled(enabled: boolean): void;
1667 /**
1668 * Creates an `NSUserActivity` and sets it as the current activity. The activity is
1669 * eligible for Handoff to another device afterward.
1670 *
1671 * @platform darwin
1672 */
1673 setUserActivity(type: string, userInfo: any, webpageURL?: string): void;
1674 /**
1675 * Adds `tasks` to the Tasks category of the Jump List on Windows.
1676 *
1677 * `tasks` is an array of `Task` objects.
1678 *
1679 * Whether the call succeeded.
1680 *
1681 * **Note:** If you'd like to customize the Jump List even more use
1682 * `app.setJumpList(categories)` instead.
1683 *
1684 * @platform win32
1685 */
1686 setUserTasks(tasks: Task[]): boolean;
1687 /**
1688 * Shows application windows after they were hidden. Does not automatically focus
1689 * them.
1690 *
1691 * @platform darwin
1692 */
1693 show(): void;
1694 /**
1695 * Show the app's about panel options. These options can be overridden with
1696 * `app.setAboutPanelOptions(options)`. This function runs asynchronously.
1697 */
1698 showAboutPanel(): void;
1699 /**
1700 * Show the platform's native emoji picker.
1701 *
1702 * @platform darwin,win32
1703 */
1704 showEmojiPanel(): void;
1705 /**
1706 * This function **must** be called once you have finished accessing the security
1707 * scoped file. If you do not remember to stop accessing the bookmark, kernel
1708 * resources will be leaked and your app will lose its ability to reach outside the
1709 * sandbox completely, until your app is restarted.
1710 *
1711 * Start accessing a security scoped resource. With this method Electron
1712 * applications that are packaged for the Mac App Store may reach outside their
1713 * sandbox to access files chosen by the user. See Apple's documentation for a
1714 * description of how this system works.
1715 *
1716 * @platform mas
1717 */
1718 startAccessingSecurityScopedResource(bookmarkData: string): Function;
1719 /**
1720 * Updates the current activity if its type matches `type`, merging the entries
1721 * from `userInfo` into its current `userInfo` dictionary.
1722 *
1723 * @platform darwin
1724 */
1725 updateCurrentActivity(type: string, userInfo: any): void;
1726 /**
1727 * fulfilled when Electron is initialized. May be used as a convenient alternative
1728 * to checking `app.isReady()` and subscribing to the `ready` event if the app is
1729 * not ready yet.
1730 */
1731 whenReady(): Promise<void>;
1732 /**
1733 * A `boolean` property that's `true` if Chrome's accessibility support is enabled,
1734 * `false` otherwise. This property will be `true` if the use of assistive
1735 * technologies, such as screen readers, has been detected. Setting this property
1736 * to `true` manually enables Chrome's accessibility support, allowing developers
1737 * to expose accessibility switch to users in application settings.
1738 *
1739 * See Chromium's accessibility docs for more details. Disabled by default.
1740 *
1741 * This API must be called after the `ready` event is emitted.
1742 *
1743 * **Note:** Rendering accessibility tree can significantly affect the performance
1744 * of your app. It should not be enabled by default.
1745 *
1746 * @platform darwin,win32
1747 */
1748 accessibilitySupportEnabled: boolean;
1749 /**
1750 * A `Menu | null` property that returns `Menu` if one has been set and `null`
1751 * otherwise. Users can pass a Menu to set this property.
1752 */
1753 applicationMenu: (Menu) | (null);
1754 /**
1755 * An `Integer` property that returns the badge count for current app. Setting the
1756 * count to `0` will hide the badge.
1757 *
1758 * On macOS, setting this with any nonzero integer shows on the dock icon. On
1759 * Linux, this property only works for Unity launcher.
1760 *
1761 * **Note:** Unity launcher requires a `.desktop` file to work. For more
1762 * information, please read the Unity integration documentation.
1763 *
1764 * **Note:** On macOS, you need to ensure that your application has the permission
1765 * to display notifications for this property to take effect.
1766 *
1767 * @platform linux,darwin
1768 */
1769 badgeCount: number;
1770 /**
1771 * A `CommandLine` object that allows you to read and manipulate the command line
1772 * arguments that Chromium uses.
1773 *
1774 */
1775 readonly commandLine: CommandLine;
1776 /**
1777 * A `Dock` `| undefined` object that allows you to perform actions on your app
1778 * icon in the user's dock on macOS.
1779 *
1780 * @platform darwin
1781 */
1782 readonly dock: Dock;
1783 /**
1784 * A `boolean` property that returns `true` if the app is packaged, `false`
1785 * otherwise. For many apps, this property can be used to distinguish development
1786 * and production environments.
1787 *
1788 */
1789 readonly isPackaged: boolean;
1790 /**
1791 * A `string` property that indicates the current application's name, which is the
1792 * name in the application's `package.json` file.
1793 *
1794 * Usually the `name` field of `package.json` is a short lowercase name, according
1795 * to the npm modules spec. You should usually also specify a `productName` field,
1796 * which is your application's full capitalized name, and which will be preferred
1797 * over `name` by Electron.
1798 */
1799 name: string;
1800 /**
1801 * A `boolean` which when `true` indicates that the app is currently running under
1802 * an ARM64 translator (like the macOS Rosetta Translator Environment or Windows
1803 * WOW).
1804 *
1805 * You can use this property to prompt users to download the arm64 version of your
1806 * application when they are mistakenly running the x64 version under Rosetta or
1807 * WOW.
1808 *
1809 * @platform darwin,win32
1810 */
1811 readonly runningUnderARM64Translation: boolean;
1812 /**
1813 * A `string` which is the user agent string Electron will use as a global
1814 * fallback.
1815 *
1816 * This is the user agent that will be used when no user agent is set at the
1817 * `webContents` or `session` level. It is useful for ensuring that your entire
1818 * app has the same user agent. Set to a custom value as early as possible in your
1819 * app's initialization to ensure that your overridden value is used.
1820 */
1821 userAgentFallback: string;
1822 }
1823
1824 interface AutoUpdater extends NodeJS.EventEmitter {
1825
1826 // Docs: https://electronjs.org/docs/api/auto-updater
1827
1828 /**
1829 * This event is emitted after a user calls `quitAndInstall()`.
1830 *
1831 * When this API is called, the `before-quit` event is not emitted before all
1832 * windows are closed. As a result you should listen to this event if you wish to
1833 * perform actions before the windows are closed while a process is quitting, as
1834 * well as listening to `before-quit`.
1835 */
1836 on(event: 'before-quit-for-update', listener: Function): this;
1837 off(event: 'before-quit-for-update', listener: Function): this;
1838 once(event: 'before-quit-for-update', listener: Function): this;
1839 addListener(event: 'before-quit-for-update', listener: Function): this;
1840 removeListener(event: 'before-quit-for-update', listener: Function): this;
1841 /**
1842 * Emitted when checking if an update has started.
1843 */
1844 on(event: 'checking-for-update', listener: Function): this;
1845 off(event: 'checking-for-update', listener: Function): this;
1846 once(event: 'checking-for-update', listener: Function): this;
1847 addListener(event: 'checking-for-update', listener: Function): this;
1848 removeListener(event: 'checking-for-update', listener: Function): this;
1849 /**
1850 * Emitted when there is an error while updating.
1851 */
1852 on(event: 'error', listener: (error: Error) => void): this;
1853 off(event: 'error', listener: (error: Error) => void): this;
1854 once(event: 'error', listener: (error: Error) => void): this;
1855 addListener(event: 'error', listener: (error: Error) => void): this;
1856 removeListener(event: 'error', listener: (error: Error) => void): this;
1857 /**
1858 * Emitted when there is an available update. The update is downloaded
1859 * automatically.
1860 */
1861 on(event: 'update-available', listener: Function): this;
1862 off(event: 'update-available', listener: Function): this;
1863 once(event: 'update-available', listener: Function): this;
1864 addListener(event: 'update-available', listener: Function): this;
1865 removeListener(event: 'update-available', listener: Function): this;
1866 /**
1867 * Emitted when an update has been downloaded.
1868 *
1869 * On Windows only `releaseName` is available.
1870 *
1871 * **Note:** It is not strictly necessary to handle this event. A successfully
1872 * downloaded update will still be applied the next time the application starts.
1873 */
1874 on(event: 'update-downloaded', listener: (event: Event,
1875 releaseNotes: string,
1876 releaseName: string,
1877 releaseDate: Date,
1878 updateURL: string) => void): this;
1879 off(event: 'update-downloaded', listener: (event: Event,
1880 releaseNotes: string,
1881 releaseName: string,
1882 releaseDate: Date,
1883 updateURL: string) => void): this;
1884 once(event: 'update-downloaded', listener: (event: Event,
1885 releaseNotes: string,
1886 releaseName: string,
1887 releaseDate: Date,
1888 updateURL: string) => void): this;
1889 addListener(event: 'update-downloaded', listener: (event: Event,
1890 releaseNotes: string,
1891 releaseName: string,
1892 releaseDate: Date,
1893 updateURL: string) => void): this;
1894 removeListener(event: 'update-downloaded', listener: (event: Event,
1895 releaseNotes: string,
1896 releaseName: string,
1897 releaseDate: Date,
1898 updateURL: string) => void): this;
1899 /**
1900 * Emitted when there is no available update.
1901 */
1902 on(event: 'update-not-available', listener: Function): this;
1903 off(event: 'update-not-available', listener: Function): this;
1904 once(event: 'update-not-available', listener: Function): this;
1905 addListener(event: 'update-not-available', listener: Function): this;
1906 removeListener(event: 'update-not-available', listener: Function): this;
1907 /**
1908 * Asks the server whether there is an update. You must call `setFeedURL` before
1909 * using this API.
1910 *
1911 * **Note:** If an update is available it will be downloaded automatically. Calling
1912 * `autoUpdater.checkForUpdates()` twice will download the update two times.
1913 */
1914 checkForUpdates(): void;
1915 /**
1916 * The current update feed URL.
1917 */
1918 getFeedURL(): string;
1919 /**
1920 * Restarts the app and installs the update after it has been downloaded. It should
1921 * only be called after `update-downloaded` has been emitted.
1922 *
1923 * Under the hood calling `autoUpdater.quitAndInstall()` will close all application
1924 * windows first, and automatically call `app.quit()` after all windows have been
1925 * closed.
1926 *
1927 * **Note:** It is not strictly necessary to call this function to apply an update,
1928 * as a successfully downloaded update will always be applied the next time the
1929 * application starts.
1930 */
1931 quitAndInstall(): void;
1932 /**
1933 * Sets the `url` and initialize the auto updater.
1934 */
1935 setFeedURL(options: FeedURLOptions): void;
1936 }
1937
1938 class BaseWindow extends NodeEventEmitter {
1939
1940 // Docs: https://electronjs.org/docs/api/base-window
1941
1942 /**
1943 * Emitted when the window is set or unset to show always on top of other windows.
1944 */
1945 on(event: 'always-on-top-changed', listener: (event: Event,
1946 isAlwaysOnTop: boolean) => void): this;
1947 off(event: 'always-on-top-changed', listener: (event: Event,
1948 isAlwaysOnTop: boolean) => void): this;
1949 once(event: 'always-on-top-changed', listener: (event: Event,
1950 isAlwaysOnTop: boolean) => void): this;
1951 addListener(event: 'always-on-top-changed', listener: (event: Event,
1952 isAlwaysOnTop: boolean) => void): this;
1953 removeListener(event: 'always-on-top-changed', listener: (event: Event,
1954 isAlwaysOnTop: boolean) => void): this;
1955 /**
1956 * Emitted when an App Command is invoked. These are typically related to keyboard
1957 * media keys or browser commands, as well as the "Back" button built into some
1958 * mice on Windows.
1959 *
1960 * Commands are lowercased, underscores are replaced with hyphens, and the
1961 * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
1962 * emitted as `browser-backward`.
1963 *
1964 * The following app commands are explicitly supported on Linux:
1965 *
1966 * * `browser-backward`
1967 * * `browser-forward`
1968 *
1969 * @platform win32,linux
1970 */
1971 on(event: 'app-command', listener: (event: Event,
1972 command: string) => void): this;
1973 /**
1974 * @platform win32,linux
1975 */
1976 off(event: 'app-command', listener: (event: Event,
1977 command: string) => void): this;
1978 /**
1979 * @platform win32,linux
1980 */
1981 once(event: 'app-command', listener: (event: Event,
1982 command: string) => void): this;
1983 /**
1984 * @platform win32,linux
1985 */
1986 addListener(event: 'app-command', listener: (event: Event,
1987 command: string) => void): this;
1988 /**
1989 * @platform win32,linux
1990 */
1991 removeListener(event: 'app-command', listener: (event: Event,
1992 command: string) => void): this;
1993 /**
1994 * Emitted when the window loses focus.
1995 */
1996 on(event: 'blur', listener: Function): this;
1997 off(event: 'blur', listener: Function): this;
1998 once(event: 'blur', listener: Function): this;
1999 addListener(event: 'blur', listener: Function): this;
2000 removeListener(event: 'blur', listener: Function): this;
2001 /**
2002 * Emitted when the window is going to be closed. It's emitted before the
2003 * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
2004 * will cancel the close.
2005 *
2006 * Usually you would want to use the `beforeunload` handler to decide whether the
2007 * window should be closed, which will also be called when the window is reloaded.
2008 * In Electron, returning any value other than `undefined` would cancel the close.
2009 * For example:
2010 *
2011 * _**Note**: There is a subtle difference between the behaviors of
2012 * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
2013 * handler)`. It is recommended to always set the `event.returnValue` explicitly,
2014 * instead of only returning a value, as the former works more consistently within
2015 * Electron._
2016 */
2017 on(event: 'close', listener: (event: Event) => void): this;
2018 off(event: 'close', listener: (event: Event) => void): this;
2019 once(event: 'close', listener: (event: Event) => void): this;
2020 addListener(event: 'close', listener: (event: Event) => void): this;
2021 removeListener(event: 'close', listener: (event: Event) => void): this;
2022 /**
2023 * Emitted when the window is closed. After you have received this event you should
2024 * remove the reference to the window and avoid using it any more.
2025 */
2026 on(event: 'closed', listener: Function): this;
2027 off(event: 'closed', listener: Function): this;
2028 once(event: 'closed', listener: Function): this;
2029 addListener(event: 'closed', listener: Function): this;
2030 removeListener(event: 'closed', listener: Function): this;
2031 /**
2032 * Emitted when the window enters a full-screen state.
2033 */
2034 on(event: 'enter-full-screen', listener: Function): this;
2035 off(event: 'enter-full-screen', listener: Function): this;
2036 once(event: 'enter-full-screen', listener: Function): this;
2037 addListener(event: 'enter-full-screen', listener: Function): this;
2038 removeListener(event: 'enter-full-screen', listener: Function): this;
2039 /**
2040 * Emitted when the window gains focus.
2041 */
2042 on(event: 'focus', listener: Function): this;
2043 off(event: 'focus', listener: Function): this;
2044 once(event: 'focus', listener: Function): this;
2045 addListener(event: 'focus', listener: Function): this;
2046 removeListener(event: 'focus', listener: Function): this;
2047 /**
2048 * Emitted when the window is hidden.
2049 */
2050 on(event: 'hide', listener: Function): this;
2051 off(event: 'hide', listener: Function): this;
2052 once(event: 'hide', listener: Function): this;
2053 addListener(event: 'hide', listener: Function): this;
2054 removeListener(event: 'hide', listener: Function): this;
2055 /**
2056 * Emitted when the window leaves a full-screen state.
2057 */
2058 on(event: 'leave-full-screen', listener: Function): this;
2059 off(event: 'leave-full-screen', listener: Function): this;
2060 once(event: 'leave-full-screen', listener: Function): this;
2061 addListener(event: 'leave-full-screen', listener: Function): this;
2062 removeListener(event: 'leave-full-screen', listener: Function): this;
2063 /**
2064 * Emitted when window is maximized.
2065 */
2066 on(event: 'maximize', listener: Function): this;
2067 off(event: 'maximize', listener: Function): this;
2068 once(event: 'maximize', listener: Function): this;
2069 addListener(event: 'maximize', listener: Function): this;
2070 removeListener(event: 'maximize', listener: Function): this;
2071 /**
2072 * Emitted when the window is minimized.
2073 */
2074 on(event: 'minimize', listener: Function): this;
2075 off(event: 'minimize', listener: Function): this;
2076 once(event: 'minimize', listener: Function): this;
2077 addListener(event: 'minimize', listener: Function): this;
2078 removeListener(event: 'minimize', listener: Function): this;
2079 /**
2080 * Emitted when the window is being moved to a new position.
2081 */
2082 on(event: 'move', listener: Function): this;
2083 off(event: 'move', listener: Function): this;
2084 once(event: 'move', listener: Function): this;
2085 addListener(event: 'move', listener: Function): this;
2086 removeListener(event: 'move', listener: Function): this;
2087 /**
2088 * Emitted once when the window is moved to a new position.
2089 *
2090 * **Note**: On macOS this event is an alias of `move`.
2091 *
2092 * @platform darwin,win32
2093 */
2094 on(event: 'moved', listener: Function): this;
2095 /**
2096 * @platform darwin,win32
2097 */
2098 off(event: 'moved', listener: Function): this;
2099 /**
2100 * @platform darwin,win32
2101 */
2102 once(event: 'moved', listener: Function): this;
2103 /**
2104 * @platform darwin,win32
2105 */
2106 addListener(event: 'moved', listener: Function): this;
2107 /**
2108 * @platform darwin,win32
2109 */
2110 removeListener(event: 'moved', listener: Function): this;
2111 /**
2112 * Emitted when the native new tab button is clicked.
2113 *
2114 * @platform darwin
2115 */
2116 on(event: 'new-window-for-tab', listener: Function): this;
2117 /**
2118 * @platform darwin
2119 */
2120 off(event: 'new-window-for-tab', listener: Function): this;
2121 /**
2122 * @platform darwin
2123 */
2124 once(event: 'new-window-for-tab', listener: Function): this;
2125 /**
2126 * @platform darwin
2127 */
2128 addListener(event: 'new-window-for-tab', listener: Function): this;
2129 /**
2130 * @platform darwin
2131 */
2132 removeListener(event: 'new-window-for-tab', listener: Function): this;
2133 /**
2134 * Emitted after the window has been resized.
2135 */
2136 on(event: 'resize', listener: Function): this;
2137 off(event: 'resize', listener: Function): this;
2138 once(event: 'resize', listener: Function): this;
2139 addListener(event: 'resize', listener: Function): this;
2140 removeListener(event: 'resize', listener: Function): this;
2141 /**
2142 * Emitted once when the window has finished being resized.
2143 *
2144 * This is usually emitted when the window has been resized manually. On macOS,
2145 * resizing the window with `setBounds`/`setSize` and setting the `animate`
2146 * parameter to `true` will also emit this event once resizing has finished.
2147 *
2148 * @platform darwin,win32
2149 */
2150 on(event: 'resized', listener: Function): this;
2151 /**
2152 * @platform darwin,win32
2153 */
2154 off(event: 'resized', listener: Function): this;
2155 /**
2156 * @platform darwin,win32
2157 */
2158 once(event: 'resized', listener: Function): this;
2159 /**
2160 * @platform darwin,win32
2161 */
2162 addListener(event: 'resized', listener: Function): this;
2163 /**
2164 * @platform darwin,win32
2165 */
2166 removeListener(event: 'resized', listener: Function): this;
2167 /**
2168 * Emitted when the window is restored from a minimized state.
2169 */
2170 on(event: 'restore', listener: Function): this;
2171 off(event: 'restore', listener: Function): this;
2172 once(event: 'restore', listener: Function): this;
2173 addListener(event: 'restore', listener: Function): this;
2174 removeListener(event: 'restore', listener: Function): this;
2175 /**
2176 * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
2177 * is ended. The `rotation` value on each emission is the angle in degrees rotated
2178 * since the last emission. The last emitted event upon a rotation gesture will
2179 * always be of value `0`. Counter-clockwise rotation values are positive, while
2180 * clockwise ones are negative.
2181 *
2182 * @platform darwin
2183 */
2184 on(event: 'rotate-gesture', listener: (event: Event,
2185 rotation: number) => void): this;
2186 /**
2187 * @platform darwin
2188 */
2189 off(event: 'rotate-gesture', listener: (event: Event,
2190 rotation: number) => void): this;
2191 /**
2192 * @platform darwin
2193 */
2194 once(event: 'rotate-gesture', listener: (event: Event,
2195 rotation: number) => void): this;
2196 /**
2197 * @platform darwin
2198 */
2199 addListener(event: 'rotate-gesture', listener: (event: Event,
2200 rotation: number) => void): this;
2201 /**
2202 * @platform darwin
2203 */
2204 removeListener(event: 'rotate-gesture', listener: (event: Event,
2205 rotation: number) => void): this;
2206 /**
2207 * Emitted when window session is going to end due to force shutdown or machine
2208 * restart or session log off.
2209 *
2210 * @platform win32
2211 */
2212 on(event: 'session-end', listener: Function): this;
2213 /**
2214 * @platform win32
2215 */
2216 off(event: 'session-end', listener: Function): this;
2217 /**
2218 * @platform win32
2219 */
2220 once(event: 'session-end', listener: Function): this;
2221 /**
2222 * @platform win32
2223 */
2224 addListener(event: 'session-end', listener: Function): this;
2225 /**
2226 * @platform win32
2227 */
2228 removeListener(event: 'session-end', listener: Function): this;
2229 /**
2230 * Emitted when the window opens a sheet.
2231 *
2232 * @platform darwin
2233 */
2234 on(event: 'sheet-begin', listener: Function): this;
2235 /**
2236 * @platform darwin
2237 */
2238 off(event: 'sheet-begin', listener: Function): this;
2239 /**
2240 * @platform darwin
2241 */
2242 once(event: 'sheet-begin', listener: Function): this;
2243 /**
2244 * @platform darwin
2245 */
2246 addListener(event: 'sheet-begin', listener: Function): this;
2247 /**
2248 * @platform darwin
2249 */
2250 removeListener(event: 'sheet-begin', listener: Function): this;
2251 /**
2252 * Emitted when the window has closed a sheet.
2253 *
2254 * @platform darwin
2255 */
2256 on(event: 'sheet-end', listener: Function): this;
2257 /**
2258 * @platform darwin
2259 */
2260 off(event: 'sheet-end', listener: Function): this;
2261 /**
2262 * @platform darwin
2263 */
2264 once(event: 'sheet-end', listener: Function): this;
2265 /**
2266 * @platform darwin
2267 */
2268 addListener(event: 'sheet-end', listener: Function): this;
2269 /**
2270 * @platform darwin
2271 */
2272 removeListener(event: 'sheet-end', listener: Function): this;
2273 /**
2274 * Emitted when the window is shown.
2275 */
2276 on(event: 'show', listener: Function): this;
2277 off(event: 'show', listener: Function): this;
2278 once(event: 'show', listener: Function): this;
2279 addListener(event: 'show', listener: Function): this;
2280 removeListener(event: 'show', listener: Function): this;
2281 /**
2282 * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
2283 * `left`.
2284 *
2285 * The method underlying this event is built to handle older macOS-style trackpad
2286 * swiping, where the content on the screen doesn't move with the swipe. Most macOS
2287 * trackpads are not configured to allow this kind of swiping anymore, so in order
2288 * for it to emit properly the 'Swipe between pages' preference in `System
2289 * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
2290 * fingers'.
2291 *
2292 * @platform darwin
2293 */
2294 on(event: 'swipe', listener: (event: Event,
2295 direction: string) => void): this;
2296 /**
2297 * @platform darwin
2298 */
2299 off(event: 'swipe', listener: (event: Event,
2300 direction: string) => void): this;
2301 /**
2302 * @platform darwin
2303 */
2304 once(event: 'swipe', listener: (event: Event,
2305 direction: string) => void): this;
2306 /**
2307 * @platform darwin
2308 */
2309 addListener(event: 'swipe', listener: (event: Event,
2310 direction: string) => void): this;
2311 /**
2312 * @platform darwin
2313 */
2314 removeListener(event: 'swipe', listener: (event: Event,
2315 direction: string) => void): this;
2316 /**
2317 * Emitted when the system context menu is triggered on the window, this is
2318 * normally only triggered when the user right clicks on the non-client area of
2319 * your window. This is the window titlebar or any area you have declared as
2320 * `-webkit-app-region: drag` in a frameless window.
2321 *
2322 * Calling `event.preventDefault()` will prevent the menu from being displayed.
2323 *
2324 * @platform win32
2325 */
2326 on(event: 'system-context-menu', listener: (event: Event,
2327 /**
2328 * The screen coordinates the context menu was triggered at
2329 */
2330 point: Point) => void): this;
2331 /**
2332 * @platform win32
2333 */
2334 off(event: 'system-context-menu', listener: (event: Event,
2335 /**
2336 * The screen coordinates the context menu was triggered at
2337 */
2338 point: Point) => void): this;
2339 /**
2340 * @platform win32
2341 */
2342 once(event: 'system-context-menu', listener: (event: Event,
2343 /**
2344 * The screen coordinates the context menu was triggered at
2345 */
2346 point: Point) => void): this;
2347 /**
2348 * @platform win32
2349 */
2350 addListener(event: 'system-context-menu', listener: (event: Event,
2351 /**
2352 * The screen coordinates the context menu was triggered at
2353 */
2354 point: Point) => void): this;
2355 /**
2356 * @platform win32
2357 */
2358 removeListener(event: 'system-context-menu', listener: (event: Event,
2359 /**
2360 * The screen coordinates the context menu was triggered at
2361 */
2362 point: Point) => void): this;
2363 /**
2364 * Emitted when the window exits from a maximized state.
2365 */
2366 on(event: 'unmaximize', listener: Function): this;
2367 off(event: 'unmaximize', listener: Function): this;
2368 once(event: 'unmaximize', listener: Function): this;
2369 addListener(event: 'unmaximize', listener: Function): this;
2370 removeListener(event: 'unmaximize', listener: Function): this;
2371 /**
2372 * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
2373 * will prevent the window from being moved.
2374 *
2375 * Note that this is only emitted when the window is being moved manually. Moving
2376 * the window with `setPosition`/`setBounds`/`center` will not emit this event.
2377 *
2378 * @platform darwin,win32
2379 */
2380 on(event: 'will-move', listener: (event: Event,
2381 /**
2382 * Location the window is being moved to.
2383 */
2384 newBounds: Rectangle) => void): this;
2385 /**
2386 * @platform darwin,win32
2387 */
2388 off(event: 'will-move', listener: (event: Event,
2389 /**
2390 * Location the window is being moved to.
2391 */
2392 newBounds: Rectangle) => void): this;
2393 /**
2394 * @platform darwin,win32
2395 */
2396 once(event: 'will-move', listener: (event: Event,
2397 /**
2398 * Location the window is being moved to.
2399 */
2400 newBounds: Rectangle) => void): this;
2401 /**
2402 * @platform darwin,win32
2403 */
2404 addListener(event: 'will-move', listener: (event: Event,
2405 /**
2406 * Location the window is being moved to.
2407 */
2408 newBounds: Rectangle) => void): this;
2409 /**
2410 * @platform darwin,win32
2411 */
2412 removeListener(event: 'will-move', listener: (event: Event,
2413 /**
2414 * Location the window is being moved to.
2415 */
2416 newBounds: Rectangle) => void): this;
2417 /**
2418 * Emitted before the window is resized. Calling `event.preventDefault()` will
2419 * prevent the window from being resized.
2420 *
2421 * Note that this is only emitted when the window is being resized manually.
2422 * Resizing the window with `setBounds`/`setSize` will not emit this event.
2423 *
2424 * The possible values and behaviors of the `edge` option are platform dependent.
2425 * Possible values are:
2426 *
2427 * * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
2428 * `top-right`, `bottom-left`, `bottom-right`.
2429 * * On macOS, possible values are `bottom` and `right`.
2430 * * The value `bottom` is used to denote vertical resizing.
2431 * * The value `right` is used to denote horizontal resizing.
2432 *
2433 * @platform darwin,win32
2434 */
2435 on(event: 'will-resize', listener: (event: Event,
2436 /**
2437 * Size the window is being resized to.
2438 */
2439 newBounds: Rectangle,
2440 details: WillResizeDetails) => void): this;
2441 /**
2442 * @platform darwin,win32
2443 */
2444 off(event: 'will-resize', listener: (event: Event,
2445 /**
2446 * Size the window is being resized to.
2447 */
2448 newBounds: Rectangle,
2449 details: WillResizeDetails) => void): this;
2450 /**
2451 * @platform darwin,win32
2452 */
2453 once(event: 'will-resize', listener: (event: Event,
2454 /**
2455 * Size the window is being resized to.
2456 */
2457 newBounds: Rectangle,
2458 details: WillResizeDetails) => void): this;
2459 /**
2460 * @platform darwin,win32
2461 */
2462 addListener(event: 'will-resize', listener: (event: Event,
2463 /**
2464 * Size the window is being resized to.
2465 */
2466 newBounds: Rectangle,
2467 details: WillResizeDetails) => void): this;
2468 /**
2469 * @platform darwin,win32
2470 */
2471 removeListener(event: 'will-resize', listener: (event: Event,
2472 /**
2473 * Size the window is being resized to.
2474 */
2475 newBounds: Rectangle,
2476 details: WillResizeDetails) => void): this;
2477 /**
2478 * BaseWindow
2479 */
2480 constructor(options?: BaseWindowConstructorOptions);
2481 /**
2482 * The window with the given `id`.
2483 */
2484 static fromId(id: number): (BaseWindow) | (null);
2485 /**
2486 * An array of all opened browser windows.
2487 */
2488 static getAllWindows(): BaseWindow[];
2489 /**
2490 * The window that is focused in this application, otherwise returns `null`.
2491 */
2492 static getFocusedWindow(): (BaseWindow) | (null);
2493 /**
2494 * Adds a window as a tab on this window, after the tab for the window instance.
2495 *
2496 * @platform darwin
2497 */
2498 addTabbedWindow(baseWindow: BaseWindow): void;
2499 /**
2500 * Removes focus from the window.
2501 */
2502 blur(): void;
2503 /**
2504 * Moves window to the center of the screen.
2505 */
2506 center(): void;
2507 /**
2508 * Try to close the window. This has the same effect as a user manually clicking
2509 * the close button of the window. The web page may cancel the close though. See
2510 * the close event.
2511 */
2512 close(): void;
2513 /**
2514 * Closes the currently open Quick Look panel.
2515 *
2516 * @platform darwin
2517 */
2518 closeFilePreview(): void;
2519 /**
2520 * Force closing the window, the `unload` and `beforeunload` event won't be emitted
2521 * for the web page, and `close` event will also not be emitted for this window,
2522 * but it guarantees the `closed` event will be emitted.
2523 */
2524 destroy(): void;
2525 /**
2526 * Starts or stops flashing the window to attract user's attention.
2527 */
2528 flashFrame(flag: boolean): void;
2529 /**
2530 * Focuses on the window.
2531 */
2532 focus(): void;
2533 /**
2534 * Gets the background color of the window in Hex (`#RRGGBB`) format.
2535 *
2536 * See Setting `backgroundColor`.
2537 *
2538 * **Note:** The alpha value is _not_ returned alongside the red, green, and blue
2539 * values.
2540 */
2541 getBackgroundColor(): string;
2542 /**
2543 * The `bounds` of the window as `Object`.
2544 *
2545 * **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
2546 * height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
2547 * 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
2548 * 25, y: 38, width: 800, height: 600 }`.
2549 */
2550 getBounds(): Rectangle;
2551 /**
2552 * All child windows.
2553 */
2554 getChildWindows(): BaseWindow[];
2555 /**
2556 * The `bounds` of the window's client area as `Object`.
2557 */
2558 getContentBounds(): Rectangle;
2559 /**
2560 * Contains the window's client area's width and height.
2561 */
2562 getContentSize(): number[];
2563 /**
2564 * Returns View - The content view of the window.
2565 */
2566 getContentView(): void;
2567 /**
2568 * Contains the window's maximum width and height.
2569 */
2570 getMaximumSize(): number[];
2571 /**
2572 * Window id in the format of DesktopCapturerSource's id. For example
2573 * "window:1324:0".
2574 *
2575 * More precisely the format is `window:id:other_id` where `id` is `HWND` on
2576 * Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
2577 * Linux. `other_id` is used to identify web contents (tabs) so within the same top
2578 * level window.
2579 */
2580 getMediaSourceId(): string;
2581 /**
2582 * Contains the window's minimum width and height.
2583 */
2584 getMinimumSize(): number[];
2585 /**
2586 * The platform-specific handle of the window.
2587 *
2588 * The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
2589 * `Window` (`unsigned long`) on Linux.
2590 */
2591 getNativeWindowHandle(): Buffer;
2592 /**
2593 * Contains the window bounds of the normal state
2594 *
2595 * **Note:** whatever the current state of the window : maximized, minimized or in
2596 * fullscreen, this function always returns the position and size of the window in
2597 * normal state. In normal state, getBounds and getNormalBounds returns the same
2598 * `Rectangle`.
2599 */
2600 getNormalBounds(): Rectangle;
2601 /**
2602 * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
2603 * 1.
2604 */
2605 getOpacity(): number;
2606 /**
2607 * The parent window or `null` if there is no parent.
2608 */
2609 getParentWindow(): (BaseWindow) | (null);
2610 /**
2611 * Contains the window's current position.
2612 */
2613 getPosition(): number[];
2614 /**
2615 * The pathname of the file the window represents.
2616 *
2617 * @platform darwin
2618 */
2619 getRepresentedFilename(): string;
2620 /**
2621 * Contains the window's width and height.
2622 */
2623 getSize(): number[];
2624 /**
2625 * The title of the native window.
2626 *
2627 * **Note:** The title of the web page can be different from the title of the
2628 * native window.
2629 */
2630 getTitle(): string;
2631 /**
2632 * The custom position for the traffic light buttons in frameless window, `null`
2633 * will be returned when there is no custom position.
2634 *
2635 * @platform darwin
2636 */
2637 getWindowButtonPosition(): (Point) | (null);
2638 /**
2639 * Whether the window has a shadow.
2640 */
2641 hasShadow(): boolean;
2642 /**
2643 * Hides the window.
2644 */
2645 hide(): void;
2646 /**
2647 * Hooks a windows message. The `callback` is called when the message is received
2648 * in the WndProc.
2649 *
2650 * @platform win32
2651 */
2652 hookWindowMessage(message: number, callback: (wParam: Buffer, lParam: Buffer) => void): void;
2653 /**
2654 * Invalidates the window shadow so that it is recomputed based on the current
2655 * window shape.
2656 *
2657 * `BaseWindow`s that are transparent can sometimes leave behind visual artifacts
2658 * on macOS. This method can be used to clear these artifacts when, for example,
2659 * performing an animation.
2660 *
2661 * @platform darwin
2662 */
2663 invalidateShadow(): void;
2664 /**
2665 * Whether the window is always on top of other windows.
2666 */
2667 isAlwaysOnTop(): boolean;
2668 /**
2669 * Whether the window can be manually closed by user.
2670 *
2671 * On Linux always returns `true`.
2672 *
2673 * @platform darwin,win32
2674 */
2675 isClosable(): boolean;
2676 /**
2677 * Whether the window is destroyed.
2678 */
2679 isDestroyed(): boolean;
2680 /**
2681 * Whether the window's document has been edited.
2682 *
2683 * @platform darwin
2684 */
2685 isDocumentEdited(): boolean;
2686 /**
2687 * whether the window is enabled.
2688 */
2689 isEnabled(): boolean;
2690 /**
2691 * Whether the window can be focused.
2692 *
2693 * @platform darwin,win32
2694 */
2695 isFocusable(): boolean;
2696 /**
2697 * Whether the window is focused.
2698 */
2699 isFocused(): boolean;
2700 /**
2701 * Whether the window is in fullscreen mode.
2702 */
2703 isFullScreen(): boolean;
2704 /**
2705 * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
2706 * window.
2707 */
2708 isFullScreenable(): boolean;
2709 /**
2710 * Whether the window will be hidden when the user toggles into mission control.
2711 *
2712 * @platform darwin
2713 */
2714 isHiddenInMissionControl(): boolean;
2715 /**
2716 * Whether the window is in kiosk mode.
2717 */
2718 isKiosk(): boolean;
2719 /**
2720 * Whether the window can be manually maximized by user.
2721 *
2722 * On Linux always returns `true`.
2723 *
2724 * @platform darwin,win32
2725 */
2726 isMaximizable(): boolean;
2727 /**
2728 * Whether the window is maximized.
2729 */
2730 isMaximized(): boolean;
2731 /**
2732 * Whether menu bar automatically hides itself.
2733 *
2734 * @platform win32,linux
2735 */
2736 isMenuBarAutoHide(): boolean;
2737 /**
2738 * Whether the menu bar is visible.
2739 *
2740 * @platform win32,linux
2741 */
2742 isMenuBarVisible(): boolean;
2743 /**
2744 * Whether the window can be manually minimized by the user.
2745 *
2746 * On Linux always returns `true`.
2747 *
2748 * @platform darwin,win32
2749 */
2750 isMinimizable(): boolean;
2751 /**
2752 * Whether the window is minimized.
2753 */
2754 isMinimized(): boolean;
2755 /**
2756 * Whether current window is a modal window.
2757 */
2758 isModal(): boolean;
2759 /**
2760 * Whether the window can be moved by user.
2761 *
2762 * On Linux always returns `true`.
2763 *
2764 * @platform darwin,win32
2765 */
2766 isMovable(): boolean;
2767 /**
2768 * Whether the window is in normal state (not maximized, not minimized, not in
2769 * fullscreen mode).
2770 */
2771 isNormal(): boolean;
2772 /**
2773 * Whether the window can be manually resized by the user.
2774 */
2775 isResizable(): boolean;
2776 /**
2777 * Whether the window is in simple (pre-Lion) fullscreen mode.
2778 *
2779 * @platform darwin
2780 */
2781 isSimpleFullScreen(): boolean;
2782 /**
2783 * Whether the window is in Windows 10 tablet mode.
2784 *
2785 * Since Windows 10 users can use their PC as tablet, under this mode apps can
2786 * choose to optimize their UI for tablets, such as enlarging the titlebar and
2787 * hiding titlebar buttons.
2788 *
2789 * This API returns whether the window is in tablet mode, and the `resize` event
2790 * can be be used to listen to changes to tablet mode.
2791 *
2792 * @platform win32
2793 */
2794 isTabletMode(): boolean;
2795 /**
2796 * Whether the window is visible to the user in the foreground of the app.
2797 */
2798 isVisible(): boolean;
2799 /**
2800 * Whether the window is visible on all workspaces.
2801 *
2802 * **Note:** This API always returns false on Windows.
2803 *
2804 * @platform darwin,linux
2805 */
2806 isVisibleOnAllWorkspaces(): boolean;
2807 /**
2808 * `true` or `false` depending on whether the message is hooked.
2809 *
2810 * @platform win32
2811 */
2812 isWindowMessageHooked(message: number): boolean;
2813 /**
2814 * Maximizes the window. This will also show (but not focus) the window if it isn't
2815 * being displayed already.
2816 */
2817 maximize(): void;
2818 /**
2819 * Merges all windows into one window with multiple tabs when native tabs are
2820 * enabled and there is more than one open window.
2821 *
2822 * @platform darwin
2823 */
2824 mergeAllWindows(): void;
2825 /**
2826 * Minimizes the window. On some platforms the minimized window will be shown in
2827 * the Dock.
2828 */
2829 minimize(): void;
2830 /**
2831 * Moves window above the source window in the sense of z-order. If the
2832 * `mediaSourceId` is not of type window or if the window does not exist then this
2833 * method throws an error.
2834 */
2835 moveAbove(mediaSourceId: string): void;
2836 /**
2837 * Moves the current tab into a new window if native tabs are enabled and there is
2838 * more than one tab in the current window.
2839 *
2840 * @platform darwin
2841 */
2842 moveTabToNewWindow(): void;
2843 /**
2844 * Moves window to top(z-order) regardless of focus
2845 */
2846 moveTop(): void;
2847 /**
2848 * Uses Quick Look to preview a file at a given path.
2849 *
2850 * @platform darwin
2851 */
2852 previewFile(path: string, displayName?: string): void;
2853 /**
2854 * Remove the window's menu bar.
2855 *
2856 * @platform linux,win32
2857 */
2858 removeMenu(): void;
2859 /**
2860 * Restores the window from minimized state to its previous state.
2861 */
2862 restore(): void;
2863 /**
2864 * Selects the next tab when native tabs are enabled and there are other tabs in
2865 * the window.
2866 *
2867 * @platform darwin
2868 */
2869 selectNextTab(): void;
2870 /**
2871 * Selects the previous tab when native tabs are enabled and there are other tabs
2872 * in the window.
2873 *
2874 * @platform darwin
2875 */
2876 selectPreviousTab(): void;
2877 /**
2878 * Sets whether the window should show always on top of other windows. After
2879 * setting this, the window is still a normal window, not a toolbox window which
2880 * can not be focused on.
2881 */
2882 setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver', relativeLevel?: number): void;
2883 /**
2884 * Sets the properties for the window's taskbar button.
2885 *
2886 * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
2887 * together. If one of those properties is not set, then neither will be used.
2888 *
2889 * @platform win32
2890 */
2891 setAppDetails(options: AppDetailsOptions): void;
2892 /**
2893 * This will make a window maintain an aspect ratio. The extra size allows a
2894 * developer to have space, specified in pixels, not included within the aspect
2895 * ratio calculations. This API already takes into account the difference between a
2896 * window's size and its content size.
2897 *
2898 * Consider a normal window with an HD video player and associated controls.
2899 * Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
2900 * on the right edge and 50 pixels of controls below the player. In order to
2901 * maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
2902 * the player itself we would call this function with arguments of 16/9 and {
2903 * width: 40, height: 50 }. The second argument doesn't care where the extra width
2904 * and height are within the content view--only that they exist. Sum any extra
2905 * width and height areas you have within the overall content view.
2906 *
2907 * The aspect ratio is not respected when window is resized programmatically with
2908 * APIs like `win.setSize`.
2909 *
2910 * To reset an aspect ratio, pass 0 as the `aspectRatio` value:
2911 * `win.setAspectRatio(0)`.
2912 */
2913 setAspectRatio(aspectRatio: number, extraSize?: Size): void;
2914 /**
2915 * Controls whether to hide cursor when typing.
2916 *
2917 * @platform darwin
2918 */
2919 setAutoHideCursor(autoHide: boolean): void;
2920 /**
2921 * Sets whether the window menu bar should hide itself automatically. Once set the
2922 * menu bar will only show when users press the single `Alt` key.
2923 *
2924 * If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
2925 * hide it immediately.
2926 *
2927 * @platform win32,linux
2928 */
2929 setAutoHideMenuBar(hide: boolean): void;
2930 /**
2931 * Examples of valid `backgroundColor` values:
2932 *
2933 * * Hex
2934 * * #fff (shorthand RGB)
2935 * * #ffff (shorthand ARGB)
2936 * * #ffffff (RGB)
2937 * * #ffffffff (ARGB)
2938 * * RGB
2939 * * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
2940 * * e.g. rgb(255, 255, 255)
2941 * * RGBA
2942 * * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
2943 * * e.g. rgba(255, 255, 255, 1.0)
2944 * * HSL
2945 * * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
2946 * * e.g. hsl(200, 20%, 50%)
2947 * * HSLA
2948 * * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
2949 * * e.g. hsla(200, 20%, 50%, 0.5)
2950 * * Color name
2951 * * Options are listed in SkParseColor.cpp
2952 * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
2953 * * e.g. `blueviolet` or `red`
2954 *
2955 * Sets the background color of the window. See Setting `backgroundColor`.
2956 */
2957 setBackgroundColor(backgroundColor: string): void;
2958 /**
2959 * This method sets the browser window's system-drawn background material,
2960 * including behind the non-client area.
2961 *
2962 * See the Windows documentation for more details.
2963 *
2964 * **Note:** This method is only supported on Windows 11 22H2 and up.
2965 *
2966 * @platform win32
2967 */
2968 setBackgroundMaterial(material: 'auto' | 'none' | 'mica' | 'acrylic' | 'tabbed'): void;
2969 /**
2970 * Resizes and moves the window to the supplied bounds. Any properties that are not
2971 * supplied will default to their current values.
2972 *
2973 * **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
2974 * height. The tray height has changed over time and depends on the operating
2975 * system, but is between 20-40px. Passing a value lower than the tray height will
2976 * result in a window that is flush to the tray.
2977 */
2978 setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
2979 /**
2980 * Sets whether the window can be manually closed by user. On Linux does nothing.
2981 *
2982 * @platform darwin,win32
2983 */
2984 setClosable(closable: boolean): void;
2985 /**
2986 * Resizes and moves the window's client area (e.g. the web page) to the supplied
2987 * bounds.
2988 */
2989 setContentBounds(bounds: Rectangle, animate?: boolean): void;
2990 /**
2991 * Prevents the window contents from being captured by other apps.
2992 *
2993 * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
2994 * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
2995 * version 2004 and up the window will be removed from capture entirely, older
2996 * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
2997 *
2998 * @platform darwin,win32
2999 */
3000 setContentProtection(enable: boolean): void;
3001 /**
3002 * Resizes the window's client area (e.g. the web page) to `width` and `height`.
3003 */
3004 setContentSize(width: number, height: number, animate?: boolean): void;
3005 /**
3006 * Sets the content view of the window.
3007 */
3008 setContentView(view: View): void;
3009 /**
3010 * Specifies whether the window’s document has been edited, and the icon in title
3011 * bar will become gray when set to `true`.
3012 *
3013 * @platform darwin
3014 */
3015 setDocumentEdited(edited: boolean): void;
3016 /**
3017 * Disable or enable the window.
3018 */
3019 setEnabled(enable: boolean): void;
3020 /**
3021 * Changes whether the window can be focused.
3022 *
3023 * On macOS it does not remove the focus from the window.
3024 *
3025 * @platform darwin,win32
3026 */
3027 setFocusable(focusable: boolean): void;
3028 /**
3029 * Sets whether the window should be in fullscreen mode.
3030 *
3031 * **Note:** On macOS, fullscreen transitions take place asynchronously. If further
3032 * actions depend on the fullscreen state, use the 'enter-full-screen' or
3033 * 'leave-full-screen' events.
3034 */
3035 setFullScreen(flag: boolean): void;
3036 /**
3037 * Sets whether the maximize/zoom window button toggles fullscreen mode or
3038 * maximizes the window.
3039 */
3040 setFullScreenable(fullscreenable: boolean): void;
3041 /**
3042 * Sets whether the window should have a shadow.
3043 */
3044 setHasShadow(hasShadow: boolean): void;
3045 /**
3046 * Sets whether the window will be hidden when the user toggles into mission
3047 * control.
3048 *
3049 * @platform darwin
3050 */
3051 setHiddenInMissionControl(hidden: boolean): void;
3052 /**
3053 * Changes window icon.
3054 *
3055 * @platform win32,linux
3056 */
3057 setIcon(icon: (NativeImage) | (string)): void;
3058 /**
3059 * Makes the window ignore all mouse events.
3060 *
3061 * All mouse events happened in this window will be passed to the window below this
3062 * window, but if this window has focus, it will still receive keyboard events.
3063 */
3064 setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
3065 /**
3066 * Enters or leaves kiosk mode.
3067 */
3068 setKiosk(flag: boolean): void;
3069 /**
3070 * Sets whether the window can be manually maximized by user. On Linux does
3071 * nothing.
3072 *
3073 * @platform darwin,win32
3074 */
3075 setMaximizable(maximizable: boolean): void;
3076 /**
3077 * Sets the maximum size of window to `width` and `height`.
3078 */
3079 setMaximumSize(width: number, height: number): void;
3080 /**
3081 * Sets the `menu` as the window's menu bar.
3082 *
3083 * @platform linux,win32
3084 */
3085 setMenu(menu: (Menu) | (null)): void;
3086 /**
3087 * Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
3088 * can still bring up the menu bar by pressing the single `Alt` key.
3089 *
3090 * @platform win32,linux
3091 */
3092 setMenuBarVisibility(visible: boolean): void;
3093 /**
3094 * Sets whether the window can be manually minimized by user. On Linux does
3095 * nothing.
3096 *
3097 * @platform darwin,win32
3098 */
3099 setMinimizable(minimizable: boolean): void;
3100 /**
3101 * Sets the minimum size of window to `width` and `height`.
3102 */
3103 setMinimumSize(width: number, height: number): void;
3104 /**
3105 * Sets whether the window can be moved by user. On Linux does nothing.
3106 *
3107 * @platform darwin,win32
3108 */
3109 setMovable(movable: boolean): void;
3110 /**
3111 * Sets the opacity of the window. On Linux, does nothing. Out of bound number
3112 * values are clamped to the [0, 1] range.
3113 *
3114 * @platform win32,darwin
3115 */
3116 setOpacity(opacity: number): void;
3117 /**
3118 * Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
3119 * convey some sort of application status or to passively notify the user.
3120 *
3121 * @platform win32
3122 */
3123 setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
3124 /**
3125 * Sets `parent` as current window's parent window, passing `null` will turn
3126 * current window into a top-level window.
3127 */
3128 setParentWindow(parent: (BaseWindow) | (null)): void;
3129 /**
3130 * Moves window to `x` and `y`.
3131 */
3132 setPosition(x: number, y: number, animate?: boolean): void;
3133 /**
3134 * Sets progress value in progress bar. Valid range is [0, 1.0].
3135 *
3136 * Remove progress bar when progress < 0; Change to indeterminate mode when
3137 * progress > 1.
3138 *
3139 * On Linux platform, only supports Unity desktop environment, you need to specify
3140 * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
3141 * it will assume `{app.name}.desktop`.
3142 *
3143 * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
3144 * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
3145 * mode set (but with a value within the valid range), `normal` will be assumed.
3146 */
3147 setProgressBar(progress: number, options?: ProgressBarOptions): void;
3148 /**
3149 * Sets the pathname of the file the window represents, and the icon of the file
3150 * will show in window's title bar.
3151 *
3152 * @platform darwin
3153 */
3154 setRepresentedFilename(filename: string): void;
3155 /**
3156 * Sets whether the window can be manually resized by the user.
3157 */
3158 setResizable(resizable: boolean): void;
3159 /**
3160 * Setting a window shape determines the area within the window where the system
3161 * permits drawing and user interaction. Outside of the given region, no pixels
3162 * will be drawn and no mouse events will be registered. Mouse events outside of
3163 * the region will not be received by that window, but will fall through to
3164 * whatever is behind the window.
3165 *
3166 * @experimental
3167 * @platform win32,linux
3168 */
3169 setShape(rects: Rectangle[]): void;
3170 /**
3171 * Changes the attachment point for sheets on macOS. By default, sheets are
3172 * attached just below the window frame, but you may want to display them beneath a
3173 * HTML-rendered toolbar. For example:
3174 *
3175 * @platform darwin
3176 */
3177 setSheetOffset(offsetY: number, offsetX?: number): void;
3178 /**
3179 * Enters or leaves simple fullscreen mode.
3180 *
3181 * Simple fullscreen mode emulates the native fullscreen behavior found in versions
3182 * of macOS prior to Lion (10.7).
3183 *
3184 * @platform darwin
3185 */
3186 setSimpleFullScreen(flag: boolean): void;
3187 /**
3188 * Resizes the window to `width` and `height`. If `width` or `height` are below any
3189 * set minimum size constraints the window will snap to its minimum size.
3190 */
3191 setSize(width: number, height: number, animate?: boolean): void;
3192 /**
3193 * Makes the window not show in the taskbar.
3194 *
3195 * @platform darwin,win32
3196 */
3197 setSkipTaskbar(skip: boolean): void;
3198 /**
3199 * Whether the buttons were added successfully
3200 *
3201 * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
3202 * of a window in a taskbar button layout. Returns a `boolean` object indicates
3203 * whether the thumbnail has been added successfully.
3204 *
3205 * The number of buttons in thumbnail toolbar should be no greater than 7 due to
3206 * the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
3207 * removed due to the platform's limitation. But you can call the API with an empty
3208 * array to clean the buttons.
3209 *
3210 * The `buttons` is an array of `Button` objects:
3211 *
3212 * * `Button` Object
3213 * * `icon` NativeImage - The icon showing in thumbnail toolbar.
3214 * * `click` Function
3215 * * `tooltip` string (optional) - The text of the button's tooltip.
3216 * * `flags` string[] (optional) - Control specific states and behaviors of the
3217 * button. By default, it is `['enabled']`.
3218 *
3219 * The `flags` is an array that can include following `string`s:
3220 *
3221 * * `enabled` - The button is active and available to the user.
3222 * * `disabled` - The button is disabled. It is present, but has a visual state
3223 * indicating it will not respond to user action.
3224 * * `dismissonclick` - When the button is clicked, the thumbnail window closes
3225 * immediately.
3226 * * `nobackground` - Do not draw a button border, use only the image.
3227 * * `hidden` - The button is not shown to the user.
3228 * * `noninteractive` - The button is enabled but not interactive; no pressed
3229 * button state is drawn. This value is intended for instances where the button is
3230 * used in a notification.
3231 *
3232 * @platform win32
3233 */
3234 setThumbarButtons(buttons: ThumbarButton[]): boolean;
3235 /**
3236 * Sets the region of the window to show as the thumbnail image displayed when
3237 * hovering over the window in the taskbar. You can reset the thumbnail to be the
3238 * entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
3239 * }`.
3240 *
3241 * @platform win32
3242 */
3243 setThumbnailClip(region: Rectangle): void;
3244 /**
3245 * Sets the toolTip that is displayed when hovering over the window thumbnail in
3246 * the taskbar.
3247 *
3248 * @platform win32
3249 */
3250 setThumbnailToolTip(toolTip: string): void;
3251 /**
3252 * Changes the title of native window to `title`.
3253 */
3254 setTitle(title: string): void;
3255 /**
3256 * On a Window with Window Controls Overlay already enabled, this method updates
3257 * the style of the title bar overlay.
3258 *
3259 * @platform win32
3260 */
3261 setTitleBarOverlay(options: TitleBarOverlayOptions): void;
3262 /**
3263 * Sets the touchBar layout for the current window. Specifying `null` or
3264 * `undefined` clears the touch bar. This method only has an effect if the machine
3265 * has a touch bar.
3266 *
3267 * **Note:** The TouchBar API is currently experimental and may change or be
3268 * removed in future Electron releases.
3269 *
3270 * @platform darwin
3271 */
3272 setTouchBar(touchBar: (TouchBar) | (null)): void;
3273 /**
3274 * Adds a vibrancy effect to the window. Passing `null` or an empty string will
3275 * remove the vibrancy effect on the window.
3276 *
3277 * @platform darwin
3278 */
3279 setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
3280 /**
3281 * Sets whether the window should be visible on all workspaces.
3282 *
3283 * **Note:** This API does nothing on Windows.
3284 *
3285 * @platform darwin,linux
3286 */
3287 setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
3288 /**
3289 * Set a custom position for the traffic light buttons in frameless window. Passing
3290 * `null` will reset the position to default.
3291 *
3292 * @platform darwin
3293 */
3294 setWindowButtonPosition(position: (Point) | (null)): void;
3295 /**
3296 * Sets whether the window traffic light buttons should be visible.
3297 *
3298 * @platform darwin
3299 */
3300 setWindowButtonVisibility(visible: boolean): void;
3301 /**
3302 * Shows and gives focus to the window.
3303 */
3304 show(): void;
3305 /**
3306 * Shows or hides the tab overview when native tabs are enabled.
3307 *
3308 * @platform darwin
3309 */
3310 showAllTabs(): void;
3311 /**
3312 * Shows the window but doesn't focus on it.
3313 */
3314 showInactive(): void;
3315 /**
3316 * Toggles the visibility of the tab bar if native tabs are enabled and there is
3317 * only one tab in the current window.
3318 *
3319 * @platform darwin
3320 */
3321 toggleTabBar(): void;
3322 /**
3323 * Unhooks all of the window messages.
3324 *
3325 * @platform win32
3326 */
3327 unhookAllWindowMessages(): void;
3328 /**
3329 * Unhook the window message.
3330 *
3331 * @platform win32
3332 */
3333 unhookWindowMessage(message: number): void;
3334 /**
3335 * Unmaximizes the window.
3336 */
3337 unmaximize(): void;
3338 /**
3339 * A `string` property that defines an alternative title provided only to
3340 * accessibility tools such as screen readers. This string is not directly visible
3341 * to users.
3342 */
3343 accessibleTitle: string;
3344 /**
3345 * A `boolean` property that determines whether the window menu bar should hide
3346 * itself automatically. Once set, the menu bar will only show when users press the
3347 * single `Alt` key.
3348 *
3349 * If the menu bar is already visible, setting this property to `true` won't hide
3350 * it immediately.
3351 */
3352 autoHideMenuBar: boolean;
3353 /**
3354 * A `boolean` property that determines whether the window can be manually closed
3355 * by user.
3356 *
3357 * On Linux the setter is a no-op, although the getter returns `true`.
3358 *
3359 * @platform darwin,win32
3360 */
3361 closable: boolean;
3362 /**
3363 * A `View` property for the content view of the window.
3364 */
3365 contentView: View;
3366 /**
3367 * A `boolean` property that specifies whether the window’s document has been
3368 * edited.
3369 *
3370 * The icon in title bar will become gray when set to `true`.
3371 *
3372 * @platform darwin
3373 */
3374 documentEdited: boolean;
3375 /**
3376 * A `boolean` property that determines whether the window is excluded from the
3377 * application’s Windows menu. `false` by default.
3378 *
3379 * @platform darwin
3380 */
3381 excludedFromShownWindowsMenu: boolean;
3382 /**
3383 * A `boolean` property that determines whether the window is focusable.
3384 *
3385 * @platform win32,darwin
3386 */
3387 focusable: boolean;
3388 /**
3389 * A `boolean` property that determines whether the window is in fullscreen mode.
3390 */
3391 fullScreen: boolean;
3392 /**
3393 * A `boolean` property that determines whether the maximize/zoom window button
3394 * toggles fullscreen mode or maximizes the window.
3395 */
3396 fullScreenable: boolean;
3397 /**
3398 * A `Integer` property representing the unique ID of the window. Each ID is unique
3399 * among all `BaseWindow` instances of the entire Electron application.
3400 *
3401 */
3402 readonly id: number;
3403 /**
3404 * A `boolean` property that determines whether the window is in kiosk mode.
3405 */
3406 kiosk: boolean;
3407 /**
3408 * A `boolean` property that determines whether the window can be manually
3409 * maximized by user.
3410 *
3411 * On Linux the setter is a no-op, although the getter returns `true`.
3412 *
3413 * @platform darwin,win32
3414 */
3415 maximizable: boolean;
3416 /**
3417 * A `boolean` property that determines whether the menu bar should be visible.
3418 *
3419 * **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
3420 * pressing the single `Alt` key.
3421 *
3422 * @platform win32,linux
3423 */
3424 menuBarVisible: boolean;
3425 /**
3426 * A `boolean` property that determines whether the window can be manually
3427 * minimized by user.
3428 *
3429 * On Linux the setter is a no-op, although the getter returns `true`.
3430 *
3431 * @platform darwin,win32
3432 */
3433 minimizable: boolean;
3434 /**
3435 * A `boolean` property that determines Whether the window can be moved by user.
3436 *
3437 * On Linux the setter is a no-op, although the getter returns `true`.
3438 *
3439 * @platform darwin,win32
3440 */
3441 movable: boolean;
3442 /**
3443 * A `string` property that determines the pathname of the file the window
3444 * represents, and the icon of the file will show in window's title bar.
3445 *
3446 * @platform darwin
3447 */
3448 representedFilename: string;
3449 /**
3450 * A `boolean` property that determines whether the window can be manually resized
3451 * by user.
3452 */
3453 resizable: boolean;
3454 /**
3455 * A `boolean` property that determines whether the window has a shadow.
3456 */
3457 shadow: boolean;
3458 /**
3459 * A `boolean` property that determines whether the window is in simple (pre-Lion)
3460 * fullscreen mode.
3461 */
3462 simpleFullScreen: boolean;
3463 /**
3464 * A `string` (optional) property that is equal to the `tabbingIdentifier` passed
3465 * to the `BrowserWindow` constructor or `undefined` if none was set.
3466 *
3467 * @platform darwin
3468 */
3469 readonly tabbingIdentifier?: string;
3470 /**
3471 * A `string` property that determines the title of the native window.
3472 *
3473 * **Note:** The title of the web page can be different from the title of the
3474 * native window.
3475 */
3476 title: string;
3477 /**
3478 * A `boolean` property that determines whether the window is visible on all
3479 * workspaces.
3480 *
3481 * **Note:** Always returns false on Windows.
3482 *
3483 * @platform darwin,linux
3484 */
3485 visibleOnAllWorkspaces: boolean;
3486 }
3487
3488 interface BaseWindowConstructorOptions {
3489
3490 // Docs: https://electronjs.org/docs/api/structures/base-window-options
3491
3492 /**
3493 * Whether clicking an inactive window will also click through to the web contents.
3494 * Default is `false` on macOS. This option is not configurable on other platforms.
3495 *
3496 * @platform darwin
3497 */
3498 acceptFirstMouse?: boolean;
3499 /**
3500 * Whether the window should always stay on top of other windows. Default is
3501 * `false`.
3502 */
3503 alwaysOnTop?: boolean;
3504 /**
3505 * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
3506 */
3507 autoHideMenuBar?: boolean;
3508 /**
3509 * The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color
3510 * format. Alpha in #AARRGGBB format is supported if `transparent` is set to
3511 * `true`. Default is `#FFF` (white). See win.setBackgroundColor for more
3512 * information.
3513 */
3514 backgroundColor?: string;
3515 /**
3516 * Set the window's system-drawn background material, including behind the
3517 * non-client area. Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See
3518 * win.setBackgroundMaterial for more information.
3519 *
3520 * @platform win32
3521 */
3522 backgroundMaterial?: ('auto' | 'none' | 'mica' | 'acrylic' | 'tabbed');
3523 /**
3524 * Show window in the center of the screen. Default is `false`.
3525 */
3526 center?: boolean;
3527 /**
3528 * Whether window is closable. This is not implemented on Linux. Default is `true`.
3529 *
3530 * @platform darwin,win32
3531 */
3532 closable?: boolean;
3533 /**
3534 * Forces using dark theme for the window, only works on some GTK+3 desktop
3535 * environments. Default is `false`.
3536 */
3537 darkTheme?: boolean;
3538 /**
3539 * Whether to hide cursor when typing. Default is `false`.
3540 */
3541 disableAutoHideCursor?: boolean;
3542 /**
3543 * Enable the window to be resized larger than screen. Only relevant for macOS, as
3544 * other OSes allow larger-than-screen windows by default. Default is `false`.
3545 *
3546 * @platform darwin
3547 */
3548 enableLargerThanScreen?: boolean;
3549 /**
3550 * Whether the window can be focused. Default is `true`. On Windows setting
3551 * `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
3552 * `focusable: false` makes the window stop interacting with wm, so the window will
3553 * always stay on top in all workspaces.
3554 */
3555 focusable?: boolean;
3556 /**
3557 * Specify `false` to create a frameless window. Default is `true`.
3558 */
3559 frame?: boolean;
3560 /**
3561 * Whether the window should show in fullscreen. When explicitly set to `false` the
3562 * fullscreen button will be hidden or disabled on macOS. Default is `false`.
3563 */
3564 fullscreen?: boolean;
3565 /**
3566 * Whether the window can be put into fullscreen mode. On macOS, also whether the
3567 * maximize/zoom button should toggle full screen mode or maximize window. Default
3568 * is `true`.
3569 */
3570 fullscreenable?: boolean;
3571 /**
3572 * Whether window should have a shadow. Default is `true`.
3573 */
3574 hasShadow?: boolean;
3575 /**
3576 * Window's height in pixels. Default is `600`.
3577 */
3578 height?: number;
3579 /**
3580 * Whether window should be hidden when the user toggles into mission control.
3581 *
3582 * @platform darwin
3583 */
3584 hiddenInMissionControl?: boolean;
3585 /**
3586 * The window icon. On Windows it is recommended to use `ICO` icons to get best
3587 * visual effects, you can also leave it undefined so the executable's icon will be
3588 * used.
3589 */
3590 icon?: (NativeImage) | (string);
3591 /**
3592 * Whether the window is in kiosk mode. Default is `false`.
3593 */
3594 kiosk?: boolean;
3595 /**
3596 * Window's maximum height. Default is no limit.
3597 */
3598 maxHeight?: number;
3599 /**
3600 * Whether window is maximizable. This is not implemented on Linux. Default is
3601 * `true`.
3602 *
3603 * @platform darwin,win32
3604 */
3605 maximizable?: boolean;
3606 /**
3607 * Window's maximum width. Default is no limit.
3608 */
3609 maxWidth?: number;
3610 /**
3611 * Window's minimum height. Default is `0`.
3612 */
3613 minHeight?: number;
3614 /**
3615 * Whether window is minimizable. This is not implemented on Linux. Default is
3616 * `true`.
3617 *
3618 * @platform darwin,win32
3619 */
3620 minimizable?: boolean;
3621 /**
3622 * Window's minimum width. Default is `0`.
3623 */
3624 minWidth?: number;
3625 /**
3626 * Whether this is a modal window. This only works when the window is a child
3627 * window. Default is `false`.
3628 */
3629 modal?: boolean;
3630 /**
3631 * Whether window is movable. This is not implemented on Linux. Default is `true`.
3632 *
3633 * @platform darwin,win32
3634 */
3635 movable?: boolean;
3636 /**
3637 * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
3638 * (fully opaque). This is only implemented on Windows and macOS.
3639 *
3640 * @platform darwin,win32
3641 */
3642 opacity?: number;
3643 /**
3644 * Specify parent window. Default is `null`.
3645 */
3646 parent?: BaseWindow;
3647 /**
3648 * Whether window is resizable. Default is `true`.
3649 */
3650 resizable?: boolean;
3651 /**
3652 * Whether frameless window should have rounded corners on macOS. Default is
3653 * `true`. Setting this property to `false` will prevent the window from being
3654 * fullscreenable.
3655 *
3656 * @platform darwin
3657 */
3658 roundedCorners?: boolean;
3659 /**
3660 * Whether window should be shown when created. Default is `true`.
3661 */
3662 show?: boolean;
3663 /**
3664 * Use pre-Lion fullscreen on macOS. Default is `false`.
3665 *
3666 * @platform darwin
3667 */
3668 simpleFullscreen?: boolean;
3669 /**
3670 * Whether to show the window in taskbar. Default is `false`.
3671 *
3672 * @platform darwin,win32
3673 */
3674 skipTaskbar?: boolean;
3675 /**
3676 * Tab group name, allows opening the window as a native tab. Windows with the same
3677 * tabbing identifier will be grouped together. This also adds a native new tab
3678 * button to your window's tab bar and allows your `app` and window to receive the
3679 * `new-window-for-tab` event.
3680 *
3681 * @platform darwin
3682 */
3683 tabbingIdentifier?: string;
3684 /**
3685 * Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
3686 * window frame. Setting it to `false` will remove window shadow and window
3687 * animations. Default is `true`.
3688 */
3689 thickFrame?: boolean;
3690 /**
3691 * Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
3692 * defined in the HTML file loaded by `loadURL()`, this property will be ignored.
3693 */
3694 title?: string;
3695 /**
3696 * The style of window title bar. Default is `default`. Possible values are:
3697 *
3698 * @platform darwin,win32
3699 */
3700 titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
3701 /**
3702 * Set a custom position for the traffic light buttons in frameless windows.
3703 *
3704 * @platform darwin
3705 */
3706 trafficLightPosition?: Point;
3707 /**
3708 * Makes the window transparent. Default is `false`. On Windows, does not work
3709 * unless the window is frameless.
3710 */
3711 transparent?: boolean;
3712 /**
3713 * The type of window, default is normal window. See more about this below.
3714 */
3715 type?: string;
3716 /**
3717 * The `width` and `height` would be used as web page's size, which means the
3718 * actual window's size will include window frame's size and be slightly larger.
3719 * Default is `false`.
3720 */
3721 useContentSize?: boolean;
3722 /**
3723 * Add a type of vibrancy effect to the window, only on macOS. Can be
3724 * `appearance-based`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`,
3725 * `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`,
3726 * `under-window`, or `under-page`.
3727 *
3728 * @platform darwin
3729 */
3730 vibrancy?: ('appearance-based' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
3731 /**
3732 * Specify how the material appearance should reflect window activity state on
3733 * macOS. Must be used with the `vibrancy` property. Possible values are:
3734 *
3735 * @platform darwin
3736 */
3737 visualEffectState?: ('followWindow' | 'active' | 'inactive');
3738 /**
3739 * Window's width in pixels. Default is `800`.
3740 */
3741 width?: number;
3742 /**
3743 * (**required** if y is used) Window's left offset from screen. Default is to
3744 * center the window.
3745 */
3746 x?: number;
3747 /**
3748 * (**required** if x is used) Window's top offset from screen. Default is to
3749 * center the window.
3750 */
3751 y?: number;
3752 /**
3753 * Controls the behavior on macOS when option-clicking the green stoplight button
3754 * on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
3755 * will grow to the preferred width of the web page when zoomed, `false` will cause
3756 * it to zoom to the width of the screen. This will also affect the behavior when
3757 * calling `maximize()` directly. Default is `false`.
3758 *
3759 * @platform darwin
3760 */
3761 zoomToPageWidth?: boolean;
3762 }
3763
3764 interface BluetoothDevice {
3765
3766 // Docs: https://electronjs.org/docs/api/structures/bluetooth-device
3767
3768 deviceId: string;
3769 deviceName: string;
3770 }
3771
3772 class BrowserView {
3773
3774 // Docs: https://electronjs.org/docs/api/browser-view
3775
3776 /**
3777 * BrowserView
3778 */
3779 constructor(options?: BrowserViewConstructorOptions);
3780 /**
3781 * The `bounds` of this BrowserView instance as `Object`.
3782 *
3783 * @experimental
3784 * @deprecated
3785 */
3786 getBounds(): Rectangle;
3787 /**
3788 * @experimental
3789 * @deprecated
3790 */
3791 setAutoResize(options: AutoResizeOptions): void;
3792 /**
3793 * Examples of valid `color` values:
3794 *
3795 * * Hex
3796 * * `#fff` (RGB)
3797 * * `#ffff` (ARGB)
3798 * * `#ffffff` (RRGGBB)
3799 * * `#ffffffff` (AARRGGBB)
3800 * * RGB
3801 * * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
3802 * * e.g. `rgb(255, 255, 255)`
3803 * * RGBA
3804 * * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
3805 * * e.g. `rgba(255, 255, 255, 1.0)`
3806 * * HSL
3807 * * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
3808 * * e.g. `hsl(200, 20%, 50%)`
3809 * * HSLA
3810 * * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
3811 * * e.g. `hsla(200, 20%, 50%, 0.5)`
3812 * * Color name
3813 * * Options are listed in SkParseColor.cpp
3814 * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
3815 * * e.g. `blueviolet` or `red`
3816 *
3817 * **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
3818 * `RGB`.
3819 *
3820 * @experimental
3821 * @deprecated
3822 */
3823 setBackgroundColor(color: string): void;
3824 /**
3825 * Resizes and moves the view to the supplied bounds relative to the window.
3826 *
3827 * @experimental
3828 * @deprecated
3829 */
3830 setBounds(bounds: Rectangle): void;
3831 /**
3832 * A `WebContents` object owned by this view.
3833 *
3834 * @experimental
3835 * @deprecated
3836 */
3837 webContents: WebContents;
3838 }
3839
3840 class BrowserWindow extends BaseWindow {
3841
3842 // Docs: https://electronjs.org/docs/api/browser-window
3843
3844 /**
3845 * Emitted when the window is set or unset to show always on top of other windows.
3846 */
3847 on(event: 'always-on-top-changed', listener: (event: Event,
3848 isAlwaysOnTop: boolean) => void): this;
3849 off(event: 'always-on-top-changed', listener: (event: Event,
3850 isAlwaysOnTop: boolean) => void): this;
3851 once(event: 'always-on-top-changed', listener: (event: Event,
3852 isAlwaysOnTop: boolean) => void): this;
3853 addListener(event: 'always-on-top-changed', listener: (event: Event,
3854 isAlwaysOnTop: boolean) => void): this;
3855 removeListener(event: 'always-on-top-changed', listener: (event: Event,
3856 isAlwaysOnTop: boolean) => void): this;
3857 /**
3858 * Emitted when the window is set or unset to show always on top of other windows.
3859 */
3860 on(event: 'always-on-top-changed', listener: (event: Event,
3861 isAlwaysOnTop: boolean) => void): this;
3862 off(event: 'always-on-top-changed', listener: (event: Event,
3863 isAlwaysOnTop: boolean) => void): this;
3864 once(event: 'always-on-top-changed', listener: (event: Event,
3865 isAlwaysOnTop: boolean) => void): this;
3866 addListener(event: 'always-on-top-changed', listener: (event: Event,
3867 isAlwaysOnTop: boolean) => void): this;
3868 removeListener(event: 'always-on-top-changed', listener: (event: Event,
3869 isAlwaysOnTop: boolean) => void): this;
3870 /**
3871 * Emitted when an App Command is invoked. These are typically related to keyboard
3872 * media keys or browser commands, as well as the "Back" button built into some
3873 * mice on Windows.
3874 *
3875 * Commands are lowercased, underscores are replaced with hyphens, and the
3876 * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
3877 * emitted as `browser-backward`.
3878 *
3879 * The following app commands are explicitly supported on Linux:
3880 *
3881 * * `browser-backward`
3882 * * `browser-forward`
3883 *
3884 * @platform win32,linux
3885 */
3886 on(event: 'app-command', listener: (event: Event,
3887 command: string) => void): this;
3888 /**
3889 * @platform win32,linux
3890 */
3891 off(event: 'app-command', listener: (event: Event,
3892 command: string) => void): this;
3893 /**
3894 * @platform win32,linux
3895 */
3896 once(event: 'app-command', listener: (event: Event,
3897 command: string) => void): this;
3898 /**
3899 * @platform win32,linux
3900 */
3901 addListener(event: 'app-command', listener: (event: Event,
3902 command: string) => void): this;
3903 /**
3904 * @platform win32,linux
3905 */
3906 removeListener(event: 'app-command', listener: (event: Event,
3907 command: string) => void): this;
3908 /**
3909 * Emitted when an App Command is invoked. These are typically related to keyboard
3910 * media keys or browser commands, as well as the "Back" button built into some
3911 * mice on Windows.
3912 *
3913 * Commands are lowercased, underscores are replaced with hyphens, and the
3914 * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
3915 * emitted as `browser-backward`.
3916 *
3917 * The following app commands are explicitly supported on Linux:
3918 *
3919 * * `browser-backward`
3920 * * `browser-forward`
3921 *
3922 * @platform win32,linux
3923 */
3924 on(event: 'app-command', listener: (event: Event,
3925 command: string) => void): this;
3926 /**
3927 * @platform win32,linux
3928 */
3929 off(event: 'app-command', listener: (event: Event,
3930 command: string) => void): this;
3931 /**
3932 * @platform win32,linux
3933 */
3934 once(event: 'app-command', listener: (event: Event,
3935 command: string) => void): this;
3936 /**
3937 * @platform win32,linux
3938 */
3939 addListener(event: 'app-command', listener: (event: Event,
3940 command: string) => void): this;
3941 /**
3942 * @platform win32,linux
3943 */
3944 removeListener(event: 'app-command', listener: (event: Event,
3945 command: string) => void): this;
3946 /**
3947 * Emitted when the window loses focus.
3948 */
3949 on(event: 'blur', listener: Function): this;
3950 off(event: 'blur', listener: Function): this;
3951 once(event: 'blur', listener: Function): this;
3952 addListener(event: 'blur', listener: Function): this;
3953 removeListener(event: 'blur', listener: Function): this;
3954 /**
3955 * Emitted when the window loses focus.
3956 */
3957 on(event: 'blur', listener: Function): this;
3958 off(event: 'blur', listener: Function): this;
3959 once(event: 'blur', listener: Function): this;
3960 addListener(event: 'blur', listener: Function): this;
3961 removeListener(event: 'blur', listener: Function): this;
3962 /**
3963 * Emitted when the window is going to be closed. It's emitted before the
3964 * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
3965 * will cancel the close.
3966 *
3967 * Usually you would want to use the `beforeunload` handler to decide whether the
3968 * window should be closed, which will also be called when the window is reloaded.
3969 * In Electron, returning any value other than `undefined` would cancel the close.
3970 * For example:
3971 *
3972 * _**Note**: There is a subtle difference between the behaviors of
3973 * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
3974 * handler)`. It is recommended to always set the `event.returnValue` explicitly,
3975 * instead of only returning a value, as the former works more consistently within
3976 * Electron._
3977 */
3978 on(event: 'close', listener: (event: Event) => void): this;
3979 off(event: 'close', listener: (event: Event) => void): this;
3980 once(event: 'close', listener: (event: Event) => void): this;
3981 addListener(event: 'close', listener: (event: Event) => void): this;
3982 removeListener(event: 'close', listener: (event: Event) => void): this;
3983 /**
3984 * Emitted when the window is going to be closed. It's emitted before the
3985 * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
3986 * will cancel the close.
3987 *
3988 * Usually you would want to use the `beforeunload` handler to decide whether the
3989 * window should be closed, which will also be called when the window is reloaded.
3990 * In Electron, returning any value other than `undefined` would cancel the close.
3991 * For example:
3992 *
3993 * _**Note**: There is a subtle difference between the behaviors of
3994 * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
3995 * handler)`. It is recommended to always set the `event.returnValue` explicitly,
3996 * instead of only returning a value, as the former works more consistently within
3997 * Electron._
3998 */
3999 on(event: 'close', listener: (event: Event) => void): this;
4000 off(event: 'close', listener: (event: Event) => void): this;
4001 once(event: 'close', listener: (event: Event) => void): this;
4002 addListener(event: 'close', listener: (event: Event) => void): this;
4003 removeListener(event: 'close', listener: (event: Event) => void): this;
4004 /**
4005 * Emitted when the window is closed. After you have received this event you should
4006 * remove the reference to the window and avoid using it any more.
4007 */
4008 on(event: 'closed', listener: Function): this;
4009 off(event: 'closed', listener: Function): this;
4010 once(event: 'closed', listener: Function): this;
4011 addListener(event: 'closed', listener: Function): this;
4012 removeListener(event: 'closed', listener: Function): this;
4013 /**
4014 * Emitted when the window is closed. After you have received this event you should
4015 * remove the reference to the window and avoid using it any more.
4016 */
4017 on(event: 'closed', listener: Function): this;
4018 off(event: 'closed', listener: Function): this;
4019 once(event: 'closed', listener: Function): this;
4020 addListener(event: 'closed', listener: Function): this;
4021 removeListener(event: 'closed', listener: Function): this;
4022 /**
4023 * Emitted when the window enters a full-screen state.
4024 */
4025 on(event: 'enter-full-screen', listener: Function): this;
4026 off(event: 'enter-full-screen', listener: Function): this;
4027 once(event: 'enter-full-screen', listener: Function): this;
4028 addListener(event: 'enter-full-screen', listener: Function): this;
4029 removeListener(event: 'enter-full-screen', listener: Function): this;
4030 /**
4031 * Emitted when the window enters a full-screen state.
4032 */
4033 on(event: 'enter-full-screen', listener: Function): this;
4034 off(event: 'enter-full-screen', listener: Function): this;
4035 once(event: 'enter-full-screen', listener: Function): this;
4036 addListener(event: 'enter-full-screen', listener: Function): this;
4037 removeListener(event: 'enter-full-screen', listener: Function): this;
4038 /**
4039 * Emitted when the window enters a full-screen state triggered by HTML API.
4040 */
4041 on(event: 'enter-html-full-screen', listener: Function): this;
4042 off(event: 'enter-html-full-screen', listener: Function): this;
4043 once(event: 'enter-html-full-screen', listener: Function): this;
4044 addListener(event: 'enter-html-full-screen', listener: Function): this;
4045 removeListener(event: 'enter-html-full-screen', listener: Function): this;
4046 /**
4047 * Emitted when the window gains focus.
4048 */
4049 on(event: 'focus', listener: Function): this;
4050 off(event: 'focus', listener: Function): this;
4051 once(event: 'focus', listener: Function): this;
4052 addListener(event: 'focus', listener: Function): this;
4053 removeListener(event: 'focus', listener: Function): this;
4054 /**
4055 * Emitted when the window gains focus.
4056 */
4057 on(event: 'focus', listener: Function): this;
4058 off(event: 'focus', listener: Function): this;
4059 once(event: 'focus', listener: Function): this;
4060 addListener(event: 'focus', listener: Function): this;
4061 removeListener(event: 'focus', listener: Function): this;
4062 /**
4063 * Emitted when the window is hidden.
4064 */
4065 on(event: 'hide', listener: Function): this;
4066 off(event: 'hide', listener: Function): this;
4067 once(event: 'hide', listener: Function): this;
4068 addListener(event: 'hide', listener: Function): this;
4069 removeListener(event: 'hide', listener: Function): this;
4070 /**
4071 * Emitted when the window is hidden.
4072 */
4073 on(event: 'hide', listener: Function): this;
4074 off(event: 'hide', listener: Function): this;
4075 once(event: 'hide', listener: Function): this;
4076 addListener(event: 'hide', listener: Function): this;
4077 removeListener(event: 'hide', listener: Function): this;
4078 /**
4079 * Emitted when the window leaves a full-screen state.
4080 */
4081 on(event: 'leave-full-screen', listener: Function): this;
4082 off(event: 'leave-full-screen', listener: Function): this;
4083 once(event: 'leave-full-screen', listener: Function): this;
4084 addListener(event: 'leave-full-screen', listener: Function): this;
4085 removeListener(event: 'leave-full-screen', listener: Function): this;
4086 /**
4087 * Emitted when the window leaves a full-screen state.
4088 */
4089 on(event: 'leave-full-screen', listener: Function): this;
4090 off(event: 'leave-full-screen', listener: Function): this;
4091 once(event: 'leave-full-screen', listener: Function): this;
4092 addListener(event: 'leave-full-screen', listener: Function): this;
4093 removeListener(event: 'leave-full-screen', listener: Function): this;
4094 /**
4095 * Emitted when the window leaves a full-screen state triggered by HTML API.
4096 */
4097 on(event: 'leave-html-full-screen', listener: Function): this;
4098 off(event: 'leave-html-full-screen', listener: Function): this;
4099 once(event: 'leave-html-full-screen', listener: Function): this;
4100 addListener(event: 'leave-html-full-screen', listener: Function): this;
4101 removeListener(event: 'leave-html-full-screen', listener: Function): this;
4102 /**
4103 * Emitted when window is maximized.
4104 */
4105 on(event: 'maximize', listener: Function): this;
4106 off(event: 'maximize', listener: Function): this;
4107 once(event: 'maximize', listener: Function): this;
4108 addListener(event: 'maximize', listener: Function): this;
4109 removeListener(event: 'maximize', listener: Function): this;
4110 /**
4111 * Emitted when window is maximized.
4112 */
4113 on(event: 'maximize', listener: Function): this;
4114 off(event: 'maximize', listener: Function): this;
4115 once(event: 'maximize', listener: Function): this;
4116 addListener(event: 'maximize', listener: Function): this;
4117 removeListener(event: 'maximize', listener: Function): this;
4118 /**
4119 * Emitted when the window is minimized.
4120 */
4121 on(event: 'minimize', listener: Function): this;
4122 off(event: 'minimize', listener: Function): this;
4123 once(event: 'minimize', listener: Function): this;
4124 addListener(event: 'minimize', listener: Function): this;
4125 removeListener(event: 'minimize', listener: Function): this;
4126 /**
4127 * Emitted when the window is minimized.
4128 */
4129 on(event: 'minimize', listener: Function): this;
4130 off(event: 'minimize', listener: Function): this;
4131 once(event: 'minimize', listener: Function): this;
4132 addListener(event: 'minimize', listener: Function): this;
4133 removeListener(event: 'minimize', listener: Function): this;
4134 /**
4135 * Emitted when the window is being moved to a new position.
4136 */
4137 on(event: 'move', listener: Function): this;
4138 off(event: 'move', listener: Function): this;
4139 once(event: 'move', listener: Function): this;
4140 addListener(event: 'move', listener: Function): this;
4141 removeListener(event: 'move', listener: Function): this;
4142 /**
4143 * Emitted when the window is being moved to a new position.
4144 */
4145 on(event: 'move', listener: Function): this;
4146 off(event: 'move', listener: Function): this;
4147 once(event: 'move', listener: Function): this;
4148 addListener(event: 'move', listener: Function): this;
4149 removeListener(event: 'move', listener: Function): this;
4150 /**
4151 * Emitted once when the window is moved to a new position.
4152 *
4153 * **Note**: On macOS this event is an alias of `move`.
4154 *
4155 * @platform darwin,win32
4156 */
4157 on(event: 'moved', listener: Function): this;
4158 /**
4159 * @platform darwin,win32
4160 */
4161 off(event: 'moved', listener: Function): this;
4162 /**
4163 * @platform darwin,win32
4164 */
4165 once(event: 'moved', listener: Function): this;
4166 /**
4167 * @platform darwin,win32
4168 */
4169 addListener(event: 'moved', listener: Function): this;
4170 /**
4171 * @platform darwin,win32
4172 */
4173 removeListener(event: 'moved', listener: Function): this;
4174 /**
4175 * Emitted once when the window is moved to a new position.
4176 *
4177 * **Note**: On macOS this event is an alias of `move`.
4178 *
4179 * @platform darwin,win32
4180 */
4181 on(event: 'moved', listener: Function): this;
4182 /**
4183 * @platform darwin,win32
4184 */
4185 off(event: 'moved', listener: Function): this;
4186 /**
4187 * @platform darwin,win32
4188 */
4189 once(event: 'moved', listener: Function): this;
4190 /**
4191 * @platform darwin,win32
4192 */
4193 addListener(event: 'moved', listener: Function): this;
4194 /**
4195 * @platform darwin,win32
4196 */
4197 removeListener(event: 'moved', listener: Function): this;
4198 /**
4199 * Emitted when the native new tab button is clicked.
4200 *
4201 * @platform darwin
4202 */
4203 on(event: 'new-window-for-tab', listener: Function): this;
4204 /**
4205 * @platform darwin
4206 */
4207 off(event: 'new-window-for-tab', listener: Function): this;
4208 /**
4209 * @platform darwin
4210 */
4211 once(event: 'new-window-for-tab', listener: Function): this;
4212 /**
4213 * @platform darwin
4214 */
4215 addListener(event: 'new-window-for-tab', listener: Function): this;
4216 /**
4217 * @platform darwin
4218 */
4219 removeListener(event: 'new-window-for-tab', listener: Function): this;
4220 /**
4221 * Emitted when the native new tab button is clicked.
4222 *
4223 * @platform darwin
4224 */
4225 on(event: 'new-window-for-tab', listener: Function): this;
4226 /**
4227 * @platform darwin
4228 */
4229 off(event: 'new-window-for-tab', listener: Function): this;
4230 /**
4231 * @platform darwin
4232 */
4233 once(event: 'new-window-for-tab', listener: Function): this;
4234 /**
4235 * @platform darwin
4236 */
4237 addListener(event: 'new-window-for-tab', listener: Function): this;
4238 /**
4239 * @platform darwin
4240 */
4241 removeListener(event: 'new-window-for-tab', listener: Function): this;
4242 /**
4243 * Emitted when the document changed its title, calling `event.preventDefault()`
4244 * will prevent the native window's title from changing. `explicitSet` is false
4245 * when title is synthesized from file URL.
4246 */
4247 on(event: 'page-title-updated', listener: (event: Event,
4248 title: string,
4249 explicitSet: boolean) => void): this;
4250 off(event: 'page-title-updated', listener: (event: Event,
4251 title: string,
4252 explicitSet: boolean) => void): this;
4253 once(event: 'page-title-updated', listener: (event: Event,
4254 title: string,
4255 explicitSet: boolean) => void): this;
4256 addListener(event: 'page-title-updated', listener: (event: Event,
4257 title: string,
4258 explicitSet: boolean) => void): this;
4259 removeListener(event: 'page-title-updated', listener: (event: Event,
4260 title: string,
4261 explicitSet: boolean) => void): this;
4262 /**
4263 * Emitted when the web page has been rendered (while not being shown) and window
4264 * can be displayed without a visual flash.
4265 *
4266 * Please note that using this event implies that the renderer will be considered
4267 * "visible" and paint even though `show` is false. This event will never fire if
4268 * you use `paintWhenInitiallyHidden: false`
4269 */
4270 on(event: 'ready-to-show', listener: Function): this;
4271 off(event: 'ready-to-show', listener: Function): this;
4272 once(event: 'ready-to-show', listener: Function): this;
4273 addListener(event: 'ready-to-show', listener: Function): this;
4274 removeListener(event: 'ready-to-show', listener: Function): this;
4275 /**
4276 * Emitted after the window has been resized.
4277 */
4278 on(event: 'resize', listener: Function): this;
4279 off(event: 'resize', listener: Function): this;
4280 once(event: 'resize', listener: Function): this;
4281 addListener(event: 'resize', listener: Function): this;
4282 removeListener(event: 'resize', listener: Function): this;
4283 /**
4284 * Emitted after the window has been resized.
4285 */
4286 on(event: 'resize', listener: Function): this;
4287 off(event: 'resize', listener: Function): this;
4288 once(event: 'resize', listener: Function): this;
4289 addListener(event: 'resize', listener: Function): this;
4290 removeListener(event: 'resize', listener: Function): this;
4291 /**
4292 * Emitted once when the window has finished being resized.
4293 *
4294 * This is usually emitted when the window has been resized manually. On macOS,
4295 * resizing the window with `setBounds`/`setSize` and setting the `animate`
4296 * parameter to `true` will also emit this event once resizing has finished.
4297 *
4298 * @platform darwin,win32
4299 */
4300 on(event: 'resized', listener: Function): this;
4301 /**
4302 * @platform darwin,win32
4303 */
4304 off(event: 'resized', listener: Function): this;
4305 /**
4306 * @platform darwin,win32
4307 */
4308 once(event: 'resized', listener: Function): this;
4309 /**
4310 * @platform darwin,win32
4311 */
4312 addListener(event: 'resized', listener: Function): this;
4313 /**
4314 * @platform darwin,win32
4315 */
4316 removeListener(event: 'resized', listener: Function): this;
4317 /**
4318 * Emitted once when the window has finished being resized.
4319 *
4320 * This is usually emitted when the window has been resized manually. On macOS,
4321 * resizing the window with `setBounds`/`setSize` and setting the `animate`
4322 * parameter to `true` will also emit this event once resizing has finished.
4323 *
4324 * @platform darwin,win32
4325 */
4326 on(event: 'resized', listener: Function): this;
4327 /**
4328 * @platform darwin,win32
4329 */
4330 off(event: 'resized', listener: Function): this;
4331 /**
4332 * @platform darwin,win32
4333 */
4334 once(event: 'resized', listener: Function): this;
4335 /**
4336 * @platform darwin,win32
4337 */
4338 addListener(event: 'resized', listener: Function): this;
4339 /**
4340 * @platform darwin,win32
4341 */
4342 removeListener(event: 'resized', listener: Function): this;
4343 /**
4344 * Emitted when the unresponsive web page becomes responsive again.
4345 */
4346 on(event: 'responsive', listener: Function): this;
4347 off(event: 'responsive', listener: Function): this;
4348 once(event: 'responsive', listener: Function): this;
4349 addListener(event: 'responsive', listener: Function): this;
4350 removeListener(event: 'responsive', listener: Function): this;
4351 /**
4352 * Emitted when the window is restored from a minimized state.
4353 */
4354 on(event: 'restore', listener: Function): this;
4355 off(event: 'restore', listener: Function): this;
4356 once(event: 'restore', listener: Function): this;
4357 addListener(event: 'restore', listener: Function): this;
4358 removeListener(event: 'restore', listener: Function): this;
4359 /**
4360 * Emitted when the window is restored from a minimized state.
4361 */
4362 on(event: 'restore', listener: Function): this;
4363 off(event: 'restore', listener: Function): this;
4364 once(event: 'restore', listener: Function): this;
4365 addListener(event: 'restore', listener: Function): this;
4366 removeListener(event: 'restore', listener: Function): this;
4367 /**
4368 * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
4369 * is ended. The `rotation` value on each emission is the angle in degrees rotated
4370 * since the last emission. The last emitted event upon a rotation gesture will
4371 * always be of value `0`. Counter-clockwise rotation values are positive, while
4372 * clockwise ones are negative.
4373 *
4374 * @platform darwin
4375 */
4376 on(event: 'rotate-gesture', listener: (event: Event,
4377 rotation: number) => void): this;
4378 /**
4379 * @platform darwin
4380 */
4381 off(event: 'rotate-gesture', listener: (event: Event,
4382 rotation: number) => void): this;
4383 /**
4384 * @platform darwin
4385 */
4386 once(event: 'rotate-gesture', listener: (event: Event,
4387 rotation: number) => void): this;
4388 /**
4389 * @platform darwin
4390 */
4391 addListener(event: 'rotate-gesture', listener: (event: Event,
4392 rotation: number) => void): this;
4393 /**
4394 * @platform darwin
4395 */
4396 removeListener(event: 'rotate-gesture', listener: (event: Event,
4397 rotation: number) => void): this;
4398 /**
4399 * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
4400 * is ended. The `rotation` value on each emission is the angle in degrees rotated
4401 * since the last emission. The last emitted event upon a rotation gesture will
4402 * always be of value `0`. Counter-clockwise rotation values are positive, while
4403 * clockwise ones are negative.
4404 *
4405 * @platform darwin
4406 */
4407 on(event: 'rotate-gesture', listener: (event: Event,
4408 rotation: number) => void): this;
4409 /**
4410 * @platform darwin
4411 */
4412 off(event: 'rotate-gesture', listener: (event: Event,
4413 rotation: number) => void): this;
4414 /**
4415 * @platform darwin
4416 */
4417 once(event: 'rotate-gesture', listener: (event: Event,
4418 rotation: number) => void): this;
4419 /**
4420 * @platform darwin
4421 */
4422 addListener(event: 'rotate-gesture', listener: (event: Event,
4423 rotation: number) => void): this;
4424 /**
4425 * @platform darwin
4426 */
4427 removeListener(event: 'rotate-gesture', listener: (event: Event,
4428 rotation: number) => void): this;
4429 /**
4430 * Emitted when window session is going to end due to force shutdown or machine
4431 * restart or session log off.
4432 *
4433 * @platform win32
4434 */
4435 on(event: 'session-end', listener: Function): this;
4436 /**
4437 * @platform win32
4438 */
4439 off(event: 'session-end', listener: Function): this;
4440 /**
4441 * @platform win32
4442 */
4443 once(event: 'session-end', listener: Function): this;
4444 /**
4445 * @platform win32
4446 */
4447 addListener(event: 'session-end', listener: Function): this;
4448 /**
4449 * @platform win32
4450 */
4451 removeListener(event: 'session-end', listener: Function): this;
4452 /**
4453 * Emitted when window session is going to end due to force shutdown or machine
4454 * restart or session log off.
4455 *
4456 * @platform win32
4457 */
4458 on(event: 'session-end', listener: Function): this;
4459 /**
4460 * @platform win32
4461 */
4462 off(event: 'session-end', listener: Function): this;
4463 /**
4464 * @platform win32
4465 */
4466 once(event: 'session-end', listener: Function): this;
4467 /**
4468 * @platform win32
4469 */
4470 addListener(event: 'session-end', listener: Function): this;
4471 /**
4472 * @platform win32
4473 */
4474 removeListener(event: 'session-end', listener: Function): this;
4475 /**
4476 * Emitted when the window opens a sheet.
4477 *
4478 * @platform darwin
4479 */
4480 on(event: 'sheet-begin', listener: Function): this;
4481 /**
4482 * @platform darwin
4483 */
4484 off(event: 'sheet-begin', listener: Function): this;
4485 /**
4486 * @platform darwin
4487 */
4488 once(event: 'sheet-begin', listener: Function): this;
4489 /**
4490 * @platform darwin
4491 */
4492 addListener(event: 'sheet-begin', listener: Function): this;
4493 /**
4494 * @platform darwin
4495 */
4496 removeListener(event: 'sheet-begin', listener: Function): this;
4497 /**
4498 * Emitted when the window opens a sheet.
4499 *
4500 * @platform darwin
4501 */
4502 on(event: 'sheet-begin', listener: Function): this;
4503 /**
4504 * @platform darwin
4505 */
4506 off(event: 'sheet-begin', listener: Function): this;
4507 /**
4508 * @platform darwin
4509 */
4510 once(event: 'sheet-begin', listener: Function): this;
4511 /**
4512 * @platform darwin
4513 */
4514 addListener(event: 'sheet-begin', listener: Function): this;
4515 /**
4516 * @platform darwin
4517 */
4518 removeListener(event: 'sheet-begin', listener: Function): this;
4519 /**
4520 * Emitted when the window has closed a sheet.
4521 *
4522 * @platform darwin
4523 */
4524 on(event: 'sheet-end', listener: Function): this;
4525 /**
4526 * @platform darwin
4527 */
4528 off(event: 'sheet-end', listener: Function): this;
4529 /**
4530 * @platform darwin
4531 */
4532 once(event: 'sheet-end', listener: Function): this;
4533 /**
4534 * @platform darwin
4535 */
4536 addListener(event: 'sheet-end', listener: Function): this;
4537 /**
4538 * @platform darwin
4539 */
4540 removeListener(event: 'sheet-end', listener: Function): this;
4541 /**
4542 * Emitted when the window has closed a sheet.
4543 *
4544 * @platform darwin
4545 */
4546 on(event: 'sheet-end', listener: Function): this;
4547 /**
4548 * @platform darwin
4549 */
4550 off(event: 'sheet-end', listener: Function): this;
4551 /**
4552 * @platform darwin
4553 */
4554 once(event: 'sheet-end', listener: Function): this;
4555 /**
4556 * @platform darwin
4557 */
4558 addListener(event: 'sheet-end', listener: Function): this;
4559 /**
4560 * @platform darwin
4561 */
4562 removeListener(event: 'sheet-end', listener: Function): this;
4563 /**
4564 * Emitted when the window is shown.
4565 */
4566 on(event: 'show', listener: Function): this;
4567 off(event: 'show', listener: Function): this;
4568 once(event: 'show', listener: Function): this;
4569 addListener(event: 'show', listener: Function): this;
4570 removeListener(event: 'show', listener: Function): this;
4571 /**
4572 * Emitted when the window is shown.
4573 */
4574 on(event: 'show', listener: Function): this;
4575 off(event: 'show', listener: Function): this;
4576 once(event: 'show', listener: Function): this;
4577 addListener(event: 'show', listener: Function): this;
4578 removeListener(event: 'show', listener: Function): this;
4579 /**
4580 * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
4581 * `left`.
4582 *
4583 * The method underlying this event is built to handle older macOS-style trackpad
4584 * swiping, where the content on the screen doesn't move with the swipe. Most macOS
4585 * trackpads are not configured to allow this kind of swiping anymore, so in order
4586 * for it to emit properly the 'Swipe between pages' preference in `System
4587 * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
4588 * fingers'.
4589 *
4590 * @platform darwin
4591 */
4592 on(event: 'swipe', listener: (event: Event,
4593 direction: string) => void): this;
4594 /**
4595 * @platform darwin
4596 */
4597 off(event: 'swipe', listener: (event: Event,
4598 direction: string) => void): this;
4599 /**
4600 * @platform darwin
4601 */
4602 once(event: 'swipe', listener: (event: Event,
4603 direction: string) => void): this;
4604 /**
4605 * @platform darwin
4606 */
4607 addListener(event: 'swipe', listener: (event: Event,
4608 direction: string) => void): this;
4609 /**
4610 * @platform darwin
4611 */
4612 removeListener(event: 'swipe', listener: (event: Event,
4613 direction: string) => void): this;
4614 /**
4615 * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
4616 * `left`.
4617 *
4618 * The method underlying this event is built to handle older macOS-style trackpad
4619 * swiping, where the content on the screen doesn't move with the swipe. Most macOS
4620 * trackpads are not configured to allow this kind of swiping anymore, so in order
4621 * for it to emit properly the 'Swipe between pages' preference in `System
4622 * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
4623 * fingers'.
4624 *
4625 * @platform darwin
4626 */
4627 on(event: 'swipe', listener: (event: Event,
4628 direction: string) => void): this;
4629 /**
4630 * @platform darwin
4631 */
4632 off(event: 'swipe', listener: (event: Event,
4633 direction: string) => void): this;
4634 /**
4635 * @platform darwin
4636 */
4637 once(event: 'swipe', listener: (event: Event,
4638 direction: string) => void): this;
4639 /**
4640 * @platform darwin
4641 */
4642 addListener(event: 'swipe', listener: (event: Event,
4643 direction: string) => void): this;
4644 /**
4645 * @platform darwin
4646 */
4647 removeListener(event: 'swipe', listener: (event: Event,
4648 direction: string) => void): this;
4649 /**
4650 * Emitted when the system context menu is triggered on the window, this is
4651 * normally only triggered when the user right clicks on the non-client area of
4652 * your window. This is the window titlebar or any area you have declared as
4653 * `-webkit-app-region: drag` in a frameless window.
4654 *
4655 * Calling `event.preventDefault()` will prevent the menu from being displayed.
4656 *
4657 * @platform win32
4658 */
4659 on(event: 'system-context-menu', listener: (event: Event,
4660 /**
4661 * The screen coordinates the context menu was triggered at
4662 */
4663 point: Point) => void): this;
4664 /**
4665 * @platform win32
4666 */
4667 off(event: 'system-context-menu', listener: (event: Event,
4668 /**
4669 * The screen coordinates the context menu was triggered at
4670 */
4671 point: Point) => void): this;
4672 /**
4673 * @platform win32
4674 */
4675 once(event: 'system-context-menu', listener: (event: Event,
4676 /**
4677 * The screen coordinates the context menu was triggered at
4678 */
4679 point: Point) => void): this;
4680 /**
4681 * @platform win32
4682 */
4683 addListener(event: 'system-context-menu', listener: (event: Event,
4684 /**
4685 * The screen coordinates the context menu was triggered at
4686 */
4687 point: Point) => void): this;
4688 /**
4689 * @platform win32
4690 */
4691 removeListener(event: 'system-context-menu', listener: (event: Event,
4692 /**
4693 * The screen coordinates the context menu was triggered at
4694 */
4695 point: Point) => void): this;
4696 /**
4697 * Emitted when the system context menu is triggered on the window, this is
4698 * normally only triggered when the user right clicks on the non-client area of
4699 * your window. This is the window titlebar or any area you have declared as
4700 * `-webkit-app-region: drag` in a frameless window.
4701 *
4702 * Calling `event.preventDefault()` will prevent the menu from being displayed.
4703 *
4704 * @platform win32
4705 */
4706 on(event: 'system-context-menu', listener: (event: Event,
4707 /**
4708 * The screen coordinates the context menu was triggered at
4709 */
4710 point: Point) => void): this;
4711 /**
4712 * @platform win32
4713 */
4714 off(event: 'system-context-menu', listener: (event: Event,
4715 /**
4716 * The screen coordinates the context menu was triggered at
4717 */
4718 point: Point) => void): this;
4719 /**
4720 * @platform win32
4721 */
4722 once(event: 'system-context-menu', listener: (event: Event,
4723 /**
4724 * The screen coordinates the context menu was triggered at
4725 */
4726 point: Point) => void): this;
4727 /**
4728 * @platform win32
4729 */
4730 addListener(event: 'system-context-menu', listener: (event: Event,
4731 /**
4732 * The screen coordinates the context menu was triggered at
4733 */
4734 point: Point) => void): this;
4735 /**
4736 * @platform win32
4737 */
4738 removeListener(event: 'system-context-menu', listener: (event: Event,
4739 /**
4740 * The screen coordinates the context menu was triggered at
4741 */
4742 point: Point) => void): this;
4743 /**
4744 * Emitted when the window exits from a maximized state.
4745 */
4746 on(event: 'unmaximize', listener: Function): this;
4747 off(event: 'unmaximize', listener: Function): this;
4748 once(event: 'unmaximize', listener: Function): this;
4749 addListener(event: 'unmaximize', listener: Function): this;
4750 removeListener(event: 'unmaximize', listener: Function): this;
4751 /**
4752 * Emitted when the window exits from a maximized state.
4753 */
4754 on(event: 'unmaximize', listener: Function): this;
4755 off(event: 'unmaximize', listener: Function): this;
4756 once(event: 'unmaximize', listener: Function): this;
4757 addListener(event: 'unmaximize', listener: Function): this;
4758 removeListener(event: 'unmaximize', listener: Function): this;
4759 /**
4760 * Emitted when the web page becomes unresponsive.
4761 */
4762 on(event: 'unresponsive', listener: Function): this;
4763 off(event: 'unresponsive', listener: Function): this;
4764 once(event: 'unresponsive', listener: Function): this;
4765 addListener(event: 'unresponsive', listener: Function): this;
4766 removeListener(event: 'unresponsive', listener: Function): this;
4767 /**
4768 * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
4769 * will prevent the window from being moved.
4770 *
4771 * Note that this is only emitted when the window is being moved manually. Moving
4772 * the window with `setPosition`/`setBounds`/`center` will not emit this event.
4773 *
4774 * @platform darwin,win32
4775 */
4776 on(event: 'will-move', listener: (event: Event,
4777 /**
4778 * Location the window is being moved to.
4779 */
4780 newBounds: Rectangle) => void): this;
4781 /**
4782 * @platform darwin,win32
4783 */
4784 off(event: 'will-move', listener: (event: Event,
4785 /**
4786 * Location the window is being moved to.
4787 */
4788 newBounds: Rectangle) => void): this;
4789 /**
4790 * @platform darwin,win32
4791 */
4792 once(event: 'will-move', listener: (event: Event,
4793 /**
4794 * Location the window is being moved to.
4795 */
4796 newBounds: Rectangle) => void): this;
4797 /**
4798 * @platform darwin,win32
4799 */
4800 addListener(event: 'will-move', listener: (event: Event,
4801 /**
4802 * Location the window is being moved to.
4803 */
4804 newBounds: Rectangle) => void): this;
4805 /**
4806 * @platform darwin,win32
4807 */
4808 removeListener(event: 'will-move', listener: (event: Event,
4809 /**
4810 * Location the window is being moved to.
4811 */
4812 newBounds: Rectangle) => void): this;
4813 /**
4814 * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
4815 * will prevent the window from being moved.
4816 *
4817 * Note that this is only emitted when the window is being moved manually. Moving
4818 * the window with `setPosition`/`setBounds`/`center` will not emit this event.
4819 *
4820 * @platform darwin,win32
4821 */
4822 on(event: 'will-move', listener: (event: Event,
4823 /**
4824 * Location the window is being moved to.
4825 */
4826 newBounds: Rectangle) => void): this;
4827 /**
4828 * @platform darwin,win32
4829 */
4830 off(event: 'will-move', listener: (event: Event,
4831 /**
4832 * Location the window is being moved to.
4833 */
4834 newBounds: Rectangle) => void): this;
4835 /**
4836 * @platform darwin,win32
4837 */
4838 once(event: 'will-move', listener: (event: Event,
4839 /**
4840 * Location the window is being moved to.
4841 */
4842 newBounds: Rectangle) => void): this;
4843 /**
4844 * @platform darwin,win32
4845 */
4846 addListener(event: 'will-move', listener: (event: Event,
4847 /**
4848 * Location the window is being moved to.
4849 */
4850 newBounds: Rectangle) => void): this;
4851 /**
4852 * @platform darwin,win32
4853 */
4854 removeListener(event: 'will-move', listener: (event: Event,
4855 /**
4856 * Location the window is being moved to.
4857 */
4858 newBounds: Rectangle) => void): this;
4859 /**
4860 * Emitted before the window is resized. Calling `event.preventDefault()` will
4861 * prevent the window from being resized.
4862 *
4863 * Note that this is only emitted when the window is being resized manually.
4864 * Resizing the window with `setBounds`/`setSize` will not emit this event.
4865 *
4866 * The possible values and behaviors of the `edge` option are platform dependent.
4867 * Possible values are:
4868 *
4869 * * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
4870 * `top-right`, `bottom-left`, `bottom-right`.
4871 * * On macOS, possible values are `bottom` and `right`.
4872 * * The value `bottom` is used to denote vertical resizing.
4873 * * The value `right` is used to denote horizontal resizing.
4874 *
4875 * @platform darwin,win32
4876 */
4877 on(event: 'will-resize', listener: (event: Event,
4878 /**
4879 * Size the window is being resized to.
4880 */
4881 newBounds: Rectangle,
4882 details: WillResizeDetails) => void): this;
4883 /**
4884 * @platform darwin,win32
4885 */
4886 off(event: 'will-resize', listener: (event: Event,
4887 /**
4888 * Size the window is being resized to.
4889 */
4890 newBounds: Rectangle,
4891 details: WillResizeDetails) => void): this;
4892 /**
4893 * @platform darwin,win32
4894 */
4895 once(event: 'will-resize', listener: (event: Event,
4896 /**
4897 * Size the window is being resized to.
4898 */
4899 newBounds: Rectangle,
4900 details: WillResizeDetails) => void): this;
4901 /**
4902 * @platform darwin,win32
4903 */
4904 addListener(event: 'will-resize', listener: (event: Event,
4905 /**
4906 * Size the window is being resized to.
4907 */
4908 newBounds: Rectangle,
4909 details: WillResizeDetails) => void): this;
4910 /**
4911 * @platform darwin,win32
4912 */
4913 removeListener(event: 'will-resize', listener: (event: Event,
4914 /**
4915 * Size the window is being resized to.
4916 */
4917 newBounds: Rectangle,
4918 details: WillResizeDetails) => void): this;
4919 /**
4920 * Emitted before the window is resized. Calling `event.preventDefault()` will
4921 * prevent the window from being resized.
4922 *
4923 * Note that this is only emitted when the window is being resized manually.
4924 * Resizing the window with `setBounds`/`setSize` will not emit this event.
4925 *
4926 * The possible values and behaviors of the `edge` option are platform dependent.
4927 * Possible values are:
4928 *
4929 * * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
4930 * `top-right`, `bottom-left`, `bottom-right`.
4931 * * On macOS, possible values are `bottom` and `right`.
4932 * * The value `bottom` is used to denote vertical resizing.
4933 * * The value `right` is used to denote horizontal resizing.
4934 *
4935 * @platform darwin,win32
4936 */
4937 on(event: 'will-resize', listener: (event: Event,
4938 /**
4939 * Size the window is being resized to.
4940 */
4941 newBounds: Rectangle,
4942 details: WillResizeDetails) => void): this;
4943 /**
4944 * @platform darwin,win32
4945 */
4946 off(event: 'will-resize', listener: (event: Event,
4947 /**
4948 * Size the window is being resized to.
4949 */
4950 newBounds: Rectangle,
4951 details: WillResizeDetails) => void): this;
4952 /**
4953 * @platform darwin,win32
4954 */
4955 once(event: 'will-resize', listener: (event: Event,
4956 /**
4957 * Size the window is being resized to.
4958 */
4959 newBounds: Rectangle,
4960 details: WillResizeDetails) => void): this;
4961 /**
4962 * @platform darwin,win32
4963 */
4964 addListener(event: 'will-resize', listener: (event: Event,
4965 /**
4966 * Size the window is being resized to.
4967 */
4968 newBounds: Rectangle,
4969 details: WillResizeDetails) => void): this;
4970 /**
4971 * @platform darwin,win32
4972 */
4973 removeListener(event: 'will-resize', listener: (event: Event,
4974 /**
4975 * Size the window is being resized to.
4976 */
4977 newBounds: Rectangle,
4978 details: WillResizeDetails) => void): this;
4979 /**
4980 * BrowserWindow
4981 */
4982 constructor(options?: BrowserWindowConstructorOptions);
4983 /**
4984 * > **Note** The `BrowserView` class is deprecated, and replaced by the new
4985 * `WebContentsView` class.
4986 *
4987 * The window that owns the given `browserView`. If the given view is not attached
4988 * to any window, returns `null`.
4989 *
4990 * @deprecated
4991 */
4992 static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
4993 /**
4994 * The window with the given `id`.
4995 */
4996 static fromId(id: number): (BrowserWindow) | (null);
4997 /**
4998 * The window that owns the given `webContents` or `null` if the contents are not
4999 * owned by a window.
5000 */
5001 static fromWebContents(webContents: WebContents): (BrowserWindow) | (null);
5002 /**
5003 * An array of all opened browser windows.
5004 */
5005 static getAllWindows(): BrowserWindow[];
5006 /**
5007 * The window that is focused in this application, otherwise returns `null`.
5008 */
5009 static getFocusedWindow(): (BrowserWindow) | (null);
5010 /**
5011 * Replacement API for setBrowserView supporting work with multi browser views.
5012 *
5013 * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5014 * `WebContentsView` class.
5015 *
5016 * @experimental
5017 * @deprecated
5018 */
5019 addBrowserView(browserView: BrowserView): void;
5020 /**
5021 * Adds a window as a tab on this window, after the tab for the window instance.
5022 *
5023 * @platform darwin
5024 */
5025 addTabbedWindow(browserWindow: BrowserWindow): void;
5026 /**
5027 * Removes focus from the window.
5028 */
5029 blur(): void;
5030 blurWebView(): void;
5031 /**
5032 * Resolves with a NativeImage
5033 *
5034 * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
5035 * whole visible page. If the page is not visible, `rect` may be empty. The page is
5036 * considered visible when its browser window is hidden and the capturer count is
5037 * non-zero. If you would like the page to stay hidden, you should ensure that
5038 * `stayHidden` is set to true.
5039 */
5040 capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
5041 /**
5042 * Moves window to the center of the screen.
5043 */
5044 center(): void;
5045 /**
5046 * Try to close the window. This has the same effect as a user manually clicking
5047 * the close button of the window. The web page may cancel the close though. See
5048 * the close event.
5049 */
5050 close(): void;
5051 /**
5052 * Closes the currently open Quick Look panel.
5053 *
5054 * @platform darwin
5055 */
5056 closeFilePreview(): void;
5057 /**
5058 * Force closing the window, the `unload` and `beforeunload` event won't be emitted
5059 * for the web page, and `close` event will also not be emitted for this window,
5060 * but it guarantees the `closed` event will be emitted.
5061 */
5062 destroy(): void;
5063 /**
5064 * Starts or stops flashing the window to attract user's attention.
5065 */
5066 flashFrame(flag: boolean): void;
5067 /**
5068 * Focuses on the window.
5069 */
5070 focus(): void;
5071 focusOnWebView(): void;
5072 /**
5073 * Gets the background color of the window in Hex (`#RRGGBB`) format.
5074 *
5075 * See Setting `backgroundColor`.
5076 *
5077 * **Note:** The alpha value is _not_ returned alongside the red, green, and blue
5078 * values.
5079 */
5080 getBackgroundColor(): string;
5081 /**
5082 * The `bounds` of the window as `Object`.
5083 *
5084 * **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
5085 * height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
5086 * 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
5087 * 25, y: 38, width: 800, height: 600 }`.
5088 */
5089 getBounds(): Rectangle;
5090 /**
5091 * The `BrowserView` attached to `win`. Returns `null` if one is not attached.
5092 * Throws an error if multiple `BrowserView`s are attached.
5093 *
5094 * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5095 * `WebContentsView` class.
5096 *
5097 * @experimental
5098 * @deprecated
5099 */
5100 getBrowserView(): (BrowserView) | (null);
5101 /**
5102 * a sorted by z-index array of all BrowserViews that have been attached with
5103 * `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
5104 * element of the array.
5105 *
5106 * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5107 * `WebContentsView` class.
5108 *
5109 * @experimental
5110 * @deprecated
5111 */
5112 getBrowserViews(): BrowserView[];
5113 /**
5114 * All child windows.
5115 */
5116 getChildWindows(): BrowserWindow[];
5117 /**
5118 * The `bounds` of the window's client area as `Object`.
5119 */
5120 getContentBounds(): Rectangle;
5121 /**
5122 * Contains the window's client area's width and height.
5123 */
5124 getContentSize(): number[];
5125 /**
5126 * Contains the window's maximum width and height.
5127 */
5128 getMaximumSize(): number[];
5129 /**
5130 * Window id in the format of DesktopCapturerSource's id. For example
5131 * "window:1324:0".
5132 *
5133 * More precisely the format is `window:id:other_id` where `id` is `HWND` on
5134 * Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
5135 * Linux. `other_id` is used to identify web contents (tabs) so within the same top
5136 * level window.
5137 */
5138 getMediaSourceId(): string;
5139 /**
5140 * Contains the window's minimum width and height.
5141 */
5142 getMinimumSize(): number[];
5143 /**
5144 * The platform-specific handle of the window.
5145 *
5146 * The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
5147 * `Window` (`unsigned long`) on Linux.
5148 */
5149 getNativeWindowHandle(): Buffer;
5150 /**
5151 * Contains the window bounds of the normal state
5152 *
5153 * **Note:** whatever the current state of the window : maximized, minimized or in
5154 * fullscreen, this function always returns the position and size of the window in
5155 * normal state. In normal state, getBounds and getNormalBounds returns the same
5156 * `Rectangle`.
5157 */
5158 getNormalBounds(): Rectangle;
5159 /**
5160 * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
5161 * 1.
5162 */
5163 getOpacity(): number;
5164 /**
5165 * The parent window or `null` if there is no parent.
5166 */
5167 getParentWindow(): (BrowserWindow) | (null);
5168 /**
5169 * Contains the window's current position.
5170 */
5171 getPosition(): number[];
5172 /**
5173 * The pathname of the file the window represents.
5174 *
5175 * @platform darwin
5176 */
5177 getRepresentedFilename(): string;
5178 /**
5179 * Contains the window's width and height.
5180 */
5181 getSize(): number[];
5182 /**
5183 * The title of the native window.
5184 *
5185 * **Note:** The title of the web page can be different from the title of the
5186 * native window.
5187 */
5188 getTitle(): string;
5189 /**
5190 * The custom position for the traffic light buttons in frameless window, `null`
5191 * will be returned when there is no custom position.
5192 *
5193 * @platform darwin
5194 */
5195 getWindowButtonPosition(): (Point) | (null);
5196 /**
5197 * Whether the window has a shadow.
5198 */
5199 hasShadow(): boolean;
5200 /**
5201 * Hides the window.
5202 */
5203 hide(): void;
5204 /**
5205 * Hooks a windows message. The `callback` is called when the message is received
5206 * in the WndProc.
5207 *
5208 * @platform win32
5209 */
5210 hookWindowMessage(message: number, callback: (wParam: Buffer, lParam: Buffer) => void): void;
5211 /**
5212 * Invalidates the window shadow so that it is recomputed based on the current
5213 * window shape.
5214 *
5215 * `BrowserWindows` that are transparent can sometimes leave behind visual
5216 * artifacts on macOS. This method can be used to clear these artifacts when, for
5217 * example, performing an animation.
5218 *
5219 * @platform darwin
5220 */
5221 invalidateShadow(): void;
5222 /**
5223 * Whether the window is always on top of other windows.
5224 */
5225 isAlwaysOnTop(): boolean;
5226 /**
5227 * Whether the window can be manually closed by user.
5228 *
5229 * On Linux always returns `true`.
5230 *
5231 * @platform darwin,win32
5232 */
5233 isClosable(): boolean;
5234 /**
5235 * Whether the window is destroyed.
5236 */
5237 isDestroyed(): boolean;
5238 /**
5239 * Whether the window's document has been edited.
5240 *
5241 * @platform darwin
5242 */
5243 isDocumentEdited(): boolean;
5244 /**
5245 * whether the window is enabled.
5246 */
5247 isEnabled(): boolean;
5248 /**
5249 * Whether the window can be focused.
5250 *
5251 * @platform darwin,win32
5252 */
5253 isFocusable(): boolean;
5254 /**
5255 * Whether the window is focused.
5256 */
5257 isFocused(): boolean;
5258 /**
5259 * Whether the window is in fullscreen mode.
5260 */
5261 isFullScreen(): boolean;
5262 /**
5263 * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
5264 * window.
5265 */
5266 isFullScreenable(): boolean;
5267 /**
5268 * Whether the window will be hidden when the user toggles into mission control.
5269 *
5270 * @platform darwin
5271 */
5272 isHiddenInMissionControl(): boolean;
5273 /**
5274 * Whether the window is in kiosk mode.
5275 */
5276 isKiosk(): boolean;
5277 /**
5278 * Whether the window can be manually maximized by user.
5279 *
5280 * On Linux always returns `true`.
5281 *
5282 * @platform darwin,win32
5283 */
5284 isMaximizable(): boolean;
5285 /**
5286 * Whether the window is maximized.
5287 */
5288 isMaximized(): boolean;
5289 /**
5290 * Whether menu bar automatically hides itself.
5291 *
5292 * @platform win32,linux
5293 */
5294 isMenuBarAutoHide(): boolean;
5295 /**
5296 * Whether the menu bar is visible.
5297 *
5298 * @platform win32,linux
5299 */
5300 isMenuBarVisible(): boolean;
5301 /**
5302 * Whether the window can be manually minimized by the user.
5303 *
5304 * On Linux always returns `true`.
5305 *
5306 * @platform darwin,win32
5307 */
5308 isMinimizable(): boolean;
5309 /**
5310 * Whether the window is minimized.
5311 */
5312 isMinimized(): boolean;
5313 /**
5314 * Whether current window is a modal window.
5315 */
5316 isModal(): boolean;
5317 /**
5318 * Whether the window can be moved by user.
5319 *
5320 * On Linux always returns `true`.
5321 *
5322 * @platform darwin,win32
5323 */
5324 isMovable(): boolean;
5325 /**
5326 * Whether the window is in normal state (not maximized, not minimized, not in
5327 * fullscreen mode).
5328 */
5329 isNormal(): boolean;
5330 /**
5331 * Whether the window can be manually resized by the user.
5332 */
5333 isResizable(): boolean;
5334 /**
5335 * Whether the window is in simple (pre-Lion) fullscreen mode.
5336 *
5337 * @platform darwin
5338 */
5339 isSimpleFullScreen(): boolean;
5340 /**
5341 * Whether the window is in Windows 10 tablet mode.
5342 *
5343 * Since Windows 10 users can use their PC as tablet, under this mode apps can
5344 * choose to optimize their UI for tablets, such as enlarging the titlebar and
5345 * hiding titlebar buttons.
5346 *
5347 * This API returns whether the window is in tablet mode, and the `resize` event
5348 * can be be used to listen to changes to tablet mode.
5349 *
5350 * @platform win32
5351 */
5352 isTabletMode(): boolean;
5353 /**
5354 * Whether the window is visible to the user in the foreground of the app.
5355 */
5356 isVisible(): boolean;
5357 /**
5358 * Whether the window is visible on all workspaces.
5359 *
5360 * **Note:** This API always returns false on Windows.
5361 *
5362 * @platform darwin,linux
5363 */
5364 isVisibleOnAllWorkspaces(): boolean;
5365 /**
5366 * `true` or `false` depending on whether the message is hooked.
5367 *
5368 * @platform win32
5369 */
5370 isWindowMessageHooked(message: number): boolean;
5371 /**
5372 * the promise will resolve when the page has finished loading (see
5373 * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
5374 *
5375 * Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
5376 * relative to the root of your application. See the `webContents` docs for more
5377 * information.
5378 */
5379 loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
5380 /**
5381 * the promise will resolve when the page has finished loading (see
5382 * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
5383 *
5384 * Same as `webContents.loadURL(url[, options])`.
5385 *
5386 * The `url` can be a remote address (e.g. `http://`) or a path to a local HTML
5387 * file using the `file://` protocol.
5388 *
5389 * To ensure that file URLs are properly formatted, it is recommended to use Node's
5390 * `url.format` method:
5391 *
5392 * You can load a URL using a `POST` request with URL-encoded data by doing the
5393 * following:
5394 */
5395 loadURL(url: string, options?: LoadURLOptions): Promise<void>;
5396 /**
5397 * Maximizes the window. This will also show (but not focus) the window if it isn't
5398 * being displayed already.
5399 */
5400 maximize(): void;
5401 /**
5402 * Merges all windows into one window with multiple tabs when native tabs are
5403 * enabled and there is more than one open window.
5404 *
5405 * @platform darwin
5406 */
5407 mergeAllWindows(): void;
5408 /**
5409 * Minimizes the window. On some platforms the minimized window will be shown in
5410 * the Dock.
5411 */
5412 minimize(): void;
5413 /**
5414 * Moves window above the source window in the sense of z-order. If the
5415 * `mediaSourceId` is not of type window or if the window does not exist then this
5416 * method throws an error.
5417 */
5418 moveAbove(mediaSourceId: string): void;
5419 /**
5420 * Moves the current tab into a new window if native tabs are enabled and there is
5421 * more than one tab in the current window.
5422 *
5423 * @platform darwin
5424 */
5425 moveTabToNewWindow(): void;
5426 /**
5427 * Moves window to top(z-order) regardless of focus
5428 */
5429 moveTop(): void;
5430 /**
5431 * Uses Quick Look to preview a file at a given path.
5432 *
5433 * @platform darwin
5434 */
5435 previewFile(path: string, displayName?: string): void;
5436 /**
5437 * Same as `webContents.reload`.
5438 */
5439 reload(): void;
5440 /**
5441 * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5442 * `WebContentsView` class.
5443 *
5444 * @experimental
5445 * @deprecated
5446 */
5447 removeBrowserView(browserView: BrowserView): void;
5448 /**
5449 * Remove the window's menu bar.
5450 *
5451 * @platform linux,win32
5452 */
5453 removeMenu(): void;
5454 /**
5455 * Restores the window from minimized state to its previous state.
5456 */
5457 restore(): void;
5458 /**
5459 * Selects the next tab when native tabs are enabled and there are other tabs in
5460 * the window.
5461 *
5462 * @platform darwin
5463 */
5464 selectNextTab(): void;
5465 /**
5466 * Selects the previous tab when native tabs are enabled and there are other tabs
5467 * in the window.
5468 *
5469 * @platform darwin
5470 */
5471 selectPreviousTab(): void;
5472 /**
5473 * Sets whether the window should show always on top of other windows. After
5474 * setting this, the window is still a normal window, not a toolbox window which
5475 * can not be focused on.
5476 */
5477 setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver', relativeLevel?: number): void;
5478 /**
5479 * Sets the properties for the window's taskbar button.
5480 *
5481 * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
5482 * together. If one of those properties is not set, then neither will be used.
5483 *
5484 * @platform win32
5485 */
5486 setAppDetails(options: AppDetailsOptions): void;
5487 /**
5488 * This will make a window maintain an aspect ratio. The extra size allows a
5489 * developer to have space, specified in pixels, not included within the aspect
5490 * ratio calculations. This API already takes into account the difference between a
5491 * window's size and its content size.
5492 *
5493 * Consider a normal window with an HD video player and associated controls.
5494 * Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
5495 * on the right edge and 50 pixels of controls below the player. In order to
5496 * maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
5497 * the player itself we would call this function with arguments of 16/9 and {
5498 * width: 40, height: 50 }. The second argument doesn't care where the extra width
5499 * and height are within the content view--only that they exist. Sum any extra
5500 * width and height areas you have within the overall content view.
5501 *
5502 * The aspect ratio is not respected when window is resized programmatically with
5503 * APIs like `win.setSize`.
5504 *
5505 * To reset an aspect ratio, pass 0 as the `aspectRatio` value:
5506 * `win.setAspectRatio(0)`.
5507 */
5508 setAspectRatio(aspectRatio: number, extraSize?: Size): void;
5509 /**
5510 * Controls whether to hide cursor when typing.
5511 *
5512 * @platform darwin
5513 */
5514 setAutoHideCursor(autoHide: boolean): void;
5515 /**
5516 * Sets whether the window menu bar should hide itself automatically. Once set the
5517 * menu bar will only show when users press the single `Alt` key.
5518 *
5519 * If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
5520 * hide it immediately.
5521 *
5522 * @platform win32,linux
5523 */
5524 setAutoHideMenuBar(hide: boolean): void;
5525 /**
5526 * Examples of valid `backgroundColor` values:
5527 *
5528 * * Hex
5529 * * #fff (shorthand RGB)
5530 * * #ffff (shorthand ARGB)
5531 * * #ffffff (RGB)
5532 * * #ffffffff (ARGB)
5533 * * RGB
5534 * * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
5535 * * e.g. rgb(255, 255, 255)
5536 * * RGBA
5537 * * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
5538 * * e.g. rgba(255, 255, 255, 1.0)
5539 * * HSL
5540 * * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
5541 * * e.g. hsl(200, 20%, 50%)
5542 * * HSLA
5543 * * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
5544 * * e.g. hsla(200, 20%, 50%, 0.5)
5545 * * Color name
5546 * * Options are listed in SkParseColor.cpp
5547 * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
5548 * * e.g. `blueviolet` or `red`
5549 *
5550 * Sets the background color of the window. See Setting `backgroundColor`.
5551 */
5552 setBackgroundColor(backgroundColor: string): void;
5553 /**
5554 * This method sets the browser window's system-drawn background material,
5555 * including behind the non-client area.
5556 *
5557 * See the Windows documentation for more details.
5558 *
5559 * **Note:** This method is only supported on Windows 11 22H2 and up.
5560 *
5561 * @platform win32
5562 */
5563 setBackgroundMaterial(material: 'auto' | 'none' | 'mica' | 'acrylic' | 'tabbed'): void;
5564 /**
5565 * Resizes and moves the window to the supplied bounds. Any properties that are not
5566 * supplied will default to their current values.
5567 *
5568 * **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
5569 * height. The tray height has changed over time and depends on the operating
5570 * system, but is between 20-40px. Passing a value lower than the tray height will
5571 * result in a window that is flush to the tray.
5572 */
5573 setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
5574 /**
5575 * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5576 * `WebContentsView` class.
5577 *
5578 * @experimental
5579 * @deprecated
5580 */
5581 setBrowserView(browserView: (BrowserView) | (null)): void;
5582 /**
5583 * Sets whether the window can be manually closed by user. On Linux does nothing.
5584 *
5585 * @platform darwin,win32
5586 */
5587 setClosable(closable: boolean): void;
5588 /**
5589 * Resizes and moves the window's client area (e.g. the web page) to the supplied
5590 * bounds.
5591 */
5592 setContentBounds(bounds: Rectangle, animate?: boolean): void;
5593 /**
5594 * Prevents the window contents from being captured by other apps.
5595 *
5596 * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
5597 * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
5598 * version 2004 and up the window will be removed from capture entirely, older
5599 * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
5600 *
5601 * @platform darwin,win32
5602 */
5603 setContentProtection(enable: boolean): void;
5604 /**
5605 * Resizes the window's client area (e.g. the web page) to `width` and `height`.
5606 */
5607 setContentSize(width: number, height: number, animate?: boolean): void;
5608 /**
5609 * Specifies whether the window’s document has been edited, and the icon in title
5610 * bar will become gray when set to `true`.
5611 *
5612 * @platform darwin
5613 */
5614 setDocumentEdited(edited: boolean): void;
5615 /**
5616 * Disable or enable the window.
5617 */
5618 setEnabled(enable: boolean): void;
5619 /**
5620 * Changes whether the window can be focused.
5621 *
5622 * On macOS it does not remove the focus from the window.
5623 *
5624 * @platform darwin,win32
5625 */
5626 setFocusable(focusable: boolean): void;
5627 /**
5628 * Sets whether the window should be in fullscreen mode.
5629 *
5630 * **Note:** On macOS, fullscreen transitions take place asynchronously. If further
5631 * actions depend on the fullscreen state, use the 'enter-full-screen' or
5632 * 'leave-full-screen' events.
5633 */
5634 setFullScreen(flag: boolean): void;
5635 /**
5636 * Sets whether the maximize/zoom window button toggles fullscreen mode or
5637 * maximizes the window.
5638 */
5639 setFullScreenable(fullscreenable: boolean): void;
5640 /**
5641 * Sets whether the window should have a shadow.
5642 */
5643 setHasShadow(hasShadow: boolean): void;
5644 /**
5645 * Sets whether the window will be hidden when the user toggles into mission
5646 * control.
5647 *
5648 * @platform darwin
5649 */
5650 setHiddenInMissionControl(hidden: boolean): void;
5651 /**
5652 * Changes window icon.
5653 *
5654 * @platform win32,linux
5655 */
5656 setIcon(icon: (NativeImage) | (string)): void;
5657 /**
5658 * Makes the window ignore all mouse events.
5659 *
5660 * All mouse events happened in this window will be passed to the window below this
5661 * window, but if this window has focus, it will still receive keyboard events.
5662 */
5663 setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
5664 /**
5665 * Enters or leaves kiosk mode.
5666 */
5667 setKiosk(flag: boolean): void;
5668 /**
5669 * Sets whether the window can be manually maximized by user. On Linux does
5670 * nothing.
5671 *
5672 * @platform darwin,win32
5673 */
5674 setMaximizable(maximizable: boolean): void;
5675 /**
5676 * Sets the maximum size of window to `width` and `height`.
5677 */
5678 setMaximumSize(width: number, height: number): void;
5679 /**
5680 * Sets the `menu` as the window's menu bar.
5681 *
5682 * @platform linux,win32
5683 */
5684 setMenu(menu: (Menu) | (null)): void;
5685 /**
5686 * Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
5687 * can still bring up the menu bar by pressing the single `Alt` key.
5688 *
5689 * @platform win32,linux
5690 */
5691 setMenuBarVisibility(visible: boolean): void;
5692 /**
5693 * Sets whether the window can be manually minimized by user. On Linux does
5694 * nothing.
5695 *
5696 * @platform darwin,win32
5697 */
5698 setMinimizable(minimizable: boolean): void;
5699 /**
5700 * Sets the minimum size of window to `width` and `height`.
5701 */
5702 setMinimumSize(width: number, height: number): void;
5703 /**
5704 * Sets whether the window can be moved by user. On Linux does nothing.
5705 *
5706 * @platform darwin,win32
5707 */
5708 setMovable(movable: boolean): void;
5709 /**
5710 * Sets the opacity of the window. On Linux, does nothing. Out of bound number
5711 * values are clamped to the [0, 1] range.
5712 *
5713 * @platform win32,darwin
5714 */
5715 setOpacity(opacity: number): void;
5716 /**
5717 * Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
5718 * convey some sort of application status or to passively notify the user.
5719 *
5720 * @platform win32
5721 */
5722 setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
5723 /**
5724 * Sets `parent` as current window's parent window, passing `null` will turn
5725 * current window into a top-level window.
5726 */
5727 setParentWindow(parent: (BrowserWindow) | (null)): void;
5728 /**
5729 * Moves window to `x` and `y`.
5730 */
5731 setPosition(x: number, y: number, animate?: boolean): void;
5732 /**
5733 * Sets progress value in progress bar. Valid range is [0, 1.0].
5734 *
5735 * Remove progress bar when progress < 0; Change to indeterminate mode when
5736 * progress > 1.
5737 *
5738 * On Linux platform, only supports Unity desktop environment, you need to specify
5739 * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
5740 * it will assume `{app.name}.desktop`.
5741 *
5742 * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
5743 * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
5744 * mode set (but with a value within the valid range), `normal` will be assumed.
5745 */
5746 setProgressBar(progress: number, options?: ProgressBarOptions): void;
5747 /**
5748 * Sets the pathname of the file the window represents, and the icon of the file
5749 * will show in window's title bar.
5750 *
5751 * @platform darwin
5752 */
5753 setRepresentedFilename(filename: string): void;
5754 /**
5755 * Sets whether the window can be manually resized by the user.
5756 */
5757 setResizable(resizable: boolean): void;
5758 /**
5759 * Setting a window shape determines the area within the window where the system
5760 * permits drawing and user interaction. Outside of the given region, no pixels
5761 * will be drawn and no mouse events will be registered. Mouse events outside of
5762 * the region will not be received by that window, but will fall through to
5763 * whatever is behind the window.
5764 *
5765 * @experimental
5766 * @platform win32,linux
5767 */
5768 setShape(rects: Rectangle[]): void;
5769 /**
5770 * Changes the attachment point for sheets on macOS. By default, sheets are
5771 * attached just below the window frame, but you may want to display them beneath a
5772 * HTML-rendered toolbar. For example:
5773 *
5774 * @platform darwin
5775 */
5776 setSheetOffset(offsetY: number, offsetX?: number): void;
5777 /**
5778 * Enters or leaves simple fullscreen mode.
5779 *
5780 * Simple fullscreen mode emulates the native fullscreen behavior found in versions
5781 * of macOS prior to Lion (10.7).
5782 *
5783 * @platform darwin
5784 */
5785 setSimpleFullScreen(flag: boolean): void;
5786 /**
5787 * Resizes the window to `width` and `height`. If `width` or `height` are below any
5788 * set minimum size constraints the window will snap to its minimum size.
5789 */
5790 setSize(width: number, height: number, animate?: boolean): void;
5791 /**
5792 * Makes the window not show in the taskbar.
5793 *
5794 * @platform darwin,win32
5795 */
5796 setSkipTaskbar(skip: boolean): void;
5797 /**
5798 * Whether the buttons were added successfully
5799 *
5800 * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
5801 * of a window in a taskbar button layout. Returns a `boolean` object indicates
5802 * whether the thumbnail has been added successfully.
5803 *
5804 * The number of buttons in thumbnail toolbar should be no greater than 7 due to
5805 * the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
5806 * removed due to the platform's limitation. But you can call the API with an empty
5807 * array to clean the buttons.
5808 *
5809 * The `buttons` is an array of `Button` objects:
5810 *
5811 * * `Button` Object
5812 * * `icon` NativeImage - The icon showing in thumbnail toolbar.
5813 * * `click` Function
5814 * * `tooltip` string (optional) - The text of the button's tooltip.
5815 * * `flags` string[] (optional) - Control specific states and behaviors of the
5816 * button. By default, it is `['enabled']`.
5817 *
5818 * The `flags` is an array that can include following `string`s:
5819 *
5820 * * `enabled` - The button is active and available to the user.
5821 * * `disabled` - The button is disabled. It is present, but has a visual state
5822 * indicating it will not respond to user action.
5823 * * `dismissonclick` - When the button is clicked, the thumbnail window closes
5824 * immediately.
5825 * * `nobackground` - Do not draw a button border, use only the image.
5826 * * `hidden` - The button is not shown to the user.
5827 * * `noninteractive` - The button is enabled but not interactive; no pressed
5828 * button state is drawn. This value is intended for instances where the button is
5829 * used in a notification.
5830 *
5831 * @platform win32
5832 */
5833 setThumbarButtons(buttons: ThumbarButton[]): boolean;
5834 /**
5835 * Sets the region of the window to show as the thumbnail image displayed when
5836 * hovering over the window in the taskbar. You can reset the thumbnail to be the
5837 * entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
5838 * }`.
5839 *
5840 * @platform win32
5841 */
5842 setThumbnailClip(region: Rectangle): void;
5843 /**
5844 * Sets the toolTip that is displayed when hovering over the window thumbnail in
5845 * the taskbar.
5846 *
5847 * @platform win32
5848 */
5849 setThumbnailToolTip(toolTip: string): void;
5850 /**
5851 * Changes the title of native window to `title`.
5852 */
5853 setTitle(title: string): void;
5854 /**
5855 * On a Window with Window Controls Overlay already enabled, this method updates
5856 * the style of the title bar overlay.
5857 *
5858 * @platform win32
5859 */
5860 setTitleBarOverlay(options: TitleBarOverlay): void;
5861 /**
5862 * Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
5863 * error if `browserView` is not attached to `win`.
5864 *
5865 * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5866 * `WebContentsView` class.
5867 *
5868 * @experimental
5869 * @deprecated
5870 */
5871 setTopBrowserView(browserView: BrowserView): void;
5872 /**
5873 * Sets the touchBar layout for the current window. Specifying `null` or
5874 * `undefined` clears the touch bar. This method only has an effect if the machine
5875 * has a touch bar.
5876 *
5877 * **Note:** The TouchBar API is currently experimental and may change or be
5878 * removed in future Electron releases.
5879 *
5880 * @platform darwin
5881 */
5882 setTouchBar(touchBar: (TouchBar) | (null)): void;
5883 /**
5884 * Adds a vibrancy effect to the browser window. Passing `null` or an empty string
5885 * will remove the vibrancy effect on the window.
5886 *
5887 * @platform darwin
5888 */
5889 setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
5890 /**
5891 * Sets whether the window should be visible on all workspaces.
5892 *
5893 * **Note:** This API does nothing on Windows.
5894 *
5895 * @platform darwin,linux
5896 */
5897 setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
5898 /**
5899 * Set a custom position for the traffic light buttons in frameless window. Passing
5900 * `null` will reset the position to default.
5901 *
5902 * @platform darwin
5903 */
5904 setWindowButtonPosition(position: (Point) | (null)): void;
5905 /**
5906 * Sets whether the window traffic light buttons should be visible.
5907 *
5908 * @platform darwin
5909 */
5910 setWindowButtonVisibility(visible: boolean): void;
5911 /**
5912 * Shows and gives focus to the window.
5913 */
5914 show(): void;
5915 /**
5916 * Shows or hides the tab overview when native tabs are enabled.
5917 *
5918 * @platform darwin
5919 */
5920 showAllTabs(): void;
5921 /**
5922 * Same as `webContents.showDefinitionForSelection()`.
5923 *
5924 * @platform darwin
5925 */
5926 showDefinitionForSelection(): void;
5927 /**
5928 * Shows the window but doesn't focus on it.
5929 */
5930 showInactive(): void;
5931 /**
5932 * Toggles the visibility of the tab bar if native tabs are enabled and there is
5933 * only one tab in the current window.
5934 *
5935 * @platform darwin
5936 */
5937 toggleTabBar(): void;
5938 /**
5939 * Unhooks all of the window messages.
5940 *
5941 * @platform win32
5942 */
5943 unhookAllWindowMessages(): void;
5944 /**
5945 * Unhook the window message.
5946 *
5947 * @platform win32
5948 */
5949 unhookWindowMessage(message: number): void;
5950 /**
5951 * Unmaximizes the window.
5952 */
5953 unmaximize(): void;
5954 /**
5955 * A `string` property that defines an alternative title provided only to
5956 * accessibility tools such as screen readers. This string is not directly visible
5957 * to users.
5958 */
5959 accessibleTitle: string;
5960 /**
5961 * A `boolean` property that determines whether the window menu bar should hide
5962 * itself automatically. Once set, the menu bar will only show when users press the
5963 * single `Alt` key.
5964 *
5965 * If the menu bar is already visible, setting this property to `true` won't hide
5966 * it immediately.
5967 */
5968 autoHideMenuBar: boolean;
5969 /**
5970 * A `boolean` property that determines whether the window can be manually closed
5971 * by user.
5972 *
5973 * On Linux the setter is a no-op, although the getter returns `true`.
5974 *
5975 * @platform darwin,win32
5976 */
5977 closable: boolean;
5978 /**
5979 * A `boolean` property that specifies whether the window’s document has been
5980 * edited.
5981 *
5982 * The icon in title bar will become gray when set to `true`.
5983 *
5984 * @platform darwin
5985 */
5986 documentEdited: boolean;
5987 /**
5988 * A `boolean` property that determines whether the window is excluded from the
5989 * application’s Windows menu. `false` by default.
5990 *
5991 * @platform darwin
5992 */
5993 excludedFromShownWindowsMenu: boolean;
5994 /**
5995 * A `boolean` property that determines whether the window is focusable.
5996 *
5997 * @platform win32,darwin
5998 */
5999 focusable: boolean;
6000 /**
6001 * A `boolean` property that determines whether the window is in fullscreen mode.
6002 */
6003 fullScreen: boolean;
6004 /**
6005 * A `boolean` property that determines whether the maximize/zoom window button
6006 * toggles fullscreen mode or maximizes the window.
6007 */
6008 fullScreenable: boolean;
6009 /**
6010 * A `Integer` property representing the unique ID of the window. Each ID is unique
6011 * among all `BrowserWindow` instances of the entire Electron application.
6012 *
6013 */
6014 readonly id: number;
6015 /**
6016 * A `boolean` property that determines whether the window is in kiosk mode.
6017 */
6018 kiosk: boolean;
6019 /**
6020 * A `boolean` property that determines whether the window can be manually
6021 * maximized by user.
6022 *
6023 * On Linux the setter is a no-op, although the getter returns `true`.
6024 *
6025 * @platform darwin,win32
6026 */
6027 maximizable: boolean;
6028 /**
6029 * A `boolean` property that determines whether the menu bar should be visible.
6030 *
6031 * **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
6032 * pressing the single `Alt` key.
6033 *
6034 * @platform win32,linux
6035 */
6036 menuBarVisible: boolean;
6037 /**
6038 * A `boolean` property that determines whether the window can be manually
6039 * minimized by user.
6040 *
6041 * On Linux the setter is a no-op, although the getter returns `true`.
6042 *
6043 * @platform darwin,win32
6044 */
6045 minimizable: boolean;
6046 /**
6047 * A `boolean` property that determines Whether the window can be moved by user.
6048 *
6049 * On Linux the setter is a no-op, although the getter returns `true`.
6050 *
6051 * @platform darwin,win32
6052 */
6053 movable: boolean;
6054 /**
6055 * A `string` property that determines the pathname of the file the window
6056 * represents, and the icon of the file will show in window's title bar.
6057 *
6058 * @platform darwin
6059 */
6060 representedFilename: string;
6061 /**
6062 * A `boolean` property that determines whether the window can be manually resized
6063 * by user.
6064 */
6065 resizable: boolean;
6066 /**
6067 * A `boolean` property that determines whether the window has a shadow.
6068 */
6069 shadow: boolean;
6070 /**
6071 * A `boolean` property that determines whether the window is in simple (pre-Lion)
6072 * fullscreen mode.
6073 */
6074 simpleFullScreen: boolean;
6075 /**
6076 * A `string` (optional) property that is equal to the `tabbingIdentifier` passed
6077 * to the `BrowserWindow` constructor or `undefined` if none was set.
6078 *
6079 * @platform darwin
6080 */
6081 readonly tabbingIdentifier?: string;
6082 /**
6083 * A `string` property that determines the title of the native window.
6084 *
6085 * **Note:** The title of the web page can be different from the title of the
6086 * native window.
6087 */
6088 title: string;
6089 /**
6090 * A `boolean` property that determines whether the window is visible on all
6091 * workspaces.
6092 *
6093 * **Note:** Always returns false on Windows.
6094 *
6095 * @platform darwin,linux
6096 */
6097 visibleOnAllWorkspaces: boolean;
6098 /**
6099 * A `WebContents` object this window owns. All web page related events and
6100 * operations will be done via it.
6101 *
6102 * See the `webContents` documentation for its methods and events.
6103 *
6104 */
6105 readonly webContents: WebContents;
6106 }
6107
6108 interface BrowserWindowConstructorOptions extends BaseWindowConstructorOptions {
6109
6110 // Docs: https://electronjs.org/docs/api/structures/browser-window-options
6111
6112 /**
6113 * Whether the renderer should be active when `show` is `false` and it has just
6114 * been created. In order for `document.visibilityState` to work correctly on
6115 * first load with `show: false` you should set this to `false`. Setting this to
6116 * `false` will cause the `ready-to-show` event to not fire. Default is `true`.
6117 */
6118 paintWhenInitiallyHidden?: boolean;
6119 /**
6120 * When using a frameless window in conjunction with
6121 * `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so
6122 * that the standard window controls ("traffic lights" on macOS) are visible, this
6123 * property enables the Window Controls Overlay JavaScript APIs and CSS Environment
6124 * Variables. Specifying `true` will result in an overlay with default system
6125 * colors. Default is `false`.
6126 */
6127 titleBarOverlay?: (TitleBarOverlay) | (boolean);
6128 /**
6129 * Settings of web page's features.
6130 */
6131 webPreferences?: WebPreferences;
6132 }
6133
6134 interface Certificate {
6135
6136 // Docs: https://electronjs.org/docs/api/structures/certificate
6137
6138 /**
6139 * PEM encoded data
6140 */
6141 data: string;
6142 /**
6143 * Fingerprint of the certificate
6144 */
6145 fingerprint: string;
6146 /**
6147 * Issuer principal
6148 */
6149 issuer: CertificatePrincipal;
6150 /**
6151 * Issuer certificate (if not self-signed)
6152 */
6153 issuerCert: Certificate;
6154 /**
6155 * Issuer's Common Name
6156 */
6157 issuerName: string;
6158 /**
6159 * Hex value represented string
6160 */
6161 serialNumber: string;
6162 /**
6163 * Subject principal
6164 */
6165 subject: CertificatePrincipal;
6166 /**
6167 * Subject's Common Name
6168 */
6169 subjectName: string;
6170 /**
6171 * End date of the certificate being valid in seconds
6172 */
6173 validExpiry: number;
6174 /**
6175 * Start date of the certificate being valid in seconds
6176 */
6177 validStart: number;
6178 }
6179
6180 interface CertificatePrincipal {
6181
6182 // Docs: https://electronjs.org/docs/api/structures/certificate-principal
6183
6184 /**
6185 * Common Name.
6186 */
6187 commonName: string;
6188 /**
6189 * Country or region.
6190 */
6191 country: string;
6192 /**
6193 * Locality.
6194 */
6195 locality: string;
6196 /**
6197 * Organization names.
6198 */
6199 organizations: string[];
6200 /**
6201 * Organization Unit names.
6202 */
6203 organizationUnits: string[];
6204 /**
6205 * State or province.
6206 */
6207 state: string;
6208 }
6209
6210 class ClientRequest extends NodeEventEmitter {
6211
6212 // Docs: https://electronjs.org/docs/api/client-request
6213
6214 /**
6215 * Emitted when the `request` is aborted. The `abort` event will not be fired if
6216 * the `request` is already closed.
6217 */
6218 on(event: 'abort', listener: Function): this;
6219 off(event: 'abort', listener: Function): this;
6220 once(event: 'abort', listener: Function): this;
6221 addListener(event: 'abort', listener: Function): this;
6222 removeListener(event: 'abort', listener: Function): this;
6223 /**
6224 * Emitted as the last event in the HTTP request-response transaction. The `close`
6225 * event indicates that no more events will be emitted on either the `request` or
6226 * `response` objects.
6227 */
6228 on(event: 'close', listener: Function): this;
6229 off(event: 'close', listener: Function): this;
6230 once(event: 'close', listener: Function): this;
6231 addListener(event: 'close', listener: Function): this;
6232 removeListener(event: 'close', listener: Function): this;
6233 /**
6234 * Emitted when the `net` module fails to issue a network request. Typically when
6235 * the `request` object emits an `error` event, a `close` event will subsequently
6236 * follow and no response object will be provided.
6237 */
6238 on(event: 'error', listener: (
6239 /**
6240 * an error object providing some information about the failure.
6241 */
6242 error: Error) => void): this;
6243 off(event: 'error', listener: (
6244 /**
6245 * an error object providing some information about the failure.
6246 */
6247 error: Error) => void): this;
6248 once(event: 'error', listener: (
6249 /**
6250 * an error object providing some information about the failure.
6251 */
6252 error: Error) => void): this;
6253 addListener(event: 'error', listener: (
6254 /**
6255 * an error object providing some information about the failure.
6256 */
6257 error: Error) => void): this;
6258 removeListener(event: 'error', listener: (
6259 /**
6260 * an error object providing some information about the failure.
6261 */
6262 error: Error) => void): this;
6263 /**
6264 * Emitted just after the last chunk of the `request`'s data has been written into
6265 * the `request` object.
6266 */
6267 on(event: 'finish', listener: Function): this;
6268 off(event: 'finish', listener: Function): this;
6269 once(event: 'finish', listener: Function): this;
6270 addListener(event: 'finish', listener: Function): this;
6271 removeListener(event: 'finish', listener: Function): this;
6272 /**
6273 * Emitted when an authenticating proxy is asking for user credentials.
6274 *
6275 * The `callback` function is expected to be called back with user credentials:
6276 *
6277 * * `username` string
6278 * * `password` string
6279 *
6280 * Providing empty credentials will cancel the request and report an authentication
6281 * error on the response object:
6282 */
6283 on(event: 'login', listener: (authInfo: AuthInfo,
6284 callback: (username?: string, password?: string) => void) => void): this;
6285 off(event: 'login', listener: (authInfo: AuthInfo,
6286 callback: (username?: string, password?: string) => void) => void): this;
6287 once(event: 'login', listener: (authInfo: AuthInfo,
6288 callback: (username?: string, password?: string) => void) => void): this;
6289 addListener(event: 'login', listener: (authInfo: AuthInfo,
6290 callback: (username?: string, password?: string) => void) => void): this;
6291 removeListener(event: 'login', listener: (authInfo: AuthInfo,
6292 callback: (username?: string, password?: string) => void) => void): this;
6293 /**
6294 * Emitted when the server returns a redirect response (e.g. 301 Moved
6295 * Permanently). Calling `request.followRedirect` will continue with the
6296 * redirection. If this event is handled, `request.followRedirect` must be called
6297 * **synchronously**, otherwise the request will be cancelled.
6298 */
6299 on(event: 'redirect', listener: (statusCode: number,
6300 method: string,
6301 redirectUrl: string,
6302 responseHeaders: Record<string, string[]>) => void): this;
6303 off(event: 'redirect', listener: (statusCode: number,
6304 method: string,
6305 redirectUrl: string,
6306 responseHeaders: Record<string, string[]>) => void): this;
6307 once(event: 'redirect', listener: (statusCode: number,
6308 method: string,
6309 redirectUrl: string,
6310 responseHeaders: Record<string, string[]>) => void): this;
6311 addListener(event: 'redirect', listener: (statusCode: number,
6312 method: string,
6313 redirectUrl: string,
6314 responseHeaders: Record<string, string[]>) => void): this;
6315 removeListener(event: 'redirect', listener: (statusCode: number,
6316 method: string,
6317 redirectUrl: string,
6318 responseHeaders: Record<string, string[]>) => void): this;
6319 on(event: 'response', listener: (
6320 /**
6321 * An object representing the HTTP response message.
6322 */
6323 response: IncomingMessage) => void): this;
6324 off(event: 'response', listener: (
6325 /**
6326 * An object representing the HTTP response message.
6327 */
6328 response: IncomingMessage) => void): this;
6329 once(event: 'response', listener: (
6330 /**
6331 * An object representing the HTTP response message.
6332 */
6333 response: IncomingMessage) => void): this;
6334 addListener(event: 'response', listener: (
6335 /**
6336 * An object representing the HTTP response message.
6337 */
6338 response: IncomingMessage) => void): this;
6339 removeListener(event: 'response', listener: (
6340 /**
6341 * An object representing the HTTP response message.
6342 */
6343 response: IncomingMessage) => void): this;
6344 /**
6345 * ClientRequest
6346 */
6347 constructor(options: (ClientRequestConstructorOptions) | (string));
6348 /**
6349 * Cancels an ongoing HTTP transaction. If the request has already emitted the
6350 * `close` event, the abort operation will have no effect. Otherwise an ongoing
6351 * event will emit `abort` and `close` events. Additionally, if there is an ongoing
6352 * response object,it will emit the `aborted` event.
6353 */
6354 abort(): void;
6355 /**
6356 * Sends the last chunk of the request data. Subsequent write or end operations
6357 * will not be allowed. The `finish` event is emitted just after the end operation.
6358 */
6359 end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): this;
6360 /**
6361 * Continues any pending redirection. Can only be called during a `'redirect'`
6362 * event.
6363 */
6364 followRedirect(): void;
6365 /**
6366 * The value of a previously set extra header name.
6367 */
6368 getHeader(name: string): string;
6369 /**
6370 * * `active` boolean - Whether the request is currently active. If this is false
6371 * no other properties will be set
6372 * * `started` boolean - Whether the upload has started. If this is false both
6373 * `current` and `total` will be set to 0.
6374 * * `current` Integer - The number of bytes that have been uploaded so far
6375 * * `total` Integer - The number of bytes that will be uploaded this request
6376 *
6377 * You can use this method in conjunction with `POST` requests to get the progress
6378 * of a file upload or other data transfer.
6379 */
6380 getUploadProgress(): UploadProgress;
6381 /**
6382 * Removes a previously set extra header name. This method can be called only
6383 * before first write. Trying to call it after the first write will throw an error.
6384 */
6385 removeHeader(name: string): void;
6386 /**
6387 * Adds an extra HTTP header. The header name will be issued as-is without
6388 * lowercasing. It can be called only before first write. Calling this method after
6389 * the first write will throw an error. If the passed value is not a `string`, its
6390 * `toString()` method will be called to obtain the final value.
6391 *
6392 * Certain headers are restricted from being set by apps. These headers are listed
6393 * below. More information on restricted headers can be found in Chromium's header
6394 * utils.
6395 *
6396 * * `Content-Length`
6397 * * `Host`
6398 * * `Trailer` or `Te`
6399 * * `Upgrade`
6400 * * `Cookie2`
6401 * * `Keep-Alive`
6402 * * `Transfer-Encoding`
6403 *
6404 * Additionally, setting the `Connection` header to the value `upgrade` is also
6405 * disallowed.
6406 */
6407 setHeader(name: string, value: string): void;
6408 /**
6409 * `callback` is essentially a dummy function introduced in the purpose of keeping
6410 * similarity with the Node.js API. It is called asynchronously in the next tick
6411 * after `chunk` content have been delivered to the Chromium networking layer.
6412 * Contrary to the Node.js implementation, it is not guaranteed that `chunk`
6413 * content have been flushed on the wire before `callback` is called.
6414 *
6415 * Adds a chunk of data to the request body. The first write operation may cause
6416 * the request headers to be issued on the wire. After the first write operation,
6417 * it is not allowed to add or remove a custom header.
6418 */
6419 write(chunk: (string) | (Buffer), encoding?: string, callback?: () => void): void;
6420 /**
6421 * A `boolean` specifying whether the request will use HTTP chunked transfer
6422 * encoding or not. Defaults to false. The property is readable and writable,
6423 * however it can be set only before the first write operation as the HTTP headers
6424 * are not yet put on the wire. Trying to set the `chunkedEncoding` property after
6425 * the first write will throw an error.
6426 *
6427 * Using chunked encoding is strongly recommended if you need to send a large
6428 * request body as data will be streamed in small chunks instead of being
6429 * internally buffered inside Electron process memory.
6430 */
6431 chunkedEncoding: boolean;
6432 }
6433
6434 interface Clipboard {
6435
6436 // Docs: https://electronjs.org/docs/api/clipboard
6437
6438 /**
6439 * An array of supported formats for the clipboard `type`.
6440 */
6441 availableFormats(type?: 'selection' | 'clipboard'): string[];
6442 /**
6443 * Clears the clipboard content.
6444 */
6445 clear(type?: 'selection' | 'clipboard'): void;
6446 /**
6447 * Whether the clipboard supports the specified `format`.
6448 *
6449 * @experimental
6450 */
6451 has(format: string, type?: 'selection' | 'clipboard'): boolean;
6452 /**
6453 * Reads `format` type from the clipboard.
6454 *
6455 * `format` should contain valid ASCII characters and have `/` separator. `a/c`,
6456 * `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid.
6457 *
6458 * @experimental
6459 */
6460 read(format: string): string;
6461 /**
6462 * * `title` string
6463 * * `url` string
6464 *
6465 * Returns an Object containing `title` and `url` keys representing the bookmark in
6466 * the clipboard. The `title` and `url` values will be empty strings when the
6467 * bookmark is unavailable. The `title` value will always be empty on Windows.
6468 *
6469 * @platform darwin,win32
6470 */
6471 readBookmark(): ReadBookmark;
6472 /**
6473 * Reads `format` type from the clipboard.
6474 *
6475 * @experimental
6476 */
6477 readBuffer(format: string): Buffer;
6478 /**
6479 * The text on the find pasteboard, which is the pasteboard that holds information
6480 * about the current state of the active application’s find panel.
6481 *
6482 * This method uses synchronous IPC when called from the renderer process. The
6483 * cached value is reread from the find pasteboard whenever the application is
6484 * activated.
6485 *
6486 * @platform darwin
6487 */
6488 readFindText(): string;
6489 /**
6490 * The content in the clipboard as markup.
6491 */
6492 readHTML(type?: 'selection' | 'clipboard'): string;
6493 /**
6494 * The image content in the clipboard.
6495 */
6496 readImage(type?: 'selection' | 'clipboard'): NativeImage;
6497 /**
6498 * The content in the clipboard as RTF.
6499 */
6500 readRTF(type?: 'selection' | 'clipboard'): string;
6501 /**
6502 * The content in the clipboard as plain text.
6503 */
6504 readText(type?: 'selection' | 'clipboard'): string;
6505 /**
6506 * Writes `data` to the clipboard.
6507 */
6508 write(data: Data, type?: 'selection' | 'clipboard'): void;
6509 /**
6510 * Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
6511 *
6512 * **Note:** Most apps on Windows don't support pasting bookmarks into them so you
6513 * can use `clipboard.write` to write both a bookmark and fallback text to the
6514 * clipboard.
6515 *
6516 * @platform darwin,win32
6517 */
6518 writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
6519 /**
6520 * Writes the `buffer` into the clipboard as `format`.
6521 *
6522 * @experimental
6523 */
6524 writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
6525 /**
6526 * Writes the `text` into the find pasteboard (the pasteboard that holds
6527 * information about the current state of the active application’s find panel) as
6528 * plain text. This method uses synchronous IPC when called from the renderer
6529 * process.
6530 *
6531 * @platform darwin
6532 */
6533 writeFindText(text: string): void;
6534 /**
6535 * Writes `markup` to the clipboard.
6536 */
6537 writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
6538 /**
6539 * Writes `image` to the clipboard.
6540 */
6541 writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
6542 /**
6543 * Writes the `text` into the clipboard in RTF.
6544 */
6545 writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
6546 /**
6547 * Writes the `text` into the clipboard as plain text.
6548 */
6549 writeText(text: string, type?: 'selection' | 'clipboard'): void;
6550 }
6551
6552 class CommandLine {
6553
6554 // Docs: https://electronjs.org/docs/api/command-line
6555
6556 /**
6557 * Append an argument to Chromium's command line. The argument will be quoted
6558 * correctly. Switches will precede arguments regardless of appending order.
6559 *
6560 * If you're appending an argument like `--switch=value`, consider using
6561 * `appendSwitch('switch', 'value')` instead.
6562 *
6563 * **Note:** This will not affect `process.argv`. The intended usage of this
6564 * function is to control Chromium's behavior.
6565 */
6566 appendArgument(value: string): void;
6567 /**
6568 * Append a switch (with optional `value`) to Chromium's command line.
6569 *
6570 * **Note:** This will not affect `process.argv`. The intended usage of this
6571 * function is to control Chromium's behavior.
6572 */
6573 appendSwitch(the_switch: string, value?: string): void;
6574 /**
6575 * The command-line switch value.
6576 *
6577 * **Note:** When the switch is not present or has no value, it returns empty
6578 * string.
6579 */
6580 getSwitchValue(the_switch: string): string;
6581 /**
6582 * Whether the command-line switch is present.
6583 */
6584 hasSwitch(the_switch: string): boolean;
6585 /**
6586 * Removes the specified switch from Chromium's command line.
6587 *
6588 * **Note:** This will not affect `process.argv`. The intended usage of this
6589 * function is to control Chromium's behavior.
6590 */
6591 removeSwitch(the_switch: string): void;
6592 }
6593
6594 interface ContentTracing {
6595
6596 // Docs: https://electronjs.org/docs/api/content-tracing
6597
6598 /**
6599 * resolves with an array of category groups once all child processes have
6600 * acknowledged the `getCategories` request
6601 *
6602 * Get a set of category groups. The category groups can change as new code paths
6603 * are reached. See also the list of built-in tracing categories.
6604 *
6605 * > **NOTE:** Electron adds a non-default tracing category called `"electron"`.
6606 * This category can be used to capture Electron-specific tracing events.
6607 */
6608 getCategories(): Promise<string[]>;
6609 /**
6610 * Resolves with an object containing the `value` and `percentage` of trace buffer
6611 * maximum usage
6612 *
6613 * * `value` number
6614 * * `percentage` number
6615 *
6616 * Get the maximum usage across processes of trace buffer as a percentage of the
6617 * full state.
6618 */
6619 getTraceBufferUsage(): Promise<Electron.TraceBufferUsageReturnValue>;
6620 /**
6621 * resolved once all child processes have acknowledged the `startRecording`
6622 * request.
6623 *
6624 * Start recording on all processes.
6625 *
6626 * Recording begins immediately locally and asynchronously on child processes as
6627 * soon as they receive the EnableRecording request.
6628 *
6629 * If a recording is already running, the promise will be immediately resolved, as
6630 * only one trace operation can be in progress at a time.
6631 */
6632 startRecording(options: (TraceConfig) | (TraceCategoriesAndOptions)): Promise<void>;
6633 /**
6634 * resolves with a path to a file that contains the traced data once all child
6635 * processes have acknowledged the `stopRecording` request
6636 *
6637 * Stop recording on all processes.
6638 *
6639 * Child processes typically cache trace data and only rarely flush and send trace
6640 * data back to the main process. This helps to minimize the runtime overhead of
6641 * tracing since sending trace data over IPC can be an expensive operation. So, to
6642 * end tracing, Chromium asynchronously asks all child processes to flush any
6643 * pending trace data.
6644 *
6645 * Trace data will be written into `resultFilePath`. If `resultFilePath` is empty
6646 * or not provided, trace data will be written to a temporary file, and the path
6647 * will be returned in the promise.
6648 */
6649 stopRecording(resultFilePath?: string): Promise<string>;
6650 }
6651
6652 interface ContextBridge {
6653
6654 // Docs: https://electronjs.org/docs/api/context-bridge
6655
6656 exposeInIsolatedWorld(worldId: number, apiKey: string, api: any): void;
6657 exposeInMainWorld(apiKey: string, api: any): void;
6658 }
6659
6660 interface Cookie {
6661
6662 // Docs: https://electronjs.org/docs/api/structures/cookie
6663
6664 /**
6665 * The domain of the cookie; this will be normalized with a preceding dot so that
6666 * it's also valid for subdomains.
6667 */
6668 domain?: string;
6669 /**
6670 * The expiration date of the cookie as the number of seconds since the UNIX epoch.
6671 * Not provided for session cookies.
6672 */
6673 expirationDate?: number;
6674 /**
6675 * Whether the cookie is a host-only cookie; this will only be `true` if no domain
6676 * was passed.
6677 */
6678 hostOnly?: boolean;
6679 /**
6680 * Whether the cookie is marked as HTTP only.
6681 */
6682 httpOnly?: boolean;
6683 /**
6684 * The name of the cookie.
6685 */
6686 name: string;
6687 /**
6688 * The path of the cookie.
6689 */
6690 path?: string;
6691 /**
6692 * The Same Site policy applied to this cookie. Can be `unspecified`,
6693 * `no_restriction`, `lax` or `strict`.
6694 */
6695 sameSite: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
6696 /**
6697 * Whether the cookie is marked as secure.
6698 */
6699 secure?: boolean;
6700 /**
6701 * Whether the cookie is a session cookie or a persistent cookie with an expiration
6702 * date.
6703 */
6704 session?: boolean;
6705 /**
6706 * The value of the cookie.
6707 */
6708 value: string;
6709 }
6710
6711 class Cookies extends NodeEventEmitter {
6712
6713 // Docs: https://electronjs.org/docs/api/cookies
6714
6715 /**
6716 * Emitted when a cookie is changed because it was added, edited, removed, or
6717 * expired.
6718 */
6719 on(event: 'changed', listener: (event: Event,
6720 /**
6721 * The cookie that was changed.
6722 */
6723 cookie: Cookie,
6724 /**
6725 * The cause of the change with one of the following values:
6726 */
6727 cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
6728 /**
6729 * `true` if the cookie was removed, `false` otherwise.
6730 */
6731 removed: boolean) => void): this;
6732 off(event: 'changed', listener: (event: Event,
6733 /**
6734 * The cookie that was changed.
6735 */
6736 cookie: Cookie,
6737 /**
6738 * The cause of the change with one of the following values:
6739 */
6740 cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
6741 /**
6742 * `true` if the cookie was removed, `false` otherwise.
6743 */
6744 removed: boolean) => void): this;
6745 once(event: 'changed', listener: (event: Event,
6746 /**
6747 * The cookie that was changed.
6748 */
6749 cookie: Cookie,
6750 /**
6751 * The cause of the change with one of the following values:
6752 */
6753 cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
6754 /**
6755 * `true` if the cookie was removed, `false` otherwise.
6756 */
6757 removed: boolean) => void): this;
6758 addListener(event: 'changed', listener: (event: Event,
6759 /**
6760 * The cookie that was changed.
6761 */
6762 cookie: Cookie,
6763 /**
6764 * The cause of the change with one of the following values:
6765 */
6766 cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
6767 /**
6768 * `true` if the cookie was removed, `false` otherwise.
6769 */
6770 removed: boolean) => void): this;
6771 removeListener(event: 'changed', listener: (event: Event,
6772 /**
6773 * The cookie that was changed.
6774 */
6775 cookie: Cookie,
6776 /**
6777 * The cause of the change with one of the following values:
6778 */
6779 cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
6780 /**
6781 * `true` if the cookie was removed, `false` otherwise.
6782 */
6783 removed: boolean) => void): this;
6784 /**
6785 * A promise which resolves when the cookie store has been flushed
6786 *
6787 * Writes any unwritten cookies data to disk
6788 *
6789 * Cookies written by any method will not be written to disk immediately, but will
6790 * be written every 30 seconds or 512 operations
6791 *
6792 * Calling this method can cause the cookie to be written to disk immediately.
6793 */
6794 flushStore(): Promise<void>;
6795 /**
6796 * A promise which resolves an array of cookie objects.
6797 *
6798 * Sends a request to get all cookies matching `filter`, and resolves a promise
6799 * with the response.
6800 */
6801 get(filter: CookiesGetFilter): Promise<Electron.Cookie[]>;
6802 /**
6803 * A promise which resolves when the cookie has been removed
6804 *
6805 * Removes the cookies matching `url` and `name`
6806 */
6807 remove(url: string, name: string): Promise<void>;
6808 /**
6809 * A promise which resolves when the cookie has been set
6810 *
6811 * Sets a cookie with `details`.
6812 */
6813 set(details: CookiesSetDetails): Promise<void>;
6814 }
6815
6816 interface CPUUsage {
6817
6818 // Docs: https://electronjs.org/docs/api/structures/cpu-usage
6819
6820 /**
6821 * The number of average idle CPU wakeups per second since the last call to
6822 * getCPUUsage. First call returns 0. Will always return 0 on Windows.
6823 */
6824 idleWakeupsPerSecond: number;
6825 /**
6826 * Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
6827 */
6828 percentCPUUsage: number;
6829 }
6830
6831 interface CrashReport {
6832
6833 // Docs: https://electronjs.org/docs/api/structures/crash-report
6834
6835 date: Date;
6836 id: string;
6837 }
6838
6839 interface CrashReporter {
6840
6841 // Docs: https://electronjs.org/docs/api/crash-reporter
6842
6843 /**
6844 * Set an extra parameter to be sent with the crash report. The values specified
6845 * here will be sent in addition to any values set via the `extra` option when
6846 * `start` was called.
6847 *
6848 * Parameters added in this fashion (or via the `extra` parameter to
6849 * `crashReporter.start`) are specific to the calling process. Adding extra
6850 * parameters in the main process will not cause those parameters to be sent along
6851 * with crashes from renderer or other child processes. Similarly, adding extra
6852 * parameters in a renderer process will not result in those parameters being sent
6853 * with crashes that occur in other renderer processes or in the main process.
6854 *
6855 * **Note:** Parameters have limits on the length of the keys and values. Key names
6856 * must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
6857 * Keys with names longer than the maximum will be silently ignored. Key values
6858 * longer than the maximum length will be truncated.
6859 */
6860 addExtraParameter(key: string, value: string): void;
6861 /**
6862 * The date and ID of the last crash report. Only crash reports that have been
6863 * uploaded will be returned; even if a crash report is present on disk it will not
6864 * be returned until it is uploaded. In the case that there are no uploaded
6865 * reports, `null` is returned.
6866 *
6867 * **Note:** This method is only available in the main process.
6868 */
6869 getLastCrashReport(): (CrashReport) | (null);
6870 /**
6871 * The current 'extra' parameters of the crash reporter.
6872 */
6873 getParameters(): Record<string, string>;
6874 /**
6875 * Returns all uploaded crash reports. Each report contains the date and uploaded
6876 * ID.
6877 *
6878 * **Note:** This method is only available in the main process.
6879 */
6880 getUploadedReports(): CrashReport[];
6881 /**
6882 * Whether reports should be submitted to the server. Set through the `start`
6883 * method or `setUploadToServer`.
6884 *
6885 * **Note:** This method is only available in the main process.
6886 */
6887 getUploadToServer(): boolean;
6888 /**
6889 * Remove an extra parameter from the current set of parameters. Future crashes
6890 * will not include this parameter.
6891 */
6892 removeExtraParameter(key: string): void;
6893 /**
6894 * This would normally be controlled by user preferences. This has no effect if
6895 * called before `start` is called.
6896 *
6897 * **Note:** This method is only available in the main process.
6898 */
6899 setUploadToServer(uploadToServer: boolean): void;
6900 /**
6901 * This method must be called before using any other `crashReporter` APIs. Once
6902 * initialized this way, the crashpad handler collects crashes from all
6903 * subsequently created processes. The crash reporter cannot be disabled once
6904 * started.
6905 *
6906 * This method should be called as early as possible in app startup, preferably
6907 * before `app.on('ready')`. If the crash reporter is not initialized at the time a
6908 * renderer process is created, then that renderer process will not be monitored by
6909 * the crash reporter.
6910 *
6911 * **Note:** You can test out the crash reporter by generating a crash using
6912 * `process.crash()`.
6913 *
6914 * **Note:** If you need to send additional/updated `extra` parameters after your
6915 * first call `start` you can call `addExtraParameter`.
6916 *
6917 * **Note:** Parameters passed in `extra`, `globalExtra` or set with
6918 * `addExtraParameter` have limits on the length of the keys and values. Key names
6919 * must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
6920 * with names longer than the maximum will be silently ignored. Key values longer
6921 * than the maximum length will be truncated.
6922 *
6923 * **Note:** This method is only available in the main process.
6924 */
6925 start(options: CrashReporterStartOptions): void;
6926 }
6927
6928 interface CustomScheme {
6929
6930 // Docs: https://electronjs.org/docs/api/structures/custom-scheme
6931
6932 privileges?: Privileges;
6933 /**
6934 * Custom schemes to be registered with options.
6935 */
6936 scheme: string;
6937 }
6938
6939 class Debugger extends NodeEventEmitter {
6940
6941 // Docs: https://electronjs.org/docs/api/debugger
6942
6943 /**
6944 * Emitted when the debugging session is terminated. This happens either when
6945 * `webContents` is closed or devtools is invoked for the attached `webContents`.
6946 */
6947 on(event: 'detach', listener: (event: Event,
6948 /**
6949 * Reason for detaching debugger.
6950 */
6951 reason: string) => void): this;
6952 off(event: 'detach', listener: (event: Event,
6953 /**
6954 * Reason for detaching debugger.
6955 */
6956 reason: string) => void): this;
6957 once(event: 'detach', listener: (event: Event,
6958 /**
6959 * Reason for detaching debugger.
6960 */
6961 reason: string) => void): this;
6962 addListener(event: 'detach', listener: (event: Event,
6963 /**
6964 * Reason for detaching debugger.
6965 */
6966 reason: string) => void): this;
6967 removeListener(event: 'detach', listener: (event: Event,
6968 /**
6969 * Reason for detaching debugger.
6970 */
6971 reason: string) => void): this;
6972 /**
6973 * Emitted whenever the debugging target issues an instrumentation event.
6974 */
6975 on(event: 'message', listener: (event: Event,
6976 /**
6977 * Method name.
6978 */
6979 method: string,
6980 /**
6981 * Event parameters defined by the 'parameters' attribute in the remote debugging
6982 * protocol.
6983 */
6984 params: any,
6985 /**
6986 * Unique identifier of attached debugging session, will match the value sent from
6987 * `debugger.sendCommand`.
6988 */
6989 sessionId: string) => void): this;
6990 off(event: 'message', listener: (event: Event,
6991 /**
6992 * Method name.
6993 */
6994 method: string,
6995 /**
6996 * Event parameters defined by the 'parameters' attribute in the remote debugging
6997 * protocol.
6998 */
6999 params: any,
7000 /**
7001 * Unique identifier of attached debugging session, will match the value sent from
7002 * `debugger.sendCommand`.
7003 */
7004 sessionId: string) => void): this;
7005 once(event: 'message', listener: (event: Event,
7006 /**
7007 * Method name.
7008 */
7009 method: string,
7010 /**
7011 * Event parameters defined by the 'parameters' attribute in the remote debugging
7012 * protocol.
7013 */
7014 params: any,
7015 /**
7016 * Unique identifier of attached debugging session, will match the value sent from
7017 * `debugger.sendCommand`.
7018 */
7019 sessionId: string) => void): this;
7020 addListener(event: 'message', listener: (event: Event,
7021 /**
7022 * Method name.
7023 */
7024 method: string,
7025 /**
7026 * Event parameters defined by the 'parameters' attribute in the remote debugging
7027 * protocol.
7028 */
7029 params: any,
7030 /**
7031 * Unique identifier of attached debugging session, will match the value sent from
7032 * `debugger.sendCommand`.
7033 */
7034 sessionId: string) => void): this;
7035 removeListener(event: 'message', listener: (event: Event,
7036 /**
7037 * Method name.
7038 */
7039 method: string,
7040 /**
7041 * Event parameters defined by the 'parameters' attribute in the remote debugging
7042 * protocol.
7043 */
7044 params: any,
7045 /**
7046 * Unique identifier of attached debugging session, will match the value sent from
7047 * `debugger.sendCommand`.
7048 */
7049 sessionId: string) => void): this;
7050 /**
7051 * Attaches the debugger to the `webContents`.
7052 */
7053 attach(protocolVersion?: string): void;
7054 /**
7055 * Detaches the debugger from the `webContents`.
7056 */
7057 detach(): void;
7058 /**
7059 * Whether a debugger is attached to the `webContents`.
7060 */
7061 isAttached(): boolean;
7062 /**
7063 * A promise that resolves with the response defined by the 'returns' attribute of
7064 * the command description in the remote debugging protocol or is rejected
7065 * indicating the failure of the command.
7066 *
7067 * Send given command to the debugging target.
7068 */
7069 sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
7070 }
7071
7072 interface DesktopCapturer {
7073
7074 // Docs: https://electronjs.org/docs/api/desktop-capturer
7075
7076 /**
7077 * Resolves with an array of `DesktopCapturerSource` objects, each
7078 * `DesktopCapturerSource` represents a screen or an individual window that can be
7079 * captured.
7080 *
7081 * **Note** Capturing the screen contents requires user consent on macOS 10.15
7082 * Catalina or higher, which can detected by
7083 * `systemPreferences.getMediaAccessStatus`.
7084 */
7085 getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
7086 }
7087
7088 interface DesktopCapturerSource {
7089
7090 // Docs: https://electronjs.org/docs/api/structures/desktop-capturer-source
7091
7092 /**
7093 * An icon image of the application that owns the window or null if the source has
7094 * a type screen. The size of the icon is not known in advance and depends on what
7095 * the application provides.
7096 */
7097 appIcon: NativeImage;
7098 /**
7099 * A unique identifier that will correspond to the `id` of the matching Display
7100 * returned by the Screen API. On some platforms, this is equivalent to the `XX`
7101 * portion of the `id` field above and on others it will differ. It will be an
7102 * empty string if not available.
7103 */
7104 display_id: string;
7105 /**
7106 * The identifier of a window or screen that can be used as a `chromeMediaSourceId`
7107 * constraint when calling `navigator.getUserMedia`. The format of the identifier
7108 * will be `window:XX:YY` or `screen:ZZ:0`. XX is the windowID/handle. YY is 1 for
7109 * the current process, and 0 for all others. ZZ is a sequential number that
7110 * represents the screen, and it does not equal to the index in the source's name.
7111 */
7112 id: string;
7113 /**
7114 * A screen source will be named either `Entire Screen` or `Screen <index>`, while
7115 * the name of a window source will match the window title.
7116 */
7117 name: string;
7118 /**
7119 * A thumbnail image. **Note:** There is no guarantee that the size of the
7120 * thumbnail is the same as the `thumbnailSize` specified in the `options` passed
7121 * to `desktopCapturer.getSources`. The actual size depends on the scale of the
7122 * screen or window.
7123 */
7124 thumbnail: NativeImage;
7125 }
7126
7127 interface Dialog {
7128
7129 // Docs: https://electronjs.org/docs/api/dialog
7130
7131 /**
7132 * resolves when the certificate trust dialog is shown.
7133 *
7134 * On macOS, this displays a modal dialog that shows a message and certificate
7135 * information, and gives the user the option of trusting/importing the
7136 * certificate. If you provide a `browserWindow` argument the dialog will be
7137 * attached to the parent window, making it modal.
7138 *
7139 * On Windows the options are more limited, due to the Win32 APIs used:
7140 *
7141 * * The `message` argument is not used, as the OS provides its own confirmation
7142 * dialog.
7143 * * The `browserWindow` argument is ignored since it is not possible to make this
7144 * confirmation dialog modal.
7145 *
7146 * @platform darwin,win32
7147 */
7148 showCertificateTrustDialog(browserWindow: BrowserWindow, options: CertificateTrustDialogOptions): Promise<void>;
7149 /**
7150 * resolves when the certificate trust dialog is shown.
7151 *
7152 * On macOS, this displays a modal dialog that shows a message and certificate
7153 * information, and gives the user the option of trusting/importing the
7154 * certificate. If you provide a `browserWindow` argument the dialog will be
7155 * attached to the parent window, making it modal.
7156 *
7157 * On Windows the options are more limited, due to the Win32 APIs used:
7158 *
7159 * * The `message` argument is not used, as the OS provides its own confirmation
7160 * dialog.
7161 * * The `browserWindow` argument is ignored since it is not possible to make this
7162 * confirmation dialog modal.
7163 *
7164 * @platform darwin,win32
7165 */
7166 showCertificateTrustDialog(options: CertificateTrustDialogOptions): Promise<void>;
7167 /**
7168 * Displays a modal dialog that shows an error message.
7169 *
7170 * This API can be called safely before the `ready` event the `app` module emits,
7171 * it is usually used to report errors in early stage of startup. If called before
7172 * the app `ready`event on Linux, the message will be emitted to stderr, and no GUI
7173 * dialog will appear.
7174 */
7175 showErrorBox(title: string, content: string): void;
7176 /**
7177 * resolves with a promise containing the following properties:
7178 *
7179 * * `response` number - The index of the clicked button.
7180 * * `checkboxChecked` boolean - The checked state of the checkbox if
7181 * `checkboxLabel` was set. Otherwise `false`.
7182 *
7183 * Shows a message box.
7184 *
7185 * The `browserWindow` argument allows the dialog to attach itself to a parent
7186 * window, making it modal.
7187 */
7188 showMessageBox(browserWindow: BrowserWindow, options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
7189 /**
7190 * resolves with a promise containing the following properties:
7191 *
7192 * * `response` number - The index of the clicked button.
7193 * * `checkboxChecked` boolean - The checked state of the checkbox if
7194 * `checkboxLabel` was set. Otherwise `false`.
7195 *
7196 * Shows a message box.
7197 *
7198 * The `browserWindow` argument allows the dialog to attach itself to a parent
7199 * window, making it modal.
7200 */
7201 showMessageBox(options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
7202 /**
7203 * the index of the clicked button.
7204 *
7205 * Shows a message box, it will block the process until the message box is closed.
7206 * It returns the index of the clicked button.
7207 *
7208 * The `browserWindow` argument allows the dialog to attach itself to a parent
7209 * window, making it modal. If `browserWindow` is not shown dialog will not be
7210 * attached to it. In such case it will be displayed as an independent window.
7211 */
7212 showMessageBoxSync(browserWindow: BrowserWindow, options: MessageBoxSyncOptions): number;
7213 /**
7214 * the index of the clicked button.
7215 *
7216 * Shows a message box, it will block the process until the message box is closed.
7217 * It returns the index of the clicked button.
7218 *
7219 * The `browserWindow` argument allows the dialog to attach itself to a parent
7220 * window, making it modal. If `browserWindow` is not shown dialog will not be
7221 * attached to it. In such case it will be displayed as an independent window.
7222 */
7223 showMessageBoxSync(options: MessageBoxSyncOptions): number;
7224 /**
7225 * Resolve with an object containing the following:
7226 *
7227 * * `canceled` boolean - whether or not the dialog was canceled.
7228 * * `filePaths` string[] - An array of file paths chosen by the user. If the
7229 * dialog is cancelled this will be an empty array.
7230 * * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
7231 * `filePaths` array of base64 encoded strings which contains security scoped
7232 * bookmark data. `securityScopedBookmarks` must be enabled for this to be
7233 * populated. (For return values, see table here.)
7234 *
7235 * The `browserWindow` argument allows the dialog to attach itself to a parent
7236 * window, making it modal.
7237 *
7238 * The `filters` specifies an array of file types that can be displayed or selected
7239 * when you want to limit the user to a specific type. For example:
7240 *
7241 * The `extensions` array should contain extensions without wildcards or dots (e.g.
7242 * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
7243 * `'*'` wildcard (no other wildcard is supported).
7244 *
7245 * **Note:** On Windows and Linux an open dialog can not be both a file selector
7246 * and a directory selector, so if you set `properties` to `['openFile',
7247 * 'openDirectory']` on these platforms, a directory selector will be shown.
7248 */
7249 showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
7250 /**
7251 * Resolve with an object containing the following:
7252 *
7253 * * `canceled` boolean - whether or not the dialog was canceled.
7254 * * `filePaths` string[] - An array of file paths chosen by the user. If the
7255 * dialog is cancelled this will be an empty array.
7256 * * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
7257 * `filePaths` array of base64 encoded strings which contains security scoped
7258 * bookmark data. `securityScopedBookmarks` must be enabled for this to be
7259 * populated. (For return values, see table here.)
7260 *
7261 * The `browserWindow` argument allows the dialog to attach itself to a parent
7262 * window, making it modal.
7263 *
7264 * The `filters` specifies an array of file types that can be displayed or selected
7265 * when you want to limit the user to a specific type. For example:
7266 *
7267 * The `extensions` array should contain extensions without wildcards or dots (e.g.
7268 * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
7269 * `'*'` wildcard (no other wildcard is supported).
7270 *
7271 * **Note:** On Windows and Linux an open dialog can not be both a file selector
7272 * and a directory selector, so if you set `properties` to `['openFile',
7273 * 'openDirectory']` on these platforms, a directory selector will be shown.
7274 */
7275 showOpenDialog(options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
7276 /**
7277 * the file paths chosen by the user; if the dialog is cancelled it returns
7278 * `undefined`.
7279 *
7280 * The `browserWindow` argument allows the dialog to attach itself to a parent
7281 * window, making it modal.
7282 *
7283 * The `filters` specifies an array of file types that can be displayed or selected
7284 * when you want to limit the user to a specific type. For example:
7285 *
7286 * The `extensions` array should contain extensions without wildcards or dots (e.g.
7287 * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
7288 * `'*'` wildcard (no other wildcard is supported).
7289 *
7290 * **Note:** On Windows and Linux an open dialog can not be both a file selector
7291 * and a directory selector, so if you set `properties` to `['openFile',
7292 * 'openDirectory']` on these platforms, a directory selector will be shown.
7293 */
7294 showOpenDialogSync(browserWindow: BrowserWindow, options: OpenDialogSyncOptions): (string[]) | (undefined);
7295 /**
7296 * the file paths chosen by the user; if the dialog is cancelled it returns
7297 * `undefined`.
7298 *
7299 * The `browserWindow` argument allows the dialog to attach itself to a parent
7300 * window, making it modal.
7301 *
7302 * The `filters` specifies an array of file types that can be displayed or selected
7303 * when you want to limit the user to a specific type. For example:
7304 *
7305 * The `extensions` array should contain extensions without wildcards or dots (e.g.
7306 * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
7307 * `'*'` wildcard (no other wildcard is supported).
7308 *
7309 * **Note:** On Windows and Linux an open dialog can not be both a file selector
7310 * and a directory selector, so if you set `properties` to `['openFile',
7311 * 'openDirectory']` on these platforms, a directory selector will be shown.
7312 */
7313 showOpenDialogSync(options: OpenDialogSyncOptions): (string[]) | (undefined);
7314 /**
7315 * Resolve with an object containing the following:
7316 *
7317 * * `canceled` boolean - whether or not the dialog was canceled.
7318 * * `filePath` string (optional) - If the dialog is canceled, this will be
7319 * `undefined`.
7320 * * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
7321 * contains the security scoped bookmark data for the saved file.
7322 * `securityScopedBookmarks` must be enabled for this to be present. (For return
7323 * values, see table here.)
7324 *
7325 * The `browserWindow` argument allows the dialog to attach itself to a parent
7326 * window, making it modal.
7327 *
7328 * The `filters` specifies an array of file types that can be displayed, see
7329 * `dialog.showOpenDialog` for an example.
7330 *
7331 * **Note:** On macOS, using the asynchronous version is recommended to avoid
7332 * issues when expanding and collapsing the dialog.
7333 */
7334 showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
7335 /**
7336 * Resolve with an object containing the following:
7337 *
7338 * * `canceled` boolean - whether or not the dialog was canceled.
7339 * * `filePath` string (optional) - If the dialog is canceled, this will be
7340 * `undefined`.
7341 * * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
7342 * contains the security scoped bookmark data for the saved file.
7343 * `securityScopedBookmarks` must be enabled for this to be present. (For return
7344 * values, see table here.)
7345 *
7346 * The `browserWindow` argument allows the dialog to attach itself to a parent
7347 * window, making it modal.
7348 *
7349 * The `filters` specifies an array of file types that can be displayed, see
7350 * `dialog.showOpenDialog` for an example.
7351 *
7352 * **Note:** On macOS, using the asynchronous version is recommended to avoid
7353 * issues when expanding and collapsing the dialog.
7354 */
7355 showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
7356 /**
7357 * the path of the file chosen by the user; if the dialog is cancelled it returns
7358 * `undefined`.
7359 *
7360 * The `browserWindow` argument allows the dialog to attach itself to a parent
7361 * window, making it modal.
7362 *
7363 * The `filters` specifies an array of file types that can be displayed, see
7364 * `dialog.showOpenDialog` for an example.
7365 */
7366 showSaveDialogSync(browserWindow: BrowserWindow, options: SaveDialogSyncOptions): (string) | (undefined);
7367 /**
7368 * the path of the file chosen by the user; if the dialog is cancelled it returns
7369 * `undefined`.
7370 *
7371 * The `browserWindow` argument allows the dialog to attach itself to a parent
7372 * window, making it modal.
7373 *
7374 * The `filters` specifies an array of file types that can be displayed, see
7375 * `dialog.showOpenDialog` for an example.
7376 */
7377 showSaveDialogSync(options: SaveDialogSyncOptions): (string) | (undefined);
7378 }
7379
7380 interface Display {
7381
7382 // Docs: https://electronjs.org/docs/api/structures/display
7383
7384 /**
7385 * Can be `available`, `unavailable`, `unknown`.
7386 */
7387 accelerometerSupport: ('available' | 'unavailable' | 'unknown');
7388 /**
7389 * the bounds of the display in DIP points.
7390 */
7391 bounds: Rectangle;
7392 /**
7393 * The number of bits per pixel.
7394 */
7395 colorDepth: number;
7396 /**
7397 * represent a color space (three-dimensional object which contains all realizable
7398 * color combinations) for the purpose of color conversions.
7399 */
7400 colorSpace: string;
7401 /**
7402 * The number of bits per color component.
7403 */
7404 depthPerComponent: number;
7405 /**
7406 * `true`` if the display is detected by the system.
7407 */
7408 detected: boolean;
7409 /**
7410 * The display refresh rate.
7411 */
7412 displayFrequency: number;
7413 /**
7414 * Unique identifier associated with the display. A value of of -1 means the
7415 * display is invalid or the correct `id` is not yet known, and a value of -10
7416 * means the display is a virtual display assigned to a unified desktop.
7417 */
7418 id: number;
7419 /**
7420 * `true` for an internal display and `false` for an external display.
7421 */
7422 internal: boolean;
7423 /**
7424 * User-friendly label, determined by the platform.
7425 */
7426 label: string;
7427 /**
7428 * Maximum cursor size in native pixels.
7429 */
7430 maximumCursorSize: Size;
7431 /**
7432 * Whether or not the display is a monochrome display.
7433 */
7434 monochrome: boolean;
7435 /**
7436 * Returns the display's origin in pixel coordinates. Only available on windowing
7437 * systems like X11 that position displays in pixel coordinates.
7438 */
7439 nativeOrigin: Point;
7440 /**
7441 * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees.
7442 */
7443 rotation: number;
7444 /**
7445 * Output device's pixel scale factor.
7446 */
7447 scaleFactor: number;
7448 size: Size;
7449 /**
7450 * Can be `available`, `unavailable`, `unknown`.
7451 */
7452 touchSupport: ('available' | 'unavailable' | 'unknown');
7453 /**
7454 * the work area of the display in DIP points.
7455 */
7456 workArea: Rectangle;
7457 /**
7458 * The size of the work area.
7459 */
7460 workAreaSize: Size;
7461 }
7462
7463 class Dock {
7464
7465 // Docs: https://electronjs.org/docs/api/dock
7466
7467 /**
7468 * an ID representing the request.
7469 *
7470 * When `critical` is passed, the dock icon will bounce until either the
7471 * application becomes active or the request is canceled.
7472 *
7473 * When `informational` is passed, the dock icon will bounce for one second.
7474 * However, the request remains active until either the application becomes active
7475 * or the request is canceled.
7476 *
7477 * **Note:** This method can only be used while the app is not focused; when the
7478 * app is focused it will return -1.
7479 *
7480 * @platform darwin
7481 */
7482 bounce(type?: 'critical' | 'informational'): number;
7483 /**
7484 * Cancel the bounce of `id`.
7485 *
7486 * @platform darwin
7487 */
7488 cancelBounce(id: number): void;
7489 /**
7490 * Bounces the Downloads stack if the filePath is inside the Downloads folder.
7491 *
7492 * @platform darwin
7493 */
7494 downloadFinished(filePath: string): void;
7495 /**
7496 * The badge string of the dock.
7497 *
7498 * @platform darwin
7499 */
7500 getBadge(): string;
7501 /**
7502 * The application's dock menu.
7503 *
7504 * @platform darwin
7505 */
7506 getMenu(): (Menu) | (null);
7507 /**
7508 * Hides the dock icon.
7509 *
7510 * @platform darwin
7511 */
7512 hide(): void;
7513 /**
7514 * Whether the dock icon is visible.
7515 *
7516 * @platform darwin
7517 */
7518 isVisible(): boolean;
7519 /**
7520 * Sets the string to be displayed in the dock’s badging area.
7521 *
7522 * @platform darwin
7523 */
7524 setBadge(text: string): void;
7525 /**
7526 * Sets the `image` associated with this dock icon.
7527 *
7528 * @platform darwin
7529 */
7530 setIcon(image: (NativeImage) | (string)): void;
7531 /**
7532 * Sets the application's dock menu.
7533 *
7534 * @platform darwin
7535 */
7536 setMenu(menu: Menu): void;
7537 /**
7538 * Resolves when the dock icon is shown.
7539 *
7540 * @platform darwin
7541 */
7542 show(): Promise<void>;
7543 }
7544
7545 class DownloadItem extends NodeEventEmitter {
7546
7547 // Docs: https://electronjs.org/docs/api/download-item
7548
7549 /**
7550 * Emitted when the download is in a terminal state. This includes a completed
7551 * download, a cancelled download (via `downloadItem.cancel()`), and interrupted
7552 * download that can't be resumed.
7553 *
7554 * The `state` can be one of following:
7555 *
7556 * * `completed` - The download completed successfully.
7557 * * `cancelled` - The download has been cancelled.
7558 * * `interrupted` - The download has interrupted and can not resume.
7559 */
7560 on(event: 'done', listener: (event: Event,
7561 /**
7562 * Can be `completed`, `cancelled` or `interrupted`.
7563 */
7564 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
7565 off(event: 'done', listener: (event: Event,
7566 /**
7567 * Can be `completed`, `cancelled` or `interrupted`.
7568 */
7569 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
7570 once(event: 'done', listener: (event: Event,
7571 /**
7572 * Can be `completed`, `cancelled` or `interrupted`.
7573 */
7574 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
7575 addListener(event: 'done', listener: (event: Event,
7576 /**
7577 * Can be `completed`, `cancelled` or `interrupted`.
7578 */
7579 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
7580 removeListener(event: 'done', listener: (event: Event,
7581 /**
7582 * Can be `completed`, `cancelled` or `interrupted`.
7583 */
7584 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
7585 /**
7586 * Emitted when the download has been updated and is not done.
7587 *
7588 * The `state` can be one of following:
7589 *
7590 * * `progressing` - The download is in-progress.
7591 * * `interrupted` - The download has interrupted and can be resumed.
7592 */
7593 on(event: 'updated', listener: (event: Event,
7594 /**
7595 * Can be `progressing` or `interrupted`.
7596 */
7597 state: ('progressing' | 'interrupted')) => void): this;
7598 off(event: 'updated', listener: (event: Event,
7599 /**
7600 * Can be `progressing` or `interrupted`.
7601 */
7602 state: ('progressing' | 'interrupted')) => void): this;
7603 once(event: 'updated', listener: (event: Event,
7604 /**
7605 * Can be `progressing` or `interrupted`.
7606 */
7607 state: ('progressing' | 'interrupted')) => void): this;
7608 addListener(event: 'updated', listener: (event: Event,
7609 /**
7610 * Can be `progressing` or `interrupted`.
7611 */
7612 state: ('progressing' | 'interrupted')) => void): this;
7613 removeListener(event: 'updated', listener: (event: Event,
7614 /**
7615 * Can be `progressing` or `interrupted`.
7616 */
7617 state: ('progressing' | 'interrupted')) => void): this;
7618 /**
7619 * Cancels the download operation.
7620 */
7621 cancel(): void;
7622 /**
7623 * Whether the download can resume.
7624 */
7625 canResume(): boolean;
7626 /**
7627 * The Content-Disposition field from the response header.
7628 */
7629 getContentDisposition(): string;
7630 /**
7631 * ETag header value.
7632 */
7633 getETag(): string;
7634 /**
7635 * The file name of the download item.
7636 *
7637 * **Note:** The file name is not always the same as the actual one saved in local
7638 * disk. If user changes the file name in a prompted download saving dialog, the
7639 * actual name of saved file will be different.
7640 */
7641 getFilename(): string;
7642 /**
7643 * Last-Modified header value.
7644 */
7645 getLastModifiedTime(): string;
7646 /**
7647 * The files mime type.
7648 */
7649 getMimeType(): string;
7650 /**
7651 * The received bytes of the download item.
7652 */
7653 getReceivedBytes(): number;
7654 /**
7655 * Returns the object previously set by
7656 * `downloadItem.setSaveDialogOptions(options)`.
7657 */
7658 getSaveDialogOptions(): SaveDialogOptions;
7659 /**
7660 * The save path of the download item. This will be either the path set via
7661 * `downloadItem.setSavePath(path)` or the path selected from the shown save
7662 * dialog.
7663 */
7664 getSavePath(): string;
7665 /**
7666 * Number of seconds since the UNIX epoch when the download was started.
7667 */
7668 getStartTime(): number;
7669 /**
7670 * The current state. Can be `progressing`, `completed`, `cancelled` or
7671 * `interrupted`.
7672 *
7673 * **Note:** The following methods are useful specifically to resume a `cancelled`
7674 * item when session is restarted.
7675 */
7676 getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
7677 /**
7678 * The total size in bytes of the download item.
7679 *
7680 * If the size is unknown, it returns 0.
7681 */
7682 getTotalBytes(): number;
7683 /**
7684 * The origin URL where the item is downloaded from.
7685 */
7686 getURL(): string;
7687 /**
7688 * The complete URL chain of the item including any redirects.
7689 */
7690 getURLChain(): string[];
7691 /**
7692 * Whether the download has user gesture.
7693 */
7694 hasUserGesture(): boolean;
7695 /**
7696 * Whether the download is paused.
7697 */
7698 isPaused(): boolean;
7699 /**
7700 * Pauses the download.
7701 */
7702 pause(): void;
7703 /**
7704 * Resumes the download that has been paused.
7705 *
7706 * **Note:** To enable resumable downloads the server you are downloading from must
7707 * support range requests and provide both `Last-Modified` and `ETag` header
7708 * values. Otherwise `resume()` will dismiss previously received bytes and restart
7709 * the download from the beginning.
7710 */
7711 resume(): void;
7712 /**
7713 * This API allows the user to set custom options for the save dialog that opens
7714 * for the download item by default. The API is only available in session's
7715 * `will-download` callback function.
7716 */
7717 setSaveDialogOptions(options: SaveDialogOptions): void;
7718 /**
7719 * The API is only available in session's `will-download` callback function. If
7720 * `path` doesn't exist, Electron will try to make the directory recursively. If
7721 * user doesn't set the save path via the API, Electron will use the original
7722 * routine to determine the save path; this usually prompts a save dialog.
7723 */
7724 setSavePath(path: string): void;
7725 /**
7726 * A `string` property that determines the save file path of the download item.
7727 *
7728 * The property is only available in session's `will-download` callback function.
7729 * If user doesn't set the save path via the property, Electron will use the
7730 * original routine to determine the save path; this usually prompts a save dialog.
7731 */
7732 savePath: string;
7733 }
7734
7735 interface Extension {
7736
7737 // Docs: https://electronjs.org/docs/api/structures/extension
7738
7739 id: string;
7740 /**
7741 * Copy of the extension's manifest data.
7742 */
7743 manifest: any;
7744 name: string;
7745 /**
7746 * The extension's file path.
7747 */
7748 path: string;
7749 /**
7750 * The extension's `chrome-extension://` URL.
7751 */
7752 url: string;
7753 version: string;
7754 }
7755
7756 interface ExtensionInfo {
7757
7758 // Docs: https://electronjs.org/docs/api/structures/extension-info
7759
7760 name: string;
7761 version: string;
7762 }
7763
7764 interface FileFilter {
7765
7766 // Docs: https://electronjs.org/docs/api/structures/file-filter
7767
7768 extensions: string[];
7769 name: string;
7770 }
7771
7772 interface FilePathWithHeaders {
7773
7774 // Docs: https://electronjs.org/docs/api/structures/file-path-with-headers
7775
7776 /**
7777 * Additional headers to be sent.
7778 */
7779 headers?: Record<string, string>;
7780 /**
7781 * The path to the file to send.
7782 */
7783 path: string;
7784 }
7785
7786 interface FilesystemPermissionRequest extends PermissionRequest {
7787
7788 // Docs: https://electronjs.org/docs/api/structures/filesystem-permission-request
7789
7790 /**
7791 * The access type of the `fileSystem` request. Can be `writable` or `readable`.
7792 */
7793 fileAccessType?: ('writable' | 'readable');
7794 /**
7795 * The path of the `fileSystem` request.
7796 */
7797 filePath?: string;
7798 /**
7799 * Whether the `fileSystem` request is a directory.
7800 */
7801 isDirectory?: boolean;
7802 }
7803
7804 interface GlobalShortcut {
7805
7806 // Docs: https://electronjs.org/docs/api/global-shortcut
7807
7808 /**
7809 * Whether this application has registered `accelerator`.
7810 *
7811 * When the accelerator is already taken by other applications, this call will
7812 * still return `false`. This behavior is intended by operating systems, since they
7813 * don't want applications to fight for global shortcuts.
7814 */
7815 isRegistered(accelerator: Accelerator): boolean;
7816 /**
7817 * Whether or not the shortcut was registered successfully.
7818 *
7819 * Registers a global shortcut of `accelerator`. The `callback` is called when the
7820 * registered shortcut is pressed by the user.
7821 *
7822 * When the accelerator is already taken by other applications, this call will
7823 * silently fail. This behavior is intended by operating systems, since they don't
7824 * want applications to fight for global shortcuts.
7825 *
7826 * The following accelerators will not be registered successfully on macOS 10.14
7827 * Mojave unless the app has been authorized as a trusted accessibility client:
7828 *
7829 * * "Media Play/Pause"
7830 * * "Media Next Track"
7831 * * "Media Previous Track"
7832 * * "Media Stop"
7833 */
7834 register(accelerator: Accelerator, callback: () => void): boolean;
7835 /**
7836 * Registers a global shortcut of all `accelerator` items in `accelerators`. The
7837 * `callback` is called when any of the registered shortcuts are pressed by the
7838 * user.
7839 *
7840 * When a given accelerator is already taken by other applications, this call will
7841 * silently fail. This behavior is intended by operating systems, since they don't
7842 * want applications to fight for global shortcuts.
7843 *
7844 * The following accelerators will not be registered successfully on macOS 10.14
7845 * Mojave unless the app has been authorized as a trusted accessibility client:
7846 *
7847 * * "Media Play/Pause"
7848 * * "Media Next Track"
7849 * * "Media Previous Track"
7850 * * "Media Stop"
7851 */
7852 registerAll(accelerators: Accelerator[], callback: () => void): void;
7853 /**
7854 * Unregisters the global shortcut of `accelerator`.
7855 */
7856 unregister(accelerator: Accelerator): void;
7857 /**
7858 * Unregisters all of the global shortcuts.
7859 */
7860 unregisterAll(): void;
7861 }
7862
7863 interface GPUFeatureStatus {
7864
7865 // Docs: https://electronjs.org/docs/api/structures/gpu-feature-status
7866
7867 /**
7868 * Canvas.
7869 */
7870 '2d_canvas': string;
7871 /**
7872 * Flash.
7873 */
7874 flash_3d: string;
7875 /**
7876 * Flash Stage3D.
7877 */
7878 flash_stage3d: string;
7879 /**
7880 * Flash Stage3D Baseline profile.
7881 */
7882 flash_stage3d_baseline: string;
7883 /**
7884 * Compositing.
7885 */
7886 gpu_compositing: string;
7887 /**
7888 * Multiple Raster Threads.
7889 */
7890 multiple_raster_threads: string;
7891 /**
7892 * Native GpuMemoryBuffers.
7893 */
7894 native_gpu_memory_buffers: string;
7895 /**
7896 * Rasterization.
7897 */
7898 rasterization: string;
7899 /**
7900 * Video Decode.
7901 */
7902 video_decode: string;
7903 /**
7904 * Video Encode.
7905 */
7906 video_encode: string;
7907 /**
7908 * VPx Video Decode.
7909 */
7910 vpx_decode: string;
7911 /**
7912 * WebGL.
7913 */
7914 webgl: string;
7915 /**
7916 * WebGL2.
7917 */
7918 webgl2: string;
7919 }
7920
7921 interface HIDDevice {
7922
7923 // Docs: https://electronjs.org/docs/api/structures/hid-device
7924
7925 /**
7926 * Unique identifier for the device.
7927 */
7928 deviceId: string;
7929 /**
7930 * Unique identifier for the HID interface. A device may have multiple HID
7931 * interfaces.
7932 */
7933 guid?: string;
7934 /**
7935 * Name of the device.
7936 */
7937 name: string;
7938 /**
7939 * The USB product ID.
7940 */
7941 productId: number;
7942 /**
7943 * The USB device serial number.
7944 */
7945 serialNumber?: string;
7946 /**
7947 * The USB vendor ID.
7948 */
7949 vendorId: number;
7950 }
7951
7952 interface InAppPurchase extends NodeJS.EventEmitter {
7953
7954 // Docs: https://electronjs.org/docs/api/in-app-purchase
7955
7956 on(event: 'transactions-updated', listener: Function): this;
7957 off(event: 'transactions-updated', listener: Function): this;
7958 once(event: 'transactions-updated', listener: Function): this;
7959 addListener(event: 'transactions-updated', listener: Function): this;
7960 removeListener(event: 'transactions-updated', listener: Function): this;
7961 /**
7962 * whether a user can make a payment.
7963 */
7964 canMakePayments(): boolean;
7965 /**
7966 * Completes all pending transactions.
7967 */
7968 finishAllTransactions(): void;
7969 /**
7970 * Completes the pending transactions corresponding to the date.
7971 */
7972 finishTransactionByDate(date: string): void;
7973 /**
7974 * Resolves with an array of `Product` objects.
7975 *
7976 * Retrieves the product descriptions.
7977 */
7978 getProducts(productIDs: string[]): Promise<Electron.Product[]>;
7979 /**
7980 * the path to the receipt.
7981 */
7982 getReceiptURL(): string;
7983 /**
7984 * Returns `true` if the product is valid and added to the payment queue.
7985 *
7986 * You should listen for the `transactions-updated` event as soon as possible and
7987 * certainly before you call `purchaseProduct`.
7988 */
7989 purchaseProduct(productID: string, opts?: (number) | (PurchaseProductOpts)): Promise<boolean>;
7990 /**
7991 * Restores finished transactions. This method can be called either to install
7992 * purchases on additional devices, or to restore purchases for an application that
7993 * the user deleted and reinstalled.
7994 *
7995 * The payment queue delivers a new transaction for each previously completed
7996 * transaction that can be restored. Each transaction includes a copy of the
7997 * original transaction.
7998 */
7999 restoreCompletedTransactions(): void;
8000 }
8001
8002 class IncomingMessage extends NodeEventEmitter {
8003
8004 // Docs: https://electronjs.org/docs/api/incoming-message
8005
8006 /**
8007 * Emitted when a request has been canceled during an ongoing HTTP transaction.
8008 */
8009 on(event: 'aborted', listener: Function): this;
8010 off(event: 'aborted', listener: Function): this;
8011 once(event: 'aborted', listener: Function): this;
8012 addListener(event: 'aborted', listener: Function): this;
8013 removeListener(event: 'aborted', listener: Function): this;
8014 /**
8015 * The `data` event is the usual method of transferring response data into
8016 * applicative code.
8017 */
8018 on(event: 'data', listener: (
8019 /**
8020 * A chunk of response body's data.
8021 */
8022 chunk: Buffer) => void): this;
8023 off(event: 'data', listener: (
8024 /**
8025 * A chunk of response body's data.
8026 */
8027 chunk: Buffer) => void): this;
8028 once(event: 'data', listener: (
8029 /**
8030 * A chunk of response body's data.
8031 */
8032 chunk: Buffer) => void): this;
8033 addListener(event: 'data', listener: (
8034 /**
8035 * A chunk of response body's data.
8036 */
8037 chunk: Buffer) => void): this;
8038 removeListener(event: 'data', listener: (
8039 /**
8040 * A chunk of response body's data.
8041 */
8042 chunk: Buffer) => void): this;
8043 /**
8044 * Indicates that response body has ended. Must be placed before 'data' event.
8045 */
8046 on(event: 'end', listener: Function): this;
8047 off(event: 'end', listener: Function): this;
8048 once(event: 'end', listener: Function): this;
8049 addListener(event: 'end', listener: Function): this;
8050 removeListener(event: 'end', listener: Function): this;
8051 /**
8052 * Returns:
8053 *
8054 * `error` Error - Typically holds an error string identifying failure root cause.
8055 *
8056 * Emitted when an error was encountered while streaming response data events. For
8057 * instance, if the server closes the underlying while the response is still
8058 * streaming, an `error` event will be emitted on the response object and a `close`
8059 * event will subsequently follow on the request object.
8060 */
8061 on(event: 'error', listener: Function): this;
8062 off(event: 'error', listener: Function): this;
8063 once(event: 'error', listener: Function): this;
8064 addListener(event: 'error', listener: Function): this;
8065 removeListener(event: 'error', listener: Function): this;
8066 /**
8067 * A `Record<string, string | string[]>` representing the HTTP response headers.
8068 * The `headers` object is formatted as follows:
8069 *
8070 * * All header names are lowercased.
8071 * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,
8072 * `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
8073 * `last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
8074 * `retry-after`, `server`, or `user-agent` are discarded.
8075 * * `set-cookie` is always an array. Duplicates are added to the array.
8076 * * For duplicate `cookie` headers, the values are joined together with '; '.
8077 * * For all other headers, the values are joined together with ', '.
8078 */
8079 headers: Record<string, (string) | (string[])>;
8080 /**
8081 * A `string` indicating the HTTP protocol version number. Typical values are '1.0'
8082 * or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two
8083 * Integer-valued readable properties that return respectively the HTTP major and
8084 * minor version numbers.
8085 */
8086 httpVersion: string;
8087 /**
8088 * An `Integer` indicating the HTTP protocol major version number.
8089 */
8090 httpVersionMajor: number;
8091 /**
8092 * An `Integer` indicating the HTTP protocol minor version number.
8093 */
8094 httpVersionMinor: number;
8095 /**
8096 * A `string[]` containing the raw HTTP response headers exactly as they were
8097 * received. The keys and values are in the same list. It is not a list of tuples.
8098 * So, the even-numbered offsets are key values, and the odd-numbered offsets are
8099 * the associated values. Header names are not lowercased, and duplicates are not
8100 * merged.
8101 */
8102 rawHeaders: string[];
8103 /**
8104 * An `Integer` indicating the HTTP response status code.
8105 */
8106 statusCode: number;
8107 /**
8108 * A `string` representing the HTTP status message.
8109 */
8110 statusMessage: string;
8111 }
8112
8113 interface InputEvent {
8114
8115 // Docs: https://electronjs.org/docs/api/structures/input-event
8116
8117 /**
8118 * An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`,
8119 * `meta`, `command`, `cmd`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`,
8120 * `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`.
8121 */
8122 modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>;
8123 /**
8124 * Can be `undefined`, `mouseDown`, `mouseUp`, `mouseMove`, `mouseEnter`,
8125 * `mouseLeave`, `contextMenu`, `mouseWheel`, `rawKeyDown`, `keyDown`, `keyUp`,
8126 * `char`, `gestureScrollBegin`, `gestureScrollEnd`, `gestureScrollUpdate`,
8127 * `gestureFlingStart`, `gestureFlingCancel`, `gesturePinchBegin`,
8128 * `gesturePinchEnd`, `gesturePinchUpdate`, `gestureTapDown`, `gestureShowPress`,
8129 * `gestureTap`, `gestureTapCancel`, `gestureShortPress`, `gestureLongPress`,
8130 * `gestureLongTap`, `gestureTwoFingerTap`, `gestureTapUnconfirmed`,
8131 * `gestureDoubleTap`, `touchStart`, `touchMove`, `touchEnd`, `touchCancel`,
8132 * `touchScrollStarted`, `pointerDown`, `pointerUp`, `pointerMove`,
8133 * `pointerRawUpdate`, `pointerCancel` or `pointerCausedUaAction`.
8134 */
8135 type: ('undefined' | 'mouseDown' | 'mouseUp' | 'mouseMove' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'rawKeyDown' | 'keyDown' | 'keyUp' | 'char' | 'gestureScrollBegin' | 'gestureScrollEnd' | 'gestureScrollUpdate' | 'gestureFlingStart' | 'gestureFlingCancel' | 'gesturePinchBegin' | 'gesturePinchEnd' | 'gesturePinchUpdate' | 'gestureTapDown' | 'gestureShowPress' | 'gestureTap' | 'gestureTapCancel' | 'gestureShortPress' | 'gestureLongPress' | 'gestureLongTap' | 'gestureTwoFingerTap' | 'gestureTapUnconfirmed' | 'gestureDoubleTap' | 'touchStart' | 'touchMove' | 'touchEnd' | 'touchCancel' | 'touchScrollStarted' | 'pointerDown' | 'pointerUp' | 'pointerMove' | 'pointerRawUpdate' | 'pointerCancel' | 'pointerCausedUaAction');
8136 }
8137
8138 interface IpcMain extends NodeJS.EventEmitter {
8139
8140 // Docs: https://electronjs.org/docs/api/ipc-main
8141
8142 /**
8143 * Adds a handler for an `invoke`able IPC. This handler will be called whenever a
8144 * renderer calls `ipcRenderer.invoke(channel, ...args)`.
8145 *
8146 * If `listener` returns a Promise, the eventual result of the promise will be
8147 * returned as a reply to the remote caller. Otherwise, the return value of the
8148 * listener will be used as the value of the reply.
8149 *
8150 * The `event` that is passed as the first argument to the handler is the same as
8151 * that passed to a regular event listener. It includes information about which
8152 * WebContents is the source of the invoke request.
8153 *
8154 * Errors thrown through `handle` in the main process are not transparent as they
8155 * are serialized and only the `message` property from the original error is
8156 * provided to the renderer process. Please refer to #24427 for details.
8157 */
8158 handle(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
8159 /**
8160 * Handles a single `invoke`able IPC message, then removes the listener. See
8161 * `ipcMain.handle(channel, listener)`.
8162 */
8163 handleOnce(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
8164 /**
8165 * Listens to `channel`, when a new message arrives `listener` would be called with
8166 * `listener(event, args...)`.
8167 */
8168 on(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
8169 /**
8170 * Adds a one time `listener` function for the event. This `listener` is invoked
8171 * only the next time a message is sent to `channel`, after which it is removed.
8172 */
8173 once(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
8174 /**
8175 * Removes listeners of the specified `channel`.
8176 */
8177 removeAllListeners(channel?: string): this;
8178 /**
8179 * Removes any handler for `channel`, if present.
8180 */
8181 removeHandler(channel: string): void;
8182 /**
8183 * Removes the specified `listener` from the listener array for the specified
8184 * `channel`.
8185 */
8186 removeListener(channel: string, listener: (...args: any[]) => void): this;
8187 }
8188
8189 interface IpcMainEvent extends Event {
8190
8191 // Docs: https://electronjs.org/docs/api/structures/ipc-main-event
8192
8193 /**
8194 * The ID of the renderer frame that sent this message
8195 */
8196 frameId: number;
8197 /**
8198 * A list of MessagePorts that were transferred with this message
8199 */
8200 ports: MessagePortMain[];
8201 /**
8202 * The internal ID of the renderer process that sent this message
8203 */
8204 processId: number;
8205 /**
8206 * A function that will send an IPC message to the renderer frame that sent the
8207 * original message that you are currently handling. You should use this method to
8208 * "reply" to the sent message in order to guarantee the reply will go to the
8209 * correct process and frame.
8210 */
8211 reply: (channel: string, ...args: any[]) => void;
8212 /**
8213 * Set this to the value to be returned in a synchronous message
8214 */
8215 returnValue: any;
8216 /**
8217 * Returns the `webContents` that sent the message
8218 */
8219 sender: WebContents;
8220 /**
8221 * The frame that sent this message
8222 *
8223 */
8224 readonly senderFrame: WebFrameMain;
8225 }
8226
8227 interface IpcMainInvokeEvent extends Event {
8228
8229 // Docs: https://electronjs.org/docs/api/structures/ipc-main-invoke-event
8230
8231 /**
8232 * The ID of the renderer frame that sent this message
8233 */
8234 frameId: number;
8235 /**
8236 * The internal ID of the renderer process that sent this message
8237 */
8238 processId: number;
8239 /**
8240 * Returns the `webContents` that sent the message
8241 */
8242 sender: WebContents;
8243 /**
8244 * The frame that sent this message
8245 *
8246 */
8247 readonly senderFrame: WebFrameMain;
8248 }
8249
8250 interface IpcRenderer extends NodeJS.EventEmitter {
8251
8252 // Docs: https://electronjs.org/docs/api/ipc-renderer
8253
8254 /**
8255 * Alias for `ipcRenderer.on`.
8256 */
8257 addListener(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
8258 /**
8259 * Resolves with the response from the main process.
8260 *
8261 * Send a message to the main process via `channel` and expect a result
8262 * asynchronously. Arguments will be serialized with the Structured Clone
8263 * Algorithm, just like `window.postMessage`, so prototype chains will not be
8264 * included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw
8265 * an exception.
8266 *
8267 * The main process should listen for `channel` with `ipcMain.handle()`.
8268 *
8269 * For example:
8270 *
8271 * If you need to transfer a `MessagePort` to the main process, use
8272 * `ipcRenderer.postMessage`.
8273 *
8274 * If you do not need a response to the message, consider using `ipcRenderer.send`.
8275 *
8276 * > **Note** Sending non-standard JavaScript types such as DOM objects or special
8277 * Electron objects will throw an exception.
8278 *
8279 * Since the main process does not have support for DOM objects such as
8280 * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
8281 * Electron's IPC to the main process, as the main process would have no way to
8282 * decode them. Attempting to send such objects over IPC will result in an error.
8283 *
8284 * > **Note** If the handler in the main process throws an error, the promise
8285 * returned by `invoke` will reject. However, the `Error` object in the renderer
8286 * process will not be the same as the one thrown in the main process.
8287 */
8288 invoke(channel: string, ...args: any[]): Promise<any>;
8289 /**
8290 * Alias for `ipcRenderer.removeListener`.
8291 */
8292 off(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
8293 /**
8294 * Listens to `channel`, when a new message arrives `listener` would be called with
8295 * `listener(event, args...)`.
8296 */
8297 on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
8298 /**
8299 * Adds a one time `listener` function for the event. This `listener` is invoked
8300 * only the next time a message is sent to `channel`, after which it is removed.
8301 */
8302 once(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
8303 /**
8304 * Send a message to the main process, optionally transferring ownership of zero or
8305 * more `MessagePort` objects.
8306 *
8307 * The transferred `MessagePort` objects will be available in the main process as
8308 * `MessagePortMain` objects by accessing the `ports` property of the emitted
8309 * event.
8310 *
8311 * For example:
8312 *
8313 * For more information on using `MessagePort` and `MessageChannel`, see the MDN
8314 * documentation.
8315 */
8316 postMessage(channel: string, message: any, transfer?: MessagePort[]): void;
8317 /**
8318 * Removes all listeners, or those of the specified `channel`.
8319 */
8320 removeAllListeners(channel: string): this;
8321 /**
8322 * Removes the specified `listener` from the listener array for the specified
8323 * `channel`.
8324 */
8325 removeListener(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
8326 /**
8327 * Send an asynchronous message to the main process via `channel`, along with
8328 * arguments. Arguments will be serialized with the Structured Clone Algorithm,
8329 * just like `window.postMessage`, so prototype chains will not be included.
8330 * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
8331 * exception.
8332 *
8333 * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
8334 * Electron objects will throw an exception.
8335 *
8336 * Since the main process does not have support for DOM objects such as
8337 * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
8338 * Electron's IPC to the main process, as the main process would have no way to
8339 * decode them. Attempting to send such objects over IPC will result in an error.
8340 *
8341 * The main process handles it by listening for `channel` with the `ipcMain`
8342 * module.
8343 *
8344 * If you need to transfer a `MessagePort` to the main process, use
8345 * `ipcRenderer.postMessage`.
8346 *
8347 * If you want to receive a single response from the main process, like the result
8348 * of a method call, consider using `ipcRenderer.invoke`.
8349 */
8350 send(channel: string, ...args: any[]): void;
8351 /**
8352 * The value sent back by the `ipcMain` handler.
8353 *
8354 * Send a message to the main process via `channel` and expect a result
8355 * synchronously. Arguments will be serialized with the Structured Clone Algorithm,
8356 * just like `window.postMessage`, so prototype chains will not be included.
8357 * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
8358 * exception.
8359 *
8360 * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
8361 * Electron objects will throw an exception.
8362 *
8363 * Since the main process does not have support for DOM objects such as
8364 * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
8365 * Electron's IPC to the main process, as the main process would have no way to
8366 * decode them. Attempting to send such objects over IPC will result in an error.
8367 *
8368 * The main process handles it by listening for `channel` with `ipcMain` module,
8369 * and replies by setting `event.returnValue`.
8370 *
8371 * > :warning: **WARNING**: Sending a synchronous message will block the whole
8372 * renderer process until the reply is received, so use this method only as a last
8373 * resort. It's much better to use the asynchronous version, `invoke()`.
8374 */
8375 sendSync(channel: string, ...args: any[]): any;
8376 /**
8377 * Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
8378 * the host page instead of the main process.
8379 */
8380 sendToHost(channel: string, ...args: any[]): void;
8381 }
8382
8383 interface IpcRendererEvent extends Event {
8384
8385 // Docs: https://electronjs.org/docs/api/structures/ipc-renderer-event
8386
8387 /**
8388 * A list of MessagePorts that were transferred with this message
8389 */
8390 ports: MessagePort[];
8391 /**
8392 * The `IpcRenderer` instance that emitted the event originally
8393 */
8394 sender: IpcRenderer;
8395 }
8396
8397 interface JumpListCategory {
8398
8399 // Docs: https://electronjs.org/docs/api/structures/jump-list-category
8400
8401 /**
8402 * Array of `JumpListItem` objects if `type` is `tasks` or `custom`, otherwise it
8403 * should be omitted.
8404 */
8405 items?: JumpListItem[];
8406 /**
8407 * Must be set if `type` is `custom`, otherwise it should be omitted.
8408 */
8409 name?: string;
8410 /**
8411 * One of the following:
8412 */
8413 type?: ('tasks' | 'frequent' | 'recent' | 'custom');
8414 }
8415
8416 interface JumpListItem {
8417
8418 // Docs: https://electronjs.org/docs/api/structures/jump-list-item
8419
8420 /**
8421 * The command line arguments when `program` is executed. Should only be set if
8422 * `type` is `task`.
8423 */
8424 args?: string;
8425 /**
8426 * Description of the task (displayed in a tooltip). Should only be set if `type`
8427 * is `task`. Maximum length 260 characters.
8428 */
8429 description?: string;
8430 /**
8431 * The index of the icon in the resource file. If a resource file contains multiple
8432 * icons this value can be used to specify the zero-based index of the icon that
8433 * should be displayed for this task. If a resource file contains only one icon,
8434 * this property should be set to zero.
8435 */
8436 iconIndex?: number;
8437 /**
8438 * The absolute path to an icon to be displayed in a Jump List, which can be an
8439 * arbitrary resource file that contains an icon (e.g. `.ico`, `.exe`, `.dll`). You
8440 * can usually specify `process.execPath` to show the program icon.
8441 */
8442 iconPath?: string;
8443 /**
8444 * Path of the file to open, should only be set if `type` is `file`.
8445 */
8446 path?: string;
8447 /**
8448 * Path of the program to execute, usually you should specify `process.execPath`
8449 * which opens the current program. Should only be set if `type` is `task`.
8450 */
8451 program?: string;
8452 /**
8453 * The text to be displayed for the item in the Jump List. Should only be set if
8454 * `type` is `task`.
8455 */
8456 title?: string;
8457 /**
8458 * One of the following:
8459 */
8460 type?: ('task' | 'separator' | 'file');
8461 /**
8462 * The working directory. Default is empty.
8463 */
8464 workingDirectory?: string;
8465 }
8466
8467 interface KeyboardEvent {
8468
8469 // Docs: https://electronjs.org/docs/api/structures/keyboard-event
8470
8471 /**
8472 * whether an Alt key was used in an accelerator to trigger the Event
8473 */
8474 altKey?: boolean;
8475 /**
8476 * whether the Control key was used in an accelerator to trigger the Event
8477 */
8478 ctrlKey?: boolean;
8479 /**
8480 * whether a meta key was used in an accelerator to trigger the Event
8481 */
8482 metaKey?: boolean;
8483 /**
8484 * whether a Shift key was used in an accelerator to trigger the Event
8485 */
8486 shiftKey?: boolean;
8487 /**
8488 * whether an accelerator was used to trigger the event as opposed to another user
8489 * gesture like mouse click
8490 */
8491 triggeredByAccelerator?: boolean;
8492 }
8493
8494 interface KeyboardInputEvent extends InputEvent {
8495
8496 // Docs: https://electronjs.org/docs/api/structures/keyboard-input-event
8497
8498 /**
8499 * The character that will be sent as the keyboard event. Should only use the valid
8500 * key codes in Accelerator.
8501 */
8502 keyCode: string;
8503 /**
8504 * The type of the event, can be `rawKeyDown`, `keyDown`, `keyUp` or `char`.
8505 */
8506 type: ('rawKeyDown' | 'keyDown' | 'keyUp' | 'char');
8507 }
8508
8509 interface MediaAccessPermissionRequest extends PermissionRequest {
8510
8511 // Docs: https://electronjs.org/docs/api/structures/media-access-permission-request
8512
8513 /**
8514 * The types of media access being requested - elements can be `video` or `audio`.
8515 */
8516 mediaTypes?: Array<'video' | 'audio'>;
8517 /**
8518 * The security origin of the request.
8519 */
8520 securityOrigin?: string;
8521 }
8522
8523 interface MemoryInfo {
8524
8525 // Docs: https://electronjs.org/docs/api/structures/memory-info
8526
8527 /**
8528 * The maximum amount of memory that has ever been pinned to actual physical RAM.
8529 */
8530 peakWorkingSetSize: number;
8531 /**
8532 * The amount of memory not shared by other processes, such as JS heap or HTML
8533 * content.
8534 *
8535 * @platform win32
8536 */
8537 privateBytes?: number;
8538 /**
8539 * The amount of memory currently pinned to actual physical RAM.
8540 */
8541 workingSetSize: number;
8542 }
8543
8544 interface MemoryUsageDetails {
8545
8546 // Docs: https://electronjs.org/docs/api/structures/memory-usage-details
8547
8548 count: number;
8549 liveSize: number;
8550 size: number;
8551 }
8552
8553 class Menu extends NodeEventEmitter {
8554
8555 // Docs: https://electronjs.org/docs/api/menu
8556
8557 /**
8558 * Emitted when a popup is closed either manually or with `menu.closePopup()`.
8559 */
8560 on(event: 'menu-will-close', listener: (event: Event) => void): this;
8561 off(event: 'menu-will-close', listener: (event: Event) => void): this;
8562 once(event: 'menu-will-close', listener: (event: Event) => void): this;
8563 addListener(event: 'menu-will-close', listener: (event: Event) => void): this;
8564 removeListener(event: 'menu-will-close', listener: (event: Event) => void): this;
8565 /**
8566 * Emitted when `menu.popup()` is called.
8567 */
8568 on(event: 'menu-will-show', listener: (event: Event) => void): this;
8569 off(event: 'menu-will-show', listener: (event: Event) => void): this;
8570 once(event: 'menu-will-show', listener: (event: Event) => void): this;
8571 addListener(event: 'menu-will-show', listener: (event: Event) => void): this;
8572 removeListener(event: 'menu-will-show', listener: (event: Event) => void): this;
8573 /**
8574 * Menu
8575 */
8576 constructor();
8577 /**
8578 * Generally, the `template` is an array of `options` for constructing a MenuItem.
8579 * The usage can be referenced above.
8580 *
8581 * You can also attach other fields to the element of the `template` and they will
8582 * become properties of the constructed menu items.
8583 */
8584 static buildFromTemplate(template: Array<(MenuItemConstructorOptions) | (MenuItem)>): Menu;
8585 /**
8586 * The application menu, if set, or `null`, if not set.
8587 *
8588 * **Note:** The returned `Menu` instance doesn't support dynamic addition or
8589 * removal of menu items. Instance properties can still be dynamically modified.
8590 */
8591 static getApplicationMenu(): (Menu) | (null);
8592 /**
8593 * Sends the `action` to the first responder of application. This is used for
8594 * emulating default macOS menu behaviors. Usually you would use the `role`
8595 * property of a `MenuItem`.
8596 *
8597 * See the macOS Cocoa Event Handling Guide for more information on macOS' native
8598 * actions.
8599 *
8600 * @platform darwin
8601 */
8602 static sendActionToFirstResponder(action: string): void;
8603 /**
8604 * Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
8605 * will be set as each window's top menu.
8606 *
8607 * Also on Windows and Linux, you can use a `&` in the top-level item name to
8608 * indicate which letter should get a generated accelerator. For example, using
8609 * `&File` for the file menu would result in a generated `Alt-F` accelerator that
8610 * opens the associated menu. The indicated character in the button label then gets
8611 * an underline, and the `&` character is not displayed on the button label.
8612 *
8613 * In order to escape the `&` character in an item name, add a proceeding `&`. For
8614 * example, `&&File` would result in `&File` displayed on the button label.
8615 *
8616 * Passing `null` will suppress the default menu. On Windows and Linux, this has
8617 * the additional effect of removing the menu bar from the window.
8618 *
8619 * **Note:** The default menu will be created automatically if the app does not set
8620 * one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
8621 * `Help`.
8622 */
8623 static setApplicationMenu(menu: (Menu) | (null)): void;
8624 /**
8625 * Appends the `menuItem` to the menu.
8626 */
8627 append(menuItem: MenuItem): void;
8628 /**
8629 * Closes the context menu in the `browserWindow`.
8630 */
8631 closePopup(browserWindow?: BrowserWindow): void;
8632 /**
8633 * the item with the specified `id`
8634 */
8635 getMenuItemById(id: string): (MenuItem) | (null);
8636 /**
8637 * Inserts the `menuItem` to the `pos` position of the menu.
8638 */
8639 insert(pos: number, menuItem: MenuItem): void;
8640 /**
8641 * Pops up this menu as a context menu in the `BrowserWindow`.
8642 */
8643 popup(options?: PopupOptions): void;
8644 /**
8645 * A `MenuItem[]` array containing the menu's items.
8646 *
8647 * Each `Menu` consists of multiple `MenuItem`s and each `MenuItem` can have a
8648 * submenu.
8649 */
8650 items: MenuItem[];
8651 }
8652
8653 class MenuItem {
8654
8655 // Docs: https://electronjs.org/docs/api/menu-item
8656
8657 /**
8658 * MenuItem
8659 */
8660 constructor(options: MenuItemConstructorOptions);
8661 /**
8662 * An `Accelerator` (optional) indicating the item's accelerator, if set.
8663 */
8664 accelerator?: Accelerator;
8665 /**
8666 * A `boolean` indicating whether the item is checked, this property can be
8667 * dynamically changed.
8668 *
8669 * A `checkbox` menu item will toggle the `checked` property on and off when
8670 * selected.
8671 *
8672 * A `radio` menu item will turn on its `checked` property when clicked, and will
8673 * turn off that property for all adjacent items in the same menu.
8674 *
8675 * You can add a `click` function for additional behavior.
8676 */
8677 checked: boolean;
8678 /**
8679 * A `Function` that is fired when the MenuItem receives a click event. It can be
8680 * called with `menuItem.click(event, focusedWindow, focusedWebContents)`.
8681 *
8682 * * `event` KeyboardEvent
8683 * * `focusedWindow` BrowserWindow
8684 * * `focusedWebContents` WebContents
8685 */
8686 click: Function;
8687 /**
8688 * A `number` indicating an item's sequential unique id.
8689 */
8690 commandId: number;
8691 /**
8692 * A `boolean` indicating whether the item is enabled, this property can be
8693 * dynamically changed.
8694 */
8695 enabled: boolean;
8696 /**
8697 * A `NativeImage | string` (optional) indicating the item's icon, if set.
8698 */
8699 icon?: (NativeImage) | (string);
8700 /**
8701 * A `string` indicating the item's unique id, this property can be dynamically
8702 * changed.
8703 */
8704 id: string;
8705 /**
8706 * A `string` indicating the item's visible label.
8707 */
8708 label: string;
8709 /**
8710 * A `Menu` that the item is a part of.
8711 */
8712 menu: Menu;
8713 /**
8714 * A `boolean` indicating if the accelerator should be registered with the system
8715 * or just displayed.
8716 *
8717 * This property can be dynamically changed.
8718 */
8719 registerAccelerator: boolean;
8720 /**
8721 * A `string` (optional) indicating the item's role, if set. Can be `undo`, `redo`,
8722 * `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`,
8723 * `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`,
8724 * `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`,
8725 * `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`,
8726 * `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`,
8727 * `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`,
8728 * `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`,
8729 * `moveTabToNewWindow` or `windowMenu`
8730 */
8731 role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleSpellChecker' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'startSpeaking' | 'stopSpeaking' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'shareMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'showAllTabs' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
8732 /**
8733 * A `SharingItem` indicating the item to share when the `role` is `shareMenu`.
8734 *
8735 * This property can be dynamically changed.
8736 *
8737 * @platform darwin
8738 */
8739 sharingItem: SharingItem;
8740 /**
8741 * A `string` indicating the item's sublabel.
8742 */
8743 sublabel: string;
8744 /**
8745 * A `Menu` (optional) containing the menu item's submenu, if present.
8746 */
8747 submenu?: Menu;
8748 /**
8749 * A `string` indicating the item's hover text.
8750 *
8751 * @platform darwin
8752 */
8753 toolTip: string;
8754 /**
8755 * A `string` indicating the type of the item. Can be `normal`, `separator`,
8756 * `submenu`, `checkbox` or `radio`.
8757 */
8758 type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
8759 /**
8760 * An `Accelerator | null` indicating the item's user-assigned accelerator for the
8761 * menu item.
8762 *
8763 * **Note:** This property is only initialized after the `MenuItem` has been added
8764 * to a `Menu`. Either via `Menu.buildFromTemplate` or via
8765 * `Menu.append()/insert()`. Accessing before initialization will just return
8766 * `null`.
8767 *
8768 * @platform darwin
8769 */
8770 readonly userAccelerator: (Accelerator) | (null);
8771 /**
8772 * A `boolean` indicating whether the item is visible, this property can be
8773 * dynamically changed.
8774 */
8775 visible: boolean;
8776 }
8777
8778 class MessageChannelMain extends NodeEventEmitter {
8779
8780 // Docs: https://electronjs.org/docs/api/message-channel-main
8781
8782 /**
8783 * A `MessagePortMain` property.
8784 */
8785 port1: MessagePortMain;
8786 /**
8787 * A `MessagePortMain` property.
8788 */
8789 port2: MessagePortMain;
8790 }
8791
8792 class MessagePortMain extends NodeEventEmitter {
8793
8794 // Docs: https://electronjs.org/docs/api/message-port-main
8795
8796 /**
8797 * Emitted when the remote end of a MessagePortMain object becomes disconnected.
8798 */
8799 on(event: 'close', listener: Function): this;
8800 off(event: 'close', listener: Function): this;
8801 once(event: 'close', listener: Function): this;
8802 addListener(event: 'close', listener: Function): this;
8803 removeListener(event: 'close', listener: Function): this;
8804 /**
8805 * Emitted when a MessagePortMain object receives a message.
8806 */
8807 on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
8808 off(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
8809 once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
8810 addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
8811 removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
8812 /**
8813 * Disconnects the port, so it is no longer active.
8814 */
8815 close(): void;
8816 /**
8817 * Sends a message from the port, and optionally, transfers ownership of objects to
8818 * other browsing contexts.
8819 */
8820 postMessage(message: any, transfer?: MessagePortMain[]): void;
8821 /**
8822 * Starts the sending of messages queued on the port. Messages will be queued until
8823 * this method is called.
8824 */
8825 start(): void;
8826 }
8827
8828 interface MimeTypedBuffer {
8829
8830 // Docs: https://electronjs.org/docs/api/structures/mime-typed-buffer
8831
8832 /**
8833 * Charset of the buffer.
8834 */
8835 charset?: string;
8836 /**
8837 * The actual Buffer content.
8838 */
8839 data: Buffer;
8840 /**
8841 * MIME type of the buffer.
8842 */
8843 mimeType?: string;
8844 }
8845
8846 interface MouseInputEvent extends InputEvent {
8847
8848 // Docs: https://electronjs.org/docs/api/structures/mouse-input-event
8849
8850 /**
8851 * The button pressed, can be `left`, `middle`, `right`.
8852 */
8853 button?: ('left' | 'middle' | 'right');
8854 clickCount?: number;
8855 globalX?: number;
8856 globalY?: number;
8857 movementX?: number;
8858 movementY?: number;
8859 /**
8860 * The type of the event, can be `mouseDown`, `mouseUp`, `mouseEnter`,
8861 * `mouseLeave`, `contextMenu`, `mouseWheel` or `mouseMove`.
8862 */
8863 type: ('mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove');
8864 x: number;
8865 y: number;
8866 }
8867
8868 interface MouseWheelInputEvent extends MouseInputEvent {
8869
8870 // Docs: https://electronjs.org/docs/api/structures/mouse-wheel-input-event
8871
8872 accelerationRatioX?: number;
8873 accelerationRatioY?: number;
8874 canScroll?: boolean;
8875 deltaX?: number;
8876 deltaY?: number;
8877 hasPreciseScrollingDeltas?: boolean;
8878 /**
8879 * The type of the event, can be `mouseWheel`.
8880 */
8881 type: ('mouseWheel');
8882 wheelTicksX?: number;
8883 wheelTicksY?: number;
8884 }
8885
8886 class NativeImage {
8887
8888 // Docs: https://electronjs.org/docs/api/native-image
8889
8890 /**
8891 * Creates an empty `NativeImage` instance.
8892 */
8893 static createEmpty(): NativeImage;
8894 /**
8895 * Creates a new `NativeImage` instance from `buffer` that contains the raw bitmap
8896 * pixel data returned by `toBitmap()`. The specific format is platform-dependent.
8897 */
8898 static createFromBitmap(buffer: Buffer, options: CreateFromBitmapOptions): NativeImage;
8899 /**
8900 * Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or
8901 * JPEG first.
8902 */
8903 static createFromBuffer(buffer: Buffer, options?: CreateFromBufferOptions): NativeImage;
8904 /**
8905 * Creates a new `NativeImage` instance from `dataUrl`, a base 64 encoded Data URL
8906 * string.
8907 */
8908 static createFromDataURL(dataURL: string): NativeImage;
8909 /**
8910 * Creates a new `NativeImage` instance from the `NSImage` that maps to the given
8911 * image name. See Apple's `NSImageName` documentation for a list of possible
8912 * values.
8913 *
8914 * The `hslShift` is applied to the image with the following rules:
8915 *
8916 * * `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0
8917 * and 360 on the hue color wheel (red).
8918 * * `hsl_shift[1]` (saturation): A saturation shift for the image, with the
8919 * following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully
8920 * saturate the image.
8921 * * `hsl_shift[2]` (lightness): A lightness shift for the image, with the
8922 * following key values: 0 = remove all lightness (make all pixels black). 0.5 =
8923 * leave unchanged. 1 = full lightness (make all pixels white).
8924 *
8925 * This means that `[-1, 0, 1]` will make the image completely white and `[-1, 1,
8926 * 0]` will make the image completely black.
8927 *
8928 * In some cases, the `NSImageName` doesn't match its string representation; one
8929 * example of this is `NSFolderImageName`, whose string representation would
8930 * actually be `NSFolder`. Therefore, you'll need to determine the correct string
8931 * representation for your image before passing it in. This can be done with the
8932 * following:
8933 *
8934 * where `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.
8935 *
8936 * @platform darwin
8937 */
8938 static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
8939 /**
8940 * Creates a new `NativeImage` instance from a file located at `path`. This method
8941 * returns an empty image if the `path` does not exist, cannot be read, or is not a
8942 * valid image.
8943 */
8944 static createFromPath(path: string): NativeImage;
8945 /**
8946 * fulfilled with the file's thumbnail preview image, which is a NativeImage.
8947 *
8948 * Note: The Windows implementation will ignore `size.height` and scale the height
8949 * according to `size.width`.
8950 *
8951 * @platform darwin,win32
8952 */
8953 static createThumbnailFromPath(path: string, size: Size): Promise<Electron.NativeImage>;
8954 /**
8955 * Add an image representation for a specific scale factor. This can be used to
8956 * programmatically add different scale factor representations to an image. This
8957 * can be called on empty images.
8958 */
8959 addRepresentation(options: AddRepresentationOptions): void;
8960 /**
8961 * The cropped image.
8962 */
8963 crop(rect: Rectangle): NativeImage;
8964 /**
8965 * The image's aspect ratio (width divided by height).
8966 *
8967 * If `scaleFactor` is passed, this will return the aspect ratio corresponding to
8968 * the image representation most closely matching the passed value.
8969 */
8970 getAspectRatio(scaleFactor?: number): number;
8971 /**
8972 * A Buffer that contains the image's raw bitmap pixel data.
8973 *
8974 * The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does
8975 * not copy the bitmap data, so you have to use the returned Buffer immediately in
8976 * current event loop tick; otherwise the data might be changed or destroyed.
8977 */
8978 getBitmap(options?: BitmapOptions): Buffer;
8979 /**
8980 * A Buffer that stores C pointer to underlying native handle of the image. On
8981 * macOS, a pointer to `NSImage` instance is returned.
8982 *
8983 * Notice that the returned pointer is a weak pointer to the underlying native
8984 * image instead of a copy, so you _must_ ensure that the associated `nativeImage`
8985 * instance is kept around.
8986 *
8987 * @platform darwin
8988 */
8989 getNativeHandle(): Buffer;
8990 /**
8991 * An array of all scale factors corresponding to representations for a given
8992 * `NativeImage`.
8993 */
8994 getScaleFactors(): number[];
8995 /**
8996 * If `scaleFactor` is passed, this will return the size corresponding to the image
8997 * representation most closely matching the passed value.
8998 */
8999 getSize(scaleFactor?: number): Size;
9000 /**
9001 * Whether the image is empty.
9002 */
9003 isEmpty(): boolean;
9004 /**
9005 * Whether the image is a macOS template image.
9006 */
9007 isTemplateImage(): boolean;
9008 /**
9009 * The resized image.
9010 *
9011 * If only the `height` or the `width` are specified then the current aspect ratio
9012 * will be preserved in the resized image.
9013 */
9014 resize(options: ResizeOptions): NativeImage;
9015 /**
9016 * Marks the image as a macOS template image.
9017 */
9018 setTemplateImage(option: boolean): void;
9019 /**
9020 * A Buffer that contains a copy of the image's raw bitmap pixel data.
9021 */
9022 toBitmap(options?: ToBitmapOptions): Buffer;
9023 /**
9024 * The Data URL of the image.
9025 */
9026 toDataURL(options?: ToDataURLOptions): string;
9027 /**
9028 * A Buffer that contains the image's `JPEG` encoded data.
9029 */
9030 toJPEG(quality: number): Buffer;
9031 /**
9032 * A Buffer that contains the image's `PNG` encoded data.
9033 */
9034 toPNG(options?: ToPNGOptions): Buffer;
9035 /**
9036 * A `boolean` property that determines whether the image is considered a template
9037 * image.
9038 *
9039 * Please note that this property only has an effect on macOS.
9040 *
9041 * @platform darwin
9042 */
9043 isMacTemplateImage: boolean;
9044 }
9045
9046 interface NativeTheme extends NodeJS.EventEmitter {
9047
9048 // Docs: https://electronjs.org/docs/api/native-theme
9049
9050 /**
9051 * Emitted when something in the underlying NativeTheme has changed. This normally
9052 * means that either the value of `shouldUseDarkColors`,
9053 * `shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed. You
9054 * will have to check them to determine which one has changed.
9055 */
9056 on(event: 'updated', listener: Function): this;
9057 off(event: 'updated', listener: Function): this;
9058 once(event: 'updated', listener: Function): this;
9059 addListener(event: 'updated', listener: Function): this;
9060 removeListener(event: 'updated', listener: Function): this;
9061 /**
9062 * A `boolean` indicating whether Chromium is in forced colors mode, controlled by
9063 * system accessibility settings. Currently, Windows high contrast is the only
9064 * system setting that triggers forced colors mode.
9065 *
9066 * @platform win32
9067 */
9068 readonly inForcedColorsMode: boolean;
9069 /**
9070 * A `boolean` for if the OS / Chromium currently has a dark mode enabled or is
9071 * being instructed to show a dark-style UI. If you want to modify this value you
9072 * should use `themeSource` below.
9073 *
9074 */
9075 readonly shouldUseDarkColors: boolean;
9076 /**
9077 * A `boolean` for if the OS / Chromium currently has high-contrast mode enabled or
9078 * is being instructed to show a high-contrast UI.
9079 *
9080 * @platform darwin,win32
9081 */
9082 readonly shouldUseHighContrastColors: boolean;
9083 /**
9084 * A `boolean` for if the OS / Chromium currently has an inverted color scheme or
9085 * is being instructed to use an inverted color scheme.
9086 *
9087 * @platform darwin,win32
9088 */
9089 readonly shouldUseInvertedColorScheme: boolean;
9090 /**
9091 * A `string` property that can be `system`, `light` or `dark`. It is used to
9092 * override and supersede the value that Chromium has chosen to use internally.
9093 *
9094 * Setting this property to `system` will remove the override and everything will
9095 * be reset to the OS default. By default `themeSource` is `system`.
9096 *
9097 * Settings this property to `dark` will have the following effects:
9098 *
9099 * * `nativeTheme.shouldUseDarkColors` will be `true` when accessed
9100 * * Any UI Electron renders on Linux and Windows including context menus,
9101 * devtools, etc. will use the dark UI.
9102 * * Any UI the OS renders on macOS including menus, window frames, etc. will use
9103 * the dark UI.
9104 * * The `prefers-color-scheme` CSS query will match `dark` mode.
9105 * * The `updated` event will be emitted
9106 *
9107 * Settings this property to `light` will have the following effects:
9108 *
9109 * * `nativeTheme.shouldUseDarkColors` will be `false` when accessed
9110 * * Any UI Electron renders on Linux and Windows including context menus,
9111 * devtools, etc. will use the light UI.
9112 * * Any UI the OS renders on macOS including menus, window frames, etc. will use
9113 * the light UI.
9114 * * The `prefers-color-scheme` CSS query will match `light` mode.
9115 * * The `updated` event will be emitted
9116 *
9117 * The usage of this property should align with a classic "dark mode" state machine
9118 * in your application where the user has three options.
9119 *
9120 * * `Follow OS` --> `themeSource = 'system'`
9121 * * `Dark Mode` --> `themeSource = 'dark'`
9122 * * `Light Mode` --> `themeSource = 'light'`
9123 *
9124 * Your application should then always use `shouldUseDarkColors` to determine what
9125 * CSS to apply.
9126 */
9127 themeSource: ('system' | 'light' | 'dark');
9128 }
9129
9130 class NavigationHistory extends NodeEventEmitter {
9131
9132 // Docs: https://electronjs.org/docs/api/navigation-history
9133
9134 /**
9135 * The index of the current page, from which we would go back/forward or reload.
9136 */
9137 getActiveIndex(): number;
9138 /**
9139 * * `url` string - The URL of the navigation entry at the given index.
9140 * * `title` string - The page title of the navigation entry at the given index.
9141 *
9142 * If index is out of bounds (greater than history length or less than 0), null
9143 * will be returned.
9144 */
9145 getEntryAtIndex(index: number): EntryAtIndex;
9146 /**
9147 * History length.
9148 */
9149 length(): number;
9150 }
9151
9152 interface Net {
9153
9154 // Docs: https://electronjs.org/docs/api/net
9155
9156 /**
9157 * see Response.
9158 *
9159 * Sends a request, similarly to how `fetch()` works in the renderer, using
9160 * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
9161 * HTTP stack.
9162 *
9163 * Example:
9164 *
9165 * This method will issue requests from the default session. To send a `fetch`
9166 * request from another session, use ses.fetch().
9167 *
9168 * See the MDN documentation for `fetch()` for more details.
9169 *
9170 * Limitations:
9171 *
9172 * * `net.fetch()` does not support the `data:` or `blob:` schemes.
9173 * * The value of the `integrity` option is ignored.
9174 * * The `.type` and `.url` values of the returned `Response` object are incorrect.
9175 *
9176 * By default, requests made with `net.fetch` can be made to custom protocols as
9177 * well as `file:`, and will trigger webRequest handlers if present. When the
9178 * non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
9179 * protocol handlers will not be called for this request. This allows forwarding an
9180 * intercepted request to the built-in handler. webRequest handlers will still be
9181 * triggered when bypassing custom protocols.
9182 *
9183 * Note: in the utility process custom protocols are not supported.
9184 */
9185 fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
9186 /**
9187 * Whether there is currently internet connection.
9188 *
9189 * A return value of `false` is a pretty strong indicator that the user won't be
9190 * able to connect to remote sites. However, a return value of `true` is
9191 * inconclusive; even if some link is up, it is uncertain whether a particular
9192 * connection attempt to a particular remote site will be successful.
9193 */
9194 isOnline(): boolean;
9195 /**
9196 * Creates a `ClientRequest` instance using the provided `options` which are
9197 * directly forwarded to the `ClientRequest` constructor. The `net.request` method
9198 * would be used to issue both secure and insecure HTTP requests according to the
9199 * specified protocol scheme in the `options` object.
9200 */
9201 request(options: (ClientRequestConstructorOptions) | (string)): ClientRequest;
9202 /**
9203 * Resolves with the resolved IP addresses for the `host`.
9204 *
9205 * This method will resolve hosts from the default session. To resolve a host from
9206 * another session, use ses.resolveHost().
9207 */
9208 resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
9209 /**
9210 * A `boolean` property. Whether there is currently internet connection.
9211 *
9212 * A return value of `false` is a pretty strong indicator that the user won't be
9213 * able to connect to remote sites. However, a return value of `true` is
9214 * inconclusive; even if some link is up, it is uncertain whether a particular
9215 * connection attempt to a particular remote site will be successful.
9216 *
9217 */
9218 readonly online: boolean;
9219 }
9220
9221 interface NetLog {
9222
9223 // Docs: https://electronjs.org/docs/api/net-log
9224
9225 /**
9226 * resolves when the net log has begun recording.
9227 *
9228 * Starts recording network events to `path`.
9229 */
9230 startLogging(path: string, options?: StartLoggingOptions): Promise<void>;
9231 /**
9232 * resolves when the net log has been flushed to disk.
9233 *
9234 * Stops recording network events. If not called, net logging will automatically
9235 * end when app quits.
9236 */
9237 stopLogging(): Promise<void>;
9238 /**
9239 * A `boolean` property that indicates whether network logs are currently being
9240 * recorded.
9241 *
9242 */
9243 readonly currentlyLogging: boolean;
9244 }
9245
9246 class Notification extends NodeEventEmitter {
9247
9248 // Docs: https://electronjs.org/docs/api/notification
9249
9250 /**
9251 * @platform darwin
9252 */
9253 on(event: 'action', listener: (event: Event,
9254 /**
9255 * The index of the action that was activated.
9256 */
9257 index: number) => void): this;
9258 /**
9259 * @platform darwin
9260 */
9261 off(event: 'action', listener: (event: Event,
9262 /**
9263 * The index of the action that was activated.
9264 */
9265 index: number) => void): this;
9266 /**
9267 * @platform darwin
9268 */
9269 once(event: 'action', listener: (event: Event,
9270 /**
9271 * The index of the action that was activated.
9272 */
9273 index: number) => void): this;
9274 /**
9275 * @platform darwin
9276 */
9277 addListener(event: 'action', listener: (event: Event,
9278 /**
9279 * The index of the action that was activated.
9280 */
9281 index: number) => void): this;
9282 /**
9283 * @platform darwin
9284 */
9285 removeListener(event: 'action', listener: (event: Event,
9286 /**
9287 * The index of the action that was activated.
9288 */
9289 index: number) => void): this;
9290 /**
9291 * Emitted when the notification is clicked by the user.
9292 */
9293 on(event: 'click', listener: (event: Event) => void): this;
9294 off(event: 'click', listener: (event: Event) => void): this;
9295 once(event: 'click', listener: (event: Event) => void): this;
9296 addListener(event: 'click', listener: (event: Event) => void): this;
9297 removeListener(event: 'click', listener: (event: Event) => void): this;
9298 /**
9299 * Emitted when the notification is closed by manual intervention from the user.
9300 *
9301 * This event is not guaranteed to be emitted in all cases where the notification
9302 * is closed.
9303 *
9304 * On Windows, the `close` event can be emitted in one of three ways: programmatic
9305 * dismissal with `notification.close()`, by the user closing the notification, or
9306 * via system timeout. If a notification is in the Action Center after the initial
9307 * `close` event is emitted, a call to `notification.close()` will remove the
9308 * notification from the action center but the `close` event will not be emitted
9309 * again.
9310 */
9311 on(event: 'close', listener: (event: Event) => void): this;
9312 off(event: 'close', listener: (event: Event) => void): this;
9313 once(event: 'close', listener: (event: Event) => void): this;
9314 addListener(event: 'close', listener: (event: Event) => void): this;
9315 removeListener(event: 'close', listener: (event: Event) => void): this;
9316 /**
9317 * Emitted when an error is encountered while creating and showing the native
9318 * notification.
9319 *
9320 * @platform win32
9321 */
9322 on(event: 'failed', listener: (event: Event,
9323 /**
9324 * The error encountered during execution of the `show()` method.
9325 */
9326 error: string) => void): this;
9327 /**
9328 * @platform win32
9329 */
9330 off(event: 'failed', listener: (event: Event,
9331 /**
9332 * The error encountered during execution of the `show()` method.
9333 */
9334 error: string) => void): this;
9335 /**
9336 * @platform win32
9337 */
9338 once(event: 'failed', listener: (event: Event,
9339 /**
9340 * The error encountered during execution of the `show()` method.
9341 */
9342 error: string) => void): this;
9343 /**
9344 * @platform win32
9345 */
9346 addListener(event: 'failed', listener: (event: Event,
9347 /**
9348 * The error encountered during execution of the `show()` method.
9349 */
9350 error: string) => void): this;
9351 /**
9352 * @platform win32
9353 */
9354 removeListener(event: 'failed', listener: (event: Event,
9355 /**
9356 * The error encountered during execution of the `show()` method.
9357 */
9358 error: string) => void): this;
9359 /**
9360 * Emitted when the user clicks the "Reply" button on a notification with
9361 * `hasReply: true`.
9362 *
9363 * @platform darwin
9364 */
9365 on(event: 'reply', listener: (event: Event,
9366 /**
9367 * The string the user entered into the inline reply field.
9368 */
9369 reply: string) => void): this;
9370 /**
9371 * @platform darwin
9372 */
9373 off(event: 'reply', listener: (event: Event,
9374 /**
9375 * The string the user entered into the inline reply field.
9376 */
9377 reply: string) => void): this;
9378 /**
9379 * @platform darwin
9380 */
9381 once(event: 'reply', listener: (event: Event,
9382 /**
9383 * The string the user entered into the inline reply field.
9384 */
9385 reply: string) => void): this;
9386 /**
9387 * @platform darwin
9388 */
9389 addListener(event: 'reply', listener: (event: Event,
9390 /**
9391 * The string the user entered into the inline reply field.
9392 */
9393 reply: string) => void): this;
9394 /**
9395 * @platform darwin
9396 */
9397 removeListener(event: 'reply', listener: (event: Event,
9398 /**
9399 * The string the user entered into the inline reply field.
9400 */
9401 reply: string) => void): this;
9402 /**
9403 * Emitted when the notification is shown to the user. Note that this event can be
9404 * fired multiple times as a notification can be shown multiple times through the
9405 * `show()` method.
9406 */
9407 on(event: 'show', listener: (event: Event) => void): this;
9408 off(event: 'show', listener: (event: Event) => void): this;
9409 once(event: 'show', listener: (event: Event) => void): this;
9410 addListener(event: 'show', listener: (event: Event) => void): this;
9411 removeListener(event: 'show', listener: (event: Event) => void): this;
9412 /**
9413 * Notification
9414 */
9415 constructor(options?: NotificationConstructorOptions);
9416 /**
9417 * Whether or not desktop notifications are supported on the current system
9418 */
9419 static isSupported(): boolean;
9420 /**
9421 * Dismisses the notification.
9422 *
9423 * On Windows, calling `notification.close()` while the notification is visible on
9424 * screen will dismiss the notification and remove it from the Action Center. If
9425 * `notification.close()` is called after the notification is no longer visible on
9426 * screen, calling `notification.close()` will try remove it from the Action
9427 * Center.
9428 */
9429 close(): void;
9430 /**
9431 * Immediately shows the notification to the user. Unlike the web notification API,
9432 * instantiating a `new Notification()` does not immediately show it to the user.
9433 * Instead, you need to call this method before the OS will display it.
9434 *
9435 * If the notification has been shown before, this method will dismiss the
9436 * previously shown notification and create a new one with identical properties.
9437 */
9438 show(): void;
9439 /**
9440 * A `NotificationAction[]` property representing the actions of the notification.
9441 */
9442 actions: NotificationAction[];
9443 /**
9444 * A `string` property representing the body of the notification.
9445 */
9446 body: string;
9447 /**
9448 * A `string` property representing the close button text of the notification.
9449 */
9450 closeButtonText: string;
9451 /**
9452 * A `boolean` property representing whether the notification has a reply action.
9453 */
9454 hasReply: boolean;
9455 /**
9456 * A `string` property representing the reply placeholder of the notification.
9457 */
9458 replyPlaceholder: string;
9459 /**
9460 * A `boolean` property representing whether the notification is silent.
9461 */
9462 silent: boolean;
9463 /**
9464 * A `string` property representing the sound of the notification.
9465 */
9466 sound: string;
9467 /**
9468 * A `string` property representing the subtitle of the notification.
9469 */
9470 subtitle: string;
9471 /**
9472 * A `string` property representing the type of timeout duration for the
9473 * notification. Can be 'default' or 'never'.
9474 *
9475 * If `timeoutType` is set to 'never', the notification never expires. It stays
9476 * open until closed by the calling API or the user.
9477 *
9478 * @platform linux,win32
9479 */
9480 timeoutType: ('default' | 'never');
9481 /**
9482 * A `string` property representing the title of the notification.
9483 */
9484 title: string;
9485 /**
9486 * A `string` property representing the custom Toast XML of the notification.
9487 *
9488 * @platform win32
9489 */
9490 toastXml: string;
9491 /**
9492 * A `string` property representing the urgency level of the notification. Can be
9493 * 'normal', 'critical', or 'low'.
9494 *
9495 * Default is 'low' - see NotifyUrgency for more information.
9496 *
9497 * @platform linux
9498 */
9499 urgency: ('normal' | 'critical' | 'low');
9500 }
9501
9502 interface NotificationAction {
9503
9504 // Docs: https://electronjs.org/docs/api/structures/notification-action
9505
9506 /**
9507 * The label for the given action.
9508 */
9509 text?: string;
9510 /**
9511 * The type of action, can be `button`.
9512 */
9513 type: ('button');
9514 }
9515
9516 interface NotificationResponse {
9517
9518 // Docs: https://electronjs.org/docs/api/structures/notification-response
9519
9520 /**
9521 * The identifier string of the action that the user selected.
9522 */
9523 actionIdentifier: string;
9524 /**
9525 * The delivery date of the notification.
9526 */
9527 date: number;
9528 /**
9529 * The unique identifier for this notification request.
9530 */
9531 identifier: string;
9532 /**
9533 * A dictionary of custom information associated with the notification.
9534 */
9535 userInfo: Record<string, any>;
9536 /**
9537 * The text entered or chosen by the user.
9538 */
9539 userText?: string;
9540 }
9541
9542 interface OpenExternalPermissionRequest extends PermissionRequest {
9543
9544 // Docs: https://electronjs.org/docs/api/structures/open-external-permission-request
9545
9546 /**
9547 * The url of the `openExternal` request.
9548 */
9549 externalURL?: string;
9550 }
9551
9552 interface ParentPort extends NodeJS.EventEmitter {
9553
9554 // Docs: https://electronjs.org/docs/api/parent-port
9555
9556 /**
9557 * Emitted when the process receives a message. Messages received on this port will
9558 * be queued up until a handler is registered for this event.
9559 */
9560 on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
9561 off(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
9562 once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
9563 addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
9564 removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
9565 /**
9566 * Sends a message from the process to its parent.
9567 */
9568 postMessage(message: any): void;
9569 }
9570
9571 interface PaymentDiscount {
9572
9573 // Docs: https://electronjs.org/docs/api/structures/payment-discount
9574
9575 /**
9576 * A string used to uniquely identify a discount offer for a product.
9577 */
9578 identifier: string;
9579 /**
9580 * A string that identifies the key used to generate the signature.
9581 */
9582 keyIdentifier: string;
9583 /**
9584 * A universally unique ID (UUID) value that you define.
9585 */
9586 nonce: string;
9587 /**
9588 * A UTF-8 string representing the properties of a specific discount offer,
9589 * cryptographically signed.
9590 */
9591 signature: string;
9592 /**
9593 * The date and time of the signature's creation in milliseconds, formatted in Unix
9594 * epoch time.
9595 */
9596 timestamp: number;
9597 }
9598
9599 interface PermissionRequest {
9600
9601 // Docs: https://electronjs.org/docs/api/structures/permission-request
9602
9603 /**
9604 * Whether the frame making the request is the main frame.
9605 */
9606 isMainFrame: boolean;
9607 /**
9608 * The last URL the requesting frame loaded.
9609 */
9610 requestingUrl: string;
9611 }
9612
9613 interface Point {
9614
9615 // Docs: https://electronjs.org/docs/api/structures/point
9616
9617 x: number;
9618 y: number;
9619 }
9620
9621 interface PostBody {
9622
9623 // Docs: https://electronjs.org/docs/api/structures/post-body
9624
9625 /**
9626 * The boundary used to separate multiple parts of the message. Only valid when
9627 * `contentType` is `multipart/form-data`.
9628 */
9629 boundary?: string;
9630 /**
9631 * The `content-type` header used for the data. One of
9632 * `application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to the
9633 * `enctype` attribute of the submitted HTML form.
9634 */
9635 contentType: string;
9636 /**
9637 * The post data to be sent to the new window.
9638 */
9639 data: Array<(UploadRawData) | (UploadFile)>;
9640 }
9641
9642 interface PowerMonitor extends NodeJS.EventEmitter {
9643
9644 // Docs: https://electronjs.org/docs/api/power-monitor
9645
9646 /**
9647 * Emitted when the system is about to lock the screen.
9648 *
9649 * @platform darwin,win32
9650 */
9651 on(event: 'lock-screen', listener: Function): this;
9652 /**
9653 * @platform darwin,win32
9654 */
9655 off(event: 'lock-screen', listener: Function): this;
9656 /**
9657 * @platform darwin,win32
9658 */
9659 once(event: 'lock-screen', listener: Function): this;
9660 /**
9661 * @platform darwin,win32
9662 */
9663 addListener(event: 'lock-screen', listener: Function): this;
9664 /**
9665 * @platform darwin,win32
9666 */
9667 removeListener(event: 'lock-screen', listener: Function): this;
9668 /**
9669 * Emitted when the system changes to AC power.
9670 *
9671 * @platform darwin,win32
9672 */
9673 on(event: 'on-ac', listener: Function): this;
9674 /**
9675 * @platform darwin,win32
9676 */
9677 off(event: 'on-ac', listener: Function): this;
9678 /**
9679 * @platform darwin,win32
9680 */
9681 once(event: 'on-ac', listener: Function): this;
9682 /**
9683 * @platform darwin,win32
9684 */
9685 addListener(event: 'on-ac', listener: Function): this;
9686 /**
9687 * @platform darwin,win32
9688 */
9689 removeListener(event: 'on-ac', listener: Function): this;
9690 /**
9691 * Emitted when system changes to battery power.
9692 *
9693 * @platform darwin
9694 */
9695 on(event: 'on-battery', listener: Function): this;
9696 /**
9697 * @platform darwin
9698 */
9699 off(event: 'on-battery', listener: Function): this;
9700 /**
9701 * @platform darwin
9702 */
9703 once(event: 'on-battery', listener: Function): this;
9704 /**
9705 * @platform darwin
9706 */
9707 addListener(event: 'on-battery', listener: Function): this;
9708 /**
9709 * @platform darwin
9710 */
9711 removeListener(event: 'on-battery', listener: Function): this;
9712 /**
9713 * Emitted when system is resuming.
9714 */
9715 on(event: 'resume', listener: Function): this;
9716 off(event: 'resume', listener: Function): this;
9717 once(event: 'resume', listener: Function): this;
9718 addListener(event: 'resume', listener: Function): this;
9719 removeListener(event: 'resume', listener: Function): this;
9720 /**
9721 * Emitted when the system is about to reboot or shut down. If the event handler
9722 * invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in
9723 * order for the app to exit cleanly. If `e.preventDefault()` is called, the app
9724 * should exit as soon as possible by calling something like `app.quit()`.
9725 *
9726 * @platform linux,darwin
9727 */
9728 on(event: 'shutdown', listener: Function): this;
9729 /**
9730 * @platform linux,darwin
9731 */
9732 off(event: 'shutdown', listener: Function): this;
9733 /**
9734 * @platform linux,darwin
9735 */
9736 once(event: 'shutdown', listener: Function): this;
9737 /**
9738 * @platform linux,darwin
9739 */
9740 addListener(event: 'shutdown', listener: Function): this;
9741 /**
9742 * @platform linux,darwin
9743 */
9744 removeListener(event: 'shutdown', listener: Function): this;
9745 /**
9746 * Notification of a change in the operating system's advertised speed limit for
9747 * CPUs, in percent. Values below 100 indicate that the system is impairing
9748 * processing power due to thermal management.
9749 *
9750 * @platform darwin,win32
9751 */
9752 on(event: 'speed-limit-change', listener: Function): this;
9753 /**
9754 * @platform darwin,win32
9755 */
9756 off(event: 'speed-limit-change', listener: Function): this;
9757 /**
9758 * @platform darwin,win32
9759 */
9760 once(event: 'speed-limit-change', listener: Function): this;
9761 /**
9762 * @platform darwin,win32
9763 */
9764 addListener(event: 'speed-limit-change', listener: Function): this;
9765 /**
9766 * @platform darwin,win32
9767 */
9768 removeListener(event: 'speed-limit-change', listener: Function): this;
9769 /**
9770 * Emitted when the system is suspending.
9771 */
9772 on(event: 'suspend', listener: Function): this;
9773 off(event: 'suspend', listener: Function): this;
9774 once(event: 'suspend', listener: Function): this;
9775 addListener(event: 'suspend', listener: Function): this;
9776 removeListener(event: 'suspend', listener: Function): this;
9777 /**
9778 * Emitted when the thermal state of the system changes. Notification of a change
9779 * in the thermal status of the system, such as entering a critical temperature
9780 * range. Depending on the severity, the system might take steps to reduce said
9781 * temperature, for example, throttling the CPU or switching on the fans if
9782 * available.
9783 *
9784 * Apps may react to the new state by reducing expensive computing tasks (e.g.
9785 * video encoding), or notifying the user. The same state might be received
9786 * repeatedly.
9787 *
9788 * See
9789 * https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html
9790 *
9791 * @platform darwin
9792 */
9793 on(event: 'thermal-state-change', listener: Function): this;
9794 /**
9795 * @platform darwin
9796 */
9797 off(event: 'thermal-state-change', listener: Function): this;
9798 /**
9799 * @platform darwin
9800 */
9801 once(event: 'thermal-state-change', listener: Function): this;
9802 /**
9803 * @platform darwin
9804 */
9805 addListener(event: 'thermal-state-change', listener: Function): this;
9806 /**
9807 * @platform darwin
9808 */
9809 removeListener(event: 'thermal-state-change', listener: Function): this;
9810 /**
9811 * Emitted as soon as the systems screen is unlocked.
9812 *
9813 * @platform darwin,win32
9814 */
9815 on(event: 'unlock-screen', listener: Function): this;
9816 /**
9817 * @platform darwin,win32
9818 */
9819 off(event: 'unlock-screen', listener: Function): this;
9820 /**
9821 * @platform darwin,win32
9822 */
9823 once(event: 'unlock-screen', listener: Function): this;
9824 /**
9825 * @platform darwin,win32
9826 */
9827 addListener(event: 'unlock-screen', listener: Function): this;
9828 /**
9829 * @platform darwin,win32
9830 */
9831 removeListener(event: 'unlock-screen', listener: Function): this;
9832 /**
9833 * Emitted when a login session is activated. See documentation for more
9834 * information.
9835 *
9836 * @platform darwin
9837 */
9838 on(event: 'user-did-become-active', listener: Function): this;
9839 /**
9840 * @platform darwin
9841 */
9842 off(event: 'user-did-become-active', listener: Function): this;
9843 /**
9844 * @platform darwin
9845 */
9846 once(event: 'user-did-become-active', listener: Function): this;
9847 /**
9848 * @platform darwin
9849 */
9850 addListener(event: 'user-did-become-active', listener: Function): this;
9851 /**
9852 * @platform darwin
9853 */
9854 removeListener(event: 'user-did-become-active', listener: Function): this;
9855 /**
9856 * Emitted when a login session is deactivated. See documentation for more
9857 * information.
9858 *
9859 * @platform darwin
9860 */
9861 on(event: 'user-did-resign-active', listener: Function): this;
9862 /**
9863 * @platform darwin
9864 */
9865 off(event: 'user-did-resign-active', listener: Function): this;
9866 /**
9867 * @platform darwin
9868 */
9869 once(event: 'user-did-resign-active', listener: Function): this;
9870 /**
9871 * @platform darwin
9872 */
9873 addListener(event: 'user-did-resign-active', listener: Function): this;
9874 /**
9875 * @platform darwin
9876 */
9877 removeListener(event: 'user-did-resign-active', listener: Function): this;
9878 /**
9879 * The system's current thermal state. Can be `unknown`, `nominal`, `fair`,
9880 * `serious`, or `critical`.
9881 *
9882 * @platform darwin
9883 */
9884 getCurrentThermalState(): ('unknown' | 'nominal' | 'fair' | 'serious' | 'critical');
9885 /**
9886 * The system's current idle state. Can be `active`, `idle`, `locked` or `unknown`.
9887 *
9888 * Calculate the system idle state. `idleThreshold` is the amount of time (in
9889 * seconds) before considered idle. `locked` is available on supported systems
9890 * only.
9891 */
9892 getSystemIdleState(idleThreshold: number): ('active' | 'idle' | 'locked' | 'unknown');
9893 /**
9894 * Idle time in seconds
9895 *
9896 * Calculate system idle time in seconds.
9897 */
9898 getSystemIdleTime(): number;
9899 /**
9900 * Whether the system is on battery power.
9901 *
9902 * To monitor for changes in this property, use the `on-battery` and `on-ac`
9903 * events.
9904 */
9905 isOnBatteryPower(): boolean;
9906 /**
9907 * A `boolean` property. True if the system is on battery power.
9908 *
9909 * See `powerMonitor.isOnBatteryPower()`.
9910 */
9911 onBatteryPower: boolean;
9912 }
9913
9914 interface PowerSaveBlocker {
9915
9916 // Docs: https://electronjs.org/docs/api/power-save-blocker
9917
9918 /**
9919 * Whether the corresponding `powerSaveBlocker` has started.
9920 */
9921 isStarted(id: number): boolean;
9922 /**
9923 * The blocker ID that is assigned to this power blocker.
9924 *
9925 * Starts preventing the system from entering lower-power mode. Returns an integer
9926 * identifying the power save blocker.
9927 *
9928 * **Note:** `prevent-display-sleep` has higher precedence over
9929 * `prevent-app-suspension`. Only the highest precedence type takes effect. In
9930 * other words, `prevent-display-sleep` always takes precedence over
9931 * `prevent-app-suspension`.
9932 *
9933 * For example, an API calling A requests for `prevent-app-suspension`, and another
9934 * calling B requests for `prevent-display-sleep`. `prevent-display-sleep` will be
9935 * used until B stops its request. After that, `prevent-app-suspension` is used.
9936 */
9937 start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number;
9938 /**
9939 * Stops the specified power save blocker.
9940 *
9941 * Whether the specified `powerSaveBlocker` has been stopped.
9942 */
9943 stop(id: number): boolean;
9944 }
9945
9946 interface PrinterInfo {
9947
9948 // Docs: https://electronjs.org/docs/api/structures/printer-info
9949
9950 /**
9951 * a longer description of the printer's type.
9952 */
9953 description: string;
9954 /**
9955 * the name of the printer as shown in Print Preview.
9956 */
9957 displayName: string;
9958 /**
9959 * whether or not a given printer is set as the default printer on the OS.
9960 */
9961 isDefault: boolean;
9962 /**
9963 * the name of the printer as understood by the OS.
9964 */
9965 name: string;
9966 /**
9967 * an object containing a variable number of platform-specific printer information.
9968 */
9969 options: Options;
9970 /**
9971 * the current status of the printer.
9972 */
9973 status: number;
9974 }
9975
9976 interface ProcessMemoryInfo {
9977
9978 // Docs: https://electronjs.org/docs/api/structures/process-memory-info
9979
9980 /**
9981 * The amount of memory not shared by other processes, such as JS heap or HTML
9982 * content in Kilobytes.
9983 */
9984 private: number;
9985 /**
9986 * The amount of memory currently pinned to actual physical RAM in Kilobytes.
9987 *
9988 * @platform linux,win32
9989 */
9990 residentSet: number;
9991 /**
9992 * The amount of memory shared between processes, typically memory consumed by the
9993 * Electron code itself in Kilobytes.
9994 */
9995 shared: number;
9996 }
9997
9998 interface ProcessMetric {
9999
10000 // Docs: https://electronjs.org/docs/api/structures/process-metric
10001
10002 /**
10003 * CPU usage of the process.
10004 */
10005 cpu: CPUUsage;
10006 /**
10007 * Creation time for this process. The time is represented as number of
10008 * milliseconds since epoch. Since the `pid` can be reused after a process dies, it
10009 * is useful to use both the `pid` and the `creationTime` to uniquely identify a
10010 * process.
10011 */
10012 creationTime: number;
10013 /**
10014 * One of the following values:
10015 *
10016 * @platform win32
10017 */
10018 integrityLevel?: ('untrusted' | 'low' | 'medium' | 'high' | 'unknown');
10019 /**
10020 * Memory information for the process.
10021 */
10022 memory: MemoryInfo;
10023 /**
10024 * The name of the process. Examples for utility: `Audio Service`, `Content
10025 * Decryption Module Service`, `Network Service`, `Video Capture`, etc.
10026 */
10027 name?: string;
10028 /**
10029 * Process id of the process.
10030 */
10031 pid: number;
10032 /**
10033 * Whether the process is sandboxed on OS level.
10034 *
10035 * @platform darwin,win32
10036 */
10037 sandboxed?: boolean;
10038 /**
10039 * The non-localized name of the process.
10040 */
10041 serviceName?: string;
10042 /**
10043 * Process type. One of the following values:
10044 */
10045 type: ('Browser' | 'Tab' | 'Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
10046 }
10047
10048 interface Product {
10049
10050 // Docs: https://electronjs.org/docs/api/structures/product
10051
10052 /**
10053 * 3 character code presenting a product's currency based on the ISO 4217 standard.
10054 */
10055 currencyCode: string;
10056 /**
10057 * An array of discount offers
10058 */
10059 discounts: ProductDiscount[];
10060 /**
10061 * The total size of the content, in bytes.
10062 */
10063 downloadContentLengths: number[];
10064 /**
10065 * A string that identifies the version of the content.
10066 */
10067 downloadContentVersion: string;
10068 /**
10069 * The locale formatted price of the product.
10070 */
10071 formattedPrice: string;
10072 /**
10073 * The object containing introductory price information for the product. available
10074 * for the product.
10075 */
10076 introductoryPrice?: ProductDiscount;
10077 /**
10078 * A boolean value that indicates whether the App Store has downloadable content
10079 * for this product. `true` if at least one file has been associated with the
10080 * product.
10081 */
10082 isDownloadable: boolean;
10083 /**
10084 * A description of the product.
10085 */
10086 localizedDescription: string;
10087 /**
10088 * The name of the product.
10089 */
10090 localizedTitle: string;
10091 /**
10092 * The cost of the product in the local currency.
10093 */
10094 price: number;
10095 /**
10096 * The string that identifies the product to the Apple App Store.
10097 */
10098 productIdentifier: string;
10099 /**
10100 * The identifier of the subscription group to which the subscription belongs.
10101 */
10102 subscriptionGroupIdentifier: string;
10103 /**
10104 * The period details for products that are subscriptions.
10105 */
10106 subscriptionPeriod?: ProductSubscriptionPeriod;
10107 }
10108
10109 interface ProductDiscount {
10110
10111 // Docs: https://electronjs.org/docs/api/structures/product-discount
10112
10113 /**
10114 * A string used to uniquely identify a discount offer for a product.
10115 */
10116 identifier: string;
10117 /**
10118 * An integer that indicates the number of periods the product discount is
10119 * available.
10120 */
10121 numberOfPeriods: number;
10122 /**
10123 * The payment mode for this product discount. Can be `payAsYouGo`, `payUpFront`,
10124 * or `freeTrial`.
10125 */
10126 paymentMode: ('payAsYouGo' | 'payUpFront' | 'freeTrial');
10127 /**
10128 * The discount price of the product in the local currency.
10129 */
10130 price: number;
10131 /**
10132 * The locale used to format the discount price of the product.
10133 */
10134 priceLocale: string;
10135 /**
10136 * An object that defines the period for the product discount.
10137 */
10138 subscriptionPeriod?: ProductSubscriptionPeriod;
10139 /**
10140 * The type of discount offer.
10141 */
10142 type: number;
10143 }
10144
10145 interface ProductSubscriptionPeriod {
10146
10147 // Docs: https://electronjs.org/docs/api/structures/product-subscription-period
10148
10149 /**
10150 * The number of units per subscription period.
10151 */
10152 numberOfUnits: number;
10153 /**
10154 * The increment of time that a subscription period is specified in. Can be `day`,
10155 * `week`, `month`, `year`.
10156 */
10157 unit: ('day' | 'week' | 'month' | 'year');
10158 }
10159
10160 interface Protocol {
10161
10162 // Docs: https://electronjs.org/docs/api/protocol
10163
10164 /**
10165 * Register a protocol handler for `scheme`. Requests made to URLs with this scheme
10166 * will delegate to this handler to determine what response should be sent.
10167 *
10168 * Either a `Response` or a `Promise<Response>` can be returned.
10169 *
10170 * Example:
10171 *
10172 * See the MDN docs for `Request` and `Response` for more details.
10173 */
10174 handle(scheme: string, handler: (request: GlobalRequest) => (GlobalResponse) | (Promise<GlobalResponse>)): void;
10175 /**
10176 * Whether the protocol was successfully intercepted
10177 *
10178 * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
10179 * which sends a `Buffer` as a response.
10180 *
10181 * @deprecated
10182 */
10183 interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
10184 /**
10185 * Whether the protocol was successfully intercepted
10186 *
10187 * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
10188 * which sends a file as a response.
10189 *
10190 * @deprecated
10191 */
10192 interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
10193 /**
10194 * Whether the protocol was successfully intercepted
10195 *
10196 * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
10197 * which sends a new HTTP request as a response.
10198 *
10199 * @deprecated
10200 */
10201 interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
10202 /**
10203 * Whether the protocol was successfully intercepted
10204 *
10205 * Same as `protocol.registerStreamProtocol`, except that it replaces an existing
10206 * protocol handler.
10207 *
10208 * @deprecated
10209 */
10210 interceptStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
10211 /**
10212 * Whether the protocol was successfully intercepted
10213 *
10214 * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
10215 * which sends a `string` as a response.
10216 *
10217 * @deprecated
10218 */
10219 interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
10220 /**
10221 * Whether `scheme` is already handled.
10222 */
10223 isProtocolHandled(scheme: string): boolean;
10224 /**
10225 * Whether `scheme` is already intercepted.
10226 *
10227 * @deprecated
10228 */
10229 isProtocolIntercepted(scheme: string): boolean;
10230 /**
10231 * Whether `scheme` is already registered.
10232 *
10233 * @deprecated
10234 */
10235 isProtocolRegistered(scheme: string): boolean;
10236 /**
10237 * Whether the protocol was successfully registered
10238 *
10239 * Registers a protocol of `scheme` that will send a `Buffer` as a response.
10240 *
10241 * The usage is the same with `registerFileProtocol`, except that the `callback`
10242 * should be called with either a `Buffer` object or an object that has the `data`
10243 * property.
10244 *
10245 * Example:
10246 *
10247 * @deprecated
10248 */
10249 registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
10250 /**
10251 * Whether the protocol was successfully registered
10252 *
10253 * Registers a protocol of `scheme` that will send a file as the response. The
10254 * `handler` will be called with `request` and `callback` where `request` is an
10255 * incoming request for the `scheme`.
10256 *
10257 * To handle the `request`, the `callback` should be called with either the file's
10258 * path or an object that has a `path` property, e.g. `callback(filePath)` or
10259 * `callback({ path: filePath })`. The `filePath` must be an absolute path.
10260 *
10261 * By default the `scheme` is treated like `http:`, which is parsed differently
10262 * from protocols that follow the "generic URI syntax" like `file:`.
10263 *
10264 * @deprecated
10265 */
10266 registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
10267 /**
10268 * Whether the protocol was successfully registered
10269 *
10270 * Registers a protocol of `scheme` that will send an HTTP request as a response.
10271 *
10272 * The usage is the same with `registerFileProtocol`, except that the `callback`
10273 * should be called with an object that has the `url` property.
10274 *
10275 * @deprecated
10276 */
10277 registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
10278 /**
10279 * **Note:** This method can only be used before the `ready` event of the `app`
10280 * module gets emitted and can be called only once.
10281 *
10282 * Registers the `scheme` as standard, secure, bypasses content security policy for
10283 * resources, allows registering ServiceWorker, supports fetch API, streaming
10284 * video/audio, and V8 code cache. Specify a privilege with the value of `true` to
10285 * enable the capability.
10286 *
10287 * An example of registering a privileged scheme, that bypasses Content Security
10288 * Policy:
10289 *
10290 * A standard scheme adheres to what RFC 3986 calls generic URI syntax. For example
10291 * `http` and `https` are standard schemes, while `file` is not.
10292 *
10293 * Registering a scheme as standard allows relative and absolute resources to be
10294 * resolved correctly when served. Otherwise the scheme will behave like the `file`
10295 * protocol, but without the ability to resolve relative URLs.
10296 *
10297 * For example when you load following page with custom protocol without
10298 * registering it as standard scheme, the image will not be loaded because
10299 * non-standard schemes can not recognize relative URLs:
10300 *
10301 * Registering a scheme as standard will allow access to files through the
10302 * FileSystem API. Otherwise the renderer will throw a security error for the
10303 * scheme.
10304 *
10305 * By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
10306 * cookies) are disabled for non standard schemes. So in general if you want to
10307 * register a custom protocol to replace the `http` protocol, you have to register
10308 * it as a standard scheme.
10309 *
10310 * Protocols that use streams (http and stream protocols) should set `stream:
10311 * true`. The `<video>` and `<audio>` HTML elements expect protocols to buffer
10312 * their responses by default. The `stream` flag configures those elements to
10313 * correctly expect streaming responses.
10314 */
10315 registerSchemesAsPrivileged(customSchemes: CustomScheme[]): void;
10316 /**
10317 * Whether the protocol was successfully registered
10318 *
10319 * Registers a protocol of `scheme` that will send a stream as a response.
10320 *
10321 * The usage is the same with `registerFileProtocol`, except that the `callback`
10322 * should be called with either a `ReadableStream` object or an object that has the
10323 * `data` property.
10324 *
10325 * Example:
10326 *
10327 * It is possible to pass any object that implements the readable stream API (emits
10328 * `data`/`end`/`error` events). For example, here's how a file could be returned:
10329 *
10330 * @deprecated
10331 */
10332 registerStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
10333 /**
10334 * Whether the protocol was successfully registered
10335 *
10336 * Registers a protocol of `scheme` that will send a `string` as a response.
10337 *
10338 * The usage is the same with `registerFileProtocol`, except that the `callback`
10339 * should be called with either a `string` or an object that has the `data`
10340 * property.
10341 *
10342 * @deprecated
10343 */
10344 registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
10345 /**
10346 * Removes a protocol handler registered with `protocol.handle`.
10347 */
10348 unhandle(scheme: string): void;
10349 /**
10350 * Whether the protocol was successfully unintercepted
10351 *
10352 * Remove the interceptor installed for `scheme` and restore its original handler.
10353 *
10354 * @deprecated
10355 */
10356 uninterceptProtocol(scheme: string): boolean;
10357 /**
10358 * Whether the protocol was successfully unregistered
10359 *
10360 * Unregisters the custom protocol of `scheme`.
10361 *
10362 * @deprecated
10363 */
10364 unregisterProtocol(scheme: string): boolean;
10365 }
10366
10367 interface ProtocolRequest {
10368
10369 // Docs: https://electronjs.org/docs/api/structures/protocol-request
10370
10371 headers: Record<string, string>;
10372 method: string;
10373 referrer: string;
10374 uploadData?: UploadData[];
10375 url: string;
10376 }
10377
10378 interface ProtocolResponse {
10379
10380 // Docs: https://electronjs.org/docs/api/structures/protocol-response
10381
10382 /**
10383 * The charset of response body, default is `"utf-8"`.
10384 */
10385 charset?: string;
10386 /**
10387 * The response body. When returning stream as response, this is a Node.js readable
10388 * stream representing the response body. When returning `Buffer` as response, this
10389 * is a `Buffer`. When returning `string` as response, this is a `string`. This is
10390 * ignored for other types of responses.
10391 */
10392 data?: (Buffer) | (string) | (NodeJS.ReadableStream);
10393 /**
10394 * When assigned, the `request` will fail with the `error` number . For the
10395 * available error numbers you can use, please see the net error list.
10396 */
10397 error?: number;
10398 /**
10399 * An object containing the response headers. The keys must be string, and values
10400 * must be either string or Array of string.
10401 */
10402 headers?: Record<string, (string) | (string[])>;
10403 /**
10404 * The HTTP `method`. This is only used for file and URL responses.
10405 */
10406 method?: string;
10407 /**
10408 * The MIME type of response body, default is `"text/html"`. Setting `mimeType`
10409 * would implicitly set the `content-type` header in response, but if
10410 * `content-type` is already set in `headers`, the `mimeType` would be ignored.
10411 */
10412 mimeType?: string;
10413 /**
10414 * Path to the file which would be sent as response body. This is only used for
10415 * file responses.
10416 */
10417 path?: string;
10418 /**
10419 * The `referrer` URL. This is only used for file and URL responses.
10420 */
10421 referrer?: string;
10422 /**
10423 * The session used for requesting URL, by default the HTTP request will reuse the
10424 * current session. Setting `session` to `null` would use a random independent
10425 * session. This is only used for URL responses.
10426 */
10427 session?: Session;
10428 /**
10429 * The HTTP response code, default is 200.
10430 */
10431 statusCode?: number;
10432 /**
10433 * The data used as upload data. This is only used for URL responses when `method`
10434 * is `"POST"`.
10435 */
10436 uploadData?: ProtocolResponseUploadData;
10437 /**
10438 * Download the `url` and pipe the result as response body. This is only used for
10439 * URL responses.
10440 */
10441 url?: string;
10442 }
10443
10444 interface ProtocolResponseUploadData {
10445
10446 // Docs: https://electronjs.org/docs/api/structures/protocol-response-upload-data
10447
10448 /**
10449 * MIME type of the content.
10450 */
10451 contentType: string;
10452 /**
10453 * Content to be sent.
10454 */
10455 data: (string) | (Buffer);
10456 }
10457
10458 interface ProxyConfig {
10459
10460 // Docs: https://electronjs.org/docs/api/structures/proxy-config
10461
10462 /**
10463 * The proxy mode. Should be one of `direct`, `auto_detect`, `pac_script`,
10464 * `fixed_servers` or `system`. Defaults to `pac_script` proxy mode if `pacScript`
10465 * option is specified otherwise defaults to `fixed_servers`.
10466 */
10467 mode?: ('direct' | 'auto_detect' | 'pac_script' | 'fixed_servers' | 'system');
10468 /**
10469 * The URL associated with the PAC file.
10470 */
10471 pacScript?: string;
10472 /**
10473 * Rules indicating which URLs should bypass the proxy settings.
10474 */
10475 proxyBypassRules?: string;
10476 /**
10477 * Rules indicating which proxies to use.
10478 */
10479 proxyRules?: string;
10480 }
10481
10482 interface PushNotifications extends NodeJS.EventEmitter {
10483
10484 // Docs: https://electronjs.org/docs/api/push-notifications
10485
10486 /**
10487 * Emitted when the app receives a remote notification while running. See:
10488 * https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
10489 *
10490 * @platform darwin
10491 */
10492 on(event: 'received-apns-notification', listener: (event: Event,
10493 userInfo: Record<string, any>) => void): this;
10494 /**
10495 * @platform darwin
10496 */
10497 off(event: 'received-apns-notification', listener: (event: Event,
10498 userInfo: Record<string, any>) => void): this;
10499 /**
10500 * @platform darwin
10501 */
10502 once(event: 'received-apns-notification', listener: (event: Event,
10503 userInfo: Record<string, any>) => void): this;
10504 /**
10505 * @platform darwin
10506 */
10507 addListener(event: 'received-apns-notification', listener: (event: Event,
10508 userInfo: Record<string, any>) => void): this;
10509 /**
10510 * @platform darwin
10511 */
10512 removeListener(event: 'received-apns-notification', listener: (event: Event,
10513 userInfo: Record<string, any>) => void): this;
10514 /**
10515 * Registers the app with Apple Push Notification service (APNS) to receive Badge,
10516 * Sound, and Alert notifications. If registration is successful, the promise will
10517 * be resolved with the APNS device token. Otherwise, the promise will be rejected
10518 * with an error message. See:
10519 * https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
10520 *
10521 * @platform darwin
10522 */
10523 registerForAPNSNotifications(): Promise<string>;
10524 /**
10525 * Unregisters the app from notifications received from APNS. See:
10526 * https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc
10527 *
10528 * @platform darwin
10529 */
10530 unregisterForAPNSNotifications(): void;
10531 }
10532
10533 interface Rectangle {
10534
10535 // Docs: https://electronjs.org/docs/api/structures/rectangle
10536
10537 /**
10538 * The height of the rectangle (must be an integer).
10539 */
10540 height: number;
10541 /**
10542 * The width of the rectangle (must be an integer).
10543 */
10544 width: number;
10545 /**
10546 * The x coordinate of the origin of the rectangle (must be an integer).
10547 */
10548 x: number;
10549 /**
10550 * The y coordinate of the origin of the rectangle (must be an integer).
10551 */
10552 y: number;
10553 }
10554
10555 interface Referrer {
10556
10557 // Docs: https://electronjs.org/docs/api/structures/referrer
10558
10559 /**
10560 * Can be `default`, `unsafe-url`, `no-referrer-when-downgrade`, `no-referrer`,
10561 * `origin`, `strict-origin-when-cross-origin`, `same-origin` or `strict-origin`.
10562 * See the Referrer-Policy spec for more details on the meaning of these values.
10563 */
10564 policy: ('default' | 'unsafe-url' | 'no-referrer-when-downgrade' | 'no-referrer' | 'origin' | 'strict-origin-when-cross-origin' | 'same-origin' | 'strict-origin');
10565 /**
10566 * HTTP Referrer URL.
10567 */
10568 url: string;
10569 }
10570
10571 interface RenderProcessGoneDetails {
10572
10573 // Docs: https://electronjs.org/docs/api/structures/render-process-gone-details
10574
10575 /**
10576 * The exit code of the process, unless `reason` is `launch-failed`, in which case
10577 * `exitCode` will be a platform-specific launch failure error code.
10578 */
10579 exitCode: number;
10580 /**
10581 * The reason the render process is gone. Possible values:
10582 */
10583 reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
10584 }
10585
10586 interface ResolvedEndpoint {
10587
10588 // Docs: https://electronjs.org/docs/api/structures/resolved-endpoint
10589
10590 address: string;
10591 /**
10592 * One of the following:
10593 */
10594 family: ('ipv4' | 'ipv6' | 'unspec');
10595 }
10596
10597 interface ResolvedHost {
10598
10599 // Docs: https://electronjs.org/docs/api/structures/resolved-host
10600
10601 /**
10602 * resolved DNS entries for the hostname
10603 */
10604 endpoints: ResolvedEndpoint[];
10605 }
10606
10607 interface SafeStorage extends NodeJS.EventEmitter {
10608
10609 // Docs: https://electronjs.org/docs/api/safe-storage
10610
10611 /**
10612 * the decrypted string. Decrypts the encrypted buffer obtained with
10613 * `safeStorage.encryptString` back into a string.
10614 *
10615 * This function will throw an error if decryption fails.
10616 */
10617 decryptString(encrypted: Buffer): string;
10618 /**
10619 * An array of bytes representing the encrypted string.
10620 *
10621 * This function will throw an error if encryption fails.
10622 */
10623 encryptString(plainText: string): Buffer;
10624 /**
10625 * User friendly name of the password manager selected on Linux.
10626 *
10627 * This function will return one of the following values:
10628 *
10629 * * `basic_text` - When the desktop environment is not recognised or if the
10630 * following command line flag is provided `--password-store="basic"`.
10631 * * `gnome_libsecret` - When the desktop environment is `X-Cinnamon`, `Deepin`,
10632 * `GNOME`, `Pantheon`, `XFCE`, `UKUI`, `unity` or if the following command line
10633 * flag is provided `--password-store="gnome-libsecret"`.
10634 * * `kwallet` - When the desktop session is `kde4` or if the following command
10635 * line flag is provided `--password-store="kwallet"`.
10636 * * `kwallet5` - When the desktop session is `kde5` or if the following command
10637 * line flag is provided `--password-store="kwallet5"`.
10638 * * `kwallet6` - When the desktop session is `kde6`.
10639 * * `unknown` - When the function is called before app has emitted the `ready`
10640 * event.
10641 *
10642 * @platform linux
10643 */
10644 getSelectedStorageBackend(): ('basic_text' | 'gnome_libsecret' | 'kwallet' | 'kwallet5' | 'kwallet6' | 'unknown');
10645 /**
10646 * Whether encryption is available.
10647 *
10648 * On Linux, returns true if the app has emitted the `ready` event and the secret
10649 * key is available. On MacOS, returns true if Keychain is available. On Windows,
10650 * returns true once the app has emitted the `ready` event.
10651 */
10652 isEncryptionAvailable(): boolean;
10653 /**
10654 * This function on Linux will force the module to use an in memory password for
10655 * creating symmetric key that is used for encrypt/decrypt functions when a valid
10656 * OS password manager cannot be determined for the current active desktop
10657 * environment. This function is a no-op on Windows and MacOS.
10658 */
10659 setUsePlainTextEncryption(usePlainText: boolean): void;
10660 }
10661
10662 interface Screen extends NodeJS.EventEmitter {
10663
10664 // Docs: https://electronjs.org/docs/api/screen
10665
10666 /**
10667 * Emitted when `newDisplay` has been added.
10668 */
10669 on(event: 'display-added', listener: (event: Event,
10670 newDisplay: Display) => void): this;
10671 off(event: 'display-added', listener: (event: Event,
10672 newDisplay: Display) => void): this;
10673 once(event: 'display-added', listener: (event: Event,
10674 newDisplay: Display) => void): this;
10675 addListener(event: 'display-added', listener: (event: Event,
10676 newDisplay: Display) => void): this;
10677 removeListener(event: 'display-added', listener: (event: Event,
10678 newDisplay: Display) => void): this;
10679 /**
10680 * Emitted when one or more metrics change in a `display`. The `changedMetrics` is
10681 * an array of strings that describe the changes. Possible changes are `bounds`,
10682 * `workArea`, `scaleFactor` and `rotation`.
10683 */
10684 on(event: 'display-metrics-changed', listener: (event: Event,
10685 display: Display,
10686 changedMetrics: string[]) => void): this;
10687 off(event: 'display-metrics-changed', listener: (event: Event,
10688 display: Display,
10689 changedMetrics: string[]) => void): this;
10690 once(event: 'display-metrics-changed', listener: (event: Event,
10691 display: Display,
10692 changedMetrics: string[]) => void): this;
10693 addListener(event: 'display-metrics-changed', listener: (event: Event,
10694 display: Display,
10695 changedMetrics: string[]) => void): this;
10696 removeListener(event: 'display-metrics-changed', listener: (event: Event,
10697 display: Display,
10698 changedMetrics: string[]) => void): this;
10699 /**
10700 * Emitted when `oldDisplay` has been removed.
10701 */
10702 on(event: 'display-removed', listener: (event: Event,
10703 oldDisplay: Display) => void): this;
10704 off(event: 'display-removed', listener: (event: Event,
10705 oldDisplay: Display) => void): this;
10706 once(event: 'display-removed', listener: (event: Event,
10707 oldDisplay: Display) => void): this;
10708 addListener(event: 'display-removed', listener: (event: Event,
10709 oldDisplay: Display) => void): this;
10710 removeListener(event: 'display-removed', listener: (event: Event,
10711 oldDisplay: Display) => void): this;
10712 /**
10713 * Converts a screen DIP point to a screen physical point. The DPI scale is
10714 * performed relative to the display containing the DIP point.
10715 *
10716 * @platform win32
10717 */
10718 dipToScreenPoint(point: Point): Point;
10719 /**
10720 * Converts a screen DIP rect to a screen physical rect. The DPI scale is performed
10721 * relative to the display nearest to `window`. If `window` is null, scaling will
10722 * be performed to the display nearest to `rect`.
10723 *
10724 * @platform win32
10725 */
10726 dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
10727 /**
10728 * An array of displays that are currently available.
10729 */
10730 getAllDisplays(): Display[];
10731 /**
10732 * The current absolute position of the mouse pointer.
10733 *
10734 * **Note:** The return value is a DIP point, not a screen physical point.
10735 */
10736 getCursorScreenPoint(): Point;
10737 /**
10738 * The display that most closely intersects the provided bounds.
10739 */
10740 getDisplayMatching(rect: Rectangle): Display;
10741 /**
10742 * The display nearest the specified point.
10743 */
10744 getDisplayNearestPoint(point: Point): Display;
10745 /**
10746 * The primary display.
10747 */
10748 getPrimaryDisplay(): Display;
10749 /**
10750 * Converts a screen physical point to a screen DIP point. The DPI scale is
10751 * performed relative to the display containing the physical point.
10752 *
10753 * @platform win32
10754 */
10755 screenToDipPoint(point: Point): Point;
10756 /**
10757 * Converts a screen physical rect to a screen DIP rect. The DPI scale is performed
10758 * relative to the display nearest to `window`. If `window` is null, scaling will
10759 * be performed to the display nearest to `rect`.
10760 *
10761 * @platform win32
10762 */
10763 screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
10764 }
10765
10766 interface ScrubberItem {
10767
10768 // Docs: https://electronjs.org/docs/api/structures/scrubber-item
10769
10770 /**
10771 * The image to appear in this item.
10772 */
10773 icon?: NativeImage;
10774 /**
10775 * The text to appear in this item.
10776 */
10777 label?: string;
10778 }
10779
10780 interface SegmentedControlSegment {
10781
10782 // Docs: https://electronjs.org/docs/api/structures/segmented-control-segment
10783
10784 /**
10785 * Whether this segment is selectable. Default: true.
10786 */
10787 enabled?: boolean;
10788 /**
10789 * The image to appear in this segment.
10790 */
10791 icon?: NativeImage;
10792 /**
10793 * The text to appear in this segment.
10794 */
10795 label?: string;
10796 }
10797
10798 interface SerialPort {
10799
10800 // Docs: https://electronjs.org/docs/api/structures/serial-port
10801
10802 /**
10803 * A stable identifier on Windows that can be used for device permissions.
10804 *
10805 * @platform win32
10806 */
10807 deviceInstanceId?: string;
10808 /**
10809 * A string suitable for display to the user for describing this device.
10810 */
10811 displayName?: string;
10812 /**
10813 * Unique identifier for the port.
10814 */
10815 portId: string;
10816 /**
10817 * Name of the port.
10818 */
10819 portName: string;
10820 /**
10821 * The USB product ID.
10822 */
10823 productId?: string;
10824 /**
10825 * The USB device serial number.
10826 */
10827 serialNumber?: string;
10828 /**
10829 * Represents a single serial port on macOS can be enumerated by multiple drivers.
10830 *
10831 * @platform darwin
10832 */
10833 usbDriverName?: string;
10834 /**
10835 * The USB vendor ID.
10836 */
10837 vendorId?: string;
10838 }
10839
10840 interface ServiceWorkerInfo {
10841
10842 // Docs: https://electronjs.org/docs/api/structures/service-worker-info
10843
10844 /**
10845 * The virtual ID of the process that this service worker is running in. This is
10846 * not an OS level PID. This aligns with the ID set used for
10847 * `webContents.getProcessId()`.
10848 */
10849 renderProcessId: number;
10850 /**
10851 * The base URL that this service worker is active for.
10852 */
10853 scope: string;
10854 /**
10855 * The full URL to the script that this service worker runs
10856 */
10857 scriptUrl: string;
10858 }
10859
10860 class ServiceWorkers extends NodeEventEmitter {
10861
10862 // Docs: https://electronjs.org/docs/api/service-workers
10863
10864 /**
10865 * Emitted when a service worker logs something to the console.
10866 */
10867 on(event: 'console-message', listener: (event: Event,
10868 /**
10869 * Information about the console message
10870 */
10871 messageDetails: MessageDetails) => void): this;
10872 off(event: 'console-message', listener: (event: Event,
10873 /**
10874 * Information about the console message
10875 */
10876 messageDetails: MessageDetails) => void): this;
10877 once(event: 'console-message', listener: (event: Event,
10878 /**
10879 * Information about the console message
10880 */
10881 messageDetails: MessageDetails) => void): this;
10882 addListener(event: 'console-message', listener: (event: Event,
10883 /**
10884 * Information about the console message
10885 */
10886 messageDetails: MessageDetails) => void): this;
10887 removeListener(event: 'console-message', listener: (event: Event,
10888 /**
10889 * Information about the console message
10890 */
10891 messageDetails: MessageDetails) => void): this;
10892 /**
10893 * Emitted when a service worker has been registered. Can occur after a call to
10894 * `navigator.serviceWorker.register('/sw.js')` successfully resolves or when a
10895 * Chrome extension is loaded.
10896 */
10897 on(event: 'registration-completed', listener: (event: Event,
10898 /**
10899 * Information about the registered service worker
10900 */
10901 details: RegistrationCompletedDetails) => void): this;
10902 off(event: 'registration-completed', listener: (event: Event,
10903 /**
10904 * Information about the registered service worker
10905 */
10906 details: RegistrationCompletedDetails) => void): this;
10907 once(event: 'registration-completed', listener: (event: Event,
10908 /**
10909 * Information about the registered service worker
10910 */
10911 details: RegistrationCompletedDetails) => void): this;
10912 addListener(event: 'registration-completed', listener: (event: Event,
10913 /**
10914 * Information about the registered service worker
10915 */
10916 details: RegistrationCompletedDetails) => void): this;
10917 removeListener(event: 'registration-completed', listener: (event: Event,
10918 /**
10919 * Information about the registered service worker
10920 */
10921 details: RegistrationCompletedDetails) => void): this;
10922 /**
10923 * A ServiceWorkerInfo object where the keys are the service worker version ID and
10924 * the values are the information about that service worker.
10925 */
10926 getAllRunning(): Record<number, ServiceWorkerInfo>;
10927 /**
10928 * Information about this service worker
10929 *
10930 * If the service worker does not exist or is not running this method will throw an
10931 * exception.
10932 */
10933 getFromVersionID(versionId: number): ServiceWorkerInfo;
10934 }
10935
10936 class Session extends NodeEventEmitter {
10937
10938 // Docs: https://electronjs.org/docs/api/session
10939
10940 /**
10941 * A session instance from `partition` string. When there is an existing `Session`
10942 * with the same `partition`, it will be returned; otherwise a new `Session`
10943 * instance will be created with `options`.
10944 *
10945 * If `partition` starts with `persist:`, the page will use a persistent session
10946 * available to all pages in the app with the same `partition`. if there is no
10947 * `persist:` prefix, the page will use an in-memory session. If the `partition` is
10948 * empty then default session of the app will be returned.
10949 *
10950 * To create a `Session` with `options`, you have to ensure the `Session` with the
10951 * `partition` has never been used before. There is no way to change the `options`
10952 * of an existing `Session` object.
10953 */
10954 static fromPartition(partition: string, options?: FromPartitionOptions): Session;
10955 /**
10956 * A session instance from the absolute path as specified by the `path` string.
10957 * When there is an existing `Session` with the same absolute path, it will be
10958 * returned; otherwise a new `Session` instance will be created with `options`. The
10959 * call will throw an error if the path is not an absolute path. Additionally, an
10960 * error will be thrown if an empty string is provided.
10961 *
10962 * To create a `Session` with `options`, you have to ensure the `Session` with the
10963 * `path` has never been used before. There is no way to change the `options` of an
10964 * existing `Session` object.
10965 */
10966 static fromPath(path: string, options?: FromPathOptions): Session;
10967 /**
10968 * A `Session` object, the default session object of the app.
10969 */
10970 static defaultSession: Session;
10971 /**
10972 * Emitted after an extension is loaded. This occurs whenever an extension is added
10973 * to the "enabled" set of extensions. This includes:
10974 *
10975 * * Extensions being loaded from `Session.loadExtension`.
10976 * * Extensions being reloaded:
10977 * * from a crash.
10978 * * if the extension requested it (`chrome.runtime.reload()`).
10979 */
10980 on(event: 'extension-loaded', listener: (event: Event,
10981 extension: Extension) => void): this;
10982 off(event: 'extension-loaded', listener: (event: Event,
10983 extension: Extension) => void): this;
10984 once(event: 'extension-loaded', listener: (event: Event,
10985 extension: Extension) => void): this;
10986 addListener(event: 'extension-loaded', listener: (event: Event,
10987 extension: Extension) => void): this;
10988 removeListener(event: 'extension-loaded', listener: (event: Event,
10989 extension: Extension) => void): this;
10990 /**
10991 * Emitted after an extension is loaded and all necessary browser state is
10992 * initialized to support the start of the extension's background page.
10993 */
10994 on(event: 'extension-ready', listener: (event: Event,
10995 extension: Extension) => void): this;
10996 off(event: 'extension-ready', listener: (event: Event,
10997 extension: Extension) => void): this;
10998 once(event: 'extension-ready', listener: (event: Event,
10999 extension: Extension) => void): this;
11000 addListener(event: 'extension-ready', listener: (event: Event,
11001 extension: Extension) => void): this;
11002 removeListener(event: 'extension-ready', listener: (event: Event,
11003 extension: Extension) => void): this;
11004 /**
11005 * Emitted after an extension is unloaded. This occurs when
11006 * `Session.removeExtension` is called.
11007 */
11008 on(event: 'extension-unloaded', listener: (event: Event,
11009 extension: Extension) => void): this;
11010 off(event: 'extension-unloaded', listener: (event: Event,
11011 extension: Extension) => void): this;
11012 once(event: 'extension-unloaded', listener: (event: Event,
11013 extension: Extension) => void): this;
11014 addListener(event: 'extension-unloaded', listener: (event: Event,
11015 extension: Extension) => void): this;
11016 removeListener(event: 'extension-unloaded', listener: (event: Event,
11017 extension: Extension) => void): this;
11018 /**
11019 * Emitted after `navigator.hid.requestDevice` has been called and
11020 * `select-hid-device` has fired if a new device becomes available before the
11021 * callback from `select-hid-device` is called. This event is intended for use
11022 * when using a UI to ask users to pick a device so that the UI can be updated with
11023 * the newly added device.
11024 */
11025 on(event: 'hid-device-added', listener: (event: Event,
11026 details: HidDeviceAddedDetails) => void): this;
11027 off(event: 'hid-device-added', listener: (event: Event,
11028 details: HidDeviceAddedDetails) => void): this;
11029 once(event: 'hid-device-added', listener: (event: Event,
11030 details: HidDeviceAddedDetails) => void): this;
11031 addListener(event: 'hid-device-added', listener: (event: Event,
11032 details: HidDeviceAddedDetails) => void): this;
11033 removeListener(event: 'hid-device-added', listener: (event: Event,
11034 details: HidDeviceAddedDetails) => void): this;
11035 /**
11036 * Emitted after `navigator.hid.requestDevice` has been called and
11037 * `select-hid-device` has fired if a device has been removed before the callback
11038 * from `select-hid-device` is called. This event is intended for use when using a
11039 * UI to ask users to pick a device so that the UI can be updated to remove the
11040 * specified device.
11041 */
11042 on(event: 'hid-device-removed', listener: (event: Event,
11043 details: HidDeviceRemovedDetails) => void): this;
11044 off(event: 'hid-device-removed', listener: (event: Event,
11045 details: HidDeviceRemovedDetails) => void): this;
11046 once(event: 'hid-device-removed', listener: (event: Event,
11047 details: HidDeviceRemovedDetails) => void): this;
11048 addListener(event: 'hid-device-removed', listener: (event: Event,
11049 details: HidDeviceRemovedDetails) => void): this;
11050 removeListener(event: 'hid-device-removed', listener: (event: Event,
11051 details: HidDeviceRemovedDetails) => void): this;
11052 /**
11053 * Emitted after `HIDDevice.forget()` has been called. This event can be used to
11054 * help maintain persistent storage of permissions when
11055 * `setDevicePermissionHandler` is used.
11056 */
11057 on(event: 'hid-device-revoked', listener: (event: Event,
11058 details: HidDeviceRevokedDetails) => void): this;
11059 off(event: 'hid-device-revoked', listener: (event: Event,
11060 details: HidDeviceRevokedDetails) => void): this;
11061 once(event: 'hid-device-revoked', listener: (event: Event,
11062 details: HidDeviceRevokedDetails) => void): this;
11063 addListener(event: 'hid-device-revoked', listener: (event: Event,
11064 details: HidDeviceRevokedDetails) => void): this;
11065 removeListener(event: 'hid-device-revoked', listener: (event: Event,
11066 details: HidDeviceRevokedDetails) => void): this;
11067 /**
11068 * Emitted when a render process requests preconnection to a URL, generally due to
11069 * a resource hint.
11070 */
11071 on(event: 'preconnect', listener: (event: Event,
11072 /**
11073 * The URL being requested for preconnection by the renderer.
11074 */
11075 preconnectUrl: string,
11076 /**
11077 * True if the renderer is requesting that the connection include credentials (see
11078 * the spec for more details.)
11079 */
11080 allowCredentials: boolean) => void): this;
11081 off(event: 'preconnect', listener: (event: Event,
11082 /**
11083 * The URL being requested for preconnection by the renderer.
11084 */
11085 preconnectUrl: string,
11086 /**
11087 * True if the renderer is requesting that the connection include credentials (see
11088 * the spec for more details.)
11089 */
11090 allowCredentials: boolean) => void): this;
11091 once(event: 'preconnect', listener: (event: Event,
11092 /**
11093 * The URL being requested for preconnection by the renderer.
11094 */
11095 preconnectUrl: string,
11096 /**
11097 * True if the renderer is requesting that the connection include credentials (see
11098 * the spec for more details.)
11099 */
11100 allowCredentials: boolean) => void): this;
11101 addListener(event: 'preconnect', listener: (event: Event,
11102 /**
11103 * The URL being requested for preconnection by the renderer.
11104 */
11105 preconnectUrl: string,
11106 /**
11107 * True if the renderer is requesting that the connection include credentials (see
11108 * the spec for more details.)
11109 */
11110 allowCredentials: boolean) => void): this;
11111 removeListener(event: 'preconnect', listener: (event: Event,
11112 /**
11113 * The URL being requested for preconnection by the renderer.
11114 */
11115 preconnectUrl: string,
11116 /**
11117 * True if the renderer is requesting that the connection include credentials (see
11118 * the spec for more details.)
11119 */
11120 allowCredentials: boolean) => void): this;
11121 /**
11122 * Emitted when a HID device needs to be selected when a call to
11123 * `navigator.hid.requestDevice` is made. `callback` should be called with
11124 * `deviceId` to be selected; passing no arguments to `callback` will cancel the
11125 * request. Additionally, permissioning on `navigator.hid` can be further managed
11126 * by using `ses.setPermissionCheckHandler(handler)` and
11127 * `ses.setDevicePermissionHandler(handler)`.
11128 */
11129 on(event: 'select-hid-device', listener: (event: Event,
11130 details: SelectHidDeviceDetails,
11131 callback: (deviceId?: (string) | (null)) => void) => void): this;
11132 off(event: 'select-hid-device', listener: (event: Event,
11133 details: SelectHidDeviceDetails,
11134 callback: (deviceId?: (string) | (null)) => void) => void): this;
11135 once(event: 'select-hid-device', listener: (event: Event,
11136 details: SelectHidDeviceDetails,
11137 callback: (deviceId?: (string) | (null)) => void) => void): this;
11138 addListener(event: 'select-hid-device', listener: (event: Event,
11139 details: SelectHidDeviceDetails,
11140 callback: (deviceId?: (string) | (null)) => void) => void): this;
11141 removeListener(event: 'select-hid-device', listener: (event: Event,
11142 details: SelectHidDeviceDetails,
11143 callback: (deviceId?: (string) | (null)) => void) => void): this;
11144 /**
11145 * Emitted when a serial port needs to be selected when a call to
11146 * `navigator.serial.requestPort` is made. `callback` should be called with
11147 * `portId` to be selected, passing an empty string to `callback` will cancel the
11148 * request. Additionally, permissioning on `navigator.serial` can be managed by
11149 * using ses.setPermissionCheckHandler(handler) with the `serial` permission.
11150 */
11151 on(event: 'select-serial-port', listener: (event: Event,
11152 portList: SerialPort[],
11153 webContents: WebContents,
11154 callback: (portId: string) => void) => void): this;
11155 off(event: 'select-serial-port', listener: (event: Event,
11156 portList: SerialPort[],
11157 webContents: WebContents,
11158 callback: (portId: string) => void) => void): this;
11159 once(event: 'select-serial-port', listener: (event: Event,
11160 portList: SerialPort[],
11161 webContents: WebContents,
11162 callback: (portId: string) => void) => void): this;
11163 addListener(event: 'select-serial-port', listener: (event: Event,
11164 portList: SerialPort[],
11165 webContents: WebContents,
11166 callback: (portId: string) => void) => void): this;
11167 removeListener(event: 'select-serial-port', listener: (event: Event,
11168 portList: SerialPort[],
11169 webContents: WebContents,
11170 callback: (portId: string) => void) => void): this;
11171 /**
11172 * Emitted when a USB device needs to be selected when a call to
11173 * `navigator.usb.requestDevice` is made. `callback` should be called with
11174 * `deviceId` to be selected; passing no arguments to `callback` will cancel the
11175 * request. Additionally, permissioning on `navigator.usb` can be further managed
11176 * by using `ses.setPermissionCheckHandler(handler)` and
11177 * `ses.setDevicePermissionHandler(handler)`.
11178 */
11179 on(event: 'select-usb-device', listener: (event: Event,
11180 details: SelectUsbDeviceDetails,
11181 callback: (deviceId?: string) => void) => void): this;
11182 off(event: 'select-usb-device', listener: (event: Event,
11183 details: SelectUsbDeviceDetails,
11184 callback: (deviceId?: string) => void) => void): this;
11185 once(event: 'select-usb-device', listener: (event: Event,
11186 details: SelectUsbDeviceDetails,
11187 callback: (deviceId?: string) => void) => void): this;
11188 addListener(event: 'select-usb-device', listener: (event: Event,
11189 details: SelectUsbDeviceDetails,
11190 callback: (deviceId?: string) => void) => void): this;
11191 removeListener(event: 'select-usb-device', listener: (event: Event,
11192 details: SelectUsbDeviceDetails,
11193 callback: (deviceId?: string) => void) => void): this;
11194 /**
11195 * Emitted after `navigator.serial.requestPort` has been called and
11196 * `select-serial-port` has fired if a new serial port becomes available before the
11197 * callback from `select-serial-port` is called. This event is intended for use
11198 * when using a UI to ask users to pick a port so that the UI can be updated with
11199 * the newly added port.
11200 */
11201 on(event: 'serial-port-added', listener: (event: Event,
11202 port: SerialPort,
11203 webContents: WebContents) => void): this;
11204 off(event: 'serial-port-added', listener: (event: Event,
11205 port: SerialPort,
11206 webContents: WebContents) => void): this;
11207 once(event: 'serial-port-added', listener: (event: Event,
11208 port: SerialPort,
11209 webContents: WebContents) => void): this;
11210 addListener(event: 'serial-port-added', listener: (event: Event,
11211 port: SerialPort,
11212 webContents: WebContents) => void): this;
11213 removeListener(event: 'serial-port-added', listener: (event: Event,
11214 port: SerialPort,
11215 webContents: WebContents) => void): this;
11216 /**
11217 * Emitted after `navigator.serial.requestPort` has been called and
11218 * `select-serial-port` has fired if a serial port has been removed before the
11219 * callback from `select-serial-port` is called. This event is intended for use
11220 * when using a UI to ask users to pick a port so that the UI can be updated to
11221 * remove the specified port.
11222 */
11223 on(event: 'serial-port-removed', listener: (event: Event,
11224 port: SerialPort,
11225 webContents: WebContents) => void): this;
11226 off(event: 'serial-port-removed', listener: (event: Event,
11227 port: SerialPort,
11228 webContents: WebContents) => void): this;
11229 once(event: 'serial-port-removed', listener: (event: Event,
11230 port: SerialPort,
11231 webContents: WebContents) => void): this;
11232 addListener(event: 'serial-port-removed', listener: (event: Event,
11233 port: SerialPort,
11234 webContents: WebContents) => void): this;
11235 removeListener(event: 'serial-port-removed', listener: (event: Event,
11236 port: SerialPort,
11237 webContents: WebContents) => void): this;
11238 /**
11239 * Emitted after `SerialPort.forget()` has been called. This event can be used to
11240 * help maintain persistent storage of permissions when
11241 * `setDevicePermissionHandler` is used.
11242 */
11243 on(event: 'serial-port-revoked', listener: (event: Event,
11244 details: SerialPortRevokedDetails) => void): this;
11245 off(event: 'serial-port-revoked', listener: (event: Event,
11246 details: SerialPortRevokedDetails) => void): this;
11247 once(event: 'serial-port-revoked', listener: (event: Event,
11248 details: SerialPortRevokedDetails) => void): this;
11249 addListener(event: 'serial-port-revoked', listener: (event: Event,
11250 details: SerialPortRevokedDetails) => void): this;
11251 removeListener(event: 'serial-port-revoked', listener: (event: Event,
11252 details: SerialPortRevokedDetails) => void): this;
11253 /**
11254 * Emitted when a hunspell dictionary file starts downloading
11255 */
11256 on(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
11257 /**
11258 * The language code of the dictionary file
11259 */
11260 languageCode: string) => void): this;
11261 off(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
11262 /**
11263 * The language code of the dictionary file
11264 */
11265 languageCode: string) => void): this;
11266 once(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
11267 /**
11268 * The language code of the dictionary file
11269 */
11270 languageCode: string) => void): this;
11271 addListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
11272 /**
11273 * The language code of the dictionary file
11274 */
11275 languageCode: string) => void): this;
11276 removeListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
11277 /**
11278 * The language code of the dictionary file
11279 */
11280 languageCode: string) => void): this;
11281 /**
11282 * Emitted when a hunspell dictionary file download fails. For details on the
11283 * failure you should collect a netlog and inspect the download request.
11284 */
11285 on(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
11286 /**
11287 * The language code of the dictionary file
11288 */
11289 languageCode: string) => void): this;
11290 off(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
11291 /**
11292 * The language code of the dictionary file
11293 */
11294 languageCode: string) => void): this;
11295 once(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
11296 /**
11297 * The language code of the dictionary file
11298 */
11299 languageCode: string) => void): this;
11300 addListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
11301 /**
11302 * The language code of the dictionary file
11303 */
11304 languageCode: string) => void): this;
11305 removeListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
11306 /**
11307 * The language code of the dictionary file
11308 */
11309 languageCode: string) => void): this;
11310 /**
11311 * Emitted when a hunspell dictionary file has been successfully downloaded
11312 */
11313 on(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
11314 /**
11315 * The language code of the dictionary file
11316 */
11317 languageCode: string) => void): this;
11318 off(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
11319 /**
11320 * The language code of the dictionary file
11321 */
11322 languageCode: string) => void): this;
11323 once(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
11324 /**
11325 * The language code of the dictionary file
11326 */
11327 languageCode: string) => void): this;
11328 addListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
11329 /**
11330 * The language code of the dictionary file
11331 */
11332 languageCode: string) => void): this;
11333 removeListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
11334 /**
11335 * The language code of the dictionary file
11336 */
11337 languageCode: string) => void): this;
11338 /**
11339 * Emitted when a hunspell dictionary file has been successfully initialized. This
11340 * occurs after the file has been downloaded.
11341 */
11342 on(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
11343 /**
11344 * The language code of the dictionary file
11345 */
11346 languageCode: string) => void): this;
11347 off(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
11348 /**
11349 * The language code of the dictionary file
11350 */
11351 languageCode: string) => void): this;
11352 once(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
11353 /**
11354 * The language code of the dictionary file
11355 */
11356 languageCode: string) => void): this;
11357 addListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
11358 /**
11359 * The language code of the dictionary file
11360 */
11361 languageCode: string) => void): this;
11362 removeListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
11363 /**
11364 * The language code of the dictionary file
11365 */
11366 languageCode: string) => void): this;
11367 /**
11368 * Emitted after `navigator.usb.requestDevice` has been called and
11369 * `select-usb-device` has fired if a new device becomes available before the
11370 * callback from `select-usb-device` is called. This event is intended for use
11371 * when using a UI to ask users to pick a device so that the UI can be updated with
11372 * the newly added device.
11373 */
11374 on(event: 'usb-device-added', listener: (event: Event,
11375 device: USBDevice,
11376 webContents: WebContents) => void): this;
11377 off(event: 'usb-device-added', listener: (event: Event,
11378 device: USBDevice,
11379 webContents: WebContents) => void): this;
11380 once(event: 'usb-device-added', listener: (event: Event,
11381 device: USBDevice,
11382 webContents: WebContents) => void): this;
11383 addListener(event: 'usb-device-added', listener: (event: Event,
11384 device: USBDevice,
11385 webContents: WebContents) => void): this;
11386 removeListener(event: 'usb-device-added', listener: (event: Event,
11387 device: USBDevice,
11388 webContents: WebContents) => void): this;
11389 /**
11390 * Emitted after `navigator.usb.requestDevice` has been called and
11391 * `select-usb-device` has fired if a device has been removed before the callback
11392 * from `select-usb-device` is called. This event is intended for use when using a
11393 * UI to ask users to pick a device so that the UI can be updated to remove the
11394 * specified device.
11395 */
11396 on(event: 'usb-device-removed', listener: (event: Event,
11397 device: USBDevice,
11398 webContents: WebContents) => void): this;
11399 off(event: 'usb-device-removed', listener: (event: Event,
11400 device: USBDevice,
11401 webContents: WebContents) => void): this;
11402 once(event: 'usb-device-removed', listener: (event: Event,
11403 device: USBDevice,
11404 webContents: WebContents) => void): this;
11405 addListener(event: 'usb-device-removed', listener: (event: Event,
11406 device: USBDevice,
11407 webContents: WebContents) => void): this;
11408 removeListener(event: 'usb-device-removed', listener: (event: Event,
11409 device: USBDevice,
11410 webContents: WebContents) => void): this;
11411 /**
11412 * Emitted after `USBDevice.forget()` has been called. This event can be used to
11413 * help maintain persistent storage of permissions when
11414 * `setDevicePermissionHandler` is used.
11415 */
11416 on(event: 'usb-device-revoked', listener: (event: Event,
11417 details: UsbDeviceRevokedDetails) => void): this;
11418 off(event: 'usb-device-revoked', listener: (event: Event,
11419 details: UsbDeviceRevokedDetails) => void): this;
11420 once(event: 'usb-device-revoked', listener: (event: Event,
11421 details: UsbDeviceRevokedDetails) => void): this;
11422 addListener(event: 'usb-device-revoked', listener: (event: Event,
11423 details: UsbDeviceRevokedDetails) => void): this;
11424 removeListener(event: 'usb-device-revoked', listener: (event: Event,
11425 details: UsbDeviceRevokedDetails) => void): this;
11426 /**
11427 * Emitted when Electron is about to download `item` in `webContents`.
11428 *
11429 * Calling `event.preventDefault()` will cancel the download and `item` will not be
11430 * available from next tick of the process.
11431 */
11432 on(event: 'will-download', listener: (event: Event,
11433 item: DownloadItem,
11434 webContents: WebContents) => void): this;
11435 off(event: 'will-download', listener: (event: Event,
11436 item: DownloadItem,
11437 webContents: WebContents) => void): this;
11438 once(event: 'will-download', listener: (event: Event,
11439 item: DownloadItem,
11440 webContents: WebContents) => void): this;
11441 addListener(event: 'will-download', listener: (event: Event,
11442 item: DownloadItem,
11443 webContents: WebContents) => void): this;
11444 removeListener(event: 'will-download', listener: (event: Event,
11445 item: DownloadItem,
11446 webContents: WebContents) => void): this;
11447 /**
11448 * Whether the word was successfully written to the custom dictionary. This API
11449 * will not work on non-persistent (in-memory) sessions.
11450 *
11451 * **Note:** On macOS and Windows 10 this word will be written to the OS custom
11452 * dictionary as well
11453 */
11454 addWordToSpellCheckerDictionary(word: string): boolean;
11455 /**
11456 * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
11457 * authentication.
11458 */
11459 allowNTLMCredentialsForDomains(domains: string): void;
11460 /**
11461 * resolves when the session’s HTTP authentication cache has been cleared.
11462 */
11463 clearAuthCache(): Promise<void>;
11464 /**
11465 * resolves when the cache clear operation is complete.
11466 *
11467 * Clears the session’s HTTP cache.
11468 */
11469 clearCache(): Promise<void>;
11470 /**
11471 * resolves when the code cache clear operation is complete.
11472 */
11473 clearCodeCaches(options: ClearCodeCachesOptions): Promise<void>;
11474 /**
11475 * Resolves when the operation is complete.
11476 *
11477 * Clears the host resolver cache.
11478 */
11479 clearHostResolverCache(): Promise<void>;
11480 /**
11481 * resolves when the storage data has been cleared.
11482 */
11483 clearStorageData(options?: ClearStorageDataOptions): Promise<void>;
11484 /**
11485 * Resolves when all connections are closed.
11486 *
11487 * **Note:** It will terminate / fail all requests currently in flight.
11488 */
11489 closeAllConnections(): Promise<void>;
11490 /**
11491 * Allows resuming `cancelled` or `interrupted` downloads from previous `Session`.
11492 * The API will generate a DownloadItem that can be accessed with the will-download
11493 * event. The DownloadItem will not have any `WebContents` associated with it and
11494 * the initial state will be `interrupted`. The download will start only when the
11495 * `resume` API is called on the DownloadItem.
11496 */
11497 createInterruptedDownload(options: CreateInterruptedDownloadOptions): void;
11498 /**
11499 * Disables any network emulation already active for the `session`. Resets to the
11500 * original network configuration.
11501 */
11502 disableNetworkEmulation(): void;
11503 /**
11504 * Initiates a download of the resource at `url`. The API will generate a
11505 * DownloadItem that can be accessed with the will-download event.
11506 *
11507 * **Note:** This does not perform any security checks that relate to a page's
11508 * origin, unlike `webContents.downloadURL`.
11509 */
11510 downloadURL(url: string, options?: DownloadURLOptions): void;
11511 /**
11512 * Emulates network with the given configuration for the `session`.
11513 */
11514 enableNetworkEmulation(options: EnableNetworkEmulationOptions): void;
11515 /**
11516 * see Response.
11517 *
11518 * Sends a request, similarly to how `fetch()` works in the renderer, using
11519 * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
11520 * HTTP stack.
11521 *
11522 * Example:
11523 *
11524 * See also `net.fetch()`, a convenience method which issues requests from the
11525 * default session.
11526 *
11527 * See the MDN documentation for `fetch()` for more details.
11528 *
11529 * Limitations:
11530 *
11531 * * `net.fetch()` does not support the `data:` or `blob:` schemes.
11532 * * The value of the `integrity` option is ignored.
11533 * * The `.type` and `.url` values of the returned `Response` object are incorrect.
11534 *
11535 * By default, requests made with `net.fetch` can be made to custom protocols as
11536 * well as `file:`, and will trigger webRequest handlers if present. When the
11537 * non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
11538 * protocol handlers will not be called for this request. This allows forwarding an
11539 * intercepted request to the built-in handler. webRequest handlers will still be
11540 * triggered when bypassing custom protocols.
11541 */
11542 fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
11543 /**
11544 * Writes any unwritten DOMStorage data to disk.
11545 */
11546 flushStorageData(): void;
11547 /**
11548 * Resolves when the all internal states of proxy service is reset and the latest
11549 * proxy configuration is reapplied if it's already available. The pac script will
11550 * be fetched from `pacScript` again if the proxy mode is `pac_script`.
11551 */
11552 forceReloadProxyConfig(): Promise<void>;
11553 /**
11554 * A list of all loaded extensions.
11555 *
11556 * **Note:** This API cannot be called before the `ready` event of the `app` module
11557 * is emitted.
11558 */
11559 getAllExtensions(): Extension[];
11560 /**
11561 * resolves with blob data.
11562 */
11563 getBlobData(identifier: string): Promise<Buffer>;
11564 /**
11565 * the session's current cache size, in bytes.
11566 */
11567 getCacheSize(): Promise<number>;
11568 /**
11569 * The loaded extension with the given ID.
11570 *
11571 * **Note:** This API cannot be called before the `ready` event of the `app` module
11572 * is emitted.
11573 */
11574 getExtension(extensionId: string): (Extension) | (null);
11575 /**
11576 * an array of paths to preload scripts that have been registered.
11577 */
11578 getPreloads(): string[];
11579 /**
11580 * An array of language codes the spellchecker is enabled for. If this list is
11581 * empty the spellchecker will fallback to using `en-US`. By default on launch if
11582 * this setting is an empty list Electron will try to populate this setting with
11583 * the current OS locale. This setting is persisted across restarts.
11584 *
11585 * **Note:** On macOS the OS spellchecker is used and has its own list of
11586 * languages. On macOS, this API will return whichever languages have been
11587 * configured by the OS.
11588 */
11589 getSpellCheckerLanguages(): string[];
11590 /**
11591 * The absolute file system path where data for this session is persisted on disk.
11592 * For in memory sessions this returns `null`.
11593 */
11594 getStoragePath(): (string) | (null);
11595 /**
11596 * The user agent for this session.
11597 */
11598 getUserAgent(): string;
11599 /**
11600 * Whether or not this session is a persistent one. The default `webContents`
11601 * session of a `BrowserWindow` is persistent. When creating a session from a
11602 * partition, session prefixed with `persist:` will be persistent, while others
11603 * will be temporary.
11604 */
11605 isPersistent(): boolean;
11606 /**
11607 * Whether the builtin spell checker is enabled.
11608 */
11609 isSpellCheckerEnabled(): boolean;
11610 /**
11611 * An array of all words in app's custom dictionary. Resolves when the full
11612 * dictionary is loaded from disk.
11613 */
11614 listWordsInSpellCheckerDictionary(): Promise<string[]>;
11615 /**
11616 * resolves when the extension is loaded.
11617 *
11618 * This method will raise an exception if the extension could not be loaded. If
11619 * there are warnings when installing the extension (e.g. if the extension requests
11620 * an API that Electron does not support) then they will be logged to the console.
11621 *
11622 * Note that Electron does not support the full range of Chrome extensions APIs.
11623 * See Supported Extensions APIs for more details on what is supported.
11624 *
11625 * Note that in previous versions of Electron, extensions that were loaded would be
11626 * remembered for future runs of the application. This is no longer the case:
11627 * `loadExtension` must be called on every boot of your app if you want the
11628 * extension to be loaded.
11629 *
11630 * This API does not support loading packed (.crx) extensions.
11631 *
11632 * **Note:** This API cannot be called before the `ready` event of the `app` module
11633 * is emitted.
11634 *
11635 * **Note:** Loading extensions into in-memory (non-persistent) sessions is not
11636 * supported and will throw an error.
11637 */
11638 loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
11639 /**
11640 * Preconnects the given number of sockets to an origin.
11641 */
11642 preconnect(options: PreconnectOptions): void;
11643 /**
11644 * Unloads an extension.
11645 *
11646 * **Note:** This API cannot be called before the `ready` event of the `app` module
11647 * is emitted.
11648 */
11649 removeExtension(extensionId: string): void;
11650 /**
11651 * Whether the word was successfully removed from the custom dictionary. This API
11652 * will not work on non-persistent (in-memory) sessions.
11653 *
11654 * **Note:** On macOS and Windows 10 this word will be removed from the OS custom
11655 * dictionary as well
11656 */
11657 removeWordFromSpellCheckerDictionary(word: string): boolean;
11658 /**
11659 * Resolves with the resolved IP addresses for the `host`.
11660 */
11661 resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
11662 /**
11663 * Resolves with the proxy information for `url`.
11664 */
11665 resolveProxy(url: string): Promise<string>;
11666 /**
11667 * Sets a handler to respond to Bluetooth pairing requests. This handler allows
11668 * developers to handle devices that require additional validation before pairing.
11669 * When a handler is not defined, any pairing on Linux or Windows that requires
11670 * additional validation will be automatically cancelled. macOS does not require a
11671 * handler because macOS handles the pairing automatically. To clear the handler,
11672 * call `setBluetoothPairingHandler(null)`.
11673 *
11674 * @platform win32,linux
11675 */
11676 setBluetoothPairingHandler(handler: ((details: BluetoothPairingHandlerHandlerDetails, callback: (response: Response) => void) => void) | (null)): void;
11677 /**
11678 * Sets the certificate verify proc for `session`, the `proc` will be called with
11679 * `proc(request, callback)` whenever a server certificate verification is
11680 * requested. Calling `callback(0)` accepts the certificate, calling `callback(-2)`
11681 * rejects it.
11682 *
11683 * Calling `setCertificateVerifyProc(null)` will revert back to default certificate
11684 * verify proc.
11685 *
11686 * > **NOTE:** The result of this procedure is cached by the network service.
11687 */
11688 setCertificateVerifyProc(proc: ((request: Request, callback: (verificationResult: number) => void) => void) | (null)): void;
11689 /**
11690 * Sets the directory to store the generated JS code cache for this session. The
11691 * directory is not required to be created by the user before this call, the
11692 * runtime will create if it does not exist otherwise will use the existing
11693 * directory. If directory cannot be created, then code cache will not be used and
11694 * all operations related to code cache will fail silently inside the runtime. By
11695 * default, the directory will be `Code Cache` under the respective user data
11696 * folder.
11697 *
11698 * Note that by default code cache is only enabled for http(s) URLs, to enable code
11699 * cache for custom protocols, `codeCache: true` and `standard: true` must be
11700 * specified when registering the protocol.
11701 */
11702 setCodeCachePath(path: string): void;
11703 /**
11704 * Sets the handler which can be used to respond to device permission checks for
11705 * the `session`. Returning `true` will allow the device to be permitted and
11706 * `false` will reject it. To clear the handler, call
11707 * `setDevicePermissionHandler(null)`. This handler can be used to provide default
11708 * permissioning to devices without first calling for permission to devices (eg via
11709 * `navigator.hid.requestDevice`). If this handler is not defined, the default
11710 * device permissions as granted through device selection (eg via
11711 * `navigator.hid.requestDevice`) will be used. Additionally, the default behavior
11712 * of Electron is to store granted device permission in memory. If longer term
11713 * storage is needed, a developer can store granted device permissions (eg when
11714 * handling the `select-hid-device` event) and then read from that storage with
11715 * `setDevicePermissionHandler`.
11716 */
11717 setDevicePermissionHandler(handler: ((details: DevicePermissionHandlerHandlerDetails) => boolean) | (null)): void;
11718 /**
11719 * This handler will be called when web content requests access to display media
11720 * via the `navigator.mediaDevices.getDisplayMedia` API. Use the desktopCapturer
11721 * API to choose which stream(s) to grant access to.
11722 *
11723 * Passing a WebFrameMain object as a video or audio stream will capture the video
11724 * or audio stream from that frame.
11725 *
11726 * Passing `null` instead of a function resets the handler to its default state.
11727 */
11728 setDisplayMediaRequestHandler(handler: ((request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: Streams) => void) => void) | (null)): void;
11729 /**
11730 * Sets download saving directory. By default, the download directory will be the
11731 * `Downloads` under the respective app folder.
11732 */
11733 setDownloadPath(path: string): void;
11734 /**
11735 * Sets the handler which can be used to respond to permission checks for the
11736 * `session`. Returning `true` will allow the permission and `false` will reject
11737 * it. Please note that you must also implement `setPermissionRequestHandler` to
11738 * get complete permission handling. Most web APIs do a permission check and then
11739 * make a permission request if the check is denied. To clear the handler, call
11740 * `setPermissionCheckHandler(null)`.
11741 */
11742 setPermissionCheckHandler(handler: ((webContents: (WebContents) | (null), permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'geolocation' | 'fullscreen' | 'hid' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'openExternal' | 'pointerLock' | 'serial' | 'storage-access' | 'top-level-storage-access' | 'usb', requestingOrigin: string, details: PermissionCheckHandlerHandlerDetails) => boolean) | (null)): void;
11743 /**
11744 * Sets the handler which can be used to respond to permission requests for the
11745 * `session`. Calling `callback(true)` will allow the permission and
11746 * `callback(false)` will reject it. To clear the handler, call
11747 * `setPermissionRequestHandler(null)`. Please note that you must also implement
11748 * `setPermissionCheckHandler` to get complete permission handling. Most web APIs
11749 * do a permission check and then make a permission request if the check is denied.
11750 */
11751 setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'display-capture' | 'fullscreen' | 'geolocation' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'pointerLock' | 'keyboardLock' | 'openExternal' | 'speaker-selection' | 'storage-access' | 'top-level-storage-access' | 'window-management' | 'unknown' | 'fileSystem', callback: (permissionGranted: boolean) => void, details: (PermissionRequest) | (FilesystemPermissionRequest) | (MediaAccessPermissionRequest) | (OpenExternalPermissionRequest)) => void) | (null)): void;
11752 /**
11753 * Adds scripts that will be executed on ALL web contents that are associated with
11754 * this session just before normal `preload` scripts run.
11755 */
11756 setPreloads(preloads: string[]): void;
11757 /**
11758 * Resolves when the proxy setting process is complete.
11759 *
11760 * Sets the proxy settings.
11761 *
11762 * You may need `ses.closeAllConnections` to close currently in flight connections
11763 * to prevent pooled sockets using previous proxy from being reused by future
11764 * requests.
11765 */
11766 setProxy(config: ProxyConfig): Promise<void>;
11767 /**
11768 * By default Electron will download hunspell dictionaries from the Chromium CDN.
11769 * If you want to override this behavior you can use this API to point the
11770 * dictionary downloader at your own hosted version of the hunspell dictionaries.
11771 * We publish a `hunspell_dictionaries.zip` file with each release which contains
11772 * the files you need to host here.
11773 *
11774 * The file server must be **case insensitive**. If you cannot do this, you must
11775 * upload each file twice: once with the case it has in the ZIP file and once with
11776 * the filename as all lowercase.
11777 *
11778 * If the files present in `hunspell_dictionaries.zip` are available at
11779 * `https://example.com/dictionaries/language-code.bdic` then you should call this
11780 * api with
11781 * `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`.
11782 * Please note the trailing slash. The URL to the dictionaries is formed as
11783 * `${url}${filename}`.
11784 *
11785 * **Note:** On macOS the OS spellchecker is used and therefore we do not download
11786 * any dictionary files. This API is a no-op on macOS.
11787 */
11788 setSpellCheckerDictionaryDownloadURL(url: string): void;
11789 /**
11790 * Sets whether to enable the builtin spell checker.
11791 */
11792 setSpellCheckerEnabled(enable: boolean): void;
11793 /**
11794 * The built in spellchecker does not automatically detect what language a user is
11795 * typing in. In order for the spell checker to correctly check their words you
11796 * must call this API with an array of language codes. You can get the list of
11797 * supported language codes with the `ses.availableSpellCheckerLanguages` property.
11798 *
11799 * **Note:** On macOS the OS spellchecker is used and will detect your language
11800 * automatically. This API is a no-op on macOS.
11801 */
11802 setSpellCheckerLanguages(languages: string[]): void;
11803 /**
11804 * Sets the SSL configuration for the session. All subsequent network requests will
11805 * use the new configuration. Existing network connections (such as WebSocket
11806 * connections) will not be terminated, but old sockets in the pool will not be
11807 * reused for new connections.
11808 */
11809 setSSLConfig(config: Config): void;
11810 /**
11811 * Sets the handler which can be used to override which USB classes are protected.
11812 * The return value for the handler is a string array of USB classes which should
11813 * be considered protected (eg not available in the renderer). Valid values for
11814 * the array are:
11815 *
11816 * * `audio`
11817 * * `audio-video`
11818 * * `hid`
11819 * * `mass-storage`
11820 * * `smart-card`
11821 * * `video`
11822 * * `wireless`
11823 *
11824 * Returning an empty string array from the handler will allow all USB classes;
11825 * returning the passed in array will maintain the default list of protected USB
11826 * classes (this is also the default behavior if a handler is not defined). To
11827 * clear the handler, call `setUSBProtectedClassesHandler(null)`.
11828 */
11829 setUSBProtectedClassesHandler(handler: ((details: USBProtectedClassesHandlerHandlerDetails) => string[]) | (null)): void;
11830 /**
11831 * Overrides the `userAgent` and `acceptLanguages` for this session.
11832 *
11833 * The `acceptLanguages` must a comma separated ordered list of language codes, for
11834 * example `"en-US,fr,de,ko,zh-CN,ja"`.
11835 *
11836 * This doesn't affect existing `WebContents`, and each `WebContents` can use
11837 * `webContents.setUserAgent` to override the session-wide user agent.
11838 */
11839 setUserAgent(userAgent: string, acceptLanguages?: string): void;
11840 /**
11841 * A `string[]` array which consists of all the known available spell checker
11842 * languages. Providing a language code to the `setSpellCheckerLanguages` API that
11843 * isn't in this array will result in an error.
11844 *
11845 */
11846 readonly availableSpellCheckerLanguages: string[];
11847 /**
11848 * A `Cookies` object for this session.
11849 *
11850 */
11851 readonly cookies: Cookies;
11852 /**
11853 * A `NetLog` object for this session.
11854 *
11855 */
11856 readonly netLog: NetLog;
11857 /**
11858 * A `Protocol` object for this session.
11859 *
11860 */
11861 readonly protocol: Protocol;
11862 /**
11863 * A `ServiceWorkers` object for this session.
11864 *
11865 */
11866 readonly serviceWorkers: ServiceWorkers;
11867 /**
11868 * A `boolean` indicating whether builtin spell checker is enabled.
11869 */
11870 spellCheckerEnabled: boolean;
11871 /**
11872 * A `string | null` indicating the absolute file system path where data for this
11873 * session is persisted on disk. For in memory sessions this returns `null`.
11874 *
11875 */
11876 readonly storagePath: (string) | (null);
11877 /**
11878 * A `WebRequest` object for this session.
11879 *
11880 */
11881 readonly webRequest: WebRequest;
11882 }
11883
11884 interface SharedWorkerInfo {
11885
11886 // Docs: https://electronjs.org/docs/api/structures/shared-worker-info
11887
11888 /**
11889 * The unique id of the shared worker.
11890 */
11891 id: string;
11892 /**
11893 * The url of the shared worker.
11894 */
11895 url: string;
11896 }
11897
11898 class ShareMenu extends NodeEventEmitter {
11899
11900 // Docs: https://electronjs.org/docs/api/share-menu
11901
11902 /**
11903 * ShareMenu
11904 */
11905 constructor(sharingItem: SharingItem);
11906 /**
11907 * Closes the context menu in the `browserWindow`.
11908 */
11909 closePopup(browserWindow?: BrowserWindow): void;
11910 /**
11911 * Pops up this menu as a context menu in the `BrowserWindow`.
11912 */
11913 popup(options?: PopupOptions): void;
11914 }
11915
11916 interface SharingItem {
11917
11918 // Docs: https://electronjs.org/docs/api/structures/sharing-item
11919
11920 /**
11921 * An array of files to share.
11922 */
11923 filePaths?: string[];
11924 /**
11925 * An array of text to share.
11926 */
11927 texts?: string[];
11928 /**
11929 * An array of URLs to share.
11930 */
11931 urls?: string[];
11932 }
11933
11934 interface Shell {
11935
11936 // Docs: https://electronjs.org/docs/api/shell
11937
11938 /**
11939 * Play the beep sound.
11940 */
11941 beep(): void;
11942 /**
11943 * Open the given external protocol URL in the desktop's default manner. (For
11944 * example, mailto: URLs in the user's default mail agent).
11945 */
11946 openExternal(url: string, options?: OpenExternalOptions): Promise<void>;
11947 /**
11948 * Resolves with a string containing the error message corresponding to the failure
11949 * if a failure occurred, otherwise "".
11950 *
11951 * Open the given file in the desktop's default manner.
11952 */
11953 openPath(path: string): Promise<string>;
11954 /**
11955 * Resolves the shortcut link at `shortcutPath`.
11956 *
11957 * An exception will be thrown when any error happens.
11958 *
11959 * @platform win32
11960 */
11961 readShortcutLink(shortcutPath: string): ShortcutDetails;
11962 /**
11963 * Show the given file in a file manager. If possible, select the file.
11964 */
11965 showItemInFolder(fullPath: string): void;
11966 /**
11967 * Resolves when the operation has been completed. Rejects if there was an error
11968 * while deleting the requested item.
11969 *
11970 * This moves a path to the OS-specific trash location (Trash on macOS, Recycle Bin
11971 * on Windows, and a desktop-environment-specific location on Linux).
11972 */
11973 trashItem(path: string): Promise<void>;
11974 /**
11975 * Whether the shortcut was created successfully.
11976 *
11977 * Creates or updates a shortcut link at `shortcutPath`.
11978 *
11979 * @platform win32
11980 */
11981 writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutDetails): boolean;
11982 /**
11983 * Whether the shortcut was created successfully.
11984 *
11985 * Creates or updates a shortcut link at `shortcutPath`.
11986 *
11987 * @platform win32
11988 */
11989 writeShortcutLink(shortcutPath: string, options: ShortcutDetails): boolean;
11990 }
11991
11992 interface ShortcutDetails {
11993
11994 // Docs: https://electronjs.org/docs/api/structures/shortcut-details
11995
11996 /**
11997 * The Application User Model ID. Default is empty.
11998 */
11999 appUserModelId?: string;
12000 /**
12001 * The arguments to be applied to `target` when launching from this shortcut.
12002 * Default is empty.
12003 */
12004 args?: string;
12005 /**
12006 * The working directory. Default is empty.
12007 */
12008 cwd?: string;
12009 /**
12010 * The description of the shortcut. Default is empty.
12011 */
12012 description?: string;
12013 /**
12014 * The path to the icon, can be a DLL or EXE. `icon` and `iconIndex` have to be set
12015 * together. Default is empty, which uses the target's icon.
12016 */
12017 icon?: string;
12018 /**
12019 * The resource ID of icon when `icon` is a DLL or EXE. Default is 0.
12020 */
12021 iconIndex?: number;
12022 /**
12023 * The target to launch from this shortcut.
12024 */
12025 target: string;
12026 /**
12027 * The Application Toast Activator CLSID. Needed for participating in Action
12028 * Center.
12029 */
12030 toastActivatorClsid?: string;
12031 }
12032
12033 interface Size {
12034
12035 // Docs: https://electronjs.org/docs/api/structures/size
12036
12037 height: number;
12038 width: number;
12039 }
12040
12041 interface SystemPreferences extends NodeJS.EventEmitter {
12042
12043 // Docs: https://electronjs.org/docs/api/system-preferences
12044
12045 /**
12046 * @platform win32
12047 */
12048 on(event: 'accent-color-changed', listener: (event: Event,
12049 /**
12050 * The new RGBA color the user assigned to be their system accent color.
12051 */
12052 newColor: string) => void): this;
12053 /**
12054 * @platform win32
12055 */
12056 off(event: 'accent-color-changed', listener: (event: Event,
12057 /**
12058 * The new RGBA color the user assigned to be their system accent color.
12059 */
12060 newColor: string) => void): this;
12061 /**
12062 * @platform win32
12063 */
12064 once(event: 'accent-color-changed', listener: (event: Event,
12065 /**
12066 * The new RGBA color the user assigned to be their system accent color.
12067 */
12068 newColor: string) => void): this;
12069 /**
12070 * @platform win32
12071 */
12072 addListener(event: 'accent-color-changed', listener: (event: Event,
12073 /**
12074 * The new RGBA color the user assigned to be their system accent color.
12075 */
12076 newColor: string) => void): this;
12077 /**
12078 * @platform win32
12079 */
12080 removeListener(event: 'accent-color-changed', listener: (event: Event,
12081 /**
12082 * The new RGBA color the user assigned to be their system accent color.
12083 */
12084 newColor: string) => void): this;
12085 /**
12086 * @platform win32
12087 */
12088 on(event: 'color-changed', listener: (event: Event) => void): this;
12089 /**
12090 * @platform win32
12091 */
12092 off(event: 'color-changed', listener: (event: Event) => void): this;
12093 /**
12094 * @platform win32
12095 */
12096 once(event: 'color-changed', listener: (event: Event) => void): this;
12097 /**
12098 * @platform win32
12099 */
12100 addListener(event: 'color-changed', listener: (event: Event) => void): this;
12101 /**
12102 * @platform win32
12103 */
12104 removeListener(event: 'color-changed', listener: (event: Event) => void): this;
12105 /**
12106 * A promise that resolves with `true` if consent was granted and `false` if it was
12107 * denied. If an invalid `mediaType` is passed, the promise will be rejected. If an
12108 * access request was denied and later is changed through the System Preferences
12109 * pane, a restart of the app will be required for the new permissions to take
12110 * effect. If access has already been requested and denied, it _must_ be changed
12111 * through the preference pane; an alert will not pop up and the promise will
12112 * resolve with the existing access status.
12113 *
12114 * **Important:** In order to properly leverage this API, you must set the
12115 * `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your
12116 * app's `Info.plist` file. The values for these keys will be used to populate the
12117 * permission dialogs so that the user will be properly informed as to the purpose
12118 * of the permission request. See Electron Application Distribution for more
12119 * information about how to set these in the context of Electron.
12120 *
12121 * This user consent was not required until macOS 10.14 Mojave, so this method will
12122 * always return `true` if your system is running 10.13 High Sierra.
12123 *
12124 * @platform darwin
12125 */
12126 askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise<boolean>;
12127 /**
12128 * whether or not this device has the ability to use Touch ID.
12129 *
12130 * @platform darwin
12131 */
12132 canPromptTouchID(): boolean;
12133 /**
12134 * The users current system wide accent color preference in RGBA hexadecimal form.
12135 *
12136 * This API is only available on macOS 10.14 Mojave or newer.
12137 *
12138 * @platform win32,darwin
12139 */
12140 getAccentColor(): string;
12141 /**
12142 * * `shouldRenderRichAnimation` boolean - Returns true if rich animations should
12143 * be rendered. Looks at session type (e.g. remote desktop) and accessibility
12144 * settings to give guidance for heavy animations.
12145 * * `scrollAnimationsEnabledBySystem` boolean - Determines on a per-platform basis
12146 * whether scroll animations (e.g. produced by home/end key) should be enabled.
12147 * * `prefersReducedMotion` boolean - Determines whether the user desires reduced
12148 * motion based on platform APIs.
12149 *
12150 * Returns an object with system animation settings.
12151 */
12152 getAnimationSettings(): AnimationSettings;
12153 /**
12154 * The system color setting in RGBA hexadecimal form (`#RRGGBBAA`). See the Windows
12155 * docs and the macOS docs for more details.
12156 *
12157 * The following colors are only available on macOS 10.14: `find-highlight`,
12158 * `selected-content-background`, `separator`,
12159 * `unemphasized-selected-content-background`,
12160 * `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
12161 *
12162 * @platform win32,darwin
12163 */
12164 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' | '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-text' | '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;
12165 /**
12166 * Can be `dark`, `light` or `unknown`.
12167 *
12168 * Gets the macOS appearance setting that is currently applied to your application,
12169 * maps to NSApplication.effectiveAppearance
12170 *
12171 * @platform darwin
12172 */
12173 getEffectiveAppearance(): ('dark' | 'light' | 'unknown');
12174 /**
12175 * Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
12176 *
12177 * This user consent was not required on macOS 10.13 High Sierra so this method
12178 * will always return `granted`. macOS 10.14 Mojave or higher requires consent for
12179 * `microphone` and `camera` access. macOS 10.15 Catalina or higher requires
12180 * consent for `screen` access.
12181 *
12182 * Windows 10 has a global setting controlling `microphone` and `camera` access for
12183 * all win32 applications. It will always return `granted` for `screen` and for all
12184 * media types on older versions of Windows.
12185 *
12186 * @platform win32,darwin
12187 */
12188 getMediaAccessStatus(mediaType: 'microphone' | 'camera' | 'screen'): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown');
12189 /**
12190 * The standard system color formatted as `#RRGGBBAA`.
12191 *
12192 * Returns one of several standard system colors that automatically adapt to
12193 * vibrancy and changes in accessibility settings like 'Increase contrast' and
12194 * 'Reduce transparency'. See Apple Documentation for more details.
12195 *
12196 * @platform darwin
12197 */
12198 getSystemColor(color: 'blue' | 'brown' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow'): string;
12199 /**
12200 * The value of `key` in `NSUserDefaults`.
12201 *
12202 * Some popular `key` and `type`s are:
12203 *
12204 * * `AppleInterfaceStyle`: `string`
12205 * * `AppleAquaColorVariant`: `integer`
12206 * * `AppleHighlightColor`: `string`
12207 * * `AppleShowScrollBars`: `string`
12208 * * `NSNavRecentPlaces`: `array`
12209 * * `NSPreferredWebServices`: `dictionary`
12210 * * `NSUserDictionaryReplacementItems`: `array`
12211 *
12212 * @platform darwin
12213 */
12214 getUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type): UserDefaultTypes[Type];
12215 /**
12216 * `true` if DWM composition (Aero Glass) is enabled, and `false` otherwise.
12217 *
12218 * An example of using it to determine if you should create a transparent window or
12219 * not (transparent windows won't work correctly when DWM composition is disabled):
12220 *
12221 * @platform win32
12222 */
12223 isAeroGlassEnabled(): boolean;
12224 /**
12225 * Whether the Swipe between pages setting is on.
12226 *
12227 * @platform darwin
12228 */
12229 isSwipeTrackingFromScrollEventsEnabled(): boolean;
12230 /**
12231 * `true` if the current process is a trusted accessibility client and `false` if
12232 * it is not.
12233 *
12234 * @platform darwin
12235 */
12236 isTrustedAccessibilityClient(prompt: boolean): boolean;
12237 /**
12238 * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
12239 * contains the user information dictionary sent along with the notification.
12240 *
12241 * @platform darwin
12242 */
12243 postLocalNotification(event: string, userInfo: Record<string, any>): void;
12244 /**
12245 * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
12246 * contains the user information dictionary sent along with the notification.
12247 *
12248 * @platform darwin
12249 */
12250 postNotification(event: string, userInfo: Record<string, any>, deliverImmediately?: boolean): void;
12251 /**
12252 * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
12253 * contains the user information dictionary sent along with the notification.
12254 *
12255 * @platform darwin
12256 */
12257 postWorkspaceNotification(event: string, userInfo: Record<string, any>): void;
12258 /**
12259 * resolves if the user has successfully authenticated with Touch ID.
12260 *
12261 * This API itself will not protect your user data; rather, it is a mechanism to
12262 * allow you to do so. Native apps will need to set Access Control Constants like
12263 * `kSecAccessControlUserPresence` on their keychain entry so that reading it would
12264 * auto-prompt for Touch ID biometric consent. This could be done with
12265 * `node-keytar`, such that one would store an encryption key with `node-keytar`
12266 * and only fetch it if `promptTouchID()` resolves.
12267 *
12268 * @platform darwin
12269 */
12270 promptTouchID(reason: string): Promise<void>;
12271 /**
12272 * Add the specified defaults to your application's `NSUserDefaults`.
12273 *
12274 * @platform darwin
12275 */
12276 registerDefaults(defaults: Record<string, (string) | (boolean) | (number)>): void;
12277 /**
12278 * Removes the `key` in `NSUserDefaults`. This can be used to restore the default
12279 * or global value of a `key` previously set with `setUserDefault`.
12280 *
12281 * @platform darwin
12282 */
12283 removeUserDefault(key: string): void;
12284 /**
12285 * Set the value of `key` in `NSUserDefaults`.
12286 *
12287 * Note that `type` should match actual type of `value`. An exception is thrown if
12288 * they don't.
12289 *
12290 * Some popular `key` and `type`s are:
12291 *
12292 * * `ApplePressAndHoldEnabled`: `boolean`
12293 *
12294 * @platform darwin
12295 */
12296 setUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type, value: UserDefaultTypes[Type]): void;
12297 /**
12298 * The ID of this subscription
12299 *
12300 * Same as `subscribeNotification`, but uses `NSNotificationCenter` for local
12301 * defaults. This is necessary for events such as
12302 * `NSUserDefaultsDidChangeNotification`.
12303 *
12304 * If `event` is null, the `NSNotificationCenter` doesn’t use it as criteria for
12305 * delivery to the observer. See docs for more information.
12306 *
12307 * @platform darwin
12308 */
12309 subscribeLocalNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
12310 /**
12311 * The ID of this subscription
12312 *
12313 * Subscribes to native notifications of macOS, `callback` will be called with
12314 * `callback(event, userInfo)` when the corresponding `event` happens. The
12315 * `userInfo` is an Object that contains the user information dictionary sent along
12316 * with the notification. The `object` is the sender of the notification, and only
12317 * supports `NSString` values for now.
12318 *
12319 * The `id` of the subscriber is returned, which can be used to unsubscribe the
12320 * `event`.
12321 *
12322 * Under the hood this API subscribes to `NSDistributedNotificationCenter`, example
12323 * values of `event` are:
12324 *
12325 * * `AppleInterfaceThemeChangedNotification`
12326 * * `AppleAquaColorVariantChanged`
12327 * * `AppleColorPreferencesChangedNotification`
12328 * * `AppleShowScrollBarsSettingChanged`
12329 *
12330 * If `event` is null, the `NSDistributedNotificationCenter` doesn’t use it as
12331 * criteria for delivery to the observer. See docs for more information.
12332 *
12333 * @platform darwin
12334 */
12335 subscribeNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
12336 /**
12337 * The ID of this subscription
12338 *
12339 * Same as `subscribeNotification`, but uses
12340 * `NSWorkspace.sharedWorkspace.notificationCenter`. This is necessary for events
12341 * such as `NSWorkspaceDidActivateApplicationNotification`.
12342 *
12343 * If `event` is null, the `NSWorkspaceNotificationCenter` doesn’t use it as
12344 * criteria for delivery to the observer. See docs for more information.
12345 *
12346 * @platform darwin
12347 */
12348 subscribeWorkspaceNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
12349 /**
12350 * Same as `unsubscribeNotification`, but removes the subscriber from
12351 * `NSNotificationCenter`.
12352 *
12353 * @platform darwin
12354 */
12355 unsubscribeLocalNotification(id: number): void;
12356 /**
12357 * Removes the subscriber with `id`.
12358 *
12359 * @platform darwin
12360 */
12361 unsubscribeNotification(id: number): void;
12362 /**
12363 * Same as `unsubscribeNotification`, but removes the subscriber from
12364 * `NSWorkspace.sharedWorkspace.notificationCenter`.
12365 *
12366 * @platform darwin
12367 */
12368 unsubscribeWorkspaceNotification(id: number): void;
12369 /**
12370 * A `boolean` property which determines whether the app avoids using
12371 * semitransparent backgrounds. This maps to
12372 * NSWorkspace.accessibilityDisplayShouldReduceTransparency
12373 *
12374 * @platform darwin
12375 */
12376 accessibilityDisplayShouldReduceTransparency(): boolean;
12377 /**
12378 * A `string` property that can be `dark`, `light` or `unknown`.
12379 *
12380 * Returns the macOS appearance setting that is currently applied to your
12381 * application, maps to NSApplication.effectiveAppearance
12382 *
12383 * @platform darwin
12384 */
12385 readonly effectiveAppearance: ('dark' | 'light' | 'unknown');
12386 }
12387
12388 interface Task {
12389
12390 // Docs: https://electronjs.org/docs/api/structures/task
12391
12392 /**
12393 * The command line arguments when `program` is executed.
12394 */
12395 arguments: string;
12396 /**
12397 * Description of this task.
12398 */
12399 description: string;
12400 /**
12401 * The icon index in the icon file. If an icon file consists of two or more icons,
12402 * set this value to identify the icon. If an icon file consists of one icon, this
12403 * value is 0.
12404 */
12405 iconIndex: number;
12406 /**
12407 * The absolute path to an icon to be displayed in a JumpList, which can be an
12408 * arbitrary resource file that contains an icon. You can usually specify
12409 * `process.execPath` to show the icon of the program.
12410 */
12411 iconPath: string;
12412 /**
12413 * Path of the program to execute, usually you should specify `process.execPath`
12414 * which opens the current program.
12415 */
12416 program: string;
12417 /**
12418 * The string to be displayed in a JumpList.
12419 */
12420 title: string;
12421 /**
12422 * The working directory. Default is empty.
12423 */
12424 workingDirectory?: string;
12425 }
12426
12427 interface ThumbarButton {
12428
12429 // Docs: https://electronjs.org/docs/api/structures/thumbar-button
12430
12431 click: () => void;
12432 /**
12433 * Control specific states and behaviors of the button. By default, it is
12434 * `['enabled']`.
12435 */
12436 flags?: string[];
12437 /**
12438 * The icon showing in thumbnail toolbar.
12439 */
12440 icon: NativeImage;
12441 /**
12442 * The text of the button's tooltip.
12443 */
12444 tooltip?: string;
12445 }
12446
12447 class TouchBar {
12448
12449 // Docs: https://electronjs.org/docs/api/touch-bar
12450
12451 /**
12452 * TouchBar
12453 */
12454 constructor(options: TouchBarConstructorOptions);
12455 /**
12456 * A `TouchBarItem` that will replace the "esc" button on the touch bar when set.
12457 * Setting to `null` restores the default "esc" button. Changing this value
12458 * immediately updates the escape item in the touch bar.
12459 */
12460 escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null);
12461 /**
12462 * A `typeof TouchBarButton` reference to the `TouchBarButton` class.
12463 */
12464 static TouchBarButton: typeof TouchBarButton;
12465 /**
12466 * A `typeof TouchBarColorPicker` reference to the `TouchBarColorPicker` class.
12467 */
12468 static TouchBarColorPicker: typeof TouchBarColorPicker;
12469 /**
12470 * A `typeof TouchBarGroup` reference to the `TouchBarGroup` class.
12471 */
12472 static TouchBarGroup: typeof TouchBarGroup;
12473 /**
12474 * A `typeof TouchBarLabel` reference to the `TouchBarLabel` class.
12475 */
12476 static TouchBarLabel: typeof TouchBarLabel;
12477 /**
12478 * A `typeof TouchBarOtherItemsProxy` reference to the `TouchBarOtherItemsProxy`
12479 * class.
12480 */
12481 static TouchBarOtherItemsProxy: typeof TouchBarOtherItemsProxy;
12482 /**
12483 * A `typeof TouchBarPopover` reference to the `TouchBarPopover` class.
12484 */
12485 static TouchBarPopover: typeof TouchBarPopover;
12486 /**
12487 * A `typeof TouchBarScrubber` reference to the `TouchBarScrubber` class.
12488 */
12489 static TouchBarScrubber: typeof TouchBarScrubber;
12490 /**
12491 * A `typeof TouchBarSegmentedControl` reference to the `TouchBarSegmentedControl`
12492 * class.
12493 */
12494 static TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
12495 /**
12496 * A `typeof TouchBarSlider` reference to the `TouchBarSlider` class.
12497 */
12498 static TouchBarSlider: typeof TouchBarSlider;
12499 /**
12500 * A `typeof TouchBarSpacer` reference to the `TouchBarSpacer` class.
12501 */
12502 static TouchBarSpacer: typeof TouchBarSpacer;
12503 }
12504
12505 class TouchBarButton {
12506
12507 // Docs: https://electronjs.org/docs/api/touch-bar-button
12508
12509 /**
12510 * TouchBarButton
12511 */
12512 constructor(options: TouchBarButtonConstructorOptions);
12513 /**
12514 * A `string` representing the description of the button to be read by a screen
12515 * reader. Will only be read by screen readers if no label is set.
12516 */
12517 accessibilityLabel: string;
12518 /**
12519 * A `string` hex code representing the button's current background color. Changing
12520 * this value immediately updates the button in the touch bar.
12521 */
12522 backgroundColor: string;
12523 /**
12524 * A `boolean` representing whether the button is in an enabled state.
12525 */
12526 enabled: boolean;
12527 /**
12528 * A `NativeImage` representing the button's current icon. Changing this value
12529 * immediately updates the button in the touch bar.
12530 */
12531 icon: NativeImage;
12532 /**
12533 * A `string` - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
12534 */
12535 iconPosition: ('left' | 'right' | 'overlay');
12536 /**
12537 * A `string` representing the button's current text. Changing this value
12538 * immediately updates the button in the touch bar.
12539 */
12540 label: string;
12541 }
12542
12543 class TouchBarColorPicker extends NodeEventEmitter {
12544
12545 // Docs: https://electronjs.org/docs/api/touch-bar-color-picker
12546
12547 /**
12548 * TouchBarColorPicker
12549 */
12550 constructor(options: TouchBarColorPickerConstructorOptions);
12551 /**
12552 * A `string[]` array representing the color picker's available colors to select.
12553 * Changing this value immediately updates the color picker in the touch bar.
12554 */
12555 availableColors: string[];
12556 /**
12557 * A `string` hex code representing the color picker's currently selected color.
12558 * Changing this value immediately updates the color picker in the touch bar.
12559 */
12560 selectedColor: string;
12561 }
12562
12563 class TouchBarGroup extends NodeEventEmitter {
12564
12565 // Docs: https://electronjs.org/docs/api/touch-bar-group
12566
12567 /**
12568 * TouchBarGroup
12569 */
12570 constructor(options: TouchBarGroupConstructorOptions);
12571 }
12572
12573 class TouchBarLabel extends NodeEventEmitter {
12574
12575 // Docs: https://electronjs.org/docs/api/touch-bar-label
12576
12577 /**
12578 * TouchBarLabel
12579 */
12580 constructor(options: TouchBarLabelConstructorOptions);
12581 /**
12582 * A `string` representing the description of the label to be read by a screen
12583 * reader.
12584 */
12585 accessibilityLabel: string;
12586 /**
12587 * A `string` representing the label's current text. Changing this value
12588 * immediately updates the label in the touch bar.
12589 */
12590 label: string;
12591 /**
12592 * A `string` hex code representing the label's current text color. Changing this
12593 * value immediately updates the label in the touch bar.
12594 */
12595 textColor: string;
12596 }
12597
12598 class TouchBarOtherItemsProxy extends NodeEventEmitter {
12599
12600 // Docs: https://electronjs.org/docs/api/touch-bar-other-items-proxy
12601
12602 /**
12603 * TouchBarOtherItemsProxy
12604 */
12605 constructor();
12606 }
12607
12608 class TouchBarPopover extends NodeEventEmitter {
12609
12610 // Docs: https://electronjs.org/docs/api/touch-bar-popover
12611
12612 /**
12613 * TouchBarPopover
12614 */
12615 constructor(options: TouchBarPopoverConstructorOptions);
12616 /**
12617 * A `NativeImage` representing the popover's current button icon. Changing this
12618 * value immediately updates the popover in the touch bar.
12619 */
12620 icon: NativeImage;
12621 /**
12622 * A `string` representing the popover's current button text. Changing this value
12623 * immediately updates the popover in the touch bar.
12624 */
12625 label: string;
12626 }
12627
12628 class TouchBarScrubber extends NodeEventEmitter {
12629
12630 // Docs: https://electronjs.org/docs/api/touch-bar-scrubber
12631
12632 /**
12633 * TouchBarScrubber
12634 */
12635 constructor(options: TouchBarScrubberConstructorOptions);
12636 /**
12637 * A `boolean` representing whether this scrubber is continuous or not. Updating
12638 * this value immediately updates the control in the touch bar.
12639 */
12640 continuous: boolean;
12641 /**
12642 * A `ScrubberItem[]` array representing the items in this scrubber. Updating this
12643 * value immediately updates the control in the touch bar. Updating deep properties
12644 * inside this array **does not update the touch bar**.
12645 */
12646 items: ScrubberItem[];
12647 /**
12648 * A `string` representing the mode of this scrubber. Updating this value
12649 * immediately updates the control in the touch bar. Possible values:
12650 *
12651 * * `fixed` - Maps to `NSScrubberModeFixed`.
12652 * * `free` - Maps to `NSScrubberModeFree`.
12653 */
12654 mode: ('fixed' | 'free');
12655 /**
12656 * A `string` representing the style that selected items in the scrubber should
12657 * have. This style is overlayed on top of the scrubber item instead of being
12658 * placed behind it. Updating this value immediately updates the control in the
12659 * touch bar. Possible values:
12660 *
12661 * * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
12662 * * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
12663 * * `none` - Removes all styles.
12664 */
12665 overlayStyle: ('background' | 'outline' | 'none');
12666 /**
12667 * A `string` representing the style that selected items in the scrubber should
12668 * have. Updating this value immediately updates the control in the touch bar.
12669 * Possible values:
12670 *
12671 * * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
12672 * * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
12673 * * `none` - Removes all styles.
12674 */
12675 selectedStyle: ('background' | 'outline' | 'none');
12676 /**
12677 * A `boolean` representing whether to show the left / right selection arrows in
12678 * this scrubber. Updating this value immediately updates the control in the touch
12679 * bar.
12680 */
12681 showArrowButtons: boolean;
12682 }
12683
12684 class TouchBarSegmentedControl extends NodeEventEmitter {
12685
12686 // Docs: https://electronjs.org/docs/api/touch-bar-segmented-control
12687
12688 /**
12689 * TouchBarSegmentedControl
12690 */
12691 constructor(options: TouchBarSegmentedControlConstructorOptions);
12692 /**
12693 * A `string` representing the current selection mode of the control. Can be
12694 * `single`, `multiple` or `buttons`.
12695 */
12696 mode: ('single' | 'multiple' | 'buttons');
12697 /**
12698 * A `SegmentedControlSegment[]` array representing the segments in this control.
12699 * Updating this value immediately updates the control in the touch bar. Updating
12700 * deep properties inside this array **does not update the touch bar**.
12701 */
12702 segments: SegmentedControlSegment[];
12703 /**
12704 * A `string` representing the controls current segment style. Updating this value
12705 * immediately updates the control in the touch bar.
12706 */
12707 segmentStyle: string;
12708 /**
12709 * An `Integer` representing the currently selected segment. Changing this value
12710 * immediately updates the control in the touch bar. User interaction with the
12711 * touch bar will update this value automatically.
12712 */
12713 selectedIndex: number;
12714 }
12715
12716 class TouchBarSlider extends NodeEventEmitter {
12717
12718 // Docs: https://electronjs.org/docs/api/touch-bar-slider
12719
12720 /**
12721 * TouchBarSlider
12722 */
12723 constructor(options: TouchBarSliderConstructorOptions);
12724 /**
12725 * A `string` representing the slider's current text. Changing this value
12726 * immediately updates the slider in the touch bar.
12727 */
12728 label: string;
12729 /**
12730 * A `number` representing the slider's current maximum value. Changing this value
12731 * immediately updates the slider in the touch bar.
12732 */
12733 maxValue: number;
12734 /**
12735 * A `number` representing the slider's current minimum value. Changing this value
12736 * immediately updates the slider in the touch bar.
12737 */
12738 minValue: number;
12739 /**
12740 * A `number` representing the slider's current value. Changing this value
12741 * immediately updates the slider in the touch bar.
12742 */
12743 value: number;
12744 }
12745
12746 class TouchBarSpacer extends NodeEventEmitter {
12747
12748 // Docs: https://electronjs.org/docs/api/touch-bar-spacer
12749
12750 /**
12751 * TouchBarSpacer
12752 */
12753 constructor(options: TouchBarSpacerConstructorOptions);
12754 /**
12755 * A `string` representing the size of the spacer. Can be `small`, `large` or
12756 * `flexible`.
12757 */
12758 size: ('small' | 'large' | 'flexible');
12759 }
12760
12761 interface TraceCategoriesAndOptions {
12762
12763 // Docs: https://electronjs.org/docs/api/structures/trace-categories-and-options
12764
12765 /**
12766 * A filter to control what category groups should be traced. A filter can have an
12767 * optional '-' prefix to exclude category groups that contain a matching category.
12768 * Having both included and excluded category patterns in the same list is not
12769 * supported. Examples: `test_MyTest*`, `test_MyTest*,test_OtherStuff`,
12770 * `-excluded_category1,-excluded_category2`.
12771 */
12772 categoryFilter: string;
12773 /**
12774 * Controls what kind of tracing is enabled, it is a comma-delimited sequence of
12775 * the following strings: `record-until-full`, `record-continuously`,
12776 * `trace-to-console`, `enable-sampling`, `enable-systrace`, e.g.
12777 * `'record-until-full,enable-sampling'`. The first 3 options are trace recording
12778 * modes and hence mutually exclusive. If more than one trace recording modes
12779 * appear in the `traceOptions` string, the last one takes precedence. If none of
12780 * the trace recording modes are specified, recording mode is `record-until-full`.
12781 * The trace option will first be reset to the default option (`record_mode` set to
12782 * `record-until-full`, `enable_sampling` and `enable_systrace` set to `false`)
12783 * before options parsed from `traceOptions` are applied on it.
12784 */
12785 traceOptions: string;
12786 }
12787
12788 interface TraceConfig {
12789
12790 // Docs: https://electronjs.org/docs/api/structures/trace-config
12791
12792 /**
12793 * if true, filter event data according to a specific list of events that have been
12794 * manually vetted to not include any PII. See the implementation in Chromium for
12795 * specifics.
12796 */
12797 enable_argument_filter?: boolean;
12798 /**
12799 * a list of tracing categories to exclude. Can include glob-like patterns using
12800 * `*` at the end of the category name. See tracing categories for the list of
12801 * categories.
12802 */
12803 excluded_categories?: string[];
12804 /**
12805 * a list of histogram names to report with the trace.
12806 */
12807 histogram_names?: string[];
12808 /**
12809 * a list of tracing categories to include. Can include glob-like patterns using
12810 * `*` at the end of the category name. See tracing categories for the list of
12811 * categories.
12812 */
12813 included_categories?: string[];
12814 /**
12815 * a list of process IDs to include in the trace. If not specified, trace all
12816 * processes.
12817 */
12818 included_process_ids?: number[];
12819 /**
12820 * if the `disabled-by-default-memory-infra` category is enabled, this contains
12821 * optional additional configuration for data collection. See the Chromium
12822 * memory-infra docs for more information.
12823 */
12824 memory_dump_config?: Record<string, any>;
12825 /**
12826 * Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible`
12827 * or `trace-to-console`. Defaults to `record-until-full`.
12828 */
12829 recording_mode?: ('record-until-full' | 'record-continuously' | 'record-as-much-as-possible' | 'trace-to-console');
12830 /**
12831 * maximum size of the trace recording buffer in events.
12832 */
12833 trace_buffer_size_in_events?: number;
12834 /**
12835 * maximum size of the trace recording buffer in kilobytes. Defaults to 100MB.
12836 */
12837 trace_buffer_size_in_kb?: number;
12838 }
12839
12840 interface Transaction {
12841
12842 // Docs: https://electronjs.org/docs/api/structures/transaction
12843
12844 /**
12845 * The error code if an error occurred while processing the transaction.
12846 */
12847 errorCode: number;
12848 /**
12849 * The error message if an error occurred while processing the transaction.
12850 */
12851 errorMessage: string;
12852 /**
12853 * The identifier of the restored transaction by the App Store.
12854 */
12855 originalTransactionIdentifier: string;
12856 payment: Payment;
12857 /**
12858 * The date the transaction was added to the App Store’s payment queue.
12859 */
12860 transactionDate: string;
12861 /**
12862 * A string that uniquely identifies a successful payment transaction.
12863 */
12864 transactionIdentifier: string;
12865 /**
12866 * The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or
12867 * `deferred`.
12868 */
12869 transactionState: ('purchasing' | 'purchased' | 'failed' | 'restored' | 'deferred');
12870 }
12871
12872 class Tray extends NodeEventEmitter {
12873
12874 // Docs: https://electronjs.org/docs/api/tray
12875
12876 /**
12877 * Emitted when the tray balloon is clicked.
12878 *
12879 * @platform win32
12880 */
12881 on(event: 'balloon-click', listener: Function): this;
12882 /**
12883 * @platform win32
12884 */
12885 off(event: 'balloon-click', listener: Function): this;
12886 /**
12887 * @platform win32
12888 */
12889 once(event: 'balloon-click', listener: Function): this;
12890 /**
12891 * @platform win32
12892 */
12893 addListener(event: 'balloon-click', listener: Function): this;
12894 /**
12895 * @platform win32
12896 */
12897 removeListener(event: 'balloon-click', listener: Function): this;
12898 /**
12899 * Emitted when the tray balloon is closed because of timeout or user manually
12900 * closes it.
12901 *
12902 * @platform win32
12903 */
12904 on(event: 'balloon-closed', listener: Function): this;
12905 /**
12906 * @platform win32
12907 */
12908 off(event: 'balloon-closed', listener: Function): this;
12909 /**
12910 * @platform win32
12911 */
12912 once(event: 'balloon-closed', listener: Function): this;
12913 /**
12914 * @platform win32
12915 */
12916 addListener(event: 'balloon-closed', listener: Function): this;
12917 /**
12918 * @platform win32
12919 */
12920 removeListener(event: 'balloon-closed', listener: Function): this;
12921 /**
12922 * Emitted when the tray balloon shows.
12923 *
12924 * @platform win32
12925 */
12926 on(event: 'balloon-show', listener: Function): this;
12927 /**
12928 * @platform win32
12929 */
12930 off(event: 'balloon-show', listener: Function): this;
12931 /**
12932 * @platform win32
12933 */
12934 once(event: 'balloon-show', listener: Function): this;
12935 /**
12936 * @platform win32
12937 */
12938 addListener(event: 'balloon-show', listener: Function): this;
12939 /**
12940 * @platform win32
12941 */
12942 removeListener(event: 'balloon-show', listener: Function): this;
12943 /**
12944 * Emitted when the tray icon is clicked.
12945 *
12946 * Note that on Linux this event is emitted when the tray icon receives an
12947 * activation, which might not necessarily be left mouse click.
12948 */
12949 on(event: 'click', listener: (event: KeyboardEvent,
12950 /**
12951 * The bounds of tray icon.
12952 */
12953 bounds: Rectangle,
12954 /**
12955 * The position of the event.
12956 */
12957 position: Point) => void): this;
12958 off(event: 'click', listener: (event: KeyboardEvent,
12959 /**
12960 * The bounds of tray icon.
12961 */
12962 bounds: Rectangle,
12963 /**
12964 * The position of the event.
12965 */
12966 position: Point) => void): this;
12967 once(event: 'click', listener: (event: KeyboardEvent,
12968 /**
12969 * The bounds of tray icon.
12970 */
12971 bounds: Rectangle,
12972 /**
12973 * The position of the event.
12974 */
12975 position: Point) => void): this;
12976 addListener(event: 'click', listener: (event: KeyboardEvent,
12977 /**
12978 * The bounds of tray icon.
12979 */
12980 bounds: Rectangle,
12981 /**
12982 * The position of the event.
12983 */
12984 position: Point) => void): this;
12985 removeListener(event: 'click', listener: (event: KeyboardEvent,
12986 /**
12987 * The bounds of tray icon.
12988 */
12989 bounds: Rectangle,
12990 /**
12991 * The position of the event.
12992 */
12993 position: Point) => void): this;
12994 /**
12995 * Emitted when the tray icon is double clicked.
12996 *
12997 * @platform darwin,win32
12998 */
12999 on(event: 'double-click', listener: (event: KeyboardEvent,
13000 /**
13001 * The bounds of tray icon.
13002 */
13003 bounds: Rectangle) => void): this;
13004 /**
13005 * @platform darwin,win32
13006 */
13007 off(event: 'double-click', listener: (event: KeyboardEvent,
13008 /**
13009 * The bounds of tray icon.
13010 */
13011 bounds: Rectangle) => void): this;
13012 /**
13013 * @platform darwin,win32
13014 */
13015 once(event: 'double-click', listener: (event: KeyboardEvent,
13016 /**
13017 * The bounds of tray icon.
13018 */
13019 bounds: Rectangle) => void): this;
13020 /**
13021 * @platform darwin,win32
13022 */
13023 addListener(event: 'double-click', listener: (event: KeyboardEvent,
13024 /**
13025 * The bounds of tray icon.
13026 */
13027 bounds: Rectangle) => void): this;
13028 /**
13029 * @platform darwin,win32
13030 */
13031 removeListener(event: 'double-click', listener: (event: KeyboardEvent,
13032 /**
13033 * The bounds of tray icon.
13034 */
13035 bounds: Rectangle) => void): this;
13036 /**
13037 * Emitted when a drag operation ends on the tray or ends at another location.
13038 *
13039 * @platform darwin
13040 */
13041 on(event: 'drag-end', listener: Function): this;
13042 /**
13043 * @platform darwin
13044 */
13045 off(event: 'drag-end', listener: Function): this;
13046 /**
13047 * @platform darwin
13048 */
13049 once(event: 'drag-end', listener: Function): this;
13050 /**
13051 * @platform darwin
13052 */
13053 addListener(event: 'drag-end', listener: Function): this;
13054 /**
13055 * @platform darwin
13056 */
13057 removeListener(event: 'drag-end', listener: Function): this;
13058 /**
13059 * Emitted when a drag operation enters the tray icon.
13060 *
13061 * @platform darwin
13062 */
13063 on(event: 'drag-enter', listener: Function): this;
13064 /**
13065 * @platform darwin
13066 */
13067 off(event: 'drag-enter', listener: Function): this;
13068 /**
13069 * @platform darwin
13070 */
13071 once(event: 'drag-enter', listener: Function): this;
13072 /**
13073 * @platform darwin
13074 */
13075 addListener(event: 'drag-enter', listener: Function): this;
13076 /**
13077 * @platform darwin
13078 */
13079 removeListener(event: 'drag-enter', listener: Function): this;
13080 /**
13081 * Emitted when a drag operation exits the tray icon.
13082 *
13083 * @platform darwin
13084 */
13085 on(event: 'drag-leave', listener: Function): this;
13086 /**
13087 * @platform darwin
13088 */
13089 off(event: 'drag-leave', listener: Function): this;
13090 /**
13091 * @platform darwin
13092 */
13093 once(event: 'drag-leave', listener: Function): this;
13094 /**
13095 * @platform darwin
13096 */
13097 addListener(event: 'drag-leave', listener: Function): this;
13098 /**
13099 * @platform darwin
13100 */
13101 removeListener(event: 'drag-leave', listener: Function): this;
13102 /**
13103 * Emitted when any dragged items are dropped on the tray icon.
13104 *
13105 * @platform darwin
13106 */
13107 on(event: 'drop', listener: Function): this;
13108 /**
13109 * @platform darwin
13110 */
13111 off(event: 'drop', listener: Function): this;
13112 /**
13113 * @platform darwin
13114 */
13115 once(event: 'drop', listener: Function): this;
13116 /**
13117 * @platform darwin
13118 */
13119 addListener(event: 'drop', listener: Function): this;
13120 /**
13121 * @platform darwin
13122 */
13123 removeListener(event: 'drop', listener: Function): this;
13124 /**
13125 * Emitted when dragged files are dropped in the tray icon.
13126 *
13127 * @platform darwin
13128 */
13129 on(event: 'drop-files', listener: (event: Event,
13130 /**
13131 * The paths of the dropped files.
13132 */
13133 files: string[]) => void): this;
13134 /**
13135 * @platform darwin
13136 */
13137 off(event: 'drop-files', listener: (event: Event,
13138 /**
13139 * The paths of the dropped files.
13140 */
13141 files: string[]) => void): this;
13142 /**
13143 * @platform darwin
13144 */
13145 once(event: 'drop-files', listener: (event: Event,
13146 /**
13147 * The paths of the dropped files.
13148 */
13149 files: string[]) => void): this;
13150 /**
13151 * @platform darwin
13152 */
13153 addListener(event: 'drop-files', listener: (event: Event,
13154 /**
13155 * The paths of the dropped files.
13156 */
13157 files: string[]) => void): this;
13158 /**
13159 * @platform darwin
13160 */
13161 removeListener(event: 'drop-files', listener: (event: Event,
13162 /**
13163 * The paths of the dropped files.
13164 */
13165 files: string[]) => void): this;
13166 /**
13167 * Emitted when dragged text is dropped in the tray icon.
13168 *
13169 * @platform darwin
13170 */
13171 on(event: 'drop-text', listener: (event: Event,
13172 /**
13173 * the dropped text string.
13174 */
13175 text: string) => void): this;
13176 /**
13177 * @platform darwin
13178 */
13179 off(event: 'drop-text', listener: (event: Event,
13180 /**
13181 * the dropped text string.
13182 */
13183 text: string) => void): this;
13184 /**
13185 * @platform darwin
13186 */
13187 once(event: 'drop-text', listener: (event: Event,
13188 /**
13189 * the dropped text string.
13190 */
13191 text: string) => void): this;
13192 /**
13193 * @platform darwin
13194 */
13195 addListener(event: 'drop-text', listener: (event: Event,
13196 /**
13197 * the dropped text string.
13198 */
13199 text: string) => void): this;
13200 /**
13201 * @platform darwin
13202 */
13203 removeListener(event: 'drop-text', listener: (event: Event,
13204 /**
13205 * the dropped text string.
13206 */
13207 text: string) => void): this;
13208 /**
13209 * Emitted when the tray icon is middle clicked.
13210 *
13211 * @platform win32
13212 */
13213 on(event: 'middle-click', listener: (event: KeyboardEvent,
13214 /**
13215 * The bounds of tray icon.
13216 */
13217 bounds: Rectangle) => void): this;
13218 /**
13219 * @platform win32
13220 */
13221 off(event: 'middle-click', listener: (event: KeyboardEvent,
13222 /**
13223 * The bounds of tray icon.
13224 */
13225 bounds: Rectangle) => void): this;
13226 /**
13227 * @platform win32
13228 */
13229 once(event: 'middle-click', listener: (event: KeyboardEvent,
13230 /**
13231 * The bounds of tray icon.
13232 */
13233 bounds: Rectangle) => void): this;
13234 /**
13235 * @platform win32
13236 */
13237 addListener(event: 'middle-click', listener: (event: KeyboardEvent,
13238 /**
13239 * The bounds of tray icon.
13240 */
13241 bounds: Rectangle) => void): this;
13242 /**
13243 * @platform win32
13244 */
13245 removeListener(event: 'middle-click', listener: (event: KeyboardEvent,
13246 /**
13247 * The bounds of tray icon.
13248 */
13249 bounds: Rectangle) => void): this;
13250 /**
13251 * Emitted when the mouse clicks the tray icon.
13252 *
13253 * @platform darwin
13254 */
13255 on(event: 'mouse-down', listener: (event: KeyboardEvent,
13256 /**
13257 * The position of the event.
13258 */
13259 position: Point) => void): this;
13260 /**
13261 * @platform darwin
13262 */
13263 off(event: 'mouse-down', listener: (event: KeyboardEvent,
13264 /**
13265 * The position of the event.
13266 */
13267 position: Point) => void): this;
13268 /**
13269 * @platform darwin
13270 */
13271 once(event: 'mouse-down', listener: (event: KeyboardEvent,
13272 /**
13273 * The position of the event.
13274 */
13275 position: Point) => void): this;
13276 /**
13277 * @platform darwin
13278 */
13279 addListener(event: 'mouse-down', listener: (event: KeyboardEvent,
13280 /**
13281 * The position of the event.
13282 */
13283 position: Point) => void): this;
13284 /**
13285 * @platform darwin
13286 */
13287 removeListener(event: 'mouse-down', listener: (event: KeyboardEvent,
13288 /**
13289 * The position of the event.
13290 */
13291 position: Point) => void): this;
13292 /**
13293 * Emitted when the mouse enters the tray icon.
13294 *
13295 * @platform darwin,win32
13296 */
13297 on(event: 'mouse-enter', listener: (event: KeyboardEvent,
13298 /**
13299 * The position of the event.
13300 */
13301 position: Point) => void): this;
13302 /**
13303 * @platform darwin,win32
13304 */
13305 off(event: 'mouse-enter', listener: (event: KeyboardEvent,
13306 /**
13307 * The position of the event.
13308 */
13309 position: Point) => void): this;
13310 /**
13311 * @platform darwin,win32
13312 */
13313 once(event: 'mouse-enter', listener: (event: KeyboardEvent,
13314 /**
13315 * The position of the event.
13316 */
13317 position: Point) => void): this;
13318 /**
13319 * @platform darwin,win32
13320 */
13321 addListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
13322 /**
13323 * The position of the event.
13324 */
13325 position: Point) => void): this;
13326 /**
13327 * @platform darwin,win32
13328 */
13329 removeListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
13330 /**
13331 * The position of the event.
13332 */
13333 position: Point) => void): this;
13334 /**
13335 * Emitted when the mouse exits the tray icon.
13336 *
13337 * @platform darwin,win32
13338 */
13339 on(event: 'mouse-leave', listener: (event: KeyboardEvent,
13340 /**
13341 * The position of the event.
13342 */
13343 position: Point) => void): this;
13344 /**
13345 * @platform darwin,win32
13346 */
13347 off(event: 'mouse-leave', listener: (event: KeyboardEvent,
13348 /**
13349 * The position of the event.
13350 */
13351 position: Point) => void): this;
13352 /**
13353 * @platform darwin,win32
13354 */
13355 once(event: 'mouse-leave', listener: (event: KeyboardEvent,
13356 /**
13357 * The position of the event.
13358 */
13359 position: Point) => void): this;
13360 /**
13361 * @platform darwin,win32
13362 */
13363 addListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
13364 /**
13365 * The position of the event.
13366 */
13367 position: Point) => void): this;
13368 /**
13369 * @platform darwin,win32
13370 */
13371 removeListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
13372 /**
13373 * The position of the event.
13374 */
13375 position: Point) => void): this;
13376 /**
13377 * Emitted when the mouse moves in the tray icon.
13378 *
13379 * @platform darwin,win32
13380 */
13381 on(event: 'mouse-move', listener: (event: KeyboardEvent,
13382 /**
13383 * The position of the event.
13384 */
13385 position: Point) => void): this;
13386 /**
13387 * @platform darwin,win32
13388 */
13389 off(event: 'mouse-move', listener: (event: KeyboardEvent,
13390 /**
13391 * The position of the event.
13392 */
13393 position: Point) => void): this;
13394 /**
13395 * @platform darwin,win32
13396 */
13397 once(event: 'mouse-move', listener: (event: KeyboardEvent,
13398 /**
13399 * The position of the event.
13400 */
13401 position: Point) => void): this;
13402 /**
13403 * @platform darwin,win32
13404 */
13405 addListener(event: 'mouse-move', listener: (event: KeyboardEvent,
13406 /**
13407 * The position of the event.
13408 */
13409 position: Point) => void): this;
13410 /**
13411 * @platform darwin,win32
13412 */
13413 removeListener(event: 'mouse-move', listener: (event: KeyboardEvent,
13414 /**
13415 * The position of the event.
13416 */
13417 position: Point) => void): this;
13418 /**
13419 * Emitted when the mouse is released from clicking the tray icon.
13420 *
13421 * Note: This will not be emitted if you have set a context menu for your Tray
13422 * using `tray.setContextMenu`, as a result of macOS-level constraints.
13423 *
13424 * @platform darwin
13425 */
13426 on(event: 'mouse-up', listener: (event: KeyboardEvent,
13427 /**
13428 * The position of the event.
13429 */
13430 position: Point) => void): this;
13431 /**
13432 * @platform darwin
13433 */
13434 off(event: 'mouse-up', listener: (event: KeyboardEvent,
13435 /**
13436 * The position of the event.
13437 */
13438 position: Point) => void): this;
13439 /**
13440 * @platform darwin
13441 */
13442 once(event: 'mouse-up', listener: (event: KeyboardEvent,
13443 /**
13444 * The position of the event.
13445 */
13446 position: Point) => void): this;
13447 /**
13448 * @platform darwin
13449 */
13450 addListener(event: 'mouse-up', listener: (event: KeyboardEvent,
13451 /**
13452 * The position of the event.
13453 */
13454 position: Point) => void): this;
13455 /**
13456 * @platform darwin
13457 */
13458 removeListener(event: 'mouse-up', listener: (event: KeyboardEvent,
13459 /**
13460 * The position of the event.
13461 */
13462 position: Point) => void): this;
13463 /**
13464 * Emitted when the tray icon is right clicked.
13465 *
13466 * @platform darwin,win32
13467 */
13468 on(event: 'right-click', listener: (event: KeyboardEvent,
13469 /**
13470 * The bounds of tray icon.
13471 */
13472 bounds: Rectangle) => void): this;
13473 /**
13474 * @platform darwin,win32
13475 */
13476 off(event: 'right-click', listener: (event: KeyboardEvent,
13477 /**
13478 * The bounds of tray icon.
13479 */
13480 bounds: Rectangle) => void): this;
13481 /**
13482 * @platform darwin,win32
13483 */
13484 once(event: 'right-click', listener: (event: KeyboardEvent,
13485 /**
13486 * The bounds of tray icon.
13487 */
13488 bounds: Rectangle) => void): this;
13489 /**
13490 * @platform darwin,win32
13491 */
13492 addListener(event: 'right-click', listener: (event: KeyboardEvent,
13493 /**
13494 * The bounds of tray icon.
13495 */
13496 bounds: Rectangle) => void): this;
13497 /**
13498 * @platform darwin,win32
13499 */
13500 removeListener(event: 'right-click', listener: (event: KeyboardEvent,
13501 /**
13502 * The bounds of tray icon.
13503 */
13504 bounds: Rectangle) => void): this;
13505 /**
13506 * Tray
13507 */
13508 constructor(image: (NativeImage) | (string), guid?: string);
13509 /**
13510 * Closes an open context menu, as set by `tray.setContextMenu()`.
13511 *
13512 * @platform darwin,win32
13513 */
13514 closeContextMenu(): void;
13515 /**
13516 * Destroys the tray icon immediately.
13517 */
13518 destroy(): void;
13519 /**
13520 * Displays a tray balloon.
13521 *
13522 * @platform win32
13523 */
13524 displayBalloon(options: DisplayBalloonOptions): void;
13525 /**
13526 * Returns focus to the taskbar notification area. Notification area icons should
13527 * use this message when they have completed their UI operation. For example, if
13528 * the icon displays a shortcut menu, but the user presses ESC to cancel it, use
13529 * `tray.focus()` to return focus to the notification area.
13530 *
13531 * @platform win32
13532 */
13533 focus(): void;
13534 /**
13535 * The `bounds` of this tray icon as `Object`.
13536 *
13537 * @platform darwin,win32
13538 */
13539 getBounds(): Rectangle;
13540 /**
13541 * Whether double click events will be ignored.
13542 *
13543 * @platform darwin
13544 */
13545 getIgnoreDoubleClickEvents(): boolean;
13546 /**
13547 * the title displayed next to the tray icon in the status bar
13548 *
13549 * @platform darwin
13550 */
13551 getTitle(): string;
13552 /**
13553 * Whether the tray icon is destroyed.
13554 */
13555 isDestroyed(): boolean;
13556 /**
13557 * Pops up the context menu of the tray icon. When `menu` is passed, the `menu`
13558 * will be shown instead of the tray icon's context menu.
13559 *
13560 * The `position` is only available on Windows, and it is (0, 0) by default.
13561 *
13562 * @platform darwin,win32
13563 */
13564 popUpContextMenu(menu?: Menu, position?: Point): void;
13565 /**
13566 * Removes a tray balloon.
13567 *
13568 * @platform win32
13569 */
13570 removeBalloon(): void;
13571 /**
13572 * Sets the context menu for this icon.
13573 */
13574 setContextMenu(menu: (Menu) | (null)): void;
13575 /**
13576 * Sets the option to ignore double click events. Ignoring these events allows you
13577 * to detect every individual click of the tray icon.
13578 *
13579 * This value is set to false by default.
13580 *
13581 * @platform darwin
13582 */
13583 setIgnoreDoubleClickEvents(ignore: boolean): void;
13584 /**
13585 * Sets the `image` associated with this tray icon.
13586 */
13587 setImage(image: (NativeImage) | (string)): void;
13588 /**
13589 * Sets the `image` associated with this tray icon when pressed on macOS.
13590 *
13591 * @platform darwin
13592 */
13593 setPressedImage(image: (NativeImage) | (string)): void;
13594 /**
13595 * Sets the title displayed next to the tray icon in the status bar (Support ANSI
13596 * colors).
13597 *
13598 * @platform darwin
13599 */
13600 setTitle(title: string, options?: TitleOptions): void;
13601 /**
13602 * Sets the hover text for this tray icon.
13603 */
13604 setToolTip(toolTip: string): void;
13605 }
13606
13607 interface UploadData {
13608
13609 // Docs: https://electronjs.org/docs/api/structures/upload-data
13610
13611 /**
13612 * UUID of blob data. Use ses.getBlobData method to retrieve the data.
13613 */
13614 blobUUID?: string;
13615 /**
13616 * Content being sent.
13617 */
13618 bytes: Buffer;
13619 /**
13620 * Path of file being uploaded.
13621 */
13622 file?: string;
13623 }
13624
13625 interface UploadFile {
13626
13627 // Docs: https://electronjs.org/docs/api/structures/upload-file
13628
13629 /**
13630 * Path of file to be uploaded.
13631 */
13632 filePath: string;
13633 /**
13634 * Number of bytes to read from `offset`. Defaults to `0`.
13635 */
13636 length?: number;
13637 /**
13638 * Last Modification time in number of seconds since the UNIX epoch. Defaults to
13639 * `0`.
13640 */
13641 modificationTime?: number;
13642 /**
13643 * Defaults to `0`.
13644 */
13645 offset?: number;
13646 /**
13647 * `file`.
13648 */
13649 type: 'file';
13650 }
13651
13652 interface UploadRawData {
13653
13654 // Docs: https://electronjs.org/docs/api/structures/upload-raw-data
13655
13656 /**
13657 * Data to be uploaded.
13658 */
13659 bytes: Buffer;
13660 /**
13661 * `rawData`.
13662 */
13663 type: 'rawData';
13664 }
13665
13666 interface USBDevice {
13667
13668 // Docs: https://electronjs.org/docs/api/structures/usb-device
13669
13670 /**
13671 * The device class for the communication interface supported by the device
13672 */
13673 deviceClass: number;
13674 /**
13675 * Unique identifier for the device.
13676 */
13677 deviceId: string;
13678 /**
13679 * The device protocol for the communication interface supported by the device
13680 */
13681 deviceProtocol: number;
13682 /**
13683 * The device subclass for the communication interface supported by the device
13684 */
13685 deviceSubclass: number;
13686 /**
13687 * The major version number of the device as defined by the device manufacturer.
13688 */
13689 deviceVersionMajor: number;
13690 /**
13691 * The minor version number of the device as defined by the device manufacturer.
13692 */
13693 deviceVersionMinor: number;
13694 /**
13695 * The subminor version number of the device as defined by the device manufacturer.
13696 */
13697 deviceVersionSubminor: number;
13698 /**
13699 * The manufacturer name of the device.
13700 */
13701 manufacturerName?: string;
13702 /**
13703 * The USB product ID.
13704 */
13705 productId: number;
13706 /**
13707 * Name of the device.
13708 */
13709 productName?: string;
13710 /**
13711 * The USB device serial number.
13712 */
13713 serialNumber?: string;
13714 /**
13715 * The USB protocol major version supported by the device
13716 */
13717 usbVersionMajor: number;
13718 /**
13719 * The USB protocol minor version supported by the device
13720 */
13721 usbVersionMinor: number;
13722 /**
13723 * The USB protocol subminor version supported by the device
13724 */
13725 usbVersionSubminor: number;
13726 /**
13727 * The USB vendor ID.
13728 */
13729 vendorId: number;
13730 }
13731
13732 interface UserDefaultTypes {
13733
13734 // Docs: https://electronjs.org/docs/api/structures/user-default-types
13735
13736 array: Array<unknown>;
13737 boolean: boolean;
13738 dictionary: Record<string, unknown>;
13739 double: number;
13740 float: number;
13741 integer: number;
13742 string: string;
13743 url: string;
13744 }
13745
13746 class UtilityProcess extends NodeEventEmitter {
13747
13748 // Docs: https://electronjs.org/docs/api/utility-process
13749
13750 static fork(modulePath: string, args?: string[], options?: ForkOptions): UtilityProcess;
13751 /**
13752 * Emitted after the child process ends.
13753 */
13754 on(event: 'exit', listener: (
13755 /**
13756 * Contains the exit code for the process obtained from waitpid on posix, or
13757 * GetExitCodeProcess on windows.
13758 */
13759 code: number) => void): this;
13760 off(event: 'exit', listener: (
13761 /**
13762 * Contains the exit code for the process obtained from waitpid on posix, or
13763 * GetExitCodeProcess on windows.
13764 */
13765 code: number) => void): this;
13766 once(event: 'exit', listener: (
13767 /**
13768 * Contains the exit code for the process obtained from waitpid on posix, or
13769 * GetExitCodeProcess on windows.
13770 */
13771 code: number) => void): this;
13772 addListener(event: 'exit', listener: (
13773 /**
13774 * Contains the exit code for the process obtained from waitpid on posix, or
13775 * GetExitCodeProcess on windows.
13776 */
13777 code: number) => void): this;
13778 removeListener(event: 'exit', listener: (
13779 /**
13780 * Contains the exit code for the process obtained from waitpid on posix, or
13781 * GetExitCodeProcess on windows.
13782 */
13783 code: number) => void): this;
13784 /**
13785 * Emitted when the child process sends a message using
13786 * `process.parentPort.postMessage()`.
13787 */
13788 on(event: 'message', listener: (message: any) => void): this;
13789 off(event: 'message', listener: (message: any) => void): this;
13790 once(event: 'message', listener: (message: any) => void): this;
13791 addListener(event: 'message', listener: (message: any) => void): this;
13792 removeListener(event: 'message', listener: (message: any) => void): this;
13793 /**
13794 * Emitted once the child process has spawned successfully.
13795 */
13796 on(event: 'spawn', listener: Function): this;
13797 off(event: 'spawn', listener: Function): this;
13798 once(event: 'spawn', listener: Function): this;
13799 addListener(event: 'spawn', listener: Function): this;
13800 removeListener(event: 'spawn', listener: Function): this;
13801 /**
13802 * Terminates the process gracefully. On POSIX, it uses SIGTERM but will ensure the
13803 * process is reaped on exit. This function returns true if the kill is successful,
13804 * and false otherwise.
13805 */
13806 kill(): boolean;
13807 /**
13808 * Send a message to the child process, optionally transferring ownership of zero
13809 * or more `MessagePortMain` objects.
13810 *
13811 * For example:
13812 */
13813 postMessage(message: any, transfer?: MessagePortMain[]): void;
13814 /**
13815 * A `Integer | undefined` representing the process identifier (PID) of the child
13816 * process. If the child process fails to spawn due to errors, then the value is
13817 * `undefined`. When the child process exits, then the value is `undefined` after
13818 * the `exit` event is emitted.
13819 */
13820 pid: (number) | (undefined);
13821 /**
13822 * A `NodeJS.ReadableStream | null` that represents the child process's stderr. If
13823 * the child was spawned with options.stdio[2] set to anything other than 'pipe',
13824 * then this will be `null`. When the child process exits, then the value is `null`
13825 * after the `exit` event is emitted.
13826 */
13827 stderr: (NodeJS.ReadableStream) | (null);
13828 /**
13829 * A `NodeJS.ReadableStream | null` that represents the child process's stdout. If
13830 * the child was spawned with options.stdio[1] set to anything other than 'pipe',
13831 * then this will be `null`. When the child process exits, then the value is `null`
13832 * after the `exit` event is emitted.
13833 */
13834 stdout: (NodeJS.ReadableStream) | (null);
13835 }
13836
13837 class View extends NodeEventEmitter {
13838
13839 // Docs: https://electronjs.org/docs/api/view
13840
13841 /**
13842 * Emitted when the view's bounds have changed in response to being laid out. The
13843 * new bounds can be retrieved with `view.getBounds()`.
13844 */
13845 on(event: 'bounds-changed', listener: Function): this;
13846 off(event: 'bounds-changed', listener: Function): this;
13847 once(event: 'bounds-changed', listener: Function): this;
13848 addListener(event: 'bounds-changed', listener: Function): this;
13849 removeListener(event: 'bounds-changed', listener: Function): this;
13850 /**
13851 * View
13852 */
13853 constructor();
13854 addChildView(view: View, index?: number): void;
13855 /**
13856 * The bounds of this View, relative to its parent.
13857 */
13858 getBounds(): Rectangle;
13859 removeChildView(view: View): void;
13860 /**
13861 * Examples of valid `color` values:
13862 *
13863 * * Hex
13864 * * `#fff` (RGB)
13865 * * `#ffff` (ARGB)
13866 * * `#ffffff` (RRGGBB)
13867 * * `#ffffffff` (AARRGGBB)
13868 * * RGB
13869 * * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
13870 * * e.g. `rgb(255, 255, 255)`
13871 * * RGBA
13872 * * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
13873 * * e.g. `rgba(255, 255, 255, 1.0)`
13874 * * HSL
13875 * * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
13876 * * e.g. `hsl(200, 20%, 50%)`
13877 * * HSLA
13878 * * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
13879 * * e.g. `hsla(200, 20%, 50%, 0.5)`
13880 * * Color name
13881 * * Options are listed in SkParseColor.cpp
13882 * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
13883 * * e.g. `blueviolet` or `red`
13884 *
13885 * **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
13886 * `RGB`.
13887 */
13888 setBackgroundColor(color: string): void;
13889 setBounds(bounds: Rectangle): void;
13890 setVisible(visible: boolean): void;
13891 /**
13892 * A `View[]` property representing the child views of this view.
13893 *
13894 */
13895 readonly children: View[];
13896 }
13897
13898 class WebContents extends NodeEventEmitter {
13899
13900 // Docs: https://electronjs.org/docs/api/web-contents
13901
13902 /**
13903 * A WebContents instance with the given TargetID, or `undefined` if there is no
13904 * WebContents associated with the given TargetID.
13905 *
13906 * When communicating with the Chrome DevTools Protocol, it can be useful to lookup
13907 * a WebContents instance based on its assigned TargetID.
13908 */
13909 static fromDevToolsTargetId(targetId: string): (WebContents) | (undefined);
13910 /**
13911 * A WebContents instance with the given WebFrameMain, or `undefined` if there is
13912 * no WebContents associated with the given WebFrameMain.
13913 */
13914 static fromFrame(frame: WebFrameMain): (WebContents) | (undefined);
13915 /**
13916 * A WebContents instance with the given ID, or `undefined` if there is no
13917 * WebContents associated with the given ID.
13918 */
13919 static fromId(id: number): (WebContents) | (undefined);
13920 /**
13921 * An array of all `WebContents` instances. This will contain web contents for all
13922 * windows, webviews, opened devtools, and devtools extension background pages.
13923 */
13924 static getAllWebContents(): WebContents[];
13925 /**
13926 * The web contents that is focused in this application, otherwise returns `null`.
13927 */
13928 static getFocusedWebContents(): (WebContents) | (null);
13929 /**
13930 * Emitted when media becomes audible or inaudible.
13931 */
13932 on(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
13933 off(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
13934 once(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
13935 addListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
13936 removeListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
13937 /**
13938 * Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
13939 * `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
13940 * menu shortcuts.
13941 *
13942 * To only prevent the menu shortcuts, use `setIgnoreMenuShortcuts`:
13943 */
13944 on(event: 'before-input-event', listener: (event: Event,
13945 /**
13946 * Input properties.
13947 */
13948 input: Input) => void): this;
13949 off(event: 'before-input-event', listener: (event: Event,
13950 /**
13951 * Input properties.
13952 */
13953 input: Input) => void): this;
13954 once(event: 'before-input-event', listener: (event: Event,
13955 /**
13956 * Input properties.
13957 */
13958 input: Input) => void): this;
13959 addListener(event: 'before-input-event', listener: (event: Event,
13960 /**
13961 * Input properties.
13962 */
13963 input: Input) => void): this;
13964 removeListener(event: 'before-input-event', listener: (event: Event,
13965 /**
13966 * Input properties.
13967 */
13968 input: Input) => void): this;
13969 /**
13970 * Emitted when the `WebContents` loses focus.
13971 */
13972 on(event: 'blur', listener: Function): this;
13973 off(event: 'blur', listener: Function): this;
13974 once(event: 'blur', listener: Function): this;
13975 addListener(event: 'blur', listener: Function): this;
13976 removeListener(event: 'blur', listener: Function): this;
13977 /**
13978 * Emitted when failed to verify the `certificate` for `url`.
13979 *
13980 * The usage is the same with the `certificate-error` event of `app`.
13981 */
13982 on(event: 'certificate-error', listener: (event: Event,
13983 url: string,
13984 /**
13985 * The error code.
13986 */
13987 error: string,
13988 certificate: Certificate,
13989 callback: (isTrusted: boolean) => void,
13990 isMainFrame: boolean) => void): this;
13991 off(event: 'certificate-error', listener: (event: Event,
13992 url: string,
13993 /**
13994 * The error code.
13995 */
13996 error: string,
13997 certificate: Certificate,
13998 callback: (isTrusted: boolean) => void,
13999 isMainFrame: boolean) => void): this;
14000 once(event: 'certificate-error', listener: (event: Event,
14001 url: string,
14002 /**
14003 * The error code.
14004 */
14005 error: string,
14006 certificate: Certificate,
14007 callback: (isTrusted: boolean) => void,
14008 isMainFrame: boolean) => void): this;
14009 addListener(event: 'certificate-error', listener: (event: Event,
14010 url: string,
14011 /**
14012 * The error code.
14013 */
14014 error: string,
14015 certificate: Certificate,
14016 callback: (isTrusted: boolean) => void,
14017 isMainFrame: boolean) => void): this;
14018 removeListener(event: 'certificate-error', listener: (event: Event,
14019 url: string,
14020 /**
14021 * The error code.
14022 */
14023 error: string,
14024 certificate: Certificate,
14025 callback: (isTrusted: boolean) => void,
14026 isMainFrame: boolean) => void): this;
14027 /**
14028 * Emitted when the associated window logs a console message.
14029 */
14030 on(event: 'console-message', listener: (event: Event,
14031 /**
14032 * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14033 * `error`.
14034 */
14035 level: number,
14036 /**
14037 * The actual console message
14038 */
14039 message: string,
14040 /**
14041 * The line number of the source that triggered this console message
14042 */
14043 line: number,
14044 sourceId: string) => void): this;
14045 off(event: 'console-message', listener: (event: Event,
14046 /**
14047 * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14048 * `error`.
14049 */
14050 level: number,
14051 /**
14052 * The actual console message
14053 */
14054 message: string,
14055 /**
14056 * The line number of the source that triggered this console message
14057 */
14058 line: number,
14059 sourceId: string) => void): this;
14060 once(event: 'console-message', listener: (event: Event,
14061 /**
14062 * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14063 * `error`.
14064 */
14065 level: number,
14066 /**
14067 * The actual console message
14068 */
14069 message: string,
14070 /**
14071 * The line number of the source that triggered this console message
14072 */
14073 line: number,
14074 sourceId: string) => void): this;
14075 addListener(event: 'console-message', listener: (event: Event,
14076 /**
14077 * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14078 * `error`.
14079 */
14080 level: number,
14081 /**
14082 * The actual console message
14083 */
14084 message: string,
14085 /**
14086 * The line number of the source that triggered this console message
14087 */
14088 line: number,
14089 sourceId: string) => void): this;
14090 removeListener(event: 'console-message', listener: (event: Event,
14091 /**
14092 * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14093 * `error`.
14094 */
14095 level: number,
14096 /**
14097 * The actual console message
14098 */
14099 message: string,
14100 /**
14101 * The line number of the source that triggered this console message
14102 */
14103 line: number,
14104 sourceId: string) => void): this;
14105 /**
14106 * Emitted when the page calls `window.moveTo`, `window.resizeTo` or related APIs.
14107 *
14108 * By default, this will move the window. To prevent that behavior, call
14109 * `event.preventDefault()`.
14110 */
14111 on(event: 'content-bounds-updated', listener: (event: Event,
14112 /**
14113 * requested new content bounds
14114 */
14115 bounds: Rectangle) => void): this;
14116 off(event: 'content-bounds-updated', listener: (event: Event,
14117 /**
14118 * requested new content bounds
14119 */
14120 bounds: Rectangle) => void): this;
14121 once(event: 'content-bounds-updated', listener: (event: Event,
14122 /**
14123 * requested new content bounds
14124 */
14125 bounds: Rectangle) => void): this;
14126 addListener(event: 'content-bounds-updated', listener: (event: Event,
14127 /**
14128 * requested new content bounds
14129 */
14130 bounds: Rectangle) => void): this;
14131 removeListener(event: 'content-bounds-updated', listener: (event: Event,
14132 /**
14133 * requested new content bounds
14134 */
14135 bounds: Rectangle) => void): this;
14136 /**
14137 * Emitted when there is a new context menu that needs to be handled.
14138 */
14139 on(event: 'context-menu', listener: (event: Event,
14140 params: ContextMenuParams) => void): this;
14141 off(event: 'context-menu', listener: (event: Event,
14142 params: ContextMenuParams) => void): this;
14143 once(event: 'context-menu', listener: (event: Event,
14144 params: ContextMenuParams) => void): this;
14145 addListener(event: 'context-menu', listener: (event: Event,
14146 params: ContextMenuParams) => void): this;
14147 removeListener(event: 'context-menu', listener: (event: Event,
14148 params: ContextMenuParams) => void): this;
14149 /**
14150 * Emitted when the cursor's type changes. The `type` parameter can be `pointer`,
14151 * `crosshair`, `hand`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
14152 * `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`,
14153 * `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`,
14154 * `row-resize`, `m-panning`, `m-panning-vertical`, `m-panning-horizontal`,
14155 * `e-panning`, `n-panning`, `ne-panning`, `nw-panning`, `s-panning`, `se-panning`,
14156 * `sw-panning`, `w-panning`, `move`, `vertical-text`, `cell`, `context-menu`,
14157 * `alias`, `progress`, `nodrop`, `copy`, `none`, `not-allowed`, `zoom-in`,
14158 * `zoom-out`, `grab`, `grabbing`, `custom`, `null`, `drag-drop-none`,
14159 * `drag-drop-move`, `drag-drop-copy`, `drag-drop-link`, `ns-no-resize`,
14160 * `ew-no-resize`, `nesw-no-resize`, `nwse-no-resize`, or `default`.
14161 *
14162 * If the `type` parameter is `custom`, the `image` parameter will hold the custom
14163 * cursor image in a `NativeImage`, and `scale`, `size` and `hotspot` will hold
14164 * additional information about the custom cursor.
14165 */
14166 on(event: 'cursor-changed', listener: (event: Event,
14167 type: string,
14168 image: NativeImage,
14169 /**
14170 * scaling factor for the custom cursor.
14171 */
14172 scale: number,
14173 /**
14174 * the size of the `image`.
14175 */
14176 size: Size,
14177 /**
14178 * coordinates of the custom cursor's hotspot.
14179 */
14180 hotspot: Point) => void): this;
14181 off(event: 'cursor-changed', listener: (event: Event,
14182 type: string,
14183 image: NativeImage,
14184 /**
14185 * scaling factor for the custom cursor.
14186 */
14187 scale: number,
14188 /**
14189 * the size of the `image`.
14190 */
14191 size: Size,
14192 /**
14193 * coordinates of the custom cursor's hotspot.
14194 */
14195 hotspot: Point) => void): this;
14196 once(event: 'cursor-changed', listener: (event: Event,
14197 type: string,
14198 image: NativeImage,
14199 /**
14200 * scaling factor for the custom cursor.
14201 */
14202 scale: number,
14203 /**
14204 * the size of the `image`.
14205 */
14206 size: Size,
14207 /**
14208 * coordinates of the custom cursor's hotspot.
14209 */
14210 hotspot: Point) => void): this;
14211 addListener(event: 'cursor-changed', listener: (event: Event,
14212 type: string,
14213 image: NativeImage,
14214 /**
14215 * scaling factor for the custom cursor.
14216 */
14217 scale: number,
14218 /**
14219 * the size of the `image`.
14220 */
14221 size: Size,
14222 /**
14223 * coordinates of the custom cursor's hotspot.
14224 */
14225 hotspot: Point) => void): this;
14226 removeListener(event: 'cursor-changed', listener: (event: Event,
14227 type: string,
14228 image: NativeImage,
14229 /**
14230 * scaling factor for the custom cursor.
14231 */
14232 scale: number,
14233 /**
14234 * the size of the `image`.
14235 */
14236 size: Size,
14237 /**
14238 * coordinates of the custom cursor's hotspot.
14239 */
14240 hotspot: Point) => void): this;
14241 /**
14242 * Emitted when `webContents` is destroyed.
14243 */
14244 on(event: 'destroyed', listener: Function): this;
14245 off(event: 'destroyed', listener: Function): this;
14246 once(event: 'destroyed', listener: Function): this;
14247 addListener(event: 'destroyed', listener: Function): this;
14248 removeListener(event: 'destroyed', listener: Function): this;
14249 /**
14250 * Emitted when DevTools is closed.
14251 */
14252 on(event: 'devtools-closed', listener: Function): this;
14253 off(event: 'devtools-closed', listener: Function): this;
14254 once(event: 'devtools-closed', listener: Function): this;
14255 addListener(event: 'devtools-closed', listener: Function): this;
14256 removeListener(event: 'devtools-closed', listener: Function): this;
14257 /**
14258 * Emitted when DevTools is focused / opened.
14259 */
14260 on(event: 'devtools-focused', listener: Function): this;
14261 off(event: 'devtools-focused', listener: Function): this;
14262 once(event: 'devtools-focused', listener: Function): this;
14263 addListener(event: 'devtools-focused', listener: Function): this;
14264 removeListener(event: 'devtools-focused', listener: Function): this;
14265 /**
14266 * Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
14267 * a link in its context menu.
14268 */
14269 on(event: 'devtools-open-url', listener: (event: Event,
14270 /**
14271 * URL of the link that was clicked or selected.
14272 */
14273 url: string) => void): this;
14274 off(event: 'devtools-open-url', listener: (event: Event,
14275 /**
14276 * URL of the link that was clicked or selected.
14277 */
14278 url: string) => void): this;
14279 once(event: 'devtools-open-url', listener: (event: Event,
14280 /**
14281 * URL of the link that was clicked or selected.
14282 */
14283 url: string) => void): this;
14284 addListener(event: 'devtools-open-url', listener: (event: Event,
14285 /**
14286 * URL of the link that was clicked or selected.
14287 */
14288 url: string) => void): this;
14289 removeListener(event: 'devtools-open-url', listener: (event: Event,
14290 /**
14291 * URL of the link that was clicked or selected.
14292 */
14293 url: string) => void): this;
14294 /**
14295 * Emitted when DevTools is opened.
14296 */
14297 on(event: 'devtools-opened', listener: Function): this;
14298 off(event: 'devtools-opened', listener: Function): this;
14299 once(event: 'devtools-opened', listener: Function): this;
14300 addListener(event: 'devtools-opened', listener: Function): this;
14301 removeListener(event: 'devtools-opened', listener: Function): this;
14302 /**
14303 * Emitted when the devtools window instructs the webContents to reload
14304 */
14305 on(event: 'devtools-reload-page', listener: Function): this;
14306 off(event: 'devtools-reload-page', listener: Function): this;
14307 once(event: 'devtools-reload-page', listener: Function): this;
14308 addListener(event: 'devtools-reload-page', listener: Function): this;
14309 removeListener(event: 'devtools-reload-page', listener: Function): this;
14310 /**
14311 * Emitted when 'Search' is selected for text in its context menu.
14312 */
14313 on(event: 'devtools-search-query', listener: (event: Event,
14314 /**
14315 * text to query for.
14316 */
14317 query: string) => void): this;
14318 off(event: 'devtools-search-query', listener: (event: Event,
14319 /**
14320 * text to query for.
14321 */
14322 query: string) => void): this;
14323 once(event: 'devtools-search-query', listener: (event: Event,
14324 /**
14325 * text to query for.
14326 */
14327 query: string) => void): this;
14328 addListener(event: 'devtools-search-query', listener: (event: Event,
14329 /**
14330 * text to query for.
14331 */
14332 query: string) => void): this;
14333 removeListener(event: 'devtools-search-query', listener: (event: Event,
14334 /**
14335 * text to query for.
14336 */
14337 query: string) => void): this;
14338 /**
14339 * Emitted when a `<webview>` has been attached to this web contents.
14340 */
14341 on(event: 'did-attach-webview', listener: (event: Event,
14342 /**
14343 * The guest web contents that is used by the `<webview>`.
14344 */
14345 webContents: WebContents) => void): this;
14346 off(event: 'did-attach-webview', listener: (event: Event,
14347 /**
14348 * The guest web contents that is used by the `<webview>`.
14349 */
14350 webContents: WebContents) => void): this;
14351 once(event: 'did-attach-webview', listener: (event: Event,
14352 /**
14353 * The guest web contents that is used by the `<webview>`.
14354 */
14355 webContents: WebContents) => void): this;
14356 addListener(event: 'did-attach-webview', listener: (event: Event,
14357 /**
14358 * The guest web contents that is used by the `<webview>`.
14359 */
14360 webContents: WebContents) => void): this;
14361 removeListener(event: 'did-attach-webview', listener: (event: Event,
14362 /**
14363 * The guest web contents that is used by the `<webview>`.
14364 */
14365 webContents: WebContents) => void): this;
14366 /**
14367 * Emitted when a page's theme color changes. This is usually due to encountering a
14368 * meta tag:
14369 */
14370 on(event: 'did-change-theme-color', listener: (event: Event,
14371 /**
14372 * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
14373 */
14374 color: (string) | (null)) => void): this;
14375 off(event: 'did-change-theme-color', listener: (event: Event,
14376 /**
14377 * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
14378 */
14379 color: (string) | (null)) => void): this;
14380 once(event: 'did-change-theme-color', listener: (event: Event,
14381 /**
14382 * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
14383 */
14384 color: (string) | (null)) => void): this;
14385 addListener(event: 'did-change-theme-color', listener: (event: Event,
14386 /**
14387 * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
14388 */
14389 color: (string) | (null)) => void): this;
14390 removeListener(event: 'did-change-theme-color', listener: (event: Event,
14391 /**
14392 * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
14393 */
14394 color: (string) | (null)) => void): this;
14395 /**
14396 * Emitted _after_ successful creation of a window via `window.open` in the
14397 * renderer. Not emitted if the creation of the window is canceled from
14398 * `webContents.setWindowOpenHandler`.
14399 *
14400 * See `window.open()` for more details and how to use this in conjunction with
14401 * `webContents.setWindowOpenHandler`.
14402 */
14403 on(event: 'did-create-window', listener: (window: BrowserWindow,
14404 details: DidCreateWindowDetails) => void): this;
14405 off(event: 'did-create-window', listener: (window: BrowserWindow,
14406 details: DidCreateWindowDetails) => void): this;
14407 once(event: 'did-create-window', listener: (window: BrowserWindow,
14408 details: DidCreateWindowDetails) => void): this;
14409 addListener(event: 'did-create-window', listener: (window: BrowserWindow,
14410 details: DidCreateWindowDetails) => void): this;
14411 removeListener(event: 'did-create-window', listener: (window: BrowserWindow,
14412 details: DidCreateWindowDetails) => void): this;
14413 /**
14414 * This event is like `did-finish-load` but emitted when the load failed. The full
14415 * list of error codes and their meaning is available here.
14416 */
14417 on(event: 'did-fail-load', listener: (event: Event,
14418 errorCode: number,
14419 errorDescription: string,
14420 validatedURL: string,
14421 isMainFrame: boolean,
14422 frameProcessId: number,
14423 frameRoutingId: number) => void): this;
14424 off(event: 'did-fail-load', listener: (event: Event,
14425 errorCode: number,
14426 errorDescription: string,
14427 validatedURL: string,
14428 isMainFrame: boolean,
14429 frameProcessId: number,
14430 frameRoutingId: number) => void): this;
14431 once(event: 'did-fail-load', listener: (event: Event,
14432 errorCode: number,
14433 errorDescription: string,
14434 validatedURL: string,
14435 isMainFrame: boolean,
14436 frameProcessId: number,
14437 frameRoutingId: number) => void): this;
14438 addListener(event: 'did-fail-load', listener: (event: Event,
14439 errorCode: number,
14440 errorDescription: string,
14441 validatedURL: string,
14442 isMainFrame: boolean,
14443 frameProcessId: number,
14444 frameRoutingId: number) => void): this;
14445 removeListener(event: 'did-fail-load', listener: (event: Event,
14446 errorCode: number,
14447 errorDescription: string,
14448 validatedURL: string,
14449 isMainFrame: boolean,
14450 frameProcessId: number,
14451 frameRoutingId: number) => void): this;
14452 /**
14453 * This event is like `did-fail-load` but emitted when the load was cancelled (e.g.
14454 * `window.stop()` was invoked).
14455 */
14456 on(event: 'did-fail-provisional-load', listener: (event: Event,
14457 errorCode: number,
14458 errorDescription: string,
14459 validatedURL: string,
14460 isMainFrame: boolean,
14461 frameProcessId: number,
14462 frameRoutingId: number) => void): this;
14463 off(event: 'did-fail-provisional-load', listener: (event: Event,
14464 errorCode: number,
14465 errorDescription: string,
14466 validatedURL: string,
14467 isMainFrame: boolean,
14468 frameProcessId: number,
14469 frameRoutingId: number) => void): this;
14470 once(event: 'did-fail-provisional-load', listener: (event: Event,
14471 errorCode: number,
14472 errorDescription: string,
14473 validatedURL: string,
14474 isMainFrame: boolean,
14475 frameProcessId: number,
14476 frameRoutingId: number) => void): this;
14477 addListener(event: 'did-fail-provisional-load', listener: (event: Event,
14478 errorCode: number,
14479 errorDescription: string,
14480 validatedURL: string,
14481 isMainFrame: boolean,
14482 frameProcessId: number,
14483 frameRoutingId: number) => void): this;
14484 removeListener(event: 'did-fail-provisional-load', listener: (event: Event,
14485 errorCode: number,
14486 errorDescription: string,
14487 validatedURL: string,
14488 isMainFrame: boolean,
14489 frameProcessId: number,
14490 frameRoutingId: number) => void): this;
14491 /**
14492 * Emitted when the navigation is done, i.e. the spinner of the tab has stopped
14493 * spinning, and the `onload` event was dispatched.
14494 */
14495 on(event: 'did-finish-load', listener: Function): this;
14496 off(event: 'did-finish-load', listener: Function): this;
14497 once(event: 'did-finish-load', listener: Function): this;
14498 addListener(event: 'did-finish-load', listener: Function): this;
14499 removeListener(event: 'did-finish-load', listener: Function): this;
14500 /**
14501 * Emitted when a frame has done navigation.
14502 */
14503 on(event: 'did-frame-finish-load', listener: (event: Event,
14504 isMainFrame: boolean,
14505 frameProcessId: number,
14506 frameRoutingId: number) => void): this;
14507 off(event: 'did-frame-finish-load', listener: (event: Event,
14508 isMainFrame: boolean,
14509 frameProcessId: number,
14510 frameRoutingId: number) => void): this;
14511 once(event: 'did-frame-finish-load', listener: (event: Event,
14512 isMainFrame: boolean,
14513 frameProcessId: number,
14514 frameRoutingId: number) => void): this;
14515 addListener(event: 'did-frame-finish-load', listener: (event: Event,
14516 isMainFrame: boolean,
14517 frameProcessId: number,
14518 frameRoutingId: number) => void): this;
14519 removeListener(event: 'did-frame-finish-load', listener: (event: Event,
14520 isMainFrame: boolean,
14521 frameProcessId: number,
14522 frameRoutingId: number) => void): this;
14523 /**
14524 * Emitted when any frame navigation is done.
14525 *
14526 * This event is not emitted for in-page navigations, such as clicking anchor links
14527 * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
14528 * this purpose.
14529 */
14530 on(event: 'did-frame-navigate', listener: (event: Event,
14531 url: string,
14532 /**
14533 * -1 for non HTTP navigations
14534 */
14535 httpResponseCode: number,
14536 /**
14537 * empty for non HTTP navigations,
14538 */
14539 httpStatusText: string,
14540 isMainFrame: boolean,
14541 frameProcessId: number,
14542 frameRoutingId: number) => void): this;
14543 off(event: 'did-frame-navigate', listener: (event: Event,
14544 url: string,
14545 /**
14546 * -1 for non HTTP navigations
14547 */
14548 httpResponseCode: number,
14549 /**
14550 * empty for non HTTP navigations,
14551 */
14552 httpStatusText: string,
14553 isMainFrame: boolean,
14554 frameProcessId: number,
14555 frameRoutingId: number) => void): this;
14556 once(event: 'did-frame-navigate', listener: (event: Event,
14557 url: string,
14558 /**
14559 * -1 for non HTTP navigations
14560 */
14561 httpResponseCode: number,
14562 /**
14563 * empty for non HTTP navigations,
14564 */
14565 httpStatusText: string,
14566 isMainFrame: boolean,
14567 frameProcessId: number,
14568 frameRoutingId: number) => void): this;
14569 addListener(event: 'did-frame-navigate', listener: (event: Event,
14570 url: string,
14571 /**
14572 * -1 for non HTTP navigations
14573 */
14574 httpResponseCode: number,
14575 /**
14576 * empty for non HTTP navigations,
14577 */
14578 httpStatusText: string,
14579 isMainFrame: boolean,
14580 frameProcessId: number,
14581 frameRoutingId: number) => void): this;
14582 removeListener(event: 'did-frame-navigate', listener: (event: Event,
14583 url: string,
14584 /**
14585 * -1 for non HTTP navigations
14586 */
14587 httpResponseCode: number,
14588 /**
14589 * empty for non HTTP navigations,
14590 */
14591 httpStatusText: string,
14592 isMainFrame: boolean,
14593 frameProcessId: number,
14594 frameRoutingId: number) => void): this;
14595 /**
14596 * Emitted when a main frame navigation is done.
14597 *
14598 * This event is not emitted for in-page navigations, such as clicking anchor links
14599 * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
14600 * this purpose.
14601 */
14602 on(event: 'did-navigate', listener: (event: Event,
14603 url: string,
14604 /**
14605 * -1 for non HTTP navigations
14606 */
14607 httpResponseCode: number,
14608 /**
14609 * empty for non HTTP navigations
14610 */
14611 httpStatusText: string) => void): this;
14612 off(event: 'did-navigate', listener: (event: Event,
14613 url: string,
14614 /**
14615 * -1 for non HTTP navigations
14616 */
14617 httpResponseCode: number,
14618 /**
14619 * empty for non HTTP navigations
14620 */
14621 httpStatusText: string) => void): this;
14622 once(event: 'did-navigate', listener: (event: Event,
14623 url: string,
14624 /**
14625 * -1 for non HTTP navigations
14626 */
14627 httpResponseCode: number,
14628 /**
14629 * empty for non HTTP navigations
14630 */
14631 httpStatusText: string) => void): this;
14632 addListener(event: 'did-navigate', listener: (event: Event,
14633 url: string,
14634 /**
14635 * -1 for non HTTP navigations
14636 */
14637 httpResponseCode: number,
14638 /**
14639 * empty for non HTTP navigations
14640 */
14641 httpStatusText: string) => void): this;
14642 removeListener(event: 'did-navigate', listener: (event: Event,
14643 url: string,
14644 /**
14645 * -1 for non HTTP navigations
14646 */
14647 httpResponseCode: number,
14648 /**
14649 * empty for non HTTP navigations
14650 */
14651 httpStatusText: string) => void): this;
14652 /**
14653 * Emitted when an in-page navigation happened in any frame.
14654 *
14655 * When in-page navigation happens, the page URL changes but does not cause
14656 * navigation outside of the page. Examples of this occurring are when anchor links
14657 * are clicked or when the DOM `hashchange` event is triggered.
14658 */
14659 on(event: 'did-navigate-in-page', listener: (event: Event,
14660 url: string,
14661 isMainFrame: boolean,
14662 frameProcessId: number,
14663 frameRoutingId: number) => void): this;
14664 off(event: 'did-navigate-in-page', listener: (event: Event,
14665 url: string,
14666 isMainFrame: boolean,
14667 frameProcessId: number,
14668 frameRoutingId: number) => void): this;
14669 once(event: 'did-navigate-in-page', listener: (event: Event,
14670 url: string,
14671 isMainFrame: boolean,
14672 frameProcessId: number,
14673 frameRoutingId: number) => void): this;
14674 addListener(event: 'did-navigate-in-page', listener: (event: Event,
14675 url: string,
14676 isMainFrame: boolean,
14677 frameProcessId: number,
14678 frameRoutingId: number) => void): this;
14679 removeListener(event: 'did-navigate-in-page', listener: (event: Event,
14680 url: string,
14681 isMainFrame: boolean,
14682 frameProcessId: number,
14683 frameRoutingId: number) => void): this;
14684 /**
14685 * Emitted after a server side redirect occurs during navigation. For example a
14686 * 302 redirect.
14687 *
14688 * This event cannot be prevented, if you want to prevent redirects you should
14689 * checkout out the `will-redirect` event above.
14690 */
14691 on(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
14692 /**
14693 * @deprecated
14694 */
14695 url: string,
14696 /**
14697 * @deprecated
14698 */
14699 isInPlace: boolean,
14700 /**
14701 * @deprecated
14702 */
14703 isMainFrame: boolean,
14704 /**
14705 * @deprecated
14706 */
14707 frameProcessId: number,
14708 /**
14709 * @deprecated
14710 */
14711 frameRoutingId: number) => void): this;
14712 off(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
14713 /**
14714 * @deprecated
14715 */
14716 url: string,
14717 /**
14718 * @deprecated
14719 */
14720 isInPlace: boolean,
14721 /**
14722 * @deprecated
14723 */
14724 isMainFrame: boolean,
14725 /**
14726 * @deprecated
14727 */
14728 frameProcessId: number,
14729 /**
14730 * @deprecated
14731 */
14732 frameRoutingId: number) => void): this;
14733 once(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
14734 /**
14735 * @deprecated
14736 */
14737 url: string,
14738 /**
14739 * @deprecated
14740 */
14741 isInPlace: boolean,
14742 /**
14743 * @deprecated
14744 */
14745 isMainFrame: boolean,
14746 /**
14747 * @deprecated
14748 */
14749 frameProcessId: number,
14750 /**
14751 * @deprecated
14752 */
14753 frameRoutingId: number) => void): this;
14754 addListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
14755 /**
14756 * @deprecated
14757 */
14758 url: string,
14759 /**
14760 * @deprecated
14761 */
14762 isInPlace: boolean,
14763 /**
14764 * @deprecated
14765 */
14766 isMainFrame: boolean,
14767 /**
14768 * @deprecated
14769 */
14770 frameProcessId: number,
14771 /**
14772 * @deprecated
14773 */
14774 frameRoutingId: number) => void): this;
14775 removeListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
14776 /**
14777 * @deprecated
14778 */
14779 url: string,
14780 /**
14781 * @deprecated
14782 */
14783 isInPlace: boolean,
14784 /**
14785 * @deprecated
14786 */
14787 isMainFrame: boolean,
14788 /**
14789 * @deprecated
14790 */
14791 frameProcessId: number,
14792 /**
14793 * @deprecated
14794 */
14795 frameRoutingId: number) => void): this;
14796 /**
14797 * Corresponds to the points in time when the spinner of the tab started spinning.
14798 */
14799 on(event: 'did-start-loading', listener: Function): this;
14800 off(event: 'did-start-loading', listener: Function): this;
14801 once(event: 'did-start-loading', listener: Function): this;
14802 addListener(event: 'did-start-loading', listener: Function): this;
14803 removeListener(event: 'did-start-loading', listener: Function): this;
14804 /**
14805 * Emitted when any frame (including main) starts navigating.
14806 */
14807 on(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
14808 /**
14809 * @deprecated
14810 */
14811 url: string,
14812 /**
14813 * @deprecated
14814 */
14815 isInPlace: boolean,
14816 /**
14817 * @deprecated
14818 */
14819 isMainFrame: boolean,
14820 /**
14821 * @deprecated
14822 */
14823 frameProcessId: number,
14824 /**
14825 * @deprecated
14826 */
14827 frameRoutingId: number) => void): this;
14828 off(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
14829 /**
14830 * @deprecated
14831 */
14832 url: string,
14833 /**
14834 * @deprecated
14835 */
14836 isInPlace: boolean,
14837 /**
14838 * @deprecated
14839 */
14840 isMainFrame: boolean,
14841 /**
14842 * @deprecated
14843 */
14844 frameProcessId: number,
14845 /**
14846 * @deprecated
14847 */
14848 frameRoutingId: number) => void): this;
14849 once(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
14850 /**
14851 * @deprecated
14852 */
14853 url: string,
14854 /**
14855 * @deprecated
14856 */
14857 isInPlace: boolean,
14858 /**
14859 * @deprecated
14860 */
14861 isMainFrame: boolean,
14862 /**
14863 * @deprecated
14864 */
14865 frameProcessId: number,
14866 /**
14867 * @deprecated
14868 */
14869 frameRoutingId: number) => void): this;
14870 addListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
14871 /**
14872 * @deprecated
14873 */
14874 url: string,
14875 /**
14876 * @deprecated
14877 */
14878 isInPlace: boolean,
14879 /**
14880 * @deprecated
14881 */
14882 isMainFrame: boolean,
14883 /**
14884 * @deprecated
14885 */
14886 frameProcessId: number,
14887 /**
14888 * @deprecated
14889 */
14890 frameRoutingId: number) => void): this;
14891 removeListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
14892 /**
14893 * @deprecated
14894 */
14895 url: string,
14896 /**
14897 * @deprecated
14898 */
14899 isInPlace: boolean,
14900 /**
14901 * @deprecated
14902 */
14903 isMainFrame: boolean,
14904 /**
14905 * @deprecated
14906 */
14907 frameProcessId: number,
14908 /**
14909 * @deprecated
14910 */
14911 frameRoutingId: number) => void): this;
14912 /**
14913 * Corresponds to the points in time when the spinner of the tab stopped spinning.
14914 */
14915 on(event: 'did-stop-loading', listener: Function): this;
14916 off(event: 'did-stop-loading', listener: Function): this;
14917 once(event: 'did-stop-loading', listener: Function): this;
14918 addListener(event: 'did-stop-loading', listener: Function): this;
14919 removeListener(event: 'did-stop-loading', listener: Function): this;
14920 /**
14921 * Emitted when the document in the top-level frame is loaded.
14922 */
14923 on(event: 'dom-ready', listener: Function): this;
14924 off(event: 'dom-ready', listener: Function): this;
14925 once(event: 'dom-ready', listener: Function): this;
14926 addListener(event: 'dom-ready', listener: Function): this;
14927 removeListener(event: 'dom-ready', listener: Function): this;
14928 /**
14929 * Emitted when the window enters a full-screen state triggered by HTML API.
14930 */
14931 on(event: 'enter-html-full-screen', listener: Function): this;
14932 off(event: 'enter-html-full-screen', listener: Function): this;
14933 once(event: 'enter-html-full-screen', listener: Function): this;
14934 addListener(event: 'enter-html-full-screen', listener: Function): this;
14935 removeListener(event: 'enter-html-full-screen', listener: Function): this;
14936 /**
14937 * Emitted when the `WebContents` gains focus.
14938 *
14939 * Note that on macOS, having focus means the `WebContents` is the first responder
14940 * of window, so switching focus between windows would not trigger the `focus` and
14941 * `blur` events of `WebContents`, as the first responder of each window is not
14942 * changed.
14943 *
14944 * The `focus` and `blur` events of `WebContents` should only be used to detect
14945 * focus change between different `WebContents` and `BrowserView` in the same
14946 * window.
14947 */
14948 on(event: 'focus', listener: Function): this;
14949 off(event: 'focus', listener: Function): this;
14950 once(event: 'focus', listener: Function): this;
14951 addListener(event: 'focus', listener: Function): this;
14952 removeListener(event: 'focus', listener: Function): this;
14953 /**
14954 * Emitted when a result is available for `webContents.findInPage` request.
14955 */
14956 on(event: 'found-in-page', listener: (event: Event,
14957 result: Result) => void): this;
14958 off(event: 'found-in-page', listener: (event: Event,
14959 result: Result) => void): this;
14960 once(event: 'found-in-page', listener: (event: Event,
14961 result: Result) => void): this;
14962 addListener(event: 'found-in-page', listener: (event: Event,
14963 result: Result) => void): this;
14964 removeListener(event: 'found-in-page', listener: (event: Event,
14965 result: Result) => void): this;
14966 /**
14967 * Emitted when the mainFrame, an `<iframe>`, or a nested `<iframe>` is loaded
14968 * within the page.
14969 */
14970 on(event: 'frame-created', listener: (event: Event,
14971 details: FrameCreatedDetails) => void): this;
14972 off(event: 'frame-created', listener: (event: Event,
14973 details: FrameCreatedDetails) => void): this;
14974 once(event: 'frame-created', listener: (event: Event,
14975 details: FrameCreatedDetails) => void): this;
14976 addListener(event: 'frame-created', listener: (event: Event,
14977 details: FrameCreatedDetails) => void): this;
14978 removeListener(event: 'frame-created', listener: (event: Event,
14979 details: FrameCreatedDetails) => void): this;
14980 /**
14981 * Emitted when an input event is sent to the WebContents. See InputEvent for
14982 * details.
14983 */
14984 on(event: 'input-event', listener: (event: Event,
14985 inputEvent: InputEvent) => void): this;
14986 off(event: 'input-event', listener: (event: Event,
14987 inputEvent: InputEvent) => void): this;
14988 once(event: 'input-event', listener: (event: Event,
14989 inputEvent: InputEvent) => void): this;
14990 addListener(event: 'input-event', listener: (event: Event,
14991 inputEvent: InputEvent) => void): this;
14992 removeListener(event: 'input-event', listener: (event: Event,
14993 inputEvent: InputEvent) => void): this;
14994 /**
14995 * Emitted when the renderer process sends an asynchronous message via
14996 * `ipcRenderer.send()`.
14997 *
14998 * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
14999 * responding to IPC messages specifically from this WebContents.
15000 */
15001 on(event: 'ipc-message', listener: (event: IpcMainEvent,
15002 channel: string,
15003 ...args: any[]) => void): this;
15004 off(event: 'ipc-message', listener: (event: IpcMainEvent,
15005 channel: string,
15006 ...args: any[]) => void): this;
15007 once(event: 'ipc-message', listener: (event: IpcMainEvent,
15008 channel: string,
15009 ...args: any[]) => void): this;
15010 addListener(event: 'ipc-message', listener: (event: IpcMainEvent,
15011 channel: string,
15012 ...args: any[]) => void): this;
15013 removeListener(event: 'ipc-message', listener: (event: IpcMainEvent,
15014 channel: string,
15015 ...args: any[]) => void): this;
15016 /**
15017 * Emitted when the renderer process sends a synchronous message via
15018 * `ipcRenderer.sendSync()`.
15019 *
15020 * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
15021 * responding to IPC messages specifically from this WebContents.
15022 */
15023 on(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
15024 channel: string,
15025 ...args: any[]) => void): this;
15026 off(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
15027 channel: string,
15028 ...args: any[]) => void): this;
15029 once(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
15030 channel: string,
15031 ...args: any[]) => void): this;
15032 addListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
15033 channel: string,
15034 ...args: any[]) => void): this;
15035 removeListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
15036 channel: string,
15037 ...args: any[]) => void): this;
15038 /**
15039 * Emitted when the window leaves a full-screen state triggered by HTML API.
15040 */
15041 on(event: 'leave-html-full-screen', listener: Function): this;
15042 off(event: 'leave-html-full-screen', listener: Function): this;
15043 once(event: 'leave-html-full-screen', listener: Function): this;
15044 addListener(event: 'leave-html-full-screen', listener: Function): this;
15045 removeListener(event: 'leave-html-full-screen', listener: Function): this;
15046 /**
15047 * Emitted when `webContents` wants to do basic auth.
15048 *
15049 * The usage is the same with the `login` event of `app`.
15050 */
15051 on(event: 'login', listener: (event: Event,
15052 authenticationResponseDetails: AuthenticationResponseDetails,
15053 authInfo: AuthInfo,
15054 callback: (username?: string, password?: string) => void) => void): this;
15055 off(event: 'login', listener: (event: Event,
15056 authenticationResponseDetails: AuthenticationResponseDetails,
15057 authInfo: AuthInfo,
15058 callback: (username?: string, password?: string) => void) => void): this;
15059 once(event: 'login', listener: (event: Event,
15060 authenticationResponseDetails: AuthenticationResponseDetails,
15061 authInfo: AuthInfo,
15062 callback: (username?: string, password?: string) => void) => void): this;
15063 addListener(event: 'login', listener: (event: Event,
15064 authenticationResponseDetails: AuthenticationResponseDetails,
15065 authInfo: AuthInfo,
15066 callback: (username?: string, password?: string) => void) => void): this;
15067 removeListener(event: 'login', listener: (event: Event,
15068 authenticationResponseDetails: AuthenticationResponseDetails,
15069 authInfo: AuthInfo,
15070 callback: (username?: string, password?: string) => void) => void): this;
15071 /**
15072 * Emitted when media is paused or done playing.
15073 */
15074 on(event: 'media-paused', listener: Function): this;
15075 off(event: 'media-paused', listener: Function): this;
15076 once(event: 'media-paused', listener: Function): this;
15077 addListener(event: 'media-paused', listener: Function): this;
15078 removeListener(event: 'media-paused', listener: Function): this;
15079 /**
15080 * Emitted when media starts playing.
15081 */
15082 on(event: 'media-started-playing', listener: Function): this;
15083 off(event: 'media-started-playing', listener: Function): this;
15084 once(event: 'media-started-playing', listener: Function): this;
15085 addListener(event: 'media-started-playing', listener: Function): this;
15086 removeListener(event: 'media-started-playing', listener: Function): this;
15087 /**
15088 * Emitted when page receives favicon urls.
15089 */
15090 on(event: 'page-favicon-updated', listener: (event: Event,
15091 /**
15092 * Array of URLs.
15093 */
15094 favicons: string[]) => void): this;
15095 off(event: 'page-favicon-updated', listener: (event: Event,
15096 /**
15097 * Array of URLs.
15098 */
15099 favicons: string[]) => void): this;
15100 once(event: 'page-favicon-updated', listener: (event: Event,
15101 /**
15102 * Array of URLs.
15103 */
15104 favicons: string[]) => void): this;
15105 addListener(event: 'page-favicon-updated', listener: (event: Event,
15106 /**
15107 * Array of URLs.
15108 */
15109 favicons: string[]) => void): this;
15110 removeListener(event: 'page-favicon-updated', listener: (event: Event,
15111 /**
15112 * Array of URLs.
15113 */
15114 favicons: string[]) => void): this;
15115 /**
15116 * Fired when page title is set during navigation. `explicitSet` is false when
15117 * title is synthesized from file url.
15118 */
15119 on(event: 'page-title-updated', listener: (event: Event,
15120 title: string,
15121 explicitSet: boolean) => void): this;
15122 off(event: 'page-title-updated', listener: (event: Event,
15123 title: string,
15124 explicitSet: boolean) => void): this;
15125 once(event: 'page-title-updated', listener: (event: Event,
15126 title: string,
15127 explicitSet: boolean) => void): this;
15128 addListener(event: 'page-title-updated', listener: (event: Event,
15129 title: string,
15130 explicitSet: boolean) => void): this;
15131 removeListener(event: 'page-title-updated', listener: (event: Event,
15132 title: string,
15133 explicitSet: boolean) => void): this;
15134 /**
15135 * Emitted when a new frame is generated. Only the dirty area is passed in the
15136 * buffer.
15137 */
15138 on(event: 'paint', listener: (event: Event,
15139 dirtyRect: Rectangle,
15140 /**
15141 * The image data of the whole frame.
15142 */
15143 image: NativeImage) => void): this;
15144 off(event: 'paint', listener: (event: Event,
15145 dirtyRect: Rectangle,
15146 /**
15147 * The image data of the whole frame.
15148 */
15149 image: NativeImage) => void): this;
15150 once(event: 'paint', listener: (event: Event,
15151 dirtyRect: Rectangle,
15152 /**
15153 * The image data of the whole frame.
15154 */
15155 image: NativeImage) => void): this;
15156 addListener(event: 'paint', listener: (event: Event,
15157 dirtyRect: Rectangle,
15158 /**
15159 * The image data of the whole frame.
15160 */
15161 image: NativeImage) => void): this;
15162 removeListener(event: 'paint', listener: (event: Event,
15163 dirtyRect: Rectangle,
15164 /**
15165 * The image data of the whole frame.
15166 */
15167 image: NativeImage) => void): this;
15168 /**
15169 * Emitted when a plugin process has crashed.
15170 */
15171 on(event: 'plugin-crashed', listener: (event: Event,
15172 name: string,
15173 version: string) => void): this;
15174 off(event: 'plugin-crashed', listener: (event: Event,
15175 name: string,
15176 version: string) => void): this;
15177 once(event: 'plugin-crashed', listener: (event: Event,
15178 name: string,
15179 version: string) => void): this;
15180 addListener(event: 'plugin-crashed', listener: (event: Event,
15181 name: string,
15182 version: string) => void): this;
15183 removeListener(event: 'plugin-crashed', listener: (event: Event,
15184 name: string,
15185 version: string) => void): this;
15186 /**
15187 * Emitted when the `WebContents` preferred size has changed.
15188 *
15189 * This event will only be emitted when `enablePreferredSizeMode` is set to `true`
15190 * in `webPreferences`.
15191 */
15192 on(event: 'preferred-size-changed', listener: (event: Event,
15193 /**
15194 * The minimum size needed to contain the layout of the document—without requiring
15195 * scrolling.
15196 */
15197 preferredSize: Size) => void): this;
15198 off(event: 'preferred-size-changed', listener: (event: Event,
15199 /**
15200 * The minimum size needed to contain the layout of the document—without requiring
15201 * scrolling.
15202 */
15203 preferredSize: Size) => void): this;
15204 once(event: 'preferred-size-changed', listener: (event: Event,
15205 /**
15206 * The minimum size needed to contain the layout of the document—without requiring
15207 * scrolling.
15208 */
15209 preferredSize: Size) => void): this;
15210 addListener(event: 'preferred-size-changed', listener: (event: Event,
15211 /**
15212 * The minimum size needed to contain the layout of the document—without requiring
15213 * scrolling.
15214 */
15215 preferredSize: Size) => void): this;
15216 removeListener(event: 'preferred-size-changed', listener: (event: Event,
15217 /**
15218 * The minimum size needed to contain the layout of the document—without requiring
15219 * scrolling.
15220 */
15221 preferredSize: Size) => void): this;
15222 /**
15223 * Emitted when the preload script `preloadPath` throws an unhandled exception
15224 * `error`.
15225 */
15226 on(event: 'preload-error', listener: (event: Event,
15227 preloadPath: string,
15228 error: Error) => void): this;
15229 off(event: 'preload-error', listener: (event: Event,
15230 preloadPath: string,
15231 error: Error) => void): this;
15232 once(event: 'preload-error', listener: (event: Event,
15233 preloadPath: string,
15234 error: Error) => void): this;
15235 addListener(event: 'preload-error', listener: (event: Event,
15236 preloadPath: string,
15237 error: Error) => void): this;
15238 removeListener(event: 'preload-error', listener: (event: Event,
15239 preloadPath: string,
15240 error: Error) => void): this;
15241 /**
15242 * Emitted when the renderer process unexpectedly disappears. This is normally
15243 * because it was crashed or killed.
15244 */
15245 on(event: 'render-process-gone', listener: (event: Event,
15246 details: RenderProcessGoneDetails) => void): this;
15247 off(event: 'render-process-gone', listener: (event: Event,
15248 details: RenderProcessGoneDetails) => void): this;
15249 once(event: 'render-process-gone', listener: (event: Event,
15250 details: RenderProcessGoneDetails) => void): this;
15251 addListener(event: 'render-process-gone', listener: (event: Event,
15252 details: RenderProcessGoneDetails) => void): this;
15253 removeListener(event: 'render-process-gone', listener: (event: Event,
15254 details: RenderProcessGoneDetails) => void): this;
15255 /**
15256 * Emitted when the unresponsive web page becomes responsive again.
15257 */
15258 on(event: 'responsive', listener: Function): this;
15259 off(event: 'responsive', listener: Function): this;
15260 once(event: 'responsive', listener: Function): this;
15261 addListener(event: 'responsive', listener: Function): this;
15262 removeListener(event: 'responsive', listener: Function): this;
15263 /**
15264 * Emitted when a bluetooth device needs to be selected when a call to
15265 * `navigator.bluetooth.requestDevice` is made. `callback` should be called with
15266 * the `deviceId` of the device to be selected. Passing an empty string to
15267 * `callback` will cancel the request.
15268 *
15269 * If an event listener is not added for this event, or if `event.preventDefault`
15270 * is not called when handling this event, the first available device will be
15271 * automatically selected.
15272 *
15273 * Due to the nature of bluetooth, scanning for devices when
15274 * `navigator.bluetooth.requestDevice` is called may take time and will cause
15275 * `select-bluetooth-device` to fire multiple times until `callback` is called with
15276 * either a device id or an empty string to cancel the request.
15277 */
15278 on(event: 'select-bluetooth-device', listener: (event: Event,
15279 devices: BluetoothDevice[],
15280 callback: (deviceId: string) => void) => void): this;
15281 off(event: 'select-bluetooth-device', listener: (event: Event,
15282 devices: BluetoothDevice[],
15283 callback: (deviceId: string) => void) => void): this;
15284 once(event: 'select-bluetooth-device', listener: (event: Event,
15285 devices: BluetoothDevice[],
15286 callback: (deviceId: string) => void) => void): this;
15287 addListener(event: 'select-bluetooth-device', listener: (event: Event,
15288 devices: BluetoothDevice[],
15289 callback: (deviceId: string) => void) => void): this;
15290 removeListener(event: 'select-bluetooth-device', listener: (event: Event,
15291 devices: BluetoothDevice[],
15292 callback: (deviceId: string) => void) => void): this;
15293 /**
15294 * Emitted when a client certificate is requested.
15295 *
15296 * The usage is the same with the `select-client-certificate` event of `app`.
15297 */
15298 on(event: 'select-client-certificate', listener: (event: Event,
15299 url: string,
15300 certificateList: Certificate[],
15301 callback: (certificate: Certificate) => void) => void): this;
15302 off(event: 'select-client-certificate', listener: (event: Event,
15303 url: string,
15304 certificateList: Certificate[],
15305 callback: (certificate: Certificate) => void) => void): this;
15306 once(event: 'select-client-certificate', listener: (event: Event,
15307 url: string,
15308 certificateList: Certificate[],
15309 callback: (certificate: Certificate) => void) => void): this;
15310 addListener(event: 'select-client-certificate', listener: (event: Event,
15311 url: string,
15312 certificateList: Certificate[],
15313 callback: (certificate: Certificate) => void) => void): this;
15314 removeListener(event: 'select-client-certificate', listener: (event: Event,
15315 url: string,
15316 certificateList: Certificate[],
15317 callback: (certificate: Certificate) => void) => void): this;
15318 /**
15319 * Emitted when the web page becomes unresponsive.
15320 */
15321 on(event: 'unresponsive', listener: Function): this;
15322 off(event: 'unresponsive', listener: Function): this;
15323 once(event: 'unresponsive', listener: Function): this;
15324 addListener(event: 'unresponsive', listener: Function): this;
15325 removeListener(event: 'unresponsive', listener: Function): this;
15326 /**
15327 * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
15328 */
15329 on(event: 'update-target-url', listener: (event: Event,
15330 url: string) => void): this;
15331 off(event: 'update-target-url', listener: (event: Event,
15332 url: string) => void): this;
15333 once(event: 'update-target-url', listener: (event: Event,
15334 url: string) => void): this;
15335 addListener(event: 'update-target-url', listener: (event: Event,
15336 url: string) => void): this;
15337 removeListener(event: 'update-target-url', listener: (event: Event,
15338 url: string) => void): this;
15339 /**
15340 * Emitted when a `<webview>`'s web contents is being attached to this web
15341 * contents. Calling `event.preventDefault()` will destroy the guest page.
15342 *
15343 * This event can be used to configure `webPreferences` for the `webContents` of a
15344 * `<webview>` before it's loaded, and provides the ability to set settings that
15345 * can't be set via `<webview>` attributes.
15346 */
15347 on(event: 'will-attach-webview', listener: (event: Event,
15348 /**
15349 * The web preferences that will be used by the guest page. This object can be
15350 * modified to adjust the preferences for the guest page.
15351 */
15352 webPreferences: WebPreferences,
15353 /**
15354 * The other `<webview>` parameters such as the `src` URL. This object can be
15355 * modified to adjust the parameters of the guest page.
15356 */
15357 params: Record<string, string>) => void): this;
15358 off(event: 'will-attach-webview', listener: (event: Event,
15359 /**
15360 * The web preferences that will be used by the guest page. This object can be
15361 * modified to adjust the preferences for the guest page.
15362 */
15363 webPreferences: WebPreferences,
15364 /**
15365 * The other `<webview>` parameters such as the `src` URL. This object can be
15366 * modified to adjust the parameters of the guest page.
15367 */
15368 params: Record<string, string>) => void): this;
15369 once(event: 'will-attach-webview', listener: (event: Event,
15370 /**
15371 * The web preferences that will be used by the guest page. This object can be
15372 * modified to adjust the preferences for the guest page.
15373 */
15374 webPreferences: WebPreferences,
15375 /**
15376 * The other `<webview>` parameters such as the `src` URL. This object can be
15377 * modified to adjust the parameters of the guest page.
15378 */
15379 params: Record<string, string>) => void): this;
15380 addListener(event: 'will-attach-webview', listener: (event: Event,
15381 /**
15382 * The web preferences that will be used by the guest page. This object can be
15383 * modified to adjust the preferences for the guest page.
15384 */
15385 webPreferences: WebPreferences,
15386 /**
15387 * The other `<webview>` parameters such as the `src` URL. This object can be
15388 * modified to adjust the parameters of the guest page.
15389 */
15390 params: Record<string, string>) => void): this;
15391 removeListener(event: 'will-attach-webview', listener: (event: Event,
15392 /**
15393 * The web preferences that will be used by the guest page. This object can be
15394 * modified to adjust the preferences for the guest page.
15395 */
15396 webPreferences: WebPreferences,
15397 /**
15398 * The other `<webview>` parameters such as the `src` URL. This object can be
15399 * modified to adjust the parameters of the guest page.
15400 */
15401 params: Record<string, string>) => void): this;
15402 /**
15403 * Emitted when a user or the page wants to start navigation in any frame. It can
15404 * happen when the `window.location` object is changed or a user clicks a link in
15405 * the page.
15406 *
15407 * Unlike `will-navigate`, `will-frame-navigate` is fired when the main frame or
15408 * any of its subframes attempts to navigate. When the navigation event comes from
15409 * the main frame, `isMainFrame` will be `true`.
15410 *
15411 * This event will not emit when the navigation is started programmatically with
15412 * APIs like `webContents.loadURL` and `webContents.back`.
15413 *
15414 * It is also not emitted for in-page navigations, such as clicking anchor links or
15415 * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
15416 * purpose.
15417 *
15418 * Calling `event.preventDefault()` will prevent the navigation.
15419 */
15420 on(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
15421 off(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
15422 once(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
15423 addListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
15424 removeListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
15425 /**
15426 * Emitted when a user or the page wants to start navigation on the main frame. It
15427 * can happen when the `window.location` object is changed or a user clicks a link
15428 * in the page.
15429 *
15430 * This event will not emit when the navigation is started programmatically with
15431 * APIs like `webContents.loadURL` and `webContents.back`.
15432 *
15433 * It is also not emitted for in-page navigations, such as clicking anchor links or
15434 * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
15435 * purpose.
15436 *
15437 * Calling `event.preventDefault()` will prevent the navigation.
15438 */
15439 on(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
15440 /**
15441 * @deprecated
15442 */
15443 url: string,
15444 /**
15445 * @deprecated
15446 */
15447 isInPlace: boolean,
15448 /**
15449 * @deprecated
15450 */
15451 isMainFrame: boolean,
15452 /**
15453 * @deprecated
15454 */
15455 frameProcessId: number,
15456 /**
15457 * @deprecated
15458 */
15459 frameRoutingId: number) => void): this;
15460 off(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
15461 /**
15462 * @deprecated
15463 */
15464 url: string,
15465 /**
15466 * @deprecated
15467 */
15468 isInPlace: boolean,
15469 /**
15470 * @deprecated
15471 */
15472 isMainFrame: boolean,
15473 /**
15474 * @deprecated
15475 */
15476 frameProcessId: number,
15477 /**
15478 * @deprecated
15479 */
15480 frameRoutingId: number) => void): this;
15481 once(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
15482 /**
15483 * @deprecated
15484 */
15485 url: string,
15486 /**
15487 * @deprecated
15488 */
15489 isInPlace: boolean,
15490 /**
15491 * @deprecated
15492 */
15493 isMainFrame: boolean,
15494 /**
15495 * @deprecated
15496 */
15497 frameProcessId: number,
15498 /**
15499 * @deprecated
15500 */
15501 frameRoutingId: number) => void): this;
15502 addListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
15503 /**
15504 * @deprecated
15505 */
15506 url: string,
15507 /**
15508 * @deprecated
15509 */
15510 isInPlace: boolean,
15511 /**
15512 * @deprecated
15513 */
15514 isMainFrame: boolean,
15515 /**
15516 * @deprecated
15517 */
15518 frameProcessId: number,
15519 /**
15520 * @deprecated
15521 */
15522 frameRoutingId: number) => void): this;
15523 removeListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
15524 /**
15525 * @deprecated
15526 */
15527 url: string,
15528 /**
15529 * @deprecated
15530 */
15531 isInPlace: boolean,
15532 /**
15533 * @deprecated
15534 */
15535 isMainFrame: boolean,
15536 /**
15537 * @deprecated
15538 */
15539 frameProcessId: number,
15540 /**
15541 * @deprecated
15542 */
15543 frameRoutingId: number) => void): this;
15544 /**
15545 * Emitted when a `beforeunload` event handler is attempting to cancel a page
15546 * unload.
15547 *
15548 * Calling `event.preventDefault()` will ignore the `beforeunload` event handler
15549 * and allow the page to be unloaded.
15550 *
15551 * **Note:** This will be emitted for `BrowserViews` but will _not_ be respected -
15552 * this is because we have chosen not to tie the `BrowserView` lifecycle to its
15553 * owning BrowserWindow should one exist per the specification.
15554 */
15555 on(event: 'will-prevent-unload', listener: (event: Event) => void): this;
15556 off(event: 'will-prevent-unload', listener: (event: Event) => void): this;
15557 once(event: 'will-prevent-unload', listener: (event: Event) => void): this;
15558 addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
15559 removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
15560 /**
15561 * Emitted when a server side redirect occurs during navigation. For example a 302
15562 * redirect.
15563 *
15564 * This event will be emitted after `did-start-navigation` and always before the
15565 * `did-redirect-navigation` event for the same navigation.
15566 *
15567 * Calling `event.preventDefault()` will prevent the navigation (not just the
15568 * redirect).
15569 */
15570 on(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
15571 /**
15572 * @deprecated
15573 */
15574 url: string,
15575 /**
15576 * @deprecated
15577 */
15578 isInPlace: boolean,
15579 /**
15580 * @deprecated
15581 */
15582 isMainFrame: boolean,
15583 /**
15584 * @deprecated
15585 */
15586 frameProcessId: number,
15587 /**
15588 * @deprecated
15589 */
15590 frameRoutingId: number) => void): this;
15591 off(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
15592 /**
15593 * @deprecated
15594 */
15595 url: string,
15596 /**
15597 * @deprecated
15598 */
15599 isInPlace: boolean,
15600 /**
15601 * @deprecated
15602 */
15603 isMainFrame: boolean,
15604 /**
15605 * @deprecated
15606 */
15607 frameProcessId: number,
15608 /**
15609 * @deprecated
15610 */
15611 frameRoutingId: number) => void): this;
15612 once(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
15613 /**
15614 * @deprecated
15615 */
15616 url: string,
15617 /**
15618 * @deprecated
15619 */
15620 isInPlace: boolean,
15621 /**
15622 * @deprecated
15623 */
15624 isMainFrame: boolean,
15625 /**
15626 * @deprecated
15627 */
15628 frameProcessId: number,
15629 /**
15630 * @deprecated
15631 */
15632 frameRoutingId: number) => void): this;
15633 addListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
15634 /**
15635 * @deprecated
15636 */
15637 url: string,
15638 /**
15639 * @deprecated
15640 */
15641 isInPlace: boolean,
15642 /**
15643 * @deprecated
15644 */
15645 isMainFrame: boolean,
15646 /**
15647 * @deprecated
15648 */
15649 frameProcessId: number,
15650 /**
15651 * @deprecated
15652 */
15653 frameRoutingId: number) => void): this;
15654 removeListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
15655 /**
15656 * @deprecated
15657 */
15658 url: string,
15659 /**
15660 * @deprecated
15661 */
15662 isInPlace: boolean,
15663 /**
15664 * @deprecated
15665 */
15666 isMainFrame: boolean,
15667 /**
15668 * @deprecated
15669 */
15670 frameProcessId: number,
15671 /**
15672 * @deprecated
15673 */
15674 frameRoutingId: number) => void): this;
15675 /**
15676 * Emitted when the user is requesting to change the zoom level using the mouse
15677 * wheel.
15678 */
15679 on(event: 'zoom-changed', listener: (event: Event,
15680 /**
15681 * Can be `in` or `out`.
15682 */
15683 zoomDirection: ('in' | 'out')) => void): this;
15684 off(event: 'zoom-changed', listener: (event: Event,
15685 /**
15686 * Can be `in` or `out`.
15687 */
15688 zoomDirection: ('in' | 'out')) => void): this;
15689 once(event: 'zoom-changed', listener: (event: Event,
15690 /**
15691 * Can be `in` or `out`.
15692 */
15693 zoomDirection: ('in' | 'out')) => void): this;
15694 addListener(event: 'zoom-changed', listener: (event: Event,
15695 /**
15696 * Can be `in` or `out`.
15697 */
15698 zoomDirection: ('in' | 'out')) => void): this;
15699 removeListener(event: 'zoom-changed', listener: (event: Event,
15700 /**
15701 * Can be `in` or `out`.
15702 */
15703 zoomDirection: ('in' | 'out')) => void): this;
15704 /**
15705 * Adds the specified path to DevTools workspace. Must be used after DevTools
15706 * creation:
15707 */
15708 addWorkSpace(path: string): void;
15709 /**
15710 * Adjusts the current text selection starting and ending points in the focused
15711 * frame by the given amounts. A negative amount moves the selection towards the
15712 * beginning of the document, and a positive amount moves the selection towards the
15713 * end of the document.
15714 *
15715 * Example:
15716 *
15717 * For a call of `win.webContents.adjustSelection({ start: 1, end: 5 })`
15718 *
15719 * Before:
15720 *
15721 * <img width="487" alt="Image Before Text Selection Adjustment"
15722 * src="../images/web-contents-text-selection-before.png"/>
15723 *
15724 * After:
15725 *
15726 * <img width="487" alt="Image After Text Selection Adjustment"
15727 * src="../images/web-contents-text-selection-after.png"/>
15728 */
15729 adjustSelection(options: AdjustSelectionOptions): void;
15730 /**
15731 * Begin subscribing for presentation events and captured frames, the `callback`
15732 * will be called with `callback(image, dirtyRect)` when there is a presentation
15733 * event.
15734 *
15735 * The `image` is an instance of NativeImage that stores the captured frame.
15736 *
15737 * The `dirtyRect` is an object with `x, y, width, height` properties that
15738 * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
15739 * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
15740 */
15741 beginFrameSubscription(onlyDirty: boolean, callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
15742 /**
15743 * Begin subscribing for presentation events and captured frames, the `callback`
15744 * will be called with `callback(image, dirtyRect)` when there is a presentation
15745 * event.
15746 *
15747 * The `image` is an instance of NativeImage that stores the captured frame.
15748 *
15749 * The `dirtyRect` is an object with `x, y, width, height` properties that
15750 * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
15751 * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
15752 */
15753 beginFrameSubscription(callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
15754 /**
15755 * Whether the browser can go back to previous web page.
15756 */
15757 canGoBack(): boolean;
15758 /**
15759 * Whether the browser can go forward to next web page.
15760 */
15761 canGoForward(): boolean;
15762 /**
15763 * Whether the web page can go to `offset`.
15764 */
15765 canGoToOffset(offset: number): boolean;
15766 /**
15767 * Resolves with a NativeImage
15768 *
15769 * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
15770 * whole visible page. The page is considered visible when its browser window is
15771 * hidden and the capturer count is non-zero. If you would like the page to stay
15772 * hidden, you should ensure that `stayHidden` is set to true.
15773 */
15774 capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
15775 /**
15776 * Centers the current text selection in web page.
15777 */
15778 centerSelection(): void;
15779 /**
15780 * Clears the navigation history.
15781 */
15782 clearHistory(): void;
15783 /**
15784 * Closes the page, as if the web content had called `window.close()`.
15785 *
15786 * If the page is successfully closed (i.e. the unload is not prevented by the
15787 * page, or `waitForBeforeUnload` is false or unspecified), the WebContents will be
15788 * destroyed and no longer usable. The `destroyed` event will be emitted.
15789 */
15790 close(opts?: CloseOpts): void;
15791 /**
15792 * Closes the devtools.
15793 */
15794 closeDevTools(): void;
15795 /**
15796 * Executes the editing command `copy` in web page.
15797 */
15798 copy(): void;
15799 /**
15800 * Copy the image at the given position to the clipboard.
15801 */
15802 copyImageAt(x: number, y: number): void;
15803 /**
15804 * Executes the editing command `cut` in web page.
15805 */
15806 cut(): void;
15807 /**
15808 * Executes the editing command `delete` in web page.
15809 */
15810 delete(): void;
15811 /**
15812 * Disable device emulation enabled by `webContents.enableDeviceEmulation`.
15813 */
15814 disableDeviceEmulation(): void;
15815 /**
15816 * Initiates a download of the resource at `url` without navigating. The
15817 * `will-download` event of `session` will be triggered.
15818 */
15819 downloadURL(url: string, options?: DownloadURLOptions): void;
15820 /**
15821 * Enable device emulation with the given parameters.
15822 */
15823 enableDeviceEmulation(parameters: Parameters): void;
15824 /**
15825 * End subscribing for frame presentation events.
15826 */
15827 endFrameSubscription(): void;
15828 /**
15829 * A promise that resolves with the result of the executed code or is rejected if
15830 * the result of the code is a rejected promise.
15831 *
15832 * Evaluates `code` in page.
15833 *
15834 * In the browser window some HTML APIs like `requestFullScreen` can only be
15835 * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
15836 * this limitation.
15837 *
15838 * Code execution will be suspended until web page stop loading.
15839 */
15840 executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
15841 /**
15842 * A promise that resolves with the result of the executed code or is rejected if
15843 * the result of the code is a rejected promise.
15844 *
15845 * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
15846 */
15847 executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean): Promise<any>;
15848 /**
15849 * The request id used for the request.
15850 *
15851 * Starts a request to find all matches for the `text` in the web page. The result
15852 * of the request can be obtained by subscribing to `found-in-page` event.
15853 */
15854 findInPage(text: string, options?: FindInPageOptions): number;
15855 /**
15856 * Focuses the web page.
15857 */
15858 focus(): void;
15859 /**
15860 * Forcefully terminates the renderer process that is currently hosting this
15861 * `webContents`. This will cause the `render-process-gone` event to be emitted
15862 * with the `reason=killed || reason=crashed`. Please note that some webContents
15863 * share renderer processes and therefore calling this method may also crash the
15864 * host process for other webContents as well.
15865 *
15866 * Calling `reload()` immediately after calling this method will force the reload
15867 * to occur in a new process. This should be used when this process is unstable or
15868 * unusable, for instance in order to recover from the `unresponsive` event.
15869 */
15870 forcefullyCrashRenderer(): void;
15871 /**
15872 * Information about all Shared Workers.
15873 */
15874 getAllSharedWorkers(): SharedWorkerInfo[];
15875 /**
15876 * whether or not this WebContents will throttle animations and timers when the
15877 * page becomes backgrounded. This also affects the Page Visibility API.
15878 */
15879 getBackgroundThrottling(): boolean;
15880 /**
15881 * the current title of the DevTools window. This will only be visible if DevTools
15882 * is opened in `undocked` or `detach` mode.
15883 */
15884 getDevToolsTitle(): string;
15885 /**
15886 * If _offscreen rendering_ is enabled returns the current frame rate.
15887 */
15888 getFrameRate(): number;
15889 /**
15890 * The identifier of a WebContents stream. This identifier can be used with
15891 * `navigator.mediaDevices.getUserMedia` using a `chromeMediaSource` of `tab`. The
15892 * identifier is restricted to the web contents that it is registered to and is
15893 * only valid for 10 seconds.
15894 */
15895 getMediaSourceId(requestWebContents: WebContents): string;
15896 /**
15897 * The operating system `pid` of the associated renderer process.
15898 */
15899 getOSProcessId(): number;
15900 /**
15901 * Get the system printer list.
15902 *
15903 * Resolves with a `PrinterInfo[]`
15904 */
15905 getPrintersAsync(): Promise<Electron.PrinterInfo[]>;
15906 /**
15907 * The Chromium internal `pid` of the associated renderer. Can be compared to the
15908 * `frameProcessId` passed by frame specific navigation events (e.g.
15909 * `did-frame-navigate`)
15910 */
15911 getProcessId(): number;
15912 /**
15913 * The title of the current web page.
15914 */
15915 getTitle(): string;
15916 /**
15917 * the type of the webContent. Can be `backgroundPage`, `window`, `browserView`,
15918 * `remote`, `webview` or `offscreen`.
15919 */
15920 getType(): ('backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen');
15921 /**
15922 * The URL of the current web page.
15923 */
15924 getURL(): string;
15925 /**
15926 * The user agent for this web page.
15927 */
15928 getUserAgent(): string;
15929 /**
15930 * Returns the WebRTC IP Handling Policy.
15931 */
15932 getWebRTCIPHandlingPolicy(): string;
15933 /**
15934 * * `min` Integer - The minimum UDP port number that WebRTC should use.
15935 * * `max` Integer - The maximum UDP port number that WebRTC should use.
15936 *
15937 * By default this value is `{ min: 0, max: 0 }` , which would apply no restriction
15938 * on the udp port range.
15939 */
15940 getWebRTCUDPPortRange(): WebRTCUDPPortRange;
15941 /**
15942 * the current zoom factor.
15943 */
15944 getZoomFactor(): number;
15945 /**
15946 * the current zoom level.
15947 */
15948 getZoomLevel(): number;
15949 /**
15950 * Makes the browser go back a web page.
15951 */
15952 goBack(): void;
15953 /**
15954 * Makes the browser go forward a web page.
15955 */
15956 goForward(): void;
15957 /**
15958 * Navigates browser to the specified absolute web page index.
15959 */
15960 goToIndex(index: number): void;
15961 /**
15962 * Navigates to the specified offset from the "current entry".
15963 */
15964 goToOffset(offset: number): void;
15965 /**
15966 * A promise that resolves with a key for the inserted CSS that can later be used
15967 * to remove the CSS via `contents.removeInsertedCSS(key)`.
15968 *
15969 * Injects CSS into the current web page and returns a unique key for the inserted
15970 * stylesheet.
15971 */
15972 insertCSS(css: string, options?: InsertCSSOptions): Promise<string>;
15973 /**
15974 * Inserts `text` to the focused element.
15975 */
15976 insertText(text: string): Promise<void>;
15977 /**
15978 * Starts inspecting element at position (`x`, `y`).
15979 */
15980 inspectElement(x: number, y: number): void;
15981 /**
15982 * Opens the developer tools for the service worker context.
15983 */
15984 inspectServiceWorker(): void;
15985 /**
15986 * Opens the developer tools for the shared worker context.
15987 */
15988 inspectSharedWorker(): void;
15989 /**
15990 * Inspects the shared worker based on its ID.
15991 */
15992 inspectSharedWorkerById(workerId: string): void;
15993 /**
15994 * Schedules a full repaint of the window this web contents is in.
15995 *
15996 * If _offscreen rendering_ is enabled invalidates the frame and generates a new
15997 * one through the `'paint'` event.
15998 */
15999 invalidate(): void;
16000 /**
16001 * Whether this page has been muted.
16002 */
16003 isAudioMuted(): boolean;
16004 /**
16005 * Whether this page is being captured. It returns true when the capturer count is
16006 * large then 0.
16007 */
16008 isBeingCaptured(): boolean;
16009 /**
16010 * Whether the renderer process has crashed.
16011 */
16012 isCrashed(): boolean;
16013 /**
16014 * Whether audio is currently playing.
16015 */
16016 isCurrentlyAudible(): boolean;
16017 /**
16018 * Whether the web page is destroyed.
16019 */
16020 isDestroyed(): boolean;
16021 /**
16022 * Whether the devtools view is focused .
16023 */
16024 isDevToolsFocused(): boolean;
16025 /**
16026 * Whether the devtools is opened.
16027 */
16028 isDevToolsOpened(): boolean;
16029 /**
16030 * Whether the web page is focused.
16031 */
16032 isFocused(): boolean;
16033 /**
16034 * Whether web page is still loading resources.
16035 */
16036 isLoading(): boolean;
16037 /**
16038 * Whether the main frame (and not just iframes or frames within it) is still
16039 * loading.
16040 */
16041 isLoadingMainFrame(): boolean;
16042 /**
16043 * Indicates whether _offscreen rendering_ is enabled.
16044 */
16045 isOffscreen(): boolean;
16046 /**
16047 * If _offscreen rendering_ is enabled returns whether it is currently painting.
16048 */
16049 isPainting(): boolean;
16050 /**
16051 * Whether the web page is waiting for a first-response from the main resource of
16052 * the page.
16053 */
16054 isWaitingForResponse(): boolean;
16055 /**
16056 * the promise will resolve when the page has finished loading (see
16057 * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
16058 *
16059 * Loads the given file in the window, `filePath` should be a path to an HTML file
16060 * relative to the root of your application. For instance an app structure like
16061 * this:
16062 *
16063 * Would require code like this
16064 */
16065 loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
16066 /**
16067 * the promise will resolve when the page has finished loading (see
16068 * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
16069 * A noop rejection handler is already attached, which avoids unhandled rejection
16070 * errors.
16071 *
16072 * Loads the `url` in the window. The `url` must contain the protocol prefix, e.g.
16073 * the `http://` or `file://`. If the load should bypass http cache then use the
16074 * `pragma` header to achieve it.
16075 */
16076 loadURL(url: string, options?: LoadURLOptions): Promise<void>;
16077 /**
16078 * Opens the devtools.
16079 *
16080 * When `contents` is a `<webview>` tag, the `mode` would be `detach` by default,
16081 * explicitly passing an empty `mode` can force using last used dock state.
16082 *
16083 * On Windows, if Windows Control Overlay is enabled, Devtools will be opened with
16084 * `mode: 'detach'`.
16085 */
16086 openDevTools(options?: OpenDevToolsOptions): void;
16087 /**
16088 * Executes the editing command `paste` in web page.
16089 */
16090 paste(): void;
16091 /**
16092 * Executes the editing command `pasteAndMatchStyle` in web page.
16093 */
16094 pasteAndMatchStyle(): void;
16095 /**
16096 * Send a message to the renderer process, optionally transferring ownership of
16097 * zero or more `MessagePortMain` objects.
16098 *
16099 * The transferred `MessagePortMain` objects will be available in the renderer
16100 * process by accessing the `ports` property of the emitted event. When they arrive
16101 * in the renderer, they will be native DOM `MessagePort` objects.
16102 *
16103 * For example:
16104 */
16105 postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
16106 /**
16107 * When a custom `pageSize` is passed, Chromium attempts to validate platform
16108 * specific minimum values for `width_microns` and `height_microns`. Width and
16109 * height must both be minimum 353 microns but may be higher on some operating
16110 * systems.
16111 *
16112 * Prints window's web page. When `silent` is set to `true`, Electron will pick the
16113 * system's default printer if `deviceName` is empty and the default settings for
16114 * printing.
16115 *
16116 * Use `page-break-before: always;` CSS style to force to print to a new page.
16117 *
16118 * Example usage:
16119 */
16120 print(options?: WebContentsPrintOptions, callback?: (success: boolean, failureReason: string) => void): void;
16121 /**
16122 * Resolves with the generated PDF data.
16123 *
16124 * Prints the window's web page as PDF.
16125 *
16126 * The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
16127 *
16128 * An example of `webContents.printToPDF`:
16129 *
16130 * See Page.printToPdf for more information.
16131 */
16132 printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
16133 /**
16134 * Executes the editing command `redo` in web page.
16135 */
16136 redo(): void;
16137 /**
16138 * Reloads the current web page.
16139 */
16140 reload(): void;
16141 /**
16142 * Reloads current page and ignores cache.
16143 */
16144 reloadIgnoringCache(): void;
16145 /**
16146 * Resolves if the removal was successful.
16147 *
16148 * Removes the inserted CSS from the current web page. The stylesheet is identified
16149 * by its key, which is returned from `contents.insertCSS(css)`.
16150 */
16151 removeInsertedCSS(key: string): Promise<void>;
16152 /**
16153 * Removes the specified path from DevTools workspace.
16154 */
16155 removeWorkSpace(path: string): void;
16156 /**
16157 * Executes the editing command `replace` in web page.
16158 */
16159 replace(text: string): void;
16160 /**
16161 * Executes the editing command `replaceMisspelling` in web page.
16162 */
16163 replaceMisspelling(text: string): void;
16164 /**
16165 * resolves if the page is saved.
16166 */
16167 savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
16168 /**
16169 * Scrolls to the bottom of the current `webContents`.
16170 */
16171 scrollToBottom(): void;
16172 /**
16173 * Scrolls to the top of the current `webContents`.
16174 */
16175 scrollToTop(): void;
16176 /**
16177 * Executes the editing command `selectAll` in web page.
16178 */
16179 selectAll(): void;
16180 /**
16181 * Send an asynchronous message to the renderer process via `channel`, along with
16182 * arguments. Arguments will be serialized with the Structured Clone Algorithm,
16183 * just like `postMessage`, so prototype chains will not be included. Sending
16184 * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
16185 *
16186 * :::warning
16187 *
16188 * Sending non-standard JavaScript types such as DOM objects or special Electron
16189 * objects will throw an exception.
16190 *
16191 * :::
16192 *
16193 * For additional reading, refer to Electron's IPC guide.
16194 */
16195 send(channel: string, ...args: any[]): void;
16196 /**
16197 * Sends an input `event` to the page. **Note:** The `BrowserWindow` containing the
16198 * contents needs to be focused for `sendInputEvent()` to work.
16199 */
16200 sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
16201 /**
16202 * Send an asynchronous message to a specific frame in a renderer process via
16203 * `channel`, along with arguments. Arguments will be serialized with the
16204 * Structured Clone Algorithm, just like `postMessage`, so prototype chains will
16205 * not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets
16206 * will throw an exception.
16207 *
16208 * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
16209 * Electron objects will throw an exception.
16210 *
16211 * The renderer process can handle the message by listening to `channel` with the
16212 * `ipcRenderer` module.
16213 *
16214 * If you want to get the `frameId` of a given renderer context you should use the
16215 * `webFrame.routingId` value. E.g.
16216 *
16217 * You can also read `frameId` from all incoming IPC messages in the main process.
16218 */
16219 sendToFrame(frameId: (number) | ([number, number]), channel: string, ...args: any[]): void;
16220 /**
16221 * Mute the audio on the current web page.
16222 */
16223 setAudioMuted(muted: boolean): void;
16224 /**
16225 * Controls whether or not this WebContents will throttle animations and timers
16226 * when the page becomes backgrounded. This also affects the Page Visibility API.
16227 */
16228 setBackgroundThrottling(allowed: boolean): void;
16229 /**
16230 * Changes the title of the DevTools window to `title`. This will only be visible
16231 * if DevTools is opened in `undocked` or `detach` mode.
16232 */
16233 setDevToolsTitle(title: string): void;
16234 /**
16235 * Uses the `devToolsWebContents` as the target `WebContents` to show devtools.
16236 *
16237 * The `devToolsWebContents` must not have done any navigation, and it should not
16238 * be used for other purposes after the call.
16239 *
16240 * By default Electron manages the devtools by creating an internal `WebContents`
16241 * with native view, which developers have very limited control of. With the
16242 * `setDevToolsWebContents` method, developers can use any `WebContents` to show
16243 * the devtools in it, including `BrowserWindow`, `BrowserView` and `<webview>`
16244 * tag.
16245 *
16246 * Note that closing the devtools does not destroy the `devToolsWebContents`, it is
16247 * caller's responsibility to destroy `devToolsWebContents`.
16248 *
16249 * An example of showing devtools in a `<webview>` tag:
16250 *
16251 * An example of showing devtools in a `BrowserWindow`:
16252 */
16253 setDevToolsWebContents(devToolsWebContents: WebContents): void;
16254 /**
16255 * If _offscreen rendering_ is enabled sets the frame rate to the specified number.
16256 * Only values between 1 and 240 are accepted.
16257 */
16258 setFrameRate(fps: number): void;
16259 /**
16260 * Ignore application menu shortcuts while this web contents is focused.
16261 */
16262 setIgnoreMenuShortcuts(ignore: boolean): void;
16263 /**
16264 * Sets the image animation policy for this webContents. The policy only affects
16265 * _new_ images, existing images that are currently being animated are unaffected.
16266 * This is a known limitation in Chromium, you can force image animation to be
16267 * recalculated with `img.src = img.src` which will result in no network traffic
16268 * but will update the animation policy.
16269 *
16270 * This corresponds to the animationPolicy accessibility feature in Chromium.
16271 */
16272 setImageAnimationPolicy(policy: 'animate' | 'animateOnce' | 'noAnimation'): void;
16273 /**
16274 * Overrides the user agent for this web page.
16275 */
16276 setUserAgent(userAgent: string): void;
16277 /**
16278 * Sets the maximum and minimum pinch-to-zoom level.
16279 *
16280 * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
16281 * call:
16282 */
16283 setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
16284 /**
16285 * Setting the WebRTC IP handling policy allows you to control which IPs are
16286 * exposed via WebRTC. See BrowserLeaks for more details.
16287 */
16288 setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
16289 /**
16290 * Setting the WebRTC UDP Port Range allows you to restrict the udp port range used
16291 * by WebRTC. By default the port range is unrestricted. **Note:** To reset to an
16292 * unrestricted port range this value should be set to `{ min: 0, max: 0 }`.
16293 */
16294 setWebRTCUDPPortRange(udpPortRange: UdpPortRange): void;
16295 /**
16296 * Called before creating a window a new window is requested by the renderer, e.g.
16297 * by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or
16298 * submitting a form with `<form target="_blank">`. See `window.open()` for more
16299 * details and how to use this in conjunction with `did-create-window`.
16300 */
16301 setWindowOpenHandler(handler: (details: HandlerDetails) => ({action: 'deny'}) | ({action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions})): void;
16302 /**
16303 * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
16304 * divided by 100, so 300% = 3.0.
16305 *
16306 * The factor must be greater than 0.0.
16307 */
16308 setZoomFactor(factor: number): void;
16309 /**
16310 * Changes the zoom level to the specified level. The original size is 0 and each
16311 * increment above or below represents zooming 20% larger or smaller to default
16312 * limits of 300% and 50% of original size, respectively. The formula for this is
16313 * `scale := 1.2 ^ level`.
16314 *
16315 * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
16316 * the zoom level for a specific domain propagates across all instances of windows
16317 * with the same domain. Differentiating the window URLs will make zoom work
16318 * per-window.
16319 */
16320 setZoomLevel(level: number): void;
16321 /**
16322 * Shows pop-up dictionary that searches the selected word on the page.
16323 *
16324 * @platform darwin
16325 */
16326 showDefinitionForSelection(): void;
16327 /**
16328 * Sets the `item` as dragging item for current drag-drop operation, `file` is the
16329 * absolute path of the file to be dragged, and `icon` is the image showing under
16330 * the cursor when dragging.
16331 */
16332 startDrag(item: Item): void;
16333 /**
16334 * If _offscreen rendering_ is enabled and not painting, start painting.
16335 */
16336 startPainting(): void;
16337 /**
16338 * Stops any pending navigation.
16339 */
16340 stop(): void;
16341 /**
16342 * Stops any `findInPage` request for the `webContents` with the provided `action`.
16343 */
16344 stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
16345 /**
16346 * If _offscreen rendering_ is enabled and painting, stop painting.
16347 */
16348 stopPainting(): void;
16349 /**
16350 * Indicates whether the snapshot has been created successfully.
16351 *
16352 * Takes a V8 heap snapshot and saves it to `filePath`.
16353 */
16354 takeHeapSnapshot(filePath: string): Promise<void>;
16355 /**
16356 * Toggles the developer tools.
16357 */
16358 toggleDevTools(): void;
16359 /**
16360 * Executes the editing command `undo` in web page.
16361 */
16362 undo(): void;
16363 /**
16364 * Executes the editing command `unselect` in web page.
16365 */
16366 unselect(): void;
16367 /**
16368 * A `boolean` property that determines whether this page is muted.
16369 */
16370 audioMuted: boolean;
16371 /**
16372 * A `boolean` property that determines whether or not this WebContents will
16373 * throttle animations and timers when the page becomes backgrounded. This also
16374 * affects the Page Visibility API.
16375 */
16376 backgroundThrottling: boolean;
16377 /**
16378 * A `Debugger` instance for this webContents.
16379 *
16380 */
16381 readonly debugger: Debugger;
16382 /**
16383 * A `WebContents | null` property that represents the of DevTools `WebContents`
16384 * associated with a given `WebContents`.
16385 *
16386 * **Note:** Users should never store this object because it may become `null` when
16387 * the DevTools has been closed.
16388 *
16389 */
16390 readonly devToolsWebContents: (WebContents) | (null);
16391 /**
16392 * An `Integer` property that sets the frame rate of the web contents to the
16393 * specified number. Only values between 1 and 240 are accepted.
16394 *
16395 * Only applicable if _offscreen rendering_ is enabled.
16396 */
16397 frameRate: number;
16398 /**
16399 * A `WebContents` instance that might own this `WebContents`.
16400 *
16401 */
16402 readonly hostWebContents: WebContents;
16403 /**
16404 * A `Integer` representing the unique ID of this WebContents. Each ID is unique
16405 * among all `WebContents` instances of the entire Electron application.
16406 *
16407 */
16408 readonly id: number;
16409 /**
16410 * An `IpcMain` scoped to just IPC messages sent from this WebContents.
16411 *
16412 * IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
16413 * `ipcRenderer.postMessage` will be delivered in the following order:
16414 *
16415 * * `contents.on('ipc-message')`
16416 * * `contents.mainFrame.on(channel)`
16417 * * `contents.ipc.on(channel)`
16418 * * `ipcMain.on(channel)`
16419 *
16420 * Handlers registered with `invoke` will be checked in the following order. The
16421 * first one that is defined will be called, the rest will be ignored.
16422 *
16423 * * `contents.mainFrame.handle(channel)`
16424 * * `contents.handle(channel)`
16425 * * `ipcMain.handle(channel)`
16426 *
16427 * A handler or event listener registered on the WebContents will receive IPC
16428 * messages sent from any frame, including child frames. In most cases, only the
16429 * main frame can send IPC messages. However, if the `nodeIntegrationInSubFrames`
16430 * option is enabled, it is possible for child frames to send IPC messages also. In
16431 * that case, handlers should check the `senderFrame` property of the IPC event to
16432 * ensure that the message is coming from the expected frame. Alternatively,
16433 * register handlers on the appropriate frame directly using the `WebFrameMain.ipc`
16434 * interface.
16435 *
16436 */
16437 readonly ipc: IpcMain;
16438 /**
16439 * A `WebFrameMain` property that represents the top frame of the page's frame
16440 * hierarchy.
16441 *
16442 */
16443 readonly mainFrame: WebFrameMain;
16444 /**
16445 * A `NavigationHistory` used by this webContents.
16446 *
16447 */
16448 readonly navigationHistory: NavigationHistory;
16449 /**
16450 * A `WebFrameMain` property that represents the frame that opened this
16451 * WebContents, either with open(), or by navigating a link with a target
16452 * attribute.
16453 *
16454 */
16455 readonly opener: WebFrameMain;
16456 /**
16457 * A `Session` used by this webContents.
16458 *
16459 */
16460 readonly session: Session;
16461 /**
16462 * A `string` property that determines the user agent for this web page.
16463 */
16464 userAgent: string;
16465 /**
16466 * A `number` property that determines the zoom factor for this web contents.
16467 *
16468 * The zoom factor is the zoom percent divided by 100, so 300% = 3.0.
16469 */
16470 zoomFactor: number;
16471 /**
16472 * A `number` property that determines the zoom level for this web contents.
16473 *
16474 * The original size is 0 and each increment above or below represents zooming 20%
16475 * larger or smaller to default limits of 300% and 50% of original size,
16476 * respectively. The formula for this is `scale := 1.2 ^ level`.
16477 */
16478 zoomLevel: number;
16479 }
16480
16481 class WebContentsView extends View {
16482
16483 // Docs: https://electronjs.org/docs/api/web-contents-view
16484
16485 /**
16486 * Emitted when the view's bounds have changed in response to being laid out. The
16487 * new bounds can be retrieved with `view.getBounds()`.
16488 */
16489 on(event: 'bounds-changed', listener: Function): this;
16490 off(event: 'bounds-changed', listener: Function): this;
16491 once(event: 'bounds-changed', listener: Function): this;
16492 addListener(event: 'bounds-changed', listener: Function): this;
16493 removeListener(event: 'bounds-changed', listener: Function): this;
16494 /**
16495 * WebContentsView
16496 */
16497 constructor(options?: WebContentsViewConstructorOptions);
16498 /**
16499 * A `WebContents` property containing a reference to the displayed `WebContents`.
16500 * Use this to interact with the `WebContents`, for instance to load a URL.
16501 *
16502 */
16503 readonly webContents: WebContents;
16504 }
16505
16506 interface WebFrame {
16507
16508 // Docs: https://electronjs.org/docs/api/web-frame
16509
16510 /**
16511 * Attempts to free memory that is no longer being used (like images from a
16512 * previous navigation).
16513 *
16514 * Note that blindly calling this method probably makes Electron slower since it
16515 * will have to refill these emptied caches, you should only call it if an event in
16516 * your app has occurred that makes you think your page is actually using less
16517 * memory (i.e. you have navigated from a super heavy page to a mostly empty one,
16518 * and intend to stay there).
16519 */
16520 clearCache(): void;
16521 /**
16522 * A promise that resolves with the result of the executed code or is rejected if
16523 * execution throws or results in a rejected promise.
16524 *
16525 * Evaluates `code` in page.
16526 *
16527 * In the browser window some HTML APIs like `requestFullScreen` can only be
16528 * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
16529 * this limitation.
16530 */
16531 executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
16532 /**
16533 * A promise that resolves with the result of the executed code or is rejected if
16534 * execution could not start.
16535 *
16536 * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
16537 *
16538 * Note that when the execution of script fails, the returned promise will not
16539 * reject and the `result` would be `undefined`. This is because Chromium does not
16540 * dispatch errors of isolated worlds to foreign worlds.
16541 */
16542 executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
16543 /**
16544 * A child of `webFrame` with the supplied `name`, `null` would be returned if
16545 * there's no such frame or if the frame is not in the current renderer process.
16546 */
16547 findFrameByName(name: string): WebFrame;
16548 /**
16549 * that has the supplied `routingId`, `null` if not found.
16550 */
16551 findFrameByRoutingId(routingId: number): WebFrame;
16552 /**
16553 * The frame element in `webFrame's` document selected by `selector`, `null` would
16554 * be returned if `selector` does not select a frame or if the frame is not in the
16555 * current renderer process.
16556 */
16557 getFrameForSelector(selector: string): WebFrame;
16558 /**
16559 * * `images` MemoryUsageDetails
16560 * * `scripts` MemoryUsageDetails
16561 * * `cssStyleSheets` MemoryUsageDetails
16562 * * `xslStyleSheets` MemoryUsageDetails
16563 * * `fonts` MemoryUsageDetails
16564 * * `other` MemoryUsageDetails
16565 *
16566 * Returns an object describing usage information of Blink's internal memory
16567 * caches.
16568 *
16569 * This will generate:
16570 */
16571 getResourceUsage(): ResourceUsage;
16572 /**
16573 * A list of suggested words for a given word. If the word is spelled correctly,
16574 * the result will be empty.
16575 */
16576 getWordSuggestions(word: string): string[];
16577 /**
16578 * The current zoom factor.
16579 */
16580 getZoomFactor(): number;
16581 /**
16582 * The current zoom level.
16583 */
16584 getZoomLevel(): number;
16585 /**
16586 * A key for the inserted CSS that can later be used to remove the CSS via
16587 * `webFrame.removeInsertedCSS(key)`.
16588 *
16589 * Injects CSS into the current web page and returns a unique key for the inserted
16590 * stylesheet.
16591 */
16592 insertCSS(css: string, options?: InsertCSSOptions): string;
16593 /**
16594 * Inserts `text` to the focused element.
16595 */
16596 insertText(text: string): void;
16597 /**
16598 * True if the word is misspelled according to the built in spellchecker, false
16599 * otherwise. If no dictionary is loaded, always return false.
16600 */
16601 isWordMisspelled(word: string): boolean;
16602 /**
16603 * Removes the inserted CSS from the current web page. The stylesheet is identified
16604 * by its key, which is returned from `webFrame.insertCSS(css)`.
16605 */
16606 removeInsertedCSS(key: string): void;
16607 /**
16608 * Set the security origin, content security policy and name of the isolated world.
16609 * Note: If the `csp` is specified, then the `securityOrigin` also has to be
16610 * specified.
16611 */
16612 setIsolatedWorldInfo(worldId: number, info: Info): void;
16613 /**
16614 * Sets a provider for spell checking in input fields and text areas.
16615 *
16616 * If you want to use this method you must disable the builtin spellchecker when
16617 * you construct the window.
16618 *
16619 * The `provider` must be an object that has a `spellCheck` method that accepts an
16620 * array of individual words for spellchecking. The `spellCheck` function runs
16621 * asynchronously and calls the `callback` function with an array of misspelt words
16622 * when complete.
16623 *
16624 * An example of using node-spellchecker as provider:
16625 */
16626 setSpellCheckProvider(language: string, provider: Provider): void;
16627 /**
16628 * Sets the maximum and minimum pinch-to-zoom level.
16629 *
16630 * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
16631 * call:
16632 *
16633 * > **NOTE**: Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
16634 * shortcuts are controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem
16635 * roles in the application Menu. To disable shortcuts, manually define the Menu
16636 * and omit zoom roles from the definition.
16637 */
16638 setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
16639 /**
16640 * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
16641 * divided by 100, so 300% = 3.0.
16642 *
16643 * The factor must be greater than 0.0.
16644 */
16645 setZoomFactor(factor: number): void;
16646 /**
16647 * Changes the zoom level to the specified level. The original size is 0 and each
16648 * increment above or below represents zooming 20% larger or smaller to default
16649 * limits of 300% and 50% of original size, respectively.
16650 *
16651 * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
16652 * the zoom level for a specific domain propagates across all instances of windows
16653 * with the same domain. Differentiating the window URLs will make zoom work
16654 * per-window.
16655 */
16656 setZoomLevel(level: number): void;
16657 /**
16658 * A `WebFrame | null` representing the first child frame of `webFrame`, the
16659 * property would be `null` if `webFrame` has no children or if first child is not
16660 * in the current renderer process.
16661 *
16662 */
16663 readonly firstChild: (WebFrame) | (null);
16664 /**
16665 * A `WebFrame | null` representing next sibling frame, the property would be
16666 * `null` if `webFrame` is the last frame in its parent or if the next sibling is
16667 * not in the current renderer process.
16668 *
16669 */
16670 readonly nextSibling: (WebFrame) | (null);
16671 /**
16672 * A `WebFrame | null` representing the frame which opened `webFrame`, the property
16673 * would be `null` if there's no opener or opener is not in the current renderer
16674 * process.
16675 *
16676 */
16677 readonly opener: (WebFrame) | (null);
16678 /**
16679 * A `WebFrame | null` representing parent frame of `webFrame`, the property would
16680 * be `null` if `webFrame` is top or parent is not in the current renderer process.
16681 *
16682 */
16683 readonly parent: (WebFrame) | (null);
16684 /**
16685 * An `Integer` representing the unique frame id in the current renderer process.
16686 * Distinct WebFrame instances that refer to the same underlying frame will have
16687 * the same `routingId`.
16688 *
16689 */
16690 readonly routingId: number;
16691 /**
16692 * A `WebFrame | null` representing top frame in frame hierarchy to which
16693 * `webFrame` belongs, the property would be `null` if top frame is not in the
16694 * current renderer process.
16695 *
16696 */
16697 readonly top: (WebFrame) | (null);
16698 }
16699
16700 class WebFrameMain extends NodeEventEmitter {
16701
16702 // Docs: https://electronjs.org/docs/api/web-frame-main
16703
16704 /**
16705 * A frame with the given process and routing IDs, or `undefined` if there is no
16706 * WebFrameMain associated with the given IDs.
16707 */
16708 static fromId(processId: number, routingId: number): (WebFrameMain) | (undefined);
16709 /**
16710 * Emitted when the document is loaded.
16711 */
16712 on(event: 'dom-ready', listener: Function): this;
16713 off(event: 'dom-ready', listener: Function): this;
16714 once(event: 'dom-ready', listener: Function): this;
16715 addListener(event: 'dom-ready', listener: Function): this;
16716 removeListener(event: 'dom-ready', listener: Function): this;
16717 /**
16718 * A promise that resolves with the result of the executed code or is rejected if
16719 * execution throws or results in a rejected promise.
16720 *
16721 * Evaluates `code` in page.
16722 *
16723 * In the browser window some HTML APIs like `requestFullScreen` can only be
16724 * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
16725 * this limitation.
16726 */
16727 executeJavaScript(code: string, userGesture?: boolean): Promise<unknown>;
16728 /**
16729 * Send a message to the renderer process, optionally transferring ownership of
16730 * zero or more `MessagePortMain` objects.
16731 *
16732 * The transferred `MessagePortMain` objects will be available in the renderer
16733 * process by accessing the `ports` property of the emitted event. When they arrive
16734 * in the renderer, they will be native DOM `MessagePort` objects.
16735 *
16736 * For example:
16737 */
16738 postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
16739 /**
16740 * Whether the reload was initiated successfully. Only results in `false` when the
16741 * frame has no history.
16742 */
16743 reload(): boolean;
16744 /**
16745 * Send an asynchronous message to the renderer process via `channel`, along with
16746 * arguments. Arguments will be serialized with the Structured Clone Algorithm,
16747 * just like `postMessage`, so prototype chains will not be included. Sending
16748 * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
16749 *
16750 * The renderer process can handle the message by listening to `channel` with the
16751 * `ipcRenderer` module.
16752 */
16753 send(channel: string, ...args: any[]): void;
16754 /**
16755 * A `WebFrameMain[]` collection containing the direct descendents of `frame`.
16756 *
16757 */
16758 readonly frames: WebFrameMain[];
16759 /**
16760 * A `WebFrameMain[]` collection containing every frame in the subtree of `frame`,
16761 * including itself. This can be useful when traversing through all frames.
16762 *
16763 */
16764 readonly framesInSubtree: WebFrameMain[];
16765 /**
16766 * An `Integer` representing the id of the frame's internal FrameTreeNode instance.
16767 * This id is browser-global and uniquely identifies a frame that hosts content.
16768 * The identifier is fixed at the creation of the frame and stays constant for the
16769 * lifetime of the frame. When the frame is removed, the id is not used again.
16770 *
16771 */
16772 readonly frameTreeNodeId: number;
16773 /**
16774 * An `IpcMain` instance scoped to the frame.
16775 *
16776 * IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
16777 * `ipcRenderer.postMessage` will be delivered in the following order:
16778 *
16779 * * `contents.on('ipc-message')`
16780 * * `contents.mainFrame.on(channel)`
16781 * * `contents.ipc.on(channel)`
16782 * * `ipcMain.on(channel)`
16783 *
16784 * Handlers registered with `invoke` will be checked in the following order. The
16785 * first one that is defined will be called, the rest will be ignored.
16786 *
16787 * * `contents.mainFrame.handle(channel)`
16788 * * `contents.handle(channel)`
16789 * * `ipcMain.handle(channel)`
16790 *
16791 * In most cases, only the main frame of a WebContents can send or receive IPC
16792 * messages. However, if the `nodeIntegrationInSubFrames` option is enabled, it is
16793 * possible for child frames to send and receive IPC messages also. The
16794 * `WebContents.ipc` interface may be more convenient when
16795 * `nodeIntegrationInSubFrames` is not enabled.
16796 *
16797 */
16798 readonly ipc: IpcMain;
16799 /**
16800 * A `string` representing the frame name.
16801 *
16802 */
16803 readonly name: string;
16804 /**
16805 * A `string` representing the current origin of the frame, serialized according to
16806 * RFC 6454. This may be different from the URL. For instance, if the frame is a
16807 * child window opened to `about:blank`, then `frame.origin` will return the parent
16808 * frame's origin, while `frame.url` will return the empty string. Pages without a
16809 * scheme/host/port triple origin will have the serialized origin of `"null"` (that
16810 * is, the string containing the letters n, u, l, l).
16811 *
16812 */
16813 readonly origin: string;
16814 /**
16815 * An `Integer` representing the operating system `pid` of the process which owns
16816 * this frame.
16817 *
16818 */
16819 readonly osProcessId: number;
16820 /**
16821 * A `WebFrameMain | null` representing parent frame of `frame`, the property would
16822 * be `null` if `frame` is the top frame in the frame hierarchy.
16823 *
16824 */
16825 readonly parent: (WebFrameMain) | (null);
16826 /**
16827 * An `Integer` representing the Chromium internal `pid` of the process which owns
16828 * this frame. This is not the same as the OS process ID; to read that use
16829 * `frame.osProcessId`.
16830 *
16831 */
16832 readonly processId: number;
16833 /**
16834 * An `Integer` representing the unique frame id in the current renderer process.
16835 * Distinct `WebFrameMain` instances that refer to the same underlying frame will
16836 * have the same `routingId`.
16837 *
16838 */
16839 readonly routingId: number;
16840 /**
16841 * A `WebFrameMain | null` representing top frame in the frame hierarchy to which
16842 * `frame` belongs.
16843 *
16844 */
16845 readonly top: (WebFrameMain) | (null);
16846 /**
16847 * A `string` representing the current URL of the frame.
16848 *
16849 */
16850 readonly url: string;
16851 /**
16852 * A `string` representing the visibility state of the frame.
16853 *
16854 * See also how the Page Visibility API is affected by other Electron APIs.
16855 *
16856 */
16857 readonly visibilityState: string;
16858 }
16859
16860 interface WebPreferences {
16861
16862 // Docs: https://electronjs.org/docs/api/structures/web-preferences
16863
16864 /**
16865 * An alternative title string provided only to accessibility tools such as screen
16866 * readers. This string is not directly visible to users.
16867 */
16868 accessibleTitle?: string;
16869 /**
16870 * A list of strings that will be appended to `process.argv` in the renderer
16871 * process of this app. Useful for passing small bits of data down to renderer
16872 * process preload scripts.
16873 */
16874 additionalArguments?: string[];
16875 /**
16876 * Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is
16877 * `false`.
16878 */
16879 allowRunningInsecureContent?: boolean;
16880 /**
16881 * Autoplay policy to apply to content in the window, can be
16882 * `no-user-gesture-required`, `user-gesture-required`,
16883 * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
16884 */
16885 autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
16886 /**
16887 * Whether to throttle animations and timers when the page becomes background. This
16888 * also affects the Page Visibility API. When at least one webContents displayed in
16889 * a single browserWindow has disabled `backgroundThrottling` then frames will be
16890 * drawn and swapped for the whole window and other webContents displayed by it.
16891 * Defaults to `true`.
16892 */
16893 backgroundThrottling?: boolean;
16894 /**
16895 * Whether to run Electron APIs and the specified `preload` script in a separate
16896 * JavaScript context. Defaults to `true`. The context that the `preload` script
16897 * runs in will only have access to its own dedicated `document` and `window`
16898 * globals, as well as its own set of JavaScript builtins (`Array`, `Object`,
16899 * `JSON`, etc.), which are all invisible to the loaded content. The Electron API
16900 * will only be available in the `preload` script and not the loaded page. This
16901 * option should be used when loading potentially untrusted remote content to
16902 * ensure the loaded content cannot tamper with the `preload` script and any
16903 * Electron APIs being used. This option uses the same technique used by Chrome
16904 * Content Scripts. You can access this context in the dev tools by selecting the
16905 * 'Electron Isolated Context' entry in the combo box at the top of the Console
16906 * tab.
16907 */
16908 contextIsolation?: boolean;
16909 /**
16910 * Defaults to `ISO-8859-1`.
16911 */
16912 defaultEncoding?: string;
16913 /**
16914 * Sets the default font for the font-family.
16915 */
16916 defaultFontFamily?: DefaultFontFamily;
16917 /**
16918 * Defaults to `16`.
16919 */
16920 defaultFontSize?: number;
16921 /**
16922 * Defaults to `13`.
16923 */
16924 defaultMonospaceFontSize?: number;
16925 /**
16926 * Whether to enable DevTools. If it is set to `false`, can not use
16927 * `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
16928 */
16929 devTools?: boolean;
16930 /**
16931 * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
16932 * to disable. The full list of supported feature strings can be found in the
16933 * RuntimeEnabledFeatures.json5 file.
16934 */
16935 disableBlinkFeatures?: string;
16936 /**
16937 * Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
16938 * `false`.
16939 */
16940 disableDialogs?: boolean;
16941 /**
16942 * Whether to prevent the window from resizing when entering HTML Fullscreen.
16943 * Default is `false`.
16944 */
16945 disableHtmlFullscreenWindowResize?: boolean;
16946 /**
16947 * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
16948 * to enable. The full list of supported feature strings can be found in the
16949 * RuntimeEnabledFeatures.json5 file.
16950 */
16951 enableBlinkFeatures?: string;
16952 /**
16953 * Whether to enable preferred size mode. The preferred size is the minimum size
16954 * needed to contain the layout of the document—without requiring scrolling.
16955 * Enabling this will cause the `preferred-size-changed` event to be emitted on the
16956 * `WebContents` when the preferred size changes. Default is `false`.
16957 */
16958 enablePreferredSizeMode?: boolean;
16959 /**
16960 * Whether to enable the WebSQL api. Default is `true`.
16961 */
16962 enableWebSQL?: boolean;
16963 /**
16964 * Enables Chromium's experimental features. Default is `false`.
16965 */
16966 experimentalFeatures?: boolean;
16967 /**
16968 * Specifies how to run image animations (E.g. GIFs). Can be `animate`,
16969 * `animateOnce` or `noAnimation`. Default is `animate`.
16970 */
16971 imageAnimationPolicy?: ('animate' | 'animateOnce' | 'noAnimation');
16972 /**
16973 * Enables image support. Default is `true`.
16974 */
16975 images?: boolean;
16976 /**
16977 * Enables JavaScript support. Default is `true`.
16978 */
16979 javascript?: boolean;
16980 /**
16981 * Defaults to `0`.
16982 */
16983 minimumFontSize?: number;
16984 /**
16985 * Whether dragging and dropping a file or link onto the page causes a navigation.
16986 * Default is `false`.
16987 */
16988 navigateOnDragDrop?: boolean;
16989 /**
16990 * Whether node integration is enabled. Default is `false`.
16991 */
16992 nodeIntegration?: boolean;
16993 /**
16994 * Experimental option for enabling Node.js support in sub-frames such as iframes
16995 * and child windows. All your preloads will load for every iframe, you can use
16996 * `process.isMainFrame` to determine if you are in the main frame or not.
16997 */
16998 nodeIntegrationInSubFrames?: boolean;
16999 /**
17000 * Whether node integration is enabled in web workers. Default is `false`. More
17001 * about this can be found in Multithreading.
17002 */
17003 nodeIntegrationInWorker?: boolean;
17004 /**
17005 * Whether to enable offscreen rendering for the browser window. Defaults to
17006 * `false`. See the offscreen rendering tutorial for more details.
17007 */
17008 offscreen?: boolean;
17009 /**
17010 * Sets the session used by the page according to the session's partition string.
17011 * If `partition` starts with `persist:`, the page will use a persistent session
17012 * available to all pages in the app with the same `partition`. If there is no
17013 * `persist:` prefix, the page will use an in-memory session. By assigning the same
17014 * `partition`, multiple pages can share the same session. Default is the default
17015 * session.
17016 */
17017 partition?: string;
17018 /**
17019 * Whether plugins should be enabled. Default is `false`.
17020 */
17021 plugins?: boolean;
17022 /**
17023 * Specifies a script that will be loaded before other scripts run in the page.
17024 * This script will always have access to node APIs no matter whether node
17025 * integration is turned on or off. The value should be the absolute file path to
17026 * the script. When node integration is turned off, the preload script can
17027 * reintroduce Node global symbols back to the global scope. See example here.
17028 */
17029 preload?: string;
17030 /**
17031 * Whether to enable browser style consecutive dialog protection. Default is
17032 * `false`.
17033 */
17034 safeDialogs?: boolean;
17035 /**
17036 * The message to display when consecutive dialog protection is triggered. If not
17037 * defined the default message would be used, note that currently the default
17038 * message is in English and not localized.
17039 */
17040 safeDialogsMessage?: string;
17041 /**
17042 * If set, this will sandbox the renderer associated with the window, making it
17043 * compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
17044 * This is not the same as the `nodeIntegration` option and the APIs available to
17045 * the preload script are more limited. Read more about the option here.
17046 */
17047 sandbox?: boolean;
17048 /**
17049 * Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.
17050 *
17051 * @platform darwin
17052 */
17053 scrollBounce?: boolean;
17054 /**
17055 * Sets the session used by the page. Instead of passing the Session object
17056 * directly, you can also choose to use the `partition` option instead, which
17057 * accepts a partition string. When both `session` and `partition` are provided,
17058 * `session` will be preferred. Default is the default session.
17059 */
17060 session?: Session;
17061 /**
17062 * Whether to enable the builtin spellchecker. Default is `true`.
17063 */
17064 spellcheck?: boolean;
17065 /**
17066 * Make TextArea elements resizable. Default is `true`.
17067 */
17068 textAreasAreResizable?: boolean;
17069 /**
17070 * Enforces the v8 code caching policy used by blink. Accepted values are
17071 */
17072 v8CacheOptions?: ('none' | 'code' | 'bypassHeatCheck' | 'bypassHeatCheckAndEagerCompile');
17073 /**
17074 * Enables WebGL support. Default is `true`.
17075 */
17076 webgl?: boolean;
17077 /**
17078 * When `false`, it will disable the same-origin policy (usually using testing
17079 * websites by people), and set `allowRunningInsecureContent` to `true` if this
17080 * options has not been set by user. Default is `true`.
17081 */
17082 webSecurity?: boolean;
17083 /**
17084 * Whether to enable the `<webview>` tag. Defaults to `false`. **Note:** The
17085 * `preload` script configured for the `<webview>` will have node integration
17086 * enabled when it is executed so you should ensure remote/untrusted content is not
17087 * able to create a `<webview>` tag with a possibly malicious `preload` script. You
17088 * can use the `will-attach-webview` event on webContents to strip away the
17089 * `preload` script and to validate or alter the `<webview>`'s initial settings.
17090 */
17091 webviewTag?: boolean;
17092 /**
17093 * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
17094 */
17095 zoomFactor?: number;
17096 }
17097
17098 class WebRequest {
17099
17100 // Docs: https://electronjs.org/docs/api/web-request
17101
17102 /**
17103 * The `listener` will be called with `listener(details)` when a server initiated
17104 * redirect is about to occur.
17105 */
17106 onBeforeRedirect(filter: WebRequestFilter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
17107 /**
17108 * The `listener` will be called with `listener(details)` when a server initiated
17109 * redirect is about to occur.
17110 */
17111 onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
17112 /**
17113 * The `listener` will be called with `listener(details, callback)` when a request
17114 * is about to occur.
17115 *
17116 * The `uploadData` is an array of `UploadData` objects.
17117 *
17118 * The `callback` has to be called with an `response` object.
17119 *
17120 * Some examples of valid `urls`:
17121 */
17122 onBeforeRequest(filter: WebRequestFilter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
17123 /**
17124 * The `listener` will be called with `listener(details, callback)` when a request
17125 * is about to occur.
17126 *
17127 * The `uploadData` is an array of `UploadData` objects.
17128 *
17129 * The `callback` has to be called with an `response` object.
17130 *
17131 * Some examples of valid `urls`:
17132 */
17133 onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
17134 /**
17135 * The `listener` will be called with `listener(details, callback)` before sending
17136 * an HTTP request, once the request headers are available. This may occur after a
17137 * TCP connection is made to the server, but before any http data is sent.
17138 *
17139 * The `callback` has to be called with a `response` object.
17140 */
17141 onBeforeSendHeaders(filter: WebRequestFilter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
17142 /**
17143 * The `listener` will be called with `listener(details, callback)` before sending
17144 * an HTTP request, once the request headers are available. This may occur after a
17145 * TCP connection is made to the server, but before any http data is sent.
17146 *
17147 * The `callback` has to be called with a `response` object.
17148 */
17149 onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
17150 /**
17151 * The `listener` will be called with `listener(details)` when a request is
17152 * completed.
17153 */
17154 onCompleted(filter: WebRequestFilter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
17155 /**
17156 * The `listener` will be called with `listener(details)` when a request is
17157 * completed.
17158 */
17159 onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
17160 /**
17161 * The `listener` will be called with `listener(details)` when an error occurs.
17162 */
17163 onErrorOccurred(filter: WebRequestFilter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
17164 /**
17165 * The `listener` will be called with `listener(details)` when an error occurs.
17166 */
17167 onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
17168 /**
17169 * The `listener` will be called with `listener(details, callback)` when HTTP
17170 * response headers of a request have been received.
17171 *
17172 * The `callback` has to be called with a `response` object.
17173 */
17174 onHeadersReceived(filter: WebRequestFilter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
17175 /**
17176 * The `listener` will be called with `listener(details, callback)` when HTTP
17177 * response headers of a request have been received.
17178 *
17179 * The `callback` has to be called with a `response` object.
17180 */
17181 onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
17182 /**
17183 * The `listener` will be called with `listener(details)` when first byte of the
17184 * response body is received. For HTTP requests, this means that the status line
17185 * and response headers are available.
17186 */
17187 onResponseStarted(filter: WebRequestFilter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
17188 /**
17189 * The `listener` will be called with `listener(details)` when first byte of the
17190 * response body is received. For HTTP requests, this means that the status line
17191 * and response headers are available.
17192 */
17193 onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
17194 /**
17195 * The `listener` will be called with `listener(details)` just before a request is
17196 * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
17197 * response are visible by the time this listener is fired.
17198 */
17199 onSendHeaders(filter: WebRequestFilter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
17200 /**
17201 * The `listener` will be called with `listener(details)` just before a request is
17202 * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
17203 * response are visible by the time this listener is fired.
17204 */
17205 onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
17206 }
17207
17208 interface WebRequestFilter {
17209
17210 // Docs: https://electronjs.org/docs/api/structures/web-request-filter
17211
17212 /**
17213 * Array of types that will be used to filter out the requests that do not match
17214 * the types. When not specified, all types will be matched. Can be `mainFrame`,
17215 * `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`,
17216 * `cspReport`, `media` or `webSocket`.
17217 */
17218 types?: Array<'mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket'>;
17219 /**
17220 * Array of URL patterns that will be used to filter out the requests that do not
17221 * match the URL patterns.
17222 */
17223 urls: string[];
17224 }
17225
17226 interface WebSource {
17227
17228 // Docs: https://electronjs.org/docs/api/structures/web-source
17229
17230 code: string;
17231 url?: string;
17232 }
17233
17234 interface WebUtils extends NodeJS.EventEmitter {
17235
17236 // Docs: https://electronjs.org/docs/api/web-utils
17237
17238 /**
17239 * The file system path that this `File` object points to. In the case where the
17240 * object passed in is not a `File` object an exception is thrown. In the case
17241 * where the File object passed in was constructed in JS and is not backed by a
17242 * file on disk an empty string is returned.
17243 *
17244 * This method superceded the previous augmentation to the `File` object with the
17245 * `path` property. An example is included below.
17246 */
17247 getPathForFile(file: File): string;
17248 }
17249
17250 interface WebviewTag extends HTMLElement {
17251
17252 // Docs: https://electronjs.org/docs/api/webview-tag
17253
17254 /**
17255 * Fired when a load has committed. This includes navigation within the current
17256 * document as well as subframe document-level loads, but does not include
17257 * asynchronous resource loads.
17258 */
17259 addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
17260 removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
17261 /**
17262 * Fired when the navigation is done, i.e. the spinner of the tab will stop
17263 * spinning, and the `onload` event is dispatched.
17264 */
17265 addEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17266 removeEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void): this;
17267 /**
17268 * This event is like `did-finish-load`, but fired when the load failed or was
17269 * cancelled, e.g. `window.stop()` is invoked.
17270 */
17271 addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
17272 removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
17273 /**
17274 * Fired when a frame has done navigation.
17275 */
17276 addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
17277 removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
17278 /**
17279 * Corresponds to the points in time when the spinner of the tab starts spinning.
17280 */
17281 addEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17282 removeEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void): this;
17283 /**
17284 * Corresponds to the points in time when the spinner of the tab stops spinning.
17285 */
17286 addEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17287 removeEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void): this;
17288 /**
17289 * Fired when attached to the embedder web contents.
17290 */
17291 addEventListener(event: 'did-attach', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17292 removeEventListener(event: 'did-attach', listener: (event: DOMEvent) => void): this;
17293 /**
17294 * Fired when document in the given frame is loaded.
17295 */
17296 addEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17297 removeEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void): this;
17298 /**
17299 * Fired when page title is set during navigation. `explicitSet` is false when
17300 * title is synthesized from file url.
17301 */
17302 addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
17303 removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
17304 /**
17305 * Fired when page receives favicon urls.
17306 */
17307 addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
17308 removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
17309 /**
17310 * Fired when page enters fullscreen triggered by HTML API.
17311 */
17312 addEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17313 removeEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void): this;
17314 /**
17315 * Fired when page leaves fullscreen triggered by HTML API.
17316 */
17317 addEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17318 removeEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void): this;
17319 /**
17320 * Fired when the guest window logs a console message.
17321 *
17322 * The following example code forwards all log messages to the embedder's console
17323 * without regard for log level or other properties.
17324 */
17325 addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
17326 removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
17327 /**
17328 * Fired when a result is available for `webview.findInPage` request.
17329 */
17330 addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
17331 removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
17332 /**
17333 * Emitted when a user or the page wants to start navigation. It can happen when
17334 * the `window.location` object is changed or a user clicks a link in the page.
17335 *
17336 * This event will not emit when the navigation is started programmatically with
17337 * APIs like `<webview>.loadURL` and `<webview>.back`.
17338 *
17339 * It is also not emitted during in-page navigation, such as clicking anchor links
17340 * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
17341 * this purpose.
17342 *
17343 * Calling `event.preventDefault()` does **NOT** have any effect.
17344 */
17345 addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
17346 removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
17347 /**
17348 * Emitted when a user or the page wants to start navigation anywhere in the
17349 * `<webview>` or any frames embedded within. It can happen when the
17350 * `window.location` object is changed or a user clicks a link in the page.
17351 *
17352 * This event will not emit when the navigation is started programmatically with
17353 * APIs like `<webview>.loadURL` and `<webview>.back`.
17354 *
17355 * It is also not emitted during in-page navigation, such as clicking anchor links
17356 * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
17357 * this purpose.
17358 *
17359 * Calling `event.preventDefault()` does **NOT** have any effect.
17360 */
17361 addEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void, useCapture?: boolean): this;
17362 removeEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void): this;
17363 /**
17364 * Emitted when any frame (including main) starts navigating. `isInPlace` will be
17365 * `true` for in-page navigations.
17366 */
17367 addEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void, useCapture?: boolean): this;
17368 removeEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void): this;
17369 /**
17370 * Emitted after a server side redirect occurs during navigation. For example a 302
17371 * redirect.
17372 */
17373 addEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void, useCapture?: boolean): this;
17374 removeEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void): this;
17375 /**
17376 * Emitted when a navigation is done.
17377 *
17378 * This event is not emitted for in-page navigations, such as clicking anchor links
17379 * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
17380 * this purpose.
17381 */
17382 addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
17383 removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
17384 /**
17385 * Emitted when any frame navigation is done.
17386 *
17387 * This event is not emitted for in-page navigations, such as clicking anchor links
17388 * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
17389 * this purpose.
17390 */
17391 addEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void, useCapture?: boolean): this;
17392 removeEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void): this;
17393 /**
17394 * Emitted when an in-page navigation happened.
17395 *
17396 * When in-page navigation happens, the page URL changes but does not cause
17397 * navigation outside of the page. Examples of this occurring are when anchor links
17398 * are clicked or when the DOM `hashchange` event is triggered.
17399 */
17400 addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
17401 removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
17402 /**
17403 * Fired when the guest page attempts to close itself.
17404 *
17405 * The following example code navigates the `webview` to `about:blank` when the
17406 * guest attempts to close itself.
17407 */
17408 addEventListener(event: 'close', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17409 removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
17410 /**
17411 * Fired when the guest page has sent an asynchronous message to embedder page.
17412 *
17413 * With `sendToHost` method and `ipc-message` event you can communicate between
17414 * guest page and embedder page:
17415 */
17416 addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
17417 removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
17418 /**
17419 * Fired when the renderer process unexpectedly disappears. This is normally
17420 * because it was crashed or killed.
17421 */
17422 addEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void, useCapture?: boolean): this;
17423 removeEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void): this;
17424 /**
17425 * Fired when a plugin process is crashed.
17426 */
17427 addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
17428 removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
17429 /**
17430 * Fired when the WebContents is destroyed.
17431 */
17432 addEventListener(event: 'destroyed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17433 removeEventListener(event: 'destroyed', listener: (event: DOMEvent) => void): this;
17434 /**
17435 * Emitted when media starts playing.
17436 */
17437 addEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17438 removeEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void): this;
17439 /**
17440 * Emitted when media is paused or done playing.
17441 */
17442 addEventListener(event: 'media-paused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17443 removeEventListener(event: 'media-paused', listener: (event: DOMEvent) => void): this;
17444 /**
17445 * Emitted when a page's theme color changes. This is usually due to encountering a
17446 * meta tag:
17447 */
17448 addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
17449 removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
17450 /**
17451 * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
17452 */
17453 addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
17454 removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
17455 addEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void, useCapture?: boolean): this;
17456 removeEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void): this;
17457 /**
17458 * Emitted when 'Search' is selected for text in its context menu.
17459 */
17460 addEventListener(event: 'devtools-search-query', listener: (event: DevtoolsSearchQueryEvent) => void, useCapture?: boolean): this;
17461 removeEventListener(event: 'devtools-search-query', listener: (event: DevtoolsSearchQueryEvent) => void): this;
17462 /**
17463 * Emitted when DevTools is opened.
17464 */
17465 addEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17466 removeEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void): this;
17467 /**
17468 * Emitted when DevTools is closed.
17469 */
17470 addEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17471 removeEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void): this;
17472 /**
17473 * Emitted when DevTools is focused / opened.
17474 */
17475 addEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
17476 removeEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void): this;
17477 /**
17478 * Emitted when there is a new context menu that needs to be handled.
17479 */
17480 addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
17481 removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
17482 addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
17483 addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
17484 removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
17485 removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
17486 /**
17487 * Adjusts the current text selection starting and ending points in the focused
17488 * frame by the given amounts. A negative amount moves the selection towards the
17489 * beginning of the document, and a positive amount moves the selection towards the
17490 * end of the document.
17491 *
17492 * See `webContents.adjustSelection` for examples.
17493 */
17494 adjustSelection(options: AdjustSelectionOptions): void;
17495 /**
17496 * Whether the guest page can go back.
17497 */
17498 canGoBack(): boolean;
17499 /**
17500 * Whether the guest page can go forward.
17501 */
17502 canGoForward(): boolean;
17503 /**
17504 * Whether the guest page can go to `offset`.
17505 */
17506 canGoToOffset(offset: number): boolean;
17507 /**
17508 * Resolves with a NativeImage
17509 *
17510 * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
17511 * whole visible page.
17512 */
17513 capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
17514 /**
17515 * Centers the current text selection in page.
17516 */
17517 centerSelection(): void;
17518 /**
17519 * Clears the navigation history.
17520 */
17521 clearHistory(): void;
17522 /**
17523 * Closes the DevTools window of guest page.
17524 */
17525 closeDevTools(): void;
17526 /**
17527 * Executes editing command `copy` in page.
17528 */
17529 copy(): void;
17530 /**
17531 * Executes editing command `cut` in page.
17532 */
17533 cut(): void;
17534 /**
17535 * Executes editing command `delete` in page.
17536 */
17537 delete(): void;
17538 /**
17539 * Initiates a download of the resource at `url` without navigating.
17540 */
17541 downloadURL(url: string, options?: DownloadURLOptions): void;
17542 /**
17543 * A promise that resolves with the result of the executed code or is rejected if
17544 * the result of the code is a rejected promise.
17545 *
17546 * Evaluates `code` in page. If `userGesture` is set, it will create the user
17547 * gesture context in the page. HTML APIs like `requestFullScreen`, which require
17548 * user action, can take advantage of this option for automation.
17549 */
17550 executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
17551 /**
17552 * The request id used for the request.
17553 *
17554 * Starts a request to find all matches for the `text` in the web page. The result
17555 * of the request can be obtained by subscribing to `found-in-page` event.
17556 */
17557 findInPage(text: string, options?: FindInPageOptions): number;
17558 /**
17559 * The title of guest page.
17560 */
17561 getTitle(): string;
17562 /**
17563 * The URL of guest page.
17564 */
17565 getURL(): string;
17566 /**
17567 * The user agent for guest page.
17568 */
17569 getUserAgent(): string;
17570 /**
17571 * The WebContents ID of this `webview`.
17572 */
17573 getWebContentsId(): number;
17574 /**
17575 * the current zoom factor.
17576 */
17577 getZoomFactor(): number;
17578 /**
17579 * the current zoom level.
17580 */
17581 getZoomLevel(): number;
17582 /**
17583 * Makes the guest page go back.
17584 */
17585 goBack(): void;
17586 /**
17587 * Makes the guest page go forward.
17588 */
17589 goForward(): void;
17590 /**
17591 * Navigates to the specified absolute index.
17592 */
17593 goToIndex(index: number): void;
17594 /**
17595 * Navigates to the specified offset from the "current entry".
17596 */
17597 goToOffset(offset: number): void;
17598 /**
17599 * A promise that resolves with a key for the inserted CSS that can later be used
17600 * to remove the CSS via `<webview>.removeInsertedCSS(key)`.
17601 *
17602 * Injects CSS into the current web page and returns a unique key for the inserted
17603 * stylesheet.
17604 */
17605 insertCSS(css: string): Promise<string>;
17606 /**
17607 * Inserts `text` to the focused element.
17608 */
17609 insertText(text: string): Promise<void>;
17610 /**
17611 * Starts inspecting element at position (`x`, `y`) of guest page.
17612 */
17613 inspectElement(x: number, y: number): void;
17614 /**
17615 * Opens the DevTools for the service worker context present in the guest page.
17616 */
17617 inspectServiceWorker(): void;
17618 /**
17619 * Opens the DevTools for the shared worker context present in the guest page.
17620 */
17621 inspectSharedWorker(): void;
17622 /**
17623 * Whether guest page has been muted.
17624 */
17625 isAudioMuted(): boolean;
17626 /**
17627 * Whether the renderer process has crashed.
17628 */
17629 isCrashed(): boolean;
17630 /**
17631 * Whether audio is currently playing.
17632 */
17633 isCurrentlyAudible(): boolean;
17634 /**
17635 * Whether DevTools window of guest page is focused.
17636 */
17637 isDevToolsFocused(): boolean;
17638 /**
17639 * Whether guest page has a DevTools window attached.
17640 */
17641 isDevToolsOpened(): boolean;
17642 /**
17643 * Whether guest page is still loading resources.
17644 */
17645 isLoading(): boolean;
17646 /**
17647 * Whether the main frame (and not just iframes or frames within it) is still
17648 * loading.
17649 */
17650 isLoadingMainFrame(): boolean;
17651 /**
17652 * Whether the guest page is waiting for a first-response for the main resource of
17653 * the page.
17654 */
17655 isWaitingForResponse(): boolean;
17656 /**
17657 * The promise will resolve when the page has finished loading (see
17658 * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
17659 *
17660 * Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
17661 * the `http://` or `file://`.
17662 */
17663 loadURL(url: string, options?: LoadURLOptions): Promise<void>;
17664 /**
17665 * Opens a DevTools window for guest page.
17666 */
17667 openDevTools(): void;
17668 /**
17669 * Executes editing command `paste` in page.
17670 */
17671 paste(): void;
17672 /**
17673 * Executes editing command `pasteAndMatchStyle` in page.
17674 */
17675 pasteAndMatchStyle(): void;
17676 /**
17677 * Prints `webview`'s web page. Same as `webContents.print([options])`.
17678 */
17679 print(options?: WebviewTagPrintOptions): Promise<void>;
17680 /**
17681 * Resolves with the generated PDF data.
17682 *
17683 * Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
17684 */
17685 printToPDF(options: PrintToPDFOptions): Promise<Uint8Array>;
17686 /**
17687 * Executes editing command `redo` in page.
17688 */
17689 redo(): void;
17690 /**
17691 * Reloads the guest page.
17692 */
17693 reload(): void;
17694 /**
17695 * Reloads the guest page and ignores cache.
17696 */
17697 reloadIgnoringCache(): void;
17698 /**
17699 * Resolves if the removal was successful.
17700 *
17701 * Removes the inserted CSS from the current web page. The stylesheet is identified
17702 * by its key, which is returned from `<webview>.insertCSS(css)`.
17703 */
17704 removeInsertedCSS(key: string): Promise<void>;
17705 /**
17706 * Executes editing command `replace` in page.
17707 */
17708 replace(text: string): void;
17709 /**
17710 * Executes editing command `replaceMisspelling` in page.
17711 */
17712 replaceMisspelling(text: string): void;
17713 /**
17714 * Scrolls to the bottom of the current `<webview>`.
17715 */
17716 scrollToBottom(): void;
17717 /**
17718 * Scrolls to the top of the current `<webview>`.
17719 */
17720 scrollToTop(): void;
17721 /**
17722 * Executes editing command `selectAll` in page.
17723 */
17724 selectAll(): void;
17725 /**
17726 * Send an asynchronous message to renderer process via `channel`, you can also
17727 * send arbitrary arguments. The renderer process can handle the message by
17728 * listening to the `channel` event with the `ipcRenderer` module.
17729 *
17730 * See webContents.send for examples.
17731 */
17732 send(channel: string, ...args: any[]): Promise<void>;
17733 /**
17734 * Sends an input `event` to the page.
17735 *
17736 * See webContents.sendInputEvent for detailed description of `event` object.
17737 */
17738 sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
17739 /**
17740 * Send an asynchronous message to renderer process via `channel`, you can also
17741 * send arbitrary arguments. The renderer process can handle the message by
17742 * listening to the `channel` event with the `ipcRenderer` module.
17743 *
17744 * See webContents.sendToFrame for examples.
17745 */
17746 sendToFrame(frameId: [number, number], channel: string, ...args: any[]): Promise<void>;
17747 /**
17748 * Set guest page muted.
17749 */
17750 setAudioMuted(muted: boolean): void;
17751 /**
17752 * Overrides the user agent for the guest page.
17753 */
17754 setUserAgent(userAgent: string): void;
17755 /**
17756 * Sets the maximum and minimum pinch-to-zoom level.
17757 */
17758 setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
17759 /**
17760 * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
17761 * divided by 100, so 300% = 3.0.
17762 */
17763 setZoomFactor(factor: number): void;
17764 /**
17765 * Changes the zoom level to the specified level. The original size is 0 and each
17766 * increment above or below represents zooming 20% larger or smaller to default
17767 * limits of 300% and 50% of original size, respectively. The formula for this is
17768 * `scale := 1.2 ^ level`.
17769 *
17770 * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
17771 * the zoom level for a specific domain propagates across all instances of windows
17772 * with the same domain. Differentiating the window URLs will make zoom work
17773 * per-window.
17774 */
17775 setZoomLevel(level: number): void;
17776 /**
17777 * Shows pop-up dictionary that searches the selected word on the page.
17778 *
17779 * @platform darwin
17780 */
17781 showDefinitionForSelection(): void;
17782 /**
17783 * Stops any pending navigation.
17784 */
17785 stop(): void;
17786 /**
17787 * Stops any `findInPage` request for the `webview` with the provided `action`.
17788 */
17789 stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
17790 /**
17791 * Executes editing command `undo` in page.
17792 */
17793 undo(): void;
17794 /**
17795 * Executes editing command `unselect` in page.
17796 */
17797 unselect(): void;
17798 /**
17799 * A `boolean`. When this attribute is present the guest page will be allowed to
17800 * open new windows. Popups are disabled by default.
17801 */
17802 allowpopups: boolean;
17803 /**
17804 * A `string` which is a list of strings which specifies the blink features to be
17805 * disabled separated by `,`. The full list of supported feature strings can be
17806 * found in the RuntimeEnabledFeatures.json5 file.
17807 */
17808 disableblinkfeatures: string;
17809 /**
17810 * A `boolean`. When this attribute is present the guest page will have web
17811 * security disabled. Web security is enabled by default.
17812 *
17813 * This value can only be modified before the first navigation.
17814 */
17815 disablewebsecurity: boolean;
17816 /**
17817 * A `string` which is a list of strings which specifies the blink features to be
17818 * enabled separated by `,`. The full list of supported feature strings can be
17819 * found in the RuntimeEnabledFeatures.json5 file.
17820 */
17821 enableblinkfeatures: string;
17822 /**
17823 * A `string` that sets the referrer URL for the guest page.
17824 */
17825 httpreferrer: string;
17826 /**
17827 * A `boolean`. When this attribute is present the guest page in `webview` will
17828 * have node integration and can use node APIs like `require` and `process` to
17829 * access low level system resources. Node integration is disabled by default in
17830 * the guest page.
17831 */
17832 nodeintegration: boolean;
17833 /**
17834 * A `boolean` for the experimental option for enabling NodeJS support in
17835 * sub-frames such as iframes inside the `webview`. All your preloads will load for
17836 * every iframe, you can use `process.isMainFrame` to determine if you are in the
17837 * main frame or not. This option is disabled by default in the guest page.
17838 */
17839 nodeintegrationinsubframes: boolean;
17840 /**
17841 * A `string` that sets the session used by the page. If `partition` starts with
17842 * `persist:`, the page will use a persistent session available to all pages in the
17843 * app with the same `partition`. if there is no `persist:` prefix, the page will
17844 * use an in-memory session. By assigning the same `partition`, multiple pages can
17845 * share the same session. If the `partition` is unset then default session of the
17846 * app will be used.
17847 *
17848 * This value can only be modified before the first navigation, since the session
17849 * of an active renderer process cannot change. Subsequent attempts to modify the
17850 * value will fail with a DOM exception.
17851 */
17852 partition: string;
17853 /**
17854 * A `boolean`. When this attribute is present the guest page in `webview` will be
17855 * able to use browser plugins. Plugins are disabled by default.
17856 */
17857 plugins: boolean;
17858 /**
17859 * A `string` that specifies a script that will be loaded before other scripts run
17860 * in the guest page. The protocol of script's URL must be `file:` (even when using
17861 * `asar:` archives) because it will be loaded by Node's `require` under the hood,
17862 * which treats `asar:` archives as virtual directories.
17863 *
17864 * When the guest page doesn't have node integration this script will still have
17865 * access to all Node APIs, but global objects injected by Node will be deleted
17866 * after this script has finished executing.
17867 */
17868 preload: string;
17869 /**
17870 * A `string` representing the visible URL. Writing to this attribute initiates
17871 * top-level navigation.
17872 *
17873 * Assigning `src` its own value will reload the current page.
17874 *
17875 * The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
17876 * world!`.
17877 */
17878 src: string;
17879 /**
17880 * A `string` that sets the user agent for the guest page before the page is
17881 * navigated to. Once the page is loaded, use the `setUserAgent` method to change
17882 * the user agent.
17883 */
17884 useragent: string;
17885 /**
17886 * A `string` which is a comma separated list of strings which specifies the web
17887 * preferences to be set on the webview. The full list of supported preference
17888 * strings can be found in BrowserWindow. In addition, webview supports the
17889 * following preferences:
17890 *
17891 * * `transparent` boolean (optional) - Whether to enable background transparency
17892 * for the guest page. Default is `true`. **Note:** The guest page's text and
17893 * background colors are derived from the color scheme of its root element. When
17894 * transparency is enabled, the text color will still change accordingly but the
17895 * background will remain transparent.
17896 *
17897 * The string follows the same format as the features string in `window.open`. A
17898 * name by itself is given a `true` boolean value. A preference can be set to
17899 * another value by including an `=`, followed by the value. Special values `yes`
17900 * and `1` are interpreted as `true`, while `no` and `0` are interpreted as
17901 * `false`.
17902 */
17903 webpreferences?: ('transparent');
17904 }
17905
17906 interface AboutPanelOptionsOptions {
17907 /**
17908 * The app's name.
17909 */
17910 applicationName?: string;
17911 /**
17912 * The app's version.
17913 */
17914 applicationVersion?: string;
17915 /**
17916 * Copyright information.
17917 */
17918 copyright?: string;
17919 /**
17920 * The app's build version number.
17921 *
17922 * @platform darwin
17923 */
17924 version?: string;
17925 /**
17926 * Credit information.
17927 *
17928 * @platform darwin,win32
17929 */
17930 credits?: string;
17931 /**
17932 * List of app authors.
17933 *
17934 * @platform linux
17935 */
17936 authors?: string[];
17937 /**
17938 * The app's website.
17939 *
17940 * @platform linux
17941 */
17942 website?: string;
17943 /**
17944 * Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as
17945 * 64x64 pixels while retaining aspect ratio.
17946 *
17947 * @platform linux,win32
17948 */
17949 iconPath?: string;
17950 }
17951
17952 interface AddRepresentationOptions {
17953 /**
17954 * The scale factor to add the image representation for.
17955 */
17956 scaleFactor?: number;
17957 /**
17958 * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
17959 */
17960 width?: number;
17961 /**
17962 * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
17963 */
17964 height?: number;
17965 /**
17966 * The buffer containing the raw image data.
17967 */
17968 buffer?: Buffer;
17969 /**
17970 * The data URL containing either a base 64 encoded PNG or JPEG image.
17971 */
17972 dataURL?: string;
17973 }
17974
17975 interface AdjustSelectionOptions {
17976 /**
17977 * Amount to shift the start index of the current selection.
17978 */
17979 start?: number;
17980 /**
17981 * Amount to shift the end index of the current selection.
17982 */
17983 end?: number;
17984 }
17985
17986 interface AnimationSettings {
17987 /**
17988 * Returns true if rich animations should be rendered. Looks at session type (e.g.
17989 * remote desktop) and accessibility settings to give guidance for heavy
17990 * animations.
17991 */
17992 shouldRenderRichAnimation: boolean;
17993 /**
17994 * Determines on a per-platform basis whether scroll animations (e.g. produced by
17995 * home/end key) should be enabled.
17996 */
17997 scrollAnimationsEnabledBySystem: boolean;
17998 /**
17999 * Determines whether the user desires reduced motion based on platform APIs.
18000 */
18001 prefersReducedMotion: boolean;
18002 }
18003
18004 interface AppDetailsOptions {
18005 /**
18006 * Window's App User Model ID. It has to be set, otherwise the other options will
18007 * have no effect.
18008 */
18009 appId?: string;
18010 /**
18011 * Window's Relaunch Icon.
18012 */
18013 appIconPath?: string;
18014 /**
18015 * Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
18016 * Default is `0`.
18017 */
18018 appIconIndex?: number;
18019 /**
18020 * Window's Relaunch Command.
18021 */
18022 relaunchCommand?: string;
18023 /**
18024 * Window's Relaunch Display Name.
18025 */
18026 relaunchDisplayName?: string;
18027 }
18028
18029 interface ApplicationInfoForProtocolReturnValue {
18030 /**
18031 * the display icon of the app handling the protocol.
18032 */
18033 icon: NativeImage;
18034 /**
18035 * installation path of the app handling the protocol.
18036 */
18037 path: string;
18038 /**
18039 * display name of the app handling the protocol.
18040 */
18041 name: string;
18042 }
18043
18044 interface AuthenticationResponseDetails {
18045 url: string;
18046 }
18047
18048 interface AuthInfo {
18049 isProxy: boolean;
18050 scheme: string;
18051 host: string;
18052 port: number;
18053 realm: string;
18054 }
18055
18056 interface AutoResizeOptions {
18057 /**
18058 * If `true`, the view's width will grow and shrink together with the window.
18059 * `false` by default.
18060 */
18061 width?: boolean;
18062 /**
18063 * If `true`, the view's height will grow and shrink together with the window.
18064 * `false` by default.
18065 */
18066 height?: boolean;
18067 /**
18068 * If `true`, the view's x position and width will grow and shrink proportionally
18069 * with the window. `false` by default.
18070 */
18071 horizontal?: boolean;
18072 /**
18073 * If `true`, the view's y position and height will grow and shrink proportionally
18074 * with the window. `false` by default.
18075 */
18076 vertical?: boolean;
18077 }
18078
18079 interface BeforeSendResponse {
18080 cancel?: boolean;
18081 /**
18082 * When provided, request will be made with these headers.
18083 */
18084 requestHeaders?: Record<string, (string) | (string[])>;
18085 }
18086
18087 interface BitmapOptions {
18088 /**
18089 * Defaults to 1.0.
18090 */
18091 scaleFactor?: number;
18092 }
18093
18094 interface BlinkMemoryInfo {
18095 /**
18096 * Size of all allocated objects in Kilobytes.
18097 */
18098 allocated: number;
18099 /**
18100 * Total allocated space in Kilobytes.
18101 */
18102 total: number;
18103 }
18104
18105 interface BluetoothPairingHandlerHandlerDetails {
18106 deviceId: string;
18107 /**
18108 * The type of pairing prompt being requested. One of the following values:
18109 */
18110 pairingKind: ('confirm' | 'confirmPin' | 'providePin');
18111 frame: WebFrameMain;
18112 /**
18113 * The pin value to verify if `pairingKind` is `confirmPin`.
18114 */
18115 pin?: string;
18116 }
18117
18118 interface BrowserViewConstructorOptions {
18119 /**
18120 * Settings of web page's features.
18121 */
18122 webPreferences?: WebPreferences;
18123 }
18124
18125 interface CallbackResponse {
18126 cancel?: boolean;
18127 /**
18128 * The original request is prevented from being sent or completed and is instead
18129 * redirected to the given URL.
18130 */
18131 redirectURL?: string;
18132 }
18133
18134 interface CertificateTrustDialogOptions {
18135 /**
18136 * The certificate to trust/import.
18137 */
18138 certificate: Certificate;
18139 /**
18140 * The message to display to the user.
18141 */
18142 message: string;
18143 }
18144
18145 interface ClearCodeCachesOptions {
18146 /**
18147 * An array of url corresponding to the resource whose generated code cache needs
18148 * to be removed. If the list is empty then all entries in the cache directory will
18149 * be removed.
18150 */
18151 urls?: string[];
18152 }
18153
18154 interface ClearStorageDataOptions {
18155 /**
18156 * Should follow `window.location.origin`’s representation `scheme://host:port`.
18157 */
18158 origin?: string;
18159 /**
18160 * The types of storages to clear, can be `cookies`, `filesystem`, `indexdb`,
18161 * `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If
18162 * not specified, clear all storage types.
18163 */
18164 storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers' | 'cachestorage'>;
18165 /**
18166 * The types of quotas to clear, can be `temporary`, `syncable`. If not specified,
18167 * clear all quotas.
18168 */
18169 quotas?: Array<'temporary' | 'syncable'>;
18170 }
18171
18172 interface ClientRequestConstructorOptions {
18173 /**
18174 * The HTTP request method. Defaults to the GET method.
18175 */
18176 method?: string;
18177 /**
18178 * The request URL. Must be provided in the absolute form with the protocol scheme
18179 * specified as http or https.
18180 */
18181 url?: string;
18182 /**
18183 * Headers to be sent with the request.
18184 */
18185 headers?: Record<string, (string) | (string[])>;
18186 /**
18187 * The `Session` instance with which the request is associated.
18188 */
18189 session?: Session;
18190 /**
18191 * The name of the `partition` with which the request is associated. Defaults to
18192 * the empty string. The `session` option supersedes `partition`. Thus if a
18193 * `session` is explicitly specified, `partition` is ignored.
18194 */
18195 partition?: string;
18196 /**
18197 * Can be `include`, `omit` or `same-origin`. Whether to send credentials with this
18198 * request. If set to `include`, credentials from the session associated with the
18199 * request will be used. If set to `omit`, credentials will not be sent with the
18200 * request (and the `'login'` event will not be triggered in the event of a 401).
18201 * If set to `same-origin`, `origin` must also be specified. This matches the
18202 * behavior of the fetch option of the same name. If this option is not specified,
18203 * authentication data from the session will be sent, and cookies will not be sent
18204 * (unless `useSessionCookies` is set).
18205 */
18206 credentials?: ('include' | 'omit' | 'same-origin');
18207 /**
18208 * Whether to send cookies with this request from the provided session. If
18209 * `credentials` is specified, this option has no effect. Default is `false`.
18210 */
18211 useSessionCookies?: boolean;
18212 /**
18213 * Can be `http:` or `https:`. The protocol scheme in the form 'scheme:'. Defaults
18214 * to 'http:'.
18215 */
18216 protocol?: ('http:' | 'https:');
18217 /**
18218 * The server host provided as a concatenation of the hostname and the port number
18219 * 'hostname:port'.
18220 */
18221 host?: string;
18222 /**
18223 * The server host name.
18224 */
18225 hostname?: string;
18226 /**
18227 * The server's listening port number.
18228 */
18229 port?: number;
18230 /**
18231 * The path part of the request URL.
18232 */
18233 path?: string;
18234 /**
18235 * Can be `follow`, `error` or `manual`. The redirect mode for this request. When
18236 * mode is `error`, any redirection will be aborted. When mode is `manual` the
18237 * redirection will be cancelled unless `request.followRedirect` is invoked
18238 * synchronously during the `redirect` event. Defaults to `follow`.
18239 */
18240 redirect?: ('follow' | 'error' | 'manual');
18241 /**
18242 * The origin URL of the request.
18243 */
18244 origin?: string;
18245 /**
18246 * can be `""`, `no-referrer`, `no-referrer-when-downgrade`, `origin`,
18247 * `origin-when-cross-origin`, `unsafe-url`, `same-origin`, `strict-origin`, or
18248 * `strict-origin-when-cross-origin`. Defaults to
18249 * `strict-origin-when-cross-origin`.
18250 */
18251 referrerPolicy?: string;
18252 /**
18253 * can be `default`, `no-store`, `reload`, `no-cache`, `force-cache` or
18254 * `only-if-cached`.
18255 */
18256 cache?: ('default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached');
18257 }
18258
18259 interface CloseOpts {
18260 /**
18261 * if true, fire the `beforeunload` event before closing the page. If the page
18262 * prevents the unload, the WebContents will not be closed. The
18263 * `will-prevent-unload` will be fired if the page requests prevention of unload.
18264 */
18265 waitForBeforeUnload: boolean;
18266 }
18267
18268 interface Config {
18269 /**
18270 * Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The minimum SSL version to allow
18271 * when connecting to remote servers. Defaults to `tls1`.
18272 */
18273 minVersion?: ('tls1' | 'tls1.1' | 'tls1.2' | 'tls1.3');
18274 /**
18275 * Can be `tls1.2` or `tls1.3`. The maximum SSL version to allow when connecting to
18276 * remote servers. Defaults to `tls1.3`.
18277 */
18278 maxVersion?: ('tls1.2' | 'tls1.3');
18279 /**
18280 * List of cipher suites which should be explicitly prevented from being used in
18281 * addition to those disabled by the net built-in policy. Supported literal forms:
18282 * 0xAABB, where AA is `cipher_suite[0]` and BB is `cipher_suite[1]`, as defined in
18283 * RFC 2246, Section 7.4.1.2. Unrecognized but parsable cipher suites in this form
18284 * will not return an error. Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify
18285 * 0x0004, while to disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002. Note
18286 * that TLSv1.3 ciphers cannot be disabled using this mechanism.
18287 */
18288 disabledCipherSuites?: number[];
18289 }
18290
18291 interface ConfigureHostResolverOptions {
18292 /**
18293 * Whether the built-in host resolver is used in preference to getaddrinfo. When
18294 * enabled, the built-in resolver will attempt to use the system's DNS settings to
18295 * do DNS lookups itself. Enabled by default on macOS, disabled by default on
18296 * Windows and Linux.
18297 */
18298 enableBuiltInResolver?: boolean;
18299 /**
18300 * Can be 'off', 'automatic' or 'secure'. Configures the DNS-over-HTTP mode. When
18301 * 'off', no DoH lookups will be performed. When 'automatic', DoH lookups will be
18302 * performed first if DoH is available, and insecure DNS lookups will be performed
18303 * as a fallback. When 'secure', only DoH lookups will be performed. Defaults to
18304 * 'automatic'.
18305 */
18306 secureDnsMode?: ('off' | 'automatic' | 'secure');
18307 /**
18308 * A list of DNS-over-HTTP server templates. See RFC8484 § 3 for details on the
18309 * template format. Most servers support the POST method; the template for such
18310 * servers is simply a URI. Note that for some DNS providers, the resolver will
18311 * automatically upgrade to DoH unless DoH is explicitly disabled, even if there
18312 * are no DoH servers provided in this list.
18313 */
18314 secureDnsServers?: string[];
18315 /**
18316 * Controls whether additional DNS query types, e.g. HTTPS (DNS type 65) will be
18317 * allowed besides the traditional A and AAAA queries when a request is being made
18318 * via insecure DNS. Has no effect on Secure DNS which always allows additional
18319 * types. Defaults to true.
18320 */
18321 enableAdditionalDnsQueryTypes?: boolean;
18322 }
18323
18324 interface ConsoleMessageEvent extends DOMEvent {
18325 /**
18326 * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
18327 * `error`.
18328 */
18329 level: number;
18330 /**
18331 * The actual console message
18332 */
18333 message: string;
18334 /**
18335 * The line number of the source that triggered this console message
18336 */
18337 line: number;
18338 sourceId: string;
18339 }
18340
18341 interface ContextMenuEvent extends DOMEvent {
18342 params: Params;
18343 }
18344
18345 interface ContextMenuParams {
18346 /**
18347 * x coordinate.
18348 */
18349 x: number;
18350 /**
18351 * y coordinate.
18352 */
18353 y: number;
18354 /**
18355 * Frame from which the context menu was invoked.
18356 */
18357 frame: WebFrameMain;
18358 /**
18359 * URL of the link that encloses the node the context menu was invoked on.
18360 */
18361 linkURL: string;
18362 /**
18363 * Text associated with the link. May be an empty string if the contents of the
18364 * link are an image.
18365 */
18366 linkText: string;
18367 /**
18368 * URL of the top level page that the context menu was invoked on.
18369 */
18370 pageURL: string;
18371 /**
18372 * URL of the subframe that the context menu was invoked on.
18373 */
18374 frameURL: string;
18375 /**
18376 * Source URL for the element that the context menu was invoked on. Elements with
18377 * source URLs are images, audio and video.
18378 */
18379 srcURL: string;
18380 /**
18381 * Type of the node the context menu was invoked on. Can be `none`, `image`,
18382 * `audio`, `video`, `canvas`, `file` or `plugin`.
18383 */
18384 mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
18385 /**
18386 * Whether the context menu was invoked on an image which has non-empty contents.
18387 */
18388 hasImageContents: boolean;
18389 /**
18390 * Whether the context is editable.
18391 */
18392 isEditable: boolean;
18393 /**
18394 * Text of the selection that the context menu was invoked on.
18395 */
18396 selectionText: string;
18397 /**
18398 * Title text of the selection that the context menu was invoked on.
18399 */
18400 titleText: string;
18401 /**
18402 * Alt text of the selection that the context menu was invoked on.
18403 */
18404 altText: string;
18405 /**
18406 * Suggested filename to be used when saving file through 'Save Link As' option of
18407 * context menu.
18408 */
18409 suggestedFilename: string;
18410 /**
18411 * Rect representing the coordinates in the document space of the selection.
18412 */
18413 selectionRect: Rectangle;
18414 /**
18415 * Start position of the selection text.
18416 */
18417 selectionStartOffset: number;
18418 /**
18419 * The referrer policy of the frame on which the menu is invoked.
18420 */
18421 referrerPolicy: Referrer;
18422 /**
18423 * The misspelled word under the cursor, if any.
18424 */
18425 misspelledWord: string;
18426 /**
18427 * An array of suggested words to show the user to replace the `misspelledWord`.
18428 * Only available if there is a misspelled word and spellchecker is enabled.
18429 */
18430 dictionarySuggestions: string[];
18431 /**
18432 * The character encoding of the frame on which the menu was invoked.
18433 */
18434 frameCharset: string;
18435 /**
18436 * The source that the context menu was invoked on. Possible values include `none`,
18437 * `button-button`, `field-set`, `input-button`, `input-checkbox`, `input-color`,
18438 * `input-date`, `input-datetime-local`, `input-email`, `input-file`,
18439 * `input-hidden`, `input-image`, `input-month`, `input-number`, `input-password`,
18440 * `input-radio`, `input-range`, `input-reset`, `input-search`, `input-submit`,
18441 * `input-telephone`, `input-text`, `input-time`, `input-url`, `input-week`,
18442 * `output`, `reset-button`, `select-list`, `select-list`, `select-multiple`,
18443 * `select-one`, `submit-button`, and `text-area`,
18444 */
18445 formControlType: ('none' | 'button-button' | 'field-set' | 'input-button' | 'input-checkbox' | 'input-color' | 'input-date' | 'input-datetime-local' | 'input-email' | 'input-file' | 'input-hidden' | 'input-image' | 'input-month' | 'input-number' | 'input-password' | 'input-radio' | 'input-range' | 'input-reset' | 'input-search' | 'input-submit' | 'input-telephone' | 'input-text' | 'input-time' | 'input-url' | 'input-week' | 'output' | 'reset-button' | 'select-list' | 'select-list' | 'select-multiple' | 'select-one' | 'submit-button' | 'text-area');
18446 /**
18447 * If the context is editable, whether or not spellchecking is enabled.
18448 */
18449 spellcheckEnabled: boolean;
18450 /**
18451 * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
18452 * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
18453 * `adjustSelection`, or `adjustSelectionReset`.
18454 */
18455 menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
18456 /**
18457 * The flags for the media element the context menu was invoked on.
18458 */
18459 mediaFlags: MediaFlags;
18460 /**
18461 * These flags indicate whether the renderer believes it is able to perform the
18462 * corresponding action.
18463 */
18464 editFlags: EditFlags;
18465 }
18466
18467 interface ContinueActivityDetails {
18468 /**
18469 * A string identifying the URL of the webpage accessed by the activity on another
18470 * device, if available.
18471 */
18472 webpageURL?: string;
18473 }
18474
18475 interface CookiesGetFilter {
18476 /**
18477 * Retrieves cookies which are associated with `url`. Empty implies retrieving
18478 * cookies of all URLs.
18479 */
18480 url?: string;
18481 /**
18482 * Filters cookies by name.
18483 */
18484 name?: string;
18485 /**
18486 * Retrieves cookies whose domains match or are subdomains of `domains`.
18487 */
18488 domain?: string;
18489 /**
18490 * Retrieves cookies whose path matches `path`.
18491 */
18492 path?: string;
18493 /**
18494 * Filters cookies by their Secure property.
18495 */
18496 secure?: boolean;
18497 /**
18498 * Filters out session or persistent cookies.
18499 */
18500 session?: boolean;
18501 /**
18502 * Filters cookies by httpOnly.
18503 */
18504 httpOnly?: boolean;
18505 }
18506
18507 interface CookiesSetDetails {
18508 /**
18509 * The URL to associate the cookie with. The promise will be rejected if the URL is
18510 * invalid.
18511 */
18512 url: string;
18513 /**
18514 * The name of the cookie. Empty by default if omitted.
18515 */
18516 name?: string;
18517 /**
18518 * The value of the cookie. Empty by default if omitted.
18519 */
18520 value?: string;
18521 /**
18522 * The domain of the cookie; this will be normalized with a preceding dot so that
18523 * it's also valid for subdomains. Empty by default if omitted.
18524 */
18525 domain?: string;
18526 /**
18527 * The path of the cookie. Empty by default if omitted.
18528 */
18529 path?: string;
18530 /**
18531 * Whether the cookie should be marked as Secure. Defaults to false unless Same
18532 * Site=None attribute is used.
18533 */
18534 secure?: boolean;
18535 /**
18536 * Whether the cookie should be marked as HTTP only. Defaults to false.
18537 */
18538 httpOnly?: boolean;
18539 /**
18540 * The expiration date of the cookie as the number of seconds since the UNIX epoch.
18541 * If omitted then the cookie becomes a session cookie and will not be retained
18542 * between sessions.
18543 */
18544 expirationDate?: number;
18545 /**
18546 * The Same Site policy to apply to this cookie. Can be `unspecified`,
18547 * `no_restriction`, `lax` or `strict`. Default is `lax`.
18548 */
18549 sameSite?: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
18550 }
18551
18552 interface CrashReporterStartOptions {
18553 /**
18554 * URL that crash reports will be sent to as POST. Required unless `uploadToServer`
18555 * is `false`.
18556 */
18557 submitURL?: string;
18558 /**
18559 * Defaults to `app.name`.
18560 */
18561 productName?: string;
18562 /**
18563 * Deprecated alias for `{ globalExtra: { _companyName: ... } }`.
18564 *
18565 * @deprecated
18566 */
18567 companyName?: string;
18568 /**
18569 * Whether crash reports should be sent to the server. If false, crash reports will
18570 * be collected and stored in the crashes directory, but not uploaded. Default is
18571 * `true`.
18572 */
18573 uploadToServer?: boolean;
18574 /**
18575 * If true, crashes generated in the main process will not be forwarded to the
18576 * system crash handler. Default is `false`.
18577 */
18578 ignoreSystemCrashHandler?: boolean;
18579 /**
18580 * If true, limit the number of crashes uploaded to 1/hour. Default is `false`.
18581 *
18582 * @platform darwin,win32
18583 */
18584 rateLimit?: boolean;
18585 /**
18586 * If true, crash reports will be compressed and uploaded with `Content-Encoding:
18587 * gzip`. Default is `true`.
18588 */
18589 compress?: boolean;
18590 /**
18591 * Extra string key/value annotations that will be sent along with crash reports
18592 * that are generated in the main process. Only string values are supported.
18593 * Crashes generated in child processes will not contain these extra parameters to
18594 * crash reports generated from child processes, call `addExtraParameter` from the
18595 * child process.
18596 */
18597 extra?: Record<string, string>;
18598 /**
18599 * Extra string key/value annotations that will be sent along with any crash
18600 * reports generated in any process. These annotations cannot be changed once the
18601 * crash reporter has been started. If a key is present in both the global extra
18602 * parameters and the process-specific extra parameters, then the global one will
18603 * take precedence. By default, `productName` and the app version are included, as
18604 * well as the Electron version.
18605 */
18606 globalExtra?: Record<string, string>;
18607 }
18608
18609 interface CreateFromBitmapOptions {
18610 width: number;
18611 height: number;
18612 /**
18613 * Defaults to 1.0.
18614 */
18615 scaleFactor?: number;
18616 }
18617
18618 interface CreateFromBufferOptions {
18619 /**
18620 * Required for bitmap buffers.
18621 */
18622 width?: number;
18623 /**
18624 * Required for bitmap buffers.
18625 */
18626 height?: number;
18627 /**
18628 * Defaults to 1.0.
18629 */
18630 scaleFactor?: number;
18631 }
18632
18633 interface CreateInterruptedDownloadOptions {
18634 /**
18635 * Absolute path of the download.
18636 */
18637 path: string;
18638 /**
18639 * Complete URL chain for the download.
18640 */
18641 urlChain: string[];
18642 mimeType?: string;
18643 /**
18644 * Start range for the download.
18645 */
18646 offset: number;
18647 /**
18648 * Total length of the download.
18649 */
18650 length: number;
18651 /**
18652 * Last-Modified header value.
18653 */
18654 lastModified?: string;
18655 /**
18656 * ETag header value.
18657 */
18658 eTag?: string;
18659 /**
18660 * Time when download was started in number of seconds since UNIX epoch.
18661 */
18662 startTime?: number;
18663 }
18664
18665 interface Data {
18666 text?: string;
18667 html?: string;
18668 image?: NativeImage;
18669 rtf?: string;
18670 /**
18671 * The title of the URL at `text`.
18672 */
18673 bookmark?: string;
18674 }
18675
18676 interface DefaultFontFamily {
18677 /**
18678 * Defaults to `Times New Roman`.
18679 */
18680 standard?: string;
18681 /**
18682 * Defaults to `Times New Roman`.
18683 */
18684 serif?: string;
18685 /**
18686 * Defaults to `Arial`.
18687 */
18688 sansSerif?: string;
18689 /**
18690 * Defaults to `Courier New`.
18691 */
18692 monospace?: string;
18693 /**
18694 * Defaults to `Script`.
18695 */
18696 cursive?: string;
18697 /**
18698 * Defaults to `Impact`.
18699 */
18700 fantasy?: string;
18701 /**
18702 * Defaults to `Latin Modern Math`.
18703 */
18704 math?: string;
18705 }
18706
18707 interface Details {
18708 /**
18709 * Process type. One of the following values:
18710 */
18711 type: ('Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
18712 /**
18713 * The reason the child process is gone. Possible values:
18714 */
18715 reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
18716 /**
18717 * The exit code for the process (e.g. status from waitpid if on posix, from
18718 * GetExitCodeProcess on Windows).
18719 */
18720 exitCode: number;
18721 /**
18722 * The non-localized name of the process.
18723 */
18724 serviceName?: string;
18725 /**
18726 * The name of the process. Examples for utility: `Audio Service`, `Content
18727 * Decryption Module Service`, `Network Service`, `Video Capture`, etc.
18728 */
18729 name?: string;
18730 }
18731
18732 interface DevicePermissionHandlerHandlerDetails {
18733 /**
18734 * The type of device that permission is being requested on, can be `hid`,
18735 * `serial`, or `usb`.
18736 */
18737 deviceType: ('hid' | 'serial' | 'usb');
18738 /**
18739 * The origin URL of the device permission check.
18740 */
18741 origin: string;
18742 /**
18743 * the device that permission is being requested for.
18744 */
18745 device: (HIDDevice) | (SerialPort) | (USBDevice);
18746 }
18747
18748 interface DevtoolsOpenUrlEvent extends DOMEvent {
18749 /**
18750 * URL of the link that was clicked or selected.
18751 */
18752 url: string;
18753 }
18754
18755 interface DevtoolsSearchQueryEvent extends DOMEvent {
18756 event: Event;
18757 /**
18758 * text to query for.
18759 */
18760 query: string;
18761 }
18762
18763 interface DidChangeThemeColorEvent extends DOMEvent {
18764 themeColor: string;
18765 }
18766
18767 interface DidCreateWindowDetails {
18768 /**
18769 * URL for the created window.
18770 */
18771 url: string;
18772 /**
18773 * Name given to the created window in the `window.open()` call.
18774 */
18775 frameName: string;
18776 /**
18777 * The options used to create the BrowserWindow. They are merged in increasing
18778 * precedence: parsed options from the `features` string from `window.open()`,
18779 * security-related webPreferences inherited from the parent, and options given by
18780 * `webContents.setWindowOpenHandler`. Unrecognized options are not filtered out.
18781 */
18782 options: BrowserWindowConstructorOptions;
18783 /**
18784 * The referrer that will be passed to the new window. May or may not result in the
18785 * `Referer` header being sent, depending on the referrer policy.
18786 */
18787 referrer: Referrer;
18788 /**
18789 * The post data that will be sent to the new window, along with the appropriate
18790 * headers that will be set. If no post data is to be sent, the value will be
18791 * `null`. Only defined when the window is being created by a form that set
18792 * `target=_blank`.
18793 */
18794 postBody?: PostBody;
18795 /**
18796 * Can be `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
18797 */
18798 disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
18799 }
18800
18801 interface DidFailLoadEvent extends DOMEvent {
18802 errorCode: number;
18803 errorDescription: string;
18804 validatedURL: string;
18805 isMainFrame: boolean;
18806 }
18807
18808 interface DidFrameFinishLoadEvent extends DOMEvent {
18809 isMainFrame: boolean;
18810 }
18811
18812 interface DidFrameNavigateEvent extends DOMEvent {
18813 url: string;
18814 /**
18815 * -1 for non HTTP navigations
18816 */
18817 httpResponseCode: number;
18818 /**
18819 * empty for non HTTP navigations,
18820 */
18821 httpStatusText: string;
18822 isMainFrame: boolean;
18823 frameProcessId: number;
18824 frameRoutingId: number;
18825 }
18826
18827 interface DidNavigateEvent extends DOMEvent {
18828 url: string;
18829 }
18830
18831 interface DidNavigateInPageEvent extends DOMEvent {
18832 isMainFrame: boolean;
18833 url: string;
18834 }
18835
18836 interface DidRedirectNavigationEvent extends DOMEvent {
18837 url: string;
18838 isInPlace: boolean;
18839 isMainFrame: boolean;
18840 frameProcessId: number;
18841 frameRoutingId: number;
18842 }
18843
18844 interface DidStartNavigationEvent extends DOMEvent {
18845 url: string;
18846 isInPlace: boolean;
18847 isMainFrame: boolean;
18848 frameProcessId: number;
18849 frameRoutingId: number;
18850 }
18851
18852 interface DisplayBalloonOptions {
18853 /**
18854 * Icon to use when `iconType` is `custom`.
18855 */
18856 icon?: (NativeImage) | (string);
18857 /**
18858 * Can be `none`, `info`, `warning`, `error` or `custom`. Default is `custom`.
18859 */
18860 iconType?: ('none' | 'info' | 'warning' | 'error' | 'custom');
18861 title: string;
18862 content: string;
18863 /**
18864 * The large version of the icon should be used. Default is `true`. Maps to
18865 * `NIIF_LARGE_ICON`.
18866 */
18867 largeIcon?: boolean;
18868 /**
18869 * Do not play the associated sound. Default is `false`. Maps to `NIIF_NOSOUND`.
18870 */
18871 noSound?: boolean;
18872 /**
18873 * Do not display the balloon notification if the current user is in "quiet time".
18874 * Default is `false`. Maps to `NIIF_RESPECT_QUIET_TIME`.
18875 */
18876 respectQuietTime?: boolean;
18877 }
18878
18879 interface DisplayMediaRequestHandlerHandlerRequest {
18880 /**
18881 * Frame that is requesting access to media.
18882 */
18883 frame: WebFrameMain;
18884 /**
18885 * Origin of the page making the request.
18886 */
18887 securityOrigin: string;
18888 /**
18889 * true if the web content requested a video stream.
18890 */
18891 videoRequested: boolean;
18892 /**
18893 * true if the web content requested an audio stream.
18894 */
18895 audioRequested: boolean;
18896 /**
18897 * Whether a user gesture was active when this request was triggered.
18898 */
18899 userGesture: boolean;
18900 }
18901
18902 interface DownloadURLOptions {
18903 /**
18904 * HTTP request headers.
18905 */
18906 headers?: Record<string, string>;
18907 }
18908
18909 interface EnableNetworkEmulationOptions {
18910 /**
18911 * Whether to emulate network outage. Defaults to false.
18912 */
18913 offline?: boolean;
18914 /**
18915 * RTT in ms. Defaults to 0 which will disable latency throttling.
18916 */
18917 latency?: number;
18918 /**
18919 * Download rate in Bps. Defaults to 0 which will disable download throttling.
18920 */
18921 downloadThroughput?: number;
18922 /**
18923 * Upload rate in Bps. Defaults to 0 which will disable upload throttling.
18924 */
18925 uploadThroughput?: number;
18926 }
18927
18928 interface EntryAtIndex {
18929 /**
18930 * The URL of the navigation entry at the given index.
18931 */
18932 url: string;
18933 /**
18934 * The page title of the navigation entry at the given index.
18935 */
18936 title: string;
18937 }
18938
18939 interface FeedURLOptions {
18940 url: string;
18941 /**
18942 * HTTP request headers.
18943 *
18944 * @platform darwin
18945 */
18946 headers?: Record<string, string>;
18947 /**
18948 * Can be `json` or `default`, see the Squirrel.Mac README for more information.
18949 *
18950 * @platform darwin
18951 */
18952 serverType?: ('json' | 'default');
18953 }
18954
18955 interface FileIconOptions {
18956 size: ('small' | 'normal' | 'large');
18957 }
18958
18959 interface FindInPageOptions {
18960 /**
18961 * Whether to search forward or backward, defaults to `true`.
18962 */
18963 forward?: boolean;
18964 /**
18965 * Whether to begin a new text finding session with this request. Should be `true`
18966 * for initial requests, and `false` for follow-up requests. Defaults to `false`.
18967 */
18968 findNext?: boolean;
18969 /**
18970 * Whether search should be case-sensitive, defaults to `false`.
18971 */
18972 matchCase?: boolean;
18973 }
18974
18975 interface FocusOptions {
18976 /**
18977 * Make the receiver the active app even if another app is currently active.
18978 *
18979 * @platform darwin
18980 */
18981 steal: boolean;
18982 }
18983
18984 interface ForkOptions {
18985 /**
18986 * Environment key-value pairs. Default is `process.env`.
18987 */
18988 env?: Env;
18989 /**
18990 * List of string arguments passed to the executable.
18991 */
18992 execArgv?: string[];
18993 /**
18994 * Current working directory of the child process.
18995 */
18996 cwd?: string;
18997 /**
18998 * Allows configuring the mode for `stdout` and `stderr` of the child process.
18999 * Default is `inherit`. String value can be one of `pipe`, `ignore`, `inherit`,
19000 * for more details on these values you can refer to stdio documentation from
19001 * Node.js. Currently this option only supports configuring `stdout` and `stderr`
19002 * to either `pipe`, `inherit` or `ignore`. Configuring `stdin` to any property
19003 * other than `ignore` is not supported and will result in an error. For example,
19004 * the supported values will be processed as following:
19005 */
19006 stdio?: (Array<'pipe' | 'ignore' | 'inherit'>) | (string);
19007 /**
19008 * Name of the process that will appear in `name` property of `ProcessMetric`
19009 * returned by `app.getAppMetrics` and `child-process-gone` event of `app`. Default
19010 * is `Node Utility Process`.
19011 */
19012 serviceName?: string;
19013 /**
19014 * With this flag, the utility process will be launched via the `Electron Helper
19015 * (Plugin).app` helper executable on macOS, which can be codesigned with
19016 * `com.apple.security.cs.disable-library-validation` and
19017 * `com.apple.security.cs.allow-unsigned-executable-memory` entitlements. This will
19018 * allow the utility process to load unsigned libraries. Unless you specifically
19019 * need this capability, it is best to leave this disabled. Default is `false`.
19020 *
19021 * @platform darwin
19022 */
19023 allowLoadingUnsignedLibraries?: boolean;
19024 }
19025
19026 interface FoundInPageEvent extends DOMEvent {
19027 result: FoundInPageResult;
19028 }
19029
19030 interface FrameCreatedDetails {
19031 frame: WebFrameMain;
19032 }
19033
19034 interface FromPartitionOptions {
19035 /**
19036 * Whether to enable cache.
19037 */
19038 cache: boolean;
19039 }
19040
19041 interface FromPathOptions {
19042 /**
19043 * Whether to enable cache.
19044 */
19045 cache: boolean;
19046 }
19047
19048 interface HandlerDetails {
19049 /**
19050 * The _resolved_ version of the URL passed to `window.open()`. e.g. opening a
19051 * window with `window.open('foo')` will yield something like
19052 * `https://the-origin/the/current/path/foo`.
19053 */
19054 url: string;
19055 /**
19056 * Name of the window provided in `window.open()`
19057 */
19058 frameName: string;
19059 /**
19060 * Comma separated list of window features provided to `window.open()`.
19061 */
19062 features: string;
19063 /**
19064 * Can be `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
19065 */
19066 disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
19067 /**
19068 * The referrer that will be passed to the new window. May or may not result in the
19069 * `Referer` header being sent, depending on the referrer policy.
19070 */
19071 referrer: Referrer;
19072 /**
19073 * The post data that will be sent to the new window, along with the appropriate
19074 * headers that will be set. If no post data is to be sent, the value will be
19075 * `null`. Only defined when the window is being created by a form that set
19076 * `target=_blank`.
19077 */
19078 postBody?: PostBody;
19079 }
19080
19081 interface HeadersReceivedResponse {
19082 cancel?: boolean;
19083 /**
19084 * When provided, the server is assumed to have responded with these headers.
19085 */
19086 responseHeaders?: Record<string, (string) | (string[])>;
19087 /**
19088 * Should be provided when overriding `responseHeaders` to change header status
19089 * otherwise original response header's status will be used.
19090 */
19091 statusLine?: string;
19092 }
19093
19094 interface HeapStatistics {
19095 totalHeapSize: number;
19096 totalHeapSizeExecutable: number;
19097 totalPhysicalSize: number;
19098 totalAvailableSize: number;
19099 usedHeapSize: number;
19100 heapSizeLimit: number;
19101 mallocedMemory: number;
19102 peakMallocedMemory: number;
19103 doesZapGarbage: boolean;
19104 }
19105
19106 interface HidDeviceAddedDetails {
19107 device: HIDDevice;
19108 frame: WebFrameMain;
19109 }
19110
19111 interface HidDeviceRemovedDetails {
19112 device: HIDDevice;
19113 frame: WebFrameMain;
19114 }
19115
19116 interface HidDeviceRevokedDetails {
19117 device: HIDDevice;
19118 /**
19119 * The origin that the device has been revoked from.
19120 */
19121 origin?: string;
19122 }
19123
19124 interface IgnoreMouseEventsOptions {
19125 /**
19126 * If true, forwards mouse move messages to Chromium, enabling mouse related events
19127 * such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false,
19128 * forwarding is always disabled regardless of this value.
19129 *
19130 * @platform darwin,win32
19131 */
19132 forward?: boolean;
19133 }
19134
19135 interface ImportCertificateOptions {
19136 /**
19137 * Path for the pkcs12 file.
19138 */
19139 certificate: string;
19140 /**
19141 * Passphrase for the certificate.
19142 */
19143 password: string;
19144 }
19145
19146 interface Info {
19147 /**
19148 * Security origin for the isolated world.
19149 */
19150 securityOrigin?: string;
19151 /**
19152 * Content Security Policy for the isolated world.
19153 */
19154 csp?: string;
19155 /**
19156 * Name for isolated world. Useful in devtools.
19157 */
19158 name?: string;
19159 }
19160
19161 interface Input {
19162 /**
19163 * Either `keyUp` or `keyDown`.
19164 */
19165 type: string;
19166 /**
19167 * Equivalent to KeyboardEvent.key.
19168 */
19169 key: string;
19170 /**
19171 * Equivalent to KeyboardEvent.code.
19172 */
19173 code: string;
19174 /**
19175 * Equivalent to KeyboardEvent.repeat.
19176 */
19177 isAutoRepeat: boolean;
19178 /**
19179 * Equivalent to KeyboardEvent.isComposing.
19180 */
19181 isComposing: boolean;
19182 /**
19183 * Equivalent to KeyboardEvent.shiftKey.
19184 */
19185 shift: boolean;
19186 /**
19187 * Equivalent to KeyboardEvent.controlKey.
19188 */
19189 control: boolean;
19190 /**
19191 * Equivalent to KeyboardEvent.altKey.
19192 */
19193 alt: boolean;
19194 /**
19195 * Equivalent to KeyboardEvent.metaKey.
19196 */
19197 meta: boolean;
19198 /**
19199 * Equivalent to KeyboardEvent.location.
19200 */
19201 location: number;
19202 /**
19203 * See InputEvent.modifiers.
19204 */
19205 modifiers: string[];
19206 }
19207
19208 interface InsertCSSOptions {
19209 /**
19210 * Can be 'user' or 'author'. Sets the cascade origin of the inserted stylesheet.
19211 * Default is 'author'.
19212 */
19213 cssOrigin?: ('user' | 'author');
19214 }
19215
19216 interface IpcMessageEvent extends DOMEvent {
19217 /**
19218 * pair of `[processId, frameId]`.
19219 */
19220 frameId: [number, number];
19221 channel: string;
19222 args: any[];
19223 }
19224
19225 interface Item {
19226 /**
19227 * The path to the file being dragged.
19228 */
19229 file: string;
19230 /**
19231 * The paths to the files being dragged. (`files` will override `file` field)
19232 */
19233 files?: string[];
19234 /**
19235 * The image must be non-empty on macOS.
19236 */
19237 icon: (NativeImage) | (string);
19238 }
19239
19240 interface JumpListSettings {
19241 /**
19242 * The minimum number of items that will be shown in the Jump List (for a more
19243 * detailed description of this value see the MSDN docs).
19244 */
19245 minItems: number;
19246 /**
19247 * Array of `JumpListItem` objects that correspond to items that the user has
19248 * explicitly removed from custom categories in the Jump List. These items must not
19249 * be re-added to the Jump List in the **next** call to `app.setJumpList()`,
19250 * Windows will not display any custom category that contains any of the removed
19251 * items.
19252 */
19253 removedItems: JumpListItem[];
19254 }
19255
19256 interface LoadCommitEvent extends DOMEvent {
19257 url: string;
19258 isMainFrame: boolean;
19259 }
19260
19261 interface LoadExtensionOptions {
19262 /**
19263 * Whether to allow the extension to read local files over `file://` protocol and
19264 * inject content scripts into `file://` pages. This is required e.g. for loading
19265 * devtools extensions on `file://` URLs. Defaults to false.
19266 */
19267 allowFileAccess: boolean;
19268 }
19269
19270 interface LoadFileOptions {
19271 /**
19272 * Passed to `url.format()`.
19273 */
19274 query?: Record<string, string>;
19275 /**
19276 * Passed to `url.format()`.
19277 */
19278 search?: string;
19279 /**
19280 * Passed to `url.format()`.
19281 */
19282 hash?: string;
19283 }
19284
19285 interface LoadURLOptions {
19286 /**
19287 * An HTTP Referrer url.
19288 */
19289 httpReferrer?: (string) | (Referrer);
19290 /**
19291 * A user agent originating the request.
19292 */
19293 userAgent?: string;
19294 /**
19295 * Extra headers separated by "\n"
19296 */
19297 extraHeaders?: string;
19298 postData?: Array<(UploadRawData) | (UploadFile)>;
19299 /**
19300 * Base url (with trailing path separator) for files to be loaded by the data url.
19301 * This is needed only if the specified `url` is a data url and needs to load other
19302 * files.
19303 */
19304 baseURLForDataURL?: string;
19305 }
19306
19307 interface LoginItemSettings {
19308 /**
19309 * `true` if the app is set to open at login.
19310 */
19311 openAtLogin: boolean;
19312 /**
19313 * `true` if the app is set to open as hidden at login. This does not work on macOS
19314 * 13 and up.
19315 *
19316 * @deprecated
19317 * @platform darwin
19318 */
19319 openAsHidden: boolean;
19320 /**
19321 * `true` if the app was opened at login automatically. This setting is not
19322 * available on MAS builds or on macOS 13 and up.
19323 *
19324 * @deprecated
19325 * @platform darwin
19326 */
19327 wasOpenedAtLogin: boolean;
19328 /**
19329 * `true` if the app was opened as a hidden login item. This indicates that the app
19330 * should not open any windows at startup. This setting is not available on MAS
19331 * builds or on macOS 13 and up.
19332 *
19333 * @deprecated
19334 * @platform darwin
19335 */
19336 wasOpenedAsHidden: boolean;
19337 /**
19338 * `true` if the app was opened as a login item that should restore the state from
19339 * the previous session. This indicates that the app should restore the windows
19340 * that were open the last time the app was closed. This setting is not available
19341 * on MAS builds or on macOS 13 and up.
19342 *
19343 * @deprecated
19344 * @platform darwin
19345 */
19346 restoreState: boolean;
19347 /**
19348 * can be one of `not-registered`, `enabled`, `requires-approval`, or `not-found`.
19349 *
19350 * @platform darwin
19351 */
19352 status: string;
19353 /**
19354 * `true` if app is set to open at login and its run key is not deactivated. This
19355 * differs from `openAtLogin` as it ignores the `args` option, this property will
19356 * be true if the given executable would be launched at login with **any**
19357 * arguments.
19358 *
19359 * @platform win32
19360 */
19361 executableWillLaunchAtLogin: boolean;
19362 launchItems: LaunchItems[];
19363 }
19364
19365 interface LoginItemSettingsOptions {
19366 /**
19367 * Can be one of `mainAppService`, `agentService`, `daemonService`, or
19368 * `loginItemService`. Defaults to `mainAppService`. Only available on macOS 13 and
19369 * up. See app.setLoginItemSettings for more information about each type.
19370 *
19371 * @platform darwin
19372 */
19373 type?: string;
19374 /**
19375 * The name of the service. Required if `type` is non-default. Only available on
19376 * macOS 13 and up.
19377 *
19378 * @platform darwin
19379 */
19380 serviceName?: string;
19381 /**
19382 * The executable path to compare against. Defaults to `process.execPath`.
19383 *
19384 * @platform win32
19385 */
19386 path?: string;
19387 /**
19388 * The command-line arguments to compare against. Defaults to an empty array.
19389 *
19390 * @platform win32
19391 */
19392 args?: string[];
19393 }
19394
19395 interface MenuItemConstructorOptions {
19396 /**
19397 * Will be called with `click(menuItem, browserWindow, event)` when the menu item
19398 * is clicked.
19399 */
19400 click?: (menuItem: MenuItem, browserWindow: (BrowserWindow) | (undefined), event: KeyboardEvent) => void;
19401 /**
19402 * Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`,
19403 * `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`,
19404 * `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`,
19405 * `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`,
19406 * `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`,
19407 * `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`,
19408 * `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`,
19409 * `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`,
19410 * `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
19411 * - Define the action of the menu item, when specified the `click` property will
19412 * be ignored. See roles.
19413 */
19414 role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleSpellChecker' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'showSubstitutions' | 'toggleSmartQuotes' | 'toggleSmartDashes' | 'toggleTextReplacement' | 'startSpeaking' | 'stopSpeaking' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'shareMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'showAllTabs' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
19415 /**
19416 * Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
19417 */
19418 type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
19419 label?: string;
19420 sublabel?: string;
19421 /**
19422 * Hover text for this menu item.
19423 *
19424 * @platform darwin
19425 */
19426 toolTip?: string;
19427 accelerator?: Accelerator;
19428 icon?: (NativeImage) | (string);
19429 /**
19430 * If false, the menu item will be greyed out and unclickable.
19431 */
19432 enabled?: boolean;
19433 /**
19434 * default is `true`, and when `false` will prevent the accelerator from triggering
19435 * the item if the item is not visible.
19436 *
19437 * @platform darwin
19438 */
19439 acceleratorWorksWhenHidden?: boolean;
19440 /**
19441 * If false, the menu item will be entirely hidden.
19442 */
19443 visible?: boolean;
19444 /**
19445 * Should only be specified for `checkbox` or `radio` type menu items.
19446 */
19447 checked?: boolean;
19448 /**
19449 * If false, the accelerator won't be registered with the system, but it will still
19450 * be displayed. Defaults to true.
19451 *
19452 * @platform linux,win32
19453 */
19454 registerAccelerator?: boolean;
19455 /**
19456 * The item to share when the `role` is `shareMenu`.
19457 *
19458 * @platform darwin
19459 */
19460 sharingItem?: SharingItem;
19461 /**
19462 * Should be specified for `submenu` type menu items. If `submenu` is specified,
19463 * the `type: 'submenu'` can be omitted. If the value is not a `Menu` then it will
19464 * be automatically converted to one using `Menu.buildFromTemplate`.
19465 */
19466 submenu?: (MenuItemConstructorOptions[]) | (Menu);
19467 /**
19468 * Unique within a single menu. If defined then it can be used as a reference to
19469 * this item by the position attribute.
19470 */
19471 id?: string;
19472 /**
19473 * Inserts this item before the item with the specified id. If the referenced item
19474 * doesn't exist the item will be inserted at the end of the menu. Also implies
19475 * that the menu item in question should be placed in the same “group” as the item.
19476 */
19477 before?: string[];
19478 /**
19479 * Inserts this item after the item with the specified id. If the referenced item
19480 * doesn't exist the item will be inserted at the end of the menu.
19481 */
19482 after?: string[];
19483 /**
19484 * Provides a means for a single context menu to declare the placement of their
19485 * containing group before the containing group of the item with the specified id.
19486 */
19487 beforeGroupContaining?: string[];
19488 /**
19489 * Provides a means for a single context menu to declare the placement of their
19490 * containing group after the containing group of the item with the specified id.
19491 */
19492 afterGroupContaining?: string[];
19493 }
19494
19495 interface MessageBoxOptions {
19496 /**
19497 * Content of the message box.
19498 */
19499 message: string;
19500 /**
19501 * Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
19502 * displays the same icon as `info`, unless you set an icon using the `icon`
19503 * option. On macOS, both `warning` and `error` display the same warning icon.
19504 */
19505 type?: ('none' | 'info' | 'error' | 'question' | 'warning');
19506 /**
19507 * Array of texts for buttons. On Windows, an empty array will result in one button
19508 * labeled "OK".
19509 */
19510 buttons?: string[];
19511 /**
19512 * Index of the button in the buttons array which will be selected by default when
19513 * the message box opens.
19514 */
19515 defaultId?: number;
19516 /**
19517 * Pass an instance of AbortSignal to optionally close the message box, the message
19518 * box will behave as if it was cancelled by the user. On macOS, `signal` does not
19519 * work with message boxes that do not have a parent window, since those message
19520 * boxes run synchronously due to platform limitations.
19521 */
19522 signal?: AbortSignal;
19523 /**
19524 * Title of the message box, some platforms will not show it.
19525 */
19526 title?: string;
19527 /**
19528 * Extra information of the message.
19529 */
19530 detail?: string;
19531 /**
19532 * If provided, the message box will include a checkbox with the given label.
19533 */
19534 checkboxLabel?: string;
19535 /**
19536 * Initial checked state of the checkbox. `false` by default.
19537 */
19538 checkboxChecked?: boolean;
19539 icon?: (NativeImage) | (string);
19540 /**
19541 * Custom width of the text in the message box.
19542 *
19543 * @platform darwin
19544 */
19545 textWidth?: number;
19546 /**
19547 * The index of the button to be used to cancel the dialog, via the `Esc` key. By
19548 * default this is assigned to the first button with "cancel" or "no" as the label.
19549 * If no such labeled buttons exist and this option is not set, `0` will be used as
19550 * the return value.
19551 */
19552 cancelId?: number;
19553 /**
19554 * On Windows Electron will try to figure out which one of the `buttons` are common
19555 * buttons (like "Cancel" or "Yes"), and show the others as command links in the
19556 * dialog. This can make the dialog appear in the style of modern Windows apps. If
19557 * you don't like this behavior, you can set `noLink` to `true`.
19558 */
19559 noLink?: boolean;
19560 /**
19561 * Normalize the keyboard access keys across platforms. Default is `false`.
19562 * Enabling this assumes `&` is used in the button labels for the placement of the
19563 * keyboard shortcut access key and labels will be converted so they work correctly
19564 * on each platform, `&` characters are removed on macOS, converted to `_` on
19565 * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
19566 * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
19567 * via `Alt-W` on Windows and Linux.
19568 */
19569 normalizeAccessKeys?: boolean;
19570 }
19571
19572 interface MessageBoxReturnValue {
19573 /**
19574 * The index of the clicked button.
19575 */
19576 response: number;
19577 /**
19578 * The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.
19579 */
19580 checkboxChecked: boolean;
19581 }
19582
19583 interface MessageBoxSyncOptions {
19584 /**
19585 * Content of the message box.
19586 */
19587 message: string;
19588 /**
19589 * Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
19590 * displays the same icon as `info`, unless you set an icon using the `icon`
19591 * option. On macOS, both `warning` and `error` display the same warning icon.
19592 */
19593 type?: ('none' | 'info' | 'error' | 'question' | 'warning');
19594 /**
19595 * Array of texts for buttons. On Windows, an empty array will result in one button
19596 * labeled "OK".
19597 */
19598 buttons?: string[];
19599 /**
19600 * Index of the button in the buttons array which will be selected by default when
19601 * the message box opens.
19602 */
19603 defaultId?: number;
19604 /**
19605 * Title of the message box, some platforms will not show it.
19606 */
19607 title?: string;
19608 /**
19609 * Extra information of the message.
19610 */
19611 detail?: string;
19612 icon?: (NativeImage) | (string);
19613 /**
19614 * Custom width of the text in the message box.
19615 *
19616 * @platform darwin
19617 */
19618 textWidth?: number;
19619 /**
19620 * The index of the button to be used to cancel the dialog, via the `Esc` key. By
19621 * default this is assigned to the first button with "cancel" or "no" as the label.
19622 * If no such labeled buttons exist and this option is not set, `0` will be used as
19623 * the return value.
19624 */
19625 cancelId?: number;
19626 /**
19627 * On Windows Electron will try to figure out which one of the `buttons` are common
19628 * buttons (like "Cancel" or "Yes"), and show the others as command links in the
19629 * dialog. This can make the dialog appear in the style of modern Windows apps. If
19630 * you don't like this behavior, you can set `noLink` to `true`.
19631 */
19632 noLink?: boolean;
19633 /**
19634 * Normalize the keyboard access keys across platforms. Default is `false`.
19635 * Enabling this assumes `&` is used in the button labels for the placement of the
19636 * keyboard shortcut access key and labels will be converted so they work correctly
19637 * on each platform, `&` characters are removed on macOS, converted to `_` on
19638 * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
19639 * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
19640 * via `Alt-W` on Windows and Linux.
19641 */
19642 normalizeAccessKeys?: boolean;
19643 }
19644
19645 interface MessageDetails {
19646 /**
19647 * The actual console message
19648 */
19649 message: string;
19650 /**
19651 * The version ID of the service worker that sent the log message
19652 */
19653 versionId: number;
19654 /**
19655 * The type of source for this message. Can be `javascript`, `xml`, `network`,
19656 * `console-api`, `storage`, `rendering`, `security`, `deprecation`, `worker`,
19657 * `violation`, `intervention`, `recommendation` or `other`.
19658 */
19659 source: ('javascript' | 'xml' | 'network' | 'console-api' | 'storage' | 'rendering' | 'security' | 'deprecation' | 'worker' | 'violation' | 'intervention' | 'recommendation' | 'other');
19660 /**
19661 * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
19662 * `error`.
19663 */
19664 level: number;
19665 /**
19666 * The URL the message came from
19667 */
19668 sourceUrl: string;
19669 /**
19670 * The line number of the source that triggered this console message
19671 */
19672 lineNumber: number;
19673 }
19674
19675 interface MessageEvent {
19676 data: any;
19677 ports: MessagePortMain[];
19678 }
19679
19680 interface MoveToApplicationsFolderOptions {
19681 /**
19682 * A handler for potential conflict in move failure.
19683 */
19684 conflictHandler?: (conflictType: 'exists' | 'existsAndRunning') => boolean;
19685 }
19686
19687 interface NotificationConstructorOptions {
19688 /**
19689 * A title for the notification, which will be displayed at the top of the
19690 * notification window when it is shown.
19691 */
19692 title?: string;
19693 /**
19694 * A subtitle for the notification, which will be displayed below the title.
19695 *
19696 * @platform darwin
19697 */
19698 subtitle?: string;
19699 /**
19700 * The body text of the notification, which will be displayed below the title or
19701 * subtitle.
19702 */
19703 body?: string;
19704 /**
19705 * Whether or not to suppress the OS notification noise when showing the
19706 * notification.
19707 */
19708 silent?: boolean;
19709 /**
19710 * An icon to use in the notification.
19711 */
19712 icon?: (string) | (NativeImage);
19713 /**
19714 * Whether or not to add an inline reply option to the notification.
19715 *
19716 * @platform darwin
19717 */
19718 hasReply?: boolean;
19719 /**
19720 * The timeout duration of the notification. Can be 'default' or 'never'.
19721 *
19722 * @platform linux,win32
19723 */
19724 timeoutType?: ('default' | 'never');
19725 /**
19726 * The placeholder to write in the inline reply input field.
19727 *
19728 * @platform darwin
19729 */
19730 replyPlaceholder?: string;
19731 /**
19732 * The name of the sound file to play when the notification is shown.
19733 *
19734 * @platform darwin
19735 */
19736 sound?: string;
19737 /**
19738 * The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
19739 *
19740 * @platform linux
19741 */
19742 urgency?: ('normal' | 'critical' | 'low');
19743 /**
19744 * Actions to add to the notification. Please read the available actions and
19745 * limitations in the `NotificationAction` documentation.
19746 *
19747 * @platform darwin
19748 */
19749 actions?: NotificationAction[];
19750 /**
19751 * A custom title for the close button of an alert. An empty string will cause the
19752 * default localized text to be used.
19753 *
19754 * @platform darwin
19755 */
19756 closeButtonText?: string;
19757 /**
19758 * A custom description of the Notification on Windows superseding all properties
19759 * above. Provides full customization of design and behavior of the notification.
19760 *
19761 * @platform win32
19762 */
19763 toastXml?: string;
19764 }
19765
19766 interface OnBeforeRedirectListenerDetails {
19767 id: number;
19768 url: string;
19769 method: string;
19770 webContentsId?: number;
19771 webContents?: WebContents;
19772 frame?: WebFrameMain;
19773 /**
19774 * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
19775 * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
19776 */
19777 resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
19778 referrer: string;
19779 timestamp: number;
19780 redirectURL: string;
19781 statusCode: number;
19782 statusLine: string;
19783 /**
19784 * The server IP address that the request was actually sent to.
19785 */
19786 ip?: string;
19787 fromCache: boolean;
19788 responseHeaders?: Record<string, string[]>;
19789 }
19790
19791 interface OnBeforeRequestListenerDetails {
19792 id: number;
19793 url: string;
19794 method: string;
19795 webContentsId?: number;
19796 webContents?: WebContents;
19797 frame?: WebFrameMain;
19798 /**
19799 * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
19800 * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
19801 */
19802 resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
19803 referrer: string;
19804 timestamp: number;
19805 uploadData: UploadData[];
19806 }
19807
19808 interface OnBeforeSendHeadersListenerDetails {
19809 id: number;
19810 url: string;
19811 method: string;
19812 webContentsId?: number;
19813 webContents?: WebContents;
19814 frame?: WebFrameMain;
19815 /**
19816 * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
19817 * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
19818 */
19819 resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
19820 referrer: string;
19821 timestamp: number;
19822 uploadData?: UploadData[];
19823 requestHeaders: Record<string, string>;
19824 }
19825
19826 interface OnCompletedListenerDetails {
19827 id: number;
19828 url: string;
19829 method: string;
19830 webContentsId?: number;
19831 webContents?: WebContents;
19832 frame?: WebFrameMain;
19833 /**
19834 * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
19835 * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
19836 */
19837 resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
19838 referrer: string;
19839 timestamp: number;
19840 responseHeaders?: Record<string, string[]>;
19841 fromCache: boolean;
19842 statusCode: number;
19843 statusLine: string;
19844 error: string;
19845 }
19846
19847 interface OnErrorOccurredListenerDetails {
19848 id: number;
19849 url: string;
19850 method: string;
19851 webContentsId?: number;
19852 webContents?: WebContents;
19853 frame?: WebFrameMain;
19854 /**
19855 * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
19856 * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
19857 */
19858 resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
19859 referrer: string;
19860 timestamp: number;
19861 fromCache: boolean;
19862 /**
19863 * The error description.
19864 */
19865 error: string;
19866 }
19867
19868 interface OnHeadersReceivedListenerDetails {
19869 id: number;
19870 url: string;
19871 method: string;
19872 webContentsId?: number;
19873 webContents?: WebContents;
19874 frame?: WebFrameMain;
19875 /**
19876 * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
19877 * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
19878 */
19879 resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
19880 referrer: string;
19881 timestamp: number;
19882 statusLine: string;
19883 statusCode: number;
19884 responseHeaders?: Record<string, string[]>;
19885 }
19886
19887 interface OnResponseStartedListenerDetails {
19888 id: number;
19889 url: string;
19890 method: string;
19891 webContentsId?: number;
19892 webContents?: WebContents;
19893 frame?: WebFrameMain;
19894 /**
19895 * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
19896 * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
19897 */
19898 resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
19899 referrer: string;
19900 timestamp: number;
19901 responseHeaders?: Record<string, string[]>;
19902 /**
19903 * Indicates whether the response was fetched from disk cache.
19904 */
19905 fromCache: boolean;
19906 statusCode: number;
19907 statusLine: string;
19908 }
19909
19910 interface OnSendHeadersListenerDetails {
19911 id: number;
19912 url: string;
19913 method: string;
19914 webContentsId?: number;
19915 webContents?: WebContents;
19916 frame?: WebFrameMain;
19917 /**
19918 * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
19919 * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
19920 */
19921 resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
19922 referrer: string;
19923 timestamp: number;
19924 requestHeaders: Record<string, string>;
19925 }
19926
19927 interface OpenDevToolsOptions {
19928 /**
19929 * Opens the devtools with specified dock state, can be `left`, `right`, `bottom`,
19930 * `undocked`, `detach`. Defaults to last used dock state. In `undocked` mode it's
19931 * possible to dock back. In `detach` mode it's not.
19932 */
19933 mode: ('left' | 'right' | 'bottom' | 'undocked' | 'detach');
19934 /**
19935 * Whether to bring the opened devtools window to the foreground. The default is
19936 * `true`.
19937 */
19938 activate?: boolean;
19939 /**
19940 * A title for the DevTools window (only in `undocked` or `detach` mode).
19941 */
19942 title?: string;
19943 }
19944
19945 interface OpenDialogOptions {
19946 title?: string;
19947 defaultPath?: string;
19948 /**
19949 * Custom label for the confirmation button, when left empty the default label will
19950 * be used.
19951 */
19952 buttonLabel?: string;
19953 filters?: FileFilter[];
19954 /**
19955 * Contains which features the dialog should use. The following values are
19956 * supported:
19957 */
19958 properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
19959 /**
19960 * Message to display above input boxes.
19961 *
19962 * @platform darwin
19963 */
19964 message?: string;
19965 /**
19966 * Create security scoped bookmarks when packaged for the Mac App Store.
19967 *
19968 * @platform darwin,mas
19969 */
19970 securityScopedBookmarks?: boolean;
19971 }
19972
19973 interface OpenDialogReturnValue {
19974 /**
19975 * whether or not the dialog was canceled.
19976 */
19977 canceled: boolean;
19978 /**
19979 * An array of file paths chosen by the user. If the dialog is cancelled this will
19980 * be an empty array.
19981 */
19982 filePaths: string[];
19983 /**
19984 * An array matching the `filePaths` array of base64 encoded strings which contains
19985 * security scoped bookmark data. `securityScopedBookmarks` must be enabled for
19986 * this to be populated. (For return values, see table here.)
19987 *
19988 * @platform darwin,mas
19989 */
19990 bookmarks?: string[];
19991 }
19992
19993 interface OpenDialogSyncOptions {
19994 title?: string;
19995 defaultPath?: string;
19996 /**
19997 * Custom label for the confirmation button, when left empty the default label will
19998 * be used.
19999 */
20000 buttonLabel?: string;
20001 filters?: FileFilter[];
20002 /**
20003 * Contains which features the dialog should use. The following values are
20004 * supported:
20005 */
20006 properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
20007 /**
20008 * Message to display above input boxes.
20009 *
20010 * @platform darwin
20011 */
20012 message?: string;
20013 /**
20014 * Create security scoped bookmarks when packaged for the Mac App Store.
20015 *
20016 * @platform darwin,mas
20017 */
20018 securityScopedBookmarks?: boolean;
20019 }
20020
20021 interface OpenExternalOptions {
20022 /**
20023 * `true` to bring the opened application to the foreground. The default is `true`.
20024 *
20025 * @platform darwin
20026 */
20027 activate?: boolean;
20028 /**
20029 * The working directory.
20030 *
20031 * @platform win32
20032 */
20033 workingDirectory?: string;
20034 /**
20035 * Indicates a user initiated launch that enables tracking of frequently used
20036 * programs and other behaviors. The default is `false`.
20037 *
20038 * @platform win32
20039 */
20040 logUsage?: boolean;
20041 }
20042
20043 interface Options {
20044 }
20045
20046 interface Opts {
20047 /**
20048 * Keep the page hidden instead of visible. Default is `false`.
20049 */
20050 stayHidden?: boolean;
20051 /**
20052 * Keep the system awake instead of allowing it to sleep. Default is `false`.
20053 */
20054 stayAwake?: boolean;
20055 }
20056
20057 interface PageFaviconUpdatedEvent extends DOMEvent {
20058 /**
20059 * Array of URLs.
20060 */
20061 favicons: string[];
20062 }
20063
20064 interface PageTitleUpdatedEvent extends DOMEvent {
20065 title: string;
20066 explicitSet: boolean;
20067 }
20068
20069 interface Parameters {
20070 /**
20071 * Specify the screen type to emulate (default: `desktop`):
20072 */
20073 screenPosition: ('desktop' | 'mobile');
20074 /**
20075 * Set the emulated screen size (screenPosition == mobile).
20076 */
20077 screenSize: Size;
20078 /**
20079 * Position the view on the screen (screenPosition == mobile) (default: `{ x: 0, y:
20080 * 0 }`).
20081 */
20082 viewPosition: Point;
20083 /**
20084 * Set the device scale factor (if zero defaults to original device scale factor)
20085 * (default: `0`).
20086 */
20087 deviceScaleFactor: number;
20088 /**
20089 * Set the emulated view size (empty means no override)
20090 */
20091 viewSize: Size;
20092 /**
20093 * Scale of emulated view inside available space (not in fit to view mode)
20094 * (default: `1`).
20095 */
20096 scale: number;
20097 }
20098
20099 interface Payment {
20100 /**
20101 * The identifier of the purchased product.
20102 */
20103 productIdentifier: string;
20104 /**
20105 * The quantity purchased.
20106 */
20107 quantity: number;
20108 /**
20109 * An opaque identifier for the user’s account on your system.
20110 */
20111 applicationUsername: string;
20112 /**
20113 * The details of the discount offer to apply to the payment.
20114 */
20115 paymentDiscount?: PaymentDiscount;
20116 }
20117
20118 interface PermissionCheckHandlerHandlerDetails {
20119 /**
20120 * The origin of the frame embedding the frame that made the permission check.
20121 * Only set for cross-origin sub frames making permission checks.
20122 */
20123 embeddingOrigin?: string;
20124 /**
20125 * The security origin of the `media` check.
20126 */
20127 securityOrigin?: string;
20128 /**
20129 * The type of media access being requested, can be `video`, `audio` or `unknown`
20130 */
20131 mediaType?: ('video' | 'audio' | 'unknown');
20132 /**
20133 * The last URL the requesting frame loaded. This is not provided for cross-origin
20134 * sub frames making permission checks.
20135 */
20136 requestingUrl?: string;
20137 /**
20138 * Whether the frame making the request is the main frame
20139 */
20140 isMainFrame: boolean;
20141 }
20142
20143 interface PluginCrashedEvent extends DOMEvent {
20144 name: string;
20145 version: string;
20146 }
20147
20148 interface PopupOptions {
20149 /**
20150 * Default is the focused window.
20151 */
20152 window?: BrowserWindow;
20153 /**
20154 * Default is the current mouse cursor position. Must be declared if `y` is
20155 * declared.
20156 */
20157 x?: number;
20158 /**
20159 * Default is the current mouse cursor position. Must be declared if `x` is
20160 * declared.
20161 */
20162 y?: number;
20163 /**
20164 * The index of the menu item to be positioned under the mouse cursor at the
20165 * specified coordinates. Default is -1.
20166 *
20167 * @platform darwin
20168 */
20169 positioningItem?: number;
20170 /**
20171 * This should map to the `menuSourceType` provided by the `context-menu` event. It
20172 * is not recommended to set this value manually, only provide values you receive
20173 * from other APIs or leave it `undefined`. Can be `none`, `mouse`, `keyboard`,
20174 * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
20175 * `adjustSelection`, or `adjustSelectionReset`.
20176 *
20177 * @platform win32,linux
20178 */
20179 sourceType?: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
20180 /**
20181 * Called when menu is closed.
20182 */
20183 callback?: () => void;
20184 }
20185
20186 interface PreconnectOptions {
20187 /**
20188 * URL for preconnect. Only the origin is relevant for opening the socket.
20189 */
20190 url: string;
20191 /**
20192 * number of sockets to preconnect. Must be between 1 and 6. Defaults to 1.
20193 */
20194 numSockets?: number;
20195 }
20196
20197 interface PrintToPDFOptions {
20198 /**
20199 * Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
20200 */
20201 landscape?: boolean;
20202 /**
20203 * Whether to display header and footer. Defaults to false.
20204 */
20205 displayHeaderFooter?: boolean;
20206 /**
20207 * Whether to print background graphics. Defaults to false.
20208 */
20209 printBackground?: boolean;
20210 /**
20211 * Scale of the webpage rendering. Defaults to 1.
20212 */
20213 scale?: number;
20214 /**
20215 * Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
20216 * `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
20217 * `height` and `width` in inches. Defaults to `Letter`.
20218 */
20219 pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid' | 'Ledger')) | (Size);
20220 margins?: Margins;
20221 /**
20222 * Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which
20223 * means print all pages.
20224 */
20225 pageRanges?: string;
20226 /**
20227 * HTML template for the print header. Should be valid HTML markup with following
20228 * classes used to inject printing values into them: `date` (formatted print date),
20229 * `title` (document title), `url` (document location), `pageNumber` (current page
20230 * number) and `totalPages` (total pages in the document). For example, `<span
20231 * class=title></span>` would generate span containing the title.
20232 */
20233 headerTemplate?: string;
20234 /**
20235 * HTML template for the print footer. Should use the same format as the
20236 * `headerTemplate`.
20237 */
20238 footerTemplate?: string;
20239 /**
20240 * Whether or not to prefer page size as defined by css. Defaults to false, in
20241 * which case the content will be scaled to fit the paper size.
20242 */
20243 preferCSSPageSize?: boolean;
20244 /**
20245 * Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this
20246 * property is experimental, the generated PDF may not adhere fully to PDF/UA and
20247 * WCAG standards.
20248 *
20249 * @experimental
20250 */
20251 generateTaggedPDF?: boolean;
20252 /**
20253 * Whether or not to generate a PDF document outline from content headers. Defaults
20254 * to false.
20255 *
20256 * @experimental
20257 */
20258 generateDocumentOutline?: boolean;
20259 }
20260
20261 interface Privileges {
20262 /**
20263 * Default false.
20264 */
20265 standard?: boolean;
20266 /**
20267 * Default false.
20268 */
20269 secure?: boolean;
20270 /**
20271 * Default false.
20272 */
20273 bypassCSP?: boolean;
20274 /**
20275 * Default false.
20276 */
20277 allowServiceWorkers?: boolean;
20278 /**
20279 * Default false.
20280 */
20281 supportFetchAPI?: boolean;
20282 /**
20283 * Default false.
20284 */
20285 corsEnabled?: boolean;
20286 /**
20287 * Default false.
20288 */
20289 stream?: boolean;
20290 /**
20291 * Enable V8 code cache for the scheme, only works when `standard` is also set to
20292 * true. Default false.
20293 */
20294 codeCache?: boolean;
20295 }
20296
20297 interface ProgressBarOptions {
20298 /**
20299 * Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or
20300 * `paused`.
20301 *
20302 * @platform win32
20303 */
20304 mode: ('none' | 'normal' | 'indeterminate' | 'error' | 'paused');
20305 }
20306
20307 interface Provider {
20308 spellCheck: (words: string[], callback: (misspeltWords: string[]) => void) => void;
20309 }
20310
20311 interface PurchaseProductOpts {
20312 /**
20313 * The number of items the user wants to purchase.
20314 */
20315 quantity?: number;
20316 /**
20317 * The string that associates the transaction with a user account on your service
20318 * (applicationUsername).
20319 */
20320 username?: string;
20321 }
20322
20323 interface ReadBookmark {
20324 title: string;
20325 url: string;
20326 }
20327
20328 interface RegistrationCompletedDetails {
20329 /**
20330 * The base URL that a service worker is registered for
20331 */
20332 scope: string;
20333 }
20334
20335 interface RelaunchOptions {
20336 args?: string[];
20337 execPath?: string;
20338 }
20339
20340 interface RenderProcessGoneEvent extends DOMEvent {
20341 details: RenderProcessGoneDetails;
20342 }
20343
20344 interface Request {
20345 hostname: string;
20346 certificate: Certificate;
20347 validatedCertificate: Certificate;
20348 /**
20349 * `true` if Chromium recognises the root CA as a standard root. If it isn't then
20350 * it's probably the case that this certificate was generated by a MITM proxy whose
20351 * root has been installed locally (for example, by a corporate proxy). This should
20352 * not be trusted if the `verificationResult` is not `OK`.
20353 */
20354 isIssuedByKnownRoot: boolean;
20355 /**
20356 * `OK` if the certificate is trusted, otherwise an error like `CERT_REVOKED`.
20357 */
20358 verificationResult: string;
20359 /**
20360 * Error code.
20361 */
20362 errorCode: number;
20363 }
20364
20365 interface ResizeOptions {
20366 /**
20367 * Defaults to the image's width.
20368 */
20369 width?: number;
20370 /**
20371 * Defaults to the image's height.
20372 */
20373 height?: number;
20374 /**
20375 * The desired quality of the resize image. Possible values include `good`,
20376 * `better`, or `best`. The default is `best`. These values express a desired
20377 * quality/speed tradeoff. They are translated into an algorithm-specific method
20378 * that depends on the capabilities (CPU, GPU) of the underlying platform. It is
20379 * possible for all three methods to be mapped to the same algorithm on a given
20380 * platform.
20381 */
20382 quality?: ('good' | 'better' | 'best');
20383 }
20384
20385 interface ResolveHostOptions {
20386 /**
20387 * Requested DNS query type. If unspecified, resolver will pick A or AAAA (or both)
20388 * based on IPv4/IPv6 settings:
20389 */
20390 queryType?: ('A' | 'AAAA');
20391 /**
20392 * The source to use for resolved addresses. Default allows the resolver to pick an
20393 * appropriate source. Only affects use of big external sources (e.g. calling the
20394 * system for resolution or using DNS). Even if a source is specified, results can
20395 * still come from cache, resolving "localhost" or IP literals, etc. One of the
20396 * following values:
20397 */
20398 source?: ('any' | 'system' | 'dns' | 'mdns' | 'localOnly');
20399 /**
20400 * Indicates what DNS cache entries, if any, can be used to provide a response. One
20401 * of the following values:
20402 */
20403 cacheUsage?: ('allowed' | 'staleAllowed' | 'disallowed');
20404 /**
20405 * Controls the resolver's Secure DNS behavior for this request. One of the
20406 * following values:
20407 */
20408 secureDnsPolicy?: ('allow' | 'disable');
20409 }
20410
20411 interface ResourceUsage {
20412 images: MemoryUsageDetails;
20413 scripts: MemoryUsageDetails;
20414 cssStyleSheets: MemoryUsageDetails;
20415 xslStyleSheets: MemoryUsageDetails;
20416 fonts: MemoryUsageDetails;
20417 other: MemoryUsageDetails;
20418 }
20419
20420 interface Response {
20421 /**
20422 * `false` should be passed in if the dialog is canceled. If the `pairingKind` is
20423 * `confirm` or `confirmPin`, this value should indicate if the pairing is
20424 * confirmed. If the `pairingKind` is `providePin` the value should be `true` when
20425 * a value is provided.
20426 */
20427 confirmed: boolean;
20428 /**
20429 * When the `pairingKind` is `providePin` this value should be the required pin for
20430 * the Bluetooth device.
20431 */
20432 pin?: (string) | (null);
20433 }
20434
20435 interface Result {
20436 requestId: number;
20437 /**
20438 * Position of the active match.
20439 */
20440 activeMatchOrdinal: number;
20441 /**
20442 * Number of Matches.
20443 */
20444 matches: number;
20445 /**
20446 * Coordinates of first match region.
20447 */
20448 selectionArea: Rectangle;
20449 finalUpdate: boolean;
20450 }
20451
20452 interface SaveDialogOptions {
20453 /**
20454 * The dialog title. Cannot be displayed on some _Linux_ desktop environments.
20455 */
20456 title?: string;
20457 /**
20458 * Absolute directory path, absolute file path, or file name to use by default.
20459 */
20460 defaultPath?: string;
20461 /**
20462 * Custom label for the confirmation button, when left empty the default label will
20463 * be used.
20464 */
20465 buttonLabel?: string;
20466 filters?: FileFilter[];
20467 /**
20468 * Message to display above text fields.
20469 *
20470 * @platform darwin
20471 */
20472 message?: string;
20473 /**
20474 * Custom label for the text displayed in front of the filename text field.
20475 *
20476 * @platform darwin
20477 */
20478 nameFieldLabel?: string;
20479 /**
20480 * Show the tags input box, defaults to `true`.
20481 *
20482 * @platform darwin
20483 */
20484 showsTagField?: boolean;
20485 properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
20486 /**
20487 * Create a security scoped bookmark when packaged for the Mac App Store. If this
20488 * option is enabled and the file doesn't already exist a blank file will be
20489 * created at the chosen path.
20490 *
20491 * @platform darwin,mas
20492 */
20493 securityScopedBookmarks?: boolean;
20494 }
20495
20496 interface SaveDialogReturnValue {
20497 /**
20498 * whether or not the dialog was canceled.
20499 */
20500 canceled: boolean;
20501 /**
20502 * If the dialog is canceled, this will be `undefined`.
20503 */
20504 filePath?: string;
20505 /**
20506 * Base64 encoded string which contains the security scoped bookmark data for the
20507 * saved file. `securityScopedBookmarks` must be enabled for this to be present.
20508 * (For return values, see table here.)
20509 *
20510 * @platform darwin,mas
20511 */
20512 bookmark?: string;
20513 }
20514
20515 interface SaveDialogSyncOptions {
20516 /**
20517 * The dialog title. Cannot be displayed on some _Linux_ desktop environments.
20518 */
20519 title?: string;
20520 /**
20521 * Absolute directory path, absolute file path, or file name to use by default.
20522 */
20523 defaultPath?: string;
20524 /**
20525 * Custom label for the confirmation button, when left empty the default label will
20526 * be used.
20527 */
20528 buttonLabel?: string;
20529 filters?: FileFilter[];
20530 /**
20531 * Message to display above text fields.
20532 *
20533 * @platform darwin
20534 */
20535 message?: string;
20536 /**
20537 * Custom label for the text displayed in front of the filename text field.
20538 *
20539 * @platform darwin
20540 */
20541 nameFieldLabel?: string;
20542 /**
20543 * Show the tags input box, defaults to `true`.
20544 *
20545 * @platform darwin
20546 */
20547 showsTagField?: boolean;
20548 properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
20549 /**
20550 * Create a security scoped bookmark when packaged for the Mac App Store. If this
20551 * option is enabled and the file doesn't already exist a blank file will be
20552 * created at the chosen path.
20553 *
20554 * @platform darwin,mas
20555 */
20556 securityScopedBookmarks?: boolean;
20557 }
20558
20559 interface SelectHidDeviceDetails {
20560 deviceList: HIDDevice[];
20561 frame: WebFrameMain;
20562 }
20563
20564 interface SelectUsbDeviceDetails {
20565 deviceList: USBDevice[];
20566 frame: WebFrameMain;
20567 }
20568
20569 interface SerialPortRevokedDetails {
20570 port: SerialPort;
20571 frame: WebFrameMain;
20572 /**
20573 * The origin that the device has been revoked from.
20574 */
20575 origin: string;
20576 }
20577
20578 interface Settings {
20579 /**
20580 * `true` to open the app at login, `false` to remove the app as a login item.
20581 * Defaults to `false`.
20582 */
20583 openAtLogin?: boolean;
20584 /**
20585 * `true` to open the app as hidden. Defaults to `false`. The user can edit this
20586 * setting from the System Preferences so
20587 * `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is
20588 * opened to know the current value. This setting is not available on MAS build s
20589 * or on macOS 13 and up.
20590 *
20591 * @deprecated
20592 * @platform darwin
20593 */
20594 openAsHidden?: boolean;
20595 /**
20596 * The type of service to add as a login item. Defaults to `mainAppService`. Only
20597 * available on macOS 13 and up.
20598 *
20599 * @platform darwin
20600 */
20601 type?: ('mainAppService' | 'agentService' | 'daemonService' | 'loginItemService');
20602 /**
20603 * The name of the service. Required if `type` is non-default. Only available on
20604 * macOS 13 and up.
20605 *
20606 * @platform darwin
20607 */
20608 serviceName?: string;
20609 /**
20610 * The executable to launch at login. Defaults to `process.execPath`.
20611 *
20612 * @platform win32
20613 */
20614 path?: string;
20615 /**
20616 * The command-line arguments to pass to the executable. Defaults to an empty
20617 * array. Take care to wrap paths in quotes.
20618 *
20619 * @platform win32
20620 */
20621 args?: string[];
20622 /**
20623 * `true` will change the startup approved registry key and `enable / disable` the
20624 * App in Task Manager and Windows Settings. Defaults to `true`.
20625 *
20626 * @platform win32
20627 */
20628 enabled?: boolean;
20629 /**
20630 * value name to write into registry. Defaults to the app's AppUserModelId().
20631 *
20632 * @platform win32
20633 */
20634 name?: string;
20635 }
20636
20637 interface SourcesOptions {
20638 /**
20639 * An array of strings that lists the types of desktop sources to be captured,
20640 * available types can be `screen` and `window`.
20641 */
20642 types: Array<'screen' | 'window'>;
20643 /**
20644 * The size that the media source thumbnail should be scaled to. Default is `150` x
20645 * `150`. Set width or height to 0 when you do not need the thumbnails. This will
20646 * save the processing time required for capturing the content of each window and
20647 * screen.
20648 */
20649 thumbnailSize?: Size;
20650 /**
20651 * Set to true to enable fetching window icons. The default value is false. When
20652 * false the appIcon property of the sources return null. Same if a source has the
20653 * type screen.
20654 */
20655 fetchWindowIcons?: boolean;
20656 }
20657
20658 interface StartLoggingOptions {
20659 /**
20660 * What kinds of data should be captured. By default, only metadata about requests
20661 * will be captured. Setting this to `includeSensitive` will include cookies and
20662 * authentication data. Setting it to `everything` will include all bytes
20663 * transferred on sockets. Can be `default`, `includeSensitive` or `everything`.
20664 */
20665 captureMode?: ('default' | 'includeSensitive' | 'everything');
20666 /**
20667 * When the log grows beyond this size, logging will automatically stop. Defaults
20668 * to unlimited.
20669 */
20670 maxFileSize?: number;
20671 }
20672
20673 interface Streams {
20674 video?: (Video) | (WebFrameMain);
20675 /**
20676 * If a string is specified, can be `loopback` or `loopbackWithMute`. Specifying a
20677 * loopback device will capture system audio, and is currently only supported on
20678 * Windows. If a WebFrameMain is specified, will capture audio from that frame.
20679 */
20680 audio?: (('loopback' | 'loopbackWithMute')) | (WebFrameMain);
20681 /**
20682 * If `audio` is a WebFrameMain and this is set to `true`, then local playback of
20683 * audio will not be muted (e.g. using `MediaRecorder` to record `WebFrameMain`
20684 * with this flag set to `true` will allow audio to pass through to the speakers
20685 * while recording). Default is `false`.
20686 */
20687 enableLocalEcho?: boolean;
20688 }
20689
20690 interface SystemMemoryInfo {
20691 /**
20692 * The total amount of physical memory in Kilobytes available to the system.
20693 */
20694 total: number;
20695 /**
20696 * The total amount of memory not being used by applications or disk cache.
20697 */
20698 free: number;
20699 /**
20700 * The total amount of swap memory in Kilobytes available to the system.
20701 *
20702 * @platform win32,linux
20703 */
20704 swapTotal: number;
20705 /**
20706 * The free amount of swap memory in Kilobytes available to the system.
20707 *
20708 * @platform win32,linux
20709 */
20710 swapFree: number;
20711 }
20712
20713 interface TitleBarOverlay {
20714 /**
20715 * The CSS color of the Window Controls Overlay when enabled. Default is the system
20716 * color.
20717 *
20718 * @platform win32
20719 */
20720 color?: string;
20721 /**
20722 * The CSS color of the symbols on the Window Controls Overlay when enabled.
20723 * Default is the system color.
20724 *
20725 * @platform win32
20726 */
20727 symbolColor?: string;
20728 /**
20729 * The height of the title bar and Window Controls Overlay in pixels. Default is
20730 * system height.
20731 *
20732 * @platform darwin,win32
20733 */
20734 height?: number;
20735 }
20736
20737 interface TitleBarOverlayOptions {
20738 /**
20739 * The CSS color of the Window Controls Overlay when enabled.
20740 *
20741 * @platform win32
20742 */
20743 color?: string;
20744 /**
20745 * The CSS color of the symbols on the Window Controls Overlay when enabled.
20746 *
20747 * @platform win32
20748 */
20749 symbolColor?: string;
20750 /**
20751 * The height of the title bar and Window Controls Overlay in pixels.
20752 *
20753 * @platform win32
20754 */
20755 height?: number;
20756 }
20757
20758 interface TitleOptions {
20759 /**
20760 * The font family variant to display, can be `monospaced` or `monospacedDigit`.
20761 * `monospaced` is available in macOS 10.15+ When left blank, the title uses the
20762 * default system font.
20763 */
20764 fontType?: ('monospaced' | 'monospacedDigit');
20765 }
20766
20767 interface ToBitmapOptions {
20768 /**
20769 * Defaults to 1.0.
20770 */
20771 scaleFactor?: number;
20772 }
20773
20774 interface ToDataURLOptions {
20775 /**
20776 * Defaults to 1.0.
20777 */
20778 scaleFactor?: number;
20779 }
20780
20781 interface ToPNGOptions {
20782 /**
20783 * Defaults to 1.0.
20784 */
20785 scaleFactor?: number;
20786 }
20787
20788 interface TouchBarButtonConstructorOptions {
20789 /**
20790 * Button text.
20791 */
20792 label?: string;
20793 /**
20794 * A short description of the button for use by screenreaders like VoiceOver.
20795 */
20796 accessibilityLabel?: string;
20797 /**
20798 * Button background color in hex format, i.e `#ABCDEF`.
20799 */
20800 backgroundColor?: string;
20801 /**
20802 * Button icon.
20803 */
20804 icon?: (NativeImage) | (string);
20805 /**
20806 * Can be `left`, `right` or `overlay`. Defaults to `overlay`.
20807 */
20808 iconPosition?: ('left' | 'right' | 'overlay');
20809 /**
20810 * Function to call when the button is clicked.
20811 */
20812 click?: () => void;
20813 /**
20814 * Whether the button is in an enabled state. Default is `true`.
20815 */
20816 enabled?: boolean;
20817 }
20818
20819 interface TouchBarColorPickerConstructorOptions {
20820 /**
20821 * Array of hex color strings to appear as possible colors to select.
20822 */
20823 availableColors?: string[];
20824 /**
20825 * The selected hex color in the picker, i.e `#ABCDEF`.
20826 */
20827 selectedColor?: string;
20828 /**
20829 * Function to call when a color is selected.
20830 */
20831 change?: (color: string) => void;
20832 }
20833
20834 interface TouchBarConstructorOptions {
20835 items?: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>;
20836 escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null);
20837 }
20838
20839 interface TouchBarGroupConstructorOptions {
20840 /**
20841 * Items to display as a group.
20842 */
20843 items: TouchBar;
20844 }
20845
20846 interface TouchBarLabelConstructorOptions {
20847 /**
20848 * Text to display.
20849 */
20850 label?: string;
20851 /**
20852 * A short description of the button for use by screenreaders like VoiceOver.
20853 */
20854 accessibilityLabel?: string;
20855 /**
20856 * Hex color of text, i.e `#ABCDEF`.
20857 */
20858 textColor?: string;
20859 }
20860
20861 interface TouchBarPopoverConstructorOptions {
20862 /**
20863 * Popover button text.
20864 */
20865 label?: string;
20866 /**
20867 * Popover button icon.
20868 */
20869 icon?: NativeImage;
20870 /**
20871 * Items to display in the popover.
20872 */
20873 items: TouchBar;
20874 /**
20875 * `true` to display a close button on the left of the popover, `false` to not show
20876 * it. Default is `true`.
20877 */
20878 showCloseButton?: boolean;
20879 }
20880
20881 interface TouchBarScrubberConstructorOptions {
20882 /**
20883 * An array of items to place in this scrubber.
20884 */
20885 items: ScrubberItem[];
20886 /**
20887 * Called when the user taps an item that was not the last tapped item.
20888 */
20889 select?: (selectedIndex: number) => void;
20890 /**
20891 * Called when the user taps any item.
20892 */
20893 highlight?: (highlightedIndex: number) => void;
20894 /**
20895 * Selected item style. Can be `background`, `outline` or `none`. Defaults to
20896 * `none`.
20897 */
20898 selectedStyle?: ('background' | 'outline' | 'none');
20899 /**
20900 * Selected overlay item style. Can be `background`, `outline` or `none`. Defaults
20901 * to `none`.
20902 */
20903 overlayStyle?: ('background' | 'outline' | 'none');
20904 /**
20905 * Whether to show arrow buttons. Defaults to `false` and is only shown if `items`
20906 * is non-empty.
20907 */
20908 showArrowButtons?: boolean;
20909 /**
20910 * Can be `fixed` or `free`. The default is `free`.
20911 */
20912 mode?: ('fixed' | 'free');
20913 /**
20914 * Defaults to `true`.
20915 */
20916 continuous?: boolean;
20917 }
20918
20919 interface TouchBarSegmentedControlConstructorOptions {
20920 /**
20921 * Style of the segments:
20922 */
20923 segmentStyle?: ('automatic' | 'rounded' | 'textured-rounded' | 'round-rect' | 'textured-square' | 'capsule' | 'small-square' | 'separated');
20924 /**
20925 * The selection mode of the control:
20926 */
20927 mode?: ('single' | 'multiple' | 'buttons');
20928 /**
20929 * An array of segments to place in this control.
20930 */
20931 segments: SegmentedControlSegment[];
20932 /**
20933 * The index of the currently selected segment, will update automatically with user
20934 * interaction. When the mode is `multiple` it will be the last selected item.
20935 */
20936 selectedIndex?: number;
20937 /**
20938 * Called when the user selects a new segment.
20939 */
20940 change?: (selectedIndex: number, isSelected: boolean) => void;
20941 }
20942
20943 interface TouchBarSliderConstructorOptions {
20944 /**
20945 * Label text.
20946 */
20947 label?: string;
20948 /**
20949 * Selected value.
20950 */
20951 value?: number;
20952 /**
20953 * Minimum value.
20954 */
20955 minValue?: number;
20956 /**
20957 * Maximum value.
20958 */
20959 maxValue?: number;
20960 /**
20961 * Function to call when the slider is changed.
20962 */
20963 change?: (newValue: number) => void;
20964 }
20965
20966 interface TouchBarSpacerConstructorOptions {
20967 /**
20968 * Size of spacer, possible values are:
20969 */
20970 size?: ('small' | 'large' | 'flexible');
20971 }
20972
20973 interface TraceBufferUsageReturnValue {
20974 value: number;
20975 percentage: number;
20976 }
20977
20978 interface UdpPortRange {
20979 /**
20980 * The minimum UDP port number that WebRTC should use.
20981 */
20982 min: number;
20983 /**
20984 * The maximum UDP port number that WebRTC should use.
20985 */
20986 max: number;
20987 }
20988
20989 interface UpdateTargetUrlEvent extends DOMEvent {
20990 url: string;
20991 }
20992
20993 interface UploadProgress {
20994 /**
20995 * Whether the request is currently active. If this is false no other properties
20996 * will be set
20997 */
20998 active: boolean;
20999 /**
21000 * Whether the upload has started. If this is false both `current` and `total` will
21001 * be set to 0.
21002 */
21003 started: boolean;
21004 /**
21005 * The number of bytes that have been uploaded so far
21006 */
21007 current: number;
21008 /**
21009 * The number of bytes that will be uploaded this request
21010 */
21011 total: number;
21012 }
21013
21014 interface UsbDeviceRevokedDetails {
21015 device: USBDevice;
21016 /**
21017 * The origin that the device has been revoked from.
21018 */
21019 origin?: string;
21020 }
21021
21022 interface USBProtectedClassesHandlerHandlerDetails {
21023 /**
21024 * The current list of protected USB classes. Possible class values include:
21025 */
21026 protectedClasses: Array<'audio' | 'audio-video' | 'hid' | 'mass-storage' | 'smart-card' | 'video' | 'wireless'>;
21027 }
21028
21029 interface VisibleOnAllWorkspacesOptions {
21030 /**
21031 * Sets whether the window should be visible above fullscreen windows.
21032 *
21033 * @platform darwin
21034 */
21035 visibleOnFullScreen?: boolean;
21036 /**
21037 * Calling setVisibleOnAllWorkspaces will by default transform the process type
21038 * between UIElementApplication and ForegroundApplication to ensure the correct
21039 * behavior. However, this will hide the window and dock for a short time every
21040 * time it is called. If your window is already of type UIElementApplication, you
21041 * can bypass this transformation by passing true to skipTransformProcessType.
21042 *
21043 * @platform darwin
21044 */
21045 skipTransformProcessType?: boolean;
21046 }
21047
21048 interface WebContentsAudioStateChangedEventParams {
21049 /**
21050 * True if one or more frames or child `webContents` are emitting audio.
21051 */
21052 audible: boolean;
21053 }
21054
21055 interface WebContentsDidRedirectNavigationEventParams {
21056 /**
21057 * The URL the frame is navigating to.
21058 */
21059 url: string;
21060 /**
21061 * Whether the navigation happened without changing document. Examples of same
21062 * document navigations are reference fragment navigations, pushState/replaceState,
21063 * and same page history navigation.
21064 */
21065 isSameDocument: boolean;
21066 /**
21067 * True if the navigation is taking place in a main frame.
21068 */
21069 isMainFrame: boolean;
21070 /**
21071 * The frame to be navigated.
21072 */
21073 frame: WebFrameMain;
21074 /**
21075 * The frame which initiated the navigation, which can be a parent frame (e.g. via
21076 * `window.open` with a frame's name), or null if the navigation was not initiated
21077 * by a frame. This can also be null if the initiating frame was deleted before the
21078 * event was emitted.
21079 */
21080 initiator?: WebFrameMain;
21081 }
21082
21083 interface WebContentsDidStartNavigationEventParams {
21084 /**
21085 * The URL the frame is navigating to.
21086 */
21087 url: string;
21088 /**
21089 * Whether the navigation happened without changing document. Examples of same
21090 * document navigations are reference fragment navigations, pushState/replaceState,
21091 * and same page history navigation.
21092 */
21093 isSameDocument: boolean;
21094 /**
21095 * True if the navigation is taking place in a main frame.
21096 */
21097 isMainFrame: boolean;
21098 /**
21099 * The frame to be navigated.
21100 */
21101 frame: WebFrameMain;
21102 /**
21103 * The frame which initiated the navigation, which can be a parent frame (e.g. via
21104 * `window.open` with a frame's name), or null if the navigation was not initiated
21105 * by a frame. This can also be null if the initiating frame was deleted before the
21106 * event was emitted.
21107 */
21108 initiator?: WebFrameMain;
21109 }
21110
21111 interface WebContentsPrintOptions {
21112 /**
21113 * Don't ask user for print settings. Default is `false`.
21114 */
21115 silent?: boolean;
21116 /**
21117 * Prints the background color and image of the web page. Default is `false`.
21118 */
21119 printBackground?: boolean;
21120 /**
21121 * Set the printer device name to use. Must be the system-defined name and not the
21122 * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
21123 */
21124 deviceName?: string;
21125 /**
21126 * Set whether the printed web page will be in color or grayscale. Default is
21127 * `true`.
21128 */
21129 color?: boolean;
21130 margins?: Margins;
21131 /**
21132 * Whether the web page should be printed in landscape mode. Default is `false`.
21133 */
21134 landscape?: boolean;
21135 /**
21136 * The scale factor of the web page.
21137 */
21138 scaleFactor?: number;
21139 /**
21140 * The number of pages to print per page sheet.
21141 */
21142 pagesPerSheet?: number;
21143 /**
21144 * Whether the web page should be collated.
21145 */
21146 collate?: boolean;
21147 /**
21148 * The number of copies of the web page to print.
21149 */
21150 copies?: number;
21151 /**
21152 * The page range to print. On macOS, only one range is honored.
21153 */
21154 pageRanges?: PageRanges[];
21155 /**
21156 * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
21157 * `longEdge`.
21158 */
21159 duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
21160 dpi?: Record<string, number>;
21161 /**
21162 * string to be printed as page header.
21163 */
21164 header?: string;
21165 /**
21166 * string to be printed as page footer.
21167 */
21168 footer?: string;
21169 /**
21170 * Specify page size of the printed document. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
21171 * `A5`, `A6`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and
21172 * `width`.
21173 */
21174 pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
21175 }
21176
21177 interface WebContentsViewConstructorOptions {
21178 /**
21179 * Settings of web page's features.
21180 */
21181 webPreferences?: WebPreferences;
21182 }
21183
21184 interface WebContentsWillFrameNavigateEventParams {
21185 /**
21186 * The URL the frame is navigating to.
21187 */
21188 url: string;
21189 /**
21190 * This event does not fire for same document navigations using window.history api
21191 * and reference fragment navigations. This property is always set to `false` for
21192 * this event.
21193 */
21194 isSameDocument: boolean;
21195 /**
21196 * True if the navigation is taking place in a main frame.
21197 */
21198 isMainFrame: boolean;
21199 /**
21200 * The frame to be navigated.
21201 */
21202 frame: WebFrameMain;
21203 /**
21204 * The frame which initiated the navigation, which can be a parent frame (e.g. via
21205 * `window.open` with a frame's name), or null if the navigation was not initiated
21206 * by a frame. This can also be null if the initiating frame was deleted before the
21207 * event was emitted.
21208 */
21209 initiator?: WebFrameMain;
21210 }
21211
21212 interface WebContentsWillNavigateEventParams {
21213 /**
21214 * The URL the frame is navigating to.
21215 */
21216 url: string;
21217 /**
21218 * This event does not fire for same document navigations using window.history api
21219 * and reference fragment navigations. This property is always set to `false` for
21220 * this event.
21221 */
21222 isSameDocument: boolean;
21223 /**
21224 * True if the navigation is taking place in a main frame.
21225 */
21226 isMainFrame: boolean;
21227 /**
21228 * The frame to be navigated.
21229 */
21230 frame: WebFrameMain;
21231 /**
21232 * The frame which initiated the navigation, which can be a parent frame (e.g. via
21233 * `window.open` with a frame's name), or null if the navigation was not initiated
21234 * by a frame. This can also be null if the initiating frame was deleted before the
21235 * event was emitted.
21236 */
21237 initiator?: WebFrameMain;
21238 }
21239
21240 interface WebContentsWillRedirectEventParams {
21241 /**
21242 * The URL the frame is navigating to.
21243 */
21244 url: string;
21245 /**
21246 * Whether the navigation happened without changing document. Examples of same
21247 * document navigations are reference fragment navigations, pushState/replaceState,
21248 * and same page history navigation.
21249 */
21250 isSameDocument: boolean;
21251 /**
21252 * True if the navigation is taking place in a main frame.
21253 */
21254 isMainFrame: boolean;
21255 /**
21256 * The frame to be navigated.
21257 */
21258 frame: WebFrameMain;
21259 /**
21260 * The frame which initiated the navigation, which can be a parent frame (e.g. via
21261 * `window.open` with a frame's name), or null if the navigation was not initiated
21262 * by a frame. This can also be null if the initiating frame was deleted before the
21263 * event was emitted.
21264 */
21265 initiator?: WebFrameMain;
21266 }
21267
21268 interface WebRTCUDPPortRange {
21269 /**
21270 * The minimum UDP port number that WebRTC should use.
21271 */
21272 min: number;
21273 /**
21274 * The maximum UDP port number that WebRTC should use.
21275 */
21276 max: number;
21277 }
21278
21279 interface WebviewTagPrintOptions {
21280 /**
21281 * Don't ask user for print settings. Default is `false`.
21282 */
21283 silent?: boolean;
21284 /**
21285 * Prints the background color and image of the web page. Default is `false`.
21286 */
21287 printBackground?: boolean;
21288 /**
21289 * Set the printer device name to use. Must be the system-defined name and not the
21290 * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
21291 */
21292 deviceName?: string;
21293 /**
21294 * Set whether the printed web page will be in color or grayscale. Default is
21295 * `true`.
21296 */
21297 color?: boolean;
21298 margins?: Margins;
21299 /**
21300 * Whether the web page should be printed in landscape mode. Default is `false`.
21301 */
21302 landscape?: boolean;
21303 /**
21304 * The scale factor of the web page.
21305 */
21306 scaleFactor?: number;
21307 /**
21308 * The number of pages to print per page sheet.
21309 */
21310 pagesPerSheet?: number;
21311 /**
21312 * Whether the web page should be collated.
21313 */
21314 collate?: boolean;
21315 /**
21316 * The number of copies of the web page to print.
21317 */
21318 copies?: number;
21319 /**
21320 * The page range to print.
21321 */
21322 pageRanges?: PageRanges[];
21323 /**
21324 * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
21325 * `longEdge`.
21326 */
21327 duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
21328 dpi?: Record<string, number>;
21329 /**
21330 * string to be printed as page header.
21331 */
21332 header?: string;
21333 /**
21334 * string to be printed as page footer.
21335 */
21336 footer?: string;
21337 /**
21338 * Specify page size of the printed document. Can be `A3`, `A4`, `A5`, `Legal`,
21339 * `Letter`, `Tabloid` or an Object containing `height` in microns.
21340 */
21341 pageSize?: (('A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
21342 }
21343
21344 interface WillFrameNavigateEvent extends DOMEvent {
21345 url: string;
21346 isMainFrame: boolean;
21347 frameProcessId: number;
21348 frameRoutingId: number;
21349 }
21350
21351 interface WillNavigateEvent extends DOMEvent {
21352 url: string;
21353 }
21354
21355 interface WillResizeDetails {
21356 /**
21357 * The edge of the window being dragged for resizing. Can be `bottom`, `left`,
21358 * `right`, `top-left`, `top-right`, `bottom-left` or `bottom-right`.
21359 */
21360 edge: ('bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right');
21361 }
21362
21363 interface EditFlags {
21364 /**
21365 * Whether the renderer believes it can undo.
21366 */
21367 canUndo: boolean;
21368 /**
21369 * Whether the renderer believes it can redo.
21370 */
21371 canRedo: boolean;
21372 /**
21373 * Whether the renderer believes it can cut.
21374 */
21375 canCut: boolean;
21376 /**
21377 * Whether the renderer believes it can copy.
21378 */
21379 canCopy: boolean;
21380 /**
21381 * Whether the renderer believes it can paste.
21382 */
21383 canPaste: boolean;
21384 /**
21385 * Whether the renderer believes it can delete.
21386 */
21387 canDelete: boolean;
21388 /**
21389 * Whether the renderer believes it can select all.
21390 */
21391 canSelectAll: boolean;
21392 /**
21393 * Whether the renderer believes it can edit text richly.
21394 */
21395 canEditRichly: boolean;
21396 }
21397
21398 interface Env {
21399 }
21400
21401 interface FoundInPageResult {
21402 requestId: number;
21403 /**
21404 * Position of the active match.
21405 */
21406 activeMatchOrdinal: number;
21407 /**
21408 * Number of Matches.
21409 */
21410 matches: number;
21411 /**
21412 * Coordinates of first match region.
21413 */
21414 selectionArea: Rectangle;
21415 finalUpdate: boolean;
21416 }
21417
21418 interface LaunchItems {
21419 /**
21420 * name value of a registry entry.
21421 *
21422 * @platform win32
21423 */
21424 name: string;
21425 /**
21426 * The executable to an app that corresponds to a registry entry.
21427 *
21428 * @platform win32
21429 */
21430 path: string;
21431 /**
21432 * the command-line arguments to pass to the executable.
21433 *
21434 * @platform win32
21435 */
21436 args: string[];
21437 /**
21438 * one of `user` or `machine`. Indicates whether the registry entry is under
21439 * `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
21440 *
21441 * @platform win32
21442 */
21443 scope: string;
21444 /**
21445 * `true` if the app registry key is startup approved and therefore shows as
21446 * `enabled` in Task Manager and Windows settings.
21447 *
21448 * @platform win32
21449 */
21450 enabled: boolean;
21451 }
21452
21453 interface Margins {
21454 /**
21455 * Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
21456 * you will also need to specify `top`, `bottom`, `left`, and `right`.
21457 */
21458 marginType?: ('default' | 'none' | 'printableArea' | 'custom');
21459 /**
21460 * The top margin of the printed web page, in pixels.
21461 */
21462 top?: number;
21463 /**
21464 * The bottom margin of the printed web page, in pixels.
21465 */
21466 bottom?: number;
21467 /**
21468 * The left margin of the printed web page, in pixels.
21469 */
21470 left?: number;
21471 /**
21472 * The right margin of the printed web page, in pixels.
21473 */
21474 right?: number;
21475 }
21476
21477 interface MediaFlags {
21478 /**
21479 * Whether the media element has crashed.
21480 */
21481 inError: boolean;
21482 /**
21483 * Whether the media element is paused.
21484 */
21485 isPaused: boolean;
21486 /**
21487 * Whether the media element is muted.
21488 */
21489 isMuted: boolean;
21490 /**
21491 * Whether the media element has audio.
21492 */
21493 hasAudio: boolean;
21494 /**
21495 * Whether the media element is looping.
21496 */
21497 isLooping: boolean;
21498 /**
21499 * Whether the media element's controls are visible.
21500 */
21501 isControlsVisible: boolean;
21502 /**
21503 * Whether the media element's controls are toggleable.
21504 */
21505 canToggleControls: boolean;
21506 /**
21507 * Whether the media element can be printed.
21508 */
21509 canPrint: boolean;
21510 /**
21511 * Whether or not the media element can be downloaded.
21512 */
21513 canSave: boolean;
21514 /**
21515 * Whether the media element can show picture-in-picture.
21516 */
21517 canShowPictureInPicture: boolean;
21518 /**
21519 * Whether the media element is currently showing picture-in-picture.
21520 */
21521 isShowingPictureInPicture: boolean;
21522 /**
21523 * Whether the media element can be rotated.
21524 */
21525 canRotate: boolean;
21526 /**
21527 * Whether the media element can be looped.
21528 */
21529 canLoop: boolean;
21530 }
21531
21532 interface PageRanges {
21533 /**
21534 * Index of the first page to print (0-based).
21535 */
21536 from: number;
21537 /**
21538 * Index of the last page to print (inclusive) (0-based).
21539 */
21540 to: number;
21541 }
21542
21543 interface Params {
21544 /**
21545 * x coordinate.
21546 */
21547 x: number;
21548 /**
21549 * y coordinate.
21550 */
21551 y: number;
21552 /**
21553 * URL of the link that encloses the node the context menu was invoked on.
21554 */
21555 linkURL: string;
21556 /**
21557 * Text associated with the link. May be an empty string if the contents of the
21558 * link are an image.
21559 */
21560 linkText: string;
21561 /**
21562 * URL of the top level page that the context menu was invoked on.
21563 */
21564 pageURL: string;
21565 /**
21566 * URL of the subframe that the context menu was invoked on.
21567 */
21568 frameURL: string;
21569 /**
21570 * Source URL for the element that the context menu was invoked on. Elements with
21571 * source URLs are images, audio and video.
21572 */
21573 srcURL: string;
21574 /**
21575 * Type of the node the context menu was invoked on. Can be `none`, `image`,
21576 * `audio`, `video`, `canvas`, `file` or `plugin`.
21577 */
21578 mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
21579 /**
21580 * Whether the context menu was invoked on an image which has non-empty contents.
21581 */
21582 hasImageContents: boolean;
21583 /**
21584 * Whether the context is editable.
21585 */
21586 isEditable: boolean;
21587 /**
21588 * Text of the selection that the context menu was invoked on.
21589 */
21590 selectionText: string;
21591 /**
21592 * Title text of the selection that the context menu was invoked on.
21593 */
21594 titleText: string;
21595 /**
21596 * Alt text of the selection that the context menu was invoked on.
21597 */
21598 altText: string;
21599 /**
21600 * Suggested filename to be used when saving file through 'Save Link As' option of
21601 * context menu.
21602 */
21603 suggestedFilename: string;
21604 /**
21605 * Rect representing the coordinates in the document space of the selection.
21606 */
21607 selectionRect: Rectangle;
21608 /**
21609 * Start position of the selection text.
21610 */
21611 selectionStartOffset: number;
21612 /**
21613 * The referrer policy of the frame on which the menu is invoked.
21614 */
21615 referrerPolicy: Referrer;
21616 /**
21617 * The misspelled word under the cursor, if any.
21618 */
21619 misspelledWord: string;
21620 /**
21621 * An array of suggested words to show the user to replace the `misspelledWord`.
21622 * Only available if there is a misspelled word and spellchecker is enabled.
21623 */
21624 dictionarySuggestions: string[];
21625 /**
21626 * The character encoding of the frame on which the menu was invoked.
21627 */
21628 frameCharset: string;
21629 /**
21630 * The source that the context menu was invoked on. Possible values include `none`,
21631 * `button-button`, `field-set`, `input-button`, `input-checkbox`, `input-color`,
21632 * `input-date`, `input-datetime-local`, `input-email`, `input-file`,
21633 * `input-hidden`, `input-image`, `input-month`, `input-number`, `input-password`,
21634 * `input-radio`, `input-range`, `input-reset`, `input-search`, `input-submit`,
21635 * `input-telephone`, `input-text`, `input-time`, `input-url`, `input-week`,
21636 * `output`, `reset-button`, `select-list`, `select-list`, `select-multiple`,
21637 * `select-one`, `submit-button`, and `text-area`,
21638 */
21639 formControlType: ('none' | 'button-button' | 'field-set' | 'input-button' | 'input-checkbox' | 'input-color' | 'input-date' | 'input-datetime-local' | 'input-email' | 'input-file' | 'input-hidden' | 'input-image' | 'input-month' | 'input-number' | 'input-password' | 'input-radio' | 'input-range' | 'input-reset' | 'input-search' | 'input-submit' | 'input-telephone' | 'input-text' | 'input-time' | 'input-url' | 'input-week' | 'output' | 'reset-button' | 'select-list' | 'select-list' | 'select-multiple' | 'select-one' | 'submit-button' | 'text-area');
21640 /**
21641 * If the context is editable, whether or not spellchecking is enabled.
21642 */
21643 spellcheckEnabled: boolean;
21644 /**
21645 * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
21646 * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
21647 * `adjustSelection`, or `adjustSelectionReset`.
21648 */
21649 menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
21650 /**
21651 * The flags for the media element the context menu was invoked on.
21652 */
21653 mediaFlags: MediaFlags;
21654 /**
21655 * These flags indicate whether the renderer believes it is able to perform the
21656 * corresponding action.
21657 */
21658 editFlags: EditFlags;
21659 }
21660
21661 interface Video {
21662 /**
21663 * The id of the stream being granted. This will usually come from a
21664 * DesktopCapturerSource object.
21665 */
21666 id: string;
21667 /**
21668 * The name of the stream being granted. This will usually come from a
21669 * DesktopCapturerSource object.
21670 */
21671 name: string;
21672 }
21673
21674
21675
21676 namespace Common {
21677 type Event<Params extends object = {}> = Electron.Event<Params>;
21678 const clipboard: Clipboard;
21679 type Clipboard = Electron.Clipboard;
21680 const crashReporter: CrashReporter;
21681 type CrashReporter = Electron.CrashReporter;
21682 const nativeImage: typeof NativeImage;
21683 type NativeImage = Electron.NativeImage;
21684 const shell: Shell;
21685 type Shell = Electron.Shell;
21686 type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
21687 type AddRepresentationOptions = Electron.AddRepresentationOptions;
21688 type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
21689 type AnimationSettings = Electron.AnimationSettings;
21690 type AppDetailsOptions = Electron.AppDetailsOptions;
21691 type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
21692 type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
21693 type AuthInfo = Electron.AuthInfo;
21694 type AutoResizeOptions = Electron.AutoResizeOptions;
21695 type BeforeSendResponse = Electron.BeforeSendResponse;
21696 type BitmapOptions = Electron.BitmapOptions;
21697 type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
21698 type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
21699 type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
21700 type CallbackResponse = Electron.CallbackResponse;
21701 type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
21702 type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
21703 type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
21704 type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
21705 type CloseOpts = Electron.CloseOpts;
21706 type Config = Electron.Config;
21707 type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
21708 type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
21709 type ContextMenuEvent = Electron.ContextMenuEvent;
21710 type ContextMenuParams = Electron.ContextMenuParams;
21711 type ContinueActivityDetails = Electron.ContinueActivityDetails;
21712 type CookiesGetFilter = Electron.CookiesGetFilter;
21713 type CookiesSetDetails = Electron.CookiesSetDetails;
21714 type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
21715 type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
21716 type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
21717 type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
21718 type Data = Electron.Data;
21719 type DefaultFontFamily = Electron.DefaultFontFamily;
21720 type Details = Electron.Details;
21721 type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
21722 type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
21723 type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
21724 type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
21725 type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
21726 type DidFailLoadEvent = Electron.DidFailLoadEvent;
21727 type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
21728 type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
21729 type DidNavigateEvent = Electron.DidNavigateEvent;
21730 type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
21731 type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
21732 type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
21733 type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
21734 type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
21735 type DownloadURLOptions = Electron.DownloadURLOptions;
21736 type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
21737 type EntryAtIndex = Electron.EntryAtIndex;
21738 type FeedURLOptions = Electron.FeedURLOptions;
21739 type FileIconOptions = Electron.FileIconOptions;
21740 type FindInPageOptions = Electron.FindInPageOptions;
21741 type FocusOptions = Electron.FocusOptions;
21742 type ForkOptions = Electron.ForkOptions;
21743 type FoundInPageEvent = Electron.FoundInPageEvent;
21744 type FrameCreatedDetails = Electron.FrameCreatedDetails;
21745 type FromPartitionOptions = Electron.FromPartitionOptions;
21746 type FromPathOptions = Electron.FromPathOptions;
21747 type HandlerDetails = Electron.HandlerDetails;
21748 type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
21749 type HeapStatistics = Electron.HeapStatistics;
21750 type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
21751 type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
21752 type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
21753 type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
21754 type ImportCertificateOptions = Electron.ImportCertificateOptions;
21755 type Info = Electron.Info;
21756 type Input = Electron.Input;
21757 type InsertCSSOptions = Electron.InsertCSSOptions;
21758 type IpcMessageEvent = Electron.IpcMessageEvent;
21759 type Item = Electron.Item;
21760 type JumpListSettings = Electron.JumpListSettings;
21761 type LoadCommitEvent = Electron.LoadCommitEvent;
21762 type LoadExtensionOptions = Electron.LoadExtensionOptions;
21763 type LoadFileOptions = Electron.LoadFileOptions;
21764 type LoadURLOptions = Electron.LoadURLOptions;
21765 type LoginItemSettings = Electron.LoginItemSettings;
21766 type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
21767 type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
21768 type MessageBoxOptions = Electron.MessageBoxOptions;
21769 type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
21770 type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
21771 type MessageDetails = Electron.MessageDetails;
21772 type MessageEvent = Electron.MessageEvent;
21773 type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
21774 type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
21775 type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
21776 type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
21777 type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
21778 type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
21779 type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
21780 type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
21781 type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
21782 type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
21783 type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
21784 type OpenDialogOptions = Electron.OpenDialogOptions;
21785 type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
21786 type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
21787 type OpenExternalOptions = Electron.OpenExternalOptions;
21788 type Options = Electron.Options;
21789 type Opts = Electron.Opts;
21790 type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
21791 type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
21792 type Parameters = Electron.Parameters;
21793 type Payment = Electron.Payment;
21794 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
21795 type PluginCrashedEvent = Electron.PluginCrashedEvent;
21796 type PopupOptions = Electron.PopupOptions;
21797 type PreconnectOptions = Electron.PreconnectOptions;
21798 type PrintToPDFOptions = Electron.PrintToPDFOptions;
21799 type Privileges = Electron.Privileges;
21800 type ProgressBarOptions = Electron.ProgressBarOptions;
21801 type Provider = Electron.Provider;
21802 type PurchaseProductOpts = Electron.PurchaseProductOpts;
21803 type ReadBookmark = Electron.ReadBookmark;
21804 type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
21805 type RelaunchOptions = Electron.RelaunchOptions;
21806 type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
21807 type Request = Electron.Request;
21808 type ResizeOptions = Electron.ResizeOptions;
21809 type ResolveHostOptions = Electron.ResolveHostOptions;
21810 type ResourceUsage = Electron.ResourceUsage;
21811 type Response = Electron.Response;
21812 type Result = Electron.Result;
21813 type SaveDialogOptions = Electron.SaveDialogOptions;
21814 type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
21815 type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
21816 type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
21817 type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
21818 type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
21819 type Settings = Electron.Settings;
21820 type SourcesOptions = Electron.SourcesOptions;
21821 type StartLoggingOptions = Electron.StartLoggingOptions;
21822 type Streams = Electron.Streams;
21823 type SystemMemoryInfo = Electron.SystemMemoryInfo;
21824 type TitleBarOverlay = Electron.TitleBarOverlay;
21825 type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
21826 type TitleOptions = Electron.TitleOptions;
21827 type ToBitmapOptions = Electron.ToBitmapOptions;
21828 type ToDataURLOptions = Electron.ToDataURLOptions;
21829 type ToPNGOptions = Electron.ToPNGOptions;
21830 type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
21831 type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
21832 type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
21833 type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
21834 type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
21835 type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
21836 type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
21837 type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
21838 type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
21839 type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
21840 type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
21841 type UdpPortRange = Electron.UdpPortRange;
21842 type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
21843 type UploadProgress = Electron.UploadProgress;
21844 type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
21845 type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
21846 type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
21847 type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
21848 type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
21849 type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
21850 type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
21851 type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
21852 type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
21853 type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
21854 type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
21855 type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
21856 type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
21857 type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
21858 type WillNavigateEvent = Electron.WillNavigateEvent;
21859 type WillResizeDetails = Electron.WillResizeDetails;
21860 type EditFlags = Electron.EditFlags;
21861 type Env = Electron.Env;
21862 type FoundInPageResult = Electron.FoundInPageResult;
21863 type LaunchItems = Electron.LaunchItems;
21864 type Margins = Electron.Margins;
21865 type MediaFlags = Electron.MediaFlags;
21866 type PageRanges = Electron.PageRanges;
21867 type Params = Electron.Params;
21868 type Video = Electron.Video;
21869 type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
21870 type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
21871 type BluetoothDevice = Electron.BluetoothDevice;
21872 type Certificate = Electron.Certificate;
21873 type CertificatePrincipal = Electron.CertificatePrincipal;
21874 type Cookie = Electron.Cookie;
21875 type CPUUsage = Electron.CPUUsage;
21876 type CrashReport = Electron.CrashReport;
21877 type CustomScheme = Electron.CustomScheme;
21878 type DesktopCapturerSource = Electron.DesktopCapturerSource;
21879 type Display = Electron.Display;
21880 type Extension = Electron.Extension;
21881 type ExtensionInfo = Electron.ExtensionInfo;
21882 type FileFilter = Electron.FileFilter;
21883 type FilePathWithHeaders = Electron.FilePathWithHeaders;
21884 type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
21885 type GPUFeatureStatus = Electron.GPUFeatureStatus;
21886 type HIDDevice = Electron.HIDDevice;
21887 type InputEvent = Electron.InputEvent;
21888 type IpcMainEvent = Electron.IpcMainEvent;
21889 type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
21890 type IpcRendererEvent = Electron.IpcRendererEvent;
21891 type JumpListCategory = Electron.JumpListCategory;
21892 type JumpListItem = Electron.JumpListItem;
21893 type KeyboardEvent = Electron.KeyboardEvent;
21894 type KeyboardInputEvent = Electron.KeyboardInputEvent;
21895 type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
21896 type MemoryInfo = Electron.MemoryInfo;
21897 type MemoryUsageDetails = Electron.MemoryUsageDetails;
21898 type MimeTypedBuffer = Electron.MimeTypedBuffer;
21899 type MouseInputEvent = Electron.MouseInputEvent;
21900 type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
21901 type NotificationAction = Electron.NotificationAction;
21902 type NotificationResponse = Electron.NotificationResponse;
21903 type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
21904 type PaymentDiscount = Electron.PaymentDiscount;
21905 type PermissionRequest = Electron.PermissionRequest;
21906 type Point = Electron.Point;
21907 type PostBody = Electron.PostBody;
21908 type PrinterInfo = Electron.PrinterInfo;
21909 type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
21910 type ProcessMetric = Electron.ProcessMetric;
21911 type Product = Electron.Product;
21912 type ProductDiscount = Electron.ProductDiscount;
21913 type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
21914 type ProtocolRequest = Electron.ProtocolRequest;
21915 type ProtocolResponse = Electron.ProtocolResponse;
21916 type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
21917 type ProxyConfig = Electron.ProxyConfig;
21918 type Rectangle = Electron.Rectangle;
21919 type Referrer = Electron.Referrer;
21920 type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
21921 type ResolvedEndpoint = Electron.ResolvedEndpoint;
21922 type ResolvedHost = Electron.ResolvedHost;
21923 type ScrubberItem = Electron.ScrubberItem;
21924 type SegmentedControlSegment = Electron.SegmentedControlSegment;
21925 type SerialPort = Electron.SerialPort;
21926 type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
21927 type SharedWorkerInfo = Electron.SharedWorkerInfo;
21928 type SharingItem = Electron.SharingItem;
21929 type ShortcutDetails = Electron.ShortcutDetails;
21930 type Size = Electron.Size;
21931 type Task = Electron.Task;
21932 type ThumbarButton = Electron.ThumbarButton;
21933 type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
21934 type TraceConfig = Electron.TraceConfig;
21935 type Transaction = Electron.Transaction;
21936 type UploadData = Electron.UploadData;
21937 type UploadFile = Electron.UploadFile;
21938 type UploadRawData = Electron.UploadRawData;
21939 type USBDevice = Electron.USBDevice;
21940 type UserDefaultTypes = Electron.UserDefaultTypes;
21941 type WebPreferences = Electron.WebPreferences;
21942 type WebRequestFilter = Electron.WebRequestFilter;
21943 type WebSource = Electron.WebSource;
21944 }
21945
21946 namespace Main {
21947 type Event<Params extends object = {}> = Electron.Event<Params>;
21948 const app: App;
21949 type App = Electron.App;
21950 const autoUpdater: AutoUpdater;
21951 type AutoUpdater = Electron.AutoUpdater;
21952 class BaseWindow extends Electron.BaseWindow {}
21953 class BrowserView extends Electron.BrowserView {}
21954 class BrowserWindow extends Electron.BrowserWindow {}
21955 type ClientRequest = Electron.ClientRequest;
21956 type CommandLine = Electron.CommandLine;
21957 const contentTracing: ContentTracing;
21958 type ContentTracing = Electron.ContentTracing;
21959 type Cookies = Electron.Cookies;
21960 type Debugger = Electron.Debugger;
21961 const desktopCapturer: DesktopCapturer;
21962 type DesktopCapturer = Electron.DesktopCapturer;
21963 const dialog: Dialog;
21964 type Dialog = Electron.Dialog;
21965 type Dock = Electron.Dock;
21966 type DownloadItem = Electron.DownloadItem;
21967 const globalShortcut: GlobalShortcut;
21968 type GlobalShortcut = Electron.GlobalShortcut;
21969 const inAppPurchase: InAppPurchase;
21970 type InAppPurchase = Electron.InAppPurchase;
21971 type IncomingMessage = Electron.IncomingMessage;
21972 const ipcMain: IpcMain;
21973 type IpcMain = Electron.IpcMain;
21974 class Menu extends Electron.Menu {}
21975 class MenuItem extends Electron.MenuItem {}
21976 class MessageChannelMain extends Electron.MessageChannelMain {}
21977 type MessagePortMain = Electron.MessagePortMain;
21978 const nativeTheme: NativeTheme;
21979 type NativeTheme = Electron.NativeTheme;
21980 type NavigationHistory = Electron.NavigationHistory;
21981 const net: Net;
21982 type Net = Electron.Net;
21983 const netLog: NetLog;
21984 type NetLog = Electron.NetLog;
21985 class Notification extends Electron.Notification {}
21986 const powerMonitor: PowerMonitor;
21987 type PowerMonitor = Electron.PowerMonitor;
21988 const powerSaveBlocker: PowerSaveBlocker;
21989 type PowerSaveBlocker = Electron.PowerSaveBlocker;
21990 const protocol: Protocol;
21991 type Protocol = Electron.Protocol;
21992 const pushNotifications: PushNotifications;
21993 type PushNotifications = Electron.PushNotifications;
21994 const safeStorage: SafeStorage;
21995 type SafeStorage = Electron.SafeStorage;
21996 const screen: Screen;
21997 type Screen = Electron.Screen;
21998 type ServiceWorkers = Electron.ServiceWorkers;
21999 const session: typeof Session;
22000 type Session = Electron.Session;
22001 class ShareMenu extends Electron.ShareMenu {}
22002 const systemPreferences: SystemPreferences;
22003 type SystemPreferences = Electron.SystemPreferences;
22004 class TouchBar extends Electron.TouchBar {}
22005 type TouchBarButton = Electron.TouchBarButton;
22006 type TouchBarColorPicker = Electron.TouchBarColorPicker;
22007 type TouchBarGroup = Electron.TouchBarGroup;
22008 type TouchBarLabel = Electron.TouchBarLabel;
22009 type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
22010 type TouchBarPopover = Electron.TouchBarPopover;
22011 type TouchBarScrubber = Electron.TouchBarScrubber;
22012 type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
22013 type TouchBarSlider = Electron.TouchBarSlider;
22014 type TouchBarSpacer = Electron.TouchBarSpacer;
22015 class Tray extends Electron.Tray {}
22016 const utilityProcess: typeof UtilityProcess;
22017 type UtilityProcess = Electron.UtilityProcess;
22018 class View extends Electron.View {}
22019 const webContents: typeof WebContents;
22020 type WebContents = Electron.WebContents;
22021 class WebContentsView extends Electron.WebContentsView {}
22022 const webFrameMain: typeof WebFrameMain;
22023 type WebFrameMain = Electron.WebFrameMain;
22024 type WebRequest = Electron.WebRequest;
22025 type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
22026 type AddRepresentationOptions = Electron.AddRepresentationOptions;
22027 type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
22028 type AnimationSettings = Electron.AnimationSettings;
22029 type AppDetailsOptions = Electron.AppDetailsOptions;
22030 type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
22031 type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
22032 type AuthInfo = Electron.AuthInfo;
22033 type AutoResizeOptions = Electron.AutoResizeOptions;
22034 type BeforeSendResponse = Electron.BeforeSendResponse;
22035 type BitmapOptions = Electron.BitmapOptions;
22036 type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
22037 type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
22038 type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
22039 type CallbackResponse = Electron.CallbackResponse;
22040 type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
22041 type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
22042 type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
22043 type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
22044 type CloseOpts = Electron.CloseOpts;
22045 type Config = Electron.Config;
22046 type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
22047 type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
22048 type ContextMenuEvent = Electron.ContextMenuEvent;
22049 type ContextMenuParams = Electron.ContextMenuParams;
22050 type ContinueActivityDetails = Electron.ContinueActivityDetails;
22051 type CookiesGetFilter = Electron.CookiesGetFilter;
22052 type CookiesSetDetails = Electron.CookiesSetDetails;
22053 type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
22054 type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
22055 type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
22056 type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
22057 type Data = Electron.Data;
22058 type DefaultFontFamily = Electron.DefaultFontFamily;
22059 type Details = Electron.Details;
22060 type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
22061 type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
22062 type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
22063 type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
22064 type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
22065 type DidFailLoadEvent = Electron.DidFailLoadEvent;
22066 type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
22067 type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
22068 type DidNavigateEvent = Electron.DidNavigateEvent;
22069 type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
22070 type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
22071 type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
22072 type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
22073 type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
22074 type DownloadURLOptions = Electron.DownloadURLOptions;
22075 type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
22076 type EntryAtIndex = Electron.EntryAtIndex;
22077 type FeedURLOptions = Electron.FeedURLOptions;
22078 type FileIconOptions = Electron.FileIconOptions;
22079 type FindInPageOptions = Electron.FindInPageOptions;
22080 type FocusOptions = Electron.FocusOptions;
22081 type ForkOptions = Electron.ForkOptions;
22082 type FoundInPageEvent = Electron.FoundInPageEvent;
22083 type FrameCreatedDetails = Electron.FrameCreatedDetails;
22084 type FromPartitionOptions = Electron.FromPartitionOptions;
22085 type FromPathOptions = Electron.FromPathOptions;
22086 type HandlerDetails = Electron.HandlerDetails;
22087 type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
22088 type HeapStatistics = Electron.HeapStatistics;
22089 type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
22090 type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
22091 type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
22092 type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
22093 type ImportCertificateOptions = Electron.ImportCertificateOptions;
22094 type Info = Electron.Info;
22095 type Input = Electron.Input;
22096 type InsertCSSOptions = Electron.InsertCSSOptions;
22097 type IpcMessageEvent = Electron.IpcMessageEvent;
22098 type Item = Electron.Item;
22099 type JumpListSettings = Electron.JumpListSettings;
22100 type LoadCommitEvent = Electron.LoadCommitEvent;
22101 type LoadExtensionOptions = Electron.LoadExtensionOptions;
22102 type LoadFileOptions = Electron.LoadFileOptions;
22103 type LoadURLOptions = Electron.LoadURLOptions;
22104 type LoginItemSettings = Electron.LoginItemSettings;
22105 type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
22106 type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
22107 type MessageBoxOptions = Electron.MessageBoxOptions;
22108 type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
22109 type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
22110 type MessageDetails = Electron.MessageDetails;
22111 type MessageEvent = Electron.MessageEvent;
22112 type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
22113 type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
22114 type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
22115 type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
22116 type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
22117 type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
22118 type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
22119 type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
22120 type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
22121 type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
22122 type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
22123 type OpenDialogOptions = Electron.OpenDialogOptions;
22124 type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
22125 type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
22126 type OpenExternalOptions = Electron.OpenExternalOptions;
22127 type Options = Electron.Options;
22128 type Opts = Electron.Opts;
22129 type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
22130 type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
22131 type Parameters = Electron.Parameters;
22132 type Payment = Electron.Payment;
22133 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
22134 type PluginCrashedEvent = Electron.PluginCrashedEvent;
22135 type PopupOptions = Electron.PopupOptions;
22136 type PreconnectOptions = Electron.PreconnectOptions;
22137 type PrintToPDFOptions = Electron.PrintToPDFOptions;
22138 type Privileges = Electron.Privileges;
22139 type ProgressBarOptions = Electron.ProgressBarOptions;
22140 type Provider = Electron.Provider;
22141 type PurchaseProductOpts = Electron.PurchaseProductOpts;
22142 type ReadBookmark = Electron.ReadBookmark;
22143 type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
22144 type RelaunchOptions = Electron.RelaunchOptions;
22145 type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
22146 type Request = Electron.Request;
22147 type ResizeOptions = Electron.ResizeOptions;
22148 type ResolveHostOptions = Electron.ResolveHostOptions;
22149 type ResourceUsage = Electron.ResourceUsage;
22150 type Response = Electron.Response;
22151 type Result = Electron.Result;
22152 type SaveDialogOptions = Electron.SaveDialogOptions;
22153 type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
22154 type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
22155 type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
22156 type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
22157 type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
22158 type Settings = Electron.Settings;
22159 type SourcesOptions = Electron.SourcesOptions;
22160 type StartLoggingOptions = Electron.StartLoggingOptions;
22161 type Streams = Electron.Streams;
22162 type SystemMemoryInfo = Electron.SystemMemoryInfo;
22163 type TitleBarOverlay = Electron.TitleBarOverlay;
22164 type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
22165 type TitleOptions = Electron.TitleOptions;
22166 type ToBitmapOptions = Electron.ToBitmapOptions;
22167 type ToDataURLOptions = Electron.ToDataURLOptions;
22168 type ToPNGOptions = Electron.ToPNGOptions;
22169 type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
22170 type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
22171 type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
22172 type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
22173 type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
22174 type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
22175 type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
22176 type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
22177 type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
22178 type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
22179 type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
22180 type UdpPortRange = Electron.UdpPortRange;
22181 type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
22182 type UploadProgress = Electron.UploadProgress;
22183 type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
22184 type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
22185 type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
22186 type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
22187 type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
22188 type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
22189 type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
22190 type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
22191 type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
22192 type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
22193 type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
22194 type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
22195 type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
22196 type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
22197 type WillNavigateEvent = Electron.WillNavigateEvent;
22198 type WillResizeDetails = Electron.WillResizeDetails;
22199 type EditFlags = Electron.EditFlags;
22200 type Env = Electron.Env;
22201 type FoundInPageResult = Electron.FoundInPageResult;
22202 type LaunchItems = Electron.LaunchItems;
22203 type Margins = Electron.Margins;
22204 type MediaFlags = Electron.MediaFlags;
22205 type PageRanges = Electron.PageRanges;
22206 type Params = Electron.Params;
22207 type Video = Electron.Video;
22208 type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
22209 type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
22210 type BluetoothDevice = Electron.BluetoothDevice;
22211 type Certificate = Electron.Certificate;
22212 type CertificatePrincipal = Electron.CertificatePrincipal;
22213 type Cookie = Electron.Cookie;
22214 type CPUUsage = Electron.CPUUsage;
22215 type CrashReport = Electron.CrashReport;
22216 type CustomScheme = Electron.CustomScheme;
22217 type DesktopCapturerSource = Electron.DesktopCapturerSource;
22218 type Display = Electron.Display;
22219 type Extension = Electron.Extension;
22220 type ExtensionInfo = Electron.ExtensionInfo;
22221 type FileFilter = Electron.FileFilter;
22222 type FilePathWithHeaders = Electron.FilePathWithHeaders;
22223 type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
22224 type GPUFeatureStatus = Electron.GPUFeatureStatus;
22225 type HIDDevice = Electron.HIDDevice;
22226 type InputEvent = Electron.InputEvent;
22227 type IpcMainEvent = Electron.IpcMainEvent;
22228 type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
22229 type IpcRendererEvent = Electron.IpcRendererEvent;
22230 type JumpListCategory = Electron.JumpListCategory;
22231 type JumpListItem = Electron.JumpListItem;
22232 type KeyboardEvent = Electron.KeyboardEvent;
22233 type KeyboardInputEvent = Electron.KeyboardInputEvent;
22234 type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
22235 type MemoryInfo = Electron.MemoryInfo;
22236 type MemoryUsageDetails = Electron.MemoryUsageDetails;
22237 type MimeTypedBuffer = Electron.MimeTypedBuffer;
22238 type MouseInputEvent = Electron.MouseInputEvent;
22239 type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
22240 type NotificationAction = Electron.NotificationAction;
22241 type NotificationResponse = Electron.NotificationResponse;
22242 type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
22243 type PaymentDiscount = Electron.PaymentDiscount;
22244 type PermissionRequest = Electron.PermissionRequest;
22245 type Point = Electron.Point;
22246 type PostBody = Electron.PostBody;
22247 type PrinterInfo = Electron.PrinterInfo;
22248 type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
22249 type ProcessMetric = Electron.ProcessMetric;
22250 type Product = Electron.Product;
22251 type ProductDiscount = Electron.ProductDiscount;
22252 type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
22253 type ProtocolRequest = Electron.ProtocolRequest;
22254 type ProtocolResponse = Electron.ProtocolResponse;
22255 type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
22256 type ProxyConfig = Electron.ProxyConfig;
22257 type Rectangle = Electron.Rectangle;
22258 type Referrer = Electron.Referrer;
22259 type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
22260 type ResolvedEndpoint = Electron.ResolvedEndpoint;
22261 type ResolvedHost = Electron.ResolvedHost;
22262 type ScrubberItem = Electron.ScrubberItem;
22263 type SegmentedControlSegment = Electron.SegmentedControlSegment;
22264 type SerialPort = Electron.SerialPort;
22265 type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
22266 type SharedWorkerInfo = Electron.SharedWorkerInfo;
22267 type SharingItem = Electron.SharingItem;
22268 type ShortcutDetails = Electron.ShortcutDetails;
22269 type Size = Electron.Size;
22270 type Task = Electron.Task;
22271 type ThumbarButton = Electron.ThumbarButton;
22272 type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
22273 type TraceConfig = Electron.TraceConfig;
22274 type Transaction = Electron.Transaction;
22275 type UploadData = Electron.UploadData;
22276 type UploadFile = Electron.UploadFile;
22277 type UploadRawData = Electron.UploadRawData;
22278 type USBDevice = Electron.USBDevice;
22279 type UserDefaultTypes = Electron.UserDefaultTypes;
22280 type WebPreferences = Electron.WebPreferences;
22281 type WebRequestFilter = Electron.WebRequestFilter;
22282 type WebSource = Electron.WebSource;
22283 }
22284
22285 namespace Renderer {
22286 type Event<Params extends object = {}> = Electron.Event<Params>;
22287 const contextBridge: ContextBridge;
22288 type ContextBridge = Electron.ContextBridge;
22289 const ipcRenderer: IpcRenderer;
22290 type IpcRenderer = Electron.IpcRenderer;
22291 const webFrame: WebFrame;
22292 type WebFrame = Electron.WebFrame;
22293 const webUtils: WebUtils;
22294 type WebUtils = Electron.WebUtils;
22295 type WebviewTag = Electron.WebviewTag;
22296 type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
22297 type AddRepresentationOptions = Electron.AddRepresentationOptions;
22298 type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
22299 type AnimationSettings = Electron.AnimationSettings;
22300 type AppDetailsOptions = Electron.AppDetailsOptions;
22301 type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
22302 type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
22303 type AuthInfo = Electron.AuthInfo;
22304 type AutoResizeOptions = Electron.AutoResizeOptions;
22305 type BeforeSendResponse = Electron.BeforeSendResponse;
22306 type BitmapOptions = Electron.BitmapOptions;
22307 type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
22308 type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
22309 type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
22310 type CallbackResponse = Electron.CallbackResponse;
22311 type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
22312 type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
22313 type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
22314 type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
22315 type CloseOpts = Electron.CloseOpts;
22316 type Config = Electron.Config;
22317 type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
22318 type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
22319 type ContextMenuEvent = Electron.ContextMenuEvent;
22320 type ContextMenuParams = Electron.ContextMenuParams;
22321 type ContinueActivityDetails = Electron.ContinueActivityDetails;
22322 type CookiesGetFilter = Electron.CookiesGetFilter;
22323 type CookiesSetDetails = Electron.CookiesSetDetails;
22324 type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
22325 type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
22326 type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
22327 type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
22328 type Data = Electron.Data;
22329 type DefaultFontFamily = Electron.DefaultFontFamily;
22330 type Details = Electron.Details;
22331 type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
22332 type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
22333 type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
22334 type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
22335 type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
22336 type DidFailLoadEvent = Electron.DidFailLoadEvent;
22337 type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
22338 type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
22339 type DidNavigateEvent = Electron.DidNavigateEvent;
22340 type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
22341 type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
22342 type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
22343 type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
22344 type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
22345 type DownloadURLOptions = Electron.DownloadURLOptions;
22346 type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
22347 type EntryAtIndex = Electron.EntryAtIndex;
22348 type FeedURLOptions = Electron.FeedURLOptions;
22349 type FileIconOptions = Electron.FileIconOptions;
22350 type FindInPageOptions = Electron.FindInPageOptions;
22351 type FocusOptions = Electron.FocusOptions;
22352 type ForkOptions = Electron.ForkOptions;
22353 type FoundInPageEvent = Electron.FoundInPageEvent;
22354 type FrameCreatedDetails = Electron.FrameCreatedDetails;
22355 type FromPartitionOptions = Electron.FromPartitionOptions;
22356 type FromPathOptions = Electron.FromPathOptions;
22357 type HandlerDetails = Electron.HandlerDetails;
22358 type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
22359 type HeapStatistics = Electron.HeapStatistics;
22360 type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
22361 type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
22362 type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
22363 type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
22364 type ImportCertificateOptions = Electron.ImportCertificateOptions;
22365 type Info = Electron.Info;
22366 type Input = Electron.Input;
22367 type InsertCSSOptions = Electron.InsertCSSOptions;
22368 type IpcMessageEvent = Electron.IpcMessageEvent;
22369 type Item = Electron.Item;
22370 type JumpListSettings = Electron.JumpListSettings;
22371 type LoadCommitEvent = Electron.LoadCommitEvent;
22372 type LoadExtensionOptions = Electron.LoadExtensionOptions;
22373 type LoadFileOptions = Electron.LoadFileOptions;
22374 type LoadURLOptions = Electron.LoadURLOptions;
22375 type LoginItemSettings = Electron.LoginItemSettings;
22376 type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
22377 type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
22378 type MessageBoxOptions = Electron.MessageBoxOptions;
22379 type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
22380 type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
22381 type MessageDetails = Electron.MessageDetails;
22382 type MessageEvent = Electron.MessageEvent;
22383 type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
22384 type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
22385 type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
22386 type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
22387 type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
22388 type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
22389 type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
22390 type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
22391 type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
22392 type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
22393 type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
22394 type OpenDialogOptions = Electron.OpenDialogOptions;
22395 type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
22396 type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
22397 type OpenExternalOptions = Electron.OpenExternalOptions;
22398 type Options = Electron.Options;
22399 type Opts = Electron.Opts;
22400 type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
22401 type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
22402 type Parameters = Electron.Parameters;
22403 type Payment = Electron.Payment;
22404 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
22405 type PluginCrashedEvent = Electron.PluginCrashedEvent;
22406 type PopupOptions = Electron.PopupOptions;
22407 type PreconnectOptions = Electron.PreconnectOptions;
22408 type PrintToPDFOptions = Electron.PrintToPDFOptions;
22409 type Privileges = Electron.Privileges;
22410 type ProgressBarOptions = Electron.ProgressBarOptions;
22411 type Provider = Electron.Provider;
22412 type PurchaseProductOpts = Electron.PurchaseProductOpts;
22413 type ReadBookmark = Electron.ReadBookmark;
22414 type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
22415 type RelaunchOptions = Electron.RelaunchOptions;
22416 type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
22417 type Request = Electron.Request;
22418 type ResizeOptions = Electron.ResizeOptions;
22419 type ResolveHostOptions = Electron.ResolveHostOptions;
22420 type ResourceUsage = Electron.ResourceUsage;
22421 type Response = Electron.Response;
22422 type Result = Electron.Result;
22423 type SaveDialogOptions = Electron.SaveDialogOptions;
22424 type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
22425 type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
22426 type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
22427 type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
22428 type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
22429 type Settings = Electron.Settings;
22430 type SourcesOptions = Electron.SourcesOptions;
22431 type StartLoggingOptions = Electron.StartLoggingOptions;
22432 type Streams = Electron.Streams;
22433 type SystemMemoryInfo = Electron.SystemMemoryInfo;
22434 type TitleBarOverlay = Electron.TitleBarOverlay;
22435 type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
22436 type TitleOptions = Electron.TitleOptions;
22437 type ToBitmapOptions = Electron.ToBitmapOptions;
22438 type ToDataURLOptions = Electron.ToDataURLOptions;
22439 type ToPNGOptions = Electron.ToPNGOptions;
22440 type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
22441 type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
22442 type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
22443 type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
22444 type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
22445 type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
22446 type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
22447 type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
22448 type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
22449 type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
22450 type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
22451 type UdpPortRange = Electron.UdpPortRange;
22452 type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
22453 type UploadProgress = Electron.UploadProgress;
22454 type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
22455 type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
22456 type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
22457 type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
22458 type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
22459 type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
22460 type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
22461 type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
22462 type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
22463 type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
22464 type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
22465 type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
22466 type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
22467 type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
22468 type WillNavigateEvent = Electron.WillNavigateEvent;
22469 type WillResizeDetails = Electron.WillResizeDetails;
22470 type EditFlags = Electron.EditFlags;
22471 type Env = Electron.Env;
22472 type FoundInPageResult = Electron.FoundInPageResult;
22473 type LaunchItems = Electron.LaunchItems;
22474 type Margins = Electron.Margins;
22475 type MediaFlags = Electron.MediaFlags;
22476 type PageRanges = Electron.PageRanges;
22477 type Params = Electron.Params;
22478 type Video = Electron.Video;
22479 type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
22480 type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
22481 type BluetoothDevice = Electron.BluetoothDevice;
22482 type Certificate = Electron.Certificate;
22483 type CertificatePrincipal = Electron.CertificatePrincipal;
22484 type Cookie = Electron.Cookie;
22485 type CPUUsage = Electron.CPUUsage;
22486 type CrashReport = Electron.CrashReport;
22487 type CustomScheme = Electron.CustomScheme;
22488 type DesktopCapturerSource = Electron.DesktopCapturerSource;
22489 type Display = Electron.Display;
22490 type Extension = Electron.Extension;
22491 type ExtensionInfo = Electron.ExtensionInfo;
22492 type FileFilter = Electron.FileFilter;
22493 type FilePathWithHeaders = Electron.FilePathWithHeaders;
22494 type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
22495 type GPUFeatureStatus = Electron.GPUFeatureStatus;
22496 type HIDDevice = Electron.HIDDevice;
22497 type InputEvent = Electron.InputEvent;
22498 type IpcMainEvent = Electron.IpcMainEvent;
22499 type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
22500 type IpcRendererEvent = Electron.IpcRendererEvent;
22501 type JumpListCategory = Electron.JumpListCategory;
22502 type JumpListItem = Electron.JumpListItem;
22503 type KeyboardEvent = Electron.KeyboardEvent;
22504 type KeyboardInputEvent = Electron.KeyboardInputEvent;
22505 type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
22506 type MemoryInfo = Electron.MemoryInfo;
22507 type MemoryUsageDetails = Electron.MemoryUsageDetails;
22508 type MimeTypedBuffer = Electron.MimeTypedBuffer;
22509 type MouseInputEvent = Electron.MouseInputEvent;
22510 type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
22511 type NotificationAction = Electron.NotificationAction;
22512 type NotificationResponse = Electron.NotificationResponse;
22513 type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
22514 type PaymentDiscount = Electron.PaymentDiscount;
22515 type PermissionRequest = Electron.PermissionRequest;
22516 type Point = Electron.Point;
22517 type PostBody = Electron.PostBody;
22518 type PrinterInfo = Electron.PrinterInfo;
22519 type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
22520 type ProcessMetric = Electron.ProcessMetric;
22521 type Product = Electron.Product;
22522 type ProductDiscount = Electron.ProductDiscount;
22523 type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
22524 type ProtocolRequest = Electron.ProtocolRequest;
22525 type ProtocolResponse = Electron.ProtocolResponse;
22526 type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
22527 type ProxyConfig = Electron.ProxyConfig;
22528 type Rectangle = Electron.Rectangle;
22529 type Referrer = Electron.Referrer;
22530 type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
22531 type ResolvedEndpoint = Electron.ResolvedEndpoint;
22532 type ResolvedHost = Electron.ResolvedHost;
22533 type ScrubberItem = Electron.ScrubberItem;
22534 type SegmentedControlSegment = Electron.SegmentedControlSegment;
22535 type SerialPort = Electron.SerialPort;
22536 type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
22537 type SharedWorkerInfo = Electron.SharedWorkerInfo;
22538 type SharingItem = Electron.SharingItem;
22539 type ShortcutDetails = Electron.ShortcutDetails;
22540 type Size = Electron.Size;
22541 type Task = Electron.Task;
22542 type ThumbarButton = Electron.ThumbarButton;
22543 type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
22544 type TraceConfig = Electron.TraceConfig;
22545 type Transaction = Electron.Transaction;
22546 type UploadData = Electron.UploadData;
22547 type UploadFile = Electron.UploadFile;
22548 type UploadRawData = Electron.UploadRawData;
22549 type USBDevice = Electron.USBDevice;
22550 type UserDefaultTypes = Electron.UserDefaultTypes;
22551 type WebPreferences = Electron.WebPreferences;
22552 type WebRequestFilter = Electron.WebRequestFilter;
22553 type WebSource = Electron.WebSource;
22554 }
22555
22556 namespace Utility {
22557 type Event<Params extends object = {}> = Electron.Event<Params>;
22558 type ClientRequest = Electron.ClientRequest;
22559 type IncomingMessage = Electron.IncomingMessage;
22560 const net: Net;
22561 type Net = Electron.Net;
22562 type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
22563 type AddRepresentationOptions = Electron.AddRepresentationOptions;
22564 type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
22565 type AnimationSettings = Electron.AnimationSettings;
22566 type AppDetailsOptions = Electron.AppDetailsOptions;
22567 type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
22568 type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
22569 type AuthInfo = Electron.AuthInfo;
22570 type AutoResizeOptions = Electron.AutoResizeOptions;
22571 type BeforeSendResponse = Electron.BeforeSendResponse;
22572 type BitmapOptions = Electron.BitmapOptions;
22573 type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
22574 type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
22575 type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
22576 type CallbackResponse = Electron.CallbackResponse;
22577 type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
22578 type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
22579 type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
22580 type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
22581 type CloseOpts = Electron.CloseOpts;
22582 type Config = Electron.Config;
22583 type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
22584 type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
22585 type ContextMenuEvent = Electron.ContextMenuEvent;
22586 type ContextMenuParams = Electron.ContextMenuParams;
22587 type ContinueActivityDetails = Electron.ContinueActivityDetails;
22588 type CookiesGetFilter = Electron.CookiesGetFilter;
22589 type CookiesSetDetails = Electron.CookiesSetDetails;
22590 type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
22591 type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
22592 type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
22593 type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
22594 type Data = Electron.Data;
22595 type DefaultFontFamily = Electron.DefaultFontFamily;
22596 type Details = Electron.Details;
22597 type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
22598 type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
22599 type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
22600 type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
22601 type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
22602 type DidFailLoadEvent = Electron.DidFailLoadEvent;
22603 type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
22604 type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
22605 type DidNavigateEvent = Electron.DidNavigateEvent;
22606 type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
22607 type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
22608 type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
22609 type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
22610 type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
22611 type DownloadURLOptions = Electron.DownloadURLOptions;
22612 type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
22613 type EntryAtIndex = Electron.EntryAtIndex;
22614 type FeedURLOptions = Electron.FeedURLOptions;
22615 type FileIconOptions = Electron.FileIconOptions;
22616 type FindInPageOptions = Electron.FindInPageOptions;
22617 type FocusOptions = Electron.FocusOptions;
22618 type ForkOptions = Electron.ForkOptions;
22619 type FoundInPageEvent = Electron.FoundInPageEvent;
22620 type FrameCreatedDetails = Electron.FrameCreatedDetails;
22621 type FromPartitionOptions = Electron.FromPartitionOptions;
22622 type FromPathOptions = Electron.FromPathOptions;
22623 type HandlerDetails = Electron.HandlerDetails;
22624 type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
22625 type HeapStatistics = Electron.HeapStatistics;
22626 type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
22627 type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
22628 type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
22629 type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
22630 type ImportCertificateOptions = Electron.ImportCertificateOptions;
22631 type Info = Electron.Info;
22632 type Input = Electron.Input;
22633 type InsertCSSOptions = Electron.InsertCSSOptions;
22634 type IpcMessageEvent = Electron.IpcMessageEvent;
22635 type Item = Electron.Item;
22636 type JumpListSettings = Electron.JumpListSettings;
22637 type LoadCommitEvent = Electron.LoadCommitEvent;
22638 type LoadExtensionOptions = Electron.LoadExtensionOptions;
22639 type LoadFileOptions = Electron.LoadFileOptions;
22640 type LoadURLOptions = Electron.LoadURLOptions;
22641 type LoginItemSettings = Electron.LoginItemSettings;
22642 type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
22643 type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
22644 type MessageBoxOptions = Electron.MessageBoxOptions;
22645 type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
22646 type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
22647 type MessageDetails = Electron.MessageDetails;
22648 type MessageEvent = Electron.MessageEvent;
22649 type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
22650 type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
22651 type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
22652 type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
22653 type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
22654 type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
22655 type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
22656 type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
22657 type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
22658 type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
22659 type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
22660 type OpenDialogOptions = Electron.OpenDialogOptions;
22661 type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
22662 type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
22663 type OpenExternalOptions = Electron.OpenExternalOptions;
22664 type Options = Electron.Options;
22665 type Opts = Electron.Opts;
22666 type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
22667 type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
22668 type Parameters = Electron.Parameters;
22669 type Payment = Electron.Payment;
22670 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
22671 type PluginCrashedEvent = Electron.PluginCrashedEvent;
22672 type PopupOptions = Electron.PopupOptions;
22673 type PreconnectOptions = Electron.PreconnectOptions;
22674 type PrintToPDFOptions = Electron.PrintToPDFOptions;
22675 type Privileges = Electron.Privileges;
22676 type ProgressBarOptions = Electron.ProgressBarOptions;
22677 type Provider = Electron.Provider;
22678 type PurchaseProductOpts = Electron.PurchaseProductOpts;
22679 type ReadBookmark = Electron.ReadBookmark;
22680 type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
22681 type RelaunchOptions = Electron.RelaunchOptions;
22682 type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
22683 type Request = Electron.Request;
22684 type ResizeOptions = Electron.ResizeOptions;
22685 type ResolveHostOptions = Electron.ResolveHostOptions;
22686 type ResourceUsage = Electron.ResourceUsage;
22687 type Response = Electron.Response;
22688 type Result = Electron.Result;
22689 type SaveDialogOptions = Electron.SaveDialogOptions;
22690 type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
22691 type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
22692 type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
22693 type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
22694 type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
22695 type Settings = Electron.Settings;
22696 type SourcesOptions = Electron.SourcesOptions;
22697 type StartLoggingOptions = Electron.StartLoggingOptions;
22698 type Streams = Electron.Streams;
22699 type SystemMemoryInfo = Electron.SystemMemoryInfo;
22700 type TitleBarOverlay = Electron.TitleBarOverlay;
22701 type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
22702 type TitleOptions = Electron.TitleOptions;
22703 type ToBitmapOptions = Electron.ToBitmapOptions;
22704 type ToDataURLOptions = Electron.ToDataURLOptions;
22705 type ToPNGOptions = Electron.ToPNGOptions;
22706 type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
22707 type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
22708 type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
22709 type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
22710 type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
22711 type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
22712 type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
22713 type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
22714 type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
22715 type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
22716 type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
22717 type UdpPortRange = Electron.UdpPortRange;
22718 type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
22719 type UploadProgress = Electron.UploadProgress;
22720 type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
22721 type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
22722 type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
22723 type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
22724 type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
22725 type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
22726 type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
22727 type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
22728 type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
22729 type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
22730 type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
22731 type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
22732 type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
22733 type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
22734 type WillNavigateEvent = Electron.WillNavigateEvent;
22735 type WillResizeDetails = Electron.WillResizeDetails;
22736 type EditFlags = Electron.EditFlags;
22737 type Env = Electron.Env;
22738 type FoundInPageResult = Electron.FoundInPageResult;
22739 type LaunchItems = Electron.LaunchItems;
22740 type Margins = Electron.Margins;
22741 type MediaFlags = Electron.MediaFlags;
22742 type PageRanges = Electron.PageRanges;
22743 type Params = Electron.Params;
22744 type Video = Electron.Video;
22745 type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
22746 type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
22747 type BluetoothDevice = Electron.BluetoothDevice;
22748 type Certificate = Electron.Certificate;
22749 type CertificatePrincipal = Electron.CertificatePrincipal;
22750 type Cookie = Electron.Cookie;
22751 type CPUUsage = Electron.CPUUsage;
22752 type CrashReport = Electron.CrashReport;
22753 type CustomScheme = Electron.CustomScheme;
22754 type DesktopCapturerSource = Electron.DesktopCapturerSource;
22755 type Display = Electron.Display;
22756 type Extension = Electron.Extension;
22757 type ExtensionInfo = Electron.ExtensionInfo;
22758 type FileFilter = Electron.FileFilter;
22759 type FilePathWithHeaders = Electron.FilePathWithHeaders;
22760 type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
22761 type GPUFeatureStatus = Electron.GPUFeatureStatus;
22762 type HIDDevice = Electron.HIDDevice;
22763 type InputEvent = Electron.InputEvent;
22764 type IpcMainEvent = Electron.IpcMainEvent;
22765 type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
22766 type IpcRendererEvent = Electron.IpcRendererEvent;
22767 type JumpListCategory = Electron.JumpListCategory;
22768 type JumpListItem = Electron.JumpListItem;
22769 type KeyboardEvent = Electron.KeyboardEvent;
22770 type KeyboardInputEvent = Electron.KeyboardInputEvent;
22771 type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
22772 type MemoryInfo = Electron.MemoryInfo;
22773 type MemoryUsageDetails = Electron.MemoryUsageDetails;
22774 type MimeTypedBuffer = Electron.MimeTypedBuffer;
22775 type MouseInputEvent = Electron.MouseInputEvent;
22776 type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
22777 type NotificationAction = Electron.NotificationAction;
22778 type NotificationResponse = Electron.NotificationResponse;
22779 type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
22780 type PaymentDiscount = Electron.PaymentDiscount;
22781 type PermissionRequest = Electron.PermissionRequest;
22782 type Point = Electron.Point;
22783 type PostBody = Electron.PostBody;
22784 type PrinterInfo = Electron.PrinterInfo;
22785 type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
22786 type ProcessMetric = Electron.ProcessMetric;
22787 type Product = Electron.Product;
22788 type ProductDiscount = Electron.ProductDiscount;
22789 type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
22790 type ProtocolRequest = Electron.ProtocolRequest;
22791 type ProtocolResponse = Electron.ProtocolResponse;
22792 type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
22793 type ProxyConfig = Electron.ProxyConfig;
22794 type Rectangle = Electron.Rectangle;
22795 type Referrer = Electron.Referrer;
22796 type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
22797 type ResolvedEndpoint = Electron.ResolvedEndpoint;
22798 type ResolvedHost = Electron.ResolvedHost;
22799 type ScrubberItem = Electron.ScrubberItem;
22800 type SegmentedControlSegment = Electron.SegmentedControlSegment;
22801 type SerialPort = Electron.SerialPort;
22802 type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
22803 type SharedWorkerInfo = Electron.SharedWorkerInfo;
22804 type SharingItem = Electron.SharingItem;
22805 type ShortcutDetails = Electron.ShortcutDetails;
22806 type Size = Electron.Size;
22807 type Task = Electron.Task;
22808 type ThumbarButton = Electron.ThumbarButton;
22809 type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
22810 type TraceConfig = Electron.TraceConfig;
22811 type Transaction = Electron.Transaction;
22812 type UploadData = Electron.UploadData;
22813 type UploadFile = Electron.UploadFile;
22814 type UploadRawData = Electron.UploadRawData;
22815 type USBDevice = Electron.USBDevice;
22816 type UserDefaultTypes = Electron.UserDefaultTypes;
22817 type WebPreferences = Electron.WebPreferences;
22818 type WebRequestFilter = Electron.WebRequestFilter;
22819 type WebSource = Electron.WebSource;
22820 }
22821
22822 namespace CrossProcessExports {
22823 type Event<Params extends object = {}> = Electron.Event<Params>;
22824 const app: App;
22825 type App = Electron.App;
22826 const autoUpdater: AutoUpdater;
22827 type AutoUpdater = Electron.AutoUpdater;
22828 class BaseWindow extends Electron.BaseWindow {}
22829 class BrowserView extends Electron.BrowserView {}
22830 class BrowserWindow extends Electron.BrowserWindow {}
22831 type ClientRequest = Electron.ClientRequest;
22832 const clipboard: Clipboard;
22833 type Clipboard = Electron.Clipboard;
22834 type CommandLine = Electron.CommandLine;
22835 const contentTracing: ContentTracing;
22836 type ContentTracing = Electron.ContentTracing;
22837 const contextBridge: ContextBridge;
22838 type ContextBridge = Electron.ContextBridge;
22839 type Cookies = Electron.Cookies;
22840 const crashReporter: CrashReporter;
22841 type CrashReporter = Electron.CrashReporter;
22842 type Debugger = Electron.Debugger;
22843 const desktopCapturer: DesktopCapturer;
22844 type DesktopCapturer = Electron.DesktopCapturer;
22845 const dialog: Dialog;
22846 type Dialog = Electron.Dialog;
22847 type Dock = Electron.Dock;
22848 type DownloadItem = Electron.DownloadItem;
22849 const globalShortcut: GlobalShortcut;
22850 type GlobalShortcut = Electron.GlobalShortcut;
22851 const inAppPurchase: InAppPurchase;
22852 type InAppPurchase = Electron.InAppPurchase;
22853 type IncomingMessage = Electron.IncomingMessage;
22854 const ipcMain: IpcMain;
22855 type IpcMain = Electron.IpcMain;
22856 const ipcRenderer: IpcRenderer;
22857 type IpcRenderer = Electron.IpcRenderer;
22858 class Menu extends Electron.Menu {}
22859 class MenuItem extends Electron.MenuItem {}
22860 class MessageChannelMain extends Electron.MessageChannelMain {}
22861 type MessagePortMain = Electron.MessagePortMain;
22862 const nativeImage: typeof NativeImage;
22863 type NativeImage = Electron.NativeImage;
22864 const nativeTheme: NativeTheme;
22865 type NativeTheme = Electron.NativeTheme;
22866 type NavigationHistory = Electron.NavigationHistory;
22867 const net: Net;
22868 type Net = Electron.Net;
22869 const netLog: NetLog;
22870 type NetLog = Electron.NetLog;
22871 class Notification extends Electron.Notification {}
22872 const powerMonitor: PowerMonitor;
22873 type PowerMonitor = Electron.PowerMonitor;
22874 const powerSaveBlocker: PowerSaveBlocker;
22875 type PowerSaveBlocker = Electron.PowerSaveBlocker;
22876 const protocol: Protocol;
22877 type Protocol = Electron.Protocol;
22878 const pushNotifications: PushNotifications;
22879 type PushNotifications = Electron.PushNotifications;
22880 const safeStorage: SafeStorage;
22881 type SafeStorage = Electron.SafeStorage;
22882 const screen: Screen;
22883 type Screen = Electron.Screen;
22884 type ServiceWorkers = Electron.ServiceWorkers;
22885 const session: typeof Session;
22886 type Session = Electron.Session;
22887 class ShareMenu extends Electron.ShareMenu {}
22888 const shell: Shell;
22889 type Shell = Electron.Shell;
22890 const systemPreferences: SystemPreferences;
22891 type SystemPreferences = Electron.SystemPreferences;
22892 class TouchBar extends Electron.TouchBar {}
22893 type TouchBarButton = Electron.TouchBarButton;
22894 type TouchBarColorPicker = Electron.TouchBarColorPicker;
22895 type TouchBarGroup = Electron.TouchBarGroup;
22896 type TouchBarLabel = Electron.TouchBarLabel;
22897 type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
22898 type TouchBarPopover = Electron.TouchBarPopover;
22899 type TouchBarScrubber = Electron.TouchBarScrubber;
22900 type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
22901 type TouchBarSlider = Electron.TouchBarSlider;
22902 type TouchBarSpacer = Electron.TouchBarSpacer;
22903 class Tray extends Electron.Tray {}
22904 const utilityProcess: typeof UtilityProcess;
22905 type UtilityProcess = Electron.UtilityProcess;
22906 class View extends Electron.View {}
22907 const webContents: typeof WebContents;
22908 type WebContents = Electron.WebContents;
22909 class WebContentsView extends Electron.WebContentsView {}
22910 const webFrame: WebFrame;
22911 type WebFrame = Electron.WebFrame;
22912 const webFrameMain: typeof WebFrameMain;
22913 type WebFrameMain = Electron.WebFrameMain;
22914 type WebRequest = Electron.WebRequest;
22915 const webUtils: WebUtils;
22916 type WebUtils = Electron.WebUtils;
22917 type WebviewTag = Electron.WebviewTag;
22918 type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
22919 type AddRepresentationOptions = Electron.AddRepresentationOptions;
22920 type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
22921 type AnimationSettings = Electron.AnimationSettings;
22922 type AppDetailsOptions = Electron.AppDetailsOptions;
22923 type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
22924 type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
22925 type AuthInfo = Electron.AuthInfo;
22926 type AutoResizeOptions = Electron.AutoResizeOptions;
22927 type BeforeSendResponse = Electron.BeforeSendResponse;
22928 type BitmapOptions = Electron.BitmapOptions;
22929 type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
22930 type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
22931 type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
22932 type CallbackResponse = Electron.CallbackResponse;
22933 type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
22934 type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
22935 type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
22936 type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
22937 type CloseOpts = Electron.CloseOpts;
22938 type Config = Electron.Config;
22939 type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
22940 type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
22941 type ContextMenuEvent = Electron.ContextMenuEvent;
22942 type ContextMenuParams = Electron.ContextMenuParams;
22943 type ContinueActivityDetails = Electron.ContinueActivityDetails;
22944 type CookiesGetFilter = Electron.CookiesGetFilter;
22945 type CookiesSetDetails = Electron.CookiesSetDetails;
22946 type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
22947 type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
22948 type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
22949 type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
22950 type Data = Electron.Data;
22951 type DefaultFontFamily = Electron.DefaultFontFamily;
22952 type Details = Electron.Details;
22953 type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
22954 type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
22955 type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
22956 type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
22957 type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
22958 type DidFailLoadEvent = Electron.DidFailLoadEvent;
22959 type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
22960 type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
22961 type DidNavigateEvent = Electron.DidNavigateEvent;
22962 type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
22963 type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
22964 type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
22965 type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
22966 type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
22967 type DownloadURLOptions = Electron.DownloadURLOptions;
22968 type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
22969 type EntryAtIndex = Electron.EntryAtIndex;
22970 type FeedURLOptions = Electron.FeedURLOptions;
22971 type FileIconOptions = Electron.FileIconOptions;
22972 type FindInPageOptions = Electron.FindInPageOptions;
22973 type FocusOptions = Electron.FocusOptions;
22974 type ForkOptions = Electron.ForkOptions;
22975 type FoundInPageEvent = Electron.FoundInPageEvent;
22976 type FrameCreatedDetails = Electron.FrameCreatedDetails;
22977 type FromPartitionOptions = Electron.FromPartitionOptions;
22978 type FromPathOptions = Electron.FromPathOptions;
22979 type HandlerDetails = Electron.HandlerDetails;
22980 type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
22981 type HeapStatistics = Electron.HeapStatistics;
22982 type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
22983 type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
22984 type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
22985 type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
22986 type ImportCertificateOptions = Electron.ImportCertificateOptions;
22987 type Info = Electron.Info;
22988 type Input = Electron.Input;
22989 type InsertCSSOptions = Electron.InsertCSSOptions;
22990 type IpcMessageEvent = Electron.IpcMessageEvent;
22991 type Item = Electron.Item;
22992 type JumpListSettings = Electron.JumpListSettings;
22993 type LoadCommitEvent = Electron.LoadCommitEvent;
22994 type LoadExtensionOptions = Electron.LoadExtensionOptions;
22995 type LoadFileOptions = Electron.LoadFileOptions;
22996 type LoadURLOptions = Electron.LoadURLOptions;
22997 type LoginItemSettings = Electron.LoginItemSettings;
22998 type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
22999 type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
23000 type MessageBoxOptions = Electron.MessageBoxOptions;
23001 type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
23002 type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
23003 type MessageDetails = Electron.MessageDetails;
23004 type MessageEvent = Electron.MessageEvent;
23005 type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
23006 type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
23007 type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
23008 type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
23009 type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
23010 type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
23011 type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
23012 type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
23013 type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
23014 type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
23015 type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
23016 type OpenDialogOptions = Electron.OpenDialogOptions;
23017 type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
23018 type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
23019 type OpenExternalOptions = Electron.OpenExternalOptions;
23020 type Options = Electron.Options;
23021 type Opts = Electron.Opts;
23022 type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
23023 type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
23024 type Parameters = Electron.Parameters;
23025 type Payment = Electron.Payment;
23026 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
23027 type PluginCrashedEvent = Electron.PluginCrashedEvent;
23028 type PopupOptions = Electron.PopupOptions;
23029 type PreconnectOptions = Electron.PreconnectOptions;
23030 type PrintToPDFOptions = Electron.PrintToPDFOptions;
23031 type Privileges = Electron.Privileges;
23032 type ProgressBarOptions = Electron.ProgressBarOptions;
23033 type Provider = Electron.Provider;
23034 type PurchaseProductOpts = Electron.PurchaseProductOpts;
23035 type ReadBookmark = Electron.ReadBookmark;
23036 type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
23037 type RelaunchOptions = Electron.RelaunchOptions;
23038 type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
23039 type Request = Electron.Request;
23040 type ResizeOptions = Electron.ResizeOptions;
23041 type ResolveHostOptions = Electron.ResolveHostOptions;
23042 type ResourceUsage = Electron.ResourceUsage;
23043 type Response = Electron.Response;
23044 type Result = Electron.Result;
23045 type SaveDialogOptions = Electron.SaveDialogOptions;
23046 type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
23047 type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
23048 type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
23049 type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
23050 type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
23051 type Settings = Electron.Settings;
23052 type SourcesOptions = Electron.SourcesOptions;
23053 type StartLoggingOptions = Electron.StartLoggingOptions;
23054 type Streams = Electron.Streams;
23055 type SystemMemoryInfo = Electron.SystemMemoryInfo;
23056 type TitleBarOverlay = Electron.TitleBarOverlay;
23057 type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
23058 type TitleOptions = Electron.TitleOptions;
23059 type ToBitmapOptions = Electron.ToBitmapOptions;
23060 type ToDataURLOptions = Electron.ToDataURLOptions;
23061 type ToPNGOptions = Electron.ToPNGOptions;
23062 type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
23063 type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
23064 type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
23065 type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
23066 type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
23067 type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
23068 type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
23069 type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
23070 type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
23071 type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
23072 type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
23073 type UdpPortRange = Electron.UdpPortRange;
23074 type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
23075 type UploadProgress = Electron.UploadProgress;
23076 type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
23077 type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
23078 type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
23079 type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
23080 type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
23081 type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
23082 type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
23083 type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
23084 type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
23085 type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
23086 type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
23087 type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
23088 type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
23089 type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
23090 type WillNavigateEvent = Electron.WillNavigateEvent;
23091 type WillResizeDetails = Electron.WillResizeDetails;
23092 type EditFlags = Electron.EditFlags;
23093 type Env = Electron.Env;
23094 type FoundInPageResult = Electron.FoundInPageResult;
23095 type LaunchItems = Electron.LaunchItems;
23096 type Margins = Electron.Margins;
23097 type MediaFlags = Electron.MediaFlags;
23098 type PageRanges = Electron.PageRanges;
23099 type Params = Electron.Params;
23100 type Video = Electron.Video;
23101 type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
23102 type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
23103 type BluetoothDevice = Electron.BluetoothDevice;
23104 type Certificate = Electron.Certificate;
23105 type CertificatePrincipal = Electron.CertificatePrincipal;
23106 type Cookie = Electron.Cookie;
23107 type CPUUsage = Electron.CPUUsage;
23108 type CrashReport = Electron.CrashReport;
23109 type CustomScheme = Electron.CustomScheme;
23110 type DesktopCapturerSource = Electron.DesktopCapturerSource;
23111 type Display = Electron.Display;
23112 type Extension = Electron.Extension;
23113 type ExtensionInfo = Electron.ExtensionInfo;
23114 type FileFilter = Electron.FileFilter;
23115 type FilePathWithHeaders = Electron.FilePathWithHeaders;
23116 type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
23117 type GPUFeatureStatus = Electron.GPUFeatureStatus;
23118 type HIDDevice = Electron.HIDDevice;
23119 type InputEvent = Electron.InputEvent;
23120 type IpcMainEvent = Electron.IpcMainEvent;
23121 type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
23122 type IpcRendererEvent = Electron.IpcRendererEvent;
23123 type JumpListCategory = Electron.JumpListCategory;
23124 type JumpListItem = Electron.JumpListItem;
23125 type KeyboardEvent = Electron.KeyboardEvent;
23126 type KeyboardInputEvent = Electron.KeyboardInputEvent;
23127 type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
23128 type MemoryInfo = Electron.MemoryInfo;
23129 type MemoryUsageDetails = Electron.MemoryUsageDetails;
23130 type MimeTypedBuffer = Electron.MimeTypedBuffer;
23131 type MouseInputEvent = Electron.MouseInputEvent;
23132 type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
23133 type NotificationAction = Electron.NotificationAction;
23134 type NotificationResponse = Electron.NotificationResponse;
23135 type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
23136 type PaymentDiscount = Electron.PaymentDiscount;
23137 type PermissionRequest = Electron.PermissionRequest;
23138 type Point = Electron.Point;
23139 type PostBody = Electron.PostBody;
23140 type PrinterInfo = Electron.PrinterInfo;
23141 type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
23142 type ProcessMetric = Electron.ProcessMetric;
23143 type Product = Electron.Product;
23144 type ProductDiscount = Electron.ProductDiscount;
23145 type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
23146 type ProtocolRequest = Electron.ProtocolRequest;
23147 type ProtocolResponse = Electron.ProtocolResponse;
23148 type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
23149 type ProxyConfig = Electron.ProxyConfig;
23150 type Rectangle = Electron.Rectangle;
23151 type Referrer = Electron.Referrer;
23152 type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
23153 type ResolvedEndpoint = Electron.ResolvedEndpoint;
23154 type ResolvedHost = Electron.ResolvedHost;
23155 type ScrubberItem = Electron.ScrubberItem;
23156 type SegmentedControlSegment = Electron.SegmentedControlSegment;
23157 type SerialPort = Electron.SerialPort;
23158 type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
23159 type SharedWorkerInfo = Electron.SharedWorkerInfo;
23160 type SharingItem = Electron.SharingItem;
23161 type ShortcutDetails = Electron.ShortcutDetails;
23162 type Size = Electron.Size;
23163 type Task = Electron.Task;
23164 type ThumbarButton = Electron.ThumbarButton;
23165 type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
23166 type TraceConfig = Electron.TraceConfig;
23167 type Transaction = Electron.Transaction;
23168 type UploadData = Electron.UploadData;
23169 type UploadFile = Electron.UploadFile;
23170 type UploadRawData = Electron.UploadRawData;
23171 type USBDevice = Electron.USBDevice;
23172 type UserDefaultTypes = Electron.UserDefaultTypes;
23173 type WebPreferences = Electron.WebPreferences;
23174 type WebRequestFilter = Electron.WebRequestFilter;
23175 type WebSource = Electron.WebSource;
23176 }
23177
23178 const app: App;
23179 const autoUpdater: AutoUpdater;
23180 const clipboard: Clipboard;
23181 const contentTracing: ContentTracing;
23182 const contextBridge: ContextBridge;
23183 const crashReporter: CrashReporter;
23184 const desktopCapturer: DesktopCapturer;
23185 const dialog: Dialog;
23186 const globalShortcut: GlobalShortcut;
23187 const inAppPurchase: InAppPurchase;
23188 const ipcMain: IpcMain;
23189 const ipcRenderer: IpcRenderer;
23190 const nativeImage: typeof NativeImage;
23191 const nativeTheme: NativeTheme;
23192 const net: Net;
23193 const netLog: NetLog;
23194 const parentPort: ParentPort;
23195 const powerMonitor: PowerMonitor;
23196 const powerSaveBlocker: PowerSaveBlocker;
23197 const protocol: Protocol;
23198 const pushNotifications: PushNotifications;
23199 const safeStorage: SafeStorage;
23200 const screen: Screen;
23201 const session: typeof Session;
23202 const shell: Shell;
23203 const systemPreferences: SystemPreferences;
23204 const utilityProcess: typeof UtilityProcess;
23205 const webContents: typeof WebContents;
23206 const webFrame: WebFrame;
23207 const webFrameMain: typeof WebFrameMain;
23208 const webUtils: WebUtils;
23209
23210}
23211
23212declare module 'electron' {
23213 export = Electron.CrossProcessExports;
23214}
23215
23216declare module 'electron/main' {
23217 export = Electron.Main;
23218}
23219
23220declare module 'electron/common' {
23221 export = Electron.Common;
23222}
23223
23224declare module 'electron/renderer' {
23225 export = Electron.Renderer;
23226}
23227
23228declare module 'electron/utility' {
23229 export = Electron.Utility;
23230}
23231
23232interface NodeRequireFunction {
23233 (moduleName: 'electron'): typeof Electron.CrossProcessExports;
23234 (moduleName: 'electron/main'): typeof Electron.Main;
23235 (moduleName: 'electron/common'): typeof Electron.Common;
23236 (moduleName: 'electron/renderer'): typeof Electron.Renderer;
23237 (moduleName: 'electron/utility'): typeof Electron.Utility;
23238}
23239
23240interface NodeRequire {
23241 (moduleName: 'electron'): typeof Electron.CrossProcessExports;
23242 (moduleName: 'electron/main'): typeof Electron.Main;
23243 (moduleName: 'electron/common'): typeof Electron.Common;
23244 (moduleName: 'electron/renderer'): typeof Electron.Renderer;
23245 (moduleName: 'electron/utility'): typeof Electron.Utility;
23246}
23247
23248interface File {
23249 /**
23250 * The real path to the file on the users filesystem
23251 */
23252 path: string;
23253}
23254
23255declare module 'original-fs' {
23256 import * as fs from 'fs';
23257 export = fs;
23258}
23259
23260declare module 'node:original-fs' {
23261 import * as fs from 'fs';
23262 export = fs;
23263}
23264
23265interface Document {
23266 createElement(tagName: 'webview'): Electron.WebviewTag;
23267}
23268
23269
23270declare namespace NodeJS {
23271 interface Process extends NodeJS.EventEmitter {
23272
23273 // Docs: https://electronjs.org/docs/api/process
23274
23275 /**
23276 * Emitted when Electron has loaded its internal initialization script and is
23277 * beginning to load the web page or the main script.
23278 */
23279 on(event: 'loaded', listener: Function): this;
23280 off(event: 'loaded', listener: Function): this;
23281 once(event: 'loaded', listener: Function): this;
23282 addListener(event: 'loaded', listener: Function): this;
23283 removeListener(event: 'loaded', listener: Function): this;
23284 /**
23285 * Causes the main thread of the current process crash.
23286 */
23287 crash(): void;
23288 /**
23289 * * `allocated` Integer - Size of all allocated objects in Kilobytes.
23290 * * `total` Integer - Total allocated space in Kilobytes.
23291 *
23292 * Returns an object with Blink memory information. It can be useful for debugging
23293 * rendering / DOM related memory issues. Note that all values are reported in
23294 * Kilobytes.
23295 */
23296 getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
23297 getCPUUsage(): Electron.CPUUsage;
23298 /**
23299 * The number of milliseconds since epoch, or `null` if the information is
23300 * unavailable
23301 *
23302 * Indicates the creation time of the application. The time is represented as
23303 * number of milliseconds since epoch. It returns null if it is unable to get the
23304 * process creation time.
23305 */
23306 getCreationTime(): (number) | (null);
23307 /**
23308 * * `totalHeapSize` Integer
23309 * * `totalHeapSizeExecutable` Integer
23310 * * `totalPhysicalSize` Integer
23311 * * `totalAvailableSize` Integer
23312 * * `usedHeapSize` Integer
23313 * * `heapSizeLimit` Integer
23314 * * `mallocedMemory` Integer
23315 * * `peakMallocedMemory` Integer
23316 * * `doesZapGarbage` boolean
23317 *
23318 * Returns an object with V8 heap statistics. Note that all statistics are reported
23319 * in Kilobytes.
23320 */
23321 getHeapStatistics(): Electron.HeapStatistics;
23322 /**
23323 * Resolves with a ProcessMemoryInfo
23324 *
23325 * Returns an object giving memory usage statistics about the current process. Note
23326 * that all statistics are reported in Kilobytes. This api should be called after
23327 * app ready.
23328 *
23329 * Chromium does not provide `residentSet` value for macOS. This is because macOS
23330 * performs in-memory compression of pages that haven't been recently used. As a
23331 * result the resident set size value is not what one would expect. `private`
23332 * memory is more representative of the actual pre-compression memory usage of the
23333 * process on macOS.
23334 */
23335 getProcessMemoryInfo(): Promise<Electron.ProcessMemoryInfo>;
23336 /**
23337 * * `total` Integer - The total amount of physical memory in Kilobytes available
23338 * to the system.
23339 * * `free` Integer - The total amount of memory not being used by applications or
23340 * disk cache.
23341 * * `swapTotal` Integer _Windows_ _Linux_ - The total amount of swap memory in
23342 * Kilobytes available to the system.
23343 * * `swapFree` Integer _Windows_ _Linux_ - The free amount of swap memory in
23344 * Kilobytes available to the system.
23345 *
23346 * Returns an object giving memory usage statistics about the entire system. Note
23347 * that all statistics are reported in Kilobytes.
23348 */
23349 getSystemMemoryInfo(): Electron.SystemMemoryInfo;
23350 /**
23351 * The version of the host operating system.
23352 *
23353 * Example:
23354 *
23355 * **Note:** It returns the actual operating system version instead of kernel
23356 * version on macOS unlike `os.release()`.
23357 */
23358 getSystemVersion(): string;
23359 /**
23360 * Causes the main thread of the current process hang.
23361 */
23362 hang(): void;
23363 /**
23364 * Sets the file descriptor soft limit to `maxDescriptors` or the OS hard limit,
23365 * whichever is lower for the current process.
23366 *
23367 * @platform darwin,linux
23368 */
23369 setFdLimit(maxDescriptors: number): void;
23370 /**
23371 * Indicates whether the snapshot has been created successfully.
23372 *
23373 * Takes a V8 heap snapshot and saves it to `filePath`.
23374 */
23375 takeHeapSnapshot(filePath: string): boolean;
23376 /**
23377 * A `string` representing Chrome's version string.
23378 *
23379 */
23380 readonly chrome: string;
23381 /**
23382 * A `string` (optional) representing a globally unique ID of the current
23383 * JavaScript context. Each frame has its own JavaScript context. When
23384 * contextIsolation is enabled, the isolated world also has a separate JavaScript
23385 * context. This property is only available in the renderer process.
23386 *
23387 */
23388 readonly contextId?: string;
23389 /**
23390 * A `boolean` that indicates whether the current renderer context has
23391 * `contextIsolation` enabled. It is `undefined` in the main process.
23392 *
23393 */
23394 readonly contextIsolated: boolean;
23395 /**
23396 * A `boolean`. When the app is started by being passed as parameter to the default
23397 * Electron executable, this property is `true` in the main process, otherwise it
23398 * is `undefined`. For example when running the app with `electron .`, it is
23399 * `true`, even if the app is packaged (`isPackaged`) is `true`. This can be useful
23400 * to determine how many arguments will need to be sliced off from `process.argv`.
23401 *
23402 */
23403 readonly defaultApp: boolean;
23404 /**
23405 * A `string` representing Electron's version string.
23406 *
23407 */
23408 readonly electron: string;
23409 /**
23410 * A `boolean`, `true` when the current renderer context is the "main" renderer
23411 * frame. If you want the ID of the current frame you should use
23412 * `webFrame.routingId`.
23413 *
23414 */
23415 readonly isMainFrame: boolean;
23416 /**
23417 * A `boolean`. For Mac App Store build, this property is `true`, for other builds
23418 * it is `undefined`.
23419 *
23420 */
23421 readonly mas: boolean;
23422 /**
23423 * A `boolean` that controls ASAR support inside your application. Setting this to
23424 * `true` will disable the support for `asar` archives in Node's built-in modules.
23425 */
23426 noAsar: boolean;
23427 /**
23428 * A `boolean` that controls whether or not deprecation warnings are printed to
23429 * `stderr`. Setting this to `true` will silence deprecation warnings. This
23430 * property is used instead of the `--no-deprecation` command line flag.
23431 */
23432 noDeprecation: boolean;
23433 /**
23434 * A `Electron.ParentPort` property if this is a `UtilityProcess` (or `null`
23435 * otherwise) allowing communication with the parent process.
23436 */
23437 parentPort: Electron.ParentPort;
23438 /**
23439 * A `string` representing the path to the resources directory.
23440 *
23441 */
23442 readonly resourcesPath: string;
23443 /**
23444 * A `boolean`. When the renderer process is sandboxed, this property is `true`,
23445 * otherwise it is `undefined`.
23446 *
23447 */
23448 readonly sandboxed: boolean;
23449 /**
23450 * A `boolean` that controls whether or not deprecation warnings will be thrown as
23451 * exceptions. Setting this to `true` will throw errors for deprecations. This
23452 * property is used instead of the `--throw-deprecation` command line flag.
23453 */
23454 throwDeprecation: boolean;
23455 /**
23456 * A `boolean` that controls whether or not deprecations printed to `stderr`
23457 * include their stack trace. Setting this to `true` will print stack traces for
23458 * deprecations. This property is instead of the `--trace-deprecation` command line
23459 * flag.
23460 */
23461 traceDeprecation: boolean;
23462 /**
23463 * A `boolean` that controls whether or not process warnings printed to `stderr`
23464 * include their stack trace. Setting this to `true` will print stack traces for
23465 * process warnings (including deprecations). This property is instead of the
23466 * `--trace-warnings` command line flag.
23467 */
23468 traceProcessWarnings: boolean;
23469 /**
23470 * A `string` representing the current process's type, can be:
23471 *
23472 * * `browser` - The main process
23473 * * `renderer` - A renderer process
23474 * * `worker` - In a web worker
23475 * * `utility` - In a node process launched as a service
23476 *
23477 */
23478 readonly type: ('browser' | 'renderer' | 'worker' | 'utility');
23479 /**
23480 * A `boolean`. If the app is running as a Windows Store app (appx), this property
23481 * is `true`, for otherwise it is `undefined`.
23482 *
23483 */
23484 readonly windowsStore: boolean;
23485 }
23486 interface ProcessVersions {
23487 readonly electron: string;
23488 readonly chrome: string;
23489 }
23490}
\No newline at end of file