Revert "[M120 Migration]Fix for crash during chrome exit"
[platform/framework/web/chromium-efl.git] / wrt / electron.d.ts
1 // Type definitions for Electron 28.1.0
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
8 type DOMEvent = Event;
9 type GlobalResponse = Response;
10 type GlobalRequest = Request;
11
12 declare 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     off(event: 'accessibility-support-changed', listener: (event: Event,
39                                                           /**
40                                                            * `true` when Chrome's accessibility support is enabled, `false` otherwise.
41                                                            */
42                                                           accessibilitySupportEnabled: boolean) => void): this;
43     once(event: 'accessibility-support-changed', listener: (event: Event,
44                                                           /**
45                                                            * `true` when Chrome's accessibility support is enabled, `false` otherwise.
46                                                            */
47                                                           accessibilitySupportEnabled: boolean) => void): this;
48     addListener(event: 'accessibility-support-changed', listener: (event: Event,
49                                                           /**
50                                                            * `true` when Chrome's accessibility support is enabled, `false` otherwise.
51                                                            */
52                                                           accessibilitySupportEnabled: boolean) => void): this;
53     removeListener(event: 'accessibility-support-changed', listener: (event: Event,
54                                                           /**
55                                                            * `true` when Chrome's accessibility support is enabled, `false` otherwise.
56                                                            */
57                                                           accessibilitySupportEnabled: boolean) => void): this;
58     /**
59      * Emitted when the application is activated. Various actions can trigger this
60      * event, such as launching the application for the first time, attempting to
61      * re-launch the application when it's already running, or clicking on the
62      * application's dock or taskbar icon.
63      *
64      * @platform darwin
65      */
66     on(event: 'activate', listener: (event: Event,
67                                      hasVisibleWindows: boolean) => void): this;
68     off(event: 'activate', listener: (event: Event,
69                                      hasVisibleWindows: boolean) => void): this;
70     once(event: 'activate', listener: (event: Event,
71                                      hasVisibleWindows: boolean) => void): this;
72     addListener(event: 'activate', listener: (event: Event,
73                                      hasVisibleWindows: boolean) => void): this;
74     removeListener(event: 'activate', listener: (event: Event,
75                                      hasVisibleWindows: boolean) => void): this;
76     /**
77      * Emitted during Handoff after an activity from this device was successfully
78      * resumed on another one.
79      *
80      * @platform darwin
81      */
82     on(event: 'activity-was-continued', listener: (event: Event,
83                                                    /**
84                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
85                                                     */
86                                                    type: string,
87                                                    /**
88                                                     * Contains app-specific state stored by the activity.
89                                                     */
90                                                    userInfo: unknown) => void): this;
91     off(event: 'activity-was-continued', listener: (event: Event,
92                                                    /**
93                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
94                                                     */
95                                                    type: string,
96                                                    /**
97                                                     * Contains app-specific state stored by the activity.
98                                                     */
99                                                    userInfo: unknown) => void): this;
100     once(event: 'activity-was-continued', listener: (event: Event,
101                                                    /**
102                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
103                                                     */
104                                                    type: string,
105                                                    /**
106                                                     * Contains app-specific state stored by the activity.
107                                                     */
108                                                    userInfo: unknown) => void): this;
109     addListener(event: 'activity-was-continued', listener: (event: Event,
110                                                    /**
111                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
112                                                     */
113                                                    type: string,
114                                                    /**
115                                                     * Contains app-specific state stored by the activity.
116                                                     */
117                                                    userInfo: unknown) => void): this;
118     removeListener(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      * Emitted before the application starts closing its windows. Calling
129      * `event.preventDefault()` will prevent the default behavior, which is terminating
130      * the application.
131      *
132      * **Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
133      * then `before-quit` is emitted _after_ emitting `close` event on all windows and
134      * closing them.
135      *
136      * **Note:** On Windows, this event will not be emitted if the app is closed due to
137      * a shutdown/restart of the system or a user logout.
138      */
139     on(event: 'before-quit', listener: (event: Event) => void): this;
140     off(event: 'before-quit', listener: (event: Event) => void): this;
141     once(event: 'before-quit', listener: (event: Event) => void): this;
142     addListener(event: 'before-quit', listener: (event: Event) => void): this;
143     removeListener(event: 'before-quit', listener: (event: Event) => void): this;
144     /**
145      * Emitted when a browserWindow gets blurred.
146      */
147     on(event: 'browser-window-blur', listener: (event: Event,
148                                                 window: BrowserWindow) => void): this;
149     off(event: 'browser-window-blur', listener: (event: Event,
150                                                 window: BrowserWindow) => void): this;
151     once(event: 'browser-window-blur', listener: (event: Event,
152                                                 window: BrowserWindow) => void): this;
153     addListener(event: 'browser-window-blur', listener: (event: Event,
154                                                 window: BrowserWindow) => void): this;
155     removeListener(event: 'browser-window-blur', listener: (event: Event,
156                                                 window: BrowserWindow) => void): this;
157     /**
158      * Emitted when a new browserWindow is created.
159      */
160     on(event: 'browser-window-created', listener: (event: Event,
161                                                    window: BrowserWindow) => void): this;
162     off(event: 'browser-window-created', listener: (event: Event,
163                                                    window: BrowserWindow) => void): this;
164     once(event: 'browser-window-created', listener: (event: Event,
165                                                    window: BrowserWindow) => void): this;
166     addListener(event: 'browser-window-created', listener: (event: Event,
167                                                    window: BrowserWindow) => void): this;
168     removeListener(event: 'browser-window-created', listener: (event: Event,
169                                                    window: BrowserWindow) => void): this;
170     /**
171      * Emitted when a browserWindow gets focused.
172      */
173     on(event: 'browser-window-focus', listener: (event: Event,
174                                                  window: BrowserWindow) => void): this;
175     off(event: 'browser-window-focus', listener: (event: Event,
176                                                  window: BrowserWindow) => void): this;
177     once(event: 'browser-window-focus', listener: (event: Event,
178                                                  window: BrowserWindow) => void): this;
179     addListener(event: 'browser-window-focus', listener: (event: Event,
180                                                  window: BrowserWindow) => void): this;
181     removeListener(event: 'browser-window-focus', listener: (event: Event,
182                                                  window: BrowserWindow) => void): this;
183     /**
184      * Emitted when failed to verify the `certificate` for `url`, to trust the
185      * certificate you should prevent the default behavior with
186      * `event.preventDefault()` and call `callback(true)`.
187      */
188     on(event: 'certificate-error', listener: (event: Event,
189                                               webContents: WebContents,
190                                               url: string,
191                                               /**
192                                                * The error code
193                                                */
194                                               error: string,
195                                               certificate: Certificate,
196                                               callback: (isTrusted: boolean) => void,
197                                               isMainFrame: boolean) => void): this;
198     off(event: 'certificate-error', listener: (event: Event,
199                                               webContents: WebContents,
200                                               url: string,
201                                               /**
202                                                * The error code
203                                                */
204                                               error: string,
205                                               certificate: Certificate,
206                                               callback: (isTrusted: boolean) => void,
207                                               isMainFrame: boolean) => void): this;
208     once(event: 'certificate-error', listener: (event: Event,
209                                               webContents: WebContents,
210                                               url: string,
211                                               /**
212                                                * The error code
213                                                */
214                                               error: string,
215                                               certificate: Certificate,
216                                               callback: (isTrusted: boolean) => void,
217                                               isMainFrame: boolean) => void): this;
218     addListener(event: 'certificate-error', listener: (event: Event,
219                                               webContents: WebContents,
220                                               url: string,
221                                               /**
222                                                * The error code
223                                                */
224                                               error: string,
225                                               certificate: Certificate,
226                                               callback: (isTrusted: boolean) => void,
227                                               isMainFrame: boolean) => void): this;
228     removeListener(event: 'certificate-error', listener: (event: Event,
229                                               webContents: WebContents,
230                                               url: string,
231                                               /**
232                                                * The error code
233                                                */
234                                               error: string,
235                                               certificate: Certificate,
236                                               callback: (isTrusted: boolean) => void,
237                                               isMainFrame: boolean) => void): this;
238     /**
239      * Emitted when the child process unexpectedly disappears. This is normally because
240      * it was crashed or killed. It does not include renderer processes.
241      */
242     on(event: 'child-process-gone', listener: (event: Event,
243                                                details: Details) => void): this;
244     off(event: 'child-process-gone', listener: (event: Event,
245                                                details: Details) => void): this;
246     once(event: 'child-process-gone', listener: (event: Event,
247                                                details: Details) => void): this;
248     addListener(event: 'child-process-gone', listener: (event: Event,
249                                                details: Details) => void): this;
250     removeListener(event: 'child-process-gone', listener: (event: Event,
251                                                details: Details) => void): this;
252     /**
253      * Emitted during Handoff when an activity from a different device wants to be
254      * resumed. You should call `event.preventDefault()` if you want to handle this
255      * event.
256      *
257      * A user activity can be continued only in an app that has the same developer Team
258      * ID as the activity's source app and that supports the activity's type. Supported
259      * activity types are specified in the app's `Info.plist` under the
260      * `NSUserActivityTypes` key.
261      *
262      * @platform darwin
263      */
264     on(event: 'continue-activity', listener: (event: Event,
265                                               /**
266                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
267                                                */
268                                               type: string,
269                                               /**
270                                                * Contains app-specific state stored by the activity on another device.
271                                                */
272                                               userInfo: unknown,
273                                               details: ContinueActivityDetails) => void): this;
274     off(event: 'continue-activity', listener: (event: Event,
275                                               /**
276                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
277                                                */
278                                               type: string,
279                                               /**
280                                                * Contains app-specific state stored by the activity on another device.
281                                                */
282                                               userInfo: unknown,
283                                               details: ContinueActivityDetails) => void): this;
284     once(event: 'continue-activity', listener: (event: Event,
285                                               /**
286                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
287                                                */
288                                               type: string,
289                                               /**
290                                                * Contains app-specific state stored by the activity on another device.
291                                                */
292                                               userInfo: unknown,
293                                               details: ContinueActivityDetails) => void): this;
294     addListener(event: 'continue-activity', listener: (event: Event,
295                                               /**
296                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
297                                                */
298                                               type: string,
299                                               /**
300                                                * Contains app-specific state stored by the activity on another device.
301                                                */
302                                               userInfo: unknown,
303                                               details: ContinueActivityDetails) => void): this;
304     removeListener(event: 'continue-activity', listener: (event: Event,
305                                               /**
306                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
307                                                */
308                                               type: string,
309                                               /**
310                                                * Contains app-specific state stored by the activity on another device.
311                                                */
312                                               userInfo: unknown,
313                                               details: ContinueActivityDetails) => void): this;
314     /**
315      * Emitted during Handoff when an activity from a different device fails to be
316      * resumed.
317      *
318      * @platform darwin
319      */
320     on(event: 'continue-activity-error', listener: (event: Event,
321                                                     /**
322                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
323                                                      */
324                                                     type: string,
325                                                     /**
326                                                      * A string with the error's localized description.
327                                                      */
328                                                     error: string) => void): this;
329     off(event: 'continue-activity-error', listener: (event: Event,
330                                                     /**
331                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
332                                                      */
333                                                     type: string,
334                                                     /**
335                                                      * A string with the error's localized description.
336                                                      */
337                                                     error: string) => void): this;
338     once(event: 'continue-activity-error', listener: (event: Event,
339                                                     /**
340                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
341                                                      */
342                                                     type: string,
343                                                     /**
344                                                      * A string with the error's localized description.
345                                                      */
346                                                     error: string) => void): this;
347     addListener(event: 'continue-activity-error', listener: (event: Event,
348                                                     /**
349                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
350                                                      */
351                                                     type: string,
352                                                     /**
353                                                      * A string with the error's localized description.
354                                                      */
355                                                     error: string) => void): this;
356     removeListener(event: 'continue-activity-error', listener: (event: Event,
357                                                     /**
358                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
359                                                      */
360                                                     type: string,
361                                                     /**
362                                                      * A string with the error's localized description.
363                                                      */
364                                                     error: string) => void): this;
365     /**
366      * Emitted when the application becomes active. This differs from the `activate`
367      * event in that `did-become-active` is emitted every time the app becomes active,
368      * not only when Dock icon is clicked or application is re-launched. It is also
369      * emitted when a user switches to the app via the macOS App Switcher.
370      *
371      * @platform darwin
372      */
373     on(event: 'did-become-active', listener: (event: Event) => void): this;
374     off(event: 'did-become-active', listener: (event: Event) => void): this;
375     once(event: 'did-become-active', listener: (event: Event) => void): this;
376     addListener(event: 'did-become-active', listener: (event: Event) => void): this;
377     removeListener(event: 'did-become-active', listener: (event: Event) => void): this;
378     /**
379      * Emitted when the app is no longer active and doesn’t have focus. This can be
380      * triggered, for example, by clicking on another application or by using the macOS
381      * App Switcher to switch to another application.
382      *
383      * @platform darwin
384      */
385     on(event: 'did-resign-active', listener: (event: Event) => void): this;
386     off(event: 'did-resign-active', listener: (event: Event) => void): this;
387     once(event: 'did-resign-active', listener: (event: Event) => void): this;
388     addListener(event: 'did-resign-active', listener: (event: Event) => void): this;
389     removeListener(event: 'did-resign-active', listener: (event: Event) => void): this;
390     /**
391      * Emitted whenever there is a GPU info update.
392      */
393     on(event: 'gpu-info-update', listener: Function): this;
394     off(event: 'gpu-info-update', listener: Function): this;
395     once(event: 'gpu-info-update', listener: Function): this;
396     addListener(event: 'gpu-info-update', listener: Function): this;
397     removeListener(event: 'gpu-info-update', listener: Function): this;
398     /**
399      * Emitted when the GPU process crashes or is killed.
400      *
401      * **Deprecated:** This event is superceded by the `child-process-gone` event which
402      * contains more information about why the child process disappeared. It isn't
403      * always because it crashed. The `killed` boolean can be replaced by checking
404      * `reason === 'killed'` when you switch to that event.
405      *
406      * @deprecated
407      */
408     on(event: 'gpu-process-crashed', listener: (event: Event,
409                                                 killed: boolean) => void): this;
410     off(event: 'gpu-process-crashed', listener: (event: Event,
411                                                 killed: boolean) => void): this;
412     once(event: 'gpu-process-crashed', listener: (event: Event,
413                                                 killed: boolean) => void): this;
414     addListener(event: 'gpu-process-crashed', listener: (event: Event,
415                                                 killed: boolean) => void): this;
416     removeListener(event: 'gpu-process-crashed', listener: (event: Event,
417                                                 killed: boolean) => void): this;
418     /**
419      * Emitted when `webContents` wants to do basic auth.
420      *
421      * The default behavior is to cancel all authentications. To override this you
422      * should prevent the default behavior with `event.preventDefault()` and call
423      * `callback(username, password)` with the credentials.
424      *
425      * If `callback` is called without a username or password, the authentication
426      * request will be cancelled and the authentication error will be returned to the
427      * page.
428      */
429     on(event: 'login', listener: (event: Event,
430                                   webContents: WebContents,
431                                   authenticationResponseDetails: AuthenticationResponseDetails,
432                                   authInfo: AuthInfo,
433                                   callback: (username?: string, password?: string) => void) => void): this;
434     off(event: 'login', listener: (event: Event,
435                                   webContents: WebContents,
436                                   authenticationResponseDetails: AuthenticationResponseDetails,
437                                   authInfo: AuthInfo,
438                                   callback: (username?: string, password?: string) => void) => void): this;
439     once(event: 'login', listener: (event: Event,
440                                   webContents: WebContents,
441                                   authenticationResponseDetails: AuthenticationResponseDetails,
442                                   authInfo: AuthInfo,
443                                   callback: (username?: string, password?: string) => void) => void): this;
444     addListener(event: 'login', listener: (event: Event,
445                                   webContents: WebContents,
446                                   authenticationResponseDetails: AuthenticationResponseDetails,
447                                   authInfo: AuthInfo,
448                                   callback: (username?: string, password?: string) => void) => void): this;
449     removeListener(event: 'login', listener: (event: Event,
450                                   webContents: WebContents,
451                                   authenticationResponseDetails: AuthenticationResponseDetails,
452                                   authInfo: AuthInfo,
453                                   callback: (username?: string, password?: string) => void) => void): this;
454     /**
455      * Emitted when the user clicks the native macOS new tab button. The new tab button
456      * is only visible if the current `BrowserWindow` has a `tabbingIdentifier`
457      *
458      * @platform darwin
459      */
460     on(event: 'new-window-for-tab', listener: (event: Event) => void): this;
461     off(event: 'new-window-for-tab', listener: (event: Event) => void): this;
462     once(event: 'new-window-for-tab', listener: (event: Event) => void): this;
463     addListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
464     removeListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
465     /**
466      * Emitted when the user wants to open a file with the application. The `open-file`
467      * event is usually emitted when the application is already open and the OS wants
468      * to reuse the application to open the file. `open-file` is also emitted when a
469      * file is dropped onto the dock and the application is not yet running. Make sure
470      * to listen for the `open-file` event very early in your application startup to
471      * handle this case (even before the `ready` event is emitted).
472      *
473      * You should call `event.preventDefault()` if you want to handle this event.
474      *
475      * On Windows, you have to parse `process.argv` (in the main process) to get the
476      * filepath.
477      *
478      * @platform darwin
479      */
480     on(event: 'open-file', listener: (event: Event,
481                                       path: string) => void): this;
482     off(event: 'open-file', listener: (event: Event,
483                                       path: string) => void): this;
484     once(event: 'open-file', listener: (event: Event,
485                                       path: string) => void): this;
486     addListener(event: 'open-file', listener: (event: Event,
487                                       path: string) => void): this;
488     removeListener(event: 'open-file', listener: (event: Event,
489                                       path: string) => void): this;
490     /**
491      * Emitted when the user wants to open a URL with the application. Your
492      * application's `Info.plist` file must define the URL scheme within the
493      * `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`.
494      *
495      * As with the `open-file` event, be sure to register a listener for the `open-url`
496      * event early in your application startup to detect if the application is being
497      * opened to handle a URL. If you register the listener in response to a `ready`
498      * event, you'll miss URLs that trigger the launch of your application.
499      *
500      * @platform darwin
501      */
502     on(event: 'open-url', listener: (event: Event,
503                                      url: string) => void): this;
504     off(event: 'open-url', listener: (event: Event,
505                                      url: string) => void): this;
506     once(event: 'open-url', listener: (event: Event,
507                                      url: string) => void): this;
508     addListener(event: 'open-url', listener: (event: Event,
509                                      url: string) => void): this;
510     removeListener(event: 'open-url', listener: (event: Event,
511                                      url: string) => void): this;
512     /**
513      * Emitted when the application is quitting.
514      *
515      * **Note:** On Windows, this event will not be emitted if the app is closed due to
516      * a shutdown/restart of the system or a user logout.
517      */
518     on(event: 'quit', listener: (event: Event,
519                                  exitCode: number) => void): this;
520     off(event: 'quit', listener: (event: Event,
521                                  exitCode: number) => void): this;
522     once(event: 'quit', listener: (event: Event,
523                                  exitCode: number) => void): this;
524     addListener(event: 'quit', listener: (event: Event,
525                                  exitCode: number) => void): this;
526     removeListener(event: 'quit', listener: (event: Event,
527                                  exitCode: number) => void): this;
528     /**
529      * Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
530      * holds the `userInfo` of the `NSUserNotification` or information from
531      * `UNNotificationResponse` that was used to open the application, if it was
532      * launched from Notification Center. You can also call `app.isReady()` to check if
533      * this event has already fired and `app.whenReady()` to get a Promise that is
534      * fulfilled when Electron is initialized.
535      */
536     on(event: 'ready', listener: (event: Event,
537                                   /**
538                                    * @platform darwin
539                                    */
540                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
541     off(event: 'ready', listener: (event: Event,
542                                   /**
543                                    * @platform darwin
544                                    */
545                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
546     once(event: 'ready', listener: (event: Event,
547                                   /**
548                                    * @platform darwin
549                                    */
550                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
551     addListener(event: 'ready', listener: (event: Event,
552                                   /**
553                                    * @platform darwin
554                                    */
555                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
556     removeListener(event: 'ready', listener: (event: Event,
557                                   /**
558                                    * @platform darwin
559                                    */
560                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
561     /**
562      * Emitted when the renderer process unexpectedly disappears.  This is normally
563      * because it was crashed or killed.
564      */
565     on(event: 'render-process-gone', listener: (event: Event,
566                                                 webContents: WebContents,
567                                                 details: RenderProcessGoneDetails) => void): this;
568     off(event: 'render-process-gone', listener: (event: Event,
569                                                 webContents: WebContents,
570                                                 details: RenderProcessGoneDetails) => void): this;
571     once(event: 'render-process-gone', listener: (event: Event,
572                                                 webContents: WebContents,
573                                                 details: RenderProcessGoneDetails) => void): this;
574     addListener(event: 'render-process-gone', listener: (event: Event,
575                                                 webContents: WebContents,
576                                                 details: RenderProcessGoneDetails) => void): this;
577     removeListener(event: 'render-process-gone', listener: (event: Event,
578                                                 webContents: WebContents,
579                                                 details: RenderProcessGoneDetails) => void): this;
580     /**
581      * Emitted when the renderer process of `webContents` crashes or is killed.
582      *
583      * **Deprecated:** This event is superceded by the `render-process-gone` event
584      * which contains more information about why the render process disappeared. It
585      * isn't always because it crashed.  The `killed` boolean can be replaced by
586      * checking `reason === 'killed'` when you switch to that event.
587      *
588      * @deprecated
589      */
590     on(event: 'renderer-process-crashed', listener: (event: Event,
591                                                      webContents: WebContents,
592                                                      killed: boolean) => void): this;
593     off(event: 'renderer-process-crashed', listener: (event: Event,
594                                                      webContents: WebContents,
595                                                      killed: boolean) => void): this;
596     once(event: 'renderer-process-crashed', listener: (event: Event,
597                                                      webContents: WebContents,
598                                                      killed: boolean) => void): this;
599     addListener(event: 'renderer-process-crashed', listener: (event: Event,
600                                                      webContents: WebContents,
601                                                      killed: boolean) => void): this;
602     removeListener(event: 'renderer-process-crashed', listener: (event: Event,
603                                                      webContents: WebContents,
604                                                      killed: boolean) => void): this;
605     /**
606      * This event will be emitted inside the primary instance of your application when
607      * a second instance has been executed and calls `app.requestSingleInstanceLock()`.
608      *
609      * `argv` is an Array of the second instance's command line arguments, and
610      * `workingDirectory` is its current working directory. Usually applications
611      * respond to this by making their primary window focused and non-minimized.
612      *
613      * **Note:** `argv` will not be exactly the same list of arguments as those passed
614      * to the second instance. The order might change and additional arguments might be
615      * appended. If you need to maintain the exact same arguments, it's advised to use
616      * `additionalData` instead.
617      *
618      * **Note:** If the second instance is started by a different user than the first,
619      * the `argv` array will not include the arguments.
620      *
621      * This event is guaranteed to be emitted after the `ready` event of `app` gets
622      * emitted.
623      *
624      * **Note:** Extra command line arguments might be added by Chromium, such as
625      * `--original-process-start-time`.
626      */
627     on(event: 'second-instance', listener: (event: Event,
628                                             /**
629                                              * An array of the second instance's command line arguments
630                                              */
631                                             argv: string[],
632                                             /**
633                                              * The second instance's working directory
634                                              */
635                                             workingDirectory: string,
636                                             /**
637                                              * A JSON object of additional data passed from the second instance
638                                              */
639                                             additionalData: unknown) => void): this;
640     off(event: 'second-instance', listener: (event: Event,
641                                             /**
642                                              * An array of the second instance's command line arguments
643                                              */
644                                             argv: string[],
645                                             /**
646                                              * The second instance's working directory
647                                              */
648                                             workingDirectory: string,
649                                             /**
650                                              * A JSON object of additional data passed from the second instance
651                                              */
652                                             additionalData: unknown) => void): this;
653     once(event: 'second-instance', listener: (event: Event,
654                                             /**
655                                              * An array of the second instance's command line arguments
656                                              */
657                                             argv: string[],
658                                             /**
659                                              * The second instance's working directory
660                                              */
661                                             workingDirectory: string,
662                                             /**
663                                              * A JSON object of additional data passed from the second instance
664                                              */
665                                             additionalData: unknown) => void): this;
666     addListener(event: 'second-instance', listener: (event: Event,
667                                             /**
668                                              * An array of the second instance's command line arguments
669                                              */
670                                             argv: string[],
671                                             /**
672                                              * The second instance's working directory
673                                              */
674                                             workingDirectory: string,
675                                             /**
676                                              * A JSON object of additional data passed from the second instance
677                                              */
678                                             additionalData: unknown) => void): this;
679     removeListener(event: 'second-instance', listener: (event: Event,
680                                             /**
681                                              * An array of the second instance's command line arguments
682                                              */
683                                             argv: string[],
684                                             /**
685                                              * The second instance's working directory
686                                              */
687                                             workingDirectory: string,
688                                             /**
689                                              * A JSON object of additional data passed from the second instance
690                                              */
691                                             additionalData: unknown) => void): this;
692     /**
693      * Emitted when a client certificate is requested.
694      *
695      * The `url` corresponds to the navigation entry requesting the client certificate
696      * and `callback` can be called with an entry filtered from the list. Using
697      * `event.preventDefault()` prevents the application from using the first
698      * certificate from the store.
699      */
700     on(event: 'select-client-certificate', listener: (event: Event,
701                                                       webContents: WebContents,
702                                                       url: string,
703                                                       certificateList: Certificate[],
704                                                       callback: (certificate?: Certificate) => void) => void): this;
705     off(event: 'select-client-certificate', listener: (event: Event,
706                                                       webContents: WebContents,
707                                                       url: string,
708                                                       certificateList: Certificate[],
709                                                       callback: (certificate?: Certificate) => void) => void): this;
710     once(event: 'select-client-certificate', listener: (event: Event,
711                                                       webContents: WebContents,
712                                                       url: string,
713                                                       certificateList: Certificate[],
714                                                       callback: (certificate?: Certificate) => void) => void): this;
715     addListener(event: 'select-client-certificate', listener: (event: Event,
716                                                       webContents: WebContents,
717                                                       url: string,
718                                                       certificateList: Certificate[],
719                                                       callback: (certificate?: Certificate) => void) => void): this;
720     removeListener(event: 'select-client-certificate', listener: (event: Event,
721                                                       webContents: WebContents,
722                                                       url: string,
723                                                       certificateList: Certificate[],
724                                                       callback: (certificate?: Certificate) => void) => void): this;
725     /**
726      * Emitted when Electron has created a new `session`.
727      */
728     on(event: 'session-created', listener: (session: Session) => void): this;
729     off(event: 'session-created', listener: (session: Session) => void): this;
730     once(event: 'session-created', listener: (session: Session) => void): this;
731     addListener(event: 'session-created', listener: (session: Session) => void): this;
732     removeListener(event: 'session-created', listener: (session: Session) => void): this;
733     /**
734      * Emitted when Handoff is about to be resumed on another device. If you need to
735      * update the state to be transferred, you should call `event.preventDefault()`
736      * immediately, construct a new `userInfo` dictionary and call
737      * `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will
738      * fail and `continue-activity-error` will be called.
739      *
740      * @platform darwin
741      */
742     on(event: 'update-activity-state', listener: (event: Event,
743                                                   /**
744                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
745                                                    */
746                                                   type: string,
747                                                   /**
748                                                    * Contains app-specific state stored by the activity.
749                                                    */
750                                                   userInfo: unknown) => void): this;
751     off(event: 'update-activity-state', listener: (event: Event,
752                                                   /**
753                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
754                                                    */
755                                                   type: string,
756                                                   /**
757                                                    * Contains app-specific state stored by the activity.
758                                                    */
759                                                   userInfo: unknown) => void): this;
760     once(event: 'update-activity-state', listener: (event: Event,
761                                                   /**
762                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
763                                                    */
764                                                   type: string,
765                                                   /**
766                                                    * Contains app-specific state stored by the activity.
767                                                    */
768                                                   userInfo: unknown) => void): this;
769     addListener(event: 'update-activity-state', listener: (event: Event,
770                                                   /**
771                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
772                                                    */
773                                                   type: string,
774                                                   /**
775                                                    * Contains app-specific state stored by the activity.
776                                                    */
777                                                   userInfo: unknown) => void): this;
778     removeListener(event: 'update-activity-state', listener: (event: Event,
779                                                   /**
780                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
781                                                    */
782                                                   type: string,
783                                                   /**
784                                                    * Contains app-specific state stored by the activity.
785                                                    */
786                                                   userInfo: unknown) => void): this;
787     /**
788      * Emitted when a new webContents is created.
789      */
790     on(event: 'web-contents-created', listener: (event: Event,
791                                                  webContents: WebContents) => void): this;
792     off(event: 'web-contents-created', listener: (event: Event,
793                                                  webContents: WebContents) => void): this;
794     once(event: 'web-contents-created', listener: (event: Event,
795                                                  webContents: WebContents) => void): this;
796     addListener(event: 'web-contents-created', listener: (event: Event,
797                                                  webContents: WebContents) => void): this;
798     removeListener(event: 'web-contents-created', listener: (event: Event,
799                                                  webContents: WebContents) => void): this;
800     /**
801      * Emitted during Handoff before an activity from a different device wants to be
802      * resumed. You should call `event.preventDefault()` if you want to handle this
803      * event.
804      *
805      * @platform darwin
806      */
807     on(event: 'will-continue-activity', listener: (event: Event,
808                                                    /**
809                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
810                                                     */
811                                                    type: string) => void): this;
812     off(event: 'will-continue-activity', listener: (event: Event,
813                                                    /**
814                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
815                                                     */
816                                                    type: string) => void): this;
817     once(event: 'will-continue-activity', listener: (event: Event,
818                                                    /**
819                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
820                                                     */
821                                                    type: string) => void): this;
822     addListener(event: 'will-continue-activity', listener: (event: Event,
823                                                    /**
824                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
825                                                     */
826                                                    type: string) => void): this;
827     removeListener(event: 'will-continue-activity', listener: (event: Event,
828                                                    /**
829                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
830                                                     */
831                                                    type: string) => void): this;
832     /**
833      * Emitted when the application has finished basic startup. On Windows and Linux,
834      * the `will-finish-launching` event is the same as the `ready` event; on macOS,
835      * this event represents the `applicationWillFinishLaunching` notification of
836      * `NSApplication`.
837      *
838      * In most cases, you should do everything in the `ready` event handler.
839      */
840     on(event: 'will-finish-launching', listener: Function): this;
841     off(event: 'will-finish-launching', listener: Function): this;
842     once(event: 'will-finish-launching', listener: Function): this;
843     addListener(event: 'will-finish-launching', listener: Function): this;
844     removeListener(event: 'will-finish-launching', listener: Function): this;
845     /**
846      * Emitted when all windows have been closed and the application will quit. Calling
847      * `event.preventDefault()` will prevent the default behavior, which is terminating
848      * the application.
849      *
850      * See the description of the `window-all-closed` event for the differences between
851      * the `will-quit` and `window-all-closed` events.
852      *
853      * **Note:** On Windows, this event will not be emitted if the app is closed due to
854      * a shutdown/restart of the system or a user logout.
855      */
856     on(event: 'will-quit', listener: (event: Event) => void): this;
857     off(event: 'will-quit', listener: (event: Event) => void): this;
858     once(event: 'will-quit', listener: (event: Event) => void): this;
859     addListener(event: 'will-quit', listener: (event: Event) => void): this;
860     removeListener(event: 'will-quit', listener: (event: Event) => void): this;
861     /**
862      * Emitted when all windows have been closed.
863      *
864      * If you do not subscribe to this event and all windows are closed, the default
865      * behavior is to quit the app; however, if you subscribe, you control whether the
866      * app quits or not. If the user pressed `Cmd + Q`, or the developer called
867      * `app.quit()`, Electron will first try to close all the windows and then emit the
868      * `will-quit` event, and in this case the `window-all-closed` event would not be
869      * emitted.
870      */
871     on(event: 'window-all-closed', listener: Function): this;
872     off(event: 'window-all-closed', listener: Function): this;
873     once(event: 'window-all-closed', listener: Function): this;
874     addListener(event: 'window-all-closed', listener: Function): this;
875     removeListener(event: 'window-all-closed', listener: Function): this;
876     /**
877      * Adds `path` to the recent documents list.
878      *
879      * This list is managed by the OS. On Windows, you can visit the list from the task
880      * bar, and on macOS, you can visit it from dock menu.
881      *
882      * @platform darwin,win32
883      */
884     addRecentDocument(path: string): void;
885     /**
886      * Clears the recent documents list.
887      *
888      * @platform darwin,win32
889      */
890     clearRecentDocuments(): void;
891     /**
892      * Configures host resolution (DNS and DNS-over-HTTPS). By default, the following
893      * resolvers will be used, in order:
894      *
895      * * DNS-over-HTTPS, if the DNS provider supports it, then
896      * * the built-in resolver (enabled on macOS only by default), then
897      * * the system's resolver (e.g. `getaddrinfo`).
898      *
899      * This can be configured to either restrict usage of non-encrypted DNS
900      * (`secureDnsMode: "secure"`), or disable DNS-over-HTTPS (`secureDnsMode: "off"`).
901      * It is also possible to enable or disable the built-in resolver.
902      *
903      * To disable insecure DNS, you can specify a `secureDnsMode` of `"secure"`. If you
904      * do so, you should make sure to provide a list of DNS-over-HTTPS servers to use,
905      * in case the user's DNS configuration does not include a provider that supports
906      * DoH.
907      *
908      * This API must be called after the `ready` event is emitted.
909      */
910     configureHostResolver(options: ConfigureHostResolverOptions): void;
911     /**
912      * By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain
913      * basis if the GPU processes crashes too frequently. This function disables that
914      * behavior.
915      *
916      * This method can only be called before app is ready.
917      */
918     disableDomainBlockingFor3DAPIs(): void;
919     /**
920      * Disables hardware acceleration for current app.
921      *
922      * This method can only be called before app is ready.
923      */
924     disableHardwareAcceleration(): void;
925     /**
926      * Enables full sandbox mode on the app. This means that all renderers will be
927      * launched sandboxed, regardless of the value of the `sandbox` flag in
928      * `WebPreferences`.
929      *
930      * This method can only be called before app is ready.
931      */
932     enableSandbox(): void;
933     /**
934      * Exits immediately with `exitCode`. `exitCode` defaults to 0.
935      *
936      * All windows will be closed immediately without asking the user, and the
937      * `before-quit` and `will-quit` events will not be emitted.
938      */
939     exit(exitCode?: number): void;
940     /**
941      * On Linux, focuses on the first visible window. On macOS, makes the application
942      * the active app. On Windows, focuses on the application's first window.
943      *
944      * You should seek to use the `steal` option as sparingly as possible.
945      */
946     focus(options?: FocusOptions): void;
947     /**
948      * Resolve with an object containing the following:
949      *
950      * * `icon` NativeImage - the display icon of the app handling the protocol.
951      * * `path` string  - installation path of the app handling the protocol.
952      * * `name` string - display name of the app handling the protocol.
953      *
954      * This method returns a promise that contains the application name, icon and path
955      * of the default handler for the protocol (aka URI scheme) of a URL.
956      *
957      * @platform darwin,win32
958      */
959     getApplicationInfoForProtocol(url: string): Promise<Electron.ApplicationInfoForProtocolReturnValue>;
960     /**
961      * Name of the application handling the protocol, or an empty string if there is no
962      * handler. For instance, if Electron is the default handler of the URL, this could
963      * be `Electron` on Windows and Mac. However, don't rely on the precise format
964      * which is not guaranteed to remain unchanged. Expect a different format on Linux,
965      * possibly with a `.desktop` suffix.
966      *
967      * This method returns the application name of the default handler for the protocol
968      * (aka URI scheme) of a URL.
969      */
970     getApplicationNameForProtocol(url: string): string;
971     /**
972      * Array of `ProcessMetric` objects that correspond to memory and CPU usage
973      * statistics of all the processes associated with the app.
974      */
975     getAppMetrics(): ProcessMetric[];
976     /**
977      * The current application directory.
978      */
979     getAppPath(): string;
980     /**
981      * The current value displayed in the counter badge.
982      *
983      * @platform linux,darwin
984      */
985     getBadgeCount(): number;
986     /**
987      * The type of the currently running activity.
988      *
989      * @platform darwin
990      */
991     getCurrentActivityType(): string;
992     /**
993      * fulfilled with the app's icon, which is a NativeImage.
994      *
995      * Fetches a path's associated icon.
996      *
997      * On _Windows_, there a 2 kinds of icons:
998      *
999      * * Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
1000      * * Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
1001      *
1002      * On _Linux_ and _macOS_, icons depend on the application associated with file
1003      * mime type.
1004      */
1005     getFileIcon(path: string, options?: FileIconOptions): Promise<Electron.NativeImage>;
1006     /**
1007      * The Graphics Feature Status from `chrome://gpu/`.
1008      *
1009      * **Note:** This information is only usable after the `gpu-info-update` event is
1010      * emitted.
1011      */
1012     getGPUFeatureStatus(): GPUFeatureStatus;
1013     /**
1014      * For `infoType` equal to `complete`: Promise is fulfilled with `Object`
1015      * containing all the GPU Information as in chromium's GPUInfo object. This
1016      * includes the version and driver information that's shown on `chrome://gpu` page.
1017      *
1018      * For `infoType` equal to `basic`: Promise is fulfilled with `Object` containing
1019      * fewer attributes than when requested with `complete`. Here's an example of basic
1020      * response:
1021      *
1022      * Using `basic` should be preferred if only basic information like `vendorId` or
1023      * `deviceId` is needed.
1024      */
1025     getGPUInfo(infoType: 'basic' | 'complete'): Promise<unknown>;
1026     /**
1027      * * `minItems` Integer - The minimum number of items that will be shown in the
1028      * Jump List (for a more detailed description of this value see the MSDN docs).
1029      * * `removedItems` JumpListItem[] - Array of `JumpListItem` objects that
1030      * correspond to items that the user has explicitly removed from custom categories
1031      * in the Jump List. These items must not be re-added to the Jump List in the
1032      * **next** call to `app.setJumpList()`, Windows will not display any custom
1033      * category that contains any of the removed items.
1034      *
1035      * @platform win32
1036      */
1037     getJumpListSettings(): JumpListSettings;
1038     /**
1039      * The current application locale, fetched using Chromium's `l10n_util` library.
1040      * Possible return values are documented here.
1041      *
1042      * To set the locale, you'll want to use a command line switch at app startup,
1043      * which may be found here.
1044      *
1045      * **Note:** When distributing your packaged app, you have to also ship the
1046      * `locales` folder.
1047      *
1048      * **Note:** This API must be called after the `ready` event is emitted.
1049      *
1050      * **Note:** To see example return values of this API compared to other locale and
1051      * language APIs, see `app.getPreferredSystemLanguages()`.
1052      */
1053     getLocale(): string;
1054     /**
1055      * User operating system's locale two-letter ISO 3166 country code. The value is
1056      * taken from native OS APIs.
1057      *
1058      * **Note:** When unable to detect locale country code, it returns empty string.
1059      */
1060     getLocaleCountryCode(): string;
1061     /**
1062      * If you provided `path` and `args` options to `app.setLoginItemSettings`, then
1063      * you need to pass the same arguments here for `openAtLogin` to be set correctly.
1064      *
1065      *
1066      * * `openAtLogin` boolean - `true` if the app is set to open at login.
1067      * * `openAsHidden` boolean _macOS_ - `true` if the app is set to open as hidden at
1068      * login. This setting is not available on MAS builds.
1069      * * `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
1070      * automatically. This setting is not available on MAS builds.
1071      * * `wasOpenedAsHidden` boolean _macOS_ - `true` if the app was opened as a hidden
1072      * login item. This indicates that the app should not open any windows at startup.
1073      * This setting is not available on MAS builds.
1074      * * `restoreState` boolean _macOS_ - `true` if the app was opened as a login item
1075      * that should restore the state from the previous session. This indicates that the
1076      * app should restore the windows that were open the last time the app was closed.
1077      * This setting is not available on MAS builds.
1078      * * `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open
1079      * at login and its run key is not deactivated. This differs from `openAtLogin` as
1080      * it ignores the `args` option, this property will be true if the given executable
1081      * would be launched at login with **any** arguments.
1082      * * `launchItems` Object[] _Windows_
1083      *   * `name` string _Windows_ - name value of a registry entry.
1084      *   * `path` string _Windows_ - The executable to an app that corresponds to a
1085      * registry entry.
1086      *   * `args` string[] _Windows_ - the command-line arguments to pass to the
1087      * executable.
1088      *   * `scope` string _Windows_ - one of `user` or `machine`. Indicates whether the
1089      * registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
1090      *   * `enabled` boolean _Windows_ - `true` if the app registry key is startup
1091      * approved and therefore shows as `enabled` in Task Manager and Windows settings.
1092      *
1093      * @platform darwin,win32
1094      */
1095     getLoginItemSettings(options?: LoginItemSettingsOptions): LoginItemSettings;
1096     /**
1097      * The current application's name, which is the name in the application's
1098      * `package.json` file.
1099      *
1100      * Usually the `name` field of `package.json` is a short lowercase name, according
1101      * to the npm modules spec. You should usually also specify a `productName` field,
1102      * which is your application's full capitalized name, and which will be preferred
1103      * over `name` by Electron.
1104      */
1105     getName(): string;
1106     /**
1107      * A path to a special directory or file associated with `name`. On failure, an
1108      * `Error` is thrown.
1109      *
1110      * If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being
1111      * called first, a default log directory will be created equivalent to calling
1112      * `app.setAppLogsPath()` without a `path` parameter.
1113      */
1114     getPath(name: 'home' | 'appData' | 'userData' | 'sessionData' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'recent' | 'logs' | 'crashDumps'): string;
1115     /**
1116      * The user's preferred system languages from most preferred to least preferred,
1117      * including the country codes if applicable. A user can modify and add to this
1118      * list on Windows or macOS through the Language and Region settings.
1119      *
1120      * The API uses `GlobalizationPreferences` (with a fallback to
1121      * `GetSystemPreferredUILanguages`) on Windows, `\[NSLocale preferredLanguages\]`
1122      * on macOS, and `g_get_language_names` on Linux.
1123      *
1124      * This API can be used for purposes such as deciding what language to present the
1125      * application in.
1126      *
1127      * Here are some examples of return values of the various language and locale APIs
1128      * with different configurations:
1129      *
1130      * On Windows, given application locale is German, the regional format is Finnish
1131      * (Finland), and the preferred system languages from most to least preferred are
1132      * French (Canada), English (US), Simplified Chinese (China), Finnish, and Spanish
1133      * (Latin America):
1134      *
1135      * On macOS, given the application locale is German, the region is Finland, and the
1136      * preferred system languages from most to least preferred are French (Canada),
1137      * English (US), Simplified Chinese, and Spanish (Latin America):
1138      *
1139      * Both the available languages and regions and the possible return values differ
1140      * between the two operating systems.
1141      *
1142      * As can be seen with the example above, on Windows, it is possible that a
1143      * preferred system language has no country code, and that one of the preferred
1144      * system languages corresponds with the language used for the regional format. On
1145      * macOS, the region serves more as a default country code: the user doesn't need
1146      * to have Finnish as a preferred language to use Finland as the region,and the
1147      * country code `FI` is used as the country code for preferred system languages
1148      * that do not have associated countries in the language name.
1149      */
1150     getPreferredSystemLanguages(): string[];
1151     /**
1152      * The current system locale. On Windows and Linux, it is fetched using Chromium's
1153      * `i18n` library. On macOS, `[NSLocale currentLocale]` is used instead. To get the
1154      * user's current system language, which is not always the same as the locale, it
1155      * is better to use `app.getPreferredSystemLanguages()`.
1156      *
1157      * Different operating systems also use the regional data differently:
1158      *
1159      * * Windows 11 uses the regional format for numbers, dates, and times.
1160      * * macOS Monterey uses the region for formatting numbers, dates, times, and for
1161      * selecting the currency symbol to use.
1162      *
1163      * Therefore, this API can be used for purposes such as choosing a format for
1164      * rendering dates and times in a calendar app, especially when the developer wants
1165      * the format to be consistent with the OS.
1166      *
1167      * **Note:** This API must be called after the `ready` event is emitted.
1168      *
1169      * **Note:** To see example return values of this API compared to other locale and
1170      * language APIs, see `app.getPreferredSystemLanguages()`.
1171      */
1172     getSystemLocale(): string;
1173     /**
1174      * The version of the loaded application. If no version is found in the
1175      * application's `package.json` file, the version of the current bundle or
1176      * executable is returned.
1177      */
1178     getVersion(): string;
1179     /**
1180      * This method returns whether or not this instance of your app is currently
1181      * holding the single instance lock.  You can request the lock with
1182      * `app.requestSingleInstanceLock()` and release with
1183      * `app.releaseSingleInstanceLock()`
1184      */
1185     hasSingleInstanceLock(): boolean;
1186     /**
1187      * Hides all application windows without minimizing them.
1188      *
1189      * @platform darwin
1190      */
1191     hide(): void;
1192     /**
1193      * Imports the certificate in pkcs12 format into the platform certificate store.
1194      * `callback` is called with the `result` of import operation, a value of `0`
1195      * indicates success while any other value indicates failure according to Chromium
1196      * net_error_list.
1197      *
1198      * @platform linux
1199      */
1200     importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void;
1201     /**
1202      * Invalidates the current Handoff user activity.
1203      *
1204      * @platform darwin
1205      */
1206     invalidateCurrentActivity(): void;
1207     /**
1208      * `true` if Chrome's accessibility support is enabled, `false` otherwise. This API
1209      * will return `true` if the use of assistive technologies, such as screen readers,
1210      * has been detected. See
1211      * https://www.chromium.org/developers/design-documents/accessibility for more
1212      * details.
1213      *
1214      * @platform darwin,win32
1215      */
1216     isAccessibilitySupportEnabled(): boolean;
1217     /**
1218      * Whether the current executable is the default handler for a protocol (aka URI
1219      * scheme).
1220      *
1221      * **Note:** On macOS, you can use this method to check if the app has been
1222      * registered as the default protocol handler for a protocol. You can also verify
1223      * this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
1224      * macOS machine. Please refer to Apple's documentation for details.
1225      *
1226      * The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme`
1227      * internally.
1228      */
1229     isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1230     /**
1231      * whether or not the current OS version allows for native emoji pickers.
1232      */
1233     isEmojiPanelSupported(): boolean;
1234     /**
1235      * `true` if the application—including all of its windows—is hidden (e.g. with
1236      * `Command-H`), `false` otherwise.
1237      *
1238      * @platform darwin
1239      */
1240     isHidden(): boolean;
1241     /**
1242      * Whether the application is currently running from the systems Application
1243      * folder. Use in combination with `app.moveToApplicationsFolder()`
1244      *
1245      * @platform darwin
1246      */
1247     isInApplicationsFolder(): boolean;
1248     /**
1249      * `true` if Electron has finished initializing, `false` otherwise. See also
1250      * `app.whenReady()`.
1251      */
1252     isReady(): boolean;
1253     /**
1254      * whether `Secure Keyboard Entry` is enabled.
1255      *
1256      * By default this API will return `false`.
1257      *
1258      * @platform darwin
1259      */
1260     isSecureKeyboardEntryEnabled(): boolean;
1261     /**
1262      * Whether the current desktop environment is Unity launcher.
1263      *
1264      * @platform linux
1265      */
1266     isUnityRunning(): boolean;
1267     /**
1268      * Whether the move was successful. Please note that if the move is successful,
1269      * your application will quit and relaunch.
1270      *
1271      * No confirmation dialog will be presented by default. If you wish to allow the
1272      * user to confirm the operation, you may do so using the `dialog` API.
1273      *
1274      * **NOTE:** This method throws errors if anything other than the user causes the
1275      * move to fail. For instance if the user cancels the authorization dialog, this
1276      * method returns false. If we fail to perform the copy, then this method will
1277      * throw an error. The message in the error should be informative and tell you
1278      * exactly what went wrong.
1279      *
1280      * By default, if an app of the same name as the one being moved exists in the
1281      * Applications directory and is _not_ running, the existing app will be trashed
1282      * and the active app moved into its place. If it _is_ running, the preexisting
1283      * running app will assume focus and the previously active app will quit itself.
1284      * This behavior can be changed by providing the optional conflict handler, where
1285      * the boolean returned by the handler determines whether or not the move conflict
1286      * is resolved with default behavior.  i.e. returning `false` will ensure no
1287      * further action is taken, returning `true` will result in the default behavior
1288      * and the method continuing.
1289      *
1290      * For example:
1291      *
1292      * Would mean that if an app already exists in the user directory, if the user
1293      * chooses to 'Continue Move' then the function would continue with its default
1294      * behavior and the existing app will be trashed and the active app moved into its
1295      * place.
1296      *
1297      * @platform darwin
1298      */
1299     moveToApplicationsFolder(options?: MoveToApplicationsFolderOptions): boolean;
1300     /**
1301      * Try to close all windows. The `before-quit` event will be emitted first. If all
1302      * windows are successfully closed, the `will-quit` event will be emitted and by
1303      * default the application will terminate.
1304      *
1305      * This method guarantees that all `beforeunload` and `unload` event handlers are
1306      * correctly executed. It is possible that a window cancels the quitting by
1307      * returning `false` in the `beforeunload` event handler.
1308      */
1309     quit(): void;
1310     /**
1311      * Relaunches the app when current instance exits.
1312      *
1313      * By default, the new instance will use the same working directory and command
1314      * line arguments with current instance. When `args` is specified, the `args` will
1315      * be passed as command line arguments instead. When `execPath` is specified, the
1316      * `execPath` will be executed for relaunch instead of current app.
1317      *
1318      * Note that this method does not quit the app when executed, you have to call
1319      * `app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.
1320      *
1321      * When `app.relaunch` is called for multiple times, multiple instances will be
1322      * started after current instance exited.
1323      *
1324      * An example of restarting current instance immediately and adding a new command
1325      * line argument to the new instance:
1326      */
1327     relaunch(options?: RelaunchOptions): void;
1328     /**
1329      * Releases all locks that were created by `requestSingleInstanceLock`. This will
1330      * allow multiple instances of the application to once again run side by side.
1331      */
1332     releaseSingleInstanceLock(): void;
1333     /**
1334      * Whether the call succeeded.
1335      *
1336      * This method checks if the current executable as the default handler for a
1337      * protocol (aka URI scheme). If so, it will remove the app as the default handler.
1338      *
1339      * @platform darwin,win32
1340      */
1341     removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1342     /**
1343      * The return value of this method indicates whether or not this instance of your
1344      * application successfully obtained the lock.  If it failed to obtain the lock,
1345      * you can assume that another instance of your application is already running with
1346      * the lock and exit immediately.
1347      *
1348      * I.e. This method returns `true` if your process is the primary instance of your
1349      * application and your app should continue loading.  It returns `false` if your
1350      * process should immediately quit as it has sent its parameters to another
1351      * instance that has already acquired the lock.
1352      *
1353      * On macOS, the system enforces single instance automatically when users try to
1354      * open a second instance of your app in Finder, and the `open-file` and `open-url`
1355      * events will be emitted for that. However when users start your app in command
1356      * line, the system's single instance mechanism will be bypassed, and you have to
1357      * use this method to ensure single instance.
1358      *
1359      * An example of activating the window of primary instance when a second instance
1360      * starts:
1361      */
1362     requestSingleInstanceLock(additionalData?: Record<any, any>): boolean;
1363     /**
1364      * Marks the current Handoff user activity as inactive without invalidating it.
1365      *
1366      * @platform darwin
1367      */
1368     resignCurrentActivity(): void;
1369     /**
1370      * Set the about panel options. This will override the values defined in the app's
1371      * `.plist` file on macOS. See the Apple docs for more details. On Linux, values
1372      * must be set in order to be shown; there are no defaults.
1373      *
1374      * If you do not set `credits` but still wish to surface them in your app, AppKit
1375      * will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in
1376      * that order, in the bundle returned by the NSBundle class method main. The first
1377      * file found is used, and if none is found, the info area is left blank. See Apple
1378      * documentation for more information.
1379      */
1380     setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
1381     /**
1382      * Manually enables Chrome's accessibility support, allowing to expose
1383      * accessibility switch to users in application settings. See Chromium's
1384      * accessibility docs for more details. Disabled by default.
1385      *
1386      * This API must be called after the `ready` event is emitted.
1387      *
1388      * **Note:** Rendering accessibility tree can significantly affect the performance
1389      * of your app. It should not be enabled by default.
1390      *
1391      * @platform darwin,win32
1392      */
1393     setAccessibilitySupportEnabled(enabled: boolean): void;
1394     /**
1395      * Sets the activation policy for a given app.
1396      *
1397      * Activation policy types:
1398      *
1399      * * 'regular' - The application is an ordinary app that appears in the Dock and
1400      * may have a user interface.
1401      * * 'accessory' - The application doesn’t appear in the Dock and doesn’t have a
1402      * menu bar, but it may be activated programmatically or by clicking on one of its
1403      * windows.
1404      * * 'prohibited' - The application doesn’t appear in the Dock and may not create
1405      * windows or be activated.
1406      *
1407      * @platform darwin
1408      */
1409     setActivationPolicy(policy: 'regular' | 'accessory' | 'prohibited'): void;
1410     /**
1411      * Sets or creates a directory your app's logs which can then be manipulated with
1412      * `app.getPath()` or `app.setPath(pathName, newPath)`.
1413      *
1414      * Calling `app.setAppLogsPath()` without a `path` parameter will result in this
1415      * directory being set to `~/Library/Logs/YourAppName` on _macOS_, and inside the
1416      * `userData` directory on _Linux_ and _Windows_.
1417      */
1418     setAppLogsPath(path?: string): void;
1419     /**
1420      * Changes the Application User Model ID to `id`.
1421      *
1422      * @platform win32
1423      */
1424     setAppUserModelId(id: string): void;
1425     /**
1426      * Whether the call succeeded.
1427      *
1428      * Sets the current executable as the default handler for a protocol (aka URI
1429      * scheme). It allows you to integrate your app deeper into the operating system.
1430      * Once registered, all links with `your-protocol://` will be opened with the
1431      * current executable. The whole link, including protocol, will be passed to your
1432      * application as a parameter.
1433      *
1434      * **Note:** On macOS, you can only register protocols that have been added to your
1435      * app's `info.plist`, which cannot be modified at runtime. However, you can change
1436      * the file during build time via Electron Forge, Electron Packager, or by editing
1437      * `info.plist` with a text editor. Please refer to Apple's documentation for
1438      * details.
1439      *
1440      * **Note:** In a Windows Store environment (when packaged as an `appx`) this API
1441      * will return `true` for all calls but the registry key it sets won't be
1442      * accessible by other applications.  In order to register your Windows Store
1443      * application as a default protocol handler you must declare the protocol in your
1444      * manifest.
1445      *
1446      * The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme`
1447      * internally.
1448      */
1449     setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1450     /**
1451      * Whether the call succeeded.
1452      *
1453      * Sets the counter badge for current app. Setting the count to `0` will hide the
1454      * badge.
1455      *
1456      * On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
1457      *
1458      * **Note:** Unity launcher requires a `.desktop` file to work. For more
1459      * information, please read the Unity integration documentation.
1460      *
1461      * **Note:** On macOS, you need to ensure that your application has the permission
1462      * to display notifications for this method to work.
1463      *
1464      * @platform linux,darwin
1465      */
1466     setBadgeCount(count?: number): boolean;
1467     /**
1468      * Sets or removes a custom Jump List for the application, and returns one of the
1469      * following strings:
1470      *
1471      * * `ok` - Nothing went wrong.
1472      * * `error` - One or more errors occurred, enable runtime logging to figure out
1473      * the likely cause.
1474      * * `invalidSeparatorError` - An attempt was made to add a separator to a custom
1475      * category in the Jump List. Separators are only allowed in the standard `Tasks`
1476      * category.
1477      * * `fileTypeRegistrationError` - An attempt was made to add a file link to the
1478      * Jump List for a file type the app isn't registered to handle.
1479      * * `customCategoryAccessDeniedError` - Custom categories can't be added to the
1480      * Jump List due to user privacy or group policy settings.
1481      *
1482      * If `categories` is `null` the previously set custom Jump List (if any) will be
1483      * replaced by the standard Jump List for the app (managed by Windows).
1484      *
1485      * **Note:** If a `JumpListCategory` object has neither the `type` nor the `name`
1486      * property set then its `type` is assumed to be `tasks`. If the `name` property is
1487      * set but the `type` property is omitted then the `type` is assumed to be
1488      * `custom`.
1489      *
1490      * **Note:** Users can remove items from custom categories, and Windows will not
1491      * allow a removed item to be added back into a custom category until **after** the
1492      * next successful call to `app.setJumpList(categories)`. Any attempt to re-add a
1493      * removed item to a custom category earlier than that will result in the entire
1494      * custom category being omitted from the Jump List. The list of removed items can
1495      * be obtained using `app.getJumpListSettings()`.
1496      *
1497      * **Note:** The maximum length of a Jump List item's `description` property is 260
1498      * characters. Beyond this limit, the item will not be added to the Jump List, nor
1499      * will it be displayed.
1500      *
1501      * Here's a very simple example of creating a custom Jump List:
1502      *
1503      * @platform win32
1504      */
1505     setJumpList(categories: (JumpListCategory[]) | (null)): ('ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError');
1506     /**
1507      * To work with Electron's `autoUpdater` on Windows, which uses Squirrel, you'll
1508      * want to set the launch path to Update.exe, and pass arguments that specify your
1509      * application name. For example:
1510      *
1511      * @platform darwin,win32
1512      */
1513     setLoginItemSettings(settings: Settings): void;
1514     /**
1515      * Overrides the current application's name.
1516      *
1517      * **Note:** This function overrides the name used internally by Electron; it does
1518      * not affect the name that the OS uses.
1519      */
1520     setName(name: string): void;
1521     /**
1522      * Overrides the `path` to a special directory or file associated with `name`. If
1523      * the path specifies a directory that does not exist, an `Error` is thrown. In
1524      * that case, the directory should be created with `fs.mkdirSync` or similar.
1525      *
1526      * You can only override paths of a `name` defined in `app.getPath`.
1527      *
1528      * By default, web pages' cookies and caches will be stored under the `sessionData`
1529      * directory. If you want to change this location, you have to override the
1530      * `sessionData` path before the `ready` event of the `app` module is emitted.
1531      */
1532     setPath(name: string, path: string): void;
1533     /**
1534      * Set the `Secure Keyboard Entry` is enabled in your application.
1535      *
1536      * By using this API, important information such as password and other sensitive
1537      * information can be prevented from being intercepted by other processes.
1538      *
1539      * See Apple's documentation for more details.
1540      *
1541      * **Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it
1542      * when it is no longer needed.
1543      *
1544      * @platform darwin
1545      */
1546     setSecureKeyboardEntryEnabled(enabled: boolean): void;
1547     /**
1548      * Creates an `NSUserActivity` and sets it as the current activity. The activity is
1549      * eligible for Handoff to another device afterward.
1550      *
1551      * @platform darwin
1552      */
1553     setUserActivity(type: string, userInfo: any, webpageURL?: string): void;
1554     /**
1555      * Adds `tasks` to the Tasks category of the Jump List on Windows.
1556      *
1557      * `tasks` is an array of `Task` objects.
1558      *
1559      * Whether the call succeeded.
1560      *
1561      * **Note:** If you'd like to customize the Jump List even more use
1562      * `app.setJumpList(categories)` instead.
1563      *
1564      * @platform win32
1565      */
1566     setUserTasks(tasks: Task[]): boolean;
1567     /**
1568      * Shows application windows after they were hidden. Does not automatically focus
1569      * them.
1570      *
1571      * @platform darwin
1572      */
1573     show(): void;
1574     /**
1575      * Show the app's about panel options. These options can be overridden with
1576      * `app.setAboutPanelOptions(options)`. This function runs asynchronously.
1577      */
1578     showAboutPanel(): void;
1579     /**
1580      * Show the platform's native emoji picker.
1581      *
1582      * @platform darwin,win32
1583      */
1584     showEmojiPanel(): void;
1585     /**
1586      * This function **must** be called once you have finished accessing the security
1587      * scoped file. If you do not remember to stop accessing the bookmark, kernel
1588      * resources will be leaked and your app will lose its ability to reach outside the
1589      * sandbox completely, until your app is restarted.
1590      *
1591      * Start accessing a security scoped resource. With this method Electron
1592      * applications that are packaged for the Mac App Store may reach outside their
1593      * sandbox to access files chosen by the user. See Apple's documentation for a
1594      * description of how this system works.
1595      *
1596      * @platform mas
1597      */
1598     startAccessingSecurityScopedResource(bookmarkData: string): Function;
1599     /**
1600      * Updates the current activity if its type matches `type`, merging the entries
1601      * from `userInfo` into its current `userInfo` dictionary.
1602      *
1603      * @platform darwin
1604      */
1605     updateCurrentActivity(type: string, userInfo: any): void;
1606     /**
1607      * fulfilled when Electron is initialized. May be used as a convenient alternative
1608      * to checking `app.isReady()` and subscribing to the `ready` event if the app is
1609      * not ready yet.
1610      */
1611     whenReady(): Promise<void>;
1612     /**
1613      * A `boolean` property that's `true` if Chrome's accessibility support is enabled,
1614      * `false` otherwise. This property will be `true` if the use of assistive
1615      * technologies, such as screen readers, has been detected. Setting this property
1616      * to `true` manually enables Chrome's accessibility support, allowing developers
1617      * to expose accessibility switch to users in application settings.
1618      *
1619      * See Chromium's accessibility docs for more details. Disabled by default.
1620      *
1621      * This API must be called after the `ready` event is emitted.
1622      *
1623      * **Note:** Rendering accessibility tree can significantly affect the performance
1624      * of your app. It should not be enabled by default.
1625      *
1626      * @platform darwin,win32
1627      */
1628     accessibilitySupportEnabled: boolean;
1629     /**
1630      * A `Menu | null` property that returns `Menu` if one has been set and `null`
1631      * otherwise. Users can pass a Menu to set this property.
1632      */
1633     applicationMenu: (Menu) | (null);
1634     /**
1635      * An `Integer` property that returns the badge count for current app. Setting the
1636      * count to `0` will hide the badge.
1637      *
1638      * On macOS, setting this with any nonzero integer shows on the dock icon. On
1639      * Linux, this property only works for Unity launcher.
1640      *
1641      * **Note:** Unity launcher requires a `.desktop` file to work. For more
1642      * information, please read the Unity integration documentation.
1643      *
1644      * **Note:** On macOS, you need to ensure that your application has the permission
1645      * to display notifications for this property to take effect.
1646      *
1647      * @platform linux,darwin
1648      */
1649     badgeCount: number;
1650     /**
1651      * A `CommandLine` object that allows you to read and manipulate the command line
1652      * arguments that Chromium uses.
1653      *
1654      */
1655     readonly commandLine: CommandLine;
1656     /**
1657      * A `Dock` `| undefined` object that allows you to perform actions on your app
1658      * icon in the user's dock on macOS.
1659      *
1660      * @platform darwin
1661      */
1662     readonly dock: Dock;
1663     /**
1664      * A `boolean` property that returns  `true` if the app is packaged, `false`
1665      * otherwise. For many apps, this property can be used to distinguish development
1666      * and production environments.
1667      *
1668      */
1669     readonly isPackaged: boolean;
1670     /**
1671      * A `string` property that indicates the current application's name, which is the
1672      * name in the application's `package.json` file.
1673      *
1674      * Usually the `name` field of `package.json` is a short lowercase name, according
1675      * to the npm modules spec. You should usually also specify a `productName` field,
1676      * which is your application's full capitalized name, and which will be preferred
1677      * over `name` by Electron.
1678      */
1679     name: string;
1680     /**
1681      * A `boolean` which when `true` indicates that the app is currently running under
1682      * an ARM64 translator (like the macOS Rosetta Translator Environment or Windows
1683      * WOW).
1684      *
1685      * You can use this property to prompt users to download the arm64 version of your
1686      * application when they are mistakenly running the x64 version under Rosetta or
1687      * WOW.
1688      *
1689      * @platform darwin,win32
1690      */
1691     readonly runningUnderARM64Translation: boolean;
1692     /**
1693      * A `string` which is the user agent string Electron will use as a global
1694      * fallback.
1695      *
1696      * This is the user agent that will be used when no user agent is set at the
1697      * `webContents` or `session` level.  It is useful for ensuring that your entire
1698      * app has the same user agent.  Set to a custom value as early as possible in your
1699      * app's initialization to ensure that your overridden value is used.
1700      */
1701     userAgentFallback: string;
1702   }
1703
1704   interface AutoUpdater extends NodeJS.EventEmitter {
1705
1706     // Docs: https://electronjs.org/docs/api/auto-updater
1707
1708     /**
1709      * This event is emitted after a user calls `quitAndInstall()`.
1710      *
1711      * When this API is called, the `before-quit` event is not emitted before all
1712      * windows are closed. As a result you should listen to this event if you wish to
1713      * perform actions before the windows are closed while a process is quitting, as
1714      * well as listening to `before-quit`.
1715      */
1716     on(event: 'before-quit-for-update', listener: Function): this;
1717     off(event: 'before-quit-for-update', listener: Function): this;
1718     once(event: 'before-quit-for-update', listener: Function): this;
1719     addListener(event: 'before-quit-for-update', listener: Function): this;
1720     removeListener(event: 'before-quit-for-update', listener: Function): this;
1721     /**
1722      * Emitted when checking if an update has started.
1723      */
1724     on(event: 'checking-for-update', listener: Function): this;
1725     off(event: 'checking-for-update', listener: Function): this;
1726     once(event: 'checking-for-update', listener: Function): this;
1727     addListener(event: 'checking-for-update', listener: Function): this;
1728     removeListener(event: 'checking-for-update', listener: Function): this;
1729     /**
1730      * Emitted when there is an error while updating.
1731      */
1732     on(event: 'error', listener: (error: Error) => void): this;
1733     off(event: 'error', listener: (error: Error) => void): this;
1734     once(event: 'error', listener: (error: Error) => void): this;
1735     addListener(event: 'error', listener: (error: Error) => void): this;
1736     removeListener(event: 'error', listener: (error: Error) => void): this;
1737     /**
1738      * Emitted when there is an available update. The update is downloaded
1739      * automatically.
1740      */
1741     on(event: 'update-available', listener: Function): this;
1742     off(event: 'update-available', listener: Function): this;
1743     once(event: 'update-available', listener: Function): this;
1744     addListener(event: 'update-available', listener: Function): this;
1745     removeListener(event: 'update-available', listener: Function): this;
1746     /**
1747      * Emitted when an update has been downloaded.
1748      *
1749      * On Windows only `releaseName` is available.
1750      *
1751      * **Note:** It is not strictly necessary to handle this event. A successfully
1752      * downloaded update will still be applied the next time the application starts.
1753      */
1754     on(event: 'update-downloaded', listener: (event: Event,
1755                                               releaseNotes: string,
1756                                               releaseName: string,
1757                                               releaseDate: Date,
1758                                               updateURL: string) => void): this;
1759     off(event: 'update-downloaded', listener: (event: Event,
1760                                               releaseNotes: string,
1761                                               releaseName: string,
1762                                               releaseDate: Date,
1763                                               updateURL: string) => void): this;
1764     once(event: 'update-downloaded', listener: (event: Event,
1765                                               releaseNotes: string,
1766                                               releaseName: string,
1767                                               releaseDate: Date,
1768                                               updateURL: string) => void): this;
1769     addListener(event: 'update-downloaded', listener: (event: Event,
1770                                               releaseNotes: string,
1771                                               releaseName: string,
1772                                               releaseDate: Date,
1773                                               updateURL: string) => void): this;
1774     removeListener(event: 'update-downloaded', listener: (event: Event,
1775                                               releaseNotes: string,
1776                                               releaseName: string,
1777                                               releaseDate: Date,
1778                                               updateURL: string) => void): this;
1779     /**
1780      * Emitted when there is no available update.
1781      */
1782     on(event: 'update-not-available', listener: Function): this;
1783     off(event: 'update-not-available', listener: Function): this;
1784     once(event: 'update-not-available', listener: Function): this;
1785     addListener(event: 'update-not-available', listener: Function): this;
1786     removeListener(event: 'update-not-available', listener: Function): this;
1787     /**
1788      * Asks the server whether there is an update. You must call `setFeedURL` before
1789      * using this API.
1790      *
1791      * **Note:** If an update is available it will be downloaded automatically. Calling
1792      * `autoUpdater.checkForUpdates()` twice will download the update two times.
1793      */
1794     checkForUpdates(): void;
1795     /**
1796      * The current update feed URL.
1797      */
1798     getFeedURL(): string;
1799     /**
1800      * Restarts the app and installs the update after it has been downloaded. It should
1801      * only be called after `update-downloaded` has been emitted.
1802      *
1803      * Under the hood calling `autoUpdater.quitAndInstall()` will close all application
1804      * windows first, and automatically call `app.quit()` after all windows have been
1805      * closed.
1806      *
1807      * **Note:** It is not strictly necessary to call this function to apply an update,
1808      * as a successfully downloaded update will always be applied the next time the
1809      * application starts.
1810      */
1811     quitAndInstall(): void;
1812     /**
1813      * Sets the `url` and initialize the auto updater.
1814      */
1815     setFeedURL(options: FeedURLOptions): void;
1816   }
1817
1818   interface BluetoothDevice {
1819
1820     // Docs: https://electronjs.org/docs/api/structures/bluetooth-device
1821
1822     deviceId: string;
1823     deviceName: string;
1824   }
1825
1826   class BrowserView {
1827
1828     // Docs: https://electronjs.org/docs/api/browser-view
1829
1830     /**
1831      * BrowserView
1832      */
1833     constructor(options?: BrowserViewConstructorOptions);
1834     /**
1835      * The `bounds` of this BrowserView instance as `Object`.
1836      *
1837      * @experimental
1838      */
1839     getBounds(): Rectangle;
1840     /**
1841      * @experimental
1842      */
1843     setAutoResize(options: AutoResizeOptions): void;
1844     /**
1845      * Examples of valid `color` values:
1846      *
1847      * * Hex
1848      *   * #fff (RGB)
1849      *   * #ffff (ARGB)
1850      *   * #ffffff (RRGGBB)
1851      *   * #ffffffff (AARRGGBB)
1852      * * RGB
1853      *   * rgb(([\d]+),\s*([\d]+),\s*([\d]+))
1854      *     * e.g. rgb(255, 255, 255)
1855      * * RGBA
1856      *   * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))
1857      *     * e.g. rgba(255, 255, 255, 1.0)
1858      * * HSL
1859      *   * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%)
1860      *     * e.g. hsl(200, 20%, 50%)
1861      * * HSLA
1862      *   * hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+))
1863      *     * e.g. hsla(200, 20%, 50%, 0.5)
1864      * * Color name
1865      *   * Options are listed in SkParseColor.cpp
1866      *   * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
1867      *     * e.g. `blueviolet` or `red`
1868      *
1869      * **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBA` or
1870      * `RGA`.
1871      *
1872      * @experimental
1873      */
1874     setBackgroundColor(color: string): void;
1875     /**
1876      * Resizes and moves the view to the supplied bounds relative to the window.
1877      *
1878      * @experimental
1879      */
1880     setBounds(bounds: Rectangle): void;
1881     /**
1882      * A `WebContents` object owned by this view.
1883      *
1884      * @experimental
1885      */
1886     webContents: WebContents;
1887   }
1888
1889   class BrowserWindow extends NodeEventEmitter {
1890
1891     // Docs: https://electronjs.org/docs/api/browser-window
1892
1893     /**
1894      * Emitted when the window is set or unset to show always on top of other windows.
1895      */
1896     on(event: 'always-on-top-changed', listener: (event: Event,
1897                                                   isAlwaysOnTop: boolean) => void): this;
1898     off(event: 'always-on-top-changed', listener: (event: Event,
1899                                                   isAlwaysOnTop: boolean) => void): this;
1900     once(event: 'always-on-top-changed', listener: (event: Event,
1901                                                   isAlwaysOnTop: boolean) => void): this;
1902     addListener(event: 'always-on-top-changed', listener: (event: Event,
1903                                                   isAlwaysOnTop: boolean) => void): this;
1904     removeListener(event: 'always-on-top-changed', listener: (event: Event,
1905                                                   isAlwaysOnTop: boolean) => void): this;
1906     /**
1907      * Emitted when an App Command is invoked. These are typically related to keyboard
1908      * media keys or browser commands, as well as the "Back" button built into some
1909      * mice on Windows.
1910      *
1911      * Commands are lowercased, underscores are replaced with hyphens, and the
1912      * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
1913      * emitted as `browser-backward`.
1914      *
1915      * The following app commands are explicitly supported on Linux:
1916      *
1917      * * `browser-backward`
1918      * * `browser-forward`
1919      *
1920      * @platform win32,linux
1921      */
1922     on(event: 'app-command', listener: (event: Event,
1923                                         command: string) => void): this;
1924     off(event: 'app-command', listener: (event: Event,
1925                                         command: string) => void): this;
1926     once(event: 'app-command', listener: (event: Event,
1927                                         command: string) => void): this;
1928     addListener(event: 'app-command', listener: (event: Event,
1929                                         command: string) => void): this;
1930     removeListener(event: 'app-command', listener: (event: Event,
1931                                         command: string) => void): this;
1932     /**
1933      * Emitted when the window loses focus.
1934      */
1935     on(event: 'blur', listener: Function): this;
1936     off(event: 'blur', listener: Function): this;
1937     once(event: 'blur', listener: Function): this;
1938     addListener(event: 'blur', listener: Function): this;
1939     removeListener(event: 'blur', listener: Function): this;
1940     /**
1941      * Emitted when the window is going to be closed. It's emitted before the
1942      * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
1943      * will cancel the close.
1944      *
1945      * Usually you would want to use the `beforeunload` handler to decide whether the
1946      * window should be closed, which will also be called when the window is reloaded.
1947      * In Electron, returning any value other than `undefined` would cancel the close.
1948      * For example:
1949      *
1950      * _**Note**: There is a subtle difference between the behaviors of
1951      * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
1952      * handler)`. It is recommended to always set the `event.returnValue` explicitly,
1953      * instead of only returning a value, as the former works more consistently within
1954      * Electron._
1955      */
1956     on(event: 'close', listener: (event: Event) => void): this;
1957     off(event: 'close', listener: (event: Event) => void): this;
1958     once(event: 'close', listener: (event: Event) => void): this;
1959     addListener(event: 'close', listener: (event: Event) => void): this;
1960     removeListener(event: 'close', listener: (event: Event) => void): this;
1961     /**
1962      * Emitted when the window is closed. After you have received this event you should
1963      * remove the reference to the window and avoid using it any more.
1964      */
1965     on(event: 'closed', listener: Function): this;
1966     off(event: 'closed', listener: Function): this;
1967     once(event: 'closed', listener: Function): this;
1968     addListener(event: 'closed', listener: Function): this;
1969     removeListener(event: 'closed', listener: Function): this;
1970     /**
1971      * Emitted when the window enters a full-screen state.
1972      */
1973     on(event: 'enter-full-screen', listener: Function): this;
1974     off(event: 'enter-full-screen', listener: Function): this;
1975     once(event: 'enter-full-screen', listener: Function): this;
1976     addListener(event: 'enter-full-screen', listener: Function): this;
1977     removeListener(event: 'enter-full-screen', listener: Function): this;
1978     /**
1979      * Emitted when the window enters a full-screen state triggered by HTML API.
1980      */
1981     on(event: 'enter-html-full-screen', listener: Function): this;
1982     off(event: 'enter-html-full-screen', listener: Function): this;
1983     once(event: 'enter-html-full-screen', listener: Function): this;
1984     addListener(event: 'enter-html-full-screen', listener: Function): this;
1985     removeListener(event: 'enter-html-full-screen', listener: Function): this;
1986     /**
1987      * Emitted when the window gains focus.
1988      */
1989     on(event: 'focus', listener: Function): this;
1990     off(event: 'focus', listener: Function): this;
1991     once(event: 'focus', listener: Function): this;
1992     addListener(event: 'focus', listener: Function): this;
1993     removeListener(event: 'focus', listener: Function): this;
1994     /**
1995      * Emitted when the window is hidden.
1996      */
1997     on(event: 'hide', listener: Function): this;
1998     off(event: 'hide', listener: Function): this;
1999     once(event: 'hide', listener: Function): this;
2000     addListener(event: 'hide', listener: Function): this;
2001     removeListener(event: 'hide', listener: Function): this;
2002     /**
2003      * Emitted when the window leaves a full-screen state.
2004      */
2005     on(event: 'leave-full-screen', listener: Function): this;
2006     off(event: 'leave-full-screen', listener: Function): this;
2007     once(event: 'leave-full-screen', listener: Function): this;
2008     addListener(event: 'leave-full-screen', listener: Function): this;
2009     removeListener(event: 'leave-full-screen', listener: Function): this;
2010     /**
2011      * Emitted when the window leaves a full-screen state triggered by HTML API.
2012      */
2013     on(event: 'leave-html-full-screen', listener: Function): this;
2014     off(event: 'leave-html-full-screen', listener: Function): this;
2015     once(event: 'leave-html-full-screen', listener: Function): this;
2016     addListener(event: 'leave-html-full-screen', listener: Function): this;
2017     removeListener(event: 'leave-html-full-screen', listener: Function): this;
2018     /**
2019      * Emitted when window is maximized.
2020      */
2021     on(event: 'maximize', listener: Function): this;
2022     off(event: 'maximize', listener: Function): this;
2023     once(event: 'maximize', listener: Function): this;
2024     addListener(event: 'maximize', listener: Function): this;
2025     removeListener(event: 'maximize', listener: Function): this;
2026     /**
2027      * Emitted when the window is minimized.
2028      */
2029     on(event: 'minimize', listener: Function): this;
2030     off(event: 'minimize', listener: Function): this;
2031     once(event: 'minimize', listener: Function): this;
2032     addListener(event: 'minimize', listener: Function): this;
2033     removeListener(event: 'minimize', listener: Function): this;
2034     /**
2035      * Emitted when the window is being moved to a new position.
2036      */
2037     on(event: 'move', listener: Function): this;
2038     off(event: 'move', listener: Function): this;
2039     once(event: 'move', listener: Function): this;
2040     addListener(event: 'move', listener: Function): this;
2041     removeListener(event: 'move', listener: Function): this;
2042     /**
2043      * Emitted once when the window is moved to a new position.
2044      *
2045      * **Note**: On macOS this event is an alias of `move`.
2046      *
2047      * @platform darwin,win32
2048      */
2049     on(event: 'moved', listener: Function): this;
2050     off(event: 'moved', listener: Function): this;
2051     once(event: 'moved', listener: Function): this;
2052     addListener(event: 'moved', listener: Function): this;
2053     removeListener(event: 'moved', listener: Function): this;
2054     /**
2055      * Emitted when the native new tab button is clicked.
2056      *
2057      * @platform darwin
2058      */
2059     on(event: 'new-window-for-tab', listener: Function): this;
2060     off(event: 'new-window-for-tab', listener: Function): this;
2061     once(event: 'new-window-for-tab', listener: Function): this;
2062     addListener(event: 'new-window-for-tab', listener: Function): this;
2063     removeListener(event: 'new-window-for-tab', listener: Function): this;
2064     /**
2065      * Emitted when the document changed its title, calling `event.preventDefault()`
2066      * will prevent the native window's title from changing. `explicitSet` is false
2067      * when title is synthesized from file URL.
2068      */
2069     on(event: 'page-title-updated', listener: (event: Event,
2070                                                title: string,
2071                                                explicitSet: boolean) => void): this;
2072     off(event: 'page-title-updated', listener: (event: Event,
2073                                                title: string,
2074                                                explicitSet: boolean) => void): this;
2075     once(event: 'page-title-updated', listener: (event: Event,
2076                                                title: string,
2077                                                explicitSet: boolean) => void): this;
2078     addListener(event: 'page-title-updated', listener: (event: Event,
2079                                                title: string,
2080                                                explicitSet: boolean) => void): this;
2081     removeListener(event: 'page-title-updated', listener: (event: Event,
2082                                                title: string,
2083                                                explicitSet: boolean) => void): this;
2084     /**
2085      * Emitted when the web page has been rendered (while not being shown) and window
2086      * can be displayed without a visual flash.
2087      *
2088      * Please note that using this event implies that the renderer will be considered
2089      * "visible" and paint even though `show` is false.  This event will never fire if
2090      * you use `paintWhenInitiallyHidden: false`
2091      */
2092     on(event: 'ready-to-show', listener: Function): this;
2093     off(event: 'ready-to-show', listener: Function): this;
2094     once(event: 'ready-to-show', listener: Function): this;
2095     addListener(event: 'ready-to-show', listener: Function): this;
2096     removeListener(event: 'ready-to-show', listener: Function): this;
2097     /**
2098      * Emitted after the window has been resized.
2099      */
2100     on(event: 'resize', listener: Function): this;
2101     off(event: 'resize', listener: Function): this;
2102     once(event: 'resize', listener: Function): this;
2103     addListener(event: 'resize', listener: Function): this;
2104     removeListener(event: 'resize', listener: Function): this;
2105     /**
2106      * Emitted once when the window has finished being resized.
2107      *
2108      * This is usually emitted when the window has been resized manually. On macOS,
2109      * resizing the window with `setBounds`/`setSize` and setting the `animate`
2110      * parameter to `true` will also emit this event once resizing has finished.
2111      *
2112      * @platform darwin,win32
2113      */
2114     on(event: 'resized', listener: Function): this;
2115     off(event: 'resized', listener: Function): this;
2116     once(event: 'resized', listener: Function): this;
2117     addListener(event: 'resized', listener: Function): this;
2118     removeListener(event: 'resized', listener: Function): this;
2119     /**
2120      * Emitted when the unresponsive web page becomes responsive again.
2121      */
2122     on(event: 'responsive', listener: Function): this;
2123     off(event: 'responsive', listener: Function): this;
2124     once(event: 'responsive', listener: Function): this;
2125     addListener(event: 'responsive', listener: Function): this;
2126     removeListener(event: 'responsive', listener: Function): this;
2127     /**
2128      * Emitted when the window is restored from a minimized state.
2129      */
2130     on(event: 'restore', listener: Function): this;
2131     off(event: 'restore', listener: Function): this;
2132     once(event: 'restore', listener: Function): this;
2133     addListener(event: 'restore', listener: Function): this;
2134     removeListener(event: 'restore', listener: Function): this;
2135     /**
2136      * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
2137      * is ended. The `rotation` value on each emission is the angle in degrees rotated
2138      * since the last emission. The last emitted event upon a rotation gesture will
2139      * always be of value `0`. Counter-clockwise rotation values are positive, while
2140      * clockwise ones are negative.
2141      *
2142      * @platform darwin
2143      */
2144     on(event: 'rotate-gesture', listener: (event: Event,
2145                                            rotation: number) => void): this;
2146     off(event: 'rotate-gesture', listener: (event: Event,
2147                                            rotation: number) => void): this;
2148     once(event: 'rotate-gesture', listener: (event: Event,
2149                                            rotation: number) => void): this;
2150     addListener(event: 'rotate-gesture', listener: (event: Event,
2151                                            rotation: number) => void): this;
2152     removeListener(event: 'rotate-gesture', listener: (event: Event,
2153                                            rotation: number) => void): this;
2154     /**
2155      * Emitted when window session is going to end due to force shutdown or machine
2156      * restart or session log off.
2157      *
2158      * @platform win32
2159      */
2160     on(event: 'session-end', listener: Function): this;
2161     off(event: 'session-end', listener: Function): this;
2162     once(event: 'session-end', listener: Function): this;
2163     addListener(event: 'session-end', listener: Function): this;
2164     removeListener(event: 'session-end', listener: Function): this;
2165     /**
2166      * Emitted when the window opens a sheet.
2167      *
2168      * @platform darwin
2169      */
2170     on(event: 'sheet-begin', listener: Function): this;
2171     off(event: 'sheet-begin', listener: Function): this;
2172     once(event: 'sheet-begin', listener: Function): this;
2173     addListener(event: 'sheet-begin', listener: Function): this;
2174     removeListener(event: 'sheet-begin', listener: Function): this;
2175     /**
2176      * Emitted when the window has closed a sheet.
2177      *
2178      * @platform darwin
2179      */
2180     on(event: 'sheet-end', listener: Function): this;
2181     off(event: 'sheet-end', listener: Function): this;
2182     once(event: 'sheet-end', listener: Function): this;
2183     addListener(event: 'sheet-end', listener: Function): this;
2184     removeListener(event: 'sheet-end', listener: Function): this;
2185     /**
2186      * Emitted when the window is shown.
2187      */
2188     on(event: 'show', listener: Function): this;
2189     off(event: 'show', listener: Function): this;
2190     once(event: 'show', listener: Function): this;
2191     addListener(event: 'show', listener: Function): this;
2192     removeListener(event: 'show', listener: Function): this;
2193     /**
2194      * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
2195      * `left`.
2196      *
2197      * The method underlying this event is built to handle older macOS-style trackpad
2198      * swiping, where the content on the screen doesn't move with the swipe. Most macOS
2199      * trackpads are not configured to allow this kind of swiping anymore, so in order
2200      * for it to emit properly the 'Swipe between pages' preference in `System
2201      * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
2202      * fingers'.
2203      *
2204      * @platform darwin
2205      */
2206     on(event: 'swipe', listener: (event: Event,
2207                                   direction: string) => void): this;
2208     off(event: 'swipe', listener: (event: Event,
2209                                   direction: string) => void): this;
2210     once(event: 'swipe', listener: (event: Event,
2211                                   direction: string) => void): this;
2212     addListener(event: 'swipe', listener: (event: Event,
2213                                   direction: string) => void): this;
2214     removeListener(event: 'swipe', listener: (event: Event,
2215                                   direction: string) => void): this;
2216     /**
2217      * Emitted when the system context menu is triggered on the window, this is
2218      * normally only triggered when the user right clicks on the non-client area of
2219      * your window.  This is the window titlebar or any area you have declared as
2220      * `-webkit-app-region: drag` in a frameless window.
2221      *
2222      * Calling `event.preventDefault()` will prevent the menu from being displayed.
2223      *
2224      * @platform win32
2225      */
2226     on(event: 'system-context-menu', listener: (event: Event,
2227                                                 /**
2228                                                  * The screen coordinates the context menu was triggered at
2229                                                  */
2230                                                 point: Point) => void): this;
2231     off(event: 'system-context-menu', listener: (event: Event,
2232                                                 /**
2233                                                  * The screen coordinates the context menu was triggered at
2234                                                  */
2235                                                 point: Point) => void): this;
2236     once(event: 'system-context-menu', listener: (event: Event,
2237                                                 /**
2238                                                  * The screen coordinates the context menu was triggered at
2239                                                  */
2240                                                 point: Point) => void): this;
2241     addListener(event: 'system-context-menu', listener: (event: Event,
2242                                                 /**
2243                                                  * The screen coordinates the context menu was triggered at
2244                                                  */
2245                                                 point: Point) => void): this;
2246     removeListener(event: 'system-context-menu', listener: (event: Event,
2247                                                 /**
2248                                                  * The screen coordinates the context menu was triggered at
2249                                                  */
2250                                                 point: Point) => void): this;
2251     /**
2252      * Emitted when the window exits from a maximized state.
2253      */
2254     on(event: 'unmaximize', listener: Function): this;
2255     off(event: 'unmaximize', listener: Function): this;
2256     once(event: 'unmaximize', listener: Function): this;
2257     addListener(event: 'unmaximize', listener: Function): this;
2258     removeListener(event: 'unmaximize', listener: Function): this;
2259     /**
2260      * Emitted when the web page becomes unresponsive.
2261      */
2262     on(event: 'unresponsive', listener: Function): this;
2263     off(event: 'unresponsive', listener: Function): this;
2264     once(event: 'unresponsive', listener: Function): this;
2265     addListener(event: 'unresponsive', listener: Function): this;
2266     removeListener(event: 'unresponsive', listener: Function): this;
2267     /**
2268      * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
2269      * will prevent the window from being moved.
2270      *
2271      * Note that this is only emitted when the window is being moved manually. Moving
2272      * the window with `setPosition`/`setBounds`/`center` will not emit this event.
2273      *
2274      * @platform darwin,win32
2275      */
2276     on(event: 'will-move', listener: (event: Event,
2277                                       /**
2278                                        * Location the window is being moved to.
2279                                        */
2280                                       newBounds: Rectangle) => void): this;
2281     off(event: 'will-move', listener: (event: Event,
2282                                       /**
2283                                        * Location the window is being moved to.
2284                                        */
2285                                       newBounds: Rectangle) => void): this;
2286     once(event: 'will-move', listener: (event: Event,
2287                                       /**
2288                                        * Location the window is being moved to.
2289                                        */
2290                                       newBounds: Rectangle) => void): this;
2291     addListener(event: 'will-move', listener: (event: Event,
2292                                       /**
2293                                        * Location the window is being moved to.
2294                                        */
2295                                       newBounds: Rectangle) => void): this;
2296     removeListener(event: 'will-move', listener: (event: Event,
2297                                       /**
2298                                        * Location the window is being moved to.
2299                                        */
2300                                       newBounds: Rectangle) => void): this;
2301     /**
2302      * Emitted before the window is resized. Calling `event.preventDefault()` will
2303      * prevent the window from being resized.
2304      *
2305      * Note that this is only emitted when the window is being resized manually.
2306      * Resizing the window with `setBounds`/`setSize` will not emit this event.
2307      *
2308      * The possible values and behaviors of the `edge` option are platform dependent.
2309      * Possible values are:
2310      *
2311      * * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
2312      * `top-right`, `bottom-left`, `bottom-right`.
2313      * * On macOS, possible values are `bottom` and `right`.
2314      *   * The value `bottom` is used to denote vertical resizing.
2315      *   * The value `right` is used to denote horizontal resizing.
2316      *
2317      * @platform darwin,win32
2318      */
2319     on(event: 'will-resize', listener: (event: Event,
2320                                         /**
2321                                          * Size the window is being resized to.
2322                                          */
2323                                         newBounds: Rectangle,
2324                                         details: WillResizeDetails) => void): this;
2325     off(event: 'will-resize', listener: (event: Event,
2326                                         /**
2327                                          * Size the window is being resized to.
2328                                          */
2329                                         newBounds: Rectangle,
2330                                         details: WillResizeDetails) => void): this;
2331     once(event: 'will-resize', listener: (event: Event,
2332                                         /**
2333                                          * Size the window is being resized to.
2334                                          */
2335                                         newBounds: Rectangle,
2336                                         details: WillResizeDetails) => void): this;
2337     addListener(event: 'will-resize', listener: (event: Event,
2338                                         /**
2339                                          * Size the window is being resized to.
2340                                          */
2341                                         newBounds: Rectangle,
2342                                         details: WillResizeDetails) => void): this;
2343     removeListener(event: 'will-resize', listener: (event: Event,
2344                                         /**
2345                                          * Size the window is being resized to.
2346                                          */
2347                                         newBounds: Rectangle,
2348                                         details: WillResizeDetails) => void): this;
2349     /**
2350      * BrowserWindow
2351      */
2352     constructor(options?: BrowserWindowConstructorOptions);
2353     /**
2354      * The window that owns the given `browserView`. If the given view is not attached
2355      * to any window, returns `null`.
2356      */
2357     static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
2358     /**
2359      * The window with the given `id`.
2360      */
2361     static fromId(id: number): (BrowserWindow) | (null);
2362     /**
2363      * The window that owns the given `webContents` or `null` if the contents are not
2364      * owned by a window.
2365      */
2366     static fromWebContents(webContents: WebContents): (BrowserWindow) | (null);
2367     /**
2368      * An array of all opened browser windows.
2369      */
2370     static getAllWindows(): BrowserWindow[];
2371     /**
2372      * The window that is focused in this application, otherwise returns `null`.
2373      */
2374     static getFocusedWindow(): (BrowserWindow) | (null);
2375     /**
2376      * Replacement API for setBrowserView supporting work with multi browser views.
2377      *
2378      * @experimental
2379      */
2380     addBrowserView(browserView: BrowserView): void;
2381     /**
2382      * Adds a window as a tab on this window, after the tab for the window instance.
2383      *
2384      * @platform darwin
2385      */
2386     addTabbedWindow(browserWindow: BrowserWindow): void;
2387     /**
2388      * Removes focus from the window.
2389      */
2390     blur(): void;
2391     blurWebView(): void;
2392     /**
2393      * Resolves with a NativeImage
2394      *
2395      * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
2396      * whole visible page. If the page is not visible, `rect` may be empty. The page is
2397      * considered visible when its browser window is hidden and the capturer count is
2398      * non-zero. If you would like the page to stay hidden, you should ensure that
2399      * `stayHidden` is set to true.
2400      */
2401     capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
2402     /**
2403      * Moves window to the center of the screen.
2404      */
2405     center(): void;
2406     /**
2407      * Try to close the window. This has the same effect as a user manually clicking
2408      * the close button of the window. The web page may cancel the close though. See
2409      * the close event.
2410      */
2411     close(): void;
2412     /**
2413      * Closes the currently open Quick Look panel.
2414      *
2415      * @platform darwin
2416      */
2417     closeFilePreview(): void;
2418     /**
2419      * Force closing the window, the `unload` and `beforeunload` event won't be emitted
2420      * for the web page, and `close` event will also not be emitted for this window,
2421      * but it guarantees the `closed` event will be emitted.
2422      */
2423     destroy(): void;
2424     /**
2425      * Starts or stops flashing the window to attract user's attention.
2426      */
2427     flashFrame(flag: boolean): void;
2428     /**
2429      * Focuses on the window.
2430      */
2431     focus(): void;
2432     focusOnWebView(): void;
2433     /**
2434      * Gets the background color of the window in Hex (`#RRGGBB`) format.
2435      *
2436      * See Setting `backgroundColor`.
2437      *
2438      * **Note:** The alpha value is _not_ returned alongside the red, green, and blue
2439      * values.
2440      */
2441     getBackgroundColor(): string;
2442     /**
2443      * The `bounds` of the window as `Object`.
2444      *
2445      * **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
2446      * height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
2447      * 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
2448      * 25, y: 38, width: 800, height: 600 }`.
2449      */
2450     getBounds(): Rectangle;
2451     /**
2452      * The `BrowserView` attached to `win`. Returns `null` if one is not attached.
2453      * Throws an error if multiple `BrowserView`s are attached.
2454      *
2455      * @experimental
2456      */
2457     getBrowserView(): (BrowserView) | (null);
2458     /**
2459      * a sorted by z-index array of all BrowserViews that have been attached with
2460      * `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
2461      * element of the array.
2462      *
2463      * **Note:** The BrowserView API is currently experimental and may change or be
2464      * removed in future Electron releases.
2465      *
2466      * @experimental
2467      */
2468     getBrowserViews(): BrowserView[];
2469     /**
2470      * All child windows.
2471      */
2472     getChildWindows(): BrowserWindow[];
2473     /**
2474      * The `bounds` of the window's client area as `Object`.
2475      */
2476     getContentBounds(): Rectangle;
2477     /**
2478      * Contains the window's client area's width and height.
2479      */
2480     getContentSize(): number[];
2481     /**
2482      * Contains the window's maximum width and height.
2483      */
2484     getMaximumSize(): number[];
2485     /**
2486      * Window id in the format of DesktopCapturerSource's id. For example
2487      * "window:1324:0".
2488      *
2489      * More precisely the format is `window:id:other_id` where `id` is `HWND` on
2490      * Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
2491      * Linux. `other_id` is used to identify web contents (tabs) so within the same top
2492      * level window.
2493      */
2494     getMediaSourceId(): string;
2495     /**
2496      * Contains the window's minimum width and height.
2497      */
2498     getMinimumSize(): number[];
2499     /**
2500      * The platform-specific handle of the window.
2501      *
2502      * The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
2503      * `Window` (`unsigned long`) on Linux.
2504      */
2505     getNativeWindowHandle(): Buffer;
2506     /**
2507      * Contains the window bounds of the normal state
2508      *
2509      * **Note:** whatever the current state of the window : maximized, minimized or in
2510      * fullscreen, this function always returns the position and size of the window in
2511      * normal state. In normal state, getBounds and getNormalBounds returns the same
2512      * `Rectangle`.
2513      */
2514     getNormalBounds(): Rectangle;
2515     /**
2516      * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
2517      * 1.
2518      */
2519     getOpacity(): number;
2520     /**
2521      * The parent window or `null` if there is no parent.
2522      */
2523     getParentWindow(): (BrowserWindow) | (null);
2524     /**
2525      * Contains the window's current position.
2526      */
2527     getPosition(): number[];
2528     /**
2529      * The pathname of the file the window represents.
2530      *
2531      * @platform darwin
2532      */
2533     getRepresentedFilename(): string;
2534     /**
2535      * Contains the window's width and height.
2536      */
2537     getSize(): number[];
2538     /**
2539      * The title of the native window.
2540      *
2541      * **Note:** The title of the web page can be different from the title of the
2542      * native window.
2543      */
2544     getTitle(): string;
2545     /**
2546      * The custom position for the traffic light buttons in frameless window, `null`
2547      * will be returned when there is no custom position.
2548      *
2549      * @platform darwin
2550      */
2551     getWindowButtonPosition(): (Point) | (null);
2552     /**
2553      * Whether the window has a shadow.
2554      */
2555     hasShadow(): boolean;
2556     /**
2557      * Hides the window.
2558      */
2559     hide(): void;
2560     /**
2561      * Hooks a windows message. The `callback` is called when the message is received
2562      * in the WndProc.
2563      *
2564      * @platform win32
2565      */
2566     hookWindowMessage(message: number, callback: (wParam: Buffer, lParam: Buffer) => void): void;
2567     /**
2568      * Invalidates the window shadow so that it is recomputed based on the current
2569      * window shape.
2570      *
2571      * `BrowserWindows` that are transparent can sometimes leave behind visual
2572      * artifacts on macOS. This method can be used to clear these artifacts when, for
2573      * example, performing an animation.
2574      *
2575      * @platform darwin
2576      */
2577     invalidateShadow(): void;
2578     /**
2579      * Whether the window is always on top of other windows.
2580      */
2581     isAlwaysOnTop(): boolean;
2582     /**
2583      * Whether the window can be manually closed by user.
2584      *
2585      * On Linux always returns `true`.
2586      *
2587      * @platform darwin,win32
2588      */
2589     isClosable(): boolean;
2590     /**
2591      * Whether the window is destroyed.
2592      */
2593     isDestroyed(): boolean;
2594     /**
2595      * Whether the window's document has been edited.
2596      *
2597      * @platform darwin
2598      */
2599     isDocumentEdited(): boolean;
2600     /**
2601      * whether the window is enabled.
2602      */
2603     isEnabled(): boolean;
2604     /**
2605      * Whether the window can be focused.
2606      *
2607      * @platform darwin,win32
2608      */
2609     isFocusable(): boolean;
2610     /**
2611      * Whether the window is focused.
2612      */
2613     isFocused(): boolean;
2614     /**
2615      * Whether the window is in fullscreen mode.
2616      */
2617     isFullScreen(): boolean;
2618     /**
2619      * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
2620      * window.
2621      */
2622     isFullScreenable(): boolean;
2623     /**
2624      * Whether the window will be hidden when the user toggles into mission control.
2625      *
2626      * @platform darwin
2627      */
2628     isHiddenInMissionControl(): boolean;
2629     /**
2630      * Whether the window is in kiosk mode.
2631      */
2632     isKiosk(): boolean;
2633     /**
2634      * Whether the window can be manually maximized by user.
2635      *
2636      * On Linux always returns `true`.
2637      *
2638      * @platform darwin,win32
2639      */
2640     isMaximizable(): boolean;
2641     /**
2642      * Whether the window is maximized.
2643      */
2644     isMaximized(): boolean;
2645     /**
2646      * Whether menu bar automatically hides itself.
2647      *
2648      * @platform win32,linux
2649      */
2650     isMenuBarAutoHide(): boolean;
2651     /**
2652      * Whether the menu bar is visible.
2653      *
2654      * @platform win32,linux
2655      */
2656     isMenuBarVisible(): boolean;
2657     /**
2658      * Whether the window can be manually minimized by the user.
2659      *
2660      * On Linux always returns `true`.
2661      *
2662      * @platform darwin,win32
2663      */
2664     isMinimizable(): boolean;
2665     /**
2666      * Whether the window is minimized.
2667      */
2668     isMinimized(): boolean;
2669     /**
2670      * Whether current window is a modal window.
2671      */
2672     isModal(): boolean;
2673     /**
2674      * Whether the window can be moved by user.
2675      *
2676      * On Linux always returns `true`.
2677      *
2678      * @platform darwin,win32
2679      */
2680     isMovable(): boolean;
2681     /**
2682      * Whether the window is in normal state (not maximized, not minimized, not in
2683      * fullscreen mode).
2684      */
2685     isNormal(): boolean;
2686     /**
2687      * Whether the window can be manually resized by the user.
2688      */
2689     isResizable(): boolean;
2690     /**
2691      * Whether the window is in simple (pre-Lion) fullscreen mode.
2692      *
2693      * @platform darwin
2694      */
2695     isSimpleFullScreen(): boolean;
2696     /**
2697      * Whether the window is in Windows 10 tablet mode.
2698      *
2699      * Since Windows 10 users can use their PC as tablet, under this mode apps can
2700      * choose to optimize their UI for tablets, such as enlarging the titlebar and
2701      * hiding titlebar buttons.
2702      *
2703      * This API returns whether the window is in tablet mode, and the `resize` event
2704      * can be be used to listen to changes to tablet mode.
2705      *
2706      * @platform win32
2707      */
2708     isTabletMode(): boolean;
2709     /**
2710      * Whether the window is visible to the user in the foreground of the app.
2711      */
2712     isVisible(): boolean;
2713     /**
2714      * Whether the window is visible on all workspaces.
2715      *
2716      * **Note:** This API always returns false on Windows.
2717      *
2718      * @platform darwin,linux
2719      */
2720     isVisibleOnAllWorkspaces(): boolean;
2721     /**
2722      * `true` or `false` depending on whether the message is hooked.
2723      *
2724      * @platform win32
2725      */
2726     isWindowMessageHooked(message: number): boolean;
2727     /**
2728      * the promise will resolve when the page has finished loading (see
2729      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
2730      *
2731      * Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
2732      * relative to the root of your application.  See the `webContents` docs for more
2733      * information.
2734      */
2735     loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
2736     /**
2737      * the promise will resolve when the page has finished loading (see
2738      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
2739      *
2740      * Same as `webContents.loadURL(url[, options])`.
2741      *
2742      * The `url` can be a remote address (e.g. `http://`) or a path to a local HTML
2743      * file using the `file://` protocol.
2744      *
2745      * To ensure that file URLs are properly formatted, it is recommended to use Node's
2746      * `url.format` method:
2747      *
2748      * You can load a URL using a `POST` request with URL-encoded data by doing the
2749      * following:
2750      */
2751     loadURL(url: string, options?: LoadURLOptions): Promise<void>;
2752     /**
2753      * Maximizes the window. This will also show (but not focus) the window if it isn't
2754      * being displayed already.
2755      */
2756     maximize(): void;
2757     /**
2758      * Merges all windows into one window with multiple tabs when native tabs are
2759      * enabled and there is more than one open window.
2760      *
2761      * @platform darwin
2762      */
2763     mergeAllWindows(): void;
2764     /**
2765      * Minimizes the window. On some platforms the minimized window will be shown in
2766      * the Dock.
2767      */
2768     minimize(): void;
2769     /**
2770      * Moves window above the source window in the sense of z-order. If the
2771      * `mediaSourceId` is not of type window or if the window does not exist then this
2772      * method throws an error.
2773      */
2774     moveAbove(mediaSourceId: string): void;
2775     /**
2776      * Moves the current tab into a new window if native tabs are enabled and there is
2777      * more than one tab in the current window.
2778      *
2779      * @platform darwin
2780      */
2781     moveTabToNewWindow(): void;
2782     /**
2783      * Moves window to top(z-order) regardless of focus
2784      */
2785     moveTop(): void;
2786     /**
2787      * Uses Quick Look to preview a file at a given path.
2788      *
2789      * @platform darwin
2790      */
2791     previewFile(path: string, displayName?: string): void;
2792     /**
2793      * Same as `webContents.reload`.
2794      */
2795     reload(): void;
2796     /**
2797      * @experimental
2798      */
2799     removeBrowserView(browserView: BrowserView): void;
2800     /**
2801      * Remove the window's menu bar.
2802      *
2803      * @platform linux,win32
2804      */
2805     removeMenu(): void;
2806     /**
2807      * Restores the window from minimized state to its previous state.
2808      */
2809     restore(): void;
2810     /**
2811      * Selects the next tab when native tabs are enabled and there are other tabs in
2812      * the window.
2813      *
2814      * @platform darwin
2815      */
2816     selectNextTab(): void;
2817     /**
2818      * Selects the previous tab when native tabs are enabled and there are other tabs
2819      * in the window.
2820      *
2821      * @platform darwin
2822      */
2823     selectPreviousTab(): void;
2824     /**
2825      * Sets whether the window should show always on top of other windows. After
2826      * setting this, the window is still a normal window, not a toolbox window which
2827      * can not be focused on.
2828      */
2829     setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver', relativeLevel?: number): void;
2830     /**
2831      * Sets the properties for the window's taskbar button.
2832      *
2833      * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
2834      * together. If one of those properties is not set, then neither will be used.
2835      *
2836      * @platform win32
2837      */
2838     setAppDetails(options: AppDetailsOptions): void;
2839     /**
2840      * This will make a window maintain an aspect ratio. The extra size allows a
2841      * developer to have space, specified in pixels, not included within the aspect
2842      * ratio calculations. This API already takes into account the difference between a
2843      * window's size and its content size.
2844      *
2845      * Consider a normal window with an HD video player and associated controls.
2846      * Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
2847      * on the right edge and 50 pixels of controls below the player. In order to
2848      * maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
2849      * the player itself we would call this function with arguments of 16/9 and {
2850      * width: 40, height: 50 }. The second argument doesn't care where the extra width
2851      * and height are within the content view--only that they exist. Sum any extra
2852      * width and height areas you have within the overall content view.
2853      *
2854      * The aspect ratio is not respected when window is resized programmatically with
2855      * APIs like `win.setSize`.
2856      *
2857      * To reset an aspect ratio, pass 0 as the `aspectRatio` value:
2858      * `win.setAspectRatio(0)`.
2859      */
2860     setAspectRatio(aspectRatio: number, extraSize?: Size): void;
2861     /**
2862      * Controls whether to hide cursor when typing.
2863      *
2864      * @platform darwin
2865      */
2866     setAutoHideCursor(autoHide: boolean): void;
2867     /**
2868      * Sets whether the window menu bar should hide itself automatically. Once set the
2869      * menu bar will only show when users press the single `Alt` key.
2870      *
2871      * If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
2872      * hide it immediately.
2873      *
2874      * @platform win32,linux
2875      */
2876     setAutoHideMenuBar(hide: boolean): void;
2877     /**
2878      * Examples of valid `backgroundColor` values:
2879      *
2880      * * Hex
2881      *   * #fff (shorthand RGB)
2882      *   * #ffff (shorthand ARGB)
2883      *   * #ffffff (RGB)
2884      *   * #ffffffff (ARGB)
2885      * * RGB
2886      *   * rgb(([\d]+),\s*([\d]+),\s*([\d]+))
2887      *     * e.g. rgb(255, 255, 255)
2888      * * RGBA
2889      *   * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))
2890      *     * e.g. rgba(255, 255, 255, 1.0)
2891      * * HSL
2892      *   * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%)
2893      *     * e.g. hsl(200, 20%, 50%)
2894      * * HSLA
2895      *   * hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+))
2896      *     * e.g. hsla(200, 20%, 50%, 0.5)
2897      * * Color name
2898      *   * Options are listed in SkParseColor.cpp
2899      *   * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
2900      *     * e.g. `blueviolet` or `red`
2901      *
2902      * Sets the background color of the window. See Setting `backgroundColor`.
2903      */
2904     setBackgroundColor(backgroundColor: string): void;
2905     /**
2906      * This method sets the browser window's system-drawn background material,
2907      * including behind the non-client area.
2908      *
2909      * See the Windows documentation for more details.
2910      *
2911      * **Note:** This method is only supported on Windows 11 22H2 and up.
2912      *
2913      * @platform win32
2914      */
2915     setBackgroundMaterial(material: 'auto' | 'none' | 'mica' | 'acrylic' | 'tabbed'): void;
2916     /**
2917      * Resizes and moves the window to the supplied bounds. Any properties that are not
2918      * supplied will default to their current values.
2919      *
2920      * **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
2921      * height. The tray height has changed over time and depends on the operating
2922      * system, but is between 20-40px. Passing a value lower than the tray height will
2923      * result in a window that is flush to the tray.
2924      */
2925     setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
2926     /**
2927      * @experimental
2928      */
2929     setBrowserView(browserView: (BrowserView) | (null)): void;
2930     /**
2931      * Sets whether the window can be manually closed by user. On Linux does nothing.
2932      *
2933      * @platform darwin,win32
2934      */
2935     setClosable(closable: boolean): void;
2936     /**
2937      * Resizes and moves the window's client area (e.g. the web page) to the supplied
2938      * bounds.
2939      */
2940     setContentBounds(bounds: Rectangle, animate?: boolean): void;
2941     /**
2942      * Prevents the window contents from being captured by other apps.
2943      *
2944      * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
2945      * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
2946      * version 2004 and up the window will be removed from capture entirely, older
2947      * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
2948      *
2949      * @platform darwin,win32
2950      */
2951     setContentProtection(enable: boolean): void;
2952     /**
2953      * Resizes the window's client area (e.g. the web page) to `width` and `height`.
2954      */
2955     setContentSize(width: number, height: number, animate?: boolean): void;
2956     /**
2957      * Specifies whether the window’s document has been edited, and the icon in title
2958      * bar will become gray when set to `true`.
2959      *
2960      * @platform darwin
2961      */
2962     setDocumentEdited(edited: boolean): void;
2963     /**
2964      * Disable or enable the window.
2965      */
2966     setEnabled(enable: boolean): void;
2967     /**
2968      * Changes whether the window can be focused.
2969      *
2970      * On macOS it does not remove the focus from the window.
2971      *
2972      * @platform darwin,win32
2973      */
2974     setFocusable(focusable: boolean): void;
2975     /**
2976      * Sets whether the window should be in fullscreen mode.
2977      *
2978      * **Note:** On macOS, fullscreen transitions take place asynchronously. If further
2979      * actions depend on the fullscreen state, use the 'enter-full-screen' or
2980      * 'leave-full-screen' events.
2981      */
2982     setFullScreen(flag: boolean): void;
2983     /**
2984      * Sets whether the maximize/zoom window button toggles fullscreen mode or
2985      * maximizes the window.
2986      */
2987     setFullScreenable(fullscreenable: boolean): void;
2988     /**
2989      * Sets whether the window should have a shadow.
2990      */
2991     setHasShadow(hasShadow: boolean): void;
2992     /**
2993      * Sets whether the window will be hidden when the user toggles into mission
2994      * control.
2995      *
2996      * @platform darwin
2997      */
2998     setHiddenInMissionControl(hidden: boolean): void;
2999     /**
3000      * Changes window icon.
3001      *
3002      * @platform win32,linux
3003      */
3004     setIcon(icon: (NativeImage) | (string)): void;
3005     /**
3006      * Makes the window ignore all mouse events.
3007      *
3008      * All mouse events happened in this window will be passed to the window below this
3009      * window, but if this window has focus, it will still receive keyboard events.
3010      */
3011     setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
3012     /**
3013      * Enters or leaves kiosk mode.
3014      */
3015     setKiosk(flag: boolean): void;
3016     /**
3017      * Sets whether the window can be manually maximized by user. On Linux does
3018      * nothing.
3019      *
3020      * @platform darwin,win32
3021      */
3022     setMaximizable(maximizable: boolean): void;
3023     /**
3024      * Sets the maximum size of window to `width` and `height`.
3025      */
3026     setMaximumSize(width: number, height: number): void;
3027     /**
3028      * Sets the `menu` as the window's menu bar.
3029      *
3030      * @platform linux,win32
3031      */
3032     setMenu(menu: (Menu) | (null)): void;
3033     /**
3034      * Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
3035      * can still bring up the menu bar by pressing the single `Alt` key.
3036      *
3037      * @platform win32,linux
3038      */
3039     setMenuBarVisibility(visible: boolean): void;
3040     /**
3041      * Sets whether the window can be manually minimized by user. On Linux does
3042      * nothing.
3043      *
3044      * @platform darwin,win32
3045      */
3046     setMinimizable(minimizable: boolean): void;
3047     /**
3048      * Sets the minimum size of window to `width` and `height`.
3049      */
3050     setMinimumSize(width: number, height: number): void;
3051     /**
3052      * Sets whether the window can be moved by user. On Linux does nothing.
3053      *
3054      * @platform darwin,win32
3055      */
3056     setMovable(movable: boolean): void;
3057     /**
3058      * Sets the opacity of the window. On Linux, does nothing. Out of bound number
3059      * values are clamped to the [0, 1] range.
3060      *
3061      * @platform win32,darwin
3062      */
3063     setOpacity(opacity: number): void;
3064     /**
3065      * Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
3066      * convey some sort of application status or to passively notify the user.
3067      *
3068      * @platform win32
3069      */
3070     setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
3071     /**
3072      * Sets `parent` as current window's parent window, passing `null` will turn
3073      * current window into a top-level window.
3074      */
3075     setParentWindow(parent: (BrowserWindow) | (null)): void;
3076     /**
3077      * Moves window to `x` and `y`.
3078      */
3079     setPosition(x: number, y: number, animate?: boolean): void;
3080     /**
3081      * Sets progress value in progress bar. Valid range is [0, 1.0].
3082      *
3083      * Remove progress bar when progress < 0; Change to indeterminate mode when
3084      * progress > 1.
3085      *
3086      * On Linux platform, only supports Unity desktop environment, you need to specify
3087      * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
3088      * it will assume `{app.name}.desktop`.
3089      *
3090      * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
3091      * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
3092      * mode set (but with a value within the valid range), `normal` will be assumed.
3093      */
3094     setProgressBar(progress: number, options?: ProgressBarOptions): void;
3095     /**
3096      * Sets the pathname of the file the window represents, and the icon of the file
3097      * will show in window's title bar.
3098      *
3099      * @platform darwin
3100      */
3101     setRepresentedFilename(filename: string): void;
3102     /**
3103      * Sets whether the window can be manually resized by the user.
3104      */
3105     setResizable(resizable: boolean): void;
3106     /**
3107      * Setting a window shape determines the area within the window where the system
3108      * permits drawing and user interaction. Outside of the given region, no pixels
3109      * will be drawn and no mouse events will be registered. Mouse events outside of
3110      * the region will not be received by that window, but will fall through to
3111      * whatever is behind the window.
3112      *
3113      * @experimental
3114      * @platform win32,linux
3115      */
3116     setShape(rects: Rectangle[]): void;
3117     /**
3118      * Changes the attachment point for sheets on macOS. By default, sheets are
3119      * attached just below the window frame, but you may want to display them beneath a
3120      * HTML-rendered toolbar. For example:
3121      *
3122      * @platform darwin
3123      */
3124     setSheetOffset(offsetY: number, offsetX?: number): void;
3125     /**
3126      * Enters or leaves simple fullscreen mode.
3127      *
3128      * Simple fullscreen mode emulates the native fullscreen behavior found in versions
3129      * of macOS prior to Lion (10.7).
3130      *
3131      * @platform darwin
3132      */
3133     setSimpleFullScreen(flag: boolean): void;
3134     /**
3135      * Resizes the window to `width` and `height`. If `width` or `height` are below any
3136      * set minimum size constraints the window will snap to its minimum size.
3137      */
3138     setSize(width: number, height: number, animate?: boolean): void;
3139     /**
3140      * Makes the window not show in the taskbar.
3141      *
3142      * @platform darwin,win32
3143      */
3144     setSkipTaskbar(skip: boolean): void;
3145     /**
3146      * Whether the buttons were added successfully
3147      *
3148      * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
3149      * of a window in a taskbar button layout. Returns a `boolean` object indicates
3150      * whether the thumbnail has been added successfully.
3151      *
3152      * The number of buttons in thumbnail toolbar should be no greater than 7 due to
3153      * the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
3154      * removed due to the platform's limitation. But you can call the API with an empty
3155      * array to clean the buttons.
3156      *
3157      * The `buttons` is an array of `Button` objects:
3158      *
3159      * * `Button` Object
3160      *   * `icon` NativeImage - The icon showing in thumbnail toolbar.
3161      *   * `click` Function
3162      *   * `tooltip` string (optional) - The text of the button's tooltip.
3163      *   * `flags` string[] (optional) - Control specific states and behaviors of the
3164      * button. By default, it is `['enabled']`.
3165      *
3166      * The `flags` is an array that can include following `string`s:
3167      *
3168      * * `enabled` - The button is active and available to the user.
3169      * * `disabled` - The button is disabled. It is present, but has a visual state
3170      * indicating it will not respond to user action.
3171      * * `dismissonclick` - When the button is clicked, the thumbnail window closes
3172      * immediately.
3173      * * `nobackground` - Do not draw a button border, use only the image.
3174      * * `hidden` - The button is not shown to the user.
3175      * * `noninteractive` - The button is enabled but not interactive; no pressed
3176      * button state is drawn. This value is intended for instances where the button is
3177      * used in a notification.
3178      *
3179      * @platform win32
3180      */
3181     setThumbarButtons(buttons: ThumbarButton[]): boolean;
3182     /**
3183      * Sets the region of the window to show as the thumbnail image displayed when
3184      * hovering over the window in the taskbar. You can reset the thumbnail to be the
3185      * entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
3186      * }`.
3187      *
3188      * @platform win32
3189      */
3190     setThumbnailClip(region: Rectangle): void;
3191     /**
3192      * Sets the toolTip that is displayed when hovering over the window thumbnail in
3193      * the taskbar.
3194      *
3195      * @platform win32
3196      */
3197     setThumbnailToolTip(toolTip: string): void;
3198     /**
3199      * Changes the title of native window to `title`.
3200      */
3201     setTitle(title: string): void;
3202     /**
3203      * On a Window with Window Controls Overlay already enabled, this method updates
3204      * the style of the title bar overlay.
3205      *
3206      * @platform win32
3207      */
3208     setTitleBarOverlay(options: TitleBarOverlayOptions): void;
3209     /**
3210      * Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
3211      * error if `browserView` is not attached to `win`.
3212      *
3213      * @experimental
3214      */
3215     setTopBrowserView(browserView: BrowserView): void;
3216     /**
3217      * Sets the touchBar layout for the current window. Specifying `null` or
3218      * `undefined` clears the touch bar. This method only has an effect if the machine
3219      * has a touch bar.
3220      *
3221      * **Note:** The TouchBar API is currently experimental and may change or be
3222      * removed in future Electron releases.
3223      *
3224      * @platform darwin
3225      */
3226     setTouchBar(touchBar: (TouchBar) | (null)): void;
3227     /**
3228      * Adds a vibrancy effect to the browser window. Passing `null` or an empty string
3229      * will remove the vibrancy effect on the window.
3230      *
3231      * @platform darwin
3232      */
3233     setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
3234     /**
3235      * Sets whether the window should be visible on all workspaces.
3236      *
3237      * **Note:** This API does nothing on Windows.
3238      *
3239      * @platform darwin,linux
3240      */
3241     setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
3242     /**
3243      * Set a custom position for the traffic light buttons in frameless window. Passing
3244      * `null` will reset the position to default.
3245      *
3246      * @platform darwin
3247      */
3248     setWindowButtonPosition(position: (Point) | (null)): void;
3249     /**
3250      * Sets whether the window traffic light buttons should be visible.
3251      *
3252      * @platform darwin
3253      */
3254     setWindowButtonVisibility(visible: boolean): void;
3255     /**
3256      * Shows and gives focus to the window.
3257      */
3258     show(): void;
3259     /**
3260      * Shows or hides the tab overview when native tabs are enabled.
3261      *
3262      * @platform darwin
3263      */
3264     showAllTabs(): void;
3265     /**
3266      * Same as `webContents.showDefinitionForSelection()`.
3267      *
3268      * @platform darwin
3269      */
3270     showDefinitionForSelection(): void;
3271     /**
3272      * Shows the window but doesn't focus on it.
3273      */
3274     showInactive(): void;
3275     /**
3276      * Toggles the visibility of the tab bar if native tabs are enabled and there is
3277      * only one tab in the current window.
3278      *
3279      * @platform darwin
3280      */
3281     toggleTabBar(): void;
3282     /**
3283      * Unhooks all of the window messages.
3284      *
3285      * @platform win32
3286      */
3287     unhookAllWindowMessages(): void;
3288     /**
3289      * Unhook the window message.
3290      *
3291      * @platform win32
3292      */
3293     unhookWindowMessage(message: number): void;
3294     /**
3295      * Unmaximizes the window.
3296      */
3297     unmaximize(): void;
3298     /**
3299      * A `string` property that defines an alternative title provided only to
3300      * accessibility tools such as screen readers. This string is not directly visible
3301      * to users.
3302      */
3303     accessibleTitle: string;
3304     /**
3305      * A `boolean` property that determines whether the window menu bar should hide
3306      * itself automatically. Once set, the menu bar will only show when users press the
3307      * single `Alt` key.
3308      *
3309      * If the menu bar is already visible, setting this property to `true` won't hide
3310      * it immediately.
3311      */
3312     autoHideMenuBar: boolean;
3313     /**
3314      * A `boolean` property that determines whether the window can be manually closed
3315      * by user.
3316      *
3317      * On Linux the setter is a no-op, although the getter returns `true`.
3318      *
3319      * @platform darwin,win32
3320      */
3321     closable: boolean;
3322     /**
3323      * A `boolean` property that specifies whether the window’s document has been
3324      * edited.
3325      *
3326      * The icon in title bar will become gray when set to `true`.
3327      *
3328      * @platform darwin
3329      */
3330     documentEdited: boolean;
3331     /**
3332      * A `boolean` property that determines whether the window is excluded from the
3333      * application’s Windows menu. `false` by default.
3334      *
3335      * @platform darwin
3336      */
3337     excludedFromShownWindowsMenu: boolean;
3338     /**
3339      * A `boolean` property that determines whether the window is focusable.
3340      *
3341      * @platform win32,darwin
3342      */
3343     focusable: boolean;
3344     /**
3345      * A `boolean` property that determines whether the window is in fullscreen mode.
3346      */
3347     fullScreen: boolean;
3348     /**
3349      * A `boolean` property that determines whether the maximize/zoom window button
3350      * toggles fullscreen mode or maximizes the window.
3351      */
3352     fullScreenable: boolean;
3353     /**
3354      * A `Integer` property representing the unique ID of the window. Each ID is unique
3355      * among all `BrowserWindow` instances of the entire Electron application.
3356      *
3357      */
3358     readonly id: number;
3359     /**
3360      * A `boolean` property that determines whether the window is in kiosk mode.
3361      */
3362     kiosk: boolean;
3363     /**
3364      * A `boolean` property that determines whether the window can be manually
3365      * maximized by user.
3366      *
3367      * On Linux the setter is a no-op, although the getter returns `true`.
3368      *
3369      * @platform darwin,win32
3370      */
3371     maximizable: boolean;
3372     /**
3373      * A `boolean` property that determines whether the menu bar should be visible.
3374      *
3375      * **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
3376      * pressing the single `Alt` key.
3377      *
3378      * @platform win32,linux
3379      */
3380     menuBarVisible: boolean;
3381     /**
3382      * A `boolean` property that determines whether the window can be manually
3383      * minimized by user.
3384      *
3385      * On Linux the setter is a no-op, although the getter returns `true`.
3386      *
3387      * @platform darwin,win32
3388      */
3389     minimizable: boolean;
3390     /**
3391      * A `boolean` property that determines Whether the window can be moved by user.
3392      *
3393      * On Linux the setter is a no-op, although the getter returns `true`.
3394      *
3395      * @platform darwin,win32
3396      */
3397     movable: boolean;
3398     /**
3399      * A `string` property that determines the pathname of the file the window
3400      * represents, and the icon of the file will show in window's title bar.
3401      *
3402      * @platform darwin
3403      */
3404     representedFilename: string;
3405     /**
3406      * A `boolean` property that determines whether the window can be manually resized
3407      * by user.
3408      */
3409     resizable: boolean;
3410     /**
3411      * A `boolean` property that determines whether the window has a shadow.
3412      */
3413     shadow: boolean;
3414     /**
3415      * A `boolean` property that determines whether the window is in simple (pre-Lion)
3416      * fullscreen mode.
3417      */
3418     simpleFullScreen: boolean;
3419     /**
3420      * A `string` (optional) property that is equal to the `tabbingIdentifier` passed
3421      * to the `BrowserWindow` constructor or `undefined` if none was set.
3422      *
3423      * @platform darwin
3424      */
3425     readonly tabbingIdentifier?: string;
3426     /**
3427      * A `string` property that determines the title of the native window.
3428      *
3429      * **Note:** The title of the web page can be different from the title of the
3430      * native window.
3431      */
3432     title: string;
3433     /**
3434      * A `boolean` property that determines whether the window is visible on all
3435      * workspaces.
3436      *
3437      * **Note:** Always returns false on Windows.
3438      *
3439      * @platform darwin,linux
3440      */
3441     visibleOnAllWorkspaces: boolean;
3442     /**
3443      * A `WebContents` object this window owns. All web page related events and
3444      * operations will be done via it.
3445      *
3446      * See the `webContents` documentation for its methods and events.
3447      *
3448      */
3449     readonly webContents: WebContents;
3450   }
3451
3452   interface BrowserWindowConstructorOptions {
3453
3454     // Docs: https://electronjs.org/docs/api/structures/browser-window-options
3455
3456     /**
3457      * Whether clicking an inactive window will also click through to the web contents.
3458      * Default is `false` on macOS. This option is not configurable on other platforms.
3459      *
3460      * @platform darwin
3461      */
3462     acceptFirstMouse?: boolean;
3463     /**
3464      * Whether the window should always stay on top of other windows. Default is
3465      * `false`.
3466      */
3467     alwaysOnTop?: boolean;
3468     /**
3469      * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
3470      */
3471     autoHideMenuBar?: boolean;
3472     /**
3473      * The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color
3474      * format. Alpha in #AARRGGBB format is supported if `transparent` is set to
3475      * `true`. Default is `#FFF` (white). See win.setBackgroundColor for more
3476      * information.
3477      */
3478     backgroundColor?: string;
3479     /**
3480      * Set the window's system-drawn background material, including behind the
3481      * non-client area. Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See
3482      * win.setBackgroundMaterial for more information.
3483      *
3484      * @platform win32
3485      */
3486     backgroundMaterial?: ('auto' | 'none' | 'mica' | 'acrylic' | 'tabbed');
3487     /**
3488      * Show window in the center of the screen. Default is `false`.
3489      */
3490     center?: boolean;
3491     /**
3492      * Whether window is closable. This is not implemented on Linux. Default is `true`.
3493      *
3494      * @platform darwin,win32
3495      */
3496     closable?: boolean;
3497     /**
3498      * Forces using dark theme for the window, only works on some GTK+3 desktop
3499      * environments. Default is `false`.
3500      */
3501     darkTheme?: boolean;
3502     /**
3503      * Whether to hide cursor when typing. Default is `false`.
3504      */
3505     disableAutoHideCursor?: boolean;
3506     /**
3507      * Enable the window to be resized larger than screen. Only relevant for macOS, as
3508      * other OSes allow larger-than-screen windows by default. Default is `false`.
3509      *
3510      * @platform darwin
3511      */
3512     enableLargerThanScreen?: boolean;
3513     /**
3514      * Whether the window can be focused. Default is `true`. On Windows setting
3515      * `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
3516      * `focusable: false` makes the window stop interacting with wm, so the window will
3517      * always stay on top in all workspaces.
3518      */
3519     focusable?: boolean;
3520     /**
3521      * Specify `false` to create a frameless window. Default is `true`.
3522      */
3523     frame?: boolean;
3524     /**
3525      * Whether the window should show in fullscreen. When explicitly set to `false` the
3526      * fullscreen button will be hidden or disabled on macOS. Default is `false`.
3527      */
3528     fullscreen?: boolean;
3529     /**
3530      * Whether the window can be put into fullscreen mode. On macOS, also whether the
3531      * maximize/zoom button should toggle full screen mode or maximize window. Default
3532      * is `true`.
3533      */
3534     fullscreenable?: boolean;
3535     /**
3536      * Whether window should have a shadow. Default is `true`.
3537      */
3538     hasShadow?: boolean;
3539     /**
3540      * Window's height in pixels. Default is `600`.
3541      */
3542     height?: number;
3543     /**
3544      * Whether window should be hidden when the user toggles into mission control.
3545      *
3546      * @platform darwin
3547      */
3548     hiddenInMissionControl?: boolean;
3549     /**
3550      * The window icon. On Windows it is recommended to use `ICO` icons to get best
3551      * visual effects, you can also leave it undefined so the executable's icon will be
3552      * used.
3553      */
3554     icon?: (NativeImage) | (string);
3555     /**
3556      * Whether the window is in kiosk mode. Default is `false`.
3557      */
3558     kiosk?: boolean;
3559     /**
3560      * Window's maximum height. Default is no limit.
3561      */
3562     maxHeight?: number;
3563     /**
3564      * Whether window is maximizable. This is not implemented on Linux. Default is
3565      * `true`.
3566      *
3567      * @platform darwin,win32
3568      */
3569     maximizable?: boolean;
3570     /**
3571      * Window's maximum width. Default is no limit.
3572      */
3573     maxWidth?: number;
3574     /**
3575      * Window's minimum height. Default is `0`.
3576      */
3577     minHeight?: number;
3578     /**
3579      * Whether window is minimizable. This is not implemented on Linux. Default is
3580      * `true`.
3581      *
3582      * @platform darwin,win32
3583      */
3584     minimizable?: boolean;
3585     /**
3586      * Window's minimum width. Default is `0`.
3587      */
3588     minWidth?: number;
3589     /**
3590      * Whether this is a modal window. This only works when the window is a child
3591      * window. Default is `false`.
3592      */
3593     modal?: boolean;
3594     /**
3595      * Whether window is movable. This is not implemented on Linux. Default is `true`.
3596      *
3597      * @platform darwin,win32
3598      */
3599     movable?: boolean;
3600     /**
3601      * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
3602      * (fully opaque). This is only implemented on Windows and macOS.
3603      *
3604      * @platform darwin,win32
3605      */
3606     opacity?: number;
3607     /**
3608      * Whether the renderer should be active when `show` is `false` and it has just
3609      * been created.  In order for `document.visibilityState` to work correctly on
3610      * first load with `show: false` you should set this to `false`.  Setting this to
3611      * `false` will cause the `ready-to-show` event to not fire.  Default is `true`.
3612      */
3613     paintWhenInitiallyHidden?: boolean;
3614     /**
3615      * Specify parent window. Default is `null`.
3616      */
3617     parent?: BrowserWindow;
3618     /**
3619      * Whether window is resizable. Default is `true`.
3620      */
3621     resizable?: boolean;
3622     /**
3623      * Whether frameless window should have rounded corners on macOS. Default is
3624      * `true`. Setting this property to `false` will prevent the window from being
3625      * fullscreenable.
3626      *
3627      * @platform darwin
3628      */
3629     roundedCorners?: boolean;
3630     /**
3631      * Whether window should be shown when created. Default is `true`.
3632      */
3633     show?: boolean;
3634     /**
3635      * Use pre-Lion fullscreen on macOS. Default is `false`.
3636      *
3637      * @platform darwin
3638      */
3639     simpleFullscreen?: boolean;
3640     /**
3641      * Whether to show the window in taskbar. Default is `false`.
3642      *
3643      * @platform darwin,win32
3644      */
3645     skipTaskbar?: boolean;
3646     /**
3647      * Tab group name, allows opening the window as a native tab. Windows with the same
3648      * tabbing identifier will be grouped together. This also adds a native new tab
3649      * button to your window's tab bar and allows your `app` and window to receive the
3650      * `new-window-for-tab` event.
3651      *
3652      * @platform darwin
3653      */
3654     tabbingIdentifier?: string;
3655     /**
3656      * Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
3657      * window frame. Setting it to `false` will remove window shadow and window
3658      * animations. Default is `true`.
3659      */
3660     thickFrame?: boolean;
3661     /**
3662      * Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
3663      * defined in the HTML file loaded by `loadURL()`, this property will be ignored.
3664      */
3665     title?: string;
3666     /**
3667      *  When using a frameless window in conjunction with
3668      * `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so
3669      * that the standard window controls ("traffic lights" on macOS) are visible, this
3670      * property enables the Window Controls Overlay JavaScript APIs and CSS Environment
3671      * Variables. Specifying `true` will result in an overlay with default system
3672      * colors. Default is `false`.
3673      */
3674     titleBarOverlay?: (TitleBarOverlay) | (boolean);
3675     /**
3676      * The style of window title bar. Default is `default`. Possible values are:
3677      *
3678      * @platform darwin,win32
3679      */
3680     titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
3681     /**
3682      * Set a custom position for the traffic light buttons in frameless windows.
3683      *
3684      * @platform darwin
3685      */
3686     trafficLightPosition?: Point;
3687     /**
3688      * Makes the window transparent. Default is `false`. On Windows, does not work
3689      * unless the window is frameless.
3690      */
3691     transparent?: boolean;
3692     /**
3693      * The type of window, default is normal window. See more about this below.
3694      */
3695     type?: string;
3696     /**
3697      * The `width` and `height` would be used as web page's size, which means the
3698      * actual window's size will include window frame's size and be slightly larger.
3699      * Default is `false`.
3700      */
3701     useContentSize?: boolean;
3702     /**
3703      * Add a type of vibrancy effect to the window, only on macOS. Can be
3704      * `appearance-based`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`,
3705      * `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`,
3706      * `under-window`, or `under-page`.
3707      *
3708      * @platform darwin
3709      */
3710     vibrancy?: ('appearance-based' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
3711     /**
3712      * Specify how the material appearance should reflect window activity state on
3713      * macOS. Must be used with the `vibrancy` property. Possible values are:
3714      *
3715      * @platform darwin
3716      */
3717     visualEffectState?: ('followWindow' | 'active' | 'inactive');
3718     /**
3719      * Settings of web page's features.
3720      */
3721     webPreferences?: WebPreferences;
3722     /**
3723      * Window's width in pixels. Default is `800`.
3724      */
3725     width?: number;
3726     /**
3727      * (**required** if y is used) Window's left offset from screen. Default is to
3728      * center the window.
3729      */
3730     x?: number;
3731     /**
3732      * (**required** if x is used) Window's top offset from screen. Default is to
3733      * center the window.
3734      */
3735     y?: number;
3736     /**
3737      * Controls the behavior on macOS when option-clicking the green stoplight button
3738      * on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
3739      * will grow to the preferred width of the web page when zoomed, `false` will cause
3740      * it to zoom to the width of the screen. This will also affect the behavior when
3741      * calling `maximize()` directly. Default is `false`.
3742      *
3743      * @platform darwin
3744      */
3745     zoomToPageWidth?: boolean;
3746   }
3747
3748   interface Certificate {
3749
3750     // Docs: https://electronjs.org/docs/api/structures/certificate
3751
3752     /**
3753      * PEM encoded data
3754      */
3755     data: string;
3756     /**
3757      * Fingerprint of the certificate
3758      */
3759     fingerprint: string;
3760     /**
3761      * Issuer principal
3762      */
3763     issuer: CertificatePrincipal;
3764     /**
3765      * Issuer certificate (if not self-signed)
3766      */
3767     issuerCert: Certificate;
3768     /**
3769      * Issuer's Common Name
3770      */
3771     issuerName: string;
3772     /**
3773      * Hex value represented string
3774      */
3775     serialNumber: string;
3776     /**
3777      * Subject principal
3778      */
3779     subject: CertificatePrincipal;
3780     /**
3781      * Subject's Common Name
3782      */
3783     subjectName: string;
3784     /**
3785      * End date of the certificate being valid in seconds
3786      */
3787     validExpiry: number;
3788     /**
3789      * Start date of the certificate being valid in seconds
3790      */
3791     validStart: number;
3792   }
3793
3794   interface CertificatePrincipal {
3795
3796     // Docs: https://electronjs.org/docs/api/structures/certificate-principal
3797
3798     /**
3799      * Common Name.
3800      */
3801     commonName: string;
3802     /**
3803      * Country or region.
3804      */
3805     country: string;
3806     /**
3807      * Locality.
3808      */
3809     locality: string;
3810     /**
3811      * Organization names.
3812      */
3813     organizations: string[];
3814     /**
3815      * Organization Unit names.
3816      */
3817     organizationUnits: string[];
3818     /**
3819      * State or province.
3820      */
3821     state: string;
3822   }
3823
3824   class ClientRequest extends NodeEventEmitter {
3825
3826     // Docs: https://electronjs.org/docs/api/client-request
3827
3828     /**
3829      * Emitted when the `request` is aborted. The `abort` event will not be fired if
3830      * the `request` is already closed.
3831      */
3832     on(event: 'abort', listener: Function): this;
3833     off(event: 'abort', listener: Function): this;
3834     once(event: 'abort', listener: Function): this;
3835     addListener(event: 'abort', listener: Function): this;
3836     removeListener(event: 'abort', listener: Function): this;
3837     /**
3838      * Emitted as the last event in the HTTP request-response transaction. The `close`
3839      * event indicates that no more events will be emitted on either the `request` or
3840      * `response` objects.
3841      */
3842     on(event: 'close', listener: Function): this;
3843     off(event: 'close', listener: Function): this;
3844     once(event: 'close', listener: Function): this;
3845     addListener(event: 'close', listener: Function): this;
3846     removeListener(event: 'close', listener: Function): this;
3847     /**
3848      * Emitted when the `net` module fails to issue a network request. Typically when
3849      * the `request` object emits an `error` event, a `close` event will subsequently
3850      * follow and no response object will be provided.
3851      */
3852     on(event: 'error', listener: (
3853                                   /**
3854                                    * an error object providing some information about the failure.
3855                                    */
3856                                   error: Error) => void): this;
3857     off(event: 'error', listener: (
3858                                   /**
3859                                    * an error object providing some information about the failure.
3860                                    */
3861                                   error: Error) => void): this;
3862     once(event: 'error', listener: (
3863                                   /**
3864                                    * an error object providing some information about the failure.
3865                                    */
3866                                   error: Error) => void): this;
3867     addListener(event: 'error', listener: (
3868                                   /**
3869                                    * an error object providing some information about the failure.
3870                                    */
3871                                   error: Error) => void): this;
3872     removeListener(event: 'error', listener: (
3873                                   /**
3874                                    * an error object providing some information about the failure.
3875                                    */
3876                                   error: Error) => void): this;
3877     /**
3878      * Emitted just after the last chunk of the `request`'s data has been written into
3879      * the `request` object.
3880      */
3881     on(event: 'finish', listener: Function): this;
3882     off(event: 'finish', listener: Function): this;
3883     once(event: 'finish', listener: Function): this;
3884     addListener(event: 'finish', listener: Function): this;
3885     removeListener(event: 'finish', listener: Function): this;
3886     /**
3887      * Emitted when an authenticating proxy is asking for user credentials.
3888      *
3889      * The `callback` function is expected to be called back with user credentials:
3890      *
3891      * * `username` string
3892      * * `password` string
3893      *
3894      * Providing empty credentials will cancel the request and report an authentication
3895      * error on the response object:
3896      */
3897     on(event: 'login', listener: (authInfo: AuthInfo,
3898                                   callback: (username?: string, password?: string) => void) => void): this;
3899     off(event: 'login', listener: (authInfo: AuthInfo,
3900                                   callback: (username?: string, password?: string) => void) => void): this;
3901     once(event: 'login', listener: (authInfo: AuthInfo,
3902                                   callback: (username?: string, password?: string) => void) => void): this;
3903     addListener(event: 'login', listener: (authInfo: AuthInfo,
3904                                   callback: (username?: string, password?: string) => void) => void): this;
3905     removeListener(event: 'login', listener: (authInfo: AuthInfo,
3906                                   callback: (username?: string, password?: string) => void) => void): this;
3907     /**
3908      * Emitted when the server returns a redirect response (e.g. 301 Moved
3909      * Permanently). Calling `request.followRedirect` will continue with the
3910      * redirection.  If this event is handled, `request.followRedirect` must be called
3911      * **synchronously**, otherwise the request will be cancelled.
3912      */
3913     on(event: 'redirect', listener: (statusCode: number,
3914                                      method: string,
3915                                      redirectUrl: string,
3916                                      responseHeaders: Record<string, string[]>) => void): this;
3917     off(event: 'redirect', listener: (statusCode: number,
3918                                      method: string,
3919                                      redirectUrl: string,
3920                                      responseHeaders: Record<string, string[]>) => void): this;
3921     once(event: 'redirect', listener: (statusCode: number,
3922                                      method: string,
3923                                      redirectUrl: string,
3924                                      responseHeaders: Record<string, string[]>) => void): this;
3925     addListener(event: 'redirect', listener: (statusCode: number,
3926                                      method: string,
3927                                      redirectUrl: string,
3928                                      responseHeaders: Record<string, string[]>) => void): this;
3929     removeListener(event: 'redirect', listener: (statusCode: number,
3930                                      method: string,
3931                                      redirectUrl: string,
3932                                      responseHeaders: Record<string, string[]>) => void): this;
3933     on(event: 'response', listener: (
3934                                      /**
3935                                       * An object representing the HTTP response message.
3936                                       */
3937                                      response: IncomingMessage) => void): this;
3938     off(event: 'response', listener: (
3939                                      /**
3940                                       * An object representing the HTTP response message.
3941                                       */
3942                                      response: IncomingMessage) => void): this;
3943     once(event: 'response', listener: (
3944                                      /**
3945                                       * An object representing the HTTP response message.
3946                                       */
3947                                      response: IncomingMessage) => void): this;
3948     addListener(event: 'response', listener: (
3949                                      /**
3950                                       * An object representing the HTTP response message.
3951                                       */
3952                                      response: IncomingMessage) => void): this;
3953     removeListener(event: 'response', listener: (
3954                                      /**
3955                                       * An object representing the HTTP response message.
3956                                       */
3957                                      response: IncomingMessage) => void): this;
3958     /**
3959      * ClientRequest
3960      */
3961     constructor(options: (ClientRequestConstructorOptions) | (string));
3962     /**
3963      * Cancels an ongoing HTTP transaction. If the request has already emitted the
3964      * `close` event, the abort operation will have no effect. Otherwise an ongoing
3965      * event will emit `abort` and `close` events. Additionally, if there is an ongoing
3966      * response object,it will emit the `aborted` event.
3967      */
3968     abort(): void;
3969     /**
3970      * Sends the last chunk of the request data. Subsequent write or end operations
3971      * will not be allowed. The `finish` event is emitted just after the end operation.
3972      */
3973     end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): this;
3974     /**
3975      * Continues any pending redirection. Can only be called during a `'redirect'`
3976      * event.
3977      */
3978     followRedirect(): void;
3979     /**
3980      * The value of a previously set extra header name.
3981      */
3982     getHeader(name: string): string;
3983     /**
3984      * * `active` boolean - Whether the request is currently active. If this is false
3985      * no other properties will be set
3986      * * `started` boolean - Whether the upload has started. If this is false both
3987      * `current` and `total` will be set to 0.
3988      * * `current` Integer - The number of bytes that have been uploaded so far
3989      * * `total` Integer - The number of bytes that will be uploaded this request
3990      *
3991      * You can use this method in conjunction with `POST` requests to get the progress
3992      * of a file upload or other data transfer.
3993      */
3994     getUploadProgress(): UploadProgress;
3995     /**
3996      * Removes a previously set extra header name. This method can be called only
3997      * before first write. Trying to call it after the first write will throw an error.
3998      */
3999     removeHeader(name: string): void;
4000     /**
4001      * Adds an extra HTTP header. The header name will be issued as-is without
4002      * lowercasing. It can be called only before first write. Calling this method after
4003      * the first write will throw an error. If the passed value is not a `string`, its
4004      * `toString()` method will be called to obtain the final value.
4005      *
4006      * Certain headers are restricted from being set by apps. These headers are listed
4007      * below. More information on restricted headers can be found in Chromium's header
4008      * utils.
4009      *
4010      * * `Content-Length`
4011      * * `Host`
4012      * * `Trailer` or `Te`
4013      * * `Upgrade`
4014      * * `Cookie2`
4015      * * `Keep-Alive`
4016      * * `Transfer-Encoding`
4017      *
4018      * Additionally, setting the `Connection` header to the value `upgrade` is also
4019      * disallowed.
4020      */
4021     setHeader(name: string, value: string): void;
4022     /**
4023      * `callback` is essentially a dummy function introduced in the purpose of keeping
4024      * similarity with the Node.js API. It is called asynchronously in the next tick
4025      * after `chunk` content have been delivered to the Chromium networking layer.
4026      * Contrary to the Node.js implementation, it is not guaranteed that `chunk`
4027      * content have been flushed on the wire before `callback` is called.
4028      *
4029      * Adds a chunk of data to the request body. The first write operation may cause
4030      * the request headers to be issued on the wire. After the first write operation,
4031      * it is not allowed to add or remove a custom header.
4032      */
4033     write(chunk: (string) | (Buffer), encoding?: string, callback?: () => void): void;
4034     /**
4035      * A `boolean` specifying whether the request will use HTTP chunked transfer
4036      * encoding or not. Defaults to false. The property is readable and writable,
4037      * however it can be set only before the first write operation as the HTTP headers
4038      * are not yet put on the wire. Trying to set the `chunkedEncoding` property after
4039      * the first write will throw an error.
4040      *
4041      * Using chunked encoding is strongly recommended if you need to send a large
4042      * request body as data will be streamed in small chunks instead of being
4043      * internally buffered inside Electron process memory.
4044      */
4045     chunkedEncoding: boolean;
4046   }
4047
4048   interface Clipboard {
4049
4050     // Docs: https://electronjs.org/docs/api/clipboard
4051
4052     /**
4053      * An array of supported formats for the clipboard `type`.
4054      */
4055     availableFormats(type?: 'selection' | 'clipboard'): string[];
4056     /**
4057      * Clears the clipboard content.
4058      */
4059     clear(type?: 'selection' | 'clipboard'): void;
4060     /**
4061      * Whether the clipboard supports the specified `format`.
4062      *
4063      * @experimental
4064      */
4065     has(format: string, type?: 'selection' | 'clipboard'): boolean;
4066     /**
4067      * Reads `format` type from the clipboard.
4068      *
4069      * `format` should contain valid ASCII characters and have `/` separator. `a/c`,
4070      * `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid.
4071      *
4072      * @experimental
4073      */
4074     read(format: string): string;
4075     /**
4076      * * `title` string
4077      * * `url` string
4078      *
4079      * Returns an Object containing `title` and `url` keys representing the bookmark in
4080      * the clipboard. The `title` and `url` values will be empty strings when the
4081      * bookmark is unavailable.  The `title` value will always be empty on Windows.
4082      *
4083      * @platform darwin,win32
4084      */
4085     readBookmark(): ReadBookmark;
4086     /**
4087      * Reads `format` type from the clipboard.
4088      *
4089      * @experimental
4090      */
4091     readBuffer(format: string): Buffer;
4092     /**
4093      * The text on the find pasteboard, which is the pasteboard that holds information
4094      * about the current state of the active application’s find panel.
4095      *
4096      * This method uses synchronous IPC when called from the renderer process. The
4097      * cached value is reread from the find pasteboard whenever the application is
4098      * activated.
4099      *
4100      * @platform darwin
4101      */
4102     readFindText(): string;
4103     /**
4104      * The content in the clipboard as markup.
4105      */
4106     readHTML(type?: 'selection' | 'clipboard'): string;
4107     /**
4108      * The image content in the clipboard.
4109      */
4110     readImage(type?: 'selection' | 'clipboard'): NativeImage;
4111     /**
4112      * The content in the clipboard as RTF.
4113      */
4114     readRTF(type?: 'selection' | 'clipboard'): string;
4115     /**
4116      * The content in the clipboard as plain text.
4117      */
4118     readText(type?: 'selection' | 'clipboard'): string;
4119     /**
4120      * Writes `data` to the clipboard.
4121      */
4122     write(data: Data, type?: 'selection' | 'clipboard'): void;
4123     /**
4124      * Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
4125      *
4126      * **Note:** Most apps on Windows don't support pasting bookmarks into them so you
4127      * can use `clipboard.write` to write both a bookmark and fallback text to the
4128      * clipboard.
4129      *
4130      * @platform darwin,win32
4131      */
4132     writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
4133     /**
4134      * Writes the `buffer` into the clipboard as `format`.
4135      *
4136      * @experimental
4137      */
4138     writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
4139     /**
4140      * Writes the `text` into the find pasteboard (the pasteboard that holds
4141      * information about the current state of the active application’s find panel) as
4142      * plain text. This method uses synchronous IPC when called from the renderer
4143      * process.
4144      *
4145      * @platform darwin
4146      */
4147     writeFindText(text: string): void;
4148     /**
4149      * Writes `markup` to the clipboard.
4150      */
4151     writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
4152     /**
4153      * Writes `image` to the clipboard.
4154      */
4155     writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
4156     /**
4157      * Writes the `text` into the clipboard in RTF.
4158      */
4159     writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
4160     /**
4161      * Writes the `text` into the clipboard as plain text.
4162      */
4163     writeText(text: string, type?: 'selection' | 'clipboard'): void;
4164   }
4165
4166   class CommandLine {
4167
4168     // Docs: https://electronjs.org/docs/api/command-line
4169
4170     /**
4171      * Append an argument to Chromium's command line. The argument will be quoted
4172      * correctly. Switches will precede arguments regardless of appending order.
4173      *
4174      * If you're appending an argument like `--switch=value`, consider using
4175      * `appendSwitch('switch', 'value')` instead.
4176      *
4177      * **Note:** This will not affect `process.argv`. The intended usage of this
4178      * function is to control Chromium's behavior.
4179      */
4180     appendArgument(value: string): void;
4181     /**
4182      * Append a switch (with optional `value`) to Chromium's command line.
4183      *
4184      * **Note:** This will not affect `process.argv`. The intended usage of this
4185      * function is to control Chromium's behavior.
4186      */
4187     appendSwitch(the_switch: string, value?: string): void;
4188     /**
4189      * The command-line switch value.
4190      *
4191      * **Note:** When the switch is not present or has no value, it returns empty
4192      * string.
4193      */
4194     getSwitchValue(the_switch: string): string;
4195     /**
4196      * Whether the command-line switch is present.
4197      */
4198     hasSwitch(the_switch: string): boolean;
4199     /**
4200      * Removes the specified switch from Chromium's command line.
4201      *
4202      * **Note:** This will not affect `process.argv`. The intended usage of this
4203      * function is to control Chromium's behavior.
4204      */
4205     removeSwitch(the_switch: string): void;
4206   }
4207
4208   interface ContentTracing {
4209
4210     // Docs: https://electronjs.org/docs/api/content-tracing
4211
4212     /**
4213      * resolves with an array of category groups once all child processes have
4214      * acknowledged the `getCategories` request
4215      *
4216      * Get a set of category groups. The category groups can change as new code paths
4217      * are reached. See also the list of built-in tracing categories.
4218      *
4219      * > **NOTE:** Electron adds a non-default tracing category called `"electron"`.
4220      * This category can be used to capture Electron-specific tracing events.
4221      */
4222     getCategories(): Promise<string[]>;
4223     /**
4224      * Resolves with an object containing the `value` and `percentage` of trace buffer
4225      * maximum usage
4226      *
4227      * * `value` number
4228      * * `percentage` number
4229      *
4230      * Get the maximum usage across processes of trace buffer as a percentage of the
4231      * full state.
4232      */
4233     getTraceBufferUsage(): Promise<Electron.TraceBufferUsageReturnValue>;
4234     /**
4235      * resolved once all child processes have acknowledged the `startRecording`
4236      * request.
4237      *
4238      * Start recording on all processes.
4239      *
4240      * Recording begins immediately locally and asynchronously on child processes as
4241      * soon as they receive the EnableRecording request.
4242      *
4243      * If a recording is already running, the promise will be immediately resolved, as
4244      * only one trace operation can be in progress at a time.
4245      */
4246     startRecording(options: (TraceConfig) | (TraceCategoriesAndOptions)): Promise<void>;
4247     /**
4248      * resolves with a path to a file that contains the traced data once all child
4249      * processes have acknowledged the `stopRecording` request
4250      *
4251      * Stop recording on all processes.
4252      *
4253      * Child processes typically cache trace data and only rarely flush and send trace
4254      * data back to the main process. This helps to minimize the runtime overhead of
4255      * tracing since sending trace data over IPC can be an expensive operation. So, to
4256      * end tracing, Chromium asynchronously asks all child processes to flush any
4257      * pending trace data.
4258      *
4259      * Trace data will be written into `resultFilePath`. If `resultFilePath` is empty
4260      * or not provided, trace data will be written to a temporary file, and the path
4261      * will be returned in the promise.
4262      */
4263     stopRecording(resultFilePath?: string): Promise<string>;
4264   }
4265
4266   interface ContextBridge {
4267
4268     // Docs: https://electronjs.org/docs/api/context-bridge
4269
4270     exposeInIsolatedWorld(worldId: number, apiKey: string, api: any): void;
4271     exposeInMainWorld(apiKey: string, api: any): void;
4272   }
4273
4274   interface Cookie {
4275
4276     // Docs: https://electronjs.org/docs/api/structures/cookie
4277
4278     /**
4279      * The domain of the cookie; this will be normalized with a preceding dot so that
4280      * it's also valid for subdomains.
4281      */
4282     domain?: string;
4283     /**
4284      * The expiration date of the cookie as the number of seconds since the UNIX epoch.
4285      * Not provided for session cookies.
4286      */
4287     expirationDate?: number;
4288     /**
4289      * Whether the cookie is a host-only cookie; this will only be `true` if no domain
4290      * was passed.
4291      */
4292     hostOnly?: boolean;
4293     /**
4294      * Whether the cookie is marked as HTTP only.
4295      */
4296     httpOnly?: boolean;
4297     /**
4298      * The name of the cookie.
4299      */
4300     name: string;
4301     /**
4302      * The path of the cookie.
4303      */
4304     path?: string;
4305     /**
4306      * The Same Site policy applied to this cookie.  Can be `unspecified`,
4307      * `no_restriction`, `lax` or `strict`.
4308      */
4309     sameSite: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
4310     /**
4311      * Whether the cookie is marked as secure.
4312      */
4313     secure?: boolean;
4314     /**
4315      * Whether the cookie is a session cookie or a persistent cookie with an expiration
4316      * date.
4317      */
4318     session?: boolean;
4319     /**
4320      * The value of the cookie.
4321      */
4322     value: string;
4323   }
4324
4325   class Cookies extends NodeEventEmitter {
4326
4327     // Docs: https://electronjs.org/docs/api/cookies
4328
4329     /**
4330      * Emitted when a cookie is changed because it was added, edited, removed, or
4331      * expired.
4332      */
4333     on(event: 'changed', listener: (event: Event,
4334                                     /**
4335                                      * The cookie that was changed.
4336                                      */
4337                                     cookie: Cookie,
4338                                     /**
4339                                      * The cause of the change with one of the following values:
4340                                      */
4341                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
4342                                     /**
4343                                      * `true` if the cookie was removed, `false` otherwise.
4344                                      */
4345                                     removed: boolean) => void): this;
4346     off(event: 'changed', listener: (event: Event,
4347                                     /**
4348                                      * The cookie that was changed.
4349                                      */
4350                                     cookie: Cookie,
4351                                     /**
4352                                      * The cause of the change with one of the following values:
4353                                      */
4354                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
4355                                     /**
4356                                      * `true` if the cookie was removed, `false` otherwise.
4357                                      */
4358                                     removed: boolean) => void): this;
4359     once(event: 'changed', listener: (event: Event,
4360                                     /**
4361                                      * The cookie that was changed.
4362                                      */
4363                                     cookie: Cookie,
4364                                     /**
4365                                      * The cause of the change with one of the following values:
4366                                      */
4367                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
4368                                     /**
4369                                      * `true` if the cookie was removed, `false` otherwise.
4370                                      */
4371                                     removed: boolean) => void): this;
4372     addListener(event: 'changed', listener: (event: Event,
4373                                     /**
4374                                      * The cookie that was changed.
4375                                      */
4376                                     cookie: Cookie,
4377                                     /**
4378                                      * The cause of the change with one of the following values:
4379                                      */
4380                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
4381                                     /**
4382                                      * `true` if the cookie was removed, `false` otherwise.
4383                                      */
4384                                     removed: boolean) => void): this;
4385     removeListener(event: 'changed', listener: (event: Event,
4386                                     /**
4387                                      * The cookie that was changed.
4388                                      */
4389                                     cookie: Cookie,
4390                                     /**
4391                                      * The cause of the change with one of the following values:
4392                                      */
4393                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
4394                                     /**
4395                                      * `true` if the cookie was removed, `false` otherwise.
4396                                      */
4397                                     removed: boolean) => void): this;
4398     /**
4399      * A promise which resolves when the cookie store has been flushed
4400      *
4401      * Writes any unwritten cookies data to disk
4402      *
4403      * Cookies written by any method will not be written to disk immediately, but will
4404      * be written every 30 seconds or 512 operations
4405      *
4406      * Calling this method can cause the cookie to be written to disk immediately.
4407      */
4408     flushStore(): Promise<void>;
4409     /**
4410      * A promise which resolves an array of cookie objects.
4411      *
4412      * Sends a request to get all cookies matching `filter`, and resolves a promise
4413      * with the response.
4414      */
4415     get(filter: CookiesGetFilter): Promise<Electron.Cookie[]>;
4416     /**
4417      * A promise which resolves when the cookie has been removed
4418      *
4419      * Removes the cookies matching `url` and `name`
4420      */
4421     remove(url: string, name: string): Promise<void>;
4422     /**
4423      * A promise which resolves when the cookie has been set
4424      *
4425      * Sets a cookie with `details`.
4426      */
4427     set(details: CookiesSetDetails): Promise<void>;
4428   }
4429
4430   interface CPUUsage {
4431
4432     // Docs: https://electronjs.org/docs/api/structures/cpu-usage
4433
4434     /**
4435      * The number of average idle CPU wakeups per second since the last call to
4436      * getCPUUsage. First call returns 0. Will always return 0 on Windows.
4437      */
4438     idleWakeupsPerSecond: number;
4439     /**
4440      * Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
4441      */
4442     percentCPUUsage: number;
4443   }
4444
4445   interface CrashReport {
4446
4447     // Docs: https://electronjs.org/docs/api/structures/crash-report
4448
4449     date: Date;
4450     id: string;
4451   }
4452
4453   interface CrashReporter {
4454
4455     // Docs: https://electronjs.org/docs/api/crash-reporter
4456
4457     /**
4458      * Set an extra parameter to be sent with the crash report. The values specified
4459      * here will be sent in addition to any values set via the `extra` option when
4460      * `start` was called.
4461      *
4462      * Parameters added in this fashion (or via the `extra` parameter to
4463      * `crashReporter.start`) are specific to the calling process. Adding extra
4464      * parameters in the main process will not cause those parameters to be sent along
4465      * with crashes from renderer or other child processes. Similarly, adding extra
4466      * parameters in a renderer process will not result in those parameters being sent
4467      * with crashes that occur in other renderer processes or in the main process.
4468      *
4469      * **Note:** Parameters have limits on the length of the keys and values. Key names
4470      * must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
4471      * Keys with names longer than the maximum will be silently ignored. Key values
4472      * longer than the maximum length will be truncated.
4473      */
4474     addExtraParameter(key: string, value: string): void;
4475     /**
4476      * The date and ID of the last crash report. Only crash reports that have been
4477      * uploaded will be returned; even if a crash report is present on disk it will not
4478      * be returned until it is uploaded. In the case that there are no uploaded
4479      * reports, `null` is returned.
4480      *
4481      * **Note:** This method is only available in the main process.
4482      */
4483     getLastCrashReport(): CrashReport;
4484     /**
4485      * The current 'extra' parameters of the crash reporter.
4486      */
4487     getParameters(): Record<string, string>;
4488     /**
4489      * Returns all uploaded crash reports. Each report contains the date and uploaded
4490      * ID.
4491      *
4492      * **Note:** This method is only available in the main process.
4493      */
4494     getUploadedReports(): CrashReport[];
4495     /**
4496      * Whether reports should be submitted to the server. Set through the `start`
4497      * method or `setUploadToServer`.
4498      *
4499      * **Note:** This method is only available in the main process.
4500      */
4501     getUploadToServer(): boolean;
4502     /**
4503      * Remove an extra parameter from the current set of parameters. Future crashes
4504      * will not include this parameter.
4505      */
4506     removeExtraParameter(key: string): void;
4507     /**
4508      * This would normally be controlled by user preferences. This has no effect if
4509      * called before `start` is called.
4510      *
4511      * **Note:** This method is only available in the main process.
4512      */
4513     setUploadToServer(uploadToServer: boolean): void;
4514     /**
4515      * This method must be called before using any other `crashReporter` APIs. Once
4516      * initialized this way, the crashpad handler collects crashes from all
4517      * subsequently created processes. The crash reporter cannot be disabled once
4518      * started.
4519      *
4520      * This method should be called as early as possible in app startup, preferably
4521      * before `app.on('ready')`. If the crash reporter is not initialized at the time a
4522      * renderer process is created, then that renderer process will not be monitored by
4523      * the crash reporter.
4524      *
4525      * **Note:** You can test out the crash reporter by generating a crash using
4526      * `process.crash()`.
4527      *
4528      * **Note:** If you need to send additional/updated `extra` parameters after your
4529      * first call `start` you can call `addExtraParameter`.
4530      *
4531      * **Note:** Parameters passed in `extra`, `globalExtra` or set with
4532      * `addExtraParameter` have limits on the length of the keys and values. Key names
4533      * must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
4534      * with names longer than the maximum will be silently ignored. Key values longer
4535      * than the maximum length will be truncated.
4536      *
4537      * **Note:** This method is only available in the main process.
4538      */
4539     start(options: CrashReporterStartOptions): void;
4540   }
4541
4542   interface CustomScheme {
4543
4544     // Docs: https://electronjs.org/docs/api/structures/custom-scheme
4545
4546     privileges?: Privileges;
4547     /**
4548      * Custom schemes to be registered with options.
4549      */
4550     scheme: string;
4551   }
4552
4553   class Debugger extends NodeEventEmitter {
4554
4555     // Docs: https://electronjs.org/docs/api/debugger
4556
4557     /**
4558      * Emitted when the debugging session is terminated. This happens either when
4559      * `webContents` is closed or devtools is invoked for the attached `webContents`.
4560      */
4561     on(event: 'detach', listener: (event: Event,
4562                                    /**
4563                                     * Reason for detaching debugger.
4564                                     */
4565                                    reason: string) => void): this;
4566     off(event: 'detach', listener: (event: Event,
4567                                    /**
4568                                     * Reason for detaching debugger.
4569                                     */
4570                                    reason: string) => void): this;
4571     once(event: 'detach', listener: (event: Event,
4572                                    /**
4573                                     * Reason for detaching debugger.
4574                                     */
4575                                    reason: string) => void): this;
4576     addListener(event: 'detach', listener: (event: Event,
4577                                    /**
4578                                     * Reason for detaching debugger.
4579                                     */
4580                                    reason: string) => void): this;
4581     removeListener(event: 'detach', listener: (event: Event,
4582                                    /**
4583                                     * Reason for detaching debugger.
4584                                     */
4585                                    reason: string) => void): this;
4586     /**
4587      * Emitted whenever the debugging target issues an instrumentation event.
4588      */
4589     on(event: 'message', listener: (event: Event,
4590                                     /**
4591                                      * Method name.
4592                                      */
4593                                     method: string,
4594                                     /**
4595                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4596                                      * protocol.
4597                                      */
4598                                     params: any,
4599                                     /**
4600                                      * Unique identifier of attached debugging session, will match the value sent from
4601                                      * `debugger.sendCommand`.
4602                                      */
4603                                     sessionId: string) => void): this;
4604     off(event: 'message', listener: (event: Event,
4605                                     /**
4606                                      * Method name.
4607                                      */
4608                                     method: string,
4609                                     /**
4610                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4611                                      * protocol.
4612                                      */
4613                                     params: any,
4614                                     /**
4615                                      * Unique identifier of attached debugging session, will match the value sent from
4616                                      * `debugger.sendCommand`.
4617                                      */
4618                                     sessionId: string) => void): this;
4619     once(event: 'message', listener: (event: Event,
4620                                     /**
4621                                      * Method name.
4622                                      */
4623                                     method: string,
4624                                     /**
4625                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4626                                      * protocol.
4627                                      */
4628                                     params: any,
4629                                     /**
4630                                      * Unique identifier of attached debugging session, will match the value sent from
4631                                      * `debugger.sendCommand`.
4632                                      */
4633                                     sessionId: string) => void): this;
4634     addListener(event: 'message', listener: (event: Event,
4635                                     /**
4636                                      * Method name.
4637                                      */
4638                                     method: string,
4639                                     /**
4640                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4641                                      * protocol.
4642                                      */
4643                                     params: any,
4644                                     /**
4645                                      * Unique identifier of attached debugging session, will match the value sent from
4646                                      * `debugger.sendCommand`.
4647                                      */
4648                                     sessionId: string) => void): this;
4649     removeListener(event: 'message', listener: (event: Event,
4650                                     /**
4651                                      * Method name.
4652                                      */
4653                                     method: string,
4654                                     /**
4655                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4656                                      * protocol.
4657                                      */
4658                                     params: any,
4659                                     /**
4660                                      * Unique identifier of attached debugging session, will match the value sent from
4661                                      * `debugger.sendCommand`.
4662                                      */
4663                                     sessionId: string) => void): this;
4664     /**
4665      * Attaches the debugger to the `webContents`.
4666      */
4667     attach(protocolVersion?: string): void;
4668     /**
4669      * Detaches the debugger from the `webContents`.
4670      */
4671     detach(): void;
4672     /**
4673      * Whether a debugger is attached to the `webContents`.
4674      */
4675     isAttached(): boolean;
4676     /**
4677      * A promise that resolves with the response defined by the 'returns' attribute of
4678      * the command description in the remote debugging protocol or is rejected
4679      * indicating the failure of the command.
4680      *
4681      * Send given command to the debugging target.
4682      */
4683     sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
4684   }
4685
4686   interface DesktopCapturer {
4687
4688     // Docs: https://electronjs.org/docs/api/desktop-capturer
4689
4690     /**
4691      * Resolves with an array of `DesktopCapturerSource` objects, each
4692      * `DesktopCapturerSource` represents a screen or an individual window that can be
4693      * captured.
4694      *
4695      * **Note** Capturing the screen contents requires user consent on macOS 10.15
4696      * Catalina or higher, which can detected by
4697      * `systemPreferences.getMediaAccessStatus`.
4698      */
4699     getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
4700   }
4701
4702   interface DesktopCapturerSource {
4703
4704     // Docs: https://electronjs.org/docs/api/structures/desktop-capturer-source
4705
4706     /**
4707      * An icon image of the application that owns the window or null if the source has
4708      * a type screen. The size of the icon is not known in advance and depends on what
4709      * the application provides.
4710      */
4711     appIcon: NativeImage;
4712     /**
4713      * A unique identifier that will correspond to the `id` of the matching Display
4714      * returned by the Screen API. On some platforms, this is equivalent to the `XX`
4715      * portion of the `id` field above and on others it will differ. It will be an
4716      * empty string if not available.
4717      */
4718     display_id: string;
4719     /**
4720      * The identifier of a window or screen that can be used as a `chromeMediaSourceId`
4721      * constraint when calling `navigator.getUserMedia`. The format of the identifier
4722      * will be `window:XX:YY` or `screen:ZZ:0`. XX is the windowID/handle. YY is 1 for
4723      * the current process, and 0 for all others. ZZ is a sequential number that
4724      * represents the screen, and it does not equal to the index in the source's name.
4725      */
4726     id: string;
4727     /**
4728      * A screen source will be named either `Entire Screen` or `Screen <index>`, while
4729      * the name of a window source will match the window title.
4730      */
4731     name: string;
4732     /**
4733      * A thumbnail image. **Note:** There is no guarantee that the size of the
4734      * thumbnail is the same as the `thumbnailSize` specified in the `options` passed
4735      * to `desktopCapturer.getSources`. The actual size depends on the scale of the
4736      * screen or window.
4737      */
4738     thumbnail: NativeImage;
4739   }
4740
4741   interface Dialog {
4742
4743     // Docs: https://electronjs.org/docs/api/dialog
4744
4745     /**
4746      * resolves when the certificate trust dialog is shown.
4747      *
4748      * On macOS, this displays a modal dialog that shows a message and certificate
4749      * information, and gives the user the option of trusting/importing the
4750      * certificate. If you provide a `browserWindow` argument the dialog will be
4751      * attached to the parent window, making it modal.
4752      *
4753      * On Windows the options are more limited, due to the Win32 APIs used:
4754      *
4755      * * The `message` argument is not used, as the OS provides its own confirmation
4756      * dialog.
4757      * * The `browserWindow` argument is ignored since it is not possible to make this
4758      * confirmation dialog modal.
4759      *
4760      * @platform darwin,win32
4761      */
4762     showCertificateTrustDialog(browserWindow: BrowserWindow, options: CertificateTrustDialogOptions): Promise<void>;
4763     /**
4764      * resolves when the certificate trust dialog is shown.
4765      *
4766      * On macOS, this displays a modal dialog that shows a message and certificate
4767      * information, and gives the user the option of trusting/importing the
4768      * certificate. If you provide a `browserWindow` argument the dialog will be
4769      * attached to the parent window, making it modal.
4770      *
4771      * On Windows the options are more limited, due to the Win32 APIs used:
4772      *
4773      * * The `message` argument is not used, as the OS provides its own confirmation
4774      * dialog.
4775      * * The `browserWindow` argument is ignored since it is not possible to make this
4776      * confirmation dialog modal.
4777      *
4778      * @platform darwin,win32
4779      */
4780     showCertificateTrustDialog(options: CertificateTrustDialogOptions): Promise<void>;
4781     /**
4782      * Displays a modal dialog that shows an error message.
4783      *
4784      * This API can be called safely before the `ready` event the `app` module emits,
4785      * it is usually used to report errors in early stage of startup. If called before
4786      * the app `ready`event on Linux, the message will be emitted to stderr, and no GUI
4787      * dialog will appear.
4788      */
4789     showErrorBox(title: string, content: string): void;
4790     /**
4791      * resolves with a promise containing the following properties:
4792      *
4793      * * `response` number - The index of the clicked button.
4794      * * `checkboxChecked` boolean - The checked state of the checkbox if
4795      * `checkboxLabel` was set. Otherwise `false`.
4796      *
4797      * Shows a message box.
4798      *
4799      * The `browserWindow` argument allows the dialog to attach itself to a parent
4800      * window, making it modal.
4801      */
4802     showMessageBox(browserWindow: BrowserWindow, options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
4803     /**
4804      * resolves with a promise containing the following properties:
4805      *
4806      * * `response` number - The index of the clicked button.
4807      * * `checkboxChecked` boolean - The checked state of the checkbox if
4808      * `checkboxLabel` was set. Otherwise `false`.
4809      *
4810      * Shows a message box.
4811      *
4812      * The `browserWindow` argument allows the dialog to attach itself to a parent
4813      * window, making it modal.
4814      */
4815     showMessageBox(options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
4816     /**
4817      * the index of the clicked button.
4818      *
4819      * Shows a message box, it will block the process until the message box is closed.
4820      * It returns the index of the clicked button.
4821      *
4822      * The `browserWindow` argument allows the dialog to attach itself to a parent
4823      * window, making it modal. If `browserWindow` is not shown dialog will not be
4824      * attached to it. In such case it will be displayed as an independent window.
4825      */
4826     showMessageBoxSync(browserWindow: BrowserWindow, options: MessageBoxSyncOptions): number;
4827     /**
4828      * the index of the clicked button.
4829      *
4830      * Shows a message box, it will block the process until the message box is closed.
4831      * It returns the index of the clicked button.
4832      *
4833      * The `browserWindow` argument allows the dialog to attach itself to a parent
4834      * window, making it modal. If `browserWindow` is not shown dialog will not be
4835      * attached to it. In such case it will be displayed as an independent window.
4836      */
4837     showMessageBoxSync(options: MessageBoxSyncOptions): number;
4838     /**
4839      * Resolve with an object containing the following:
4840      *
4841      * * `canceled` boolean - whether or not the dialog was canceled.
4842      * * `filePaths` string[] - An array of file paths chosen by the user. If the
4843      * dialog is cancelled this will be an empty array.
4844      * * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
4845      * `filePaths` array of base64 encoded strings which contains security scoped
4846      * bookmark data. `securityScopedBookmarks` must be enabled for this to be
4847      * populated. (For return values, see table here.)
4848      *
4849      * The `browserWindow` argument allows the dialog to attach itself to a parent
4850      * window, making it modal.
4851      *
4852      * The `filters` specifies an array of file types that can be displayed or selected
4853      * when you want to limit the user to a specific type. For example:
4854      *
4855      * The `extensions` array should contain extensions without wildcards or dots (e.g.
4856      * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
4857      * `'*'` wildcard (no other wildcard is supported).
4858      *
4859      * **Note:** On Windows and Linux an open dialog can not be both a file selector
4860      * and a directory selector, so if you set `properties` to `['openFile',
4861      * 'openDirectory']` on these platforms, a directory selector will be shown.
4862      */
4863     showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
4864     /**
4865      * Resolve with an object containing the following:
4866      *
4867      * * `canceled` boolean - whether or not the dialog was canceled.
4868      * * `filePaths` string[] - An array of file paths chosen by the user. If the
4869      * dialog is cancelled this will be an empty array.
4870      * * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
4871      * `filePaths` array of base64 encoded strings which contains security scoped
4872      * bookmark data. `securityScopedBookmarks` must be enabled for this to be
4873      * populated. (For return values, see table here.)
4874      *
4875      * The `browserWindow` argument allows the dialog to attach itself to a parent
4876      * window, making it modal.
4877      *
4878      * The `filters` specifies an array of file types that can be displayed or selected
4879      * when you want to limit the user to a specific type. For example:
4880      *
4881      * The `extensions` array should contain extensions without wildcards or dots (e.g.
4882      * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
4883      * `'*'` wildcard (no other wildcard is supported).
4884      *
4885      * **Note:** On Windows and Linux an open dialog can not be both a file selector
4886      * and a directory selector, so if you set `properties` to `['openFile',
4887      * 'openDirectory']` on these platforms, a directory selector will be shown.
4888      */
4889     showOpenDialog(options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
4890     /**
4891      * the file paths chosen by the user; if the dialog is cancelled it returns
4892      * `undefined`.
4893      *
4894      * The `browserWindow` argument allows the dialog to attach itself to a parent
4895      * window, making it modal.
4896      *
4897      * The `filters` specifies an array of file types that can be displayed or selected
4898      * when you want to limit the user to a specific type. For example:
4899      *
4900      * The `extensions` array should contain extensions without wildcards or dots (e.g.
4901      * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
4902      * `'*'` wildcard (no other wildcard is supported).
4903      *
4904      * **Note:** On Windows and Linux an open dialog can not be both a file selector
4905      * and a directory selector, so if you set `properties` to `['openFile',
4906      * 'openDirectory']` on these platforms, a directory selector will be shown.
4907      */
4908     showOpenDialogSync(browserWindow: BrowserWindow, options: OpenDialogSyncOptions): (string[]) | (undefined);
4909     /**
4910      * the file paths chosen by the user; if the dialog is cancelled it returns
4911      * `undefined`.
4912      *
4913      * The `browserWindow` argument allows the dialog to attach itself to a parent
4914      * window, making it modal.
4915      *
4916      * The `filters` specifies an array of file types that can be displayed or selected
4917      * when you want to limit the user to a specific type. For example:
4918      *
4919      * The `extensions` array should contain extensions without wildcards or dots (e.g.
4920      * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
4921      * `'*'` wildcard (no other wildcard is supported).
4922      *
4923      * **Note:** On Windows and Linux an open dialog can not be both a file selector
4924      * and a directory selector, so if you set `properties` to `['openFile',
4925      * 'openDirectory']` on these platforms, a directory selector will be shown.
4926      */
4927     showOpenDialogSync(options: OpenDialogSyncOptions): (string[]) | (undefined);
4928     /**
4929      * Resolve with an object containing the following:
4930      *
4931      * * `canceled` boolean - whether or not the dialog was canceled.
4932      * * `filePath` string (optional) - If the dialog is canceled, this will be
4933      * `undefined`.
4934      * * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
4935      * contains the security scoped bookmark data for the saved file.
4936      * `securityScopedBookmarks` must be enabled for this to be present. (For return
4937      * values, see table here.)
4938      *
4939      * The `browserWindow` argument allows the dialog to attach itself to a parent
4940      * window, making it modal.
4941      *
4942      * The `filters` specifies an array of file types that can be displayed, see
4943      * `dialog.showOpenDialog` for an example.
4944      *
4945      * **Note:** On macOS, using the asynchronous version is recommended to avoid
4946      * issues when expanding and collapsing the dialog.
4947      */
4948     showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
4949     /**
4950      * Resolve with an object containing the following:
4951      *
4952      * * `canceled` boolean - whether or not the dialog was canceled.
4953      * * `filePath` string (optional) - If the dialog is canceled, this will be
4954      * `undefined`.
4955      * * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
4956      * contains the security scoped bookmark data for the saved file.
4957      * `securityScopedBookmarks` must be enabled for this to be present. (For return
4958      * values, see table here.)
4959      *
4960      * The `browserWindow` argument allows the dialog to attach itself to a parent
4961      * window, making it modal.
4962      *
4963      * The `filters` specifies an array of file types that can be displayed, see
4964      * `dialog.showOpenDialog` for an example.
4965      *
4966      * **Note:** On macOS, using the asynchronous version is recommended to avoid
4967      * issues when expanding and collapsing the dialog.
4968      */
4969     showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
4970     /**
4971      * the path of the file chosen by the user; if the dialog is cancelled it returns
4972      * `undefined`.
4973      *
4974      * The `browserWindow` argument allows the dialog to attach itself to a parent
4975      * window, making it modal.
4976      *
4977      * The `filters` specifies an array of file types that can be displayed, see
4978      * `dialog.showOpenDialog` for an example.
4979      */
4980     showSaveDialogSync(browserWindow: BrowserWindow, options: SaveDialogSyncOptions): (string) | (undefined);
4981     /**
4982      * the path of the file chosen by the user; if the dialog is cancelled it returns
4983      * `undefined`.
4984      *
4985      * The `browserWindow` argument allows the dialog to attach itself to a parent
4986      * window, making it modal.
4987      *
4988      * The `filters` specifies an array of file types that can be displayed, see
4989      * `dialog.showOpenDialog` for an example.
4990      */
4991     showSaveDialogSync(options: SaveDialogSyncOptions): (string) | (undefined);
4992   }
4993
4994   interface Display {
4995
4996     // Docs: https://electronjs.org/docs/api/structures/display
4997
4998     /**
4999      * Can be `available`, `unavailable`, `unknown`.
5000      */
5001     accelerometerSupport: ('available' | 'unavailable' | 'unknown');
5002     /**
5003      * the bounds of the display in DIP points.
5004      */
5005     bounds: Rectangle;
5006     /**
5007      * The number of bits per pixel.
5008      */
5009     colorDepth: number;
5010     /**
5011      *  represent a color space (three-dimensional object which contains all realizable
5012      * color combinations) for the purpose of color conversions.
5013      */
5014     colorSpace: string;
5015     /**
5016      * The number of bits per color component.
5017      */
5018     depthPerComponent: number;
5019     /**
5020      * `true`` if the display is detected by the system.
5021      */
5022     detected: boolean;
5023     /**
5024      * The display refresh rate.
5025      */
5026     displayFrequency: number;
5027     /**
5028      * Unique identifier associated with the display. A value of of -1 means the
5029      * display is invalid or the correct `id` is not yet known, and a value of -10
5030      * means the display is a virtual display assigned to a unified desktop.
5031      */
5032     id: number;
5033     /**
5034      * `true` for an internal display and `false` for an external display.
5035      */
5036     internal: boolean;
5037     /**
5038      * User-friendly label, determined by the platform.
5039      */
5040     label: string;
5041     /**
5042      * Maximum cursor size in native pixels.
5043      */
5044     maximumCursorSize: Size;
5045     /**
5046      * Whether or not the display is a monochrome display.
5047      */
5048     monochrome: boolean;
5049     /**
5050      * Returns the display's origin in pixel coordinates. Only available on windowing
5051      * systems like X11 that position displays in pixel coordinates.
5052      */
5053     nativeOrigin: Point;
5054     /**
5055      * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees.
5056      */
5057     rotation: number;
5058     /**
5059      * Output device's pixel scale factor.
5060      */
5061     scaleFactor: number;
5062     size: Size;
5063     /**
5064      * Can be `available`, `unavailable`, `unknown`.
5065      */
5066     touchSupport: ('available' | 'unavailable' | 'unknown');
5067     /**
5068      * the work area of the display in DIP points.
5069      */
5070     workArea: Rectangle;
5071     /**
5072      * The size of the work area.
5073      */
5074     workAreaSize: Size;
5075   }
5076
5077   class Dock {
5078
5079     // Docs: https://electronjs.org/docs/api/dock
5080
5081     /**
5082      * an ID representing the request.
5083      *
5084      * When `critical` is passed, the dock icon will bounce until either the
5085      * application becomes active or the request is canceled.
5086      *
5087      * When `informational` is passed, the dock icon will bounce for one second.
5088      * However, the request remains active until either the application becomes active
5089      * or the request is canceled.
5090      *
5091      * **Note:** This method can only be used while the app is not focused; when the
5092      * app is focused it will return -1.
5093      *
5094      * @platform darwin
5095      */
5096     bounce(type?: 'critical' | 'informational'): number;
5097     /**
5098      * Cancel the bounce of `id`.
5099      *
5100      * @platform darwin
5101      */
5102     cancelBounce(id: number): void;
5103     /**
5104      * Bounces the Downloads stack if the filePath is inside the Downloads folder.
5105      *
5106      * @platform darwin
5107      */
5108     downloadFinished(filePath: string): void;
5109     /**
5110      * The badge string of the dock.
5111      *
5112      * @platform darwin
5113      */
5114     getBadge(): string;
5115     /**
5116      * The application's dock menu.
5117      *
5118      * @platform darwin
5119      */
5120     getMenu(): (Menu) | (null);
5121     /**
5122      * Hides the dock icon.
5123      *
5124      * @platform darwin
5125      */
5126     hide(): void;
5127     /**
5128      * Whether the dock icon is visible.
5129      *
5130      * @platform darwin
5131      */
5132     isVisible(): boolean;
5133     /**
5134      * Sets the string to be displayed in the dock’s badging area.
5135      *
5136      * @platform darwin
5137      */
5138     setBadge(text: string): void;
5139     /**
5140      * Sets the `image` associated with this dock icon.
5141      *
5142      * @platform darwin
5143      */
5144     setIcon(image: (NativeImage) | (string)): void;
5145     /**
5146      * Sets the application's dock menu.
5147      *
5148      * @platform darwin
5149      */
5150     setMenu(menu: Menu): void;
5151     /**
5152      * Resolves when the dock icon is shown.
5153      *
5154      * @platform darwin
5155      */
5156     show(): Promise<void>;
5157   }
5158
5159   class DownloadItem extends NodeEventEmitter {
5160
5161     // Docs: https://electronjs.org/docs/api/download-item
5162
5163     /**
5164      * Emitted when the download is in a terminal state. This includes a completed
5165      * download, a cancelled download (via `downloadItem.cancel()`), and interrupted
5166      * download that can't be resumed.
5167      *
5168      * The `state` can be one of following:
5169      *
5170      * * `completed` - The download completed successfully.
5171      * * `cancelled` - The download has been cancelled.
5172      * * `interrupted` - The download has interrupted and can not resume.
5173      */
5174     on(event: 'done', listener: (event: Event,
5175                                  /**
5176                                   * Can be `completed`, `cancelled` or `interrupted`.
5177                                   */
5178                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
5179     off(event: 'done', listener: (event: Event,
5180                                  /**
5181                                   * Can be `completed`, `cancelled` or `interrupted`.
5182                                   */
5183                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
5184     once(event: 'done', listener: (event: Event,
5185                                  /**
5186                                   * Can be `completed`, `cancelled` or `interrupted`.
5187                                   */
5188                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
5189     addListener(event: 'done', listener: (event: Event,
5190                                  /**
5191                                   * Can be `completed`, `cancelled` or `interrupted`.
5192                                   */
5193                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
5194     removeListener(event: 'done', listener: (event: Event,
5195                                  /**
5196                                   * Can be `completed`, `cancelled` or `interrupted`.
5197                                   */
5198                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
5199     /**
5200      * Emitted when the download has been updated and is not done.
5201      *
5202      * The `state` can be one of following:
5203      *
5204      * * `progressing` - The download is in-progress.
5205      * * `interrupted` - The download has interrupted and can be resumed.
5206      */
5207     on(event: 'updated', listener: (event: Event,
5208                                     /**
5209                                      * Can be `progressing` or `interrupted`.
5210                                      */
5211                                     state: ('progressing' | 'interrupted')) => void): this;
5212     off(event: 'updated', listener: (event: Event,
5213                                     /**
5214                                      * Can be `progressing` or `interrupted`.
5215                                      */
5216                                     state: ('progressing' | 'interrupted')) => void): this;
5217     once(event: 'updated', listener: (event: Event,
5218                                     /**
5219                                      * Can be `progressing` or `interrupted`.
5220                                      */
5221                                     state: ('progressing' | 'interrupted')) => void): this;
5222     addListener(event: 'updated', listener: (event: Event,
5223                                     /**
5224                                      * Can be `progressing` or `interrupted`.
5225                                      */
5226                                     state: ('progressing' | 'interrupted')) => void): this;
5227     removeListener(event: 'updated', listener: (event: Event,
5228                                     /**
5229                                      * Can be `progressing` or `interrupted`.
5230                                      */
5231                                     state: ('progressing' | 'interrupted')) => void): this;
5232     /**
5233      * Cancels the download operation.
5234      */
5235     cancel(): void;
5236     /**
5237      * Whether the download can resume.
5238      */
5239     canResume(): boolean;
5240     /**
5241      * The Content-Disposition field from the response header.
5242      */
5243     getContentDisposition(): string;
5244     /**
5245      * ETag header value.
5246      */
5247     getETag(): string;
5248     /**
5249      * The file name of the download item.
5250      *
5251      * **Note:** The file name is not always the same as the actual one saved in local
5252      * disk. If user changes the file name in a prompted download saving dialog, the
5253      * actual name of saved file will be different.
5254      */
5255     getFilename(): string;
5256     /**
5257      * Last-Modified header value.
5258      */
5259     getLastModifiedTime(): string;
5260     /**
5261      * The files mime type.
5262      */
5263     getMimeType(): string;
5264     /**
5265      * The received bytes of the download item.
5266      */
5267     getReceivedBytes(): number;
5268     /**
5269      * Returns the object previously set by
5270      * `downloadItem.setSaveDialogOptions(options)`.
5271      */
5272     getSaveDialogOptions(): SaveDialogOptions;
5273     /**
5274      * The save path of the download item. This will be either the path set via
5275      * `downloadItem.setSavePath(path)` or the path selected from the shown save
5276      * dialog.
5277      */
5278     getSavePath(): string;
5279     /**
5280      * Number of seconds since the UNIX epoch when the download was started.
5281      */
5282     getStartTime(): number;
5283     /**
5284      * The current state. Can be `progressing`, `completed`, `cancelled` or
5285      * `interrupted`.
5286      *
5287      * **Note:** The following methods are useful specifically to resume a `cancelled`
5288      * item when session is restarted.
5289      */
5290     getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
5291     /**
5292      * The total size in bytes of the download item.
5293      *
5294      * If the size is unknown, it returns 0.
5295      */
5296     getTotalBytes(): number;
5297     /**
5298      * The origin URL where the item is downloaded from.
5299      */
5300     getURL(): string;
5301     /**
5302      * The complete URL chain of the item including any redirects.
5303      */
5304     getURLChain(): string[];
5305     /**
5306      * Whether the download has user gesture.
5307      */
5308     hasUserGesture(): boolean;
5309     /**
5310      * Whether the download is paused.
5311      */
5312     isPaused(): boolean;
5313     /**
5314      * Pauses the download.
5315      */
5316     pause(): void;
5317     /**
5318      * Resumes the download that has been paused.
5319      *
5320      * **Note:** To enable resumable downloads the server you are downloading from must
5321      * support range requests and provide both `Last-Modified` and `ETag` header
5322      * values. Otherwise `resume()` will dismiss previously received bytes and restart
5323      * the download from the beginning.
5324      */
5325     resume(): void;
5326     /**
5327      * This API allows the user to set custom options for the save dialog that opens
5328      * for the download item by default. The API is only available in session's
5329      * `will-download` callback function.
5330      */
5331     setSaveDialogOptions(options: SaveDialogOptions): void;
5332     /**
5333      * The API is only available in session's `will-download` callback function. If
5334      * `path` doesn't exist, Electron will try to make the directory recursively. If
5335      * user doesn't set the save path via the API, Electron will use the original
5336      * routine to determine the save path; this usually prompts a save dialog.
5337      */
5338     setSavePath(path: string): void;
5339     /**
5340      * A `string` property that determines the save file path of the download item.
5341      *
5342      * The property is only available in session's `will-download` callback function.
5343      * If user doesn't set the save path via the property, Electron will use the
5344      * original routine to determine the save path; this usually prompts a save dialog.
5345      */
5346     savePath: string;
5347   }
5348
5349   interface Extension {
5350
5351     // Docs: https://electronjs.org/docs/api/structures/extension
5352
5353     id: string;
5354     /**
5355      * Copy of the extension's manifest data.
5356      */
5357     manifest: any;
5358     name: string;
5359     /**
5360      * The extension's file path.
5361      */
5362     path: string;
5363     /**
5364      * The extension's `chrome-extension://` URL.
5365      */
5366     url: string;
5367     version: string;
5368   }
5369
5370   interface ExtensionInfo {
5371
5372     // Docs: https://electronjs.org/docs/api/structures/extension-info
5373
5374     name: string;
5375     version: string;
5376   }
5377
5378   interface FileFilter {
5379
5380     // Docs: https://electronjs.org/docs/api/structures/file-filter
5381
5382     extensions: string[];
5383     name: string;
5384   }
5385
5386   interface FilePathWithHeaders {
5387
5388     // Docs: https://electronjs.org/docs/api/structures/file-path-with-headers
5389
5390     /**
5391      * Additional headers to be sent.
5392      */
5393     headers?: Record<string, string>;
5394     /**
5395      * The path to the file to send.
5396      */
5397     path: string;
5398   }
5399
5400   interface GlobalShortcut {
5401
5402     // Docs: https://electronjs.org/docs/api/global-shortcut
5403
5404     /**
5405      * Whether this application has registered `accelerator`.
5406      *
5407      * When the accelerator is already taken by other applications, this call will
5408      * still return `false`. This behavior is intended by operating systems, since they
5409      * don't want applications to fight for global shortcuts.
5410      */
5411     isRegistered(accelerator: Accelerator): boolean;
5412     /**
5413      * Whether or not the shortcut was registered successfully.
5414      *
5415      * Registers a global shortcut of `accelerator`. The `callback` is called when the
5416      * registered shortcut is pressed by the user.
5417      *
5418      * When the accelerator is already taken by other applications, this call will
5419      * silently fail. This behavior is intended by operating systems, since they don't
5420      * want applications to fight for global shortcuts.
5421      *
5422      * The following accelerators will not be registered successfully on macOS 10.14
5423      * Mojave unless the app has been authorized as a trusted accessibility client:
5424      *
5425      * * "Media Play/Pause"
5426      * * "Media Next Track"
5427      * * "Media Previous Track"
5428      * * "Media Stop"
5429      */
5430     register(accelerator: Accelerator, callback: () => void): boolean;
5431     /**
5432      * Registers a global shortcut of all `accelerator` items in `accelerators`. The
5433      * `callback` is called when any of the registered shortcuts are pressed by the
5434      * user.
5435      *
5436      * When a given accelerator is already taken by other applications, this call will
5437      * silently fail. This behavior is intended by operating systems, since they don't
5438      * want applications to fight for global shortcuts.
5439      *
5440      * The following accelerators will not be registered successfully on macOS 10.14
5441      * Mojave unless the app has been authorized as a trusted accessibility client:
5442      *
5443      * * "Media Play/Pause"
5444      * * "Media Next Track"
5445      * * "Media Previous Track"
5446      * * "Media Stop"
5447      */
5448     registerAll(accelerators: Accelerator[], callback: () => void): void;
5449     /**
5450      * Unregisters the global shortcut of `accelerator`.
5451      */
5452     unregister(accelerator: Accelerator): void;
5453     /**
5454      * Unregisters all of the global shortcuts.
5455      */
5456     unregisterAll(): void;
5457   }
5458
5459   interface GPUFeatureStatus {
5460
5461     // Docs: https://electronjs.org/docs/api/structures/gpu-feature-status
5462
5463     /**
5464      * Canvas.
5465      */
5466     '2d_canvas': string;
5467     /**
5468      * Flash.
5469      */
5470     flash_3d: string;
5471     /**
5472      * Flash Stage3D.
5473      */
5474     flash_stage3d: string;
5475     /**
5476      * Flash Stage3D Baseline profile.
5477      */
5478     flash_stage3d_baseline: string;
5479     /**
5480      * Compositing.
5481      */
5482     gpu_compositing: string;
5483     /**
5484      * Multiple Raster Threads.
5485      */
5486     multiple_raster_threads: string;
5487     /**
5488      * Native GpuMemoryBuffers.
5489      */
5490     native_gpu_memory_buffers: string;
5491     /**
5492      * Rasterization.
5493      */
5494     rasterization: string;
5495     /**
5496      * Video Decode.
5497      */
5498     video_decode: string;
5499     /**
5500      * Video Encode.
5501      */
5502     video_encode: string;
5503     /**
5504      * VPx Video Decode.
5505      */
5506     vpx_decode: string;
5507     /**
5508      * WebGL.
5509      */
5510     webgl: string;
5511     /**
5512      * WebGL2.
5513      */
5514     webgl2: string;
5515   }
5516
5517   interface HIDDevice {
5518
5519     // Docs: https://electronjs.org/docs/api/structures/hid-device
5520
5521     /**
5522      * Unique identifier for the device.
5523      */
5524     deviceId: string;
5525     /**
5526      * Unique identifier for the HID interface.  A device may have multiple HID
5527      * interfaces.
5528      */
5529     guid?: string;
5530     /**
5531      * Name of the device.
5532      */
5533     name: string;
5534     /**
5535      * The USB product ID.
5536      */
5537     productId: number;
5538     /**
5539      * The USB device serial number.
5540      */
5541     serialNumber?: string;
5542     /**
5543      * The USB vendor ID.
5544      */
5545     vendorId: number;
5546   }
5547
5548   interface InAppPurchase extends NodeJS.EventEmitter {
5549
5550     // Docs: https://electronjs.org/docs/api/in-app-purchase
5551
5552     on(event: 'transactions-updated', listener: Function): this;
5553     off(event: 'transactions-updated', listener: Function): this;
5554     once(event: 'transactions-updated', listener: Function): this;
5555     addListener(event: 'transactions-updated', listener: Function): this;
5556     removeListener(event: 'transactions-updated', listener: Function): this;
5557     /**
5558      * whether a user can make a payment.
5559      */
5560     canMakePayments(): boolean;
5561     /**
5562      * Completes all pending transactions.
5563      */
5564     finishAllTransactions(): void;
5565     /**
5566      * Completes the pending transactions corresponding to the date.
5567      */
5568     finishTransactionByDate(date: string): void;
5569     /**
5570      * Resolves with an array of `Product` objects.
5571      *
5572      * Retrieves the product descriptions.
5573      */
5574     getProducts(productIDs: string[]): Promise<Electron.Product[]>;
5575     /**
5576      * the path to the receipt.
5577      */
5578     getReceiptURL(): string;
5579     /**
5580      * Returns `true` if the product is valid and added to the payment queue.
5581      *
5582      * You should listen for the `transactions-updated` event as soon as possible and
5583      * certainly before you call `purchaseProduct`.
5584      */
5585     purchaseProduct(productID: string, opts?: (number) | (PurchaseProductOpts)): Promise<boolean>;
5586     /**
5587      * Restores finished transactions. This method can be called either to install
5588      * purchases on additional devices, or to restore purchases for an application that
5589      * the user deleted and reinstalled.
5590      *
5591      * The payment queue delivers a new transaction for each previously completed
5592      * transaction that can be restored. Each transaction includes a copy of the
5593      * original transaction.
5594      */
5595     restoreCompletedTransactions(): void;
5596   }
5597
5598   class IncomingMessage extends NodeEventEmitter {
5599
5600     // Docs: https://electronjs.org/docs/api/incoming-message
5601
5602     /**
5603      * Emitted when a request has been canceled during an ongoing HTTP transaction.
5604      */
5605     on(event: 'aborted', listener: Function): this;
5606     off(event: 'aborted', listener: Function): this;
5607     once(event: 'aborted', listener: Function): this;
5608     addListener(event: 'aborted', listener: Function): this;
5609     removeListener(event: 'aborted', listener: Function): this;
5610     /**
5611      * The `data` event is the usual method of transferring response data into
5612      * applicative code.
5613      */
5614     on(event: 'data', listener: (
5615                                  /**
5616                                   * A chunk of response body's data.
5617                                   */
5618                                  chunk: Buffer) => void): this;
5619     off(event: 'data', listener: (
5620                                  /**
5621                                   * A chunk of response body's data.
5622                                   */
5623                                  chunk: Buffer) => void): this;
5624     once(event: 'data', listener: (
5625                                  /**
5626                                   * A chunk of response body's data.
5627                                   */
5628                                  chunk: Buffer) => void): this;
5629     addListener(event: 'data', listener: (
5630                                  /**
5631                                   * A chunk of response body's data.
5632                                   */
5633                                  chunk: Buffer) => void): this;
5634     removeListener(event: 'data', listener: (
5635                                  /**
5636                                   * A chunk of response body's data.
5637                                   */
5638                                  chunk: Buffer) => void): this;
5639     /**
5640      * Indicates that response body has ended. Must be placed before 'data' event.
5641      */
5642     on(event: 'end', listener: Function): this;
5643     off(event: 'end', listener: Function): this;
5644     once(event: 'end', listener: Function): this;
5645     addListener(event: 'end', listener: Function): this;
5646     removeListener(event: 'end', listener: Function): this;
5647     /**
5648      * Returns:
5649      *
5650      * `error` Error - Typically holds an error string identifying failure root cause.
5651      *
5652      * Emitted when an error was encountered while streaming response data events. For
5653      * instance, if the server closes the underlying while the response is still
5654      * streaming, an `error` event will be emitted on the response object and a `close`
5655      * event will subsequently follow on the request object.
5656      */
5657     on(event: 'error', listener: Function): this;
5658     off(event: 'error', listener: Function): this;
5659     once(event: 'error', listener: Function): this;
5660     addListener(event: 'error', listener: Function): this;
5661     removeListener(event: 'error', listener: Function): this;
5662     /**
5663      * A `Record<string, string | string[]>` representing the HTTP response headers.
5664      * The `headers` object is formatted as follows:
5665      *
5666      * * All header names are lowercased.
5667      * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,
5668      * `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
5669      * `last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
5670      * `retry-after`, `server`, or `user-agent` are discarded.
5671      * * `set-cookie` is always an array. Duplicates are added to the array.
5672      * * For duplicate `cookie` headers, the values are joined together with '; '.
5673      * * For all other headers, the values are joined together with ', '.
5674      */
5675     headers: Record<string, (string) | (string[])>;
5676     /**
5677      * A `string` indicating the HTTP protocol version number. Typical values are '1.0'
5678      * or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two
5679      * Integer-valued readable properties that return respectively the HTTP major and
5680      * minor version numbers.
5681      */
5682     httpVersion: string;
5683     /**
5684      * An `Integer` indicating the HTTP protocol major version number.
5685      */
5686     httpVersionMajor: number;
5687     /**
5688      * An `Integer` indicating the HTTP protocol minor version number.
5689      */
5690     httpVersionMinor: number;
5691     /**
5692      * A `string[]` containing the raw HTTP response headers exactly as they were
5693      * received. The keys and values are in the same list. It is not a list of tuples.
5694      * So, the even-numbered offsets are key values, and the odd-numbered offsets are
5695      * the associated values. Header names are not lowercased, and duplicates are not
5696      * merged.
5697      */
5698     rawHeaders: string[];
5699     /**
5700      * An `Integer` indicating the HTTP response status code.
5701      */
5702     statusCode: number;
5703     /**
5704      * A `string` representing the HTTP status message.
5705      */
5706     statusMessage: string;
5707   }
5708
5709   interface InputEvent {
5710
5711     // Docs: https://electronjs.org/docs/api/structures/input-event
5712
5713     /**
5714      * An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`,
5715      * `meta`, `command`, `cmd`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`,
5716      * `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`.
5717      */
5718     modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>;
5719     /**
5720      * Can be `undefined`, `mouseDown`, `mouseUp`, `mouseMove`, `mouseEnter`,
5721      * `mouseLeave`, `contextMenu`, `mouseWheel`, `rawKeyDown`, `keyDown`, `keyUp`,
5722      * `char`, `gestureScrollBegin`, `gestureScrollEnd`, `gestureScrollUpdate`,
5723      * `gestureFlingStart`, `gestureFlingCancel`, `gesturePinchBegin`,
5724      * `gesturePinchEnd`, `gesturePinchUpdate`, `gestureTapDown`, `gestureShowPress`,
5725      * `gestureTap`, `gestureTapCancel`, `gestureShortPress`, `gestureLongPress`,
5726      * `gestureLongTap`, `gestureTwoFingerTap`, `gestureTapUnconfirmed`,
5727      * `gestureDoubleTap`, `touchStart`, `touchMove`, `touchEnd`, `touchCancel`,
5728      * `touchScrollStarted`, `pointerDown`, `pointerUp`, `pointerMove`,
5729      * `pointerRawUpdate`, `pointerCancel` or `pointerCausedUaAction`.
5730      */
5731     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');
5732   }
5733
5734   interface IOCounters {
5735
5736     // Docs: https://electronjs.org/docs/api/structures/io-counters
5737
5738     /**
5739      * Then number of I/O other operations.
5740      */
5741     otherOperationCount: number;
5742     /**
5743      * Then number of I/O other transfers.
5744      */
5745     otherTransferCount: number;
5746     /**
5747      * The number of I/O read operations.
5748      */
5749     readOperationCount: number;
5750     /**
5751      * The number of I/O read transfers.
5752      */
5753     readTransferCount: number;
5754     /**
5755      * The number of I/O write operations.
5756      */
5757     writeOperationCount: number;
5758     /**
5759      * The number of I/O write transfers.
5760      */
5761     writeTransferCount: number;
5762   }
5763
5764   interface IpcMain extends NodeJS.EventEmitter {
5765
5766     // Docs: https://electronjs.org/docs/api/ipc-main
5767
5768     /**
5769      * Adds a handler for an `invoke`able IPC. This handler will be called whenever a
5770      * renderer calls `ipcRenderer.invoke(channel, ...args)`.
5771      *
5772      * If `listener` returns a Promise, the eventual result of the promise will be
5773      * returned as a reply to the remote caller. Otherwise, the return value of the
5774      * listener will be used as the value of the reply.
5775      *
5776      * The `event` that is passed as the first argument to the handler is the same as
5777      * that passed to a regular event listener. It includes information about which
5778      * WebContents is the source of the invoke request.
5779      *
5780      * Errors thrown through `handle` in the main process are not transparent as they
5781      * are serialized and only the `message` property from the original error is
5782      * provided to the renderer process. Please refer to #24427 for details.
5783      */
5784     handle(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
5785     /**
5786      * Handles a single `invoke`able IPC message, then removes the listener. See
5787      * `ipcMain.handle(channel, listener)`.
5788      */
5789     handleOnce(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
5790     /**
5791      * Listens to `channel`, when a new message arrives `listener` would be called with
5792      * `listener(event, args...)`.
5793      */
5794     on(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
5795     /**
5796      * Adds a one time `listener` function for the event. This `listener` is invoked
5797      * only the next time a message is sent to `channel`, after which it is removed.
5798      */
5799     once(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
5800     /**
5801      * Removes listeners of the specified `channel`.
5802      */
5803     removeAllListeners(channel?: string): this;
5804     /**
5805      * Removes any handler for `channel`, if present.
5806      */
5807     removeHandler(channel: string): void;
5808     /**
5809      * Removes the specified `listener` from the listener array for the specified
5810      * `channel`.
5811      */
5812     removeListener(channel: string, listener: (...args: any[]) => void): this;
5813   }
5814
5815   interface IpcMainEvent extends Event {
5816
5817     // Docs: https://electronjs.org/docs/api/structures/ipc-main-event
5818
5819     /**
5820      * The ID of the renderer frame that sent this message
5821      */
5822     frameId: number;
5823     /**
5824      * A list of MessagePorts that were transferred with this message
5825      */
5826     ports: MessagePortMain[];
5827     /**
5828      * The internal ID of the renderer process that sent this message
5829      */
5830     processId: number;
5831     /**
5832      * A function that will send an IPC message to the renderer frame that sent the
5833      * original message that you are currently handling.  You should use this method to
5834      * "reply" to the sent message in order to guarantee the reply will go to the
5835      * correct process and frame.
5836      */
5837     reply: (channel: string, ...args: any[]) => void;
5838     /**
5839      * Set this to the value to be returned in a synchronous message
5840      */
5841     returnValue: any;
5842     /**
5843      * Returns the `webContents` that sent the message
5844      */
5845     sender: WebContents;
5846     /**
5847      * The frame that sent this message
5848      *
5849      */
5850     readonly senderFrame: WebFrameMain;
5851   }
5852
5853   interface IpcMainInvokeEvent extends Event {
5854
5855     // Docs: https://electronjs.org/docs/api/structures/ipc-main-invoke-event
5856
5857     /**
5858      * The ID of the renderer frame that sent this message
5859      */
5860     frameId: number;
5861     /**
5862      * The internal ID of the renderer process that sent this message
5863      */
5864     processId: number;
5865     /**
5866      * Returns the `webContents` that sent the message
5867      */
5868     sender: WebContents;
5869     /**
5870      * The frame that sent this message
5871      *
5872      */
5873     readonly senderFrame: WebFrameMain;
5874   }
5875
5876   interface IpcRenderer extends NodeJS.EventEmitter {
5877
5878     // Docs: https://electronjs.org/docs/api/ipc-renderer
5879
5880     /**
5881      * Alias for `ipcRenderer.on`.
5882      */
5883     addListener(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
5884     /**
5885      * Resolves with the response from the main process.
5886      *
5887      * Send a message to the main process via `channel` and expect a result
5888      * asynchronously. Arguments will be serialized with the Structured Clone
5889      * Algorithm, just like `window.postMessage`, so prototype chains will not be
5890      * included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw
5891      * an exception.
5892      *
5893      * The main process should listen for `channel` with `ipcMain.handle()`.
5894      *
5895      * For example:
5896      *
5897      * If you need to transfer a `MessagePort` to the main process, use
5898      * `ipcRenderer.postMessage`.
5899      *
5900      * If you do not need a response to the message, consider using `ipcRenderer.send`.
5901      *
5902      * > **Note** Sending non-standard JavaScript types such as DOM objects or special
5903      * Electron objects will throw an exception.
5904      *
5905      * Since the main process does not have support for DOM objects such as
5906      * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
5907      * Electron's IPC to the main process, as the main process would have no way to
5908      * decode them. Attempting to send such objects over IPC will result in an error.
5909      *
5910      * > **Note** If the handler in the main process throws an error, the promise
5911      * returned by `invoke` will reject. However, the `Error` object in the renderer
5912      * process will not be the same as the one thrown in the main process.
5913      */
5914     invoke(channel: string, ...args: any[]): Promise<any>;
5915     /**
5916      * Alias for `ipcRenderer.removeListener`.
5917      */
5918     off(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
5919     /**
5920      * Listens to `channel`, when a new message arrives `listener` would be called with
5921      * `listener(event, args...)`.
5922      */
5923     on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
5924     /**
5925      * Adds a one time `listener` function for the event. This `listener` is invoked
5926      * only the next time a message is sent to `channel`, after which it is removed.
5927      */
5928     once(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
5929     /**
5930      * Send a message to the main process, optionally transferring ownership of zero or
5931      * more `MessagePort` objects.
5932      *
5933      * The transferred `MessagePort` objects will be available in the main process as
5934      * `MessagePortMain` objects by accessing the `ports` property of the emitted
5935      * event.
5936      *
5937      * For example:
5938      *
5939      * For more information on using `MessagePort` and `MessageChannel`, see the MDN
5940      * documentation.
5941      */
5942     postMessage(channel: string, message: any, transfer?: MessagePort[]): void;
5943     /**
5944      * Removes all listeners, or those of the specified `channel`.
5945      */
5946     removeAllListeners(channel: string): this;
5947     /**
5948      * Removes the specified `listener` from the listener array for the specified
5949      * `channel`.
5950      */
5951     removeListener(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
5952     /**
5953      * Send an asynchronous message to the main process via `channel`, along with
5954      * arguments. Arguments will be serialized with the Structured Clone Algorithm,
5955      * just like `window.postMessage`, so prototype chains will not be included.
5956      * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
5957      * exception.
5958      *
5959      * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
5960      * Electron objects will throw an exception.
5961      *
5962      * Since the main process does not have support for DOM objects such as
5963      * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
5964      * Electron's IPC to the main process, as the main process would have no way to
5965      * decode them. Attempting to send such objects over IPC will result in an error.
5966      *
5967      * The main process handles it by listening for `channel` with the `ipcMain`
5968      * module.
5969      *
5970      * If you need to transfer a `MessagePort` to the main process, use
5971      * `ipcRenderer.postMessage`.
5972      *
5973      * If you want to receive a single response from the main process, like the result
5974      * of a method call, consider using `ipcRenderer.invoke`.
5975      */
5976     send(channel: string, ...args: any[]): void;
5977     /**
5978      * The value sent back by the `ipcMain` handler.
5979      *
5980      * Send a message to the main process via `channel` and expect a result
5981      * synchronously. Arguments will be serialized with the Structured Clone Algorithm,
5982      * just like `window.postMessage`, so prototype chains will not be included.
5983      * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
5984      * exception.
5985      *
5986      * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
5987      * Electron objects will throw an exception.
5988      *
5989      * Since the main process does not have support for DOM objects such as
5990      * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
5991      * Electron's IPC to the main process, as the main process would have no way to
5992      * decode them. Attempting to send such objects over IPC will result in an error.
5993      *
5994      * The main process handles it by listening for `channel` with `ipcMain` module,
5995      * and replies by setting `event.returnValue`.
5996      *
5997      * > :warning: **WARNING**: Sending a synchronous message will block the whole
5998      * renderer process until the reply is received, so use this method only as a last
5999      * resort. It's much better to use the asynchronous version, `invoke()`.
6000      */
6001     sendSync(channel: string, ...args: any[]): any;
6002     /**
6003      * Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
6004      * the host page instead of the main process.
6005      */
6006     sendToHost(channel: string, ...args: any[]): void;
6007   }
6008
6009   interface IpcRendererEvent extends Event {
6010
6011     // Docs: https://electronjs.org/docs/api/structures/ipc-renderer-event
6012
6013     /**
6014      * A list of MessagePorts that were transferred with this message
6015      */
6016     ports: MessagePort[];
6017     /**
6018      * The `IpcRenderer` instance that emitted the event originally
6019      */
6020     sender: IpcRenderer;
6021   }
6022
6023   interface JumpListCategory {
6024
6025     // Docs: https://electronjs.org/docs/api/structures/jump-list-category
6026
6027     /**
6028      * Array of `JumpListItem` objects if `type` is `tasks` or `custom`, otherwise it
6029      * should be omitted.
6030      */
6031     items?: JumpListItem[];
6032     /**
6033      * Must be set if `type` is `custom`, otherwise it should be omitted.
6034      */
6035     name?: string;
6036     /**
6037      * One of the following:
6038      */
6039     type?: ('tasks' | 'frequent' | 'recent' | 'custom');
6040   }
6041
6042   interface JumpListItem {
6043
6044     // Docs: https://electronjs.org/docs/api/structures/jump-list-item
6045
6046     /**
6047      * The command line arguments when `program` is executed. Should only be set if
6048      * `type` is `task`.
6049      */
6050     args?: string;
6051     /**
6052      * Description of the task (displayed in a tooltip). Should only be set if `type`
6053      * is `task`. Maximum length 260 characters.
6054      */
6055     description?: string;
6056     /**
6057      * The index of the icon in the resource file. If a resource file contains multiple
6058      * icons this value can be used to specify the zero-based index of the icon that
6059      * should be displayed for this task. If a resource file contains only one icon,
6060      * this property should be set to zero.
6061      */
6062     iconIndex?: number;
6063     /**
6064      * The absolute path to an icon to be displayed in a Jump List, which can be an
6065      * arbitrary resource file that contains an icon (e.g. `.ico`, `.exe`, `.dll`). You
6066      * can usually specify `process.execPath` to show the program icon.
6067      */
6068     iconPath?: string;
6069     /**
6070      * Path of the file to open, should only be set if `type` is `file`.
6071      */
6072     path?: string;
6073     /**
6074      * Path of the program to execute, usually you should specify `process.execPath`
6075      * which opens the current program. Should only be set if `type` is `task`.
6076      */
6077     program?: string;
6078     /**
6079      * The text to be displayed for the item in the Jump List. Should only be set if
6080      * `type` is `task`.
6081      */
6082     title?: string;
6083     /**
6084      * One of the following:
6085      */
6086     type?: ('task' | 'separator' | 'file');
6087     /**
6088      * The working directory. Default is empty.
6089      */
6090     workingDirectory?: string;
6091   }
6092
6093   interface KeyboardEvent {
6094
6095     // Docs: https://electronjs.org/docs/api/structures/keyboard-event
6096
6097     /**
6098      * whether an Alt key was used in an accelerator to trigger the Event
6099      */
6100     altKey?: boolean;
6101     /**
6102      * whether the Control key was used in an accelerator to trigger the Event
6103      */
6104     ctrlKey?: boolean;
6105     /**
6106      * whether a meta key was used in an accelerator to trigger the Event
6107      */
6108     metaKey?: boolean;
6109     /**
6110      * whether a Shift key was used in an accelerator to trigger the Event
6111      */
6112     shiftKey?: boolean;
6113     /**
6114      * whether an accelerator was used to trigger the event as opposed to another user
6115      * gesture like mouse click
6116      */
6117     triggeredByAccelerator?: boolean;
6118   }
6119
6120   interface KeyboardInputEvent extends InputEvent {
6121
6122     // Docs: https://electronjs.org/docs/api/structures/keyboard-input-event
6123
6124     /**
6125      * The character that will be sent as the keyboard event. Should only use the valid
6126      * key codes in Accelerator.
6127      */
6128     keyCode: string;
6129     /**
6130      * The type of the event, can be `rawKeyDown`, `keyDown`, `keyUp` or `char`.
6131      */
6132     type: ('rawKeyDown' | 'keyDown' | 'keyUp' | 'char');
6133   }
6134
6135   interface MemoryInfo {
6136
6137     // Docs: https://electronjs.org/docs/api/structures/memory-info
6138
6139     /**
6140      * The maximum amount of memory that has ever been pinned to actual physical RAM.
6141      */
6142     peakWorkingSetSize: number;
6143     /**
6144      * The amount of memory not shared by other processes, such as JS heap or HTML
6145      * content.
6146      *
6147      * @platform win32
6148      */
6149     privateBytes?: number;
6150     /**
6151      * The amount of memory currently pinned to actual physical RAM.
6152      */
6153     workingSetSize: number;
6154   }
6155
6156   interface MemoryUsageDetails {
6157
6158     // Docs: https://electronjs.org/docs/api/structures/memory-usage-details
6159
6160     count: number;
6161     liveSize: number;
6162     size: number;
6163   }
6164
6165   class Menu extends NodeEventEmitter {
6166
6167     // Docs: https://electronjs.org/docs/api/menu
6168
6169     /**
6170      * Emitted when a popup is closed either manually or with `menu.closePopup()`.
6171      */
6172     on(event: 'menu-will-close', listener: (event: Event) => void): this;
6173     off(event: 'menu-will-close', listener: (event: Event) => void): this;
6174     once(event: 'menu-will-close', listener: (event: Event) => void): this;
6175     addListener(event: 'menu-will-close', listener: (event: Event) => void): this;
6176     removeListener(event: 'menu-will-close', listener: (event: Event) => void): this;
6177     /**
6178      * Emitted when `menu.popup()` is called.
6179      */
6180     on(event: 'menu-will-show', listener: (event: Event) => void): this;
6181     off(event: 'menu-will-show', listener: (event: Event) => void): this;
6182     once(event: 'menu-will-show', listener: (event: Event) => void): this;
6183     addListener(event: 'menu-will-show', listener: (event: Event) => void): this;
6184     removeListener(event: 'menu-will-show', listener: (event: Event) => void): this;
6185     /**
6186      * Menu
6187      */
6188     constructor();
6189     /**
6190      * Generally, the `template` is an array of `options` for constructing a MenuItem.
6191      * The usage can be referenced above.
6192      *
6193      * You can also attach other fields to the element of the `template` and they will
6194      * become properties of the constructed menu items.
6195      */
6196     static buildFromTemplate(template: Array<(MenuItemConstructorOptions) | (MenuItem)>): Menu;
6197     /**
6198      * The application menu, if set, or `null`, if not set.
6199      *
6200      * **Note:** The returned `Menu` instance doesn't support dynamic addition or
6201      * removal of menu items. Instance properties can still be dynamically modified.
6202      */
6203     static getApplicationMenu(): (Menu) | (null);
6204     /**
6205      * Sends the `action` to the first responder of application. This is used for
6206      * emulating default macOS menu behaviors. Usually you would use the `role`
6207      * property of a `MenuItem`.
6208      *
6209      * See the macOS Cocoa Event Handling Guide for more information on macOS' native
6210      * actions.
6211      *
6212      * @platform darwin
6213      */
6214     static sendActionToFirstResponder(action: string): void;
6215     /**
6216      * Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
6217      * will be set as each window's top menu.
6218      *
6219      * Also on Windows and Linux, you can use a `&` in the top-level item name to
6220      * indicate which letter should get a generated accelerator. For example, using
6221      * `&File` for the file menu would result in a generated `Alt-F` accelerator that
6222      * opens the associated menu. The indicated character in the button label then gets
6223      * an underline, and the `&` character is not displayed on the button label.
6224      *
6225      * In order to escape the `&` character in an item name, add a proceeding `&`. For
6226      * example, `&&File` would result in `&File` displayed on the button label.
6227      *
6228      * Passing `null` will suppress the default menu. On Windows and Linux, this has
6229      * the additional effect of removing the menu bar from the window.
6230      *
6231      * **Note:** The default menu will be created automatically if the app does not set
6232      * one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
6233      * `Help`.
6234      */
6235     static setApplicationMenu(menu: (Menu) | (null)): void;
6236     /**
6237      * Appends the `menuItem` to the menu.
6238      */
6239     append(menuItem: MenuItem): void;
6240     /**
6241      * Closes the context menu in the `browserWindow`.
6242      */
6243     closePopup(browserWindow?: BrowserWindow): void;
6244     /**
6245      * the item with the specified `id`
6246      */
6247     getMenuItemById(id: string): (MenuItem) | (null);
6248     /**
6249      * Inserts the `menuItem` to the `pos` position of the menu.
6250      */
6251     insert(pos: number, menuItem: MenuItem): void;
6252     /**
6253      * Pops up this menu as a context menu in the `BrowserWindow`.
6254      */
6255     popup(options?: PopupOptions): void;
6256     /**
6257      * A `MenuItem[]` array containing the menu's items.
6258      *
6259      * Each `Menu` consists of multiple `MenuItem`s and each `MenuItem` can have a
6260      * submenu.
6261      */
6262     items: MenuItem[];
6263   }
6264
6265   class MenuItem {
6266
6267     // Docs: https://electronjs.org/docs/api/menu-item
6268
6269     /**
6270      * MenuItem
6271      */
6272     constructor(options: MenuItemConstructorOptions);
6273     /**
6274      * An `Accelerator` (optional) indicating the item's accelerator, if set.
6275      */
6276     accelerator?: Accelerator;
6277     /**
6278      * A `boolean` indicating whether the item is checked, this property can be
6279      * dynamically changed.
6280      *
6281      * A `checkbox` menu item will toggle the `checked` property on and off when
6282      * selected.
6283      *
6284      * A `radio` menu item will turn on its `checked` property when clicked, and will
6285      * turn off that property for all adjacent items in the same menu.
6286      *
6287      * You can add a `click` function for additional behavior.
6288      */
6289     checked: boolean;
6290     /**
6291      * A `Function` that is fired when the MenuItem receives a click event. It can be
6292      * called with `menuItem.click(event, focusedWindow, focusedWebContents)`.
6293      *
6294      * * `event` KeyboardEvent
6295      * * `focusedWindow` BrowserWindow
6296      * * `focusedWebContents` WebContents
6297      */
6298     click: Function;
6299     /**
6300      * A `number` indicating an item's sequential unique id.
6301      */
6302     commandId: number;
6303     /**
6304      * A `boolean` indicating whether the item is enabled, this property can be
6305      * dynamically changed.
6306      */
6307     enabled: boolean;
6308     /**
6309      * A `NativeImage | string` (optional) indicating the item's icon, if set.
6310      */
6311     icon?: (NativeImage) | (string);
6312     /**
6313      * A `string` indicating the item's unique id, this property can be dynamically
6314      * changed.
6315      */
6316     id: string;
6317     /**
6318      * A `string` indicating the item's visible label.
6319      */
6320     label: string;
6321     /**
6322      * A `Menu` that the item is a part of.
6323      */
6324     menu: Menu;
6325     /**
6326      * A `boolean` indicating if the accelerator should be registered with the system
6327      * or just displayed.
6328      *
6329      * This property can be dynamically changed.
6330      */
6331     registerAccelerator: boolean;
6332     /**
6333      * A `string` (optional) indicating the item's role, if set. Can be `undo`, `redo`,
6334      * `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`,
6335      * `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`,
6336      * `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`,
6337      * `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`,
6338      * `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`,
6339      * `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`,
6340      * `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`,
6341      * `moveTabToNewWindow` or `windowMenu`
6342      */
6343     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');
6344     /**
6345      * A `SharingItem` indicating the item to share when the `role` is `shareMenu`.
6346      *
6347      * This property can be dynamically changed.
6348      *
6349      * @platform darwin
6350      */
6351     sharingItem: SharingItem;
6352     /**
6353      * A `string` indicating the item's sublabel.
6354      */
6355     sublabel: string;
6356     /**
6357      * A `Menu` (optional) containing the menu item's submenu, if present.
6358      */
6359     submenu?: Menu;
6360     /**
6361      * A `string` indicating the item's hover text.
6362      *
6363      * @platform darwin
6364      */
6365     toolTip: string;
6366     /**
6367      * A `string` indicating the type of the item. Can be `normal`, `separator`,
6368      * `submenu`, `checkbox` or `radio`.
6369      */
6370     type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
6371     /**
6372      * An `Accelerator | null` indicating the item's user-assigned accelerator for the
6373      * menu item.
6374      *
6375      * **Note:** This property is only initialized after the `MenuItem` has been added
6376      * to a `Menu`. Either via `Menu.buildFromTemplate` or via
6377      * `Menu.append()/insert()`.  Accessing before initialization will just return
6378      * `null`.
6379      *
6380      * @platform darwin
6381      */
6382     readonly userAccelerator: (Accelerator) | (null);
6383     /**
6384      * A `boolean` indicating whether the item is visible, this property can be
6385      * dynamically changed.
6386      */
6387     visible: boolean;
6388   }
6389
6390   class MessageChannelMain extends NodeEventEmitter {
6391
6392     // Docs: https://electronjs.org/docs/api/message-channel-main
6393
6394     /**
6395      * A `MessagePortMain` property.
6396      */
6397     port1: MessagePortMain;
6398     /**
6399      * A `MessagePortMain` property.
6400      */
6401     port2: MessagePortMain;
6402   }
6403
6404   class MessagePortMain extends NodeEventEmitter {
6405
6406     // Docs: https://electronjs.org/docs/api/message-port-main
6407
6408     /**
6409      * Emitted when the remote end of a MessagePortMain object becomes disconnected.
6410      */
6411     on(event: 'close', listener: Function): this;
6412     off(event: 'close', listener: Function): this;
6413     once(event: 'close', listener: Function): this;
6414     addListener(event: 'close', listener: Function): this;
6415     removeListener(event: 'close', listener: Function): this;
6416     /**
6417      * Emitted when a MessagePortMain object receives a message.
6418      */
6419     on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6420     off(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6421     once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6422     addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6423     removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6424     /**
6425      * Disconnects the port, so it is no longer active.
6426      */
6427     close(): void;
6428     /**
6429      * Sends a message from the port, and optionally, transfers ownership of objects to
6430      * other browsing contexts.
6431      */
6432     postMessage(message: any, transfer?: MessagePortMain[]): void;
6433     /**
6434      * Starts the sending of messages queued on the port. Messages will be queued until
6435      * this method is called.
6436      */
6437     start(): void;
6438   }
6439
6440   interface MimeTypedBuffer {
6441
6442     // Docs: https://electronjs.org/docs/api/structures/mime-typed-buffer
6443
6444     /**
6445      * Charset of the buffer.
6446      */
6447     charset?: string;
6448     /**
6449      * The actual Buffer content.
6450      */
6451     data: Buffer;
6452     /**
6453      * MIME type of the buffer.
6454      */
6455     mimeType?: string;
6456   }
6457
6458   interface MouseInputEvent extends InputEvent {
6459
6460     // Docs: https://electronjs.org/docs/api/structures/mouse-input-event
6461
6462     /**
6463      * The button pressed, can be `left`, `middle`, `right`.
6464      */
6465     button?: ('left' | 'middle' | 'right');
6466     clickCount?: number;
6467     globalX?: number;
6468     globalY?: number;
6469     movementX?: number;
6470     movementY?: number;
6471     /**
6472      * The type of the event, can be `mouseDown`, `mouseUp`, `mouseEnter`,
6473      * `mouseLeave`, `contextMenu`, `mouseWheel` or `mouseMove`.
6474      */
6475     type: ('mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove');
6476     x: number;
6477     y: number;
6478   }
6479
6480   interface MouseWheelInputEvent extends MouseInputEvent {
6481
6482     // Docs: https://electronjs.org/docs/api/structures/mouse-wheel-input-event
6483
6484     accelerationRatioX?: number;
6485     accelerationRatioY?: number;
6486     canScroll?: boolean;
6487     deltaX?: number;
6488     deltaY?: number;
6489     hasPreciseScrollingDeltas?: boolean;
6490     /**
6491      * The type of the event, can be `mouseWheel`.
6492      */
6493     type: ('mouseWheel');
6494     wheelTicksX?: number;
6495     wheelTicksY?: number;
6496   }
6497
6498   class NativeImage {
6499
6500     // Docs: https://electronjs.org/docs/api/native-image
6501
6502     /**
6503      * Creates an empty `NativeImage` instance.
6504      */
6505     static createEmpty(): NativeImage;
6506     /**
6507      * Creates a new `NativeImage` instance from `buffer` that contains the raw bitmap
6508      * pixel data returned by `toBitmap()`. The specific format is platform-dependent.
6509      */
6510     static createFromBitmap(buffer: Buffer, options: CreateFromBitmapOptions): NativeImage;
6511     /**
6512      * Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or
6513      * JPEG first.
6514      */
6515     static createFromBuffer(buffer: Buffer, options?: CreateFromBufferOptions): NativeImage;
6516     /**
6517      * Creates a new `NativeImage` instance from `dataURL`.
6518      */
6519     static createFromDataURL(dataURL: string): NativeImage;
6520     /**
6521      * Creates a new `NativeImage` instance from the NSImage that maps to the given
6522      * image name. See `System Icons` for a list of possible values.
6523      *
6524      * The `hslShift` is applied to the image with the following rules:
6525      *
6526      * * `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0
6527      * and 360 on the hue color wheel (red).
6528      * * `hsl_shift[1]` (saturation): A saturation shift for the image, with the
6529      * following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully
6530      * saturate the image.
6531      * * `hsl_shift[2]` (lightness): A lightness shift for the image, with the
6532      * following key values: 0 = remove all lightness (make all pixels black). 0.5 =
6533      * leave unchanged. 1 = full lightness (make all pixels white).
6534      *
6535      * This means that `[-1, 0, 1]` will make the image completely white and `[-1, 1,
6536      * 0]` will make the image completely black.
6537      *
6538      * In some cases, the `NSImageName` doesn't match its string representation; one
6539      * example of this is `NSFolderImageName`, whose string representation would
6540      * actually be `NSFolder`. Therefore, you'll need to determine the correct string
6541      * representation for your image before passing it in. This can be done with the
6542      * following:
6543      *
6544      * `echo -e '#import <Cocoa/Cocoa.h>\nint main() { NSLog(@"%@", SYSTEM_IMAGE_NAME);
6545      * }' | clang -otest -x objective-c -framework Cocoa - && ./test`
6546      *
6547      * where `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.
6548      *
6549      * @platform darwin
6550      */
6551     static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
6552     /**
6553      * Creates a new `NativeImage` instance from a file located at `path`. This method
6554      * returns an empty image if the `path` does not exist, cannot be read, or is not a
6555      * valid image.
6556      */
6557     static createFromPath(path: string): NativeImage;
6558     /**
6559      * fulfilled with the file's thumbnail preview image, which is a NativeImage.
6560      *
6561      * Note: The Windows implementation will ignore `size.height` and scale the height
6562      * according to `size.width`.
6563      *
6564      * @platform darwin,win32
6565      */
6566     static createThumbnailFromPath(path: string, size: Size): Promise<Electron.NativeImage>;
6567     /**
6568      * Add an image representation for a specific scale factor. This can be used to
6569      * explicitly add different scale factor representations to an image. This can be
6570      * called on empty images.
6571      */
6572     addRepresentation(options: AddRepresentationOptions): void;
6573     /**
6574      * The cropped image.
6575      */
6576     crop(rect: Rectangle): NativeImage;
6577     /**
6578      * The image's aspect ratio.
6579      *
6580      * If `scaleFactor` is passed, this will return the aspect ratio corresponding to
6581      * the image representation most closely matching the passed value.
6582      */
6583     getAspectRatio(scaleFactor?: number): number;
6584     /**
6585      * A Buffer that contains the image's raw bitmap pixel data.
6586      *
6587      * The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does
6588      * not copy the bitmap data, so you have to use the returned Buffer immediately in
6589      * current event loop tick; otherwise the data might be changed or destroyed.
6590      */
6591     getBitmap(options?: BitmapOptions): Buffer;
6592     /**
6593      * A Buffer that stores C pointer to underlying native handle of the image. On
6594      * macOS, a pointer to `NSImage` instance would be returned.
6595      *
6596      * Notice that the returned pointer is a weak pointer to the underlying native
6597      * image instead of a copy, so you _must_ ensure that the associated `nativeImage`
6598      * instance is kept around.
6599      *
6600      * @platform darwin
6601      */
6602     getNativeHandle(): Buffer;
6603     /**
6604      * An array of all scale factors corresponding to representations for a given
6605      * nativeImage.
6606      */
6607     getScaleFactors(): number[];
6608     /**
6609      * If `scaleFactor` is passed, this will return the size corresponding to the image
6610      * representation most closely matching the passed value.
6611      */
6612     getSize(scaleFactor?: number): Size;
6613     /**
6614      * Whether the image is empty.
6615      */
6616     isEmpty(): boolean;
6617     /**
6618      * Whether the image is a template image.
6619      */
6620     isTemplateImage(): boolean;
6621     /**
6622      * The resized image.
6623      *
6624      * If only the `height` or the `width` are specified then the current aspect ratio
6625      * will be preserved in the resized image.
6626      */
6627     resize(options: ResizeOptions): NativeImage;
6628     /**
6629      * Marks the image as a template image.
6630      */
6631     setTemplateImage(option: boolean): void;
6632     /**
6633      * A Buffer that contains a copy of the image's raw bitmap pixel data.
6634      */
6635     toBitmap(options?: ToBitmapOptions): Buffer;
6636     /**
6637      * The data URL of the image.
6638      */
6639     toDataURL(options?: ToDataURLOptions): string;
6640     /**
6641      * A Buffer that contains the image's `JPEG` encoded data.
6642      */
6643     toJPEG(quality: number): Buffer;
6644     /**
6645      * A Buffer that contains the image's `PNG` encoded data.
6646      */
6647     toPNG(options?: ToPNGOptions): Buffer;
6648     /**
6649      * A `boolean` property that determines whether the image is considered a template
6650      * image.
6651      *
6652      * Please note that this property only has an effect on macOS.
6653      *
6654      * @platform darwin
6655      */
6656     isMacTemplateImage: boolean;
6657   }
6658
6659   interface NativeTheme extends NodeJS.EventEmitter {
6660
6661     // Docs: https://electronjs.org/docs/api/native-theme
6662
6663     /**
6664      * Emitted when something in the underlying NativeTheme has changed. This normally
6665      * means that either the value of `shouldUseDarkColors`,
6666      * `shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed. You
6667      * will have to check them to determine which one has changed.
6668      */
6669     on(event: 'updated', listener: Function): this;
6670     off(event: 'updated', listener: Function): this;
6671     once(event: 'updated', listener: Function): this;
6672     addListener(event: 'updated', listener: Function): this;
6673     removeListener(event: 'updated', listener: Function): this;
6674     /**
6675      * A `boolean` indicating whether Chromium is in forced colors mode, controlled by
6676      * system accessibility settings. Currently, Windows high contrast is the only
6677      * system setting that triggers forced colors mode.
6678      *
6679      * @platform win32
6680      */
6681     readonly inForcedColorsMode: boolean;
6682     /**
6683      * A `boolean` for if the OS / Chromium currently has a dark mode enabled or is
6684      * being instructed to show a dark-style UI.  If you want to modify this value you
6685      * should use `themeSource` below.
6686      *
6687      */
6688     readonly shouldUseDarkColors: boolean;
6689     /**
6690      * A `boolean` for if the OS / Chromium currently has high-contrast mode enabled or
6691      * is being instructed to show a high-contrast UI.
6692      *
6693      * @platform darwin,win32
6694      */
6695     readonly shouldUseHighContrastColors: boolean;
6696     /**
6697      * A `boolean` for if the OS / Chromium currently has an inverted color scheme or
6698      * is being instructed to use an inverted color scheme.
6699      *
6700      * @platform darwin,win32
6701      */
6702     readonly shouldUseInvertedColorScheme: boolean;
6703     /**
6704      * A `string` property that can be `system`, `light` or `dark`.  It is used to
6705      * override and supersede the value that Chromium has chosen to use internally.
6706      *
6707      * Setting this property to `system` will remove the override and everything will
6708      * be reset to the OS default.  By default `themeSource` is `system`.
6709      *
6710      * Settings this property to `dark` will have the following effects:
6711      *
6712      * * `nativeTheme.shouldUseDarkColors` will be `true` when accessed
6713      * * Any UI Electron renders on Linux and Windows including context menus,
6714      * devtools, etc. will use the dark UI.
6715      * * Any UI the OS renders on macOS including menus, window frames, etc. will use
6716      * the dark UI.
6717      * * The `prefers-color-scheme` CSS query will match `dark` mode.
6718      * * The `updated` event will be emitted
6719      *
6720      * Settings this property to `light` will have the following effects:
6721      *
6722      * * `nativeTheme.shouldUseDarkColors` will be `false` when accessed
6723      * * Any UI Electron renders on Linux and Windows including context menus,
6724      * devtools, etc. will use the light UI.
6725      * * Any UI the OS renders on macOS including menus, window frames, etc. will use
6726      * the light UI.
6727      * * The `prefers-color-scheme` CSS query will match `light` mode.
6728      * * The `updated` event will be emitted
6729      *
6730      * The usage of this property should align with a classic "dark mode" state machine
6731      * in your application where the user has three options.
6732      *
6733      * * `Follow OS` --> `themeSource = 'system'`
6734      * * `Dark Mode` --> `themeSource = 'dark'`
6735      * * `Light Mode` --> `themeSource = 'light'`
6736      *
6737      * Your application should then always use `shouldUseDarkColors` to determine what
6738      * CSS to apply.
6739      */
6740     themeSource: ('system' | 'light' | 'dark');
6741   }
6742
6743   interface Net {
6744
6745     // Docs: https://electronjs.org/docs/api/net
6746
6747     /**
6748      * see Response.
6749      *
6750      * Sends a request, similarly to how `fetch()` works in the renderer, using
6751      * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
6752      * HTTP stack.
6753      *
6754      * Example:
6755      *
6756      * This method will issue requests from the default session. To send a `fetch`
6757      * request from another session, use ses.fetch().
6758      *
6759      * See the MDN documentation for `fetch()` for more details.
6760      *
6761      * Limitations:
6762      *
6763      * * `net.fetch()` does not support the `data:` or `blob:` schemes.
6764      * * The value of the `integrity` option is ignored.
6765      * * The `.type` and `.url` values of the returned `Response` object are incorrect.
6766      *
6767      * By default, requests made with `net.fetch` can be made to custom protocols as
6768      * well as `file:`, and will trigger webRequest handlers if present. When the
6769      * non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
6770      * protocol handlers will not be called for this request. This allows forwarding an
6771      * intercepted request to the built-in handler. webRequest handlers will still be
6772      * triggered when bypassing custom protocols.
6773      */
6774     fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
6775     /**
6776      * Whether there is currently internet connection.
6777      *
6778      * A return value of `false` is a pretty strong indicator that the user won't be
6779      * able to connect to remote sites. However, a return value of `true` is
6780      * inconclusive; even if some link is up, it is uncertain whether a particular
6781      * connection attempt to a particular remote site will be successful.
6782      */
6783     isOnline(): boolean;
6784     /**
6785      * Creates a `ClientRequest` instance using the provided `options` which are
6786      * directly forwarded to the `ClientRequest` constructor. The `net.request` method
6787      * would be used to issue both secure and insecure HTTP requests according to the
6788      * specified protocol scheme in the `options` object.
6789      */
6790     request(options: (ClientRequestConstructorOptions) | (string)): ClientRequest;
6791     /**
6792      * Resolves with the resolved IP addresses for the `host`.
6793      *
6794      * This method will resolve hosts from the default session. To resolve a host from
6795      * another session, use ses.resolveHost().
6796      */
6797     resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
6798     /**
6799      * A `boolean` property. Whether there is currently internet connection.
6800      *
6801      * A return value of `false` is a pretty strong indicator that the user won't be
6802      * able to connect to remote sites. However, a return value of `true` is
6803      * inconclusive; even if some link is up, it is uncertain whether a particular
6804      * connection attempt to a particular remote site will be successful.
6805      *
6806      */
6807     readonly online: boolean;
6808   }
6809
6810   interface NetLog {
6811
6812     // Docs: https://electronjs.org/docs/api/net-log
6813
6814     /**
6815      * resolves when the net log has begun recording.
6816      *
6817      * Starts recording network events to `path`.
6818      */
6819     startLogging(path: string, options?: StartLoggingOptions): Promise<void>;
6820     /**
6821      * resolves when the net log has been flushed to disk.
6822      *
6823      * Stops recording network events. If not called, net logging will automatically
6824      * end when app quits.
6825      */
6826     stopLogging(): Promise<void>;
6827     /**
6828      * A `boolean` property that indicates whether network logs are currently being
6829      * recorded.
6830      *
6831      */
6832     readonly currentlyLogging: boolean;
6833   }
6834
6835   class Notification extends NodeEventEmitter {
6836
6837     // Docs: https://electronjs.org/docs/api/notification
6838
6839     /**
6840      * @platform darwin
6841      */
6842     on(event: 'action', listener: (event: Event,
6843                                    /**
6844                                     * The index of the action that was activated.
6845                                     */
6846                                    index: number) => void): this;
6847     off(event: 'action', listener: (event: Event,
6848                                    /**
6849                                     * The index of the action that was activated.
6850                                     */
6851                                    index: number) => void): this;
6852     once(event: 'action', listener: (event: Event,
6853                                    /**
6854                                     * The index of the action that was activated.
6855                                     */
6856                                    index: number) => void): this;
6857     addListener(event: 'action', listener: (event: Event,
6858                                    /**
6859                                     * The index of the action that was activated.
6860                                     */
6861                                    index: number) => void): this;
6862     removeListener(event: 'action', listener: (event: Event,
6863                                    /**
6864                                     * The index of the action that was activated.
6865                                     */
6866                                    index: number) => void): this;
6867     /**
6868      * Emitted when the notification is clicked by the user.
6869      */
6870     on(event: 'click', listener: (event: Event) => void): this;
6871     off(event: 'click', listener: (event: Event) => void): this;
6872     once(event: 'click', listener: (event: Event) => void): this;
6873     addListener(event: 'click', listener: (event: Event) => void): this;
6874     removeListener(event: 'click', listener: (event: Event) => void): this;
6875     /**
6876      * Emitted when the notification is closed by manual intervention from the user.
6877      *
6878      * This event is not guaranteed to be emitted in all cases where the notification
6879      * is closed.
6880      *
6881      * On Windows, the `close` event can be emitted in one of three ways: programmatic
6882      * dismissal with `notification.close()`, by the user closing the notification, or
6883      * via system timeout. If a notification is in the Action Center after the initial
6884      * `close` event is emitted, a call to `notification.close()` will remove the
6885      * notification from the action center but the `close` event will not be emitted
6886      * again.
6887      */
6888     on(event: 'close', listener: (event: Event) => void): this;
6889     off(event: 'close', listener: (event: Event) => void): this;
6890     once(event: 'close', listener: (event: Event) => void): this;
6891     addListener(event: 'close', listener: (event: Event) => void): this;
6892     removeListener(event: 'close', listener: (event: Event) => void): this;
6893     /**
6894      * Emitted when an error is encountered while creating and showing the native
6895      * notification.
6896      *
6897      * @platform win32
6898      */
6899     on(event: 'failed', listener: (event: Event,
6900                                    /**
6901                                     * The error encountered during execution of the `show()` method.
6902                                     */
6903                                    error: string) => void): this;
6904     off(event: 'failed', listener: (event: Event,
6905                                    /**
6906                                     * The error encountered during execution of the `show()` method.
6907                                     */
6908                                    error: string) => void): this;
6909     once(event: 'failed', listener: (event: Event,
6910                                    /**
6911                                     * The error encountered during execution of the `show()` method.
6912                                     */
6913                                    error: string) => void): this;
6914     addListener(event: 'failed', listener: (event: Event,
6915                                    /**
6916                                     * The error encountered during execution of the `show()` method.
6917                                     */
6918                                    error: string) => void): this;
6919     removeListener(event: 'failed', listener: (event: Event,
6920                                    /**
6921                                     * The error encountered during execution of the `show()` method.
6922                                     */
6923                                    error: string) => void): this;
6924     /**
6925      * Emitted when the user clicks the "Reply" button on a notification with
6926      * `hasReply: true`.
6927      *
6928      * @platform darwin
6929      */
6930     on(event: 'reply', listener: (event: Event,
6931                                   /**
6932                                    * The string the user entered into the inline reply field.
6933                                    */
6934                                   reply: string) => void): this;
6935     off(event: 'reply', listener: (event: Event,
6936                                   /**
6937                                    * The string the user entered into the inline reply field.
6938                                    */
6939                                   reply: string) => void): this;
6940     once(event: 'reply', listener: (event: Event,
6941                                   /**
6942                                    * The string the user entered into the inline reply field.
6943                                    */
6944                                   reply: string) => void): this;
6945     addListener(event: 'reply', listener: (event: Event,
6946                                   /**
6947                                    * The string the user entered into the inline reply field.
6948                                    */
6949                                   reply: string) => void): this;
6950     removeListener(event: 'reply', listener: (event: Event,
6951                                   /**
6952                                    * The string the user entered into the inline reply field.
6953                                    */
6954                                   reply: string) => void): this;
6955     /**
6956      * Emitted when the notification is shown to the user. Note that this event can be
6957      * fired multiple times as a notification can be shown multiple times through the
6958      * `show()` method.
6959      */
6960     on(event: 'show', listener: (event: Event) => void): this;
6961     off(event: 'show', listener: (event: Event) => void): this;
6962     once(event: 'show', listener: (event: Event) => void): this;
6963     addListener(event: 'show', listener: (event: Event) => void): this;
6964     removeListener(event: 'show', listener: (event: Event) => void): this;
6965     /**
6966      * Notification
6967      */
6968     constructor(options?: NotificationConstructorOptions);
6969     /**
6970      * Whether or not desktop notifications are supported on the current system
6971      */
6972     static isSupported(): boolean;
6973     /**
6974      * Dismisses the notification.
6975      *
6976      * On Windows, calling `notification.close()` while the notification is visible on
6977      * screen will dismiss the notification and remove it from the Action Center. If
6978      * `notification.close()` is called after the notification is no longer visible on
6979      * screen, calling `notification.close()` will try remove it from the Action
6980      * Center.
6981      */
6982     close(): void;
6983     /**
6984      * Immediately shows the notification to the user. Unlike the web notification API,
6985      * instantiating a `new Notification()` does not immediately show it to the user.
6986      * Instead, you need to call this method before the OS will display it.
6987      *
6988      * If the notification has been shown before, this method will dismiss the
6989      * previously shown notification and create a new one with identical properties.
6990      */
6991     show(): void;
6992     /**
6993      * A `NotificationAction[]` property representing the actions of the notification.
6994      */
6995     actions: NotificationAction[];
6996     /**
6997      * A `string` property representing the body of the notification.
6998      */
6999     body: string;
7000     /**
7001      * A `string` property representing the close button text of the notification.
7002      */
7003     closeButtonText: string;
7004     /**
7005      * A `boolean` property representing whether the notification has a reply action.
7006      */
7007     hasReply: boolean;
7008     /**
7009      * A `string` property representing the reply placeholder of the notification.
7010      */
7011     replyPlaceholder: string;
7012     /**
7013      * A `boolean` property representing whether the notification is silent.
7014      */
7015     silent: boolean;
7016     /**
7017      * A `string` property representing the sound of the notification.
7018      */
7019     sound: string;
7020     /**
7021      * A `string` property representing the subtitle of the notification.
7022      */
7023     subtitle: string;
7024     /**
7025      * A `string` property representing the type of timeout duration for the
7026      * notification. Can be 'default' or 'never'.
7027      *
7028      * If `timeoutType` is set to 'never', the notification never expires. It stays
7029      * open until closed by the calling API or the user.
7030      *
7031      * @platform linux,win32
7032      */
7033     timeoutType: ('default' | 'never');
7034     /**
7035      * A `string` property representing the title of the notification.
7036      */
7037     title: string;
7038     /**
7039      * A `string` property representing the custom Toast XML of the notification.
7040      *
7041      * @platform win32
7042      */
7043     toastXml: string;
7044     /**
7045      * A `string` property representing the urgency level of the notification. Can be
7046      * 'normal', 'critical', or 'low'.
7047      *
7048      * Default is 'low' - see NotifyUrgency for more information.
7049      *
7050      * @platform linux
7051      */
7052     urgency: ('normal' | 'critical' | 'low');
7053   }
7054
7055   interface NotificationAction {
7056
7057     // Docs: https://electronjs.org/docs/api/structures/notification-action
7058
7059     /**
7060      * The label for the given action.
7061      */
7062     text?: string;
7063     /**
7064      * The type of action, can be `button`.
7065      */
7066     type: ('button');
7067   }
7068
7069   interface NotificationResponse {
7070
7071     // Docs: https://electronjs.org/docs/api/structures/notification-response
7072
7073     /**
7074      * The identifier string of the action that the user selected.
7075      */
7076     actionIdentifier: string;
7077     /**
7078      * The delivery date of the notification.
7079      */
7080     date: number;
7081     /**
7082      * The unique identifier for this notification request.
7083      */
7084     identifier: string;
7085     /**
7086      * A dictionary of custom information associated with the notification.
7087      */
7088     userInfo: Record<string, any>;
7089     /**
7090      * The text entered or chosen by the user.
7091      */
7092     userText?: string;
7093   }
7094
7095   interface ParentPort extends NodeJS.EventEmitter {
7096
7097     // Docs: https://electronjs.org/docs/api/parent-port
7098
7099     /**
7100      * Emitted when the process receives a message. Messages received on this port will
7101      * be queued up until a handler is registered for this event.
7102      */
7103     on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
7104     off(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
7105     once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
7106     addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
7107     removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
7108     /**
7109      * Sends a message from the process to its parent.
7110      */
7111     postMessage(message: any): void;
7112   }
7113
7114   interface PaymentDiscount {
7115
7116     // Docs: https://electronjs.org/docs/api/structures/payment-discount
7117
7118     /**
7119      * A string used to uniquely identify a discount offer for a product.
7120      */
7121     identifier: string;
7122     /**
7123      * A string that identifies the key used to generate the signature.
7124      */
7125     keyIdentifier: string;
7126     /**
7127      * A universally unique ID (UUID) value that you define.
7128      */
7129     nonce: string;
7130     /**
7131      * A UTF-8 string representing the properties of a specific discount offer,
7132      * cryptographically signed.
7133      */
7134     signature: string;
7135     /**
7136      * The date and time of the signature's creation in milliseconds, formatted in Unix
7137      * epoch time.
7138      */
7139     timestamp: number;
7140   }
7141
7142   interface Point {
7143
7144     // Docs: https://electronjs.org/docs/api/structures/point
7145
7146     x: number;
7147     y: number;
7148   }
7149
7150   interface PostBody {
7151
7152     // Docs: https://electronjs.org/docs/api/structures/post-body
7153
7154     /**
7155      * The boundary used to separate multiple parts of the message. Only valid when
7156      * `contentType` is `multipart/form-data`.
7157      */
7158     boundary?: string;
7159     /**
7160      * The `content-type` header used for the data. One of
7161      * `application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to the
7162      * `enctype` attribute of the submitted HTML form.
7163      */
7164     contentType: string;
7165     /**
7166      * The post data to be sent to the new window.
7167      */
7168     data: Array<(UploadRawData) | (UploadFile)>;
7169   }
7170
7171   interface PowerMonitor extends NodeJS.EventEmitter {
7172
7173     // Docs: https://electronjs.org/docs/api/power-monitor
7174
7175     /**
7176      * Emitted when the system is about to lock the screen.
7177      *
7178      * @platform darwin,win32
7179      */
7180     on(event: 'lock-screen', listener: Function): this;
7181     off(event: 'lock-screen', listener: Function): this;
7182     once(event: 'lock-screen', listener: Function): this;
7183     addListener(event: 'lock-screen', listener: Function): this;
7184     removeListener(event: 'lock-screen', listener: Function): this;
7185     /**
7186      * Emitted when the system changes to AC power.
7187      *
7188      * @platform darwin,win32
7189      */
7190     on(event: 'on-ac', listener: Function): this;
7191     off(event: 'on-ac', listener: Function): this;
7192     once(event: 'on-ac', listener: Function): this;
7193     addListener(event: 'on-ac', listener: Function): this;
7194     removeListener(event: 'on-ac', listener: Function): this;
7195     /**
7196      * Emitted when system changes to battery power.
7197      *
7198      * @platform darwin
7199      */
7200     on(event: 'on-battery', listener: Function): this;
7201     off(event: 'on-battery', listener: Function): this;
7202     once(event: 'on-battery', listener: Function): this;
7203     addListener(event: 'on-battery', listener: Function): this;
7204     removeListener(event: 'on-battery', listener: Function): this;
7205     /**
7206      * Emitted when system is resuming.
7207      */
7208     on(event: 'resume', listener: Function): this;
7209     off(event: 'resume', listener: Function): this;
7210     once(event: 'resume', listener: Function): this;
7211     addListener(event: 'resume', listener: Function): this;
7212     removeListener(event: 'resume', listener: Function): this;
7213     /**
7214      * Emitted when the system is about to reboot or shut down. If the event handler
7215      * invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in
7216      * order for the app to exit cleanly. If `e.preventDefault()` is called, the app
7217      * should exit as soon as possible by calling something like `app.quit()`.
7218      *
7219      * @platform linux,darwin
7220      */
7221     on(event: 'shutdown', listener: Function): this;
7222     off(event: 'shutdown', listener: Function): this;
7223     once(event: 'shutdown', listener: Function): this;
7224     addListener(event: 'shutdown', listener: Function): this;
7225     removeListener(event: 'shutdown', listener: Function): this;
7226     /**
7227      * Notification of a change in the operating system's advertised speed limit for
7228      * CPUs, in percent. Values below 100 indicate that the system is impairing
7229      * processing power due to thermal management.
7230      *
7231      * @platform darwin,win32
7232      */
7233     on(event: 'speed-limit-change', listener: Function): this;
7234     off(event: 'speed-limit-change', listener: Function): this;
7235     once(event: 'speed-limit-change', listener: Function): this;
7236     addListener(event: 'speed-limit-change', listener: Function): this;
7237     removeListener(event: 'speed-limit-change', listener: Function): this;
7238     /**
7239      * Emitted when the system is suspending.
7240      */
7241     on(event: 'suspend', listener: Function): this;
7242     off(event: 'suspend', listener: Function): this;
7243     once(event: 'suspend', listener: Function): this;
7244     addListener(event: 'suspend', listener: Function): this;
7245     removeListener(event: 'suspend', listener: Function): this;
7246     /**
7247      * Emitted when the thermal state of the system changes. Notification of a change
7248      * in the thermal status of the system, such as entering a critical temperature
7249      * range. Depending on the severity, the system might take steps to reduce said
7250      * temperature, for example, throttling the CPU or switching on the fans if
7251      * available.
7252      *
7253      * Apps may react to the new state by reducing expensive computing tasks (e.g.
7254      * video encoding), or notifying the user. The same state might be received
7255      * repeatedly.
7256      *
7257      * See
7258      * https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html
7259      *
7260      * @platform darwin
7261      */
7262     on(event: 'thermal-state-change', listener: Function): this;
7263     off(event: 'thermal-state-change', listener: Function): this;
7264     once(event: 'thermal-state-change', listener: Function): this;
7265     addListener(event: 'thermal-state-change', listener: Function): this;
7266     removeListener(event: 'thermal-state-change', listener: Function): this;
7267     /**
7268      * Emitted as soon as the systems screen is unlocked.
7269      *
7270      * @platform darwin,win32
7271      */
7272     on(event: 'unlock-screen', listener: Function): this;
7273     off(event: 'unlock-screen', listener: Function): this;
7274     once(event: 'unlock-screen', listener: Function): this;
7275     addListener(event: 'unlock-screen', listener: Function): this;
7276     removeListener(event: 'unlock-screen', listener: Function): this;
7277     /**
7278      * Emitted when a login session is activated. See documentation for more
7279      * information.
7280      *
7281      * @platform darwin
7282      */
7283     on(event: 'user-did-become-active', listener: Function): this;
7284     off(event: 'user-did-become-active', listener: Function): this;
7285     once(event: 'user-did-become-active', listener: Function): this;
7286     addListener(event: 'user-did-become-active', listener: Function): this;
7287     removeListener(event: 'user-did-become-active', listener: Function): this;
7288     /**
7289      * Emitted when a login session is deactivated. See documentation for more
7290      * information.
7291      *
7292      * @platform darwin
7293      */
7294     on(event: 'user-did-resign-active', listener: Function): this;
7295     off(event: 'user-did-resign-active', listener: Function): this;
7296     once(event: 'user-did-resign-active', listener: Function): this;
7297     addListener(event: 'user-did-resign-active', listener: Function): this;
7298     removeListener(event: 'user-did-resign-active', listener: Function): this;
7299     /**
7300      * The system's current thermal state. Can be `unknown`, `nominal`, `fair`,
7301      * `serious`, or `critical`.
7302      *
7303      * @platform darwin
7304      */
7305     getCurrentThermalState(): ('unknown' | 'nominal' | 'fair' | 'serious' | 'critical');
7306     /**
7307      * The system's current idle state. Can be `active`, `idle`, `locked` or `unknown`.
7308      *
7309      * Calculate the system idle state. `idleThreshold` is the amount of time (in
7310      * seconds) before considered idle.  `locked` is available on supported systems
7311      * only.
7312      */
7313     getSystemIdleState(idleThreshold: number): ('active' | 'idle' | 'locked' | 'unknown');
7314     /**
7315      * Idle time in seconds
7316      *
7317      * Calculate system idle time in seconds.
7318      */
7319     getSystemIdleTime(): number;
7320     /**
7321      * Whether the system is on battery power.
7322      *
7323      * To monitor for changes in this property, use the `on-battery` and `on-ac`
7324      * events.
7325      */
7326     isOnBatteryPower(): boolean;
7327     /**
7328      * A `boolean` property. True if the system is on battery power.
7329      *
7330      * See `powerMonitor.isOnBatteryPower()`.
7331      */
7332     onBatteryPower: boolean;
7333   }
7334
7335   interface PowerSaveBlocker {
7336
7337     // Docs: https://electronjs.org/docs/api/power-save-blocker
7338
7339     /**
7340      * Whether the corresponding `powerSaveBlocker` has started.
7341      */
7342     isStarted(id: number): boolean;
7343     /**
7344      * The blocker ID that is assigned to this power blocker.
7345      *
7346      * Starts preventing the system from entering lower-power mode. Returns an integer
7347      * identifying the power save blocker.
7348      *
7349      * **Note:** `prevent-display-sleep` has higher precedence over
7350      * `prevent-app-suspension`. Only the highest precedence type takes effect. In
7351      * other words, `prevent-display-sleep` always takes precedence over
7352      * `prevent-app-suspension`.
7353      *
7354      * For example, an API calling A requests for `prevent-app-suspension`, and another
7355      * calling B requests for `prevent-display-sleep`. `prevent-display-sleep` will be
7356      * used until B stops its request. After that, `prevent-app-suspension` is used.
7357      */
7358     start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number;
7359     /**
7360      * Stops the specified power save blocker.
7361      *
7362      * Whether the specified `powerSaveBlocker` has been stopped.
7363      */
7364     stop(id: number): boolean;
7365   }
7366
7367   interface PrinterInfo {
7368
7369     // Docs: https://electronjs.org/docs/api/structures/printer-info
7370
7371     /**
7372      * a longer description of the printer's type.
7373      */
7374     description: string;
7375     /**
7376      * the name of the printer as shown in Print Preview.
7377      */
7378     displayName: string;
7379     /**
7380      * whether or not a given printer is set as the default printer on the OS.
7381      */
7382     isDefault: boolean;
7383     /**
7384      * the name of the printer as understood by the OS.
7385      */
7386     name: string;
7387     /**
7388      * an object containing a variable number of platform-specific printer information.
7389      */
7390     options: Options;
7391     /**
7392      * the current status of the printer.
7393      */
7394     status: number;
7395   }
7396
7397   interface ProcessMemoryInfo {
7398
7399     // Docs: https://electronjs.org/docs/api/structures/process-memory-info
7400
7401     /**
7402      * The amount of memory not shared by other processes, such as JS heap or HTML
7403      * content in Kilobytes.
7404      */
7405     private: number;
7406     /**
7407      * The amount of memory currently pinned to actual physical RAM in Kilobytes.
7408      *
7409      * @platform linux,win32
7410      */
7411     residentSet: number;
7412     /**
7413      * The amount of memory shared between processes, typically memory consumed by the
7414      * Electron code itself in Kilobytes.
7415      */
7416     shared: number;
7417   }
7418
7419   interface ProcessMetric {
7420
7421     // Docs: https://electronjs.org/docs/api/structures/process-metric
7422
7423     /**
7424      * CPU usage of the process.
7425      */
7426     cpu: CPUUsage;
7427     /**
7428      * Creation time for this process. The time is represented as number of
7429      * milliseconds since epoch. Since the `pid` can be reused after a process dies, it
7430      * is useful to use both the `pid` and the `creationTime` to uniquely identify a
7431      * process.
7432      */
7433     creationTime: number;
7434     /**
7435      * One of the following values:
7436      *
7437      * @platform win32
7438      */
7439     integrityLevel?: ('untrusted' | 'low' | 'medium' | 'high' | 'unknown');
7440     /**
7441      * Memory information for the process.
7442      */
7443     memory: MemoryInfo;
7444     /**
7445      * The name of the process. Examples for utility: `Audio Service`, `Content
7446      * Decryption Module Service`, `Network Service`, `Video Capture`, etc.
7447      */
7448     name?: string;
7449     /**
7450      * Process id of the process.
7451      */
7452     pid: number;
7453     /**
7454      * Whether the process is sandboxed on OS level.
7455      *
7456      * @platform darwin,win32
7457      */
7458     sandboxed?: boolean;
7459     /**
7460      * The non-localized name of the process.
7461      */
7462     serviceName?: string;
7463     /**
7464      * Process type. One of the following values:
7465      */
7466     type: ('Browser' | 'Tab' | 'Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
7467   }
7468
7469   interface Product {
7470
7471     // Docs: https://electronjs.org/docs/api/structures/product
7472
7473     /**
7474      * 3 character code presenting a product's currency based on the ISO 4217 standard.
7475      */
7476     currencyCode: string;
7477     /**
7478      * An array of discount offers
7479      */
7480     discounts: ProductDiscount[];
7481     /**
7482      * The total size of the content, in bytes.
7483      */
7484     downloadContentLengths: number[];
7485     /**
7486      * A string that identifies the version of the content.
7487      */
7488     downloadContentVersion: string;
7489     /**
7490      * The locale formatted price of the product.
7491      */
7492     formattedPrice: string;
7493     /**
7494      * The object containing introductory price information for the product. available
7495      * for the product.
7496      */
7497     introductoryPrice?: ProductDiscount;
7498     /**
7499      * A boolean value that indicates whether the App Store has downloadable content
7500      * for this product. `true` if at least one file has been associated with the
7501      * product.
7502      */
7503     isDownloadable: boolean;
7504     /**
7505      * A description of the product.
7506      */
7507     localizedDescription: string;
7508     /**
7509      * The name of the product.
7510      */
7511     localizedTitle: string;
7512     /**
7513      * The cost of the product in the local currency.
7514      */
7515     price: number;
7516     /**
7517      * The string that identifies the product to the Apple App Store.
7518      */
7519     productIdentifier: string;
7520     /**
7521      * The identifier of the subscription group to which the subscription belongs.
7522      */
7523     subscriptionGroupIdentifier: string;
7524     /**
7525      * The period details for products that are subscriptions.
7526      */
7527     subscriptionPeriod?: ProductSubscriptionPeriod;
7528   }
7529
7530   interface ProductDiscount {
7531
7532     // Docs: https://electronjs.org/docs/api/structures/product-discount
7533
7534     /**
7535      * A string used to uniquely identify a discount offer for a product.
7536      */
7537     identifier: string;
7538     /**
7539      * An integer that indicates the number of periods the product discount is
7540      * available.
7541      */
7542     numberOfPeriods: number;
7543     /**
7544      * The payment mode for this product discount. Can be `payAsYouGo`, `payUpFront`,
7545      * or `freeTrial`.
7546      */
7547     paymentMode: ('payAsYouGo' | 'payUpFront' | 'freeTrial');
7548     /**
7549      * The discount price of the product in the local currency.
7550      */
7551     price: number;
7552     /**
7553      * The locale used to format the discount price of the product.
7554      */
7555     priceLocale: string;
7556     /**
7557      * An object that defines the period for the product discount.
7558      */
7559     subscriptionPeriod?: ProductSubscriptionPeriod;
7560     /**
7561      * The type of discount offer.
7562      */
7563     type: number;
7564   }
7565
7566   interface ProductSubscriptionPeriod {
7567
7568     // Docs: https://electronjs.org/docs/api/structures/product-subscription-period
7569
7570     /**
7571      * The number of units per subscription period.
7572      */
7573     numberOfUnits: number;
7574     /**
7575      * The increment of time that a subscription period is specified in. Can be `day`,
7576      * `week`, `month`, `year`.
7577      */
7578     unit: ('day' | 'week' | 'month' | 'year');
7579   }
7580
7581   interface Protocol {
7582
7583     // Docs: https://electronjs.org/docs/api/protocol
7584
7585     /**
7586      * Register a protocol handler for `scheme`. Requests made to URLs with this scheme
7587      * will delegate to this handler to determine what response should be sent.
7588      *
7589      * Either a `Response` or a `Promise<Response>` can be returned.
7590      *
7591      * Example:
7592      *
7593      * See the MDN docs for `Request` and `Response` for more details.
7594      */
7595     handle(scheme: string, handler: (request: GlobalRequest) => (GlobalResponse) | (Promise<GlobalResponse>)): void;
7596     /**
7597      * Whether the protocol was successfully intercepted
7598      *
7599      * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
7600      * which sends a `Buffer` as a response.
7601      *
7602      * @deprecated
7603      */
7604     interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
7605     /**
7606      * Whether the protocol was successfully intercepted
7607      *
7608      * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
7609      * which sends a file as a response.
7610      *
7611      * @deprecated
7612      */
7613     interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
7614     /**
7615      * Whether the protocol was successfully intercepted
7616      *
7617      * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
7618      * which sends a new HTTP request as a response.
7619      *
7620      * @deprecated
7621      */
7622     interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
7623     /**
7624      * Whether the protocol was successfully intercepted
7625      *
7626      * Same as `protocol.registerStreamProtocol`, except that it replaces an existing
7627      * protocol handler.
7628      *
7629      * @deprecated
7630      */
7631     interceptStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
7632     /**
7633      * Whether the protocol was successfully intercepted
7634      *
7635      * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
7636      * which sends a `string` as a response.
7637      *
7638      * @deprecated
7639      */
7640     interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
7641     /**
7642      * Whether `scheme` is already handled.
7643      */
7644     isProtocolHandled(scheme: string): boolean;
7645     /**
7646      * Whether `scheme` is already intercepted.
7647      *
7648      * @deprecated
7649      */
7650     isProtocolIntercepted(scheme: string): boolean;
7651     /**
7652      * Whether `scheme` is already registered.
7653      *
7654      * @deprecated
7655      */
7656     isProtocolRegistered(scheme: string): boolean;
7657     /**
7658      * Whether the protocol was successfully registered
7659      *
7660      * Registers a protocol of `scheme` that will send a `Buffer` as a response.
7661      *
7662      * The usage is the same with `registerFileProtocol`, except that the `callback`
7663      * should be called with either a `Buffer` object or an object that has the `data`
7664      * property.
7665      *
7666      * Example:
7667      *
7668      * @deprecated
7669      */
7670     registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
7671     /**
7672      * Whether the protocol was successfully registered
7673      *
7674      * Registers a protocol of `scheme` that will send a file as the response. The
7675      * `handler` will be called with `request` and `callback` where `request` is an
7676      * incoming request for the `scheme`.
7677      *
7678      * To handle the `request`, the `callback` should be called with either the file's
7679      * path or an object that has a `path` property, e.g. `callback(filePath)` or
7680      * `callback({ path: filePath })`. The `filePath` must be an absolute path.
7681      *
7682      * By default the `scheme` is treated like `http:`, which is parsed differently
7683      * from protocols that follow the "generic URI syntax" like `file:`.
7684      *
7685      * @deprecated
7686      */
7687     registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
7688     /**
7689      * Whether the protocol was successfully registered
7690      *
7691      * Registers a protocol of `scheme` that will send an HTTP request as a response.
7692      *
7693      * The usage is the same with `registerFileProtocol`, except that the `callback`
7694      * should be called with an object that has the `url` property.
7695      *
7696      * @deprecated
7697      */
7698     registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
7699     /**
7700      * **Note:** This method can only be used before the `ready` event of the `app`
7701      * module gets emitted and can be called only once.
7702      *
7703      * Registers the `scheme` as standard, secure, bypasses content security policy for
7704      * resources, allows registering ServiceWorker, supports fetch API, streaming
7705      * video/audio, and V8 code cache. Specify a privilege with the value of `true` to
7706      * enable the capability.
7707      *
7708      * An example of registering a privileged scheme, that bypasses Content Security
7709      * Policy:
7710      *
7711      * A standard scheme adheres to what RFC 3986 calls generic URI syntax. For example
7712      * `http` and `https` are standard schemes, while `file` is not.
7713      *
7714      * Registering a scheme as standard allows relative and absolute resources to be
7715      * resolved correctly when served. Otherwise the scheme will behave like the `file`
7716      * protocol, but without the ability to resolve relative URLs.
7717      *
7718      * For example when you load following page with custom protocol without
7719      * registering it as standard scheme, the image will not be loaded because
7720      * non-standard schemes can not recognize relative URLs:
7721      *
7722      * Registering a scheme as standard will allow access to files through the
7723      * FileSystem API. Otherwise the renderer will throw a security error for the
7724      * scheme.
7725      *
7726      * By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
7727      * cookies) are disabled for non standard schemes. So in general if you want to
7728      * register a custom protocol to replace the `http` protocol, you have to register
7729      * it as a standard scheme.
7730      *
7731      * Protocols that use streams (http and stream protocols) should set `stream:
7732      * true`. The `<video>` and `<audio>` HTML elements expect protocols to buffer
7733      * their responses by default. The `stream` flag configures those elements to
7734      * correctly expect streaming responses.
7735      */
7736     registerSchemesAsPrivileged(customSchemes: CustomScheme[]): void;
7737     /**
7738      * Whether the protocol was successfully registered
7739      *
7740      * Registers a protocol of `scheme` that will send a stream as a response.
7741      *
7742      * The usage is the same with `registerFileProtocol`, except that the `callback`
7743      * should be called with either a `ReadableStream` object or an object that has the
7744      * `data` property.
7745      *
7746      * Example:
7747      *
7748      * It is possible to pass any object that implements the readable stream API (emits
7749      * `data`/`end`/`error` events). For example, here's how a file could be returned:
7750      *
7751      * @deprecated
7752      */
7753     registerStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
7754     /**
7755      * Whether the protocol was successfully registered
7756      *
7757      * Registers a protocol of `scheme` that will send a `string` as a response.
7758      *
7759      * The usage is the same with `registerFileProtocol`, except that the `callback`
7760      * should be called with either a `string` or an object that has the `data`
7761      * property.
7762      *
7763      * @deprecated
7764      */
7765     registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
7766     /**
7767      * Removes a protocol handler registered with `protocol.handle`.
7768      */
7769     unhandle(scheme: string): void;
7770     /**
7771      * Whether the protocol was successfully unintercepted
7772      *
7773      * Remove the interceptor installed for `scheme` and restore its original handler.
7774      *
7775      * @deprecated
7776      */
7777     uninterceptProtocol(scheme: string): boolean;
7778     /**
7779      * Whether the protocol was successfully unregistered
7780      *
7781      * Unregisters the custom protocol of `scheme`.
7782      *
7783      * @deprecated
7784      */
7785     unregisterProtocol(scheme: string): boolean;
7786   }
7787
7788   interface ProtocolRequest {
7789
7790     // Docs: https://electronjs.org/docs/api/structures/protocol-request
7791
7792     headers: Record<string, string>;
7793     method: string;
7794     referrer: string;
7795     uploadData?: UploadData[];
7796     url: string;
7797   }
7798
7799   interface ProtocolResponse {
7800
7801     // Docs: https://electronjs.org/docs/api/structures/protocol-response
7802
7803     /**
7804      * The charset of response body, default is `"utf-8"`.
7805      */
7806     charset?: string;
7807     /**
7808      * The response body. When returning stream as response, this is a Node.js readable
7809      * stream representing the response body. When returning `Buffer` as response, this
7810      * is a `Buffer`. When returning `string` as response, this is a `string`. This is
7811      * ignored for other types of responses.
7812      */
7813     data?: (Buffer) | (string) | (NodeJS.ReadableStream);
7814     /**
7815      * When assigned, the `request` will fail with the `error` number . For the
7816      * available error numbers you can use, please see the net error list.
7817      */
7818     error?: number;
7819     /**
7820      * An object containing the response headers. The keys must be string, and values
7821      * must be either string or Array of string.
7822      */
7823     headers?: Record<string, (string) | (string[])>;
7824     /**
7825      * The HTTP `method`. This is only used for file and URL responses.
7826      */
7827     method?: string;
7828     /**
7829      * The MIME type of response body, default is `"text/html"`. Setting `mimeType`
7830      * would implicitly set the `content-type` header in response, but if
7831      * `content-type` is already set in `headers`, the `mimeType` would be ignored.
7832      */
7833     mimeType?: string;
7834     /**
7835      * Path to the file which would be sent as response body. This is only used for
7836      * file responses.
7837      */
7838     path?: string;
7839     /**
7840      * The `referrer` URL. This is only used for file and URL responses.
7841      */
7842     referrer?: string;
7843     /**
7844      * The session used for requesting URL, by default the HTTP request will reuse the
7845      * current session. Setting `session` to `null` would use a random independent
7846      * session. This is only used for URL responses.
7847      */
7848     session?: Session;
7849     /**
7850      * The HTTP response code, default is 200.
7851      */
7852     statusCode?: number;
7853     /**
7854      * The data used as upload data. This is only used for URL responses when `method`
7855      * is `"POST"`.
7856      */
7857     uploadData?: ProtocolResponseUploadData;
7858     /**
7859      * Download the `url` and pipe the result as response body. This is only used for
7860      * URL responses.
7861      */
7862     url?: string;
7863   }
7864
7865   interface ProtocolResponseUploadData {
7866
7867     // Docs: https://electronjs.org/docs/api/structures/protocol-response-upload-data
7868
7869     /**
7870      * MIME type of the content.
7871      */
7872     contentType: string;
7873     /**
7874      * Content to be sent.
7875      */
7876     data: (string) | (Buffer);
7877   }
7878
7879   interface PushNotifications extends NodeJS.EventEmitter {
7880
7881     // Docs: https://electronjs.org/docs/api/push-notifications
7882
7883     /**
7884      * Emitted when the app receives a remote notification while running. See:
7885      * https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
7886      *
7887      * @platform darwin
7888      */
7889     on(event: 'received-apns-notification', listener: (event: Event,
7890                                                        userInfo: Record<string, any>) => void): this;
7891     off(event: 'received-apns-notification', listener: (event: Event,
7892                                                        userInfo: Record<string, any>) => void): this;
7893     once(event: 'received-apns-notification', listener: (event: Event,
7894                                                        userInfo: Record<string, any>) => void): this;
7895     addListener(event: 'received-apns-notification', listener: (event: Event,
7896                                                        userInfo: Record<string, any>) => void): this;
7897     removeListener(event: 'received-apns-notification', listener: (event: Event,
7898                                                        userInfo: Record<string, any>) => void): this;
7899     /**
7900      * Registers the app with Apple Push Notification service (APNS) to receive Badge,
7901      * Sound, and Alert notifications. If registration is successful, the promise will
7902      * be resolved with the APNS device token. Otherwise, the promise will be rejected
7903      * with an error message. See:
7904      * https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
7905      *
7906      * @platform darwin
7907      */
7908     registerForAPNSNotifications(): Promise<string>;
7909     /**
7910      * Unregisters the app from notifications received from APNS. See:
7911      * https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc
7912      *
7913      * @platform darwin
7914      */
7915     unregisterForAPNSNotifications(): void;
7916   }
7917
7918   interface Rectangle {
7919
7920     // Docs: https://electronjs.org/docs/api/structures/rectangle
7921
7922     /**
7923      * The height of the rectangle (must be an integer).
7924      */
7925     height: number;
7926     /**
7927      * The width of the rectangle (must be an integer).
7928      */
7929     width: number;
7930     /**
7931      * The x coordinate of the origin of the rectangle (must be an integer).
7932      */
7933     x: number;
7934     /**
7935      * The y coordinate of the origin of the rectangle (must be an integer).
7936      */
7937     y: number;
7938   }
7939
7940   interface Referrer {
7941
7942     // Docs: https://electronjs.org/docs/api/structures/referrer
7943
7944     /**
7945      * Can be `default`, `unsafe-url`, `no-referrer-when-downgrade`, `no-referrer`,
7946      * `origin`, `strict-origin-when-cross-origin`, `same-origin` or `strict-origin`.
7947      * See the Referrer-Policy spec for more details on the meaning of these values.
7948      */
7949     policy: ('default' | 'unsafe-url' | 'no-referrer-when-downgrade' | 'no-referrer' | 'origin' | 'strict-origin-when-cross-origin' | 'same-origin' | 'strict-origin');
7950     /**
7951      * HTTP Referrer URL.
7952      */
7953     url: string;
7954   }
7955
7956   interface RenderProcessGoneDetails {
7957
7958     // Docs: https://electronjs.org/docs/api/structures/render-process-gone-details
7959
7960     /**
7961      * The exit code of the process, unless `reason` is `launch-failed`, in which case
7962      * `exitCode` will be a platform-specific launch failure error code.
7963      */
7964     exitCode: number;
7965     /**
7966      * The reason the render process is gone.  Possible values:
7967      */
7968     reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
7969   }
7970
7971   interface ResolvedEndpoint {
7972
7973     // Docs: https://electronjs.org/docs/api/structures/resolved-endpoint
7974
7975     address: string;
7976     /**
7977      * One of the following:
7978      */
7979     family: ('ipv4' | 'ipv6' | 'unspec');
7980   }
7981
7982   interface ResolvedHost {
7983
7984     // Docs: https://electronjs.org/docs/api/structures/resolved-host
7985
7986     /**
7987      * resolved DNS entries for the hostname
7988      */
7989     endpoints: ResolvedEndpoint[];
7990   }
7991
7992   interface SafeStorage extends NodeJS.EventEmitter {
7993
7994     // Docs: https://electronjs.org/docs/api/safe-storage
7995
7996     /**
7997      * the decrypted string. Decrypts the encrypted buffer obtained  with
7998      * `safeStorage.encryptString` back into a string.
7999      *
8000      * This function will throw an error if decryption fails.
8001      */
8002     decryptString(encrypted: Buffer): string;
8003     /**
8004      * An array of bytes representing the encrypted string.
8005      *
8006      * This function will throw an error if encryption fails.
8007      */
8008     encryptString(plainText: string): Buffer;
8009     /**
8010      * User friendly name of the password manager selected on Linux.
8011      *
8012      * This function will return one of the following values:
8013      *
8014      * * `basic_text` - When the desktop environment is not recognised or if the
8015      * following command line flag is provided `--password-store="basic"`.
8016      * * `gnome_libsecret` - When the desktop environment is `X-Cinnamon`, `Deepin`,
8017      * `GNOME`, `Pantheon`, `XFCE`, `UKUI`, `unity` or if the following command line
8018      * flag is provided `--password-store="gnome-libsecret"`.
8019      * * `kwallet` - When the desktop session is `kde4` or if the following command
8020      * line flag is provided `--password-store="kwallet"`.
8021      * * `kwallet5` - When the desktop session is `kde5` or if the following command
8022      * line flag is provided `--password-store="kwallet5"`.
8023      * * `kwallet6` - When the desktop session is `kde6`.
8024      * * `unknown` - When the function is called before app has emitted the `ready`
8025      * event.
8026      *
8027      * @platform linux
8028      */
8029     getSelectedStorageBackend(): ('basic_text' | 'gnome_libsecret' | 'kwallet' | 'kwallet5' | 'kwallet6' | 'unknown');
8030     /**
8031      * Whether encryption is available.
8032      *
8033      * On Linux, returns true if the app has emitted the `ready` event and the secret
8034      * key is available. On MacOS, returns true if Keychain is available. On Windows,
8035      * returns true once the app has emitted the `ready` event.
8036      */
8037     isEncryptionAvailable(): boolean;
8038     /**
8039      * This function on Linux will force the module to use an in memory password for
8040      * creating symmetric key that is used for encrypt/decrypt functions when a valid
8041      * OS password manager cannot be determined for the current active desktop
8042      * environment. This function is a no-op on Windows and MacOS.
8043      */
8044     setUsePlainTextEncryption(usePlainText: boolean): void;
8045   }
8046
8047   interface Screen extends NodeJS.EventEmitter {
8048
8049     // Docs: https://electronjs.org/docs/api/screen
8050
8051     /**
8052      * Emitted when `newDisplay` has been added.
8053      */
8054     on(event: 'display-added', listener: (event: Event,
8055                                           newDisplay: Display) => void): this;
8056     off(event: 'display-added', listener: (event: Event,
8057                                           newDisplay: Display) => void): this;
8058     once(event: 'display-added', listener: (event: Event,
8059                                           newDisplay: Display) => void): this;
8060     addListener(event: 'display-added', listener: (event: Event,
8061                                           newDisplay: Display) => void): this;
8062     removeListener(event: 'display-added', listener: (event: Event,
8063                                           newDisplay: Display) => void): this;
8064     /**
8065      * Emitted when one or more metrics change in a `display`. The `changedMetrics` is
8066      * an array of strings that describe the changes. Possible changes are `bounds`,
8067      * `workArea`, `scaleFactor` and `rotation`.
8068      */
8069     on(event: 'display-metrics-changed', listener: (event: Event,
8070                                                     display: Display,
8071                                                     changedMetrics: string[]) => void): this;
8072     off(event: 'display-metrics-changed', listener: (event: Event,
8073                                                     display: Display,
8074                                                     changedMetrics: string[]) => void): this;
8075     once(event: 'display-metrics-changed', listener: (event: Event,
8076                                                     display: Display,
8077                                                     changedMetrics: string[]) => void): this;
8078     addListener(event: 'display-metrics-changed', listener: (event: Event,
8079                                                     display: Display,
8080                                                     changedMetrics: string[]) => void): this;
8081     removeListener(event: 'display-metrics-changed', listener: (event: Event,
8082                                                     display: Display,
8083                                                     changedMetrics: string[]) => void): this;
8084     /**
8085      * Emitted when `oldDisplay` has been removed.
8086      */
8087     on(event: 'display-removed', listener: (event: Event,
8088                                             oldDisplay: Display) => void): this;
8089     off(event: 'display-removed', listener: (event: Event,
8090                                             oldDisplay: Display) => void): this;
8091     once(event: 'display-removed', listener: (event: Event,
8092                                             oldDisplay: Display) => void): this;
8093     addListener(event: 'display-removed', listener: (event: Event,
8094                                             oldDisplay: Display) => void): this;
8095     removeListener(event: 'display-removed', listener: (event: Event,
8096                                             oldDisplay: Display) => void): this;
8097     /**
8098      * Converts a screen DIP point to a screen physical point. The DPI scale is
8099      * performed relative to the display containing the DIP point.
8100      *
8101      * @platform win32
8102      */
8103     dipToScreenPoint(point: Point): Point;
8104     /**
8105      * Converts a screen DIP rect to a screen physical rect. The DPI scale is performed
8106      * relative to the display nearest to `window`. If `window` is null, scaling will
8107      * be performed to the display nearest to `rect`.
8108      *
8109      * @platform win32
8110      */
8111     dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
8112     /**
8113      * An array of displays that are currently available.
8114      */
8115     getAllDisplays(): Display[];
8116     /**
8117      * The current absolute position of the mouse pointer.
8118      *
8119      * **Note:** The return value is a DIP point, not a screen physical point.
8120      */
8121     getCursorScreenPoint(): Point;
8122     /**
8123      * The display that most closely intersects the provided bounds.
8124      */
8125     getDisplayMatching(rect: Rectangle): Display;
8126     /**
8127      * The display nearest the specified point.
8128      */
8129     getDisplayNearestPoint(point: Point): Display;
8130     /**
8131      * The primary display.
8132      */
8133     getPrimaryDisplay(): Display;
8134     /**
8135      * Converts a screen physical point to a screen DIP point. The DPI scale is
8136      * performed relative to the display containing the physical point.
8137      *
8138      * @platform win32
8139      */
8140     screenToDipPoint(point: Point): Point;
8141     /**
8142      * Converts a screen physical rect to a screen DIP rect. The DPI scale is performed
8143      * relative to the display nearest to `window`. If `window` is null, scaling will
8144      * be performed to the display nearest to `rect`.
8145      *
8146      * @platform win32
8147      */
8148     screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
8149   }
8150
8151   interface ScrubberItem {
8152
8153     // Docs: https://electronjs.org/docs/api/structures/scrubber-item
8154
8155     /**
8156      * The image to appear in this item.
8157      */
8158     icon?: NativeImage;
8159     /**
8160      * The text to appear in this item.
8161      */
8162     label?: string;
8163   }
8164
8165   interface SegmentedControlSegment {
8166
8167     // Docs: https://electronjs.org/docs/api/structures/segmented-control-segment
8168
8169     /**
8170      * Whether this segment is selectable. Default: true.
8171      */
8172     enabled?: boolean;
8173     /**
8174      * The image to appear in this segment.
8175      */
8176     icon?: NativeImage;
8177     /**
8178      * The text to appear in this segment.
8179      */
8180     label?: string;
8181   }
8182
8183   interface SerialPort {
8184
8185     // Docs: https://electronjs.org/docs/api/structures/serial-port
8186
8187     /**
8188      * A stable identifier on Windows that can be used for device permissions.
8189      *
8190      * @platform win32
8191      */
8192     deviceInstanceId?: string;
8193     /**
8194      * A string suitable for display to the user for describing this device.
8195      */
8196     displayName?: string;
8197     /**
8198      * Unique identifier for the port.
8199      */
8200     portId: string;
8201     /**
8202      * Name of the port.
8203      */
8204     portName: string;
8205     /**
8206      * The USB product ID.
8207      */
8208     productId?: string;
8209     /**
8210      * The USB device serial number.
8211      */
8212     serialNumber?: string;
8213     /**
8214      * Represents a single serial port on macOS can be enumerated by multiple drivers.
8215      *
8216      * @platform darwin
8217      */
8218     usbDriverName?: string;
8219     /**
8220      * The USB vendor ID.
8221      */
8222     vendorId?: string;
8223   }
8224
8225   interface ServiceWorkerInfo {
8226
8227     // Docs: https://electronjs.org/docs/api/structures/service-worker-info
8228
8229     /**
8230      * The virtual ID of the process that this service worker is running in.  This is
8231      * not an OS level PID.  This aligns with the ID set used for
8232      * `webContents.getProcessId()`.
8233      */
8234     renderProcessId: number;
8235     /**
8236      * The base URL that this service worker is active for.
8237      */
8238     scope: string;
8239     /**
8240      * The full URL to the script that this service worker runs
8241      */
8242     scriptUrl: string;
8243   }
8244
8245   class ServiceWorkers extends NodeEventEmitter {
8246
8247     // Docs: https://electronjs.org/docs/api/service-workers
8248
8249     /**
8250      * Emitted when a service worker logs something to the console.
8251      */
8252     on(event: 'console-message', listener: (event: Event,
8253                                             /**
8254                                              * Information about the console message
8255                                              */
8256                                             messageDetails: MessageDetails) => void): this;
8257     off(event: 'console-message', listener: (event: Event,
8258                                             /**
8259                                              * Information about the console message
8260                                              */
8261                                             messageDetails: MessageDetails) => void): this;
8262     once(event: 'console-message', listener: (event: Event,
8263                                             /**
8264                                              * Information about the console message
8265                                              */
8266                                             messageDetails: MessageDetails) => void): this;
8267     addListener(event: 'console-message', listener: (event: Event,
8268                                             /**
8269                                              * Information about the console message
8270                                              */
8271                                             messageDetails: MessageDetails) => void): this;
8272     removeListener(event: 'console-message', listener: (event: Event,
8273                                             /**
8274                                              * Information about the console message
8275                                              */
8276                                             messageDetails: MessageDetails) => void): this;
8277     /**
8278      * Emitted when a service worker has been registered. Can occur after a call to
8279      * `navigator.serviceWorker.register('/sw.js')` successfully resolves or when a
8280      * Chrome extension is loaded.
8281      */
8282     on(event: 'registration-completed', listener: (event: Event,
8283                                                    /**
8284                                                     * Information about the registered service worker
8285                                                     */
8286                                                    details: RegistrationCompletedDetails) => void): this;
8287     off(event: 'registration-completed', listener: (event: Event,
8288                                                    /**
8289                                                     * Information about the registered service worker
8290                                                     */
8291                                                    details: RegistrationCompletedDetails) => void): this;
8292     once(event: 'registration-completed', listener: (event: Event,
8293                                                    /**
8294                                                     * Information about the registered service worker
8295                                                     */
8296                                                    details: RegistrationCompletedDetails) => void): this;
8297     addListener(event: 'registration-completed', listener: (event: Event,
8298                                                    /**
8299                                                     * Information about the registered service worker
8300                                                     */
8301                                                    details: RegistrationCompletedDetails) => void): this;
8302     removeListener(event: 'registration-completed', listener: (event: Event,
8303                                                    /**
8304                                                     * Information about the registered service worker
8305                                                     */
8306                                                    details: RegistrationCompletedDetails) => void): this;
8307     /**
8308      * A ServiceWorkerInfo object where the keys are the service worker version ID and
8309      * the values are the information about that service worker.
8310      */
8311     getAllRunning(): Record<number, ServiceWorkerInfo>;
8312     /**
8313      * Information about this service worker
8314      *
8315      * If the service worker does not exist or is not running this method will throw an
8316      * exception.
8317      */
8318     getFromVersionID(versionId: number): ServiceWorkerInfo;
8319   }
8320
8321   class Session extends NodeEventEmitter {
8322
8323     // Docs: https://electronjs.org/docs/api/session
8324
8325     /**
8326      * A session instance from `partition` string. When there is an existing `Session`
8327      * with the same `partition`, it will be returned; otherwise a new `Session`
8328      * instance will be created with `options`.
8329      *
8330      * If `partition` starts with `persist:`, the page will use a persistent session
8331      * available to all pages in the app with the same `partition`. if there is no
8332      * `persist:` prefix, the page will use an in-memory session. If the `partition` is
8333      * empty then default session of the app will be returned.
8334      *
8335      * To create a `Session` with `options`, you have to ensure the `Session` with the
8336      * `partition` has never been used before. There is no way to change the `options`
8337      * of an existing `Session` object.
8338      */
8339     static fromPartition(partition: string, options?: FromPartitionOptions): Session;
8340     /**
8341      * A session instance from the absolute path as specified by the `path` string.
8342      * When there is an existing `Session` with the same absolute path, it will be
8343      * returned; otherwise a new `Session` instance will be created with `options`. The
8344      * call will throw an error if the path is not an absolute path. Additionally, an
8345      * error will be thrown if an empty string is provided.
8346      *
8347      * To create a `Session` with `options`, you have to ensure the `Session` with the
8348      * `path` has never been used before. There is no way to change the `options` of an
8349      * existing `Session` object.
8350      */
8351     static fromPath(path: string, options?: FromPathOptions): Session;
8352     /**
8353      * A `Session` object, the default session object of the app.
8354      */
8355     static defaultSession: Session;
8356     /**
8357      * Emitted after an extension is loaded. This occurs whenever an extension is added
8358      * to the "enabled" set of extensions. This includes:
8359      *
8360      * * Extensions being loaded from `Session.loadExtension`.
8361      * * Extensions being reloaded:
8362      *   * from a crash.
8363      *   * if the extension requested it (`chrome.runtime.reload()`).
8364      */
8365     on(event: 'extension-loaded', listener: (event: Event,
8366                                              extension: Extension) => void): this;
8367     off(event: 'extension-loaded', listener: (event: Event,
8368                                              extension: Extension) => void): this;
8369     once(event: 'extension-loaded', listener: (event: Event,
8370                                              extension: Extension) => void): this;
8371     addListener(event: 'extension-loaded', listener: (event: Event,
8372                                              extension: Extension) => void): this;
8373     removeListener(event: 'extension-loaded', listener: (event: Event,
8374                                              extension: Extension) => void): this;
8375     /**
8376      * Emitted after an extension is loaded and all necessary browser state is
8377      * initialized to support the start of the extension's background page.
8378      */
8379     on(event: 'extension-ready', listener: (event: Event,
8380                                             extension: Extension) => void): this;
8381     off(event: 'extension-ready', listener: (event: Event,
8382                                             extension: Extension) => void): this;
8383     once(event: 'extension-ready', listener: (event: Event,
8384                                             extension: Extension) => void): this;
8385     addListener(event: 'extension-ready', listener: (event: Event,
8386                                             extension: Extension) => void): this;
8387     removeListener(event: 'extension-ready', listener: (event: Event,
8388                                             extension: Extension) => void): this;
8389     /**
8390      * Emitted after an extension is unloaded. This occurs when
8391      * `Session.removeExtension` is called.
8392      */
8393     on(event: 'extension-unloaded', listener: (event: Event,
8394                                                extension: Extension) => void): this;
8395     off(event: 'extension-unloaded', listener: (event: Event,
8396                                                extension: Extension) => void): this;
8397     once(event: 'extension-unloaded', listener: (event: Event,
8398                                                extension: Extension) => void): this;
8399     addListener(event: 'extension-unloaded', listener: (event: Event,
8400                                                extension: Extension) => void): this;
8401     removeListener(event: 'extension-unloaded', listener: (event: Event,
8402                                                extension: Extension) => void): this;
8403     /**
8404      * Emitted after `navigator.hid.requestDevice` has been called and
8405      * `select-hid-device` has fired if a new device becomes available before the
8406      * callback from `select-hid-device` is called.  This event is intended for use
8407      * when using a UI to ask users to pick a device so that the UI can be updated with
8408      * the newly added device.
8409      */
8410     on(event: 'hid-device-added', listener: (event: Event,
8411                                              details: HidDeviceAddedDetails) => void): this;
8412     off(event: 'hid-device-added', listener: (event: Event,
8413                                              details: HidDeviceAddedDetails) => void): this;
8414     once(event: 'hid-device-added', listener: (event: Event,
8415                                              details: HidDeviceAddedDetails) => void): this;
8416     addListener(event: 'hid-device-added', listener: (event: Event,
8417                                              details: HidDeviceAddedDetails) => void): this;
8418     removeListener(event: 'hid-device-added', listener: (event: Event,
8419                                              details: HidDeviceAddedDetails) => void): this;
8420     /**
8421      * Emitted after `navigator.hid.requestDevice` has been called and
8422      * `select-hid-device` has fired if a device has been removed before the callback
8423      * from `select-hid-device` is called.  This event is intended for use when using a
8424      * UI to ask users to pick a device so that the UI can be updated to remove the
8425      * specified device.
8426      */
8427     on(event: 'hid-device-removed', listener: (event: Event,
8428                                                details: HidDeviceRemovedDetails) => void): this;
8429     off(event: 'hid-device-removed', listener: (event: Event,
8430                                                details: HidDeviceRemovedDetails) => void): this;
8431     once(event: 'hid-device-removed', listener: (event: Event,
8432                                                details: HidDeviceRemovedDetails) => void): this;
8433     addListener(event: 'hid-device-removed', listener: (event: Event,
8434                                                details: HidDeviceRemovedDetails) => void): this;
8435     removeListener(event: 'hid-device-removed', listener: (event: Event,
8436                                                details: HidDeviceRemovedDetails) => void): this;
8437     /**
8438      * Emitted after `HIDDevice.forget()` has been called.  This event can be used to
8439      * help maintain persistent storage of permissions when
8440      * `setDevicePermissionHandler` is used.
8441      */
8442     on(event: 'hid-device-revoked', listener: (event: Event,
8443                                                details: HidDeviceRevokedDetails) => void): this;
8444     off(event: 'hid-device-revoked', listener: (event: Event,
8445                                                details: HidDeviceRevokedDetails) => void): this;
8446     once(event: 'hid-device-revoked', listener: (event: Event,
8447                                                details: HidDeviceRevokedDetails) => void): this;
8448     addListener(event: 'hid-device-revoked', listener: (event: Event,
8449                                                details: HidDeviceRevokedDetails) => void): this;
8450     removeListener(event: 'hid-device-revoked', listener: (event: Event,
8451                                                details: HidDeviceRevokedDetails) => void): this;
8452     /**
8453      * Emitted when a render process requests preconnection to a URL, generally due to
8454      * a resource hint.
8455      */
8456     on(event: 'preconnect', listener: (event: Event,
8457                                        /**
8458                                         * The URL being requested for preconnection by the renderer.
8459                                         */
8460                                        preconnectUrl: string,
8461                                        /**
8462                                         * True if the renderer is requesting that the connection include credentials (see
8463                                         * the spec for more details.)
8464                                         */
8465                                        allowCredentials: boolean) => void): this;
8466     off(event: 'preconnect', listener: (event: Event,
8467                                        /**
8468                                         * The URL being requested for preconnection by the renderer.
8469                                         */
8470                                        preconnectUrl: string,
8471                                        /**
8472                                         * True if the renderer is requesting that the connection include credentials (see
8473                                         * the spec for more details.)
8474                                         */
8475                                        allowCredentials: boolean) => void): this;
8476     once(event: 'preconnect', listener: (event: Event,
8477                                        /**
8478                                         * The URL being requested for preconnection by the renderer.
8479                                         */
8480                                        preconnectUrl: string,
8481                                        /**
8482                                         * True if the renderer is requesting that the connection include credentials (see
8483                                         * the spec for more details.)
8484                                         */
8485                                        allowCredentials: boolean) => void): this;
8486     addListener(event: 'preconnect', listener: (event: Event,
8487                                        /**
8488                                         * The URL being requested for preconnection by the renderer.
8489                                         */
8490                                        preconnectUrl: string,
8491                                        /**
8492                                         * True if the renderer is requesting that the connection include credentials (see
8493                                         * the spec for more details.)
8494                                         */
8495                                        allowCredentials: boolean) => void): this;
8496     removeListener(event: 'preconnect', listener: (event: Event,
8497                                        /**
8498                                         * The URL being requested for preconnection by the renderer.
8499                                         */
8500                                        preconnectUrl: string,
8501                                        /**
8502                                         * True if the renderer is requesting that the connection include credentials (see
8503                                         * the spec for more details.)
8504                                         */
8505                                        allowCredentials: boolean) => void): this;
8506     /**
8507      * Emitted when a HID device needs to be selected when a call to
8508      * `navigator.hid.requestDevice` is made. `callback` should be called with
8509      * `deviceId` to be selected; passing no arguments to `callback` will cancel the
8510      * request.  Additionally, permissioning on `navigator.hid` can be further managed
8511      * by using `ses.setPermissionCheckHandler(handler)` and
8512      * `ses.setDevicePermissionHandler(handler)`.
8513      */
8514     on(event: 'select-hid-device', listener: (event: Event,
8515                                               details: SelectHidDeviceDetails,
8516                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
8517     off(event: 'select-hid-device', listener: (event: Event,
8518                                               details: SelectHidDeviceDetails,
8519                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
8520     once(event: 'select-hid-device', listener: (event: Event,
8521                                               details: SelectHidDeviceDetails,
8522                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
8523     addListener(event: 'select-hid-device', listener: (event: Event,
8524                                               details: SelectHidDeviceDetails,
8525                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
8526     removeListener(event: 'select-hid-device', listener: (event: Event,
8527                                               details: SelectHidDeviceDetails,
8528                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
8529     /**
8530      * Emitted when a serial port needs to be selected when a call to
8531      * `navigator.serial.requestPort` is made. `callback` should be called with
8532      * `portId` to be selected, passing an empty string to `callback` will cancel the
8533      * request.  Additionally, permissioning on `navigator.serial` can be managed by
8534      * using ses.setPermissionCheckHandler(handler) with the `serial` permission.
8535      */
8536     on(event: 'select-serial-port', listener: (event: Event,
8537                                                portList: SerialPort[],
8538                                                webContents: WebContents,
8539                                                callback: (portId: string) => void) => void): this;
8540     off(event: 'select-serial-port', listener: (event: Event,
8541                                                portList: SerialPort[],
8542                                                webContents: WebContents,
8543                                                callback: (portId: string) => void) => void): this;
8544     once(event: 'select-serial-port', listener: (event: Event,
8545                                                portList: SerialPort[],
8546                                                webContents: WebContents,
8547                                                callback: (portId: string) => void) => void): this;
8548     addListener(event: 'select-serial-port', listener: (event: Event,
8549                                                portList: SerialPort[],
8550                                                webContents: WebContents,
8551                                                callback: (portId: string) => void) => void): this;
8552     removeListener(event: 'select-serial-port', listener: (event: Event,
8553                                                portList: SerialPort[],
8554                                                webContents: WebContents,
8555                                                callback: (portId: string) => void) => void): this;
8556     /**
8557      * Emitted when a USB device needs to be selected when a call to
8558      * `navigator.usb.requestDevice` is made. `callback` should be called with
8559      * `deviceId` to be selected; passing no arguments to `callback` will cancel the
8560      * request.  Additionally, permissioning on `navigator.usb` can be further managed
8561      * by using `ses.setPermissionCheckHandler(handler)` and
8562      * `ses.setDevicePermissionHandler(handler)`.
8563      */
8564     on(event: 'select-usb-device', listener: (event: Event,
8565                                               details: SelectUsbDeviceDetails,
8566                                               callback: (deviceId?: string) => void) => void): this;
8567     off(event: 'select-usb-device', listener: (event: Event,
8568                                               details: SelectUsbDeviceDetails,
8569                                               callback: (deviceId?: string) => void) => void): this;
8570     once(event: 'select-usb-device', listener: (event: Event,
8571                                               details: SelectUsbDeviceDetails,
8572                                               callback: (deviceId?: string) => void) => void): this;
8573     addListener(event: 'select-usb-device', listener: (event: Event,
8574                                               details: SelectUsbDeviceDetails,
8575                                               callback: (deviceId?: string) => void) => void): this;
8576     removeListener(event: 'select-usb-device', listener: (event: Event,
8577                                               details: SelectUsbDeviceDetails,
8578                                               callback: (deviceId?: string) => void) => void): this;
8579     /**
8580      * Emitted after `navigator.serial.requestPort` has been called and
8581      * `select-serial-port` has fired if a new serial port becomes available before the
8582      * callback from `select-serial-port` is called.  This event is intended for use
8583      * when using a UI to ask users to pick a port so that the UI can be updated with
8584      * the newly added port.
8585      */
8586     on(event: 'serial-port-added', listener: (event: Event,
8587                                               port: SerialPort,
8588                                               webContents: WebContents) => void): this;
8589     off(event: 'serial-port-added', listener: (event: Event,
8590                                               port: SerialPort,
8591                                               webContents: WebContents) => void): this;
8592     once(event: 'serial-port-added', listener: (event: Event,
8593                                               port: SerialPort,
8594                                               webContents: WebContents) => void): this;
8595     addListener(event: 'serial-port-added', listener: (event: Event,
8596                                               port: SerialPort,
8597                                               webContents: WebContents) => void): this;
8598     removeListener(event: 'serial-port-added', listener: (event: Event,
8599                                               port: SerialPort,
8600                                               webContents: WebContents) => void): this;
8601     /**
8602      * Emitted after `navigator.serial.requestPort` has been called and
8603      * `select-serial-port` has fired if a serial port has been removed before the
8604      * callback from `select-serial-port` is called.  This event is intended for use
8605      * when using a UI to ask users to pick a port so that the UI can be updated to
8606      * remove the specified port.
8607      */
8608     on(event: 'serial-port-removed', listener: (event: Event,
8609                                                 port: SerialPort,
8610                                                 webContents: WebContents) => void): this;
8611     off(event: 'serial-port-removed', listener: (event: Event,
8612                                                 port: SerialPort,
8613                                                 webContents: WebContents) => void): this;
8614     once(event: 'serial-port-removed', listener: (event: Event,
8615                                                 port: SerialPort,
8616                                                 webContents: WebContents) => void): this;
8617     addListener(event: 'serial-port-removed', listener: (event: Event,
8618                                                 port: SerialPort,
8619                                                 webContents: WebContents) => void): this;
8620     removeListener(event: 'serial-port-removed', listener: (event: Event,
8621                                                 port: SerialPort,
8622                                                 webContents: WebContents) => void): this;
8623     /**
8624      * Emitted after `SerialPort.forget()` has been called.  This event can be used to
8625      * help maintain persistent storage of permissions when
8626      * `setDevicePermissionHandler` is used.
8627      */
8628     on(event: 'serial-port-revoked', listener: (event: Event,
8629                                                 details: SerialPortRevokedDetails) => void): this;
8630     off(event: 'serial-port-revoked', listener: (event: Event,
8631                                                 details: SerialPortRevokedDetails) => void): this;
8632     once(event: 'serial-port-revoked', listener: (event: Event,
8633                                                 details: SerialPortRevokedDetails) => void): this;
8634     addListener(event: 'serial-port-revoked', listener: (event: Event,
8635                                                 details: SerialPortRevokedDetails) => void): this;
8636     removeListener(event: 'serial-port-revoked', listener: (event: Event,
8637                                                 details: SerialPortRevokedDetails) => void): this;
8638     /**
8639      * Emitted when a hunspell dictionary file starts downloading
8640      */
8641     on(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
8642                                                                  /**
8643                                                                   * The language code of the dictionary file
8644                                                                   */
8645                                                                  languageCode: string) => void): this;
8646     off(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
8647                                                                  /**
8648                                                                   * The language code of the dictionary file
8649                                                                   */
8650                                                                  languageCode: string) => void): this;
8651     once(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
8652                                                                  /**
8653                                                                   * The language code of the dictionary file
8654                                                                   */
8655                                                                  languageCode: string) => void): this;
8656     addListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
8657                                                                  /**
8658                                                                   * The language code of the dictionary file
8659                                                                   */
8660                                                                  languageCode: string) => void): this;
8661     removeListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
8662                                                                  /**
8663                                                                   * The language code of the dictionary file
8664                                                                   */
8665                                                                  languageCode: string) => void): this;
8666     /**
8667      * Emitted when a hunspell dictionary file download fails.  For details on the
8668      * failure you should collect a netlog and inspect the download request.
8669      */
8670     on(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
8671                                                                    /**
8672                                                                     * The language code of the dictionary file
8673                                                                     */
8674                                                                    languageCode: string) => void): this;
8675     off(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
8676                                                                    /**
8677                                                                     * The language code of the dictionary file
8678                                                                     */
8679                                                                    languageCode: string) => void): this;
8680     once(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
8681                                                                    /**
8682                                                                     * The language code of the dictionary file
8683                                                                     */
8684                                                                    languageCode: string) => void): this;
8685     addListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
8686                                                                    /**
8687                                                                     * The language code of the dictionary file
8688                                                                     */
8689                                                                    languageCode: string) => void): this;
8690     removeListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
8691                                                                    /**
8692                                                                     * The language code of the dictionary file
8693                                                                     */
8694                                                                    languageCode: string) => void): this;
8695     /**
8696      * Emitted when a hunspell dictionary file has been successfully downloaded
8697      */
8698     on(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
8699                                                                    /**
8700                                                                     * The language code of the dictionary file
8701                                                                     */
8702                                                                    languageCode: string) => void): this;
8703     off(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
8704                                                                    /**
8705                                                                     * The language code of the dictionary file
8706                                                                     */
8707                                                                    languageCode: string) => void): this;
8708     once(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
8709                                                                    /**
8710                                                                     * The language code of the dictionary file
8711                                                                     */
8712                                                                    languageCode: string) => void): this;
8713     addListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
8714                                                                    /**
8715                                                                     * The language code of the dictionary file
8716                                                                     */
8717                                                                    languageCode: string) => void): this;
8718     removeListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
8719                                                                    /**
8720                                                                     * The language code of the dictionary file
8721                                                                     */
8722                                                                    languageCode: string) => void): this;
8723     /**
8724      * Emitted when a hunspell dictionary file has been successfully initialized. This
8725      * occurs after the file has been downloaded.
8726      */
8727     on(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
8728                                                               /**
8729                                                                * The language code of the dictionary file
8730                                                                */
8731                                                               languageCode: string) => void): this;
8732     off(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
8733                                                               /**
8734                                                                * The language code of the dictionary file
8735                                                                */
8736                                                               languageCode: string) => void): this;
8737     once(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
8738                                                               /**
8739                                                                * The language code of the dictionary file
8740                                                                */
8741                                                               languageCode: string) => void): this;
8742     addListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
8743                                                               /**
8744                                                                * The language code of the dictionary file
8745                                                                */
8746                                                               languageCode: string) => void): this;
8747     removeListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
8748                                                               /**
8749                                                                * The language code of the dictionary file
8750                                                                */
8751                                                               languageCode: string) => void): this;
8752     /**
8753      * Emitted after `navigator.usb.requestDevice` has been called and
8754      * `select-usb-device` has fired if a new device becomes available before the
8755      * callback from `select-usb-device` is called.  This event is intended for use
8756      * when using a UI to ask users to pick a device so that the UI can be updated with
8757      * the newly added device.
8758      */
8759     on(event: 'usb-device-added', listener: (event: Event,
8760                                              device: USBDevice,
8761                                              webContents: WebContents) => void): this;
8762     off(event: 'usb-device-added', listener: (event: Event,
8763                                              device: USBDevice,
8764                                              webContents: WebContents) => void): this;
8765     once(event: 'usb-device-added', listener: (event: Event,
8766                                              device: USBDevice,
8767                                              webContents: WebContents) => void): this;
8768     addListener(event: 'usb-device-added', listener: (event: Event,
8769                                              device: USBDevice,
8770                                              webContents: WebContents) => void): this;
8771     removeListener(event: 'usb-device-added', listener: (event: Event,
8772                                              device: USBDevice,
8773                                              webContents: WebContents) => void): this;
8774     /**
8775      * Emitted after `navigator.usb.requestDevice` has been called and
8776      * `select-usb-device` has fired if a device has been removed before the callback
8777      * from `select-usb-device` is called.  This event is intended for use when using a
8778      * UI to ask users to pick a device so that the UI can be updated to remove the
8779      * specified device.
8780      */
8781     on(event: 'usb-device-removed', listener: (event: Event,
8782                                                device: USBDevice,
8783                                                webContents: WebContents) => void): this;
8784     off(event: 'usb-device-removed', listener: (event: Event,
8785                                                device: USBDevice,
8786                                                webContents: WebContents) => void): this;
8787     once(event: 'usb-device-removed', listener: (event: Event,
8788                                                device: USBDevice,
8789                                                webContents: WebContents) => void): this;
8790     addListener(event: 'usb-device-removed', listener: (event: Event,
8791                                                device: USBDevice,
8792                                                webContents: WebContents) => void): this;
8793     removeListener(event: 'usb-device-removed', listener: (event: Event,
8794                                                device: USBDevice,
8795                                                webContents: WebContents) => void): this;
8796     /**
8797      * Emitted after `USBDevice.forget()` has been called.  This event can be used to
8798      * help maintain persistent storage of permissions when
8799      * `setDevicePermissionHandler` is used.
8800      */
8801     on(event: 'usb-device-revoked', listener: (event: Event,
8802                                                details: UsbDeviceRevokedDetails) => void): this;
8803     off(event: 'usb-device-revoked', listener: (event: Event,
8804                                                details: UsbDeviceRevokedDetails) => void): this;
8805     once(event: 'usb-device-revoked', listener: (event: Event,
8806                                                details: UsbDeviceRevokedDetails) => void): this;
8807     addListener(event: 'usb-device-revoked', listener: (event: Event,
8808                                                details: UsbDeviceRevokedDetails) => void): this;
8809     removeListener(event: 'usb-device-revoked', listener: (event: Event,
8810                                                details: UsbDeviceRevokedDetails) => void): this;
8811     /**
8812      * Emitted when Electron is about to download `item` in `webContents`.
8813      *
8814      * Calling `event.preventDefault()` will cancel the download and `item` will not be
8815      * available from next tick of the process.
8816      */
8817     on(event: 'will-download', listener: (event: Event,
8818                                           item: DownloadItem,
8819                                           webContents: WebContents) => void): this;
8820     off(event: 'will-download', listener: (event: Event,
8821                                           item: DownloadItem,
8822                                           webContents: WebContents) => void): this;
8823     once(event: 'will-download', listener: (event: Event,
8824                                           item: DownloadItem,
8825                                           webContents: WebContents) => void): this;
8826     addListener(event: 'will-download', listener: (event: Event,
8827                                           item: DownloadItem,
8828                                           webContents: WebContents) => void): this;
8829     removeListener(event: 'will-download', listener: (event: Event,
8830                                           item: DownloadItem,
8831                                           webContents: WebContents) => void): this;
8832     /**
8833      * Whether the word was successfully written to the custom dictionary. This API
8834      * will not work on non-persistent (in-memory) sessions.
8835      *
8836      * **Note:** On macOS and Windows 10 this word will be written to the OS custom
8837      * dictionary as well
8838      */
8839     addWordToSpellCheckerDictionary(word: string): boolean;
8840     /**
8841      * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
8842      * authentication.
8843      */
8844     allowNTLMCredentialsForDomains(domains: string): void;
8845     /**
8846      * resolves when the session’s HTTP authentication cache has been cleared.
8847      */
8848     clearAuthCache(): Promise<void>;
8849     /**
8850      * resolves when the cache clear operation is complete.
8851      *
8852      * Clears the session’s HTTP cache.
8853      */
8854     clearCache(): Promise<void>;
8855     /**
8856      * resolves when the code cache clear operation is complete.
8857      */
8858     clearCodeCaches(options: ClearCodeCachesOptions): Promise<void>;
8859     /**
8860      * Resolves when the operation is complete.
8861      *
8862      * Clears the host resolver cache.
8863      */
8864     clearHostResolverCache(): Promise<void>;
8865     /**
8866      * resolves when the storage data has been cleared.
8867      */
8868     clearStorageData(options?: ClearStorageDataOptions): Promise<void>;
8869     /**
8870      * Resolves when all connections are closed.
8871      *
8872      * **Note:** It will terminate / fail all requests currently in flight.
8873      */
8874     closeAllConnections(): Promise<void>;
8875     /**
8876      * Allows resuming `cancelled` or `interrupted` downloads from previous `Session`.
8877      * The API will generate a DownloadItem that can be accessed with the will-download
8878      * event. The DownloadItem will not have any `WebContents` associated with it and
8879      * the initial state will be `interrupted`. The download will start only when the
8880      * `resume` API is called on the DownloadItem.
8881      */
8882     createInterruptedDownload(options: CreateInterruptedDownloadOptions): void;
8883     /**
8884      * Disables any network emulation already active for the `session`. Resets to the
8885      * original network configuration.
8886      */
8887     disableNetworkEmulation(): void;
8888     /**
8889      * Initiates a download of the resource at `url`. The API will generate a
8890      * DownloadItem that can be accessed with the will-download event.
8891      *
8892      * **Note:** This does not perform any security checks that relate to a page's
8893      * origin, unlike `webContents.downloadURL`.
8894      */
8895     downloadURL(url: string, options?: DownloadURLOptions): void;
8896     /**
8897      * Emulates network with the given configuration for the `session`.
8898      */
8899     enableNetworkEmulation(options: EnableNetworkEmulationOptions): void;
8900     /**
8901      * see Response.
8902      *
8903      * Sends a request, similarly to how `fetch()` works in the renderer, using
8904      * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
8905      * HTTP stack.
8906      *
8907      * Example:
8908      *
8909      * See also `net.fetch()`, a convenience method which issues requests from the
8910      * default session.
8911      *
8912      * See the MDN documentation for `fetch()` for more details.
8913      *
8914      * Limitations:
8915      *
8916      * * `net.fetch()` does not support the `data:` or `blob:` schemes.
8917      * * The value of the `integrity` option is ignored.
8918      * * The `.type` and `.url` values of the returned `Response` object are incorrect.
8919      *
8920      * By default, requests made with `net.fetch` can be made to custom protocols as
8921      * well as `file:`, and will trigger webRequest handlers if present. When the
8922      * non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
8923      * protocol handlers will not be called for this request. This allows forwarding an
8924      * intercepted request to the built-in handler. webRequest handlers will still be
8925      * triggered when bypassing custom protocols.
8926      */
8927     fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
8928     /**
8929      * Writes any unwritten DOMStorage data to disk.
8930      */
8931     flushStorageData(): void;
8932     /**
8933      * Resolves when the all internal states of proxy service is reset and the latest
8934      * proxy configuration is reapplied if it's already available. The pac script will
8935      * be fetched from `pacScript` again if the proxy mode is `pac_script`.
8936      */
8937     forceReloadProxyConfig(): Promise<void>;
8938     /**
8939      * A list of all loaded extensions.
8940      *
8941      * **Note:** This API cannot be called before the `ready` event of the `app` module
8942      * is emitted.
8943      */
8944     getAllExtensions(): Extension[];
8945     /**
8946      * resolves with blob data.
8947      */
8948     getBlobData(identifier: string): Promise<Buffer>;
8949     /**
8950      * the session's current cache size, in bytes.
8951      */
8952     getCacheSize(): Promise<number>;
8953     /**
8954      * The loaded extension with the given ID.
8955      *
8956      * **Note:** This API cannot be called before the `ready` event of the `app` module
8957      * is emitted.
8958      */
8959     getExtension(extensionId: string): (Extension) | (null);
8960     /**
8961      * an array of paths to preload scripts that have been registered.
8962      */
8963     getPreloads(): string[];
8964     /**
8965      * An array of language codes the spellchecker is enabled for.  If this list is
8966      * empty the spellchecker will fallback to using `en-US`.  By default on launch if
8967      * this setting is an empty list Electron will try to populate this setting with
8968      * the current OS locale.  This setting is persisted across restarts.
8969      *
8970      * **Note:** On macOS the OS spellchecker is used and has its own list of
8971      * languages. On macOS, this API will return whichever languages have been
8972      * configured by the OS.
8973      */
8974     getSpellCheckerLanguages(): string[];
8975     /**
8976      * The absolute file system path where data for this session is persisted on disk.
8977      * For in memory sessions this returns `null`.
8978      */
8979     getStoragePath(): (string) | (null);
8980     /**
8981      * The user agent for this session.
8982      */
8983     getUserAgent(): string;
8984     /**
8985      * Whether or not this session is a persistent one. The default `webContents`
8986      * session of a `BrowserWindow` is persistent. When creating a session from a
8987      * partition, session prefixed with `persist:` will be persistent, while others
8988      * will be temporary.
8989      */
8990     isPersistent(): boolean;
8991     /**
8992      * Whether the builtin spell checker is enabled.
8993      */
8994     isSpellCheckerEnabled(): boolean;
8995     /**
8996      * An array of all words in app's custom dictionary. Resolves when the full
8997      * dictionary is loaded from disk.
8998      */
8999     listWordsInSpellCheckerDictionary(): Promise<string[]>;
9000     /**
9001      * resolves when the extension is loaded.
9002      *
9003      * This method will raise an exception if the extension could not be loaded. If
9004      * there are warnings when installing the extension (e.g. if the extension requests
9005      * an API that Electron does not support) then they will be logged to the console.
9006      *
9007      * Note that Electron does not support the full range of Chrome extensions APIs.
9008      * See Supported Extensions APIs for more details on what is supported.
9009      *
9010      * Note that in previous versions of Electron, extensions that were loaded would be
9011      * remembered for future runs of the application. This is no longer the case:
9012      * `loadExtension` must be called on every boot of your app if you want the
9013      * extension to be loaded.
9014      *
9015      * This API does not support loading packed (.crx) extensions.
9016      *
9017      * **Note:** This API cannot be called before the `ready` event of the `app` module
9018      * is emitted.
9019      *
9020      * **Note:** Loading extensions into in-memory (non-persistent) sessions is not
9021      * supported and will throw an error.
9022      */
9023     loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
9024     /**
9025      * Preconnects the given number of sockets to an origin.
9026      */
9027     preconnect(options: PreconnectOptions): void;
9028     /**
9029      * Unloads an extension.
9030      *
9031      * **Note:** This API cannot be called before the `ready` event of the `app` module
9032      * is emitted.
9033      */
9034     removeExtension(extensionId: string): void;
9035     /**
9036      * Whether the word was successfully removed from the custom dictionary. This API
9037      * will not work on non-persistent (in-memory) sessions.
9038      *
9039      * **Note:** On macOS and Windows 10 this word will be removed from the OS custom
9040      * dictionary as well
9041      */
9042     removeWordFromSpellCheckerDictionary(word: string): boolean;
9043     /**
9044      * Resolves with the resolved IP addresses for the `host`.
9045      */
9046     resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
9047     /**
9048      * Resolves with the proxy information for `url`.
9049      */
9050     resolveProxy(url: string): Promise<string>;
9051     /**
9052      * Sets a handler to respond to Bluetooth pairing requests. This handler allows
9053      * developers to handle devices that require additional validation before pairing.
9054      * When a handler is not defined, any pairing on Linux or Windows that requires
9055      * additional validation will be automatically cancelled. macOS does not require a
9056      * handler because macOS handles the pairing automatically.  To clear the handler,
9057      * call `setBluetoothPairingHandler(null)`.
9058      *
9059      * @platform win32,linux
9060      */
9061     setBluetoothPairingHandler(handler: ((details: BluetoothPairingHandlerHandlerDetails, callback: (response: Response) => void) => void) | (null)): void;
9062     /**
9063      * Sets the certificate verify proc for `session`, the `proc` will be called with
9064      * `proc(request, callback)` whenever a server certificate verification is
9065      * requested. Calling `callback(0)` accepts the certificate, calling `callback(-2)`
9066      * rejects it.
9067      *
9068      * Calling `setCertificateVerifyProc(null)` will revert back to default certificate
9069      * verify proc.
9070      *
9071      * > **NOTE:** The result of this procedure is cached by the network service.
9072      */
9073     setCertificateVerifyProc(proc: ((request: Request, callback: (verificationResult: number) => void) => void) | (null)): void;
9074     /**
9075      * Sets the directory to store the generated JS code cache for this session. The
9076      * directory is not required to be created by the user before this call, the
9077      * runtime will create if it does not exist otherwise will use the existing
9078      * directory. If directory cannot be created, then code cache will not be used and
9079      * all operations related to code cache will fail silently inside the runtime. By
9080      * default, the directory will be `Code Cache` under the respective user data
9081      * folder.
9082      *
9083      * Note that by default code cache is only enabled for http(s) URLs, to enable code
9084      * cache for custom protocols, `codeCache: true` and `standard: true` must be
9085      * specified when registering the protocol.
9086      */
9087     setCodeCachePath(path: string): void;
9088     /**
9089      * Sets the handler which can be used to respond to device permission checks for
9090      * the `session`. Returning `true` will allow the device to be permitted and
9091      * `false` will reject it. To clear the handler, call
9092      * `setDevicePermissionHandler(null)`. This handler can be used to provide default
9093      * permissioning to devices without first calling for permission to devices (eg via
9094      * `navigator.hid.requestDevice`).  If this handler is not defined, the default
9095      * device permissions as granted through device selection (eg via
9096      * `navigator.hid.requestDevice`) will be used. Additionally, the default behavior
9097      * of Electron is to store granted device permission in memory. If longer term
9098      * storage is needed, a developer can store granted device permissions (eg when
9099      * handling the `select-hid-device` event) and then read from that storage with
9100      * `setDevicePermissionHandler`.
9101      */
9102     setDevicePermissionHandler(handler: ((details: DevicePermissionHandlerHandlerDetails) => boolean) | (null)): void;
9103     /**
9104      * This handler will be called when web content requests access to display media
9105      * via the `navigator.mediaDevices.getDisplayMedia` API. Use the desktopCapturer
9106      * API to choose which stream(s) to grant access to.
9107      *
9108      * Passing a WebFrameMain object as a video or audio stream will capture the video
9109      * or audio stream from that frame.
9110      *
9111      * Passing `null` instead of a function resets the handler to its default state.
9112      */
9113     setDisplayMediaRequestHandler(handler: ((request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: Streams) => void) => void) | (null)): void;
9114     /**
9115      * Sets download saving directory. By default, the download directory will be the
9116      * `Downloads` under the respective app folder.
9117      */
9118     setDownloadPath(path: string): void;
9119     /**
9120      * Sets the handler which can be used to respond to permission checks for the
9121      * `session`. Returning `true` will allow the permission and `false` will reject
9122      * it.  Please note that you must also implement `setPermissionRequestHandler` to
9123      * get complete permission handling. Most web APIs do a permission check and then
9124      * make a permission request if the check is denied. To clear the handler, call
9125      * `setPermissionCheckHandler(null)`.
9126      */
9127     setPermissionCheckHandler(handler: ((webContents: (WebContents) | (null), permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'geolocation' | 'fullscreen' | 'hid' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'openExternal' | 'pointerLock' | 'serial' | 'usb', requestingOrigin: string, details: PermissionCheckHandlerHandlerDetails) => boolean) | (null)): void;
9128     /**
9129      * Sets the handler which can be used to respond to permission requests for the
9130      * `session`. Calling `callback(true)` will allow the permission and
9131      * `callback(false)` will reject it. To clear the handler, call
9132      * `setPermissionRequestHandler(null)`.  Please note that you must also implement
9133      * `setPermissionCheckHandler` to get complete permission handling. Most web APIs
9134      * do a permission check and then make a permission request if the check is denied.
9135      */
9136     setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'display-capture' | 'fullscreen' | 'geolocation' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'pointerLock' | 'keyboardLock' | 'openExternal' | 'window-management' | 'unknown', callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerHandlerDetails) => void) | (null)): void;
9137     /**
9138      * Adds scripts that will be executed on ALL web contents that are associated with
9139      * this session just before normal `preload` scripts run.
9140      */
9141     setPreloads(preloads: string[]): void;
9142     /**
9143      * Resolves when the proxy setting process is complete.
9144      *
9145      * Sets the proxy settings.
9146      *
9147      * When `mode` is unspecified, `pacScript` and `proxyRules` are provided together,
9148      * the `proxyRules` option is ignored and `pacScript` configuration is applied.
9149      *
9150      * You may need `ses.closeAllConnections` to close currently in flight connections
9151      * to prevent pooled sockets using previous proxy from being reused by future
9152      * requests.
9153      *
9154      * The `proxyRules` has to follow the rules below:
9155      *
9156      * For example:
9157      *
9158      * * `http=foopy:80;ftp=foopy2` - Use HTTP proxy `foopy:80` for `http://` URLs, and
9159      * HTTP proxy `foopy2:80` for `ftp://` URLs.
9160      * * `foopy:80` - Use HTTP proxy `foopy:80` for all URLs.
9161      * * `foopy:80,bar,direct://` - Use HTTP proxy `foopy:80` for all URLs, failing
9162      * over to `bar` if `foopy:80` is unavailable, and after that using no proxy.
9163      * * `socks4://foopy` - Use SOCKS v4 proxy `foopy:1080` for all URLs.
9164      * * `http=foopy,socks5://bar.com` - Use HTTP proxy `foopy` for http URLs, and fail
9165      * over to the SOCKS5 proxy `bar.com` if `foopy` is unavailable.
9166      * * `http=foopy,direct://` - Use HTTP proxy `foopy` for http URLs, and use no
9167      * proxy if `foopy` is unavailable.
9168      * * `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use
9169      * `socks4://foopy2` for all other URLs.
9170      *
9171      * The `proxyBypassRules` is a comma separated list of rules described below:
9172      *
9173      * * `[ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" <port> ]`
9174      *
9175      * Match all hostnames that match the pattern HOSTNAME_PATTERN.
9176      *
9177      * Examples: "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99",
9178      * "https://x.*.y.com:99"
9179      * * `"." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]`
9180      *
9181      * Match a particular domain suffix.
9182      *
9183      * Examples: ".google.com", ".com", "http://.google.com"
9184      * * `[ SCHEME "://" ] IP_LITERAL [ ":" PORT ]`
9185      *
9186      * Match URLs which are IP address literals.
9187      *
9188      * Examples: "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
9189      * * `IP_LITERAL "/" PREFIX_LENGTH_IN_BITS`
9190      *
9191      * Match any URL that is to an IP literal that falls between the given range. IP
9192      * range is specified using CIDR notation.
9193      *
9194      * Examples: "192.168.1.1/16", "fefe:13::abc/33".
9195      * * `<local>`
9196      *
9197      * Match local addresses. The meaning of `<local>` is whether the host matches one
9198      * of: "127.0.0.1", "::1", "localhost".
9199      */
9200     setProxy(config: Config): Promise<void>;
9201     /**
9202      * By default Electron will download hunspell dictionaries from the Chromium CDN.
9203      * If you want to override this behavior you can use this API to point the
9204      * dictionary downloader at your own hosted version of the hunspell dictionaries.
9205      * We publish a `hunspell_dictionaries.zip` file with each release which contains
9206      * the files you need to host here.
9207      *
9208      * The file server must be **case insensitive**. If you cannot do this, you must
9209      * upload each file twice: once with the case it has in the ZIP file and once with
9210      * the filename as all lowercase.
9211      *
9212      * If the files present in `hunspell_dictionaries.zip` are available at
9213      * `https://example.com/dictionaries/language-code.bdic` then you should call this
9214      * api with
9215      * `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`.
9216      *  Please note the trailing slash.  The URL to the dictionaries is formed as
9217      * `${url}${filename}`.
9218      *
9219      * **Note:** On macOS the OS spellchecker is used and therefore we do not download
9220      * any dictionary files.  This API is a no-op on macOS.
9221      */
9222     setSpellCheckerDictionaryDownloadURL(url: string): void;
9223     /**
9224      * Sets whether to enable the builtin spell checker.
9225      */
9226     setSpellCheckerEnabled(enable: boolean): void;
9227     /**
9228      * The built in spellchecker does not automatically detect what language a user is
9229      * typing in.  In order for the spell checker to correctly check their words you
9230      * must call this API with an array of language codes.  You can get the list of
9231      * supported language codes with the `ses.availableSpellCheckerLanguages` property.
9232      *
9233      * **Note:** On macOS the OS spellchecker is used and will detect your language
9234      * automatically.  This API is a no-op on macOS.
9235      */
9236     setSpellCheckerLanguages(languages: string[]): void;
9237     /**
9238      * Sets the SSL configuration for the session. All subsequent network requests will
9239      * use the new configuration. Existing network connections (such as WebSocket
9240      * connections) will not be terminated, but old sockets in the pool will not be
9241      * reused for new connections.
9242      */
9243     setSSLConfig(config: SSLConfigConfig): void;
9244     /**
9245      * Sets the handler which can be used to override which USB classes are protected.
9246      * The return value for the handler is a string array of USB classes which should
9247      * be considered protected (eg not available in the renderer).  Valid values for
9248      * the array are:
9249      *
9250      * * `audio`
9251      * * `audio-video`
9252      * * `hid`
9253      * * `mass-storage`
9254      * * `smart-card`
9255      * * `video`
9256      * * `wireless`
9257      *
9258      * Returning an empty string array from the handler will allow all USB classes;
9259      * returning the passed in array will maintain the default list of protected USB
9260      * classes (this is also the default behavior if a handler is not defined). To
9261      * clear the handler, call `setUSBProtectedClassesHandler(null)`.
9262      */
9263     setUSBProtectedClassesHandler(handler: ((details: USBProtectedClassesHandlerHandlerDetails) => string[]) | (null)): void;
9264     /**
9265      * Overrides the `userAgent` and `acceptLanguages` for this session.
9266      *
9267      * The `acceptLanguages` must a comma separated ordered list of language codes, for
9268      * example `"en-US,fr,de,ko,zh-CN,ja"`.
9269      *
9270      * This doesn't affect existing `WebContents`, and each `WebContents` can use
9271      * `webContents.setUserAgent` to override the session-wide user agent.
9272      */
9273     setUserAgent(userAgent: string, acceptLanguages?: string): void;
9274     /**
9275      * A `string[]` array which consists of all the known available spell checker
9276      * languages.  Providing a language code to the `setSpellCheckerLanguages` API that
9277      * isn't in this array will result in an error.
9278      *
9279      */
9280     readonly availableSpellCheckerLanguages: string[];
9281     /**
9282      * A `Cookies` object for this session.
9283      *
9284      */
9285     readonly cookies: Cookies;
9286     /**
9287      * A `NetLog` object for this session.
9288      *
9289      */
9290     readonly netLog: NetLog;
9291     /**
9292      * A `Protocol` object for this session.
9293      *
9294      */
9295     readonly protocol: Protocol;
9296     /**
9297      * A `ServiceWorkers` object for this session.
9298      *
9299      */
9300     readonly serviceWorkers: ServiceWorkers;
9301     /**
9302      * A `boolean` indicating whether builtin spell checker is enabled.
9303      */
9304     spellCheckerEnabled: boolean;
9305     /**
9306      * A `string | null` indicating the absolute file system path where data for this
9307      * session is persisted on disk.  For in memory sessions this returns `null`.
9308      *
9309      */
9310     readonly storagePath: (string) | (null);
9311     /**
9312      * A `WebRequest` object for this session.
9313      *
9314      */
9315     readonly webRequest: WebRequest;
9316   }
9317
9318   interface SharedWorkerInfo {
9319
9320     // Docs: https://electronjs.org/docs/api/structures/shared-worker-info
9321
9322     /**
9323      * The unique id of the shared worker.
9324      */
9325     id: string;
9326     /**
9327      * The url of the shared worker.
9328      */
9329     url: string;
9330   }
9331
9332   class ShareMenu extends NodeEventEmitter {
9333
9334     // Docs: https://electronjs.org/docs/api/share-menu
9335
9336     /**
9337      * ShareMenu
9338      */
9339     constructor(sharingItem: SharingItem);
9340     /**
9341      * Closes the context menu in the `browserWindow`.
9342      */
9343     closePopup(browserWindow?: BrowserWindow): void;
9344     /**
9345      * Pops up this menu as a context menu in the `BrowserWindow`.
9346      */
9347     popup(options?: PopupOptions): void;
9348   }
9349
9350   interface SharingItem {
9351
9352     // Docs: https://electronjs.org/docs/api/structures/sharing-item
9353
9354     /**
9355      * An array of files to share.
9356      */
9357     filePaths?: string[];
9358     /**
9359      * An array of text to share.
9360      */
9361     texts?: string[];
9362     /**
9363      * An array of URLs to share.
9364      */
9365     urls?: string[];
9366   }
9367
9368   interface Shell {
9369
9370     // Docs: https://electronjs.org/docs/api/shell
9371
9372     /**
9373      * Play the beep sound.
9374      */
9375     beep(): void;
9376     /**
9377      * Open the given external protocol URL in the desktop's default manner. (For
9378      * example, mailto: URLs in the user's default mail agent).
9379      */
9380     openExternal(url: string, options?: OpenExternalOptions): Promise<void>;
9381     /**
9382      * Resolves with a string containing the error message corresponding to the failure
9383      * if a failure occurred, otherwise "".
9384      *
9385      * Open the given file in the desktop's default manner.
9386      */
9387     openPath(path: string): Promise<string>;
9388     /**
9389      * Resolves the shortcut link at `shortcutPath`.
9390      *
9391      * An exception will be thrown when any error happens.
9392      *
9393      * @platform win32
9394      */
9395     readShortcutLink(shortcutPath: string): ShortcutDetails;
9396     /**
9397      * Show the given file in a file manager. If possible, select the file.
9398      */
9399     showItemInFolder(fullPath: string): void;
9400     /**
9401      * Resolves when the operation has been completed. Rejects if there was an error
9402      * while deleting the requested item.
9403      *
9404      * This moves a path to the OS-specific trash location (Trash on macOS, Recycle Bin
9405      * on Windows, and a desktop-environment-specific location on Linux).
9406      */
9407     trashItem(path: string): Promise<void>;
9408     /**
9409      * Whether the shortcut was created successfully.
9410      *
9411      * Creates or updates a shortcut link at `shortcutPath`.
9412      *
9413      * @platform win32
9414      */
9415     writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutDetails): boolean;
9416     /**
9417      * Whether the shortcut was created successfully.
9418      *
9419      * Creates or updates a shortcut link at `shortcutPath`.
9420      *
9421      * @platform win32
9422      */
9423     writeShortcutLink(shortcutPath: string, options: ShortcutDetails): boolean;
9424   }
9425
9426   interface ShortcutDetails {
9427
9428     // Docs: https://electronjs.org/docs/api/structures/shortcut-details
9429
9430     /**
9431      * The Application User Model ID. Default is empty.
9432      */
9433     appUserModelId?: string;
9434     /**
9435      * The arguments to be applied to `target` when launching from this shortcut.
9436      * Default is empty.
9437      */
9438     args?: string;
9439     /**
9440      * The working directory. Default is empty.
9441      */
9442     cwd?: string;
9443     /**
9444      * The description of the shortcut. Default is empty.
9445      */
9446     description?: string;
9447     /**
9448      * The path to the icon, can be a DLL or EXE. `icon` and `iconIndex` have to be set
9449      * together. Default is empty, which uses the target's icon.
9450      */
9451     icon?: string;
9452     /**
9453      * The resource ID of icon when `icon` is a DLL or EXE. Default is 0.
9454      */
9455     iconIndex?: number;
9456     /**
9457      * The target to launch from this shortcut.
9458      */
9459     target: string;
9460     /**
9461      * The Application Toast Activator CLSID. Needed for participating in Action
9462      * Center.
9463      */
9464     toastActivatorClsid?: string;
9465   }
9466
9467   interface Size {
9468
9469     // Docs: https://electronjs.org/docs/api/structures/size
9470
9471     height: number;
9472     width: number;
9473   }
9474
9475   interface SystemPreferences extends NodeJS.EventEmitter {
9476
9477     // Docs: https://electronjs.org/docs/api/system-preferences
9478
9479     /**
9480      * @platform win32
9481      */
9482     on(event: 'accent-color-changed', listener: (event: Event,
9483                                                  /**
9484                                                   * The new RGBA color the user assigned to be their system accent color.
9485                                                   */
9486                                                  newColor: string) => void): this;
9487     off(event: 'accent-color-changed', listener: (event: Event,
9488                                                  /**
9489                                                   * The new RGBA color the user assigned to be their system accent color.
9490                                                   */
9491                                                  newColor: string) => void): this;
9492     once(event: 'accent-color-changed', listener: (event: Event,
9493                                                  /**
9494                                                   * The new RGBA color the user assigned to be their system accent color.
9495                                                   */
9496                                                  newColor: string) => void): this;
9497     addListener(event: 'accent-color-changed', listener: (event: Event,
9498                                                  /**
9499                                                   * The new RGBA color the user assigned to be their system accent color.
9500                                                   */
9501                                                  newColor: string) => void): this;
9502     removeListener(event: 'accent-color-changed', listener: (event: Event,
9503                                                  /**
9504                                                   * The new RGBA color the user assigned to be their system accent color.
9505                                                   */
9506                                                  newColor: string) => void): this;
9507     /**
9508      * @platform win32
9509      */
9510     on(event: 'color-changed', listener: (event: Event) => void): this;
9511     off(event: 'color-changed', listener: (event: Event) => void): this;
9512     once(event: 'color-changed', listener: (event: Event) => void): this;
9513     addListener(event: 'color-changed', listener: (event: Event) => void): this;
9514     removeListener(event: 'color-changed', listener: (event: Event) => void): this;
9515     /**
9516      * A promise that resolves with `true` if consent was granted and `false` if it was
9517      * denied. If an invalid `mediaType` is passed, the promise will be rejected. If an
9518      * access request was denied and later is changed through the System Preferences
9519      * pane, a restart of the app will be required for the new permissions to take
9520      * effect. If access has already been requested and denied, it _must_ be changed
9521      * through the preference pane; an alert will not pop up and the promise will
9522      * resolve with the existing access status.
9523      *
9524      * **Important:** In order to properly leverage this API, you must set the
9525      * `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your
9526      * app's `Info.plist` file. The values for these keys will be used to populate the
9527      * permission dialogs so that the user will be properly informed as to the purpose
9528      * of the permission request. See Electron Application Distribution for more
9529      * information about how to set these in the context of Electron.
9530      *
9531      * This user consent was not required until macOS 10.14 Mojave, so this method will
9532      * always return `true` if your system is running 10.13 High Sierra.
9533      *
9534      * @platform darwin
9535      */
9536     askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise<boolean>;
9537     /**
9538      * whether or not this device has the ability to use Touch ID.
9539      *
9540      * @platform darwin
9541      */
9542     canPromptTouchID(): boolean;
9543     /**
9544      * The users current system wide accent color preference in RGBA hexadecimal form.
9545      *
9546      * This API is only available on macOS 10.14 Mojave or newer.
9547      *
9548      * @platform win32,darwin
9549      */
9550     getAccentColor(): string;
9551     /**
9552      * * `shouldRenderRichAnimation` boolean - Returns true if rich animations should
9553      * be rendered. Looks at session type (e.g. remote desktop) and accessibility
9554      * settings to give guidance for heavy animations.
9555      * * `scrollAnimationsEnabledBySystem` boolean - Determines on a per-platform basis
9556      * whether scroll animations (e.g. produced by home/end key) should be enabled.
9557      * * `prefersReducedMotion` boolean - Determines whether the user desires reduced
9558      * motion based on platform APIs.
9559      *
9560      * Returns an object with system animation settings.
9561      */
9562     getAnimationSettings(): AnimationSettings;
9563     /**
9564      * The system color setting in RGBA hexadecimal form (`#RRGGBBAA`). See the Windows
9565      * docs and the macOS docs for more details.
9566      *
9567      * The following colors are only available on macOS 10.14: `find-highlight`,
9568      * `selected-content-background`, `separator`,
9569      * `unemphasized-selected-content-background`,
9570      * `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
9571      *
9572      * @platform win32,darwin
9573      */
9574     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;
9575     /**
9576      * Can be `dark`, `light` or `unknown`.
9577      *
9578      * Gets the macOS appearance setting that is currently applied to your application,
9579      * maps to NSApplication.effectiveAppearance
9580      *
9581      * @platform darwin
9582      */
9583     getEffectiveAppearance(): ('dark' | 'light' | 'unknown');
9584     /**
9585      * Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
9586      *
9587      * This user consent was not required on macOS 10.13 High Sierra so this method
9588      * will always return `granted`. macOS 10.14 Mojave or higher requires consent for
9589      * `microphone` and `camera` access. macOS 10.15 Catalina or higher requires
9590      * consent for `screen` access.
9591      *
9592      * Windows 10 has a global setting controlling `microphone` and `camera` access for
9593      * all win32 applications. It will always return `granted` for `screen` and for all
9594      * media types on older versions of Windows.
9595      *
9596      * @platform win32,darwin
9597      */
9598     getMediaAccessStatus(mediaType: 'microphone' | 'camera' | 'screen'): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown');
9599     /**
9600      * The standard system color formatted as `#RRGGBBAA`.
9601      *
9602      * Returns one of several standard system colors that automatically adapt to
9603      * vibrancy and changes in accessibility settings like 'Increase contrast' and
9604      * 'Reduce transparency'. See Apple Documentation for  more details.
9605      *
9606      * @platform darwin
9607      */
9608     getSystemColor(color: 'blue' | 'brown' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow'): string;
9609     /**
9610      * The value of `key` in `NSUserDefaults`.
9611      *
9612      * Some popular `key` and `type`s are:
9613      *
9614      * * `AppleInterfaceStyle`: `string`
9615      * * `AppleAquaColorVariant`: `integer`
9616      * * `AppleHighlightColor`: `string`
9617      * * `AppleShowScrollBars`: `string`
9618      * * `NSNavRecentPlaces`: `array`
9619      * * `NSPreferredWebServices`: `dictionary`
9620      * * `NSUserDictionaryReplacementItems`: `array`
9621      *
9622      * @platform darwin
9623      */
9624     getUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type): UserDefaultTypes[Type];
9625     /**
9626      * `true` if DWM composition (Aero Glass) is enabled, and `false` otherwise.
9627      *
9628      * An example of using it to determine if you should create a transparent window or
9629      * not (transparent windows won't work correctly when DWM composition is disabled):
9630      *
9631      * @platform win32
9632      */
9633     isAeroGlassEnabled(): boolean;
9634     /**
9635      * Whether the Swipe between pages setting is on.
9636      *
9637      * @platform darwin
9638      */
9639     isSwipeTrackingFromScrollEventsEnabled(): boolean;
9640     /**
9641      * `true` if the current process is a trusted accessibility client and `false` if
9642      * it is not.
9643      *
9644      * @platform darwin
9645      */
9646     isTrustedAccessibilityClient(prompt: boolean): boolean;
9647     /**
9648      * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
9649      * contains the user information dictionary sent along with the notification.
9650      *
9651      * @platform darwin
9652      */
9653     postLocalNotification(event: string, userInfo: Record<string, any>): void;
9654     /**
9655      * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
9656      * contains the user information dictionary sent along with the notification.
9657      *
9658      * @platform darwin
9659      */
9660     postNotification(event: string, userInfo: Record<string, any>, deliverImmediately?: boolean): void;
9661     /**
9662      * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
9663      * contains the user information dictionary sent along with the notification.
9664      *
9665      * @platform darwin
9666      */
9667     postWorkspaceNotification(event: string, userInfo: Record<string, any>): void;
9668     /**
9669      * resolves if the user has successfully authenticated with Touch ID.
9670      *
9671      * This API itself will not protect your user data; rather, it is a mechanism to
9672      * allow you to do so. Native apps will need to set Access Control Constants like
9673      * `kSecAccessControlUserPresence` on their keychain entry so that reading it would
9674      * auto-prompt for Touch ID biometric consent. This could be done with
9675      * `node-keytar`, such that one would store an encryption key with `node-keytar`
9676      * and only fetch it if `promptTouchID()` resolves.
9677      *
9678      * @platform darwin
9679      */
9680     promptTouchID(reason: string): Promise<void>;
9681     /**
9682      * Add the specified defaults to your application's `NSUserDefaults`.
9683      *
9684      * @platform darwin
9685      */
9686     registerDefaults(defaults: Record<string, (string) | (boolean) | (number)>): void;
9687     /**
9688      * Removes the `key` in `NSUserDefaults`. This can be used to restore the default
9689      * or global value of a `key` previously set with `setUserDefault`.
9690      *
9691      * @platform darwin
9692      */
9693     removeUserDefault(key: string): void;
9694     /**
9695      * Set the value of `key` in `NSUserDefaults`.
9696      *
9697      * Note that `type` should match actual type of `value`. An exception is thrown if
9698      * they don't.
9699      *
9700      * Some popular `key` and `type`s are:
9701      *
9702      * * `ApplePressAndHoldEnabled`: `boolean`
9703      *
9704      * @platform darwin
9705      */
9706     setUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type, value: UserDefaultTypes[Type]): void;
9707     /**
9708      * The ID of this subscription
9709      *
9710      * Same as `subscribeNotification`, but uses `NSNotificationCenter` for local
9711      * defaults. This is necessary for events such as
9712      * `NSUserDefaultsDidChangeNotification`.
9713      *
9714      * If `event` is null, the `NSNotificationCenter` doesn’t use it as criteria for
9715      * delivery to the observer. See docs for more information.
9716      *
9717      * @platform darwin
9718      */
9719     subscribeLocalNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
9720     /**
9721      * The ID of this subscription
9722      *
9723      * Subscribes to native notifications of macOS, `callback` will be called with
9724      * `callback(event, userInfo)` when the corresponding `event` happens. The
9725      * `userInfo` is an Object that contains the user information dictionary sent along
9726      * with the notification. The `object` is the sender of the notification, and only
9727      * supports `NSString` values for now.
9728      *
9729      * The `id` of the subscriber is returned, which can be used to unsubscribe the
9730      * `event`.
9731      *
9732      * Under the hood this API subscribes to `NSDistributedNotificationCenter`, example
9733      * values of `event` are:
9734      *
9735      * * `AppleInterfaceThemeChangedNotification`
9736      * * `AppleAquaColorVariantChanged`
9737      * * `AppleColorPreferencesChangedNotification`
9738      * * `AppleShowScrollBarsSettingChanged`
9739      *
9740      * If `event` is null, the `NSDistributedNotificationCenter` doesn’t use it as
9741      * criteria for delivery to the observer. See docs  for more information.
9742      *
9743      * @platform darwin
9744      */
9745     subscribeNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
9746     /**
9747      * The ID of this subscription
9748      *
9749      * Same as `subscribeNotification`, but uses
9750      * `NSWorkspace.sharedWorkspace.notificationCenter`. This is necessary for events
9751      * such as `NSWorkspaceDidActivateApplicationNotification`.
9752      *
9753      * If `event` is null, the `NSWorkspaceNotificationCenter` doesn’t use it as
9754      * criteria for delivery to the observer. See docs for more information.
9755      *
9756      * @platform darwin
9757      */
9758     subscribeWorkspaceNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
9759     /**
9760      * Same as `unsubscribeNotification`, but removes the subscriber from
9761      * `NSNotificationCenter`.
9762      *
9763      * @platform darwin
9764      */
9765     unsubscribeLocalNotification(id: number): void;
9766     /**
9767      * Removes the subscriber with `id`.
9768      *
9769      * @platform darwin
9770      */
9771     unsubscribeNotification(id: number): void;
9772     /**
9773      * Same as `unsubscribeNotification`, but removes the subscriber from
9774      * `NSWorkspace.sharedWorkspace.notificationCenter`.
9775      *
9776      * @platform darwin
9777      */
9778     unsubscribeWorkspaceNotification(id: number): void;
9779     /**
9780      * A `boolean` property which determines whether the app avoids using
9781      * semitransparent backgrounds. This maps to
9782      * NSWorkspace.accessibilityDisplayShouldReduceTransparency
9783      *
9784      * @platform darwin
9785      */
9786     accessibilityDisplayShouldReduceTransparency(): boolean;
9787     /**
9788      * A `string` property that can be `dark`, `light` or `unknown`.
9789      *
9790      * Returns the macOS appearance setting that is currently applied to your
9791      * application, maps to NSApplication.effectiveAppearance
9792      *
9793      * @platform darwin
9794      */
9795     readonly effectiveAppearance: ('dark' | 'light' | 'unknown');
9796   }
9797
9798   interface Task {
9799
9800     // Docs: https://electronjs.org/docs/api/structures/task
9801
9802     /**
9803      * The command line arguments when `program` is executed.
9804      */
9805     arguments: string;
9806     /**
9807      * Description of this task.
9808      */
9809     description: string;
9810     /**
9811      * The icon index in the icon file. If an icon file consists of two or more icons,
9812      * set this value to identify the icon. If an icon file consists of one icon, this
9813      * value is 0.
9814      */
9815     iconIndex: number;
9816     /**
9817      * The absolute path to an icon to be displayed in a JumpList, which can be an
9818      * arbitrary resource file that contains an icon. You can usually specify
9819      * `process.execPath` to show the icon of the program.
9820      */
9821     iconPath: string;
9822     /**
9823      * Path of the program to execute, usually you should specify `process.execPath`
9824      * which opens the current program.
9825      */
9826     program: string;
9827     /**
9828      * The string to be displayed in a JumpList.
9829      */
9830     title: string;
9831     /**
9832      * The working directory. Default is empty.
9833      */
9834     workingDirectory?: string;
9835   }
9836
9837   interface ThumbarButton {
9838
9839     // Docs: https://electronjs.org/docs/api/structures/thumbar-button
9840
9841     click: () => void;
9842     /**
9843      * Control specific states and behaviors of the button. By default, it is
9844      * `['enabled']`.
9845      */
9846     flags?: string[];
9847     /**
9848      * The icon showing in thumbnail toolbar.
9849      */
9850     icon: NativeImage;
9851     /**
9852      * The text of the button's tooltip.
9853      */
9854     tooltip?: string;
9855   }
9856
9857   class TouchBar {
9858
9859     // Docs: https://electronjs.org/docs/api/touch-bar
9860
9861     /**
9862      * TouchBar
9863      */
9864     constructor(options: TouchBarConstructorOptions);
9865     /**
9866      * A `TouchBarItem` that will replace the "esc" button on the touch bar when set.
9867      * Setting to `null` restores the default "esc" button. Changing this value
9868      * immediately updates the escape item in the touch bar.
9869      */
9870     escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null);
9871     /**
9872      * A `typeof TouchBarButton` reference to the `TouchBarButton` class.
9873      */
9874     static TouchBarButton: typeof TouchBarButton;
9875     /**
9876      * A `typeof TouchBarColorPicker` reference to the `TouchBarColorPicker` class.
9877      */
9878     static TouchBarColorPicker: typeof TouchBarColorPicker;
9879     /**
9880      * A `typeof TouchBarGroup` reference to the `TouchBarGroup` class.
9881      */
9882     static TouchBarGroup: typeof TouchBarGroup;
9883     /**
9884      * A `typeof TouchBarLabel` reference to the `TouchBarLabel` class.
9885      */
9886     static TouchBarLabel: typeof TouchBarLabel;
9887     /**
9888      * A `typeof TouchBarOtherItemsProxy` reference to the `TouchBarOtherItemsProxy`
9889      * class.
9890      */
9891     static TouchBarOtherItemsProxy: typeof TouchBarOtherItemsProxy;
9892     /**
9893      * A `typeof TouchBarPopover` reference to the `TouchBarPopover` class.
9894      */
9895     static TouchBarPopover: typeof TouchBarPopover;
9896     /**
9897      * A `typeof TouchBarScrubber` reference to the `TouchBarScrubber` class.
9898      */
9899     static TouchBarScrubber: typeof TouchBarScrubber;
9900     /**
9901      * A `typeof TouchBarSegmentedControl` reference to the `TouchBarSegmentedControl`
9902      * class.
9903      */
9904     static TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
9905     /**
9906      * A `typeof TouchBarSlider` reference to the `TouchBarSlider` class.
9907      */
9908     static TouchBarSlider: typeof TouchBarSlider;
9909     /**
9910      * A `typeof TouchBarSpacer` reference to the `TouchBarSpacer` class.
9911      */
9912     static TouchBarSpacer: typeof TouchBarSpacer;
9913   }
9914
9915   class TouchBarButton {
9916
9917     // Docs: https://electronjs.org/docs/api/touch-bar-button
9918
9919     /**
9920      * TouchBarButton
9921      */
9922     constructor(options: TouchBarButtonConstructorOptions);
9923     /**
9924      * A `string` representing the description of the button to be read by a screen
9925      * reader. Will only be read by screen readers if no label is set.
9926      */
9927     accessibilityLabel: string;
9928     /**
9929      * A `string` hex code representing the button's current background color. Changing
9930      * this value immediately updates the button in the touch bar.
9931      */
9932     backgroundColor: string;
9933     /**
9934      * A `boolean` representing whether the button is in an enabled state.
9935      */
9936     enabled: boolean;
9937     /**
9938      * A `NativeImage` representing the button's current icon. Changing this value
9939      * immediately updates the button in the touch bar.
9940      */
9941     icon: NativeImage;
9942     /**
9943      * A `string` - Can be `left`, `right` or `overlay`.  Defaults to `overlay`.
9944      */
9945     iconPosition: ('left' | 'right' | 'overlay');
9946     /**
9947      * A `string` representing the button's current text. Changing this value
9948      * immediately updates the button in the touch bar.
9949      */
9950     label: string;
9951   }
9952
9953   class TouchBarColorPicker extends NodeEventEmitter {
9954
9955     // Docs: https://electronjs.org/docs/api/touch-bar-color-picker
9956
9957     /**
9958      * TouchBarColorPicker
9959      */
9960     constructor(options: TouchBarColorPickerConstructorOptions);
9961     /**
9962      * A `string[]` array representing the color picker's available colors to select.
9963      * Changing this value immediately updates the color picker in the touch bar.
9964      */
9965     availableColors: string[];
9966     /**
9967      * A `string` hex code representing the color picker's currently selected color.
9968      * Changing this value immediately updates the color picker in the touch bar.
9969      */
9970     selectedColor: string;
9971   }
9972
9973   class TouchBarGroup extends NodeEventEmitter {
9974
9975     // Docs: https://electronjs.org/docs/api/touch-bar-group
9976
9977     /**
9978      * TouchBarGroup
9979      */
9980     constructor(options: TouchBarGroupConstructorOptions);
9981   }
9982
9983   class TouchBarLabel extends NodeEventEmitter {
9984
9985     // Docs: https://electronjs.org/docs/api/touch-bar-label
9986
9987     /**
9988      * TouchBarLabel
9989      */
9990     constructor(options: TouchBarLabelConstructorOptions);
9991     /**
9992      * A `string` representing the description of the label to be read by a screen
9993      * reader.
9994      */
9995     accessibilityLabel: string;
9996     /**
9997      * A `string` representing the label's current text. Changing this value
9998      * immediately updates the label in the touch bar.
9999      */
10000     label: string;
10001     /**
10002      * A `string` hex code representing the label's current text color. Changing this
10003      * value immediately updates the label in the touch bar.
10004      */
10005     textColor: string;
10006   }
10007
10008   class TouchBarOtherItemsProxy extends NodeEventEmitter {
10009
10010     // Docs: https://electronjs.org/docs/api/touch-bar-other-items-proxy
10011
10012     /**
10013      * TouchBarOtherItemsProxy
10014      */
10015     constructor();
10016   }
10017
10018   class TouchBarPopover extends NodeEventEmitter {
10019
10020     // Docs: https://electronjs.org/docs/api/touch-bar-popover
10021
10022     /**
10023      * TouchBarPopover
10024      */
10025     constructor(options: TouchBarPopoverConstructorOptions);
10026     /**
10027      * A `NativeImage` representing the popover's current button icon. Changing this
10028      * value immediately updates the popover in the touch bar.
10029      */
10030     icon: NativeImage;
10031     /**
10032      * A `string` representing the popover's current button text. Changing this value
10033      * immediately updates the popover in the touch bar.
10034      */
10035     label: string;
10036   }
10037
10038   class TouchBarScrubber extends NodeEventEmitter {
10039
10040     // Docs: https://electronjs.org/docs/api/touch-bar-scrubber
10041
10042     /**
10043      * TouchBarScrubber
10044      */
10045     constructor(options: TouchBarScrubberConstructorOptions);
10046     /**
10047      * A `boolean` representing whether this scrubber is continuous or not. Updating
10048      * this value immediately updates the control in the touch bar.
10049      */
10050     continuous: boolean;
10051     /**
10052      * A `ScrubberItem[]` array representing the items in this scrubber. Updating this
10053      * value immediately updates the control in the touch bar. Updating deep properties
10054      * inside this array **does not update the touch bar**.
10055      */
10056     items: ScrubberItem[];
10057     /**
10058      * A `string` representing the mode of this scrubber. Updating this value
10059      * immediately updates the control in the touch bar. Possible values:
10060      *
10061      * * `fixed` - Maps to `NSScrubberModeFixed`.
10062      * * `free` - Maps to `NSScrubberModeFree`.
10063      */
10064     mode: ('fixed' | 'free');
10065     /**
10066      * A `string` representing the style that selected items in the scrubber should
10067      * have. This style is overlayed on top of the scrubber item instead of being
10068      * placed behind it. Updating this value immediately updates the control in the
10069      * touch bar. Possible values:
10070      *
10071      * * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
10072      * * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
10073      * * `none` - Removes all styles.
10074      */
10075     overlayStyle: ('background' | 'outline' | 'none');
10076     /**
10077      * A `string` representing the style that selected items in the scrubber should
10078      * have. Updating this value immediately updates the control in the touch bar.
10079      * Possible values:
10080      *
10081      * * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
10082      * * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
10083      * * `none` - Removes all styles.
10084      */
10085     selectedStyle: ('background' | 'outline' | 'none');
10086     /**
10087      * A `boolean` representing whether to show the left / right selection arrows in
10088      * this scrubber. Updating this value immediately updates the control in the touch
10089      * bar.
10090      */
10091     showArrowButtons: boolean;
10092   }
10093
10094   class TouchBarSegmentedControl extends NodeEventEmitter {
10095
10096     // Docs: https://electronjs.org/docs/api/touch-bar-segmented-control
10097
10098     /**
10099      * TouchBarSegmentedControl
10100      */
10101     constructor(options: TouchBarSegmentedControlConstructorOptions);
10102     /**
10103      * A `string` representing the current selection mode of the control.  Can be
10104      * `single`, `multiple` or `buttons`.
10105      */
10106     mode: ('single' | 'multiple' | 'buttons');
10107     /**
10108      * A `SegmentedControlSegment[]` array representing the segments in this control.
10109      * Updating this value immediately updates the control in the touch bar. Updating
10110      * deep properties inside this array **does not update the touch bar**.
10111      */
10112     segments: SegmentedControlSegment[];
10113     /**
10114      * A `string` representing the controls current segment style. Updating this value
10115      * immediately updates the control in the touch bar.
10116      */
10117     segmentStyle: string;
10118     /**
10119      * An `Integer` representing the currently selected segment. Changing this value
10120      * immediately updates the control in the touch bar. User interaction with the
10121      * touch bar will update this value automatically.
10122      */
10123     selectedIndex: number;
10124   }
10125
10126   class TouchBarSlider extends NodeEventEmitter {
10127
10128     // Docs: https://electronjs.org/docs/api/touch-bar-slider
10129
10130     /**
10131      * TouchBarSlider
10132      */
10133     constructor(options: TouchBarSliderConstructorOptions);
10134     /**
10135      * A `string` representing the slider's current text. Changing this value
10136      * immediately updates the slider in the touch bar.
10137      */
10138     label: string;
10139     /**
10140      * A `number` representing the slider's current maximum value. Changing this value
10141      * immediately updates the slider in the touch bar.
10142      */
10143     maxValue: number;
10144     /**
10145      * A `number` representing the slider's current minimum value. Changing this value
10146      * immediately updates the slider in the touch bar.
10147      */
10148     minValue: number;
10149     /**
10150      * A `number` representing the slider's current value. Changing this value
10151      * immediately updates the slider in the touch bar.
10152      */
10153     value: number;
10154   }
10155
10156   class TouchBarSpacer extends NodeEventEmitter {
10157
10158     // Docs: https://electronjs.org/docs/api/touch-bar-spacer
10159
10160     /**
10161      * TouchBarSpacer
10162      */
10163     constructor(options: TouchBarSpacerConstructorOptions);
10164     /**
10165      * A `string` representing the size of the spacer.  Can be `small`, `large` or
10166      * `flexible`.
10167      */
10168     size: ('small' | 'large' | 'flexible');
10169   }
10170
10171   interface TraceCategoriesAndOptions {
10172
10173     // Docs: https://electronjs.org/docs/api/structures/trace-categories-and-options
10174
10175     /**
10176      * A filter to control what category groups should be traced. A filter can have an
10177      * optional '-' prefix to exclude category groups that contain a matching category.
10178      * Having both included and excluded category patterns in the same list is not
10179      * supported. Examples: `test_MyTest*`, `test_MyTest*,test_OtherStuff`,
10180      * `-excluded_category1,-excluded_category2`.
10181      */
10182     categoryFilter: string;
10183     /**
10184      * Controls what kind of tracing is enabled, it is a comma-delimited sequence of
10185      * the following strings: `record-until-full`, `record-continuously`,
10186      * `trace-to-console`, `enable-sampling`, `enable-systrace`, e.g.
10187      * `'record-until-full,enable-sampling'`. The first 3 options are trace recording
10188      * modes and hence mutually exclusive. If more than one trace recording modes
10189      * appear in the `traceOptions` string, the last one takes precedence. If none of
10190      * the trace recording modes are specified, recording mode is `record-until-full`.
10191      * The trace option will first be reset to the default option (`record_mode` set to
10192      * `record-until-full`, `enable_sampling` and `enable_systrace` set to `false`)
10193      * before options parsed from `traceOptions` are applied on it.
10194      */
10195     traceOptions: string;
10196   }
10197
10198   interface TraceConfig {
10199
10200     // Docs: https://electronjs.org/docs/api/structures/trace-config
10201
10202     /**
10203      * if true, filter event data according to a specific list of events that have been
10204      * manually vetted to not include any PII. See the implementation in Chromium for
10205      * specifics.
10206      */
10207     enable_argument_filter?: boolean;
10208     /**
10209      * a list of tracing categories to exclude. Can include glob-like patterns using
10210      * `*` at the end of the category name. See tracing categories for the list of
10211      * categories.
10212      */
10213     excluded_categories?: string[];
10214     /**
10215      * a list of histogram names to report with the trace.
10216      */
10217     histogram_names?: string[];
10218     /**
10219      * a list of tracing categories to include. Can include glob-like patterns using
10220      * `*` at the end of the category name. See tracing categories for the list of
10221      * categories.
10222      */
10223     included_categories?: string[];
10224     /**
10225      * a list of process IDs to include in the trace. If not specified, trace all
10226      * processes.
10227      */
10228     included_process_ids?: number[];
10229     /**
10230      * if the `disabled-by-default-memory-infra` category is enabled, this contains
10231      * optional additional configuration for data collection. See the Chromium
10232      * memory-infra docs for more information.
10233      */
10234     memory_dump_config?: Record<string, any>;
10235     /**
10236      * Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible`
10237      * or `trace-to-console`. Defaults to `record-until-full`.
10238      */
10239     recording_mode?: ('record-until-full' | 'record-continuously' | 'record-as-much-as-possible' | 'trace-to-console');
10240     /**
10241      * maximum size of the trace recording buffer in events.
10242      */
10243     trace_buffer_size_in_events?: number;
10244     /**
10245      * maximum size of the trace recording buffer in kilobytes. Defaults to 100MB.
10246      */
10247     trace_buffer_size_in_kb?: number;
10248   }
10249
10250   interface Transaction {
10251
10252     // Docs: https://electronjs.org/docs/api/structures/transaction
10253
10254     /**
10255      * The error code if an error occurred while processing the transaction.
10256      */
10257     errorCode: number;
10258     /**
10259      * The error message if an error occurred while processing the transaction.
10260      */
10261     errorMessage: string;
10262     /**
10263      * The identifier of the restored transaction by the App Store.
10264      */
10265     originalTransactionIdentifier: string;
10266     payment: Payment;
10267     /**
10268      * The date the transaction was added to the App Store’s payment queue.
10269      */
10270     transactionDate: string;
10271     /**
10272      * A string that uniquely identifies a successful payment transaction.
10273      */
10274     transactionIdentifier: string;
10275     /**
10276      * The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or
10277      * `deferred`.
10278      */
10279     transactionState: ('purchasing' | 'purchased' | 'failed' | 'restored' | 'deferred');
10280   }
10281
10282   class Tray extends NodeEventEmitter {
10283
10284     // Docs: https://electronjs.org/docs/api/tray
10285
10286     /**
10287      * Emitted when the tray balloon is clicked.
10288      *
10289      * @platform win32
10290      */
10291     on(event: 'balloon-click', listener: Function): this;
10292     off(event: 'balloon-click', listener: Function): this;
10293     once(event: 'balloon-click', listener: Function): this;
10294     addListener(event: 'balloon-click', listener: Function): this;
10295     removeListener(event: 'balloon-click', listener: Function): this;
10296     /**
10297      * Emitted when the tray balloon is closed because of timeout or user manually
10298      * closes it.
10299      *
10300      * @platform win32
10301      */
10302     on(event: 'balloon-closed', listener: Function): this;
10303     off(event: 'balloon-closed', listener: Function): this;
10304     once(event: 'balloon-closed', listener: Function): this;
10305     addListener(event: 'balloon-closed', listener: Function): this;
10306     removeListener(event: 'balloon-closed', listener: Function): this;
10307     /**
10308      * Emitted when the tray balloon shows.
10309      *
10310      * @platform win32
10311      */
10312     on(event: 'balloon-show', listener: Function): this;
10313     off(event: 'balloon-show', listener: Function): this;
10314     once(event: 'balloon-show', listener: Function): this;
10315     addListener(event: 'balloon-show', listener: Function): this;
10316     removeListener(event: 'balloon-show', listener: Function): this;
10317     /**
10318      * Emitted when the tray icon is clicked.
10319      *
10320      * Note that on Linux this event is emitted when the tray icon receives an
10321      * activation, which might not necessarily be left mouse click.
10322      */
10323     on(event: 'click', listener: (event: KeyboardEvent,
10324                                   /**
10325                                    * The bounds of tray icon.
10326                                    */
10327                                   bounds: Rectangle,
10328                                   /**
10329                                    * The position of the event.
10330                                    */
10331                                   position: Point) => void): this;
10332     off(event: 'click', listener: (event: KeyboardEvent,
10333                                   /**
10334                                    * The bounds of tray icon.
10335                                    */
10336                                   bounds: Rectangle,
10337                                   /**
10338                                    * The position of the event.
10339                                    */
10340                                   position: Point) => void): this;
10341     once(event: 'click', listener: (event: KeyboardEvent,
10342                                   /**
10343                                    * The bounds of tray icon.
10344                                    */
10345                                   bounds: Rectangle,
10346                                   /**
10347                                    * The position of the event.
10348                                    */
10349                                   position: Point) => void): this;
10350     addListener(event: 'click', listener: (event: KeyboardEvent,
10351                                   /**
10352                                    * The bounds of tray icon.
10353                                    */
10354                                   bounds: Rectangle,
10355                                   /**
10356                                    * The position of the event.
10357                                    */
10358                                   position: Point) => void): this;
10359     removeListener(event: 'click', listener: (event: KeyboardEvent,
10360                                   /**
10361                                    * The bounds of tray icon.
10362                                    */
10363                                   bounds: Rectangle,
10364                                   /**
10365                                    * The position of the event.
10366                                    */
10367                                   position: Point) => void): this;
10368     /**
10369      * Emitted when the tray icon is double clicked.
10370      *
10371      * @platform darwin,win32
10372      */
10373     on(event: 'double-click', listener: (event: KeyboardEvent,
10374                                          /**
10375                                           * The bounds of tray icon.
10376                                           */
10377                                          bounds: Rectangle) => void): this;
10378     off(event: 'double-click', listener: (event: KeyboardEvent,
10379                                          /**
10380                                           * The bounds of tray icon.
10381                                           */
10382                                          bounds: Rectangle) => void): this;
10383     once(event: 'double-click', listener: (event: KeyboardEvent,
10384                                          /**
10385                                           * The bounds of tray icon.
10386                                           */
10387                                          bounds: Rectangle) => void): this;
10388     addListener(event: 'double-click', listener: (event: KeyboardEvent,
10389                                          /**
10390                                           * The bounds of tray icon.
10391                                           */
10392                                          bounds: Rectangle) => void): this;
10393     removeListener(event: 'double-click', listener: (event: KeyboardEvent,
10394                                          /**
10395                                           * The bounds of tray icon.
10396                                           */
10397                                          bounds: Rectangle) => void): this;
10398     /**
10399      * Emitted when a drag operation ends on the tray or ends at another location.
10400      *
10401      * @platform darwin
10402      */
10403     on(event: 'drag-end', listener: Function): this;
10404     off(event: 'drag-end', listener: Function): this;
10405     once(event: 'drag-end', listener: Function): this;
10406     addListener(event: 'drag-end', listener: Function): this;
10407     removeListener(event: 'drag-end', listener: Function): this;
10408     /**
10409      * Emitted when a drag operation enters the tray icon.
10410      *
10411      * @platform darwin
10412      */
10413     on(event: 'drag-enter', listener: Function): this;
10414     off(event: 'drag-enter', listener: Function): this;
10415     once(event: 'drag-enter', listener: Function): this;
10416     addListener(event: 'drag-enter', listener: Function): this;
10417     removeListener(event: 'drag-enter', listener: Function): this;
10418     /**
10419      * Emitted when a drag operation exits the tray icon.
10420      *
10421      * @platform darwin
10422      */
10423     on(event: 'drag-leave', listener: Function): this;
10424     off(event: 'drag-leave', listener: Function): this;
10425     once(event: 'drag-leave', listener: Function): this;
10426     addListener(event: 'drag-leave', listener: Function): this;
10427     removeListener(event: 'drag-leave', listener: Function): this;
10428     /**
10429      * Emitted when any dragged items are dropped on the tray icon.
10430      *
10431      * @platform darwin
10432      */
10433     on(event: 'drop', listener: Function): this;
10434     off(event: 'drop', listener: Function): this;
10435     once(event: 'drop', listener: Function): this;
10436     addListener(event: 'drop', listener: Function): this;
10437     removeListener(event: 'drop', listener: Function): this;
10438     /**
10439      * Emitted when dragged files are dropped in the tray icon.
10440      *
10441      * @platform darwin
10442      */
10443     on(event: 'drop-files', listener: (event: Event,
10444                                        /**
10445                                         * The paths of the dropped files.
10446                                         */
10447                                        files: string[]) => void): this;
10448     off(event: 'drop-files', listener: (event: Event,
10449                                        /**
10450                                         * The paths of the dropped files.
10451                                         */
10452                                        files: string[]) => void): this;
10453     once(event: 'drop-files', listener: (event: Event,
10454                                        /**
10455                                         * The paths of the dropped files.
10456                                         */
10457                                        files: string[]) => void): this;
10458     addListener(event: 'drop-files', listener: (event: Event,
10459                                        /**
10460                                         * The paths of the dropped files.
10461                                         */
10462                                        files: string[]) => void): this;
10463     removeListener(event: 'drop-files', listener: (event: Event,
10464                                        /**
10465                                         * The paths of the dropped files.
10466                                         */
10467                                        files: string[]) => void): this;
10468     /**
10469      * Emitted when dragged text is dropped in the tray icon.
10470      *
10471      * @platform darwin
10472      */
10473     on(event: 'drop-text', listener: (event: Event,
10474                                       /**
10475                                        * the dropped text string.
10476                                        */
10477                                       text: string) => void): this;
10478     off(event: 'drop-text', listener: (event: Event,
10479                                       /**
10480                                        * the dropped text string.
10481                                        */
10482                                       text: string) => void): this;
10483     once(event: 'drop-text', listener: (event: Event,
10484                                       /**
10485                                        * the dropped text string.
10486                                        */
10487                                       text: string) => void): this;
10488     addListener(event: 'drop-text', listener: (event: Event,
10489                                       /**
10490                                        * the dropped text string.
10491                                        */
10492                                       text: string) => void): this;
10493     removeListener(event: 'drop-text', listener: (event: Event,
10494                                       /**
10495                                        * the dropped text string.
10496                                        */
10497                                       text: string) => void): this;
10498     /**
10499      * Emitted when the tray icon is middle clicked.
10500      *
10501      * @platform win32
10502      */
10503     on(event: 'middle-click', listener: (event: KeyboardEvent,
10504                                          /**
10505                                           * The bounds of tray icon.
10506                                           */
10507                                          bounds: Rectangle) => void): this;
10508     off(event: 'middle-click', listener: (event: KeyboardEvent,
10509                                          /**
10510                                           * The bounds of tray icon.
10511                                           */
10512                                          bounds: Rectangle) => void): this;
10513     once(event: 'middle-click', listener: (event: KeyboardEvent,
10514                                          /**
10515                                           * The bounds of tray icon.
10516                                           */
10517                                          bounds: Rectangle) => void): this;
10518     addListener(event: 'middle-click', listener: (event: KeyboardEvent,
10519                                          /**
10520                                           * The bounds of tray icon.
10521                                           */
10522                                          bounds: Rectangle) => void): this;
10523     removeListener(event: 'middle-click', listener: (event: KeyboardEvent,
10524                                          /**
10525                                           * The bounds of tray icon.
10526                                           */
10527                                          bounds: Rectangle) => void): this;
10528     /**
10529      * Emitted when the mouse clicks the tray icon.
10530      *
10531      * @platform darwin
10532      */
10533     on(event: 'mouse-down', listener: (event: KeyboardEvent,
10534                                        /**
10535                                         * The position of the event.
10536                                         */
10537                                        position: Point) => void): this;
10538     off(event: 'mouse-down', listener: (event: KeyboardEvent,
10539                                        /**
10540                                         * The position of the event.
10541                                         */
10542                                        position: Point) => void): this;
10543     once(event: 'mouse-down', listener: (event: KeyboardEvent,
10544                                        /**
10545                                         * The position of the event.
10546                                         */
10547                                        position: Point) => void): this;
10548     addListener(event: 'mouse-down', listener: (event: KeyboardEvent,
10549                                        /**
10550                                         * The position of the event.
10551                                         */
10552                                        position: Point) => void): this;
10553     removeListener(event: 'mouse-down', listener: (event: KeyboardEvent,
10554                                        /**
10555                                         * The position of the event.
10556                                         */
10557                                        position: Point) => void): this;
10558     /**
10559      * Emitted when the mouse enters the tray icon.
10560      *
10561      * @platform darwin,win32
10562      */
10563     on(event: 'mouse-enter', listener: (event: KeyboardEvent,
10564                                         /**
10565                                          * The position of the event.
10566                                          */
10567                                         position: Point) => void): this;
10568     off(event: 'mouse-enter', listener: (event: KeyboardEvent,
10569                                         /**
10570                                          * The position of the event.
10571                                          */
10572                                         position: Point) => void): this;
10573     once(event: 'mouse-enter', listener: (event: KeyboardEvent,
10574                                         /**
10575                                          * The position of the event.
10576                                          */
10577                                         position: Point) => void): this;
10578     addListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
10579                                         /**
10580                                          * The position of the event.
10581                                          */
10582                                         position: Point) => void): this;
10583     removeListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
10584                                         /**
10585                                          * The position of the event.
10586                                          */
10587                                         position: Point) => void): this;
10588     /**
10589      * Emitted when the mouse exits the tray icon.
10590      *
10591      * @platform darwin,win32
10592      */
10593     on(event: 'mouse-leave', listener: (event: KeyboardEvent,
10594                                         /**
10595                                          * The position of the event.
10596                                          */
10597                                         position: Point) => void): this;
10598     off(event: 'mouse-leave', listener: (event: KeyboardEvent,
10599                                         /**
10600                                          * The position of the event.
10601                                          */
10602                                         position: Point) => void): this;
10603     once(event: 'mouse-leave', listener: (event: KeyboardEvent,
10604                                         /**
10605                                          * The position of the event.
10606                                          */
10607                                         position: Point) => void): this;
10608     addListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
10609                                         /**
10610                                          * The position of the event.
10611                                          */
10612                                         position: Point) => void): this;
10613     removeListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
10614                                         /**
10615                                          * The position of the event.
10616                                          */
10617                                         position: Point) => void): this;
10618     /**
10619      * Emitted when the mouse moves in the tray icon.
10620      *
10621      * @platform darwin,win32
10622      */
10623     on(event: 'mouse-move', listener: (event: KeyboardEvent,
10624                                        /**
10625                                         * The position of the event.
10626                                         */
10627                                        position: Point) => void): this;
10628     off(event: 'mouse-move', listener: (event: KeyboardEvent,
10629                                        /**
10630                                         * The position of the event.
10631                                         */
10632                                        position: Point) => void): this;
10633     once(event: 'mouse-move', listener: (event: KeyboardEvent,
10634                                        /**
10635                                         * The position of the event.
10636                                         */
10637                                        position: Point) => void): this;
10638     addListener(event: 'mouse-move', listener: (event: KeyboardEvent,
10639                                        /**
10640                                         * The position of the event.
10641                                         */
10642                                        position: Point) => void): this;
10643     removeListener(event: 'mouse-move', listener: (event: KeyboardEvent,
10644                                        /**
10645                                         * The position of the event.
10646                                         */
10647                                        position: Point) => void): this;
10648     /**
10649      * Emitted when the mouse is released from clicking the tray icon.
10650      *
10651      * Note: This will not be emitted if you have set a context menu for your Tray
10652      * using `tray.setContextMenu`, as a result of macOS-level constraints.
10653      *
10654      * @platform darwin
10655      */
10656     on(event: 'mouse-up', listener: (event: KeyboardEvent,
10657                                      /**
10658                                       * The position of the event.
10659                                       */
10660                                      position: Point) => void): this;
10661     off(event: 'mouse-up', listener: (event: KeyboardEvent,
10662                                      /**
10663                                       * The position of the event.
10664                                       */
10665                                      position: Point) => void): this;
10666     once(event: 'mouse-up', listener: (event: KeyboardEvent,
10667                                      /**
10668                                       * The position of the event.
10669                                       */
10670                                      position: Point) => void): this;
10671     addListener(event: 'mouse-up', listener: (event: KeyboardEvent,
10672                                      /**
10673                                       * The position of the event.
10674                                       */
10675                                      position: Point) => void): this;
10676     removeListener(event: 'mouse-up', listener: (event: KeyboardEvent,
10677                                      /**
10678                                       * The position of the event.
10679                                       */
10680                                      position: Point) => void): this;
10681     /**
10682      * Emitted when the tray icon is right clicked.
10683      *
10684      * @platform darwin,win32
10685      */
10686     on(event: 'right-click', listener: (event: KeyboardEvent,
10687                                         /**
10688                                          * The bounds of tray icon.
10689                                          */
10690                                         bounds: Rectangle) => void): this;
10691     off(event: 'right-click', listener: (event: KeyboardEvent,
10692                                         /**
10693                                          * The bounds of tray icon.
10694                                          */
10695                                         bounds: Rectangle) => void): this;
10696     once(event: 'right-click', listener: (event: KeyboardEvent,
10697                                         /**
10698                                          * The bounds of tray icon.
10699                                          */
10700                                         bounds: Rectangle) => void): this;
10701     addListener(event: 'right-click', listener: (event: KeyboardEvent,
10702                                         /**
10703                                          * The bounds of tray icon.
10704                                          */
10705                                         bounds: Rectangle) => void): this;
10706     removeListener(event: 'right-click', listener: (event: KeyboardEvent,
10707                                         /**
10708                                          * The bounds of tray icon.
10709                                          */
10710                                         bounds: Rectangle) => void): this;
10711     /**
10712      * Tray
10713      */
10714     constructor(image: (NativeImage) | (string), guid?: string);
10715     /**
10716      * Closes an open context menu, as set by `tray.setContextMenu()`.
10717      *
10718      * @platform darwin,win32
10719      */
10720     closeContextMenu(): void;
10721     /**
10722      * Destroys the tray icon immediately.
10723      */
10724     destroy(): void;
10725     /**
10726      * Displays a tray balloon.
10727      *
10728      * @platform win32
10729      */
10730     displayBalloon(options: DisplayBalloonOptions): void;
10731     /**
10732      * Returns focus to the taskbar notification area. Notification area icons should
10733      * use this message when they have completed their UI operation. For example, if
10734      * the icon displays a shortcut menu, but the user presses ESC to cancel it, use
10735      * `tray.focus()` to return focus to the notification area.
10736      *
10737      * @platform win32
10738      */
10739     focus(): void;
10740     /**
10741      * The `bounds` of this tray icon as `Object`.
10742      *
10743      * @platform darwin,win32
10744      */
10745     getBounds(): Rectangle;
10746     /**
10747      * Whether double click events will be ignored.
10748      *
10749      * @platform darwin
10750      */
10751     getIgnoreDoubleClickEvents(): boolean;
10752     /**
10753      * the title displayed next to the tray icon in the status bar
10754      *
10755      * @platform darwin
10756      */
10757     getTitle(): string;
10758     /**
10759      * Whether the tray icon is destroyed.
10760      */
10761     isDestroyed(): boolean;
10762     /**
10763      * Pops up the context menu of the tray icon. When `menu` is passed, the `menu`
10764      * will be shown instead of the tray icon's context menu.
10765      *
10766      * The `position` is only available on Windows, and it is (0, 0) by default.
10767      *
10768      * @platform darwin,win32
10769      */
10770     popUpContextMenu(menu?: Menu, position?: Point): void;
10771     /**
10772      * Removes a tray balloon.
10773      *
10774      * @platform win32
10775      */
10776     removeBalloon(): void;
10777     /**
10778      * Sets the context menu for this icon.
10779      */
10780     setContextMenu(menu: (Menu) | (null)): void;
10781     /**
10782      * Sets the option to ignore double click events. Ignoring these events allows you
10783      * to detect every individual click of the tray icon.
10784      *
10785      * This value is set to false by default.
10786      *
10787      * @platform darwin
10788      */
10789     setIgnoreDoubleClickEvents(ignore: boolean): void;
10790     /**
10791      * Sets the `image` associated with this tray icon.
10792      */
10793     setImage(image: (NativeImage) | (string)): void;
10794     /**
10795      * Sets the `image` associated with this tray icon when pressed on macOS.
10796      *
10797      * @platform darwin
10798      */
10799     setPressedImage(image: (NativeImage) | (string)): void;
10800     /**
10801      * Sets the title displayed next to the tray icon in the status bar (Support ANSI
10802      * colors).
10803      *
10804      * @platform darwin
10805      */
10806     setTitle(title: string, options?: TitleOptions): void;
10807     /**
10808      * Sets the hover text for this tray icon.
10809      */
10810     setToolTip(toolTip: string): void;
10811   }
10812
10813   interface UploadData {
10814
10815     // Docs: https://electronjs.org/docs/api/structures/upload-data
10816
10817     /**
10818      * UUID of blob data. Use ses.getBlobData method to retrieve the data.
10819      */
10820     blobUUID?: string;
10821     /**
10822      * Content being sent.
10823      */
10824     bytes: Buffer;
10825     /**
10826      * Path of file being uploaded.
10827      */
10828     file?: string;
10829   }
10830
10831   interface UploadFile {
10832
10833     // Docs: https://electronjs.org/docs/api/structures/upload-file
10834
10835     /**
10836      * Path of file to be uploaded.
10837      */
10838     filePath: string;
10839     /**
10840      * Number of bytes to read from `offset`. Defaults to `0`.
10841      */
10842     length?: number;
10843     /**
10844      * Last Modification time in number of seconds since the UNIX epoch. Defaults to
10845      * `0`.
10846      */
10847     modificationTime?: number;
10848     /**
10849      * Defaults to `0`.
10850      */
10851     offset?: number;
10852     /**
10853      * `file`.
10854      */
10855     type: 'file';
10856   }
10857
10858   interface UploadRawData {
10859
10860     // Docs: https://electronjs.org/docs/api/structures/upload-raw-data
10861
10862     /**
10863      * Data to be uploaded.
10864      */
10865     bytes: Buffer;
10866     /**
10867      * `rawData`.
10868      */
10869     type: 'rawData';
10870   }
10871
10872   interface USBDevice {
10873
10874     // Docs: https://electronjs.org/docs/api/structures/usb-device
10875
10876     /**
10877      * The device class for the communication interface supported by the device
10878      */
10879     deviceClass: number;
10880     /**
10881      * Unique identifier for the device.
10882      */
10883     deviceId: string;
10884     /**
10885      * The device protocol for the communication interface supported by the device
10886      */
10887     deviceProtocol: number;
10888     /**
10889      * The device subclass for the communication interface supported by the device
10890      */
10891     deviceSubclass: number;
10892     /**
10893      * The major version number of the device as defined by the device manufacturer.
10894      */
10895     deviceVersionMajor: number;
10896     /**
10897      * The minor version number of the device as defined by the device manufacturer.
10898      */
10899     deviceVersionMinor: number;
10900     /**
10901      * The subminor version number of the device as defined by the device manufacturer.
10902      */
10903     deviceVersionSubminor: number;
10904     /**
10905      * The manufacturer name of the device.
10906      */
10907     manufacturerName?: string;
10908     /**
10909      * The USB product ID.
10910      */
10911     productId: number;
10912     /**
10913      * Name of the device.
10914      */
10915     productName?: string;
10916     /**
10917      * The USB device serial number.
10918      */
10919     serialNumber?: string;
10920     /**
10921      * The USB protocol major version supported by the device
10922      */
10923     usbVersionMajor: number;
10924     /**
10925      * The USB protocol minor version supported by the device
10926      */
10927     usbVersionMinor: number;
10928     /**
10929      * The USB protocol subminor version supported by the device
10930      */
10931     usbVersionSubminor: number;
10932     /**
10933      * The USB vendor ID.
10934      */
10935     vendorId: number;
10936   }
10937
10938   interface UserDefaultTypes {
10939
10940     // Docs: https://electronjs.org/docs/api/structures/user-default-types
10941
10942     array: Array<unknown>;
10943     boolean: boolean;
10944     dictionary: Record<string, unknown>;
10945     double: number;
10946     float: number;
10947     integer: number;
10948     string: string;
10949     url: string;
10950   }
10951
10952   class UtilityProcess extends NodeEventEmitter {
10953
10954     // Docs: https://electronjs.org/docs/api/utility-process
10955
10956     static fork(modulePath: string, args?: string[], options?: ForkOptions): UtilityProcess;
10957     /**
10958      * Emitted after the child process ends.
10959      */
10960     on(event: 'exit', listener: (
10961                                  /**
10962                                   * Contains the exit code for the process obtained from waitpid on posix, or
10963                                   * GetExitCodeProcess on windows.
10964                                   */
10965                                  code: number) => void): this;
10966     off(event: 'exit', listener: (
10967                                  /**
10968                                   * Contains the exit code for the process obtained from waitpid on posix, or
10969                                   * GetExitCodeProcess on windows.
10970                                   */
10971                                  code: number) => void): this;
10972     once(event: 'exit', listener: (
10973                                  /**
10974                                   * Contains the exit code for the process obtained from waitpid on posix, or
10975                                   * GetExitCodeProcess on windows.
10976                                   */
10977                                  code: number) => void): this;
10978     addListener(event: 'exit', listener: (
10979                                  /**
10980                                   * Contains the exit code for the process obtained from waitpid on posix, or
10981                                   * GetExitCodeProcess on windows.
10982                                   */
10983                                  code: number) => void): this;
10984     removeListener(event: 'exit', listener: (
10985                                  /**
10986                                   * Contains the exit code for the process obtained from waitpid on posix, or
10987                                   * GetExitCodeProcess on windows.
10988                                   */
10989                                  code: number) => void): this;
10990     /**
10991      * Emitted when the child process sends a message using
10992      * `process.parentPort.postMessage()`.
10993      */
10994     on(event: 'message', listener: (message: any) => void): this;
10995     off(event: 'message', listener: (message: any) => void): this;
10996     once(event: 'message', listener: (message: any) => void): this;
10997     addListener(event: 'message', listener: (message: any) => void): this;
10998     removeListener(event: 'message', listener: (message: any) => void): this;
10999     /**
11000      * Emitted once the child process has spawned successfully.
11001      */
11002     on(event: 'spawn', listener: Function): this;
11003     off(event: 'spawn', listener: Function): this;
11004     once(event: 'spawn', listener: Function): this;
11005     addListener(event: 'spawn', listener: Function): this;
11006     removeListener(event: 'spawn', listener: Function): this;
11007     /**
11008      * Terminates the process gracefully. On POSIX, it uses SIGTERM but will ensure the
11009      * process is reaped on exit. This function returns true if the kill is successful,
11010      * and false otherwise.
11011      */
11012     kill(): boolean;
11013     /**
11014      * Send a message to the child process, optionally transferring ownership of zero
11015      * or more `MessagePortMain` objects.
11016      *
11017      * For example:
11018      */
11019     postMessage(message: any, transfer?: MessagePortMain[]): void;
11020     /**
11021      * A `Integer | undefined` representing the process identifier (PID) of the child
11022      * process. If the child process fails to spawn due to errors, then the value is
11023      * `undefined`. When the child process exits, then the value is `undefined` after
11024      * the `exit` event is emitted.
11025      */
11026     pid: (number) | (undefined);
11027     /**
11028      * A `NodeJS.ReadableStream | null` that represents the child process's stderr. If
11029      * the child was spawned with options.stdio[2] set to anything other than 'pipe',
11030      * then this will be `null`. When the child process exits, then the value is `null`
11031      * after the `exit` event is emitted.
11032      */
11033     stderr: (NodeJS.ReadableStream) | (null);
11034     /**
11035      * A `NodeJS.ReadableStream | null` that represents the child process's stdout. If
11036      * the child was spawned with options.stdio[1] set to anything other than 'pipe',
11037      * then this will be `null`. When the child process exits, then the value is `null`
11038      * after the `exit` event is emitted.
11039      */
11040     stdout: (NodeJS.ReadableStream) | (null);
11041   }
11042
11043   class WebContents extends NodeEventEmitter {
11044
11045     // Docs: https://electronjs.org/docs/api/web-contents
11046
11047     /**
11048      * A WebContents instance with the given TargetID, or `undefined` if there is no
11049      * WebContents associated with the given TargetID.
11050      *
11051      * When communicating with the Chrome DevTools Protocol, it can be useful to lookup
11052      * a WebContents instance based on its assigned TargetID.
11053      */
11054     static fromDevToolsTargetId(targetId: string): (WebContents) | (undefined);
11055     /**
11056      * A WebContents instance with the given WebFrameMain, or `undefined` if there is
11057      * no WebContents associated with the given WebFrameMain.
11058      */
11059     static fromFrame(frame: WebFrameMain): (WebContents) | (undefined);
11060     /**
11061      * A WebContents instance with the given ID, or `undefined` if there is no
11062      * WebContents associated with the given ID.
11063      */
11064     static fromId(id: number): (WebContents) | (undefined);
11065     /**
11066      * An array of all `WebContents` instances. This will contain web contents for all
11067      * windows, webviews, opened devtools, and devtools extension background pages.
11068      */
11069     static getAllWebContents(): WebContents[];
11070     /**
11071      * The web contents that is focused in this application, otherwise returns `null`.
11072      */
11073     static getFocusedWebContents(): (WebContents) | (null);
11074     /**
11075      * Emitted when media becomes audible or inaudible.
11076      */
11077     on(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
11078     off(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
11079     once(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
11080     addListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
11081     removeListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
11082     /**
11083      * Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
11084      * `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
11085      * menu shortcuts.
11086      *
11087      * To only prevent the menu shortcuts, use `setIgnoreMenuShortcuts`:
11088      */
11089     on(event: 'before-input-event', listener: (event: Event,
11090                                                /**
11091                                                 * Input properties.
11092                                                 */
11093                                                input: Input) => void): this;
11094     off(event: 'before-input-event', listener: (event: Event,
11095                                                /**
11096                                                 * Input properties.
11097                                                 */
11098                                                input: Input) => void): this;
11099     once(event: 'before-input-event', listener: (event: Event,
11100                                                /**
11101                                                 * Input properties.
11102                                                 */
11103                                                input: Input) => void): this;
11104     addListener(event: 'before-input-event', listener: (event: Event,
11105                                                /**
11106                                                 * Input properties.
11107                                                 */
11108                                                input: Input) => void): this;
11109     removeListener(event: 'before-input-event', listener: (event: Event,
11110                                                /**
11111                                                 * Input properties.
11112                                                 */
11113                                                input: Input) => void): this;
11114     /**
11115      * Emitted when the `WebContents` loses focus.
11116      */
11117     on(event: 'blur', listener: Function): this;
11118     off(event: 'blur', listener: Function): this;
11119     once(event: 'blur', listener: Function): this;
11120     addListener(event: 'blur', listener: Function): this;
11121     removeListener(event: 'blur', listener: Function): this;
11122     /**
11123      * Emitted when failed to verify the `certificate` for `url`.
11124      *
11125      * The usage is the same with the `certificate-error` event of `app`.
11126      */
11127     on(event: 'certificate-error', listener: (event: Event,
11128                                               url: string,
11129                                               /**
11130                                                * The error code.
11131                                                */
11132                                               error: string,
11133                                               certificate: Certificate,
11134                                               callback: (isTrusted: boolean) => void,
11135                                               isMainFrame: boolean) => void): this;
11136     off(event: 'certificate-error', listener: (event: Event,
11137                                               url: string,
11138                                               /**
11139                                                * The error code.
11140                                                */
11141                                               error: string,
11142                                               certificate: Certificate,
11143                                               callback: (isTrusted: boolean) => void,
11144                                               isMainFrame: boolean) => void): this;
11145     once(event: 'certificate-error', listener: (event: Event,
11146                                               url: string,
11147                                               /**
11148                                                * The error code.
11149                                                */
11150                                               error: string,
11151                                               certificate: Certificate,
11152                                               callback: (isTrusted: boolean) => void,
11153                                               isMainFrame: boolean) => void): this;
11154     addListener(event: 'certificate-error', listener: (event: Event,
11155                                               url: string,
11156                                               /**
11157                                                * The error code.
11158                                                */
11159                                               error: string,
11160                                               certificate: Certificate,
11161                                               callback: (isTrusted: boolean) => void,
11162                                               isMainFrame: boolean) => void): this;
11163     removeListener(event: 'certificate-error', listener: (event: Event,
11164                                               url: string,
11165                                               /**
11166                                                * The error code.
11167                                                */
11168                                               error: string,
11169                                               certificate: Certificate,
11170                                               callback: (isTrusted: boolean) => void,
11171                                               isMainFrame: boolean) => void): this;
11172     /**
11173      * Emitted when the associated window logs a console message.
11174      */
11175     on(event: 'console-message', listener: (event: Event,
11176                                             /**
11177                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
11178                                              * `error`.
11179                                              */
11180                                             level: number,
11181                                             /**
11182                                              * The actual console message
11183                                              */
11184                                             message: string,
11185                                             /**
11186                                              * The line number of the source that triggered this console message
11187                                              */
11188                                             line: number,
11189                                             sourceId: string) => void): this;
11190     off(event: 'console-message', listener: (event: Event,
11191                                             /**
11192                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
11193                                              * `error`.
11194                                              */
11195                                             level: number,
11196                                             /**
11197                                              * The actual console message
11198                                              */
11199                                             message: string,
11200                                             /**
11201                                              * The line number of the source that triggered this console message
11202                                              */
11203                                             line: number,
11204                                             sourceId: string) => void): this;
11205     once(event: 'console-message', listener: (event: Event,
11206                                             /**
11207                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
11208                                              * `error`.
11209                                              */
11210                                             level: number,
11211                                             /**
11212                                              * The actual console message
11213                                              */
11214                                             message: string,
11215                                             /**
11216                                              * The line number of the source that triggered this console message
11217                                              */
11218                                             line: number,
11219                                             sourceId: string) => void): this;
11220     addListener(event: 'console-message', listener: (event: Event,
11221                                             /**
11222                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
11223                                              * `error`.
11224                                              */
11225                                             level: number,
11226                                             /**
11227                                              * The actual console message
11228                                              */
11229                                             message: string,
11230                                             /**
11231                                              * The line number of the source that triggered this console message
11232                                              */
11233                                             line: number,
11234                                             sourceId: string) => void): this;
11235     removeListener(event: 'console-message', listener: (event: Event,
11236                                             /**
11237                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
11238                                              * `error`.
11239                                              */
11240                                             level: number,
11241                                             /**
11242                                              * The actual console message
11243                                              */
11244                                             message: string,
11245                                             /**
11246                                              * The line number of the source that triggered this console message
11247                                              */
11248                                             line: number,
11249                                             sourceId: string) => void): this;
11250     /**
11251      * Emitted when the page calls `window.moveTo`, `window.resizeTo` or related APIs.
11252      *
11253      * By default, this will move the window. To prevent that behavior, call
11254      * `event.preventDefault()`.
11255      */
11256     on(event: 'content-bounds-updated', listener: (event: Event,
11257                                                    /**
11258                                                     * requested new content bounds
11259                                                     */
11260                                                    bounds: Rectangle) => void): this;
11261     off(event: 'content-bounds-updated', listener: (event: Event,
11262                                                    /**
11263                                                     * requested new content bounds
11264                                                     */
11265                                                    bounds: Rectangle) => void): this;
11266     once(event: 'content-bounds-updated', listener: (event: Event,
11267                                                    /**
11268                                                     * requested new content bounds
11269                                                     */
11270                                                    bounds: Rectangle) => void): this;
11271     addListener(event: 'content-bounds-updated', listener: (event: Event,
11272                                                    /**
11273                                                     * requested new content bounds
11274                                                     */
11275                                                    bounds: Rectangle) => void): this;
11276     removeListener(event: 'content-bounds-updated', listener: (event: Event,
11277                                                    /**
11278                                                     * requested new content bounds
11279                                                     */
11280                                                    bounds: Rectangle) => void): this;
11281     /**
11282      * Emitted when there is a new context menu that needs to be handled.
11283      */
11284     on(event: 'context-menu', listener: (event: Event,
11285                                          params: ContextMenuParams) => void): this;
11286     off(event: 'context-menu', listener: (event: Event,
11287                                          params: ContextMenuParams) => void): this;
11288     once(event: 'context-menu', listener: (event: Event,
11289                                          params: ContextMenuParams) => void): this;
11290     addListener(event: 'context-menu', listener: (event: Event,
11291                                          params: ContextMenuParams) => void): this;
11292     removeListener(event: 'context-menu', listener: (event: Event,
11293                                          params: ContextMenuParams) => void): this;
11294     /**
11295      * Emitted when the renderer process crashes or is killed.
11296      *
11297      * **Deprecated:** This event is superceded by the `render-process-gone` event
11298      * which contains more information about why the render process disappeared. It
11299      * isn't always because it crashed.  The `killed` boolean can be replaced by
11300      * checking `reason === 'killed'` when you switch to that event.
11301      *
11302      * @deprecated
11303      */
11304     on(event: 'crashed', listener: (event: Event,
11305                                     killed: boolean) => void): this;
11306     off(event: 'crashed', listener: (event: Event,
11307                                     killed: boolean) => void): this;
11308     once(event: 'crashed', listener: (event: Event,
11309                                     killed: boolean) => void): this;
11310     addListener(event: 'crashed', listener: (event: Event,
11311                                     killed: boolean) => void): this;
11312     removeListener(event: 'crashed', listener: (event: Event,
11313                                     killed: boolean) => void): this;
11314     /**
11315      * Emitted when the cursor's type changes. The `type` parameter can be `pointer`,
11316      * `crosshair`, `hand`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
11317      * `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`,
11318      * `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`,
11319      * `row-resize`, `m-panning`, `m-panning-vertical`, `m-panning-horizontal`,
11320      * `e-panning`, `n-panning`, `ne-panning`, `nw-panning`, `s-panning`, `se-panning`,
11321      * `sw-panning`, `w-panning`, `move`, `vertical-text`, `cell`, `context-menu`,
11322      * `alias`, `progress`, `nodrop`, `copy`, `none`, `not-allowed`, `zoom-in`,
11323      * `zoom-out`, `grab`, `grabbing`, `custom`, `null`, `drag-drop-none`,
11324      * `drag-drop-move`, `drag-drop-copy`, `drag-drop-link`, `ns-no-resize`,
11325      * `ew-no-resize`, `nesw-no-resize`, `nwse-no-resize`, or `default`.
11326      *
11327      * If the `type` parameter is `custom`, the `image` parameter will hold the custom
11328      * cursor image in a `NativeImage`, and `scale`, `size` and `hotspot` will hold
11329      * additional information about the custom cursor.
11330      */
11331     on(event: 'cursor-changed', listener: (event: Event,
11332                                            type: string,
11333                                            image: NativeImage,
11334                                            /**
11335                                             * scaling factor for the custom cursor.
11336                                             */
11337                                            scale: number,
11338                                            /**
11339                                             * the size of the `image`.
11340                                             */
11341                                            size: Size,
11342                                            /**
11343                                             * coordinates of the custom cursor's hotspot.
11344                                             */
11345                                            hotspot: Point) => void): this;
11346     off(event: 'cursor-changed', listener: (event: Event,
11347                                            type: string,
11348                                            image: NativeImage,
11349                                            /**
11350                                             * scaling factor for the custom cursor.
11351                                             */
11352                                            scale: number,
11353                                            /**
11354                                             * the size of the `image`.
11355                                             */
11356                                            size: Size,
11357                                            /**
11358                                             * coordinates of the custom cursor's hotspot.
11359                                             */
11360                                            hotspot: Point) => void): this;
11361     once(event: 'cursor-changed', listener: (event: Event,
11362                                            type: string,
11363                                            image: NativeImage,
11364                                            /**
11365                                             * scaling factor for the custom cursor.
11366                                             */
11367                                            scale: number,
11368                                            /**
11369                                             * the size of the `image`.
11370                                             */
11371                                            size: Size,
11372                                            /**
11373                                             * coordinates of the custom cursor's hotspot.
11374                                             */
11375                                            hotspot: Point) => void): this;
11376     addListener(event: 'cursor-changed', listener: (event: Event,
11377                                            type: string,
11378                                            image: NativeImage,
11379                                            /**
11380                                             * scaling factor for the custom cursor.
11381                                             */
11382                                            scale: number,
11383                                            /**
11384                                             * the size of the `image`.
11385                                             */
11386                                            size: Size,
11387                                            /**
11388                                             * coordinates of the custom cursor's hotspot.
11389                                             */
11390                                            hotspot: Point) => void): this;
11391     removeListener(event: 'cursor-changed', listener: (event: Event,
11392                                            type: string,
11393                                            image: NativeImage,
11394                                            /**
11395                                             * scaling factor for the custom cursor.
11396                                             */
11397                                            scale: number,
11398                                            /**
11399                                             * the size of the `image`.
11400                                             */
11401                                            size: Size,
11402                                            /**
11403                                             * coordinates of the custom cursor's hotspot.
11404                                             */
11405                                            hotspot: Point) => void): this;
11406     /**
11407      * Emitted when `webContents` is destroyed.
11408      */
11409     on(event: 'destroyed', listener: Function): this;
11410     off(event: 'destroyed', listener: Function): this;
11411     once(event: 'destroyed', listener: Function): this;
11412     addListener(event: 'destroyed', listener: Function): this;
11413     removeListener(event: 'destroyed', listener: Function): this;
11414     /**
11415      * Emitted when DevTools is closed.
11416      */
11417     on(event: 'devtools-closed', listener: Function): this;
11418     off(event: 'devtools-closed', listener: Function): this;
11419     once(event: 'devtools-closed', listener: Function): this;
11420     addListener(event: 'devtools-closed', listener: Function): this;
11421     removeListener(event: 'devtools-closed', listener: Function): this;
11422     /**
11423      * Emitted when DevTools is focused / opened.
11424      */
11425     on(event: 'devtools-focused', listener: Function): this;
11426     off(event: 'devtools-focused', listener: Function): this;
11427     once(event: 'devtools-focused', listener: Function): this;
11428     addListener(event: 'devtools-focused', listener: Function): this;
11429     removeListener(event: 'devtools-focused', listener: Function): this;
11430     /**
11431      * Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
11432      * a link in its context menu.
11433      */
11434     on(event: 'devtools-open-url', listener: (event: Event,
11435                                               /**
11436                                                * URL of the link that was clicked or selected.
11437                                                */
11438                                               url: string) => void): this;
11439     off(event: 'devtools-open-url', listener: (event: Event,
11440                                               /**
11441                                                * URL of the link that was clicked or selected.
11442                                                */
11443                                               url: string) => void): this;
11444     once(event: 'devtools-open-url', listener: (event: Event,
11445                                               /**
11446                                                * URL of the link that was clicked or selected.
11447                                                */
11448                                               url: string) => void): this;
11449     addListener(event: 'devtools-open-url', listener: (event: Event,
11450                                               /**
11451                                                * URL of the link that was clicked or selected.
11452                                                */
11453                                               url: string) => void): this;
11454     removeListener(event: 'devtools-open-url', listener: (event: Event,
11455                                               /**
11456                                                * URL of the link that was clicked or selected.
11457                                                */
11458                                               url: string) => void): this;
11459     /**
11460      * Emitted when DevTools is opened.
11461      */
11462     on(event: 'devtools-opened', listener: Function): this;
11463     off(event: 'devtools-opened', listener: Function): this;
11464     once(event: 'devtools-opened', listener: Function): this;
11465     addListener(event: 'devtools-opened', listener: Function): this;
11466     removeListener(event: 'devtools-opened', listener: Function): this;
11467     /**
11468      * Emitted when the devtools window instructs the webContents to reload
11469      */
11470     on(event: 'devtools-reload-page', listener: Function): this;
11471     off(event: 'devtools-reload-page', listener: Function): this;
11472     once(event: 'devtools-reload-page', listener: Function): this;
11473     addListener(event: 'devtools-reload-page', listener: Function): this;
11474     removeListener(event: 'devtools-reload-page', listener: Function): this;
11475     /**
11476      * Emitted when a `<webview>` has been attached to this web contents.
11477      */
11478     on(event: 'did-attach-webview', listener: (event: Event,
11479                                                /**
11480                                                 * The guest web contents that is used by the `<webview>`.
11481                                                 */
11482                                                webContents: WebContents) => void): this;
11483     off(event: 'did-attach-webview', listener: (event: Event,
11484                                                /**
11485                                                 * The guest web contents that is used by the `<webview>`.
11486                                                 */
11487                                                webContents: WebContents) => void): this;
11488     once(event: 'did-attach-webview', listener: (event: Event,
11489                                                /**
11490                                                 * The guest web contents that is used by the `<webview>`.
11491                                                 */
11492                                                webContents: WebContents) => void): this;
11493     addListener(event: 'did-attach-webview', listener: (event: Event,
11494                                                /**
11495                                                 * The guest web contents that is used by the `<webview>`.
11496                                                 */
11497                                                webContents: WebContents) => void): this;
11498     removeListener(event: 'did-attach-webview', listener: (event: Event,
11499                                                /**
11500                                                 * The guest web contents that is used by the `<webview>`.
11501                                                 */
11502                                                webContents: WebContents) => void): this;
11503     /**
11504      * Emitted when a page's theme color changes. This is usually due to encountering a
11505      * meta tag:
11506      */
11507     on(event: 'did-change-theme-color', listener: (event: Event,
11508                                                    /**
11509                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
11510                                                     */
11511                                                    color: (string) | (null)) => void): this;
11512     off(event: 'did-change-theme-color', listener: (event: Event,
11513                                                    /**
11514                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
11515                                                     */
11516                                                    color: (string) | (null)) => void): this;
11517     once(event: 'did-change-theme-color', listener: (event: Event,
11518                                                    /**
11519                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
11520                                                     */
11521                                                    color: (string) | (null)) => void): this;
11522     addListener(event: 'did-change-theme-color', listener: (event: Event,
11523                                                    /**
11524                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
11525                                                     */
11526                                                    color: (string) | (null)) => void): this;
11527     removeListener(event: 'did-change-theme-color', listener: (event: Event,
11528                                                    /**
11529                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
11530                                                     */
11531                                                    color: (string) | (null)) => void): this;
11532     /**
11533      * Emitted _after_ successful creation of a window via `window.open` in the
11534      * renderer. Not emitted if the creation of the window is canceled from
11535      * `webContents.setWindowOpenHandler`.
11536      *
11537      * See `window.open()` for more details and how to use this in conjunction with
11538      * `webContents.setWindowOpenHandler`.
11539      */
11540     on(event: 'did-create-window', listener: (window: BrowserWindow,
11541                                               details: DidCreateWindowDetails) => void): this;
11542     off(event: 'did-create-window', listener: (window: BrowserWindow,
11543                                               details: DidCreateWindowDetails) => void): this;
11544     once(event: 'did-create-window', listener: (window: BrowserWindow,
11545                                               details: DidCreateWindowDetails) => void): this;
11546     addListener(event: 'did-create-window', listener: (window: BrowserWindow,
11547                                               details: DidCreateWindowDetails) => void): this;
11548     removeListener(event: 'did-create-window', listener: (window: BrowserWindow,
11549                                               details: DidCreateWindowDetails) => void): this;
11550     /**
11551      * This event is like `did-finish-load` but emitted when the load failed. The full
11552      * list of error codes and their meaning is available here.
11553      */
11554     on(event: 'did-fail-load', listener: (event: Event,
11555                                           errorCode: number,
11556                                           errorDescription: string,
11557                                           validatedURL: string,
11558                                           isMainFrame: boolean,
11559                                           frameProcessId: number,
11560                                           frameRoutingId: number) => void): this;
11561     off(event: 'did-fail-load', listener: (event: Event,
11562                                           errorCode: number,
11563                                           errorDescription: string,
11564                                           validatedURL: string,
11565                                           isMainFrame: boolean,
11566                                           frameProcessId: number,
11567                                           frameRoutingId: number) => void): this;
11568     once(event: 'did-fail-load', listener: (event: Event,
11569                                           errorCode: number,
11570                                           errorDescription: string,
11571                                           validatedURL: string,
11572                                           isMainFrame: boolean,
11573                                           frameProcessId: number,
11574                                           frameRoutingId: number) => void): this;
11575     addListener(event: 'did-fail-load', listener: (event: Event,
11576                                           errorCode: number,
11577                                           errorDescription: string,
11578                                           validatedURL: string,
11579                                           isMainFrame: boolean,
11580                                           frameProcessId: number,
11581                                           frameRoutingId: number) => void): this;
11582     removeListener(event: 'did-fail-load', listener: (event: Event,
11583                                           errorCode: number,
11584                                           errorDescription: string,
11585                                           validatedURL: string,
11586                                           isMainFrame: boolean,
11587                                           frameProcessId: number,
11588                                           frameRoutingId: number) => void): this;
11589     /**
11590      * This event is like `did-fail-load` but emitted when the load was cancelled (e.g.
11591      * `window.stop()` was invoked).
11592      */
11593     on(event: 'did-fail-provisional-load', listener: (event: Event,
11594                                                       errorCode: number,
11595                                                       errorDescription: string,
11596                                                       validatedURL: string,
11597                                                       isMainFrame: boolean,
11598                                                       frameProcessId: number,
11599                                                       frameRoutingId: number) => void): this;
11600     off(event: 'did-fail-provisional-load', listener: (event: Event,
11601                                                       errorCode: number,
11602                                                       errorDescription: string,
11603                                                       validatedURL: string,
11604                                                       isMainFrame: boolean,
11605                                                       frameProcessId: number,
11606                                                       frameRoutingId: number) => void): this;
11607     once(event: 'did-fail-provisional-load', listener: (event: Event,
11608                                                       errorCode: number,
11609                                                       errorDescription: string,
11610                                                       validatedURL: string,
11611                                                       isMainFrame: boolean,
11612                                                       frameProcessId: number,
11613                                                       frameRoutingId: number) => void): this;
11614     addListener(event: 'did-fail-provisional-load', listener: (event: Event,
11615                                                       errorCode: number,
11616                                                       errorDescription: string,
11617                                                       validatedURL: string,
11618                                                       isMainFrame: boolean,
11619                                                       frameProcessId: number,
11620                                                       frameRoutingId: number) => void): this;
11621     removeListener(event: 'did-fail-provisional-load', listener: (event: Event,
11622                                                       errorCode: number,
11623                                                       errorDescription: string,
11624                                                       validatedURL: string,
11625                                                       isMainFrame: boolean,
11626                                                       frameProcessId: number,
11627                                                       frameRoutingId: number) => void): this;
11628     /**
11629      * Emitted when the navigation is done, i.e. the spinner of the tab has stopped
11630      * spinning, and the `onload` event was dispatched.
11631      */
11632     on(event: 'did-finish-load', listener: Function): this;
11633     off(event: 'did-finish-load', listener: Function): this;
11634     once(event: 'did-finish-load', listener: Function): this;
11635     addListener(event: 'did-finish-load', listener: Function): this;
11636     removeListener(event: 'did-finish-load', listener: Function): this;
11637     /**
11638      * Emitted when a frame has done navigation.
11639      */
11640     on(event: 'did-frame-finish-load', listener: (event: Event,
11641                                                   isMainFrame: boolean,
11642                                                   frameProcessId: number,
11643                                                   frameRoutingId: number) => void): this;
11644     off(event: 'did-frame-finish-load', listener: (event: Event,
11645                                                   isMainFrame: boolean,
11646                                                   frameProcessId: number,
11647                                                   frameRoutingId: number) => void): this;
11648     once(event: 'did-frame-finish-load', listener: (event: Event,
11649                                                   isMainFrame: boolean,
11650                                                   frameProcessId: number,
11651                                                   frameRoutingId: number) => void): this;
11652     addListener(event: 'did-frame-finish-load', listener: (event: Event,
11653                                                   isMainFrame: boolean,
11654                                                   frameProcessId: number,
11655                                                   frameRoutingId: number) => void): this;
11656     removeListener(event: 'did-frame-finish-load', listener: (event: Event,
11657                                                   isMainFrame: boolean,
11658                                                   frameProcessId: number,
11659                                                   frameRoutingId: number) => void): this;
11660     /**
11661      * Emitted when any frame navigation is done.
11662      *
11663      * This event is not emitted for in-page navigations, such as clicking anchor links
11664      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
11665      * this purpose.
11666      */
11667     on(event: 'did-frame-navigate', listener: (event: Event,
11668                                                url: string,
11669                                                /**
11670                                                 * -1 for non HTTP navigations
11671                                                 */
11672                                                httpResponseCode: number,
11673                                                /**
11674                                                 * empty for non HTTP navigations,
11675                                                 */
11676                                                httpStatusText: string,
11677                                                isMainFrame: boolean,
11678                                                frameProcessId: number,
11679                                                frameRoutingId: number) => void): this;
11680     off(event: 'did-frame-navigate', listener: (event: Event,
11681                                                url: string,
11682                                                /**
11683                                                 * -1 for non HTTP navigations
11684                                                 */
11685                                                httpResponseCode: number,
11686                                                /**
11687                                                 * empty for non HTTP navigations,
11688                                                 */
11689                                                httpStatusText: string,
11690                                                isMainFrame: boolean,
11691                                                frameProcessId: number,
11692                                                frameRoutingId: number) => void): this;
11693     once(event: 'did-frame-navigate', listener: (event: Event,
11694                                                url: string,
11695                                                /**
11696                                                 * -1 for non HTTP navigations
11697                                                 */
11698                                                httpResponseCode: number,
11699                                                /**
11700                                                 * empty for non HTTP navigations,
11701                                                 */
11702                                                httpStatusText: string,
11703                                                isMainFrame: boolean,
11704                                                frameProcessId: number,
11705                                                frameRoutingId: number) => void): this;
11706     addListener(event: 'did-frame-navigate', listener: (event: Event,
11707                                                url: string,
11708                                                /**
11709                                                 * -1 for non HTTP navigations
11710                                                 */
11711                                                httpResponseCode: number,
11712                                                /**
11713                                                 * empty for non HTTP navigations,
11714                                                 */
11715                                                httpStatusText: string,
11716                                                isMainFrame: boolean,
11717                                                frameProcessId: number,
11718                                                frameRoutingId: number) => void): this;
11719     removeListener(event: 'did-frame-navigate', listener: (event: Event,
11720                                                url: string,
11721                                                /**
11722                                                 * -1 for non HTTP navigations
11723                                                 */
11724                                                httpResponseCode: number,
11725                                                /**
11726                                                 * empty for non HTTP navigations,
11727                                                 */
11728                                                httpStatusText: string,
11729                                                isMainFrame: boolean,
11730                                                frameProcessId: number,
11731                                                frameRoutingId: number) => void): this;
11732     /**
11733      * Emitted when a main frame navigation is done.
11734      *
11735      * This event is not emitted for in-page navigations, such as clicking anchor links
11736      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
11737      * this purpose.
11738      */
11739     on(event: 'did-navigate', listener: (event: Event,
11740                                          url: string,
11741                                          /**
11742                                           * -1 for non HTTP navigations
11743                                           */
11744                                          httpResponseCode: number,
11745                                          /**
11746                                           * empty for non HTTP navigations
11747                                           */
11748                                          httpStatusText: string) => void): this;
11749     off(event: 'did-navigate', listener: (event: Event,
11750                                          url: string,
11751                                          /**
11752                                           * -1 for non HTTP navigations
11753                                           */
11754                                          httpResponseCode: number,
11755                                          /**
11756                                           * empty for non HTTP navigations
11757                                           */
11758                                          httpStatusText: string) => void): this;
11759     once(event: 'did-navigate', listener: (event: Event,
11760                                          url: string,
11761                                          /**
11762                                           * -1 for non HTTP navigations
11763                                           */
11764                                          httpResponseCode: number,
11765                                          /**
11766                                           * empty for non HTTP navigations
11767                                           */
11768                                          httpStatusText: string) => void): this;
11769     addListener(event: 'did-navigate', listener: (event: Event,
11770                                          url: string,
11771                                          /**
11772                                           * -1 for non HTTP navigations
11773                                           */
11774                                          httpResponseCode: number,
11775                                          /**
11776                                           * empty for non HTTP navigations
11777                                           */
11778                                          httpStatusText: string) => void): this;
11779     removeListener(event: 'did-navigate', listener: (event: Event,
11780                                          url: string,
11781                                          /**
11782                                           * -1 for non HTTP navigations
11783                                           */
11784                                          httpResponseCode: number,
11785                                          /**
11786                                           * empty for non HTTP navigations
11787                                           */
11788                                          httpStatusText: string) => void): this;
11789     /**
11790      * Emitted when an in-page navigation happened in any frame.
11791      *
11792      * When in-page navigation happens, the page URL changes but does not cause
11793      * navigation outside of the page. Examples of this occurring are when anchor links
11794      * are clicked or when the DOM `hashchange` event is triggered.
11795      */
11796     on(event: 'did-navigate-in-page', listener: (event: Event,
11797                                                  url: string,
11798                                                  isMainFrame: boolean,
11799                                                  frameProcessId: number,
11800                                                  frameRoutingId: number) => void): this;
11801     off(event: 'did-navigate-in-page', listener: (event: Event,
11802                                                  url: string,
11803                                                  isMainFrame: boolean,
11804                                                  frameProcessId: number,
11805                                                  frameRoutingId: number) => void): this;
11806     once(event: 'did-navigate-in-page', listener: (event: Event,
11807                                                  url: string,
11808                                                  isMainFrame: boolean,
11809                                                  frameProcessId: number,
11810                                                  frameRoutingId: number) => void): this;
11811     addListener(event: 'did-navigate-in-page', listener: (event: Event,
11812                                                  url: string,
11813                                                  isMainFrame: boolean,
11814                                                  frameProcessId: number,
11815                                                  frameRoutingId: number) => void): this;
11816     removeListener(event: 'did-navigate-in-page', listener: (event: Event,
11817                                                  url: string,
11818                                                  isMainFrame: boolean,
11819                                                  frameProcessId: number,
11820                                                  frameRoutingId: number) => void): this;
11821     /**
11822      * Emitted after a server side redirect occurs during navigation.  For example a
11823      * 302 redirect.
11824      *
11825      * This event cannot be prevented, if you want to prevent redirects you should
11826      * checkout out the `will-redirect` event above.
11827      */
11828     on(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11829                                                     /**
11830                                                      * @deprecated
11831                                                      */
11832                                                     url: string,
11833                                                     /**
11834                                                      * @deprecated
11835                                                      */
11836                                                     isInPlace: boolean,
11837                                                     /**
11838                                                      * @deprecated
11839                                                      */
11840                                                     isMainFrame: boolean,
11841                                                     /**
11842                                                      * @deprecated
11843                                                      */
11844                                                     frameProcessId: number,
11845                                                     /**
11846                                                      * @deprecated
11847                                                      */
11848                                                     frameRoutingId: number) => void): this;
11849     off(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11850                                                     /**
11851                                                      * @deprecated
11852                                                      */
11853                                                     url: string,
11854                                                     /**
11855                                                      * @deprecated
11856                                                      */
11857                                                     isInPlace: boolean,
11858                                                     /**
11859                                                      * @deprecated
11860                                                      */
11861                                                     isMainFrame: boolean,
11862                                                     /**
11863                                                      * @deprecated
11864                                                      */
11865                                                     frameProcessId: number,
11866                                                     /**
11867                                                      * @deprecated
11868                                                      */
11869                                                     frameRoutingId: number) => void): this;
11870     once(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11871                                                     /**
11872                                                      * @deprecated
11873                                                      */
11874                                                     url: string,
11875                                                     /**
11876                                                      * @deprecated
11877                                                      */
11878                                                     isInPlace: boolean,
11879                                                     /**
11880                                                      * @deprecated
11881                                                      */
11882                                                     isMainFrame: boolean,
11883                                                     /**
11884                                                      * @deprecated
11885                                                      */
11886                                                     frameProcessId: number,
11887                                                     /**
11888                                                      * @deprecated
11889                                                      */
11890                                                     frameRoutingId: number) => void): this;
11891     addListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11892                                                     /**
11893                                                      * @deprecated
11894                                                      */
11895                                                     url: string,
11896                                                     /**
11897                                                      * @deprecated
11898                                                      */
11899                                                     isInPlace: boolean,
11900                                                     /**
11901                                                      * @deprecated
11902                                                      */
11903                                                     isMainFrame: boolean,
11904                                                     /**
11905                                                      * @deprecated
11906                                                      */
11907                                                     frameProcessId: number,
11908                                                     /**
11909                                                      * @deprecated
11910                                                      */
11911                                                     frameRoutingId: number) => void): this;
11912     removeListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11913                                                     /**
11914                                                      * @deprecated
11915                                                      */
11916                                                     url: string,
11917                                                     /**
11918                                                      * @deprecated
11919                                                      */
11920                                                     isInPlace: boolean,
11921                                                     /**
11922                                                      * @deprecated
11923                                                      */
11924                                                     isMainFrame: boolean,
11925                                                     /**
11926                                                      * @deprecated
11927                                                      */
11928                                                     frameProcessId: number,
11929                                                     /**
11930                                                      * @deprecated
11931                                                      */
11932                                                     frameRoutingId: number) => void): this;
11933     /**
11934      * Corresponds to the points in time when the spinner of the tab started spinning.
11935      */
11936     on(event: 'did-start-loading', listener: Function): this;
11937     off(event: 'did-start-loading', listener: Function): this;
11938     once(event: 'did-start-loading', listener: Function): this;
11939     addListener(event: 'did-start-loading', listener: Function): this;
11940     removeListener(event: 'did-start-loading', listener: Function): this;
11941     /**
11942      * Emitted when any frame (including main) starts navigating.
11943      */
11944     on(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11945                                                  /**
11946                                                   * @deprecated
11947                                                   */
11948                                                  url: string,
11949                                                  /**
11950                                                   * @deprecated
11951                                                   */
11952                                                  isInPlace: boolean,
11953                                                  /**
11954                                                   * @deprecated
11955                                                   */
11956                                                  isMainFrame: boolean,
11957                                                  /**
11958                                                   * @deprecated
11959                                                   */
11960                                                  frameProcessId: number,
11961                                                  /**
11962                                                   * @deprecated
11963                                                   */
11964                                                  frameRoutingId: number) => void): this;
11965     off(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11966                                                  /**
11967                                                   * @deprecated
11968                                                   */
11969                                                  url: string,
11970                                                  /**
11971                                                   * @deprecated
11972                                                   */
11973                                                  isInPlace: boolean,
11974                                                  /**
11975                                                   * @deprecated
11976                                                   */
11977                                                  isMainFrame: boolean,
11978                                                  /**
11979                                                   * @deprecated
11980                                                   */
11981                                                  frameProcessId: number,
11982                                                  /**
11983                                                   * @deprecated
11984                                                   */
11985                                                  frameRoutingId: number) => void): this;
11986     once(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11987                                                  /**
11988                                                   * @deprecated
11989                                                   */
11990                                                  url: string,
11991                                                  /**
11992                                                   * @deprecated
11993                                                   */
11994                                                  isInPlace: boolean,
11995                                                  /**
11996                                                   * @deprecated
11997                                                   */
11998                                                  isMainFrame: boolean,
11999                                                  /**
12000                                                   * @deprecated
12001                                                   */
12002                                                  frameProcessId: number,
12003                                                  /**
12004                                                   * @deprecated
12005                                                   */
12006                                                  frameRoutingId: number) => void): this;
12007     addListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
12008                                                  /**
12009                                                   * @deprecated
12010                                                   */
12011                                                  url: string,
12012                                                  /**
12013                                                   * @deprecated
12014                                                   */
12015                                                  isInPlace: boolean,
12016                                                  /**
12017                                                   * @deprecated
12018                                                   */
12019                                                  isMainFrame: boolean,
12020                                                  /**
12021                                                   * @deprecated
12022                                                   */
12023                                                  frameProcessId: number,
12024                                                  /**
12025                                                   * @deprecated
12026                                                   */
12027                                                  frameRoutingId: number) => void): this;
12028     removeListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
12029                                                  /**
12030                                                   * @deprecated
12031                                                   */
12032                                                  url: string,
12033                                                  /**
12034                                                   * @deprecated
12035                                                   */
12036                                                  isInPlace: boolean,
12037                                                  /**
12038                                                   * @deprecated
12039                                                   */
12040                                                  isMainFrame: boolean,
12041                                                  /**
12042                                                   * @deprecated
12043                                                   */
12044                                                  frameProcessId: number,
12045                                                  /**
12046                                                   * @deprecated
12047                                                   */
12048                                                  frameRoutingId: number) => void): this;
12049     /**
12050      * Corresponds to the points in time when the spinner of the tab stopped spinning.
12051      */
12052     on(event: 'did-stop-loading', listener: Function): this;
12053     off(event: 'did-stop-loading', listener: Function): this;
12054     once(event: 'did-stop-loading', listener: Function): this;
12055     addListener(event: 'did-stop-loading', listener: Function): this;
12056     removeListener(event: 'did-stop-loading', listener: Function): this;
12057     /**
12058      * Emitted when the document in the top-level frame is loaded.
12059      */
12060     on(event: 'dom-ready', listener: Function): this;
12061     off(event: 'dom-ready', listener: Function): this;
12062     once(event: 'dom-ready', listener: Function): this;
12063     addListener(event: 'dom-ready', listener: Function): this;
12064     removeListener(event: 'dom-ready', listener: Function): this;
12065     /**
12066      * Emitted when the window enters a full-screen state triggered by HTML API.
12067      */
12068     on(event: 'enter-html-full-screen', listener: Function): this;
12069     off(event: 'enter-html-full-screen', listener: Function): this;
12070     once(event: 'enter-html-full-screen', listener: Function): this;
12071     addListener(event: 'enter-html-full-screen', listener: Function): this;
12072     removeListener(event: 'enter-html-full-screen', listener: Function): this;
12073     /**
12074      * Emitted when the `WebContents` gains focus.
12075      *
12076      * Note that on macOS, having focus means the `WebContents` is the first responder
12077      * of window, so switching focus between windows would not trigger the `focus` and
12078      * `blur` events of `WebContents`, as the first responder of each window is not
12079      * changed.
12080      *
12081      * The `focus` and `blur` events of `WebContents` should only be used to detect
12082      * focus change between different `WebContents` and `BrowserView` in the same
12083      * window.
12084      */
12085     on(event: 'focus', listener: Function): this;
12086     off(event: 'focus', listener: Function): this;
12087     once(event: 'focus', listener: Function): this;
12088     addListener(event: 'focus', listener: Function): this;
12089     removeListener(event: 'focus', listener: Function): this;
12090     /**
12091      * Emitted when a result is available for `webContents.findInPage` request.
12092      */
12093     on(event: 'found-in-page', listener: (event: Event,
12094                                           result: Result) => void): this;
12095     off(event: 'found-in-page', listener: (event: Event,
12096                                           result: Result) => void): this;
12097     once(event: 'found-in-page', listener: (event: Event,
12098                                           result: Result) => void): this;
12099     addListener(event: 'found-in-page', listener: (event: Event,
12100                                           result: Result) => void): this;
12101     removeListener(event: 'found-in-page', listener: (event: Event,
12102                                           result: Result) => void): this;
12103     /**
12104      * Emitted when the mainFrame, an `<iframe>`, or a nested `<iframe>` is loaded
12105      * within the page.
12106      */
12107     on(event: 'frame-created', listener: (event: Event,
12108                                           details: FrameCreatedDetails) => void): this;
12109     off(event: 'frame-created', listener: (event: Event,
12110                                           details: FrameCreatedDetails) => void): this;
12111     once(event: 'frame-created', listener: (event: Event,
12112                                           details: FrameCreatedDetails) => void): this;
12113     addListener(event: 'frame-created', listener: (event: Event,
12114                                           details: FrameCreatedDetails) => void): this;
12115     removeListener(event: 'frame-created', listener: (event: Event,
12116                                           details: FrameCreatedDetails) => void): this;
12117     /**
12118      * Emitted when an input event is sent to the WebContents. See InputEvent for
12119      * details.
12120      */
12121     on(event: 'input-event', listener: (event: Event,
12122                                         inputEvent: InputEvent) => void): this;
12123     off(event: 'input-event', listener: (event: Event,
12124                                         inputEvent: InputEvent) => void): this;
12125     once(event: 'input-event', listener: (event: Event,
12126                                         inputEvent: InputEvent) => void): this;
12127     addListener(event: 'input-event', listener: (event: Event,
12128                                         inputEvent: InputEvent) => void): this;
12129     removeListener(event: 'input-event', listener: (event: Event,
12130                                         inputEvent: InputEvent) => void): this;
12131     /**
12132      * Emitted when the renderer process sends an asynchronous message via
12133      * `ipcRenderer.send()`.
12134      *
12135      * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
12136      * responding to IPC messages specifically from this WebContents.
12137      */
12138     on(event: 'ipc-message', listener: (event: IpcMainEvent,
12139                                         channel: string,
12140                                         ...args: any[]) => void): this;
12141     off(event: 'ipc-message', listener: (event: IpcMainEvent,
12142                                         channel: string,
12143                                         ...args: any[]) => void): this;
12144     once(event: 'ipc-message', listener: (event: IpcMainEvent,
12145                                         channel: string,
12146                                         ...args: any[]) => void): this;
12147     addListener(event: 'ipc-message', listener: (event: IpcMainEvent,
12148                                         channel: string,
12149                                         ...args: any[]) => void): this;
12150     removeListener(event: 'ipc-message', listener: (event: IpcMainEvent,
12151                                         channel: string,
12152                                         ...args: any[]) => void): this;
12153     /**
12154      * Emitted when the renderer process sends a synchronous message via
12155      * `ipcRenderer.sendSync()`.
12156      *
12157      * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
12158      * responding to IPC messages specifically from this WebContents.
12159      */
12160     on(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
12161                                              channel: string,
12162                                              ...args: any[]) => void): this;
12163     off(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
12164                                              channel: string,
12165                                              ...args: any[]) => void): this;
12166     once(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
12167                                              channel: string,
12168                                              ...args: any[]) => void): this;
12169     addListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
12170                                              channel: string,
12171                                              ...args: any[]) => void): this;
12172     removeListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
12173                                              channel: string,
12174                                              ...args: any[]) => void): this;
12175     /**
12176      * Emitted when the window leaves a full-screen state triggered by HTML API.
12177      */
12178     on(event: 'leave-html-full-screen', listener: Function): this;
12179     off(event: 'leave-html-full-screen', listener: Function): this;
12180     once(event: 'leave-html-full-screen', listener: Function): this;
12181     addListener(event: 'leave-html-full-screen', listener: Function): this;
12182     removeListener(event: 'leave-html-full-screen', listener: Function): this;
12183     /**
12184      * Emitted when `webContents` wants to do basic auth.
12185      *
12186      * The usage is the same with the `login` event of `app`.
12187      */
12188     on(event: 'login', listener: (event: Event,
12189                                   authenticationResponseDetails: AuthenticationResponseDetails,
12190                                   authInfo: AuthInfo,
12191                                   callback: (username?: string, password?: string) => void) => void): this;
12192     off(event: 'login', listener: (event: Event,
12193                                   authenticationResponseDetails: AuthenticationResponseDetails,
12194                                   authInfo: AuthInfo,
12195                                   callback: (username?: string, password?: string) => void) => void): this;
12196     once(event: 'login', listener: (event: Event,
12197                                   authenticationResponseDetails: AuthenticationResponseDetails,
12198                                   authInfo: AuthInfo,
12199                                   callback: (username?: string, password?: string) => void) => void): this;
12200     addListener(event: 'login', listener: (event: Event,
12201                                   authenticationResponseDetails: AuthenticationResponseDetails,
12202                                   authInfo: AuthInfo,
12203                                   callback: (username?: string, password?: string) => void) => void): this;
12204     removeListener(event: 'login', listener: (event: Event,
12205                                   authenticationResponseDetails: AuthenticationResponseDetails,
12206                                   authInfo: AuthInfo,
12207                                   callback: (username?: string, password?: string) => void) => void): this;
12208     /**
12209      * Emitted when media is paused or done playing.
12210      */
12211     on(event: 'media-paused', listener: Function): this;
12212     off(event: 'media-paused', listener: Function): this;
12213     once(event: 'media-paused', listener: Function): this;
12214     addListener(event: 'media-paused', listener: Function): this;
12215     removeListener(event: 'media-paused', listener: Function): this;
12216     /**
12217      * Emitted when media starts playing.
12218      */
12219     on(event: 'media-started-playing', listener: Function): this;
12220     off(event: 'media-started-playing', listener: Function): this;
12221     once(event: 'media-started-playing', listener: Function): this;
12222     addListener(event: 'media-started-playing', listener: Function): this;
12223     removeListener(event: 'media-started-playing', listener: Function): this;
12224     /**
12225      * Emitted when page receives favicon urls.
12226      */
12227     on(event: 'page-favicon-updated', listener: (event: Event,
12228                                                  /**
12229                                                   * Array of URLs.
12230                                                   */
12231                                                  favicons: string[]) => void): this;
12232     off(event: 'page-favicon-updated', listener: (event: Event,
12233                                                  /**
12234                                                   * Array of URLs.
12235                                                   */
12236                                                  favicons: string[]) => void): this;
12237     once(event: 'page-favicon-updated', listener: (event: Event,
12238                                                  /**
12239                                                   * Array of URLs.
12240                                                   */
12241                                                  favicons: string[]) => void): this;
12242     addListener(event: 'page-favicon-updated', listener: (event: Event,
12243                                                  /**
12244                                                   * Array of URLs.
12245                                                   */
12246                                                  favicons: string[]) => void): this;
12247     removeListener(event: 'page-favicon-updated', listener: (event: Event,
12248                                                  /**
12249                                                   * Array of URLs.
12250                                                   */
12251                                                  favicons: string[]) => void): this;
12252     /**
12253      * Fired when page title is set during navigation. `explicitSet` is false when
12254      * title is synthesized from file url.
12255      */
12256     on(event: 'page-title-updated', listener: (event: Event,
12257                                                title: string,
12258                                                explicitSet: boolean) => void): this;
12259     off(event: 'page-title-updated', listener: (event: Event,
12260                                                title: string,
12261                                                explicitSet: boolean) => void): this;
12262     once(event: 'page-title-updated', listener: (event: Event,
12263                                                title: string,
12264                                                explicitSet: boolean) => void): this;
12265     addListener(event: 'page-title-updated', listener: (event: Event,
12266                                                title: string,
12267                                                explicitSet: boolean) => void): this;
12268     removeListener(event: 'page-title-updated', listener: (event: Event,
12269                                                title: string,
12270                                                explicitSet: boolean) => void): this;
12271     /**
12272      * Emitted when a new frame is generated. Only the dirty area is passed in the
12273      * buffer.
12274      */
12275     on(event: 'paint', listener: (event: Event,
12276                                   dirtyRect: Rectangle,
12277                                   /**
12278                                    * The image data of the whole frame.
12279                                    */
12280                                   image: NativeImage) => void): this;
12281     off(event: 'paint', listener: (event: Event,
12282                                   dirtyRect: Rectangle,
12283                                   /**
12284                                    * The image data of the whole frame.
12285                                    */
12286                                   image: NativeImage) => void): this;
12287     once(event: 'paint', listener: (event: Event,
12288                                   dirtyRect: Rectangle,
12289                                   /**
12290                                    * The image data of the whole frame.
12291                                    */
12292                                   image: NativeImage) => void): this;
12293     addListener(event: 'paint', listener: (event: Event,
12294                                   dirtyRect: Rectangle,
12295                                   /**
12296                                    * The image data of the whole frame.
12297                                    */
12298                                   image: NativeImage) => void): this;
12299     removeListener(event: 'paint', listener: (event: Event,
12300                                   dirtyRect: Rectangle,
12301                                   /**
12302                                    * The image data of the whole frame.
12303                                    */
12304                                   image: NativeImage) => void): this;
12305     /**
12306      * Emitted when a plugin process has crashed.
12307      */
12308     on(event: 'plugin-crashed', listener: (event: Event,
12309                                            name: string,
12310                                            version: string) => void): this;
12311     off(event: 'plugin-crashed', listener: (event: Event,
12312                                            name: string,
12313                                            version: string) => void): this;
12314     once(event: 'plugin-crashed', listener: (event: Event,
12315                                            name: string,
12316                                            version: string) => void): this;
12317     addListener(event: 'plugin-crashed', listener: (event: Event,
12318                                            name: string,
12319                                            version: string) => void): this;
12320     removeListener(event: 'plugin-crashed', listener: (event: Event,
12321                                            name: string,
12322                                            version: string) => void): this;
12323     /**
12324      * Emitted when the `WebContents` preferred size has changed.
12325      *
12326      * This event will only be emitted when `enablePreferredSizeMode` is set to `true`
12327      * in `webPreferences`.
12328      */
12329     on(event: 'preferred-size-changed', listener: (event: Event,
12330                                                    /**
12331                                                     * The minimum size needed to contain the layout of the document—without requiring
12332                                                     * scrolling.
12333                                                     */
12334                                                    preferredSize: Size) => void): this;
12335     off(event: 'preferred-size-changed', listener: (event: Event,
12336                                                    /**
12337                                                     * The minimum size needed to contain the layout of the document—without requiring
12338                                                     * scrolling.
12339                                                     */
12340                                                    preferredSize: Size) => void): this;
12341     once(event: 'preferred-size-changed', listener: (event: Event,
12342                                                    /**
12343                                                     * The minimum size needed to contain the layout of the document—without requiring
12344                                                     * scrolling.
12345                                                     */
12346                                                    preferredSize: Size) => void): this;
12347     addListener(event: 'preferred-size-changed', listener: (event: Event,
12348                                                    /**
12349                                                     * The minimum size needed to contain the layout of the document—without requiring
12350                                                     * scrolling.
12351                                                     */
12352                                                    preferredSize: Size) => void): this;
12353     removeListener(event: 'preferred-size-changed', listener: (event: Event,
12354                                                    /**
12355                                                     * The minimum size needed to contain the layout of the document—without requiring
12356                                                     * scrolling.
12357                                                     */
12358                                                    preferredSize: Size) => void): this;
12359     /**
12360      * Emitted when the preload script `preloadPath` throws an unhandled exception
12361      * `error`.
12362      */
12363     on(event: 'preload-error', listener: (event: Event,
12364                                           preloadPath: string,
12365                                           error: Error) => void): this;
12366     off(event: 'preload-error', listener: (event: Event,
12367                                           preloadPath: string,
12368                                           error: Error) => void): this;
12369     once(event: 'preload-error', listener: (event: Event,
12370                                           preloadPath: string,
12371                                           error: Error) => void): this;
12372     addListener(event: 'preload-error', listener: (event: Event,
12373                                           preloadPath: string,
12374                                           error: Error) => void): this;
12375     removeListener(event: 'preload-error', listener: (event: Event,
12376                                           preloadPath: string,
12377                                           error: Error) => void): this;
12378     /**
12379      * Emitted when the renderer process unexpectedly disappears.  This is normally
12380      * because it was crashed or killed.
12381      */
12382     on(event: 'render-process-gone', listener: (event: Event,
12383                                                 details: RenderProcessGoneDetails) => void): this;
12384     off(event: 'render-process-gone', listener: (event: Event,
12385                                                 details: RenderProcessGoneDetails) => void): this;
12386     once(event: 'render-process-gone', listener: (event: Event,
12387                                                 details: RenderProcessGoneDetails) => void): this;
12388     addListener(event: 'render-process-gone', listener: (event: Event,
12389                                                 details: RenderProcessGoneDetails) => void): this;
12390     removeListener(event: 'render-process-gone', listener: (event: Event,
12391                                                 details: RenderProcessGoneDetails) => void): this;
12392     /**
12393      * Emitted when the unresponsive web page becomes responsive again.
12394      */
12395     on(event: 'responsive', listener: Function): this;
12396     off(event: 'responsive', listener: Function): this;
12397     once(event: 'responsive', listener: Function): this;
12398     addListener(event: 'responsive', listener: Function): this;
12399     removeListener(event: 'responsive', listener: Function): this;
12400     /**
12401      * Emitted when a bluetooth device needs to be selected when a call to
12402      * `navigator.bluetooth.requestDevice` is made. `callback` should be called with
12403      * the `deviceId` of the device to be selected.  Passing an empty string to
12404      * `callback` will cancel the request.
12405      *
12406      * If an event listener is not added for this event, or if `event.preventDefault`
12407      * is not called when handling this event, the first available device will be
12408      * automatically selected.
12409      *
12410      * Due to the nature of bluetooth, scanning for devices when
12411      * `navigator.bluetooth.requestDevice` is called may take time and will cause
12412      * `select-bluetooth-device` to fire multiple times until `callback` is called with
12413      * either a device id or an empty string to cancel the request.
12414      */
12415     on(event: 'select-bluetooth-device', listener: (event: Event,
12416                                                     devices: BluetoothDevice[],
12417                                                     callback: (deviceId: string) => void) => void): this;
12418     off(event: 'select-bluetooth-device', listener: (event: Event,
12419                                                     devices: BluetoothDevice[],
12420                                                     callback: (deviceId: string) => void) => void): this;
12421     once(event: 'select-bluetooth-device', listener: (event: Event,
12422                                                     devices: BluetoothDevice[],
12423                                                     callback: (deviceId: string) => void) => void): this;
12424     addListener(event: 'select-bluetooth-device', listener: (event: Event,
12425                                                     devices: BluetoothDevice[],
12426                                                     callback: (deviceId: string) => void) => void): this;
12427     removeListener(event: 'select-bluetooth-device', listener: (event: Event,
12428                                                     devices: BluetoothDevice[],
12429                                                     callback: (deviceId: string) => void) => void): this;
12430     /**
12431      * Emitted when a client certificate is requested.
12432      *
12433      * The usage is the same with the `select-client-certificate` event of `app`.
12434      */
12435     on(event: 'select-client-certificate', listener: (event: Event,
12436                                                       url: string,
12437                                                       certificateList: Certificate[],
12438                                                       callback: (certificate: Certificate) => void) => void): this;
12439     off(event: 'select-client-certificate', listener: (event: Event,
12440                                                       url: string,
12441                                                       certificateList: Certificate[],
12442                                                       callback: (certificate: Certificate) => void) => void): this;
12443     once(event: 'select-client-certificate', listener: (event: Event,
12444                                                       url: string,
12445                                                       certificateList: Certificate[],
12446                                                       callback: (certificate: Certificate) => void) => void): this;
12447     addListener(event: 'select-client-certificate', listener: (event: Event,
12448                                                       url: string,
12449                                                       certificateList: Certificate[],
12450                                                       callback: (certificate: Certificate) => void) => void): this;
12451     removeListener(event: 'select-client-certificate', listener: (event: Event,
12452                                                       url: string,
12453                                                       certificateList: Certificate[],
12454                                                       callback: (certificate: Certificate) => void) => void): this;
12455     /**
12456      * Emitted when the web page becomes unresponsive.
12457      */
12458     on(event: 'unresponsive', listener: Function): this;
12459     off(event: 'unresponsive', listener: Function): this;
12460     once(event: 'unresponsive', listener: Function): this;
12461     addListener(event: 'unresponsive', listener: Function): this;
12462     removeListener(event: 'unresponsive', listener: Function): this;
12463     /**
12464      * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
12465      */
12466     on(event: 'update-target-url', listener: (event: Event,
12467                                               url: string) => void): this;
12468     off(event: 'update-target-url', listener: (event: Event,
12469                                               url: string) => void): this;
12470     once(event: 'update-target-url', listener: (event: Event,
12471                                               url: string) => void): this;
12472     addListener(event: 'update-target-url', listener: (event: Event,
12473                                               url: string) => void): this;
12474     removeListener(event: 'update-target-url', listener: (event: Event,
12475                                               url: string) => void): this;
12476     /**
12477      * Emitted when a `<webview>`'s web contents is being attached to this web
12478      * contents. Calling `event.preventDefault()` will destroy the guest page.
12479      *
12480      * This event can be used to configure `webPreferences` for the `webContents` of a
12481      * `<webview>` before it's loaded, and provides the ability to set settings that
12482      * can't be set via `<webview>` attributes.
12483      */
12484     on(event: 'will-attach-webview', listener: (event: Event,
12485                                                 /**
12486                                                  * The web preferences that will be used by the guest page. This object can be
12487                                                  * modified to adjust the preferences for the guest page.
12488                                                  */
12489                                                 webPreferences: WebPreferences,
12490                                                 /**
12491                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
12492                                                  * modified to adjust the parameters of the guest page.
12493                                                  */
12494                                                 params: Record<string, string>) => void): this;
12495     off(event: 'will-attach-webview', listener: (event: Event,
12496                                                 /**
12497                                                  * The web preferences that will be used by the guest page. This object can be
12498                                                  * modified to adjust the preferences for the guest page.
12499                                                  */
12500                                                 webPreferences: WebPreferences,
12501                                                 /**
12502                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
12503                                                  * modified to adjust the parameters of the guest page.
12504                                                  */
12505                                                 params: Record<string, string>) => void): this;
12506     once(event: 'will-attach-webview', listener: (event: Event,
12507                                                 /**
12508                                                  * The web preferences that will be used by the guest page. This object can be
12509                                                  * modified to adjust the preferences for the guest page.
12510                                                  */
12511                                                 webPreferences: WebPreferences,
12512                                                 /**
12513                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
12514                                                  * modified to adjust the parameters of the guest page.
12515                                                  */
12516                                                 params: Record<string, string>) => void): this;
12517     addListener(event: 'will-attach-webview', listener: (event: Event,
12518                                                 /**
12519                                                  * The web preferences that will be used by the guest page. This object can be
12520                                                  * modified to adjust the preferences for the guest page.
12521                                                  */
12522                                                 webPreferences: WebPreferences,
12523                                                 /**
12524                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
12525                                                  * modified to adjust the parameters of the guest page.
12526                                                  */
12527                                                 params: Record<string, string>) => void): this;
12528     removeListener(event: 'will-attach-webview', listener: (event: Event,
12529                                                 /**
12530                                                  * The web preferences that will be used by the guest page. This object can be
12531                                                  * modified to adjust the preferences for the guest page.
12532                                                  */
12533                                                 webPreferences: WebPreferences,
12534                                                 /**
12535                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
12536                                                  * modified to adjust the parameters of the guest page.
12537                                                  */
12538                                                 params: Record<string, string>) => void): this;
12539     /**
12540      * Emitted when a user or the page wants to start navigation in any frame. It can
12541      * happen when the `window.location` object is changed or a user clicks a link in
12542      * the page.
12543      *
12544      * Unlike `will-navigate`, `will-frame-navigate` is fired when the main frame or
12545      * any of its subframes attempts to navigate. When the navigation event comes from
12546      * the main frame, `isMainFrame` will be `true`.
12547      *
12548      * This event will not emit when the navigation is started programmatically with
12549      * APIs like `webContents.loadURL` and `webContents.back`.
12550      *
12551      * It is also not emitted for in-page navigations, such as clicking anchor links or
12552      * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
12553      * purpose.
12554      *
12555      * Calling `event.preventDefault()` will prevent the navigation.
12556      */
12557     on(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
12558     off(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
12559     once(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
12560     addListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
12561     removeListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
12562     /**
12563      * Emitted when a user or the page wants to start navigation on the main frame. It
12564      * can happen when the `window.location` object is changed or a user clicks a link
12565      * in the page.
12566      *
12567      * This event will not emit when the navigation is started programmatically with
12568      * APIs like `webContents.loadURL` and `webContents.back`.
12569      *
12570      * It is also not emitted for in-page navigations, such as clicking anchor links or
12571      * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
12572      * purpose.
12573      *
12574      * Calling `event.preventDefault()` will prevent the navigation.
12575      */
12576     on(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
12577                                           /**
12578                                            * @deprecated
12579                                            */
12580                                           url: string,
12581                                           /**
12582                                            * @deprecated
12583                                            */
12584                                           isInPlace: boolean,
12585                                           /**
12586                                            * @deprecated
12587                                            */
12588                                           isMainFrame: boolean,
12589                                           /**
12590                                            * @deprecated
12591                                            */
12592                                           frameProcessId: number,
12593                                           /**
12594                                            * @deprecated
12595                                            */
12596                                           frameRoutingId: number) => void): this;
12597     off(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
12598                                           /**
12599                                            * @deprecated
12600                                            */
12601                                           url: string,
12602                                           /**
12603                                            * @deprecated
12604                                            */
12605                                           isInPlace: boolean,
12606                                           /**
12607                                            * @deprecated
12608                                            */
12609                                           isMainFrame: boolean,
12610                                           /**
12611                                            * @deprecated
12612                                            */
12613                                           frameProcessId: number,
12614                                           /**
12615                                            * @deprecated
12616                                            */
12617                                           frameRoutingId: number) => void): this;
12618     once(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
12619                                           /**
12620                                            * @deprecated
12621                                            */
12622                                           url: string,
12623                                           /**
12624                                            * @deprecated
12625                                            */
12626                                           isInPlace: boolean,
12627                                           /**
12628                                            * @deprecated
12629                                            */
12630                                           isMainFrame: boolean,
12631                                           /**
12632                                            * @deprecated
12633                                            */
12634                                           frameProcessId: number,
12635                                           /**
12636                                            * @deprecated
12637                                            */
12638                                           frameRoutingId: number) => void): this;
12639     addListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
12640                                           /**
12641                                            * @deprecated
12642                                            */
12643                                           url: string,
12644                                           /**
12645                                            * @deprecated
12646                                            */
12647                                           isInPlace: boolean,
12648                                           /**
12649                                            * @deprecated
12650                                            */
12651                                           isMainFrame: boolean,
12652                                           /**
12653                                            * @deprecated
12654                                            */
12655                                           frameProcessId: number,
12656                                           /**
12657                                            * @deprecated
12658                                            */
12659                                           frameRoutingId: number) => void): this;
12660     removeListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
12661                                           /**
12662                                            * @deprecated
12663                                            */
12664                                           url: string,
12665                                           /**
12666                                            * @deprecated
12667                                            */
12668                                           isInPlace: boolean,
12669                                           /**
12670                                            * @deprecated
12671                                            */
12672                                           isMainFrame: boolean,
12673                                           /**
12674                                            * @deprecated
12675                                            */
12676                                           frameProcessId: number,
12677                                           /**
12678                                            * @deprecated
12679                                            */
12680                                           frameRoutingId: number) => void): this;
12681     /**
12682      * Emitted when a `beforeunload` event handler is attempting to cancel a page
12683      * unload.
12684      *
12685      * Calling `event.preventDefault()` will ignore the `beforeunload` event handler
12686      * and allow the page to be unloaded.
12687      *
12688      * **Note:** This will be emitted for `BrowserViews` but will _not_ be respected -
12689      * this is because we have chosen not to tie the `BrowserView` lifecycle to its
12690      * owning BrowserWindow should one exist per the specification.
12691      */
12692     on(event: 'will-prevent-unload', listener: (event: Event) => void): this;
12693     off(event: 'will-prevent-unload', listener: (event: Event) => void): this;
12694     once(event: 'will-prevent-unload', listener: (event: Event) => void): this;
12695     addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
12696     removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
12697     /**
12698      * Emitted when a server side redirect occurs during navigation.  For example a 302
12699      * redirect.
12700      *
12701      * This event will be emitted after `did-start-navigation` and always before the
12702      * `did-redirect-navigation` event for the same navigation.
12703      *
12704      * Calling `event.preventDefault()` will prevent the navigation (not just the
12705      * redirect).
12706      */
12707     on(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
12708                                           /**
12709                                            * @deprecated
12710                                            */
12711                                           url: string,
12712                                           /**
12713                                            * @deprecated
12714                                            */
12715                                           isInPlace: boolean,
12716                                           /**
12717                                            * @deprecated
12718                                            */
12719                                           isMainFrame: boolean,
12720                                           /**
12721                                            * @deprecated
12722                                            */
12723                                           frameProcessId: number,
12724                                           /**
12725                                            * @deprecated
12726                                            */
12727                                           frameRoutingId: number) => void): this;
12728     off(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
12729                                           /**
12730                                            * @deprecated
12731                                            */
12732                                           url: string,
12733                                           /**
12734                                            * @deprecated
12735                                            */
12736                                           isInPlace: boolean,
12737                                           /**
12738                                            * @deprecated
12739                                            */
12740                                           isMainFrame: boolean,
12741                                           /**
12742                                            * @deprecated
12743                                            */
12744                                           frameProcessId: number,
12745                                           /**
12746                                            * @deprecated
12747                                            */
12748                                           frameRoutingId: number) => void): this;
12749     once(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
12750                                           /**
12751                                            * @deprecated
12752                                            */
12753                                           url: string,
12754                                           /**
12755                                            * @deprecated
12756                                            */
12757                                           isInPlace: boolean,
12758                                           /**
12759                                            * @deprecated
12760                                            */
12761                                           isMainFrame: boolean,
12762                                           /**
12763                                            * @deprecated
12764                                            */
12765                                           frameProcessId: number,
12766                                           /**
12767                                            * @deprecated
12768                                            */
12769                                           frameRoutingId: number) => void): this;
12770     addListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
12771                                           /**
12772                                            * @deprecated
12773                                            */
12774                                           url: string,
12775                                           /**
12776                                            * @deprecated
12777                                            */
12778                                           isInPlace: boolean,
12779                                           /**
12780                                            * @deprecated
12781                                            */
12782                                           isMainFrame: boolean,
12783                                           /**
12784                                            * @deprecated
12785                                            */
12786                                           frameProcessId: number,
12787                                           /**
12788                                            * @deprecated
12789                                            */
12790                                           frameRoutingId: number) => void): this;
12791     removeListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
12792                                           /**
12793                                            * @deprecated
12794                                            */
12795                                           url: string,
12796                                           /**
12797                                            * @deprecated
12798                                            */
12799                                           isInPlace: boolean,
12800                                           /**
12801                                            * @deprecated
12802                                            */
12803                                           isMainFrame: boolean,
12804                                           /**
12805                                            * @deprecated
12806                                            */
12807                                           frameProcessId: number,
12808                                           /**
12809                                            * @deprecated
12810                                            */
12811                                           frameRoutingId: number) => void): this;
12812     /**
12813      * Emitted when the user is requesting to change the zoom level using the mouse
12814      * wheel.
12815      */
12816     on(event: 'zoom-changed', listener: (event: Event,
12817                                          /**
12818                                           * Can be `in` or `out`.
12819                                           */
12820                                          zoomDirection: ('in' | 'out')) => void): this;
12821     off(event: 'zoom-changed', listener: (event: Event,
12822                                          /**
12823                                           * Can be `in` or `out`.
12824                                           */
12825                                          zoomDirection: ('in' | 'out')) => void): this;
12826     once(event: 'zoom-changed', listener: (event: Event,
12827                                          /**
12828                                           * Can be `in` or `out`.
12829                                           */
12830                                          zoomDirection: ('in' | 'out')) => void): this;
12831     addListener(event: 'zoom-changed', listener: (event: Event,
12832                                          /**
12833                                           * Can be `in` or `out`.
12834                                           */
12835                                          zoomDirection: ('in' | 'out')) => void): this;
12836     removeListener(event: 'zoom-changed', listener: (event: Event,
12837                                          /**
12838                                           * Can be `in` or `out`.
12839                                           */
12840                                          zoomDirection: ('in' | 'out')) => void): this;
12841     /**
12842      * Adds the specified path to DevTools workspace. Must be used after DevTools
12843      * creation:
12844      */
12845     addWorkSpace(path: string): void;
12846     /**
12847      * Adjusts the current text selection starting and ending points in the focused
12848      * frame by the given amounts. A negative amount moves the selection towards the
12849      * beginning of the document, and a positive amount moves the selection towards the
12850      * end of the document.
12851      *
12852      * Example:
12853      *
12854      * For a call of `win.webContents.adjustSelection({ start: 1, end: 5 })`
12855      *
12856      * Before:
12857      *
12858      * <img width="487" alt="Image Before Text Selection Adjustment"
12859      * src="../images/web-contents-text-selection-before.png"/>
12860      *
12861      * After:
12862      *
12863      * <img width="487" alt="Image After Text Selection Adjustment"
12864      * src="../images/web-contents-text-selection-after.png"/>
12865      */
12866     adjustSelection(options: AdjustSelectionOptions): void;
12867     /**
12868      * Begin subscribing for presentation events and captured frames, the `callback`
12869      * will be called with `callback(image, dirtyRect)` when there is a presentation
12870      * event.
12871      *
12872      * The `image` is an instance of NativeImage that stores the captured frame.
12873      *
12874      * The `dirtyRect` is an object with `x, y, width, height` properties that
12875      * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
12876      * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
12877      */
12878     beginFrameSubscription(onlyDirty: boolean, callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
12879     /**
12880      * Begin subscribing for presentation events and captured frames, the `callback`
12881      * will be called with `callback(image, dirtyRect)` when there is a presentation
12882      * event.
12883      *
12884      * The `image` is an instance of NativeImage that stores the captured frame.
12885      *
12886      * The `dirtyRect` is an object with `x, y, width, height` properties that
12887      * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
12888      * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
12889      */
12890     beginFrameSubscription(callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
12891     /**
12892      * Whether the browser can go back to previous web page.
12893      */
12894     canGoBack(): boolean;
12895     /**
12896      * Whether the browser can go forward to next web page.
12897      */
12898     canGoForward(): boolean;
12899     /**
12900      * Whether the web page can go to `offset`.
12901      */
12902     canGoToOffset(offset: number): boolean;
12903     /**
12904      * Resolves with a NativeImage
12905      *
12906      * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
12907      * whole visible page. The page is considered visible when its browser window is
12908      * hidden and the capturer count is non-zero. If you would like the page to stay
12909      * hidden, you should ensure that `stayHidden` is set to true.
12910      */
12911     capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
12912     /**
12913      * Centers the current text selection in web page.
12914      */
12915     centerSelection(): void;
12916     /**
12917      * Clears the navigation history.
12918      */
12919     clearHistory(): void;
12920     /**
12921      * Closes the page, as if the web content had called `window.close()`.
12922      *
12923      * If the page is successfully closed (i.e. the unload is not prevented by the
12924      * page, or `waitForBeforeUnload` is false or unspecified), the WebContents will be
12925      * destroyed and no longer usable. The `destroyed` event will be emitted.
12926      */
12927     close(opts?: CloseOpts): void;
12928     /**
12929      * Closes the devtools.
12930      */
12931     closeDevTools(): void;
12932     /**
12933      * Executes the editing command `copy` in web page.
12934      */
12935     copy(): void;
12936     /**
12937      * Copy the image at the given position to the clipboard.
12938      */
12939     copyImageAt(x: number, y: number): void;
12940     /**
12941      * Executes the editing command `cut` in web page.
12942      */
12943     cut(): void;
12944     /**
12945      * Executes the editing command `delete` in web page.
12946      */
12947     delete(): void;
12948     /**
12949      * Disable device emulation enabled by `webContents.enableDeviceEmulation`.
12950      */
12951     disableDeviceEmulation(): void;
12952     /**
12953      * Initiates a download of the resource at `url` without navigating. The
12954      * `will-download` event of `session` will be triggered.
12955      */
12956     downloadURL(url: string, options?: DownloadURLOptions): void;
12957     /**
12958      * Enable device emulation with the given parameters.
12959      */
12960     enableDeviceEmulation(parameters: Parameters): void;
12961     /**
12962      * End subscribing for frame presentation events.
12963      */
12964     endFrameSubscription(): void;
12965     /**
12966      * A promise that resolves with the result of the executed code or is rejected if
12967      * the result of the code is a rejected promise.
12968      *
12969      * Evaluates `code` in page.
12970      *
12971      * In the browser window some HTML APIs like `requestFullScreen` can only be
12972      * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
12973      * this limitation.
12974      *
12975      * Code execution will be suspended until web page stop loading.
12976      */
12977     executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
12978     /**
12979      * A promise that resolves with the result of the executed code or is rejected if
12980      * the result of the code is a rejected promise.
12981      *
12982      * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
12983      */
12984     executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean): Promise<any>;
12985     /**
12986      * The request id used for the request.
12987      *
12988      * Starts a request to find all matches for the `text` in the web page. The result
12989      * of the request can be obtained by subscribing to `found-in-page` event.
12990      */
12991     findInPage(text: string, options?: FindInPageOptions): number;
12992     /**
12993      * Focuses the web page.
12994      */
12995     focus(): void;
12996     /**
12997      * Forcefully terminates the renderer process that is currently hosting this
12998      * `webContents`. This will cause the `render-process-gone` event to be emitted
12999      * with the `reason=killed || reason=crashed`. Please note that some webContents
13000      * share renderer processes and therefore calling this method may also crash the
13001      * host process for other webContents as well.
13002      *
13003      * Calling `reload()` immediately after calling this method will force the reload
13004      * to occur in a new process. This should be used when this process is unstable or
13005      * unusable, for instance in order to recover from the `unresponsive` event.
13006      */
13007     forcefullyCrashRenderer(): void;
13008     /**
13009      * Information about all Shared Workers.
13010      */
13011     getAllSharedWorkers(): SharedWorkerInfo[];
13012     /**
13013      * whether or not this WebContents will throttle animations and timers when the
13014      * page becomes backgrounded. This also affects the Page Visibility API.
13015      */
13016     getBackgroundThrottling(): boolean;
13017     /**
13018      * the current title of the DevTools window. This will only be visible if DevTools
13019      * is opened in `undocked` or `detach` mode.
13020      */
13021     getDevToolsTitle(): string;
13022     /**
13023      * If _offscreen rendering_ is enabled returns the current frame rate.
13024      */
13025     getFrameRate(): number;
13026     /**
13027      * The identifier of a WebContents stream. This identifier can be used with
13028      * `navigator.mediaDevices.getUserMedia` using a `chromeMediaSource` of `tab`. The
13029      * identifier is restricted to the web contents that it is registered to and is
13030      * only valid for 10 seconds.
13031      */
13032     getMediaSourceId(requestWebContents: WebContents): string;
13033     /**
13034      * The operating system `pid` of the associated renderer process.
13035      */
13036     getOSProcessId(): number;
13037     /**
13038      * Get the system printer list.
13039      *
13040      * Resolves with a `PrinterInfo[]`
13041      */
13042     getPrintersAsync(): Promise<Electron.PrinterInfo[]>;
13043     /**
13044      * The Chromium internal `pid` of the associated renderer. Can be compared to the
13045      * `frameProcessId` passed by frame specific navigation events (e.g.
13046      * `did-frame-navigate`)
13047      */
13048     getProcessId(): number;
13049     /**
13050      * The title of the current web page.
13051      */
13052     getTitle(): string;
13053     /**
13054      * the type of the webContent. Can be `backgroundPage`, `window`, `browserView`,
13055      * `remote`, `webview` or `offscreen`.
13056      */
13057     getType(): ('backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen');
13058     /**
13059      * The URL of the current web page.
13060      */
13061     getURL(): string;
13062     /**
13063      * The user agent for this web page.
13064      */
13065     getUserAgent(): string;
13066     /**
13067      * Returns the WebRTC IP Handling Policy.
13068      */
13069     getWebRTCIPHandlingPolicy(): string;
13070     /**
13071      * * `min` Integer - The minimum UDP port number that WebRTC should use.
13072      * * `max` Integer - The maximum UDP port number that WebRTC should use.
13073      *
13074      * By default this value is `{ min: 0, max: 0 }` , which would apply no restriction
13075      * on the udp port range.
13076      */
13077     getWebRTCUDPPortRange(): WebRTCUDPPortRange;
13078     /**
13079      * the current zoom factor.
13080      */
13081     getZoomFactor(): number;
13082     /**
13083      * the current zoom level.
13084      */
13085     getZoomLevel(): number;
13086     /**
13087      * Makes the browser go back a web page.
13088      */
13089     goBack(): void;
13090     /**
13091      * Makes the browser go forward a web page.
13092      */
13093     goForward(): void;
13094     /**
13095      * Navigates browser to the specified absolute web page index.
13096      */
13097     goToIndex(index: number): void;
13098     /**
13099      * Navigates to the specified offset from the "current entry".
13100      */
13101     goToOffset(offset: number): void;
13102     /**
13103      * A promise that resolves with a key for the inserted CSS that can later be used
13104      * to remove the CSS via `contents.removeInsertedCSS(key)`.
13105      *
13106      * Injects CSS into the current web page and returns a unique key for the inserted
13107      * stylesheet.
13108      */
13109     insertCSS(css: string, options?: InsertCSSOptions): Promise<string>;
13110     /**
13111      * Inserts `text` to the focused element.
13112      */
13113     insertText(text: string): Promise<void>;
13114     /**
13115      * Starts inspecting element at position (`x`, `y`).
13116      */
13117     inspectElement(x: number, y: number): void;
13118     /**
13119      * Opens the developer tools for the service worker context.
13120      */
13121     inspectServiceWorker(): void;
13122     /**
13123      * Opens the developer tools for the shared worker context.
13124      */
13125     inspectSharedWorker(): void;
13126     /**
13127      * Inspects the shared worker based on its ID.
13128      */
13129     inspectSharedWorkerById(workerId: string): void;
13130     /**
13131      * Schedules a full repaint of the window this web contents is in.
13132      *
13133      * If _offscreen rendering_ is enabled invalidates the frame and generates a new
13134      * one through the `'paint'` event.
13135      */
13136     invalidate(): void;
13137     /**
13138      * Whether this page has been muted.
13139      */
13140     isAudioMuted(): boolean;
13141     /**
13142      * Whether this page is being captured. It returns true when the capturer count is
13143      * large then 0.
13144      */
13145     isBeingCaptured(): boolean;
13146     /**
13147      * Whether the renderer process has crashed.
13148      */
13149     isCrashed(): boolean;
13150     /**
13151      * Whether audio is currently playing.
13152      */
13153     isCurrentlyAudible(): boolean;
13154     /**
13155      * Whether the web page is destroyed.
13156      */
13157     isDestroyed(): boolean;
13158     /**
13159      * Whether the devtools view is focused .
13160      */
13161     isDevToolsFocused(): boolean;
13162     /**
13163      * Whether the devtools is opened.
13164      */
13165     isDevToolsOpened(): boolean;
13166     /**
13167      * Whether the web page is focused.
13168      */
13169     isFocused(): boolean;
13170     /**
13171      * Whether web page is still loading resources.
13172      */
13173     isLoading(): boolean;
13174     /**
13175      * Whether the main frame (and not just iframes or frames within it) is still
13176      * loading.
13177      */
13178     isLoadingMainFrame(): boolean;
13179     /**
13180      * Indicates whether _offscreen rendering_ is enabled.
13181      */
13182     isOffscreen(): boolean;
13183     /**
13184      * If _offscreen rendering_ is enabled returns whether it is currently painting.
13185      */
13186     isPainting(): boolean;
13187     /**
13188      * Whether the web page is waiting for a first-response from the main resource of
13189      * the page.
13190      */
13191     isWaitingForResponse(): boolean;
13192     /**
13193      * the promise will resolve when the page has finished loading (see
13194      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
13195      *
13196      * Loads the given file in the window, `filePath` should be a path to an HTML file
13197      * relative to the root of your application.  For instance an app structure like
13198      * this:
13199      *
13200      * Would require code like this
13201      */
13202     loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
13203     /**
13204      * the promise will resolve when the page has finished loading (see
13205      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
13206      * A noop rejection handler is already attached, which avoids unhandled rejection
13207      * errors.
13208      *
13209      * Loads the `url` in the window. The `url` must contain the protocol prefix, e.g.
13210      * the `http://` or `file://`. If the load should bypass http cache then use the
13211      * `pragma` header to achieve it.
13212      */
13213     loadURL(url: string, options?: LoadURLOptions): Promise<void>;
13214     /**
13215      * Opens the devtools.
13216      *
13217      * When `contents` is a `<webview>` tag, the `mode` would be `detach` by default,
13218      * explicitly passing an empty `mode` can force using last used dock state.
13219      *
13220      * On Windows, if Windows Control Overlay is enabled, Devtools will be opened with
13221      * `mode: 'detach'`.
13222      */
13223     openDevTools(options?: OpenDevToolsOptions): void;
13224     /**
13225      * Executes the editing command `paste` in web page.
13226      */
13227     paste(): void;
13228     /**
13229      * Executes the editing command `pasteAndMatchStyle` in web page.
13230      */
13231     pasteAndMatchStyle(): void;
13232     /**
13233      * Send a message to the renderer process, optionally transferring ownership of
13234      * zero or more `MessagePortMain` objects.
13235      *
13236      * The transferred `MessagePortMain` objects will be available in the renderer
13237      * process by accessing the `ports` property of the emitted event. When they arrive
13238      * in the renderer, they will be native DOM `MessagePort` objects.
13239      *
13240      * For example:
13241      */
13242     postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
13243     /**
13244      * When a custom `pageSize` is passed, Chromium attempts to validate platform
13245      * specific minimum values for `width_microns` and `height_microns`. Width and
13246      * height must both be minimum 353 microns but may be higher on some operating
13247      * systems.
13248      *
13249      * Prints window's web page. When `silent` is set to `true`, Electron will pick the
13250      * system's default printer if `deviceName` is empty and the default settings for
13251      * printing.
13252      *
13253      * Use `page-break-before: always;` CSS style to force to print to a new page.
13254      *
13255      * Example usage:
13256      */
13257     print(options?: WebContentsPrintOptions, callback?: (success: boolean, failureReason: string) => void): void;
13258     /**
13259      * Resolves with the generated PDF data.
13260      *
13261      * Prints the window's web page as PDF.
13262      *
13263      * The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
13264      *
13265      * An example of `webContents.printToPDF`:
13266      *
13267      * See Page.printToPdf for more information.
13268      */
13269     printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
13270     /**
13271      * Executes the editing command `redo` in web page.
13272      */
13273     redo(): void;
13274     /**
13275      * Reloads the current web page.
13276      */
13277     reload(): void;
13278     /**
13279      * Reloads current page and ignores cache.
13280      */
13281     reloadIgnoringCache(): void;
13282     /**
13283      * Resolves if the removal was successful.
13284      *
13285      * Removes the inserted CSS from the current web page. The stylesheet is identified
13286      * by its key, which is returned from `contents.insertCSS(css)`.
13287      */
13288     removeInsertedCSS(key: string): Promise<void>;
13289     /**
13290      * Removes the specified path from DevTools workspace.
13291      */
13292     removeWorkSpace(path: string): void;
13293     /**
13294      * Executes the editing command `replace` in web page.
13295      */
13296     replace(text: string): void;
13297     /**
13298      * Executes the editing command `replaceMisspelling` in web page.
13299      */
13300     replaceMisspelling(text: string): void;
13301     /**
13302      * resolves if the page is saved.
13303      */
13304     savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
13305     /**
13306      * Scrolls to the bottom of the current `webContents`.
13307      */
13308     scrollToBottom(): void;
13309     /**
13310      * Scrolls to the top of the current `webContents`.
13311      */
13312     scrollToTop(): void;
13313     /**
13314      * Executes the editing command `selectAll` in web page.
13315      */
13316     selectAll(): void;
13317     /**
13318      * Send an asynchronous message to the renderer process via `channel`, along with
13319      * arguments. Arguments will be serialized with the Structured Clone Algorithm,
13320      * just like `postMessage`, so prototype chains will not be included. Sending
13321      * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
13322      *
13323      * :::warning
13324      *
13325      * Sending non-standard JavaScript types such as DOM objects or special Electron
13326      * objects will throw an exception.
13327      *
13328      * :::
13329      *
13330      * For additional reading, refer to Electron's IPC guide.
13331      */
13332     send(channel: string, ...args: any[]): void;
13333     /**
13334      * Sends an input `event` to the page. **Note:** The `BrowserWindow` containing the
13335      * contents needs to be focused for `sendInputEvent()` to work.
13336      */
13337     sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
13338     /**
13339      * Send an asynchronous message to a specific frame in a renderer process via
13340      * `channel`, along with arguments. Arguments will be serialized with the
13341      * Structured Clone Algorithm, just like `postMessage`, so prototype chains will
13342      * not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets
13343      * will throw an exception.
13344      *
13345      * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
13346      * Electron objects will throw an exception.
13347      *
13348      * The renderer process can handle the message by listening to `channel` with the
13349      * `ipcRenderer` module.
13350      *
13351      * If you want to get the `frameId` of a given renderer context you should use the
13352      * `webFrame.routingId` value.  E.g.
13353      *
13354      * You can also read `frameId` from all incoming IPC messages in the main process.
13355      */
13356     sendToFrame(frameId: (number) | ([number, number]), channel: string, ...args: any[]): void;
13357     /**
13358      * Mute the audio on the current web page.
13359      */
13360     setAudioMuted(muted: boolean): void;
13361     /**
13362      * Controls whether or not this WebContents will throttle animations and timers
13363      * when the page becomes backgrounded. This also affects the Page Visibility API.
13364      */
13365     setBackgroundThrottling(allowed: boolean): void;
13366     /**
13367      * Changes the title of the DevTools window to `title`. This will only be visible
13368      * if DevTools is opened in `undocked` or `detach` mode.
13369      */
13370     setDevToolsTitle(title: string): void;
13371     /**
13372      * Uses the `devToolsWebContents` as the target `WebContents` to show devtools.
13373      *
13374      * The `devToolsWebContents` must not have done any navigation, and it should not
13375      * be used for other purposes after the call.
13376      *
13377      * By default Electron manages the devtools by creating an internal `WebContents`
13378      * with native view, which developers have very limited control of. With the
13379      * `setDevToolsWebContents` method, developers can use any `WebContents` to show
13380      * the devtools in it, including `BrowserWindow`, `BrowserView` and `<webview>`
13381      * tag.
13382      *
13383      * Note that closing the devtools does not destroy the `devToolsWebContents`, it is
13384      * caller's responsibility to destroy `devToolsWebContents`.
13385      *
13386      * An example of showing devtools in a `<webview>` tag:
13387      *
13388      * An example of showing devtools in a `BrowserWindow`:
13389      */
13390     setDevToolsWebContents(devToolsWebContents: WebContents): void;
13391     /**
13392      * If _offscreen rendering_ is enabled sets the frame rate to the specified number.
13393      * Only values between 1 and 240 are accepted.
13394      */
13395     setFrameRate(fps: number): void;
13396     /**
13397      * Ignore application menu shortcuts while this web contents is focused.
13398      */
13399     setIgnoreMenuShortcuts(ignore: boolean): void;
13400     /**
13401      * Sets the image animation policy for this webContents.  The policy only affects
13402      * _new_ images, existing images that are currently being animated are unaffected.
13403      * This is a known limitation in Chromium, you can force image animation to be
13404      * recalculated with `img.src = img.src` which will result in no network traffic
13405      * but will update the animation policy.
13406      *
13407      * This corresponds to the animationPolicy accessibility feature in Chromium.
13408      */
13409     setImageAnimationPolicy(policy: 'animate' | 'animateOnce' | 'noAnimation'): void;
13410     /**
13411      * Overrides the user agent for this web page.
13412      */
13413     setUserAgent(userAgent: string): void;
13414     /**
13415      * Sets the maximum and minimum pinch-to-zoom level.
13416      *
13417      * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
13418      * call:
13419      */
13420     setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
13421     /**
13422      * Setting the WebRTC IP handling policy allows you to control which IPs are
13423      * exposed via WebRTC. See BrowserLeaks for more details.
13424      */
13425     setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
13426     /**
13427      * Setting the WebRTC UDP Port Range allows you to restrict the udp port range used
13428      * by WebRTC. By default the port range is unrestricted. **Note:** To reset to an
13429      * unrestricted port range this value should be set to `{ min: 0, max: 0 }`.
13430      */
13431     setWebRTCUDPPortRange(udpPortRange: UdpPortRange): void;
13432     /**
13433      * Called before creating a window a new window is requested by the renderer, e.g.
13434      * by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or
13435      * submitting a form with `<form target="_blank">`. See `window.open()` for more
13436      * details and how to use this in conjunction with `did-create-window`.
13437      */
13438     setWindowOpenHandler(handler: (details: HandlerDetails) => ({action: 'deny'}) | ({action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions})): void;
13439     /**
13440      * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
13441      * divided by 100, so 300% = 3.0.
13442      *
13443      * The factor must be greater than 0.0.
13444      */
13445     setZoomFactor(factor: number): void;
13446     /**
13447      * Changes the zoom level to the specified level. The original size is 0 and each
13448      * increment above or below represents zooming 20% larger or smaller to default
13449      * limits of 300% and 50% of original size, respectively. The formula for this is
13450      * `scale := 1.2 ^ level`.
13451      *
13452      * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
13453      * the zoom level for a specific domain propagates across all instances of windows
13454      * with the same domain. Differentiating the window URLs will make zoom work
13455      * per-window.
13456      */
13457     setZoomLevel(level: number): void;
13458     /**
13459      * Shows pop-up dictionary that searches the selected word on the page.
13460      *
13461      * @platform darwin
13462      */
13463     showDefinitionForSelection(): void;
13464     /**
13465      * Sets the `item` as dragging item for current drag-drop operation, `file` is the
13466      * absolute path of the file to be dragged, and `icon` is the image showing under
13467      * the cursor when dragging.
13468      */
13469     startDrag(item: Item): void;
13470     /**
13471      * If _offscreen rendering_ is enabled and not painting, start painting.
13472      */
13473     startPainting(): void;
13474     /**
13475      * Stops any pending navigation.
13476      */
13477     stop(): void;
13478     /**
13479      * Stops any `findInPage` request for the `webContents` with the provided `action`.
13480      */
13481     stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
13482     /**
13483      * If _offscreen rendering_ is enabled and painting, stop painting.
13484      */
13485     stopPainting(): void;
13486     /**
13487      * Indicates whether the snapshot has been created successfully.
13488      *
13489      * Takes a V8 heap snapshot and saves it to `filePath`.
13490      */
13491     takeHeapSnapshot(filePath: string): Promise<void>;
13492     /**
13493      * Toggles the developer tools.
13494      */
13495     toggleDevTools(): void;
13496     /**
13497      * Executes the editing command `undo` in web page.
13498      */
13499     undo(): void;
13500     /**
13501      * Executes the editing command `unselect` in web page.
13502      */
13503     unselect(): void;
13504     /**
13505      * A `boolean` property that determines whether this page is muted.
13506      */
13507     audioMuted: boolean;
13508     /**
13509      * A `boolean` property that determines whether or not this WebContents will
13510      * throttle animations and timers when the page becomes backgrounded. This also
13511      * affects the Page Visibility API.
13512      */
13513     backgroundThrottling: boolean;
13514     /**
13515      * A `Debugger` instance for this webContents.
13516      *
13517      */
13518     readonly debugger: Debugger;
13519     /**
13520      * A `WebContents | null` property that represents the of DevTools `WebContents`
13521      * associated with a given `WebContents`.
13522      *
13523      * **Note:** Users should never store this object because it may become `null` when
13524      * the DevTools has been closed.
13525      *
13526      */
13527     readonly devToolsWebContents: (WebContents) | (null);
13528     /**
13529      * An `Integer` property that sets the frame rate of the web contents to the
13530      * specified number. Only values between 1 and 240 are accepted.
13531      *
13532      * Only applicable if _offscreen rendering_ is enabled.
13533      */
13534     frameRate: number;
13535     /**
13536      * A `WebContents` instance that might own this `WebContents`.
13537      *
13538      */
13539     readonly hostWebContents: WebContents;
13540     /**
13541      * A `Integer` representing the unique ID of this WebContents. Each ID is unique
13542      * among all `WebContents` instances of the entire Electron application.
13543      *
13544      */
13545     readonly id: number;
13546     /**
13547      * An `IpcMain` scoped to just IPC messages sent from this WebContents.
13548      *
13549      * IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
13550      * `ipcRenderer.postMessage` will be delivered in the following order:
13551      *
13552      * * `contents.on('ipc-message')`
13553      * * `contents.mainFrame.on(channel)`
13554      * * `contents.ipc.on(channel)`
13555      * * `ipcMain.on(channel)`
13556      *
13557      * Handlers registered with `invoke` will be checked in the following order. The
13558      * first one that is defined will be called, the rest will be ignored.
13559      *
13560      * * `contents.mainFrame.handle(channel)`
13561      * * `contents.handle(channel)`
13562      * * `ipcMain.handle(channel)`
13563      *
13564      * A handler or event listener registered on the WebContents will receive IPC
13565      * messages sent from any frame, including child frames. In most cases, only the
13566      * main frame can send IPC messages. However, if the `nodeIntegrationInSubFrames`
13567      * option is enabled, it is possible for child frames to send IPC messages also. In
13568      * that case, handlers should check the `senderFrame` property of the IPC event to
13569      * ensure that the message is coming from the expected frame. Alternatively,
13570      * register handlers on the appropriate frame directly using the `WebFrameMain.ipc`
13571      * interface.
13572      *
13573      */
13574     readonly ipc: IpcMain;
13575     /**
13576      * A `WebFrameMain` property that represents the top frame of the page's frame
13577      * hierarchy.
13578      *
13579      */
13580     readonly mainFrame: WebFrameMain;
13581     /**
13582      * A `WebFrameMain` property that represents the frame that opened this
13583      * WebContents, either with open(), or by navigating a link with a target
13584      * attribute.
13585      *
13586      */
13587     readonly opener: WebFrameMain;
13588     /**
13589      * A `Session` used by this webContents.
13590      *
13591      */
13592     readonly session: Session;
13593     /**
13594      * A `string` property that determines the user agent for this web page.
13595      */
13596     userAgent: string;
13597     /**
13598      * A `number` property that determines the zoom factor for this web contents.
13599      *
13600      * The zoom factor is the zoom percent divided by 100, so 300% = 3.0.
13601      */
13602     zoomFactor: number;
13603     /**
13604      * A `number` property that determines the zoom level for this web contents.
13605      *
13606      * The original size is 0 and each increment above or below represents zooming 20%
13607      * larger or smaller to default limits of 300% and 50% of original size,
13608      * respectively. The formula for this is `scale := 1.2 ^ level`.
13609      */
13610     zoomLevel: number;
13611   }
13612
13613   interface WebFrame {
13614
13615     // Docs: https://electronjs.org/docs/api/web-frame
13616
13617     /**
13618      * Attempts to free memory that is no longer being used (like images from a
13619      * previous navigation).
13620      *
13621      * Note that blindly calling this method probably makes Electron slower since it
13622      * will have to refill these emptied caches, you should only call it if an event in
13623      * your app has occurred that makes you think your page is actually using less
13624      * memory (i.e. you have navigated from a super heavy page to a mostly empty one,
13625      * and intend to stay there).
13626      */
13627     clearCache(): void;
13628     /**
13629      * A promise that resolves with the result of the executed code or is rejected if
13630      * execution throws or results in a rejected promise.
13631      *
13632      * Evaluates `code` in page.
13633      *
13634      * In the browser window some HTML APIs like `requestFullScreen` can only be
13635      * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
13636      * this limitation.
13637      */
13638     executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
13639     /**
13640      * A promise that resolves with the result of the executed code or is rejected if
13641      * execution could not start.
13642      *
13643      * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
13644      *
13645      * Note that when the execution of script fails, the returned promise will not
13646      * reject and the `result` would be `undefined`. This is because Chromium does not
13647      * dispatch errors of isolated worlds to foreign worlds.
13648      */
13649     executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
13650     /**
13651      * A child of `webFrame` with the supplied `name`, `null` would be returned if
13652      * there's no such frame or if the frame is not in the current renderer process.
13653      */
13654     findFrameByName(name: string): WebFrame;
13655     /**
13656      * that has the supplied `routingId`, `null` if not found.
13657      */
13658     findFrameByRoutingId(routingId: number): WebFrame;
13659     /**
13660      * The frame element in `webFrame's` document selected by `selector`, `null` would
13661      * be returned if `selector` does not select a frame or if the frame is not in the
13662      * current renderer process.
13663      */
13664     getFrameForSelector(selector: string): WebFrame;
13665     /**
13666      * * `images` MemoryUsageDetails
13667      * * `scripts` MemoryUsageDetails
13668      * * `cssStyleSheets` MemoryUsageDetails
13669      * * `xslStyleSheets` MemoryUsageDetails
13670      * * `fonts` MemoryUsageDetails
13671      * * `other` MemoryUsageDetails
13672      *
13673      * Returns an object describing usage information of Blink's internal memory
13674      * caches.
13675      *
13676      * This will generate:
13677      */
13678     getResourceUsage(): ResourceUsage;
13679     /**
13680      * A list of suggested words for a given word. If the word is spelled correctly,
13681      * the result will be empty.
13682      */
13683     getWordSuggestions(word: string): string[];
13684     /**
13685      * The current zoom factor.
13686      */
13687     getZoomFactor(): number;
13688     /**
13689      * The current zoom level.
13690      */
13691     getZoomLevel(): number;
13692     /**
13693      * A key for the inserted CSS that can later be used to remove the CSS via
13694      * `webFrame.removeInsertedCSS(key)`.
13695      *
13696      * Injects CSS into the current web page and returns a unique key for the inserted
13697      * stylesheet.
13698      */
13699     insertCSS(css: string, options?: InsertCSSOptions): string;
13700     /**
13701      * Inserts `text` to the focused element.
13702      */
13703     insertText(text: string): void;
13704     /**
13705      * True if the word is misspelled according to the built in spellchecker, false
13706      * otherwise. If no dictionary is loaded, always return false.
13707      */
13708     isWordMisspelled(word: string): boolean;
13709     /**
13710      * Removes the inserted CSS from the current web page. The stylesheet is identified
13711      * by its key, which is returned from `webFrame.insertCSS(css)`.
13712      */
13713     removeInsertedCSS(key: string): void;
13714     /**
13715      * Set the security origin, content security policy and name of the isolated world.
13716      * Note: If the `csp` is specified, then the `securityOrigin` also has to be
13717      * specified.
13718      */
13719     setIsolatedWorldInfo(worldId: number, info: Info): void;
13720     /**
13721      * Sets a provider for spell checking in input fields and text areas.
13722      *
13723      * If you want to use this method you must disable the builtin spellchecker when
13724      * you construct the window.
13725      *
13726      * The `provider` must be an object that has a `spellCheck` method that accepts an
13727      * array of individual words for spellchecking. The `spellCheck` function runs
13728      * asynchronously and calls the `callback` function with an array of misspelt words
13729      * when complete.
13730      *
13731      * An example of using node-spellchecker as provider:
13732      */
13733     setSpellCheckProvider(language: string, provider: Provider): void;
13734     /**
13735      * Sets the maximum and minimum pinch-to-zoom level.
13736      *
13737      * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
13738      * call:
13739      *
13740      * > **NOTE**: Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
13741      * shortcuts are controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem
13742      * roles in the application Menu. To disable shortcuts, manually define the Menu
13743      * and omit zoom roles from the definition.
13744      */
13745     setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
13746     /**
13747      * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
13748      * divided by 100, so 300% = 3.0.
13749      *
13750      * The factor must be greater than 0.0.
13751      */
13752     setZoomFactor(factor: number): void;
13753     /**
13754      * Changes the zoom level to the specified level. The original size is 0 and each
13755      * increment above or below represents zooming 20% larger or smaller to default
13756      * limits of 300% and 50% of original size, respectively.
13757      *
13758      * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
13759      * the zoom level for a specific domain propagates across all instances of windows
13760      * with the same domain. Differentiating the window URLs will make zoom work
13761      * per-window.
13762      */
13763     setZoomLevel(level: number): void;
13764     /**
13765      * A `WebFrame | null` representing the first child frame of `webFrame`, the
13766      * property would be `null` if `webFrame` has no children or if first child is not
13767      * in the current renderer process.
13768      *
13769      */
13770     readonly firstChild: (WebFrame) | (null);
13771     /**
13772      * A `WebFrame | null` representing next sibling frame, the property would be
13773      * `null` if `webFrame` is the last frame in its parent or if the next sibling is
13774      * not in the current renderer process.
13775      *
13776      */
13777     readonly nextSibling: (WebFrame) | (null);
13778     /**
13779      * A `WebFrame | null` representing the frame which opened `webFrame`, the property
13780      * would be `null` if there's no opener or opener is not in the current renderer
13781      * process.
13782      *
13783      */
13784     readonly opener: (WebFrame) | (null);
13785     /**
13786      * A `WebFrame | null` representing parent frame of `webFrame`, the property would
13787      * be `null` if `webFrame` is top or parent is not in the current renderer process.
13788      *
13789      */
13790     readonly parent: (WebFrame) | (null);
13791     /**
13792      * An `Integer` representing the unique frame id in the current renderer process.
13793      * Distinct WebFrame instances that refer to the same underlying frame will have
13794      * the same `routingId`.
13795      *
13796      */
13797     readonly routingId: number;
13798     /**
13799      * A `WebFrame | null` representing top frame in frame hierarchy to which
13800      * `webFrame` belongs, the property would be `null` if top frame is not in the
13801      * current renderer process.
13802      *
13803      */
13804     readonly top: (WebFrame) | (null);
13805   }
13806
13807   class WebFrameMain extends NodeEventEmitter {
13808
13809     // Docs: https://electronjs.org/docs/api/web-frame-main
13810
13811     /**
13812      * A frame with the given process and routing IDs, or `undefined` if there is no
13813      * WebFrameMain associated with the given IDs.
13814      */
13815     static fromId(processId: number, routingId: number): (WebFrameMain) | (undefined);
13816     /**
13817      * Emitted when the document is loaded.
13818      */
13819     on(event: 'dom-ready', listener: Function): this;
13820     off(event: 'dom-ready', listener: Function): this;
13821     once(event: 'dom-ready', listener: Function): this;
13822     addListener(event: 'dom-ready', listener: Function): this;
13823     removeListener(event: 'dom-ready', listener: Function): this;
13824     /**
13825      * A promise that resolves with the result of the executed code or is rejected if
13826      * execution throws or results in a rejected promise.
13827      *
13828      * Evaluates `code` in page.
13829      *
13830      * In the browser window some HTML APIs like `requestFullScreen` can only be
13831      * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
13832      * this limitation.
13833      */
13834     executeJavaScript(code: string, userGesture?: boolean): Promise<unknown>;
13835     /**
13836      * Send a message to the renderer process, optionally transferring ownership of
13837      * zero or more `MessagePortMain` objects.
13838      *
13839      * The transferred `MessagePortMain` objects will be available in the renderer
13840      * process by accessing the `ports` property of the emitted event. When they arrive
13841      * in the renderer, they will be native DOM `MessagePort` objects.
13842      *
13843      * For example:
13844      */
13845     postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
13846     /**
13847      * Whether the reload was initiated successfully. Only results in `false` when the
13848      * frame has no history.
13849      */
13850     reload(): boolean;
13851     /**
13852      * Send an asynchronous message to the renderer process via `channel`, along with
13853      * arguments. Arguments will be serialized with the Structured Clone Algorithm,
13854      * just like `postMessage`, so prototype chains will not be included. Sending
13855      * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
13856      *
13857      * The renderer process can handle the message by listening to `channel` with the
13858      * `ipcRenderer` module.
13859      */
13860     send(channel: string, ...args: any[]): void;
13861     /**
13862      * A `WebFrameMain[]` collection containing the direct descendents of `frame`.
13863      *
13864      */
13865     readonly frames: WebFrameMain[];
13866     /**
13867      * A `WebFrameMain[]` collection containing every frame in the subtree of `frame`,
13868      * including itself. This can be useful when traversing through all frames.
13869      *
13870      */
13871     readonly framesInSubtree: WebFrameMain[];
13872     /**
13873      * An `Integer` representing the id of the frame's internal FrameTreeNode instance.
13874      * This id is browser-global and uniquely identifies a frame that hosts content.
13875      * The identifier is fixed at the creation of the frame and stays constant for the
13876      * lifetime of the frame. When the frame is removed, the id is not used again.
13877      *
13878      */
13879     readonly frameTreeNodeId: number;
13880     /**
13881      * An `IpcMain` instance scoped to the frame.
13882      *
13883      * IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
13884      * `ipcRenderer.postMessage` will be delivered in the following order:
13885      *
13886      * * `contents.on('ipc-message')`
13887      * * `contents.mainFrame.on(channel)`
13888      * * `contents.ipc.on(channel)`
13889      * * `ipcMain.on(channel)`
13890      *
13891      * Handlers registered with `invoke` will be checked in the following order. The
13892      * first one that is defined will be called, the rest will be ignored.
13893      *
13894      * * `contents.mainFrame.handle(channel)`
13895      * * `contents.handle(channel)`
13896      * * `ipcMain.handle(channel)`
13897      *
13898      * In most cases, only the main frame of a WebContents can send or receive IPC
13899      * messages. However, if the `nodeIntegrationInSubFrames` option is enabled, it is
13900      * possible for child frames to send and receive IPC messages also. The
13901      * `WebContents.ipc` interface may be more convenient when
13902      * `nodeIntegrationInSubFrames` is not enabled.
13903      *
13904      */
13905     readonly ipc: IpcMain;
13906     /**
13907      * A `string` representing the frame name.
13908      *
13909      */
13910     readonly name: string;
13911     /**
13912      * A `string` representing the current origin of the frame, serialized according to
13913      * RFC 6454. This may be different from the URL. For instance, if the frame is a
13914      * child window opened to `about:blank`, then `frame.origin` will return the parent
13915      * frame's origin, while `frame.url` will return the empty string. Pages without a
13916      * scheme/host/port triple origin will have the serialized origin of `"null"` (that
13917      * is, the string containing the letters n, u, l, l).
13918      *
13919      */
13920     readonly origin: string;
13921     /**
13922      * An `Integer` representing the operating system `pid` of the process which owns
13923      * this frame.
13924      *
13925      */
13926     readonly osProcessId: number;
13927     /**
13928      * A `WebFrameMain | null` representing parent frame of `frame`, the property would
13929      * be `null` if `frame` is the top frame in the frame hierarchy.
13930      *
13931      */
13932     readonly parent: (WebFrameMain) | (null);
13933     /**
13934      * An `Integer` representing the Chromium internal `pid` of the process which owns
13935      * this frame. This is not the same as the OS process ID; to read that use
13936      * `frame.osProcessId`.
13937      *
13938      */
13939     readonly processId: number;
13940     /**
13941      * An `Integer` representing the unique frame id in the current renderer process.
13942      * Distinct `WebFrameMain` instances that refer to the same underlying frame will
13943      * have the same `routingId`.
13944      *
13945      */
13946     readonly routingId: number;
13947     /**
13948      * A `WebFrameMain | null` representing top frame in the frame hierarchy to which
13949      * `frame` belongs.
13950      *
13951      */
13952     readonly top: (WebFrameMain) | (null);
13953     /**
13954      * A `string` representing the current URL of the frame.
13955      *
13956      */
13957     readonly url: string;
13958     /**
13959      * A `string` representing the visibility state of the frame.
13960      *
13961      * See also how the Page Visibility API is affected by other Electron APIs.
13962      *
13963      */
13964     readonly visibilityState: string;
13965   }
13966
13967   interface WebPreferences {
13968
13969     // Docs: https://electronjs.org/docs/api/structures/web-preferences
13970
13971     /**
13972      * An alternative title string provided only to accessibility tools such as screen
13973      * readers. This string is not directly visible to users.
13974      */
13975     accessibleTitle?: string;
13976     /**
13977      * A list of strings that will be appended to `process.argv` in the renderer
13978      * process of this app.  Useful for passing small bits of data down to renderer
13979      * process preload scripts.
13980      */
13981     additionalArguments?: string[];
13982     /**
13983      * Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is
13984      * `false`.
13985      */
13986     allowRunningInsecureContent?: boolean;
13987     /**
13988      * Autoplay policy to apply to content in the window, can be
13989      * `no-user-gesture-required`, `user-gesture-required`,
13990      * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
13991      */
13992     autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
13993     /**
13994      * Whether to throttle animations and timers when the page becomes background. This
13995      * also affects the Page Visibility API. When at least one webContents displayed in
13996      * a single browserWindow has disabled `backgroundThrottling` then frames will be
13997      * drawn and swapped for the whole window and other webContents displayed by it.
13998      * Defaults to `true`.
13999      */
14000     backgroundThrottling?: boolean;
14001     /**
14002      * Whether to run Electron APIs and the specified `preload` script in a separate
14003      * JavaScript context. Defaults to `true`. The context that the `preload` script
14004      * runs in will only have access to its own dedicated `document` and `window`
14005      * globals, as well as its own set of JavaScript builtins (`Array`, `Object`,
14006      * `JSON`, etc.), which are all invisible to the loaded content. The Electron API
14007      * will only be available in the `preload` script and not the loaded page. This
14008      * option should be used when loading potentially untrusted remote content to
14009      * ensure the loaded content cannot tamper with the `preload` script and any
14010      * Electron APIs being used.  This option uses the same technique used by Chrome
14011      * Content Scripts.  You can access this context in the dev tools by selecting the
14012      * 'Electron Isolated Context' entry in the combo box at the top of the Console
14013      * tab.
14014      */
14015     contextIsolation?: boolean;
14016     /**
14017      * Defaults to `ISO-8859-1`.
14018      */
14019     defaultEncoding?: string;
14020     /**
14021      * Sets the default font for the font-family.
14022      */
14023     defaultFontFamily?: DefaultFontFamily;
14024     /**
14025      * Defaults to `16`.
14026      */
14027     defaultFontSize?: number;
14028     /**
14029      * Defaults to `13`.
14030      */
14031     defaultMonospaceFontSize?: number;
14032     /**
14033      * Whether to enable DevTools. If it is set to `false`, can not use
14034      * `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
14035      */
14036     devTools?: boolean;
14037     /**
14038      * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
14039      * to disable. The full list of supported feature strings can be found in the
14040      * RuntimeEnabledFeatures.json5 file.
14041      */
14042     disableBlinkFeatures?: string;
14043     /**
14044      * Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
14045      * `false`.
14046      */
14047     disableDialogs?: boolean;
14048     /**
14049      * Whether to prevent the window from resizing when entering HTML Fullscreen.
14050      * Default is `false`.
14051      */
14052     disableHtmlFullscreenWindowResize?: boolean;
14053     /**
14054      * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
14055      * to enable. The full list of supported feature strings can be found in the
14056      * RuntimeEnabledFeatures.json5 file.
14057      */
14058     enableBlinkFeatures?: string;
14059     /**
14060      * Whether to enable preferred size mode. The preferred size is the minimum size
14061      * needed to contain the layout of the document—without requiring scrolling.
14062      * Enabling this will cause the `preferred-size-changed` event to be emitted on the
14063      * `WebContents` when the preferred size changes. Default is `false`.
14064      */
14065     enablePreferredSizeMode?: boolean;
14066     /**
14067      * Whether to enable the WebSQL api. Default is `true`.
14068      */
14069     enableWebSQL?: boolean;
14070     /**
14071      * Enables Chromium's experimental features. Default is `false`.
14072      */
14073     experimentalFeatures?: boolean;
14074     /**
14075      * Specifies how to run image animations (E.g. GIFs).  Can be `animate`,
14076      * `animateOnce` or `noAnimation`.  Default is `animate`.
14077      */
14078     imageAnimationPolicy?: ('animate' | 'animateOnce' | 'noAnimation');
14079     /**
14080      * Enables image support. Default is `true`.
14081      */
14082     images?: boolean;
14083     /**
14084      * Enables JavaScript support. Default is `true`.
14085      */
14086     javascript?: boolean;
14087     /**
14088      * Defaults to `0`.
14089      */
14090     minimumFontSize?: number;
14091     /**
14092      * Whether dragging and dropping a file or link onto the page causes a navigation.
14093      * Default is `false`.
14094      */
14095     navigateOnDragDrop?: boolean;
14096     /**
14097      * Whether node integration is enabled. Default is `false`.
14098      */
14099     nodeIntegration?: boolean;
14100     /**
14101      * Experimental option for enabling Node.js support in sub-frames such as iframes
14102      * and child windows. All your preloads will load for every iframe, you can use
14103      * `process.isMainFrame` to determine if you are in the main frame or not.
14104      */
14105     nodeIntegrationInSubFrames?: boolean;
14106     /**
14107      * Whether node integration is enabled in web workers. Default is `false`. More
14108      * about this can be found in Multithreading.
14109      */
14110     nodeIntegrationInWorker?: boolean;
14111     /**
14112      * Whether to enable offscreen rendering for the browser window. Defaults to
14113      * `false`. See the offscreen rendering tutorial for more details.
14114      */
14115     offscreen?: boolean;
14116     /**
14117      * Sets the session used by the page according to the session's partition string.
14118      * If `partition` starts with `persist:`, the page will use a persistent session
14119      * available to all pages in the app with the same `partition`. If there is no
14120      * `persist:` prefix, the page will use an in-memory session. By assigning the same
14121      * `partition`, multiple pages can share the same session. Default is the default
14122      * session.
14123      */
14124     partition?: string;
14125     /**
14126      * Whether plugins should be enabled. Default is `false`.
14127      */
14128     plugins?: boolean;
14129     /**
14130      * Specifies a script that will be loaded before other scripts run in the page.
14131      * This script will always have access to node APIs no matter whether node
14132      * integration is turned on or off. The value should be the absolute file path to
14133      * the script. When node integration is turned off, the preload script can
14134      * reintroduce Node global symbols back to the global scope. See example here.
14135      */
14136     preload?: string;
14137     /**
14138      * Whether to enable browser style consecutive dialog protection. Default is
14139      * `false`.
14140      */
14141     safeDialogs?: boolean;
14142     /**
14143      * The message to display when consecutive dialog protection is triggered. If not
14144      * defined the default message would be used, note that currently the default
14145      * message is in English and not localized.
14146      */
14147     safeDialogsMessage?: string;
14148     /**
14149      * If set, this will sandbox the renderer associated with the window, making it
14150      * compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
14151      * This is not the same as the `nodeIntegration` option and the APIs available to
14152      * the preload script are more limited. Read more about the option here.
14153      */
14154     sandbox?: boolean;
14155     /**
14156      * Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.
14157      *
14158      * @platform darwin
14159      */
14160     scrollBounce?: boolean;
14161     /**
14162      * Sets the session used by the page. Instead of passing the Session object
14163      * directly, you can also choose to use the `partition` option instead, which
14164      * accepts a partition string. When both `session` and `partition` are provided,
14165      * `session` will be preferred. Default is the default session.
14166      */
14167     session?: Session;
14168     /**
14169      * Whether to enable the builtin spellchecker. Default is `true`.
14170      */
14171     spellcheck?: boolean;
14172     /**
14173      * Make TextArea elements resizable. Default is `true`.
14174      */
14175     textAreasAreResizable?: boolean;
14176     /**
14177      * Enforces the v8 code caching policy used by blink. Accepted values are
14178      */
14179     v8CacheOptions?: ('none' | 'code' | 'bypassHeatCheck' | 'bypassHeatCheckAndEagerCompile');
14180     /**
14181      * Enables WebGL support. Default is `true`.
14182      */
14183     webgl?: boolean;
14184     /**
14185      * When `false`, it will disable the same-origin policy (usually using testing
14186      * websites by people), and set `allowRunningInsecureContent` to `true` if this
14187      * options has not been set by user. Default is `true`.
14188      */
14189     webSecurity?: boolean;
14190     /**
14191      * Whether to enable the `<webview>` tag. Defaults to `false`. **Note:** The
14192      * `preload` script configured for the `<webview>` will have node integration
14193      * enabled when it is executed so you should ensure remote/untrusted content is not
14194      * able to create a `<webview>` tag with a possibly malicious `preload` script. You
14195      * can use the `will-attach-webview` event on webContents to strip away the
14196      * `preload` script and to validate or alter the `<webview>`'s initial settings.
14197      */
14198     webviewTag?: boolean;
14199     /**
14200      * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
14201      */
14202     zoomFactor?: number;
14203   }
14204
14205   class WebRequest {
14206
14207     // Docs: https://electronjs.org/docs/api/web-request
14208
14209     /**
14210      * The `listener` will be called with `listener(details)` when a server initiated
14211      * redirect is about to occur.
14212      */
14213     onBeforeRedirect(filter: WebRequestFilter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
14214     /**
14215      * The `listener` will be called with `listener(details)` when a server initiated
14216      * redirect is about to occur.
14217      */
14218     onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
14219     /**
14220      * The `listener` will be called with `listener(details, callback)` when a request
14221      * is about to occur.
14222      *
14223      * The `uploadData` is an array of `UploadData` objects.
14224      *
14225      * The `callback` has to be called with an `response` object.
14226      *
14227      * Some examples of valid `urls`:
14228      */
14229     onBeforeRequest(filter: WebRequestFilter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
14230     /**
14231      * The `listener` will be called with `listener(details, callback)` when a request
14232      * is about to occur.
14233      *
14234      * The `uploadData` is an array of `UploadData` objects.
14235      *
14236      * The `callback` has to be called with an `response` object.
14237      *
14238      * Some examples of valid `urls`:
14239      */
14240     onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
14241     /**
14242      * The `listener` will be called with `listener(details, callback)` before sending
14243      * an HTTP request, once the request headers are available. This may occur after a
14244      * TCP connection is made to the server, but before any http data is sent.
14245      *
14246      * The `callback` has to be called with a `response` object.
14247      */
14248     onBeforeSendHeaders(filter: WebRequestFilter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
14249     /**
14250      * The `listener` will be called with `listener(details, callback)` before sending
14251      * an HTTP request, once the request headers are available. This may occur after a
14252      * TCP connection is made to the server, but before any http data is sent.
14253      *
14254      * The `callback` has to be called with a `response` object.
14255      */
14256     onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
14257     /**
14258      * The `listener` will be called with `listener(details)` when a request is
14259      * completed.
14260      */
14261     onCompleted(filter: WebRequestFilter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
14262     /**
14263      * The `listener` will be called with `listener(details)` when a request is
14264      * completed.
14265      */
14266     onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
14267     /**
14268      * The `listener` will be called with `listener(details)` when an error occurs.
14269      */
14270     onErrorOccurred(filter: WebRequestFilter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
14271     /**
14272      * The `listener` will be called with `listener(details)` when an error occurs.
14273      */
14274     onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
14275     /**
14276      * The `listener` will be called with `listener(details, callback)` when HTTP
14277      * response headers of a request have been received.
14278      *
14279      * The `callback` has to be called with a `response` object.
14280      */
14281     onHeadersReceived(filter: WebRequestFilter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
14282     /**
14283      * The `listener` will be called with `listener(details, callback)` when HTTP
14284      * response headers of a request have been received.
14285      *
14286      * The `callback` has to be called with a `response` object.
14287      */
14288     onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
14289     /**
14290      * The `listener` will be called with `listener(details)` when first byte of the
14291      * response body is received. For HTTP requests, this means that the status line
14292      * and response headers are available.
14293      */
14294     onResponseStarted(filter: WebRequestFilter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
14295     /**
14296      * The `listener` will be called with `listener(details)` when first byte of the
14297      * response body is received. For HTTP requests, this means that the status line
14298      * and response headers are available.
14299      */
14300     onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
14301     /**
14302      * The `listener` will be called with `listener(details)` just before a request is
14303      * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
14304      * response are visible by the time this listener is fired.
14305      */
14306     onSendHeaders(filter: WebRequestFilter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
14307     /**
14308      * The `listener` will be called with `listener(details)` just before a request is
14309      * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
14310      * response are visible by the time this listener is fired.
14311      */
14312     onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
14313   }
14314
14315   interface WebRequestFilter {
14316
14317     // Docs: https://electronjs.org/docs/api/structures/web-request-filter
14318
14319     /**
14320      * Array of types that will be used to filter out the requests that do not match
14321      * the types. When not specified, all types will be matched. Can be `mainFrame`,
14322      * `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`,
14323      * `cspReport`, `media` or `webSocket`.
14324      */
14325     types?: Array<'mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket'>;
14326     /**
14327      * Array of URL patterns that will be used to filter out the requests that do not
14328      * match the URL patterns.
14329      */
14330     urls: string[];
14331   }
14332
14333   interface WebSource {
14334
14335     // Docs: https://electronjs.org/docs/api/structures/web-source
14336
14337     code: string;
14338     url?: string;
14339   }
14340
14341   interface WebviewTag extends HTMLElement {
14342
14343     // Docs: https://electronjs.org/docs/api/webview-tag
14344
14345     /**
14346      * Fired when a load has committed. This includes navigation within the current
14347      * document as well as subframe document-level loads, but does not include
14348      * asynchronous resource loads.
14349      */
14350     addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
14351     removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
14352     /**
14353      * Fired when the navigation is done, i.e. the spinner of the tab will stop
14354      * spinning, and the `onload` event is dispatched.
14355      */
14356     addEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14357     removeEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void): this;
14358     /**
14359      * This event is like `did-finish-load`, but fired when the load failed or was
14360      * cancelled, e.g. `window.stop()` is invoked.
14361      */
14362     addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
14363     removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
14364     /**
14365      * Fired when a frame has done navigation.
14366      */
14367     addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
14368     removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
14369     /**
14370      * Corresponds to the points in time when the spinner of the tab starts spinning.
14371      */
14372     addEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14373     removeEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void): this;
14374     /**
14375      * Corresponds to the points in time when the spinner of the tab stops spinning.
14376      */
14377     addEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14378     removeEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void): this;
14379     /**
14380      * Fired when attached to the embedder web contents.
14381      */
14382     addEventListener(event: 'did-attach', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14383     removeEventListener(event: 'did-attach', listener: (event: DOMEvent) => void): this;
14384     /**
14385      * Fired when document in the given frame is loaded.
14386      */
14387     addEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14388     removeEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void): this;
14389     /**
14390      * Fired when page title is set during navigation. `explicitSet` is false when
14391      * title is synthesized from file url.
14392      */
14393     addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
14394     removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
14395     /**
14396      * Fired when page receives favicon urls.
14397      */
14398     addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
14399     removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
14400     /**
14401      * Fired when page enters fullscreen triggered by HTML API.
14402      */
14403     addEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14404     removeEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void): this;
14405     /**
14406      * Fired when page leaves fullscreen triggered by HTML API.
14407      */
14408     addEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14409     removeEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void): this;
14410     /**
14411      * Fired when the guest window logs a console message.
14412      *
14413      * The following example code forwards all log messages to the embedder's console
14414      * without regard for log level or other properties.
14415      */
14416     addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
14417     removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
14418     /**
14419      * Fired when a result is available for `webview.findInPage` request.
14420      */
14421     addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
14422     removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
14423     /**
14424      * Emitted when a user or the page wants to start navigation. It can happen when
14425      * the `window.location` object is changed or a user clicks a link in the page.
14426      *
14427      * This event will not emit when the navigation is started programmatically with
14428      * APIs like `<webview>.loadURL` and `<webview>.back`.
14429      *
14430      * It is also not emitted during in-page navigation, such as clicking anchor links
14431      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
14432      * this purpose.
14433      *
14434      * Calling `event.preventDefault()` does **NOT** have any effect.
14435      */
14436     addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
14437     removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
14438     /**
14439      * Emitted when a user or the page wants to start navigation anywhere in the
14440      * `<webview>` or any frames embedded within. It can happen when the
14441      * `window.location` object is changed or a user clicks a link in the page.
14442      *
14443      * This event will not emit when the navigation is started programmatically with
14444      * APIs like `<webview>.loadURL` and `<webview>.back`.
14445      *
14446      * It is also not emitted during in-page navigation, such as clicking anchor links
14447      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
14448      * this purpose.
14449      *
14450      * Calling `event.preventDefault()` does **NOT** have any effect.
14451      */
14452     addEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void, useCapture?: boolean): this;
14453     removeEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void): this;
14454     /**
14455      * Emitted when any frame (including main) starts navigating. `isInPlace` will be
14456      * `true` for in-page navigations.
14457      */
14458     addEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void, useCapture?: boolean): this;
14459     removeEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void): this;
14460     /**
14461      * Emitted after a server side redirect occurs during navigation. For example a 302
14462      * redirect.
14463      */
14464     addEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void, useCapture?: boolean): this;
14465     removeEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void): this;
14466     /**
14467      * Emitted when a navigation is done.
14468      *
14469      * This event is not emitted for in-page navigations, such as clicking anchor links
14470      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
14471      * this purpose.
14472      */
14473     addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
14474     removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
14475     /**
14476      * Emitted when any frame navigation is done.
14477      *
14478      * This event is not emitted for in-page navigations, such as clicking anchor links
14479      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
14480      * this purpose.
14481      */
14482     addEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void, useCapture?: boolean): this;
14483     removeEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void): this;
14484     /**
14485      * Emitted when an in-page navigation happened.
14486      *
14487      * When in-page navigation happens, the page URL changes but does not cause
14488      * navigation outside of the page. Examples of this occurring are when anchor links
14489      * are clicked or when the DOM `hashchange` event is triggered.
14490      */
14491     addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
14492     removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
14493     /**
14494      * Fired when the guest page attempts to close itself.
14495      *
14496      * The following example code navigates the `webview` to `about:blank` when the
14497      * guest attempts to close itself.
14498      */
14499     addEventListener(event: 'close', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14500     removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
14501     /**
14502      * Fired when the guest page has sent an asynchronous message to embedder page.
14503      *
14504      * With `sendToHost` method and `ipc-message` event you can communicate between
14505      * guest page and embedder page:
14506      */
14507     addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
14508     removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
14509     /**
14510      * Fired when the renderer process crashes or is killed.
14511      *
14512      * **Deprecated:** This event is superceded by the `render-process-gone` event
14513      * which contains more information about why the render process disappeared. It
14514      * isn't always because it crashed.
14515      *
14516      * @deprecated
14517      */
14518     addEventListener(event: 'crashed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14519     removeEventListener(event: 'crashed', listener: (event: DOMEvent) => void): this;
14520     /**
14521      * Fired when the renderer process unexpectedly disappears. This is normally
14522      * because it was crashed or killed.
14523      */
14524     addEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void, useCapture?: boolean): this;
14525     removeEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void): this;
14526     /**
14527      * Fired when a plugin process is crashed.
14528      */
14529     addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
14530     removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
14531     /**
14532      * Fired when the WebContents is destroyed.
14533      */
14534     addEventListener(event: 'destroyed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14535     removeEventListener(event: 'destroyed', listener: (event: DOMEvent) => void): this;
14536     /**
14537      * Emitted when media starts playing.
14538      */
14539     addEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14540     removeEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void): this;
14541     /**
14542      * Emitted when media is paused or done playing.
14543      */
14544     addEventListener(event: 'media-paused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14545     removeEventListener(event: 'media-paused', listener: (event: DOMEvent) => void): this;
14546     /**
14547      * Emitted when a page's theme color changes. This is usually due to encountering a
14548      * meta tag:
14549      */
14550     addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
14551     removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
14552     /**
14553      * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
14554      */
14555     addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
14556     removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
14557     /**
14558      * Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
14559      * a link in its context menu.
14560      */
14561     addEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void, useCapture?: boolean): this;
14562     removeEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void): this;
14563     /**
14564      * Emitted when DevTools is opened.
14565      */
14566     addEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14567     removeEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void): this;
14568     /**
14569      * Emitted when DevTools is closed.
14570      */
14571     addEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14572     removeEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void): this;
14573     /**
14574      * Emitted when DevTools is focused / opened.
14575      */
14576     addEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
14577     removeEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void): this;
14578     /**
14579      * Emitted when there is a new context menu that needs to be handled.
14580      */
14581     addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
14582     removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
14583     addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
14584     addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
14585     removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
14586     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
14587     /**
14588      * Adjusts the current text selection starting and ending points in the focused
14589      * frame by the given amounts. A negative amount moves the selection towards the
14590      * beginning of the document, and a positive amount moves the selection towards the
14591      * end of the document.
14592      *
14593      * See `webContents.adjustSelection` for examples.
14594      */
14595     adjustSelection(options: AdjustSelectionOptions): void;
14596     /**
14597      * Whether the guest page can go back.
14598      */
14599     canGoBack(): boolean;
14600     /**
14601      * Whether the guest page can go forward.
14602      */
14603     canGoForward(): boolean;
14604     /**
14605      * Whether the guest page can go to `offset`.
14606      */
14607     canGoToOffset(offset: number): boolean;
14608     /**
14609      * Resolves with a NativeImage
14610      *
14611      * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
14612      * whole visible page.
14613      */
14614     capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
14615     /**
14616      * Centers the current text selection in page.
14617      */
14618     centerSelection(): void;
14619     /**
14620      * Clears the navigation history.
14621      */
14622     clearHistory(): void;
14623     /**
14624      * Closes the DevTools window of guest page.
14625      */
14626     closeDevTools(): void;
14627     /**
14628      * Executes editing command `copy` in page.
14629      */
14630     copy(): void;
14631     /**
14632      * Executes editing command `cut` in page.
14633      */
14634     cut(): void;
14635     /**
14636      * Executes editing command `delete` in page.
14637      */
14638     delete(): void;
14639     /**
14640      * Initiates a download of the resource at `url` without navigating.
14641      */
14642     downloadURL(url: string, options?: DownloadURLOptions): void;
14643     /**
14644      * A promise that resolves with the result of the executed code or is rejected if
14645      * the result of the code is a rejected promise.
14646      *
14647      * Evaluates `code` in page. If `userGesture` is set, it will create the user
14648      * gesture context in the page. HTML APIs like `requestFullScreen`, which require
14649      * user action, can take advantage of this option for automation.
14650      */
14651     executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
14652     /**
14653      * The request id used for the request.
14654      *
14655      * Starts a request to find all matches for the `text` in the web page. The result
14656      * of the request can be obtained by subscribing to `found-in-page` event.
14657      */
14658     findInPage(text: string, options?: FindInPageOptions): number;
14659     /**
14660      * The title of guest page.
14661      */
14662     getTitle(): string;
14663     /**
14664      * The URL of guest page.
14665      */
14666     getURL(): string;
14667     /**
14668      * The user agent for guest page.
14669      */
14670     getUserAgent(): string;
14671     /**
14672      * The WebContents ID of this `webview`.
14673      */
14674     getWebContentsId(): number;
14675     /**
14676      * the current zoom factor.
14677      */
14678     getZoomFactor(): number;
14679     /**
14680      * the current zoom level.
14681      */
14682     getZoomLevel(): number;
14683     /**
14684      * Makes the guest page go back.
14685      */
14686     goBack(): void;
14687     /**
14688      * Makes the guest page go forward.
14689      */
14690     goForward(): void;
14691     /**
14692      * Navigates to the specified absolute index.
14693      */
14694     goToIndex(index: number): void;
14695     /**
14696      * Navigates to the specified offset from the "current entry".
14697      */
14698     goToOffset(offset: number): void;
14699     /**
14700      * A promise that resolves with a key for the inserted CSS that can later be used
14701      * to remove the CSS via `<webview>.removeInsertedCSS(key)`.
14702      *
14703      * Injects CSS into the current web page and returns a unique key for the inserted
14704      * stylesheet.
14705      */
14706     insertCSS(css: string): Promise<string>;
14707     /**
14708      * Inserts `text` to the focused element.
14709      */
14710     insertText(text: string): Promise<void>;
14711     /**
14712      * Starts inspecting element at position (`x`, `y`) of guest page.
14713      */
14714     inspectElement(x: number, y: number): void;
14715     /**
14716      * Opens the DevTools for the service worker context present in the guest page.
14717      */
14718     inspectServiceWorker(): void;
14719     /**
14720      * Opens the DevTools for the shared worker context present in the guest page.
14721      */
14722     inspectSharedWorker(): void;
14723     /**
14724      * Whether guest page has been muted.
14725      */
14726     isAudioMuted(): boolean;
14727     /**
14728      * Whether the renderer process has crashed.
14729      */
14730     isCrashed(): boolean;
14731     /**
14732      * Whether audio is currently playing.
14733      */
14734     isCurrentlyAudible(): boolean;
14735     /**
14736      * Whether DevTools window of guest page is focused.
14737      */
14738     isDevToolsFocused(): boolean;
14739     /**
14740      * Whether guest page has a DevTools window attached.
14741      */
14742     isDevToolsOpened(): boolean;
14743     /**
14744      * Whether guest page is still loading resources.
14745      */
14746     isLoading(): boolean;
14747     /**
14748      * Whether the main frame (and not just iframes or frames within it) is still
14749      * loading.
14750      */
14751     isLoadingMainFrame(): boolean;
14752     /**
14753      * Whether the guest page is waiting for a first-response for the main resource of
14754      * the page.
14755      */
14756     isWaitingForResponse(): boolean;
14757     /**
14758      * The promise will resolve when the page has finished loading (see
14759      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
14760      *
14761      * Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
14762      * the `http://` or `file://`.
14763      */
14764     loadURL(url: string, options?: LoadURLOptions): Promise<void>;
14765     /**
14766      * Opens a DevTools window for guest page.
14767      */
14768     openDevTools(): void;
14769     /**
14770      * Executes editing command `paste` in page.
14771      */
14772     paste(): void;
14773     /**
14774      * Executes editing command `pasteAndMatchStyle` in page.
14775      */
14776     pasteAndMatchStyle(): void;
14777     /**
14778      * Prints `webview`'s web page. Same as `webContents.print([options])`.
14779      */
14780     print(options?: WebviewTagPrintOptions): Promise<void>;
14781     /**
14782      * Resolves with the generated PDF data.
14783      *
14784      * Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
14785      */
14786     printToPDF(options: PrintToPDFOptions): Promise<Uint8Array>;
14787     /**
14788      * Executes editing command `redo` in page.
14789      */
14790     redo(): void;
14791     /**
14792      * Reloads the guest page.
14793      */
14794     reload(): void;
14795     /**
14796      * Reloads the guest page and ignores cache.
14797      */
14798     reloadIgnoringCache(): void;
14799     /**
14800      * Resolves if the removal was successful.
14801      *
14802      * Removes the inserted CSS from the current web page. The stylesheet is identified
14803      * by its key, which is returned from `<webview>.insertCSS(css)`.
14804      */
14805     removeInsertedCSS(key: string): Promise<void>;
14806     /**
14807      * Executes editing command `replace` in page.
14808      */
14809     replace(text: string): void;
14810     /**
14811      * Executes editing command `replaceMisspelling` in page.
14812      */
14813     replaceMisspelling(text: string): void;
14814     /**
14815      * Scrolls to the bottom of the current `<webview>`.
14816      */
14817     scrollToBottom(): void;
14818     /**
14819      * Scrolls to the top of the current `<webview>`.
14820      */
14821     scrollToTop(): void;
14822     /**
14823      * Executes editing command `selectAll` in page.
14824      */
14825     selectAll(): void;
14826     /**
14827      * Send an asynchronous message to renderer process via `channel`, you can also
14828      * send arbitrary arguments. The renderer process can handle the message by
14829      * listening to the `channel` event with the `ipcRenderer` module.
14830      *
14831      * See webContents.send for examples.
14832      */
14833     send(channel: string, ...args: any[]): Promise<void>;
14834     /**
14835      * Sends an input `event` to the page.
14836      *
14837      * See webContents.sendInputEvent for detailed description of `event` object.
14838      */
14839     sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
14840     /**
14841      * Send an asynchronous message to renderer process via `channel`, you can also
14842      * send arbitrary arguments. The renderer process can handle the message by
14843      * listening to the `channel` event with the `ipcRenderer` module.
14844      *
14845      * See webContents.sendToFrame for examples.
14846      */
14847     sendToFrame(frameId: [number, number], channel: string, ...args: any[]): Promise<void>;
14848     /**
14849      * Set guest page muted.
14850      */
14851     setAudioMuted(muted: boolean): void;
14852     /**
14853      * Overrides the user agent for the guest page.
14854      */
14855     setUserAgent(userAgent: string): void;
14856     /**
14857      * Sets the maximum and minimum pinch-to-zoom level.
14858      */
14859     setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
14860     /**
14861      * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
14862      * divided by 100, so 300% = 3.0.
14863      */
14864     setZoomFactor(factor: number): void;
14865     /**
14866      * Changes the zoom level to the specified level. The original size is 0 and each
14867      * increment above or below represents zooming 20% larger or smaller to default
14868      * limits of 300% and 50% of original size, respectively. The formula for this is
14869      * `scale := 1.2 ^ level`.
14870      *
14871      * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
14872      * the zoom level for a specific domain propagates across all instances of windows
14873      * with the same domain. Differentiating the window URLs will make zoom work
14874      * per-window.
14875      */
14876     setZoomLevel(level: number): void;
14877     /**
14878      * Shows pop-up dictionary that searches the selected word on the page.
14879      *
14880      * @platform darwin
14881      */
14882     showDefinitionForSelection(): void;
14883     /**
14884      * Stops any pending navigation.
14885      */
14886     stop(): void;
14887     /**
14888      * Stops any `findInPage` request for the `webview` with the provided `action`.
14889      */
14890     stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
14891     /**
14892      * Executes editing command `undo` in page.
14893      */
14894     undo(): void;
14895     /**
14896      * Executes editing command `unselect` in page.
14897      */
14898     unselect(): void;
14899     /**
14900      * A `boolean`. When this attribute is present the guest page will be allowed to
14901      * open new windows. Popups are disabled by default.
14902      */
14903     allowpopups: boolean;
14904     /**
14905      * A `string` which is a list of strings which specifies the blink features to be
14906      * disabled separated by `,`. The full list of supported feature strings can be
14907      * found in the RuntimeEnabledFeatures.json5 file.
14908      */
14909     disableblinkfeatures: string;
14910     /**
14911      * A `boolean`. When this attribute is present the guest page will have web
14912      * security disabled. Web security is enabled by default.
14913      *
14914      * This value can only be modified before the first navigation.
14915      */
14916     disablewebsecurity: boolean;
14917     /**
14918      * A `string` which is a list of strings which specifies the blink features to be
14919      * enabled separated by `,`. The full list of supported feature strings can be
14920      * found in the RuntimeEnabledFeatures.json5 file.
14921      */
14922     enableblinkfeatures: string;
14923     /**
14924      * A `string` that sets the referrer URL for the guest page.
14925      */
14926     httpreferrer: string;
14927     /**
14928      * A `boolean`. When this attribute is present the guest page in `webview` will
14929      * have node integration and can use node APIs like `require` and `process` to
14930      * access low level system resources. Node integration is disabled by default in
14931      * the guest page.
14932      */
14933     nodeintegration: boolean;
14934     /**
14935      * A `boolean` for the experimental option for enabling NodeJS support in
14936      * sub-frames such as iframes inside the `webview`. All your preloads will load for
14937      * every iframe, you can use `process.isMainFrame` to determine if you are in the
14938      * main frame or not. This option is disabled by default in the guest page.
14939      */
14940     nodeintegrationinsubframes: boolean;
14941     /**
14942      * A `string` that sets the session used by the page. If `partition` starts with
14943      * `persist:`, the page will use a persistent session available to all pages in the
14944      * app with the same `partition`. if there is no `persist:` prefix, the page will
14945      * use an in-memory session. By assigning the same `partition`, multiple pages can
14946      * share the same session. If the `partition` is unset then default session of the
14947      * app will be used.
14948      *
14949      * This value can only be modified before the first navigation, since the session
14950      * of an active renderer process cannot change. Subsequent attempts to modify the
14951      * value will fail with a DOM exception.
14952      */
14953     partition: string;
14954     /**
14955      * A `boolean`. When this attribute is present the guest page in `webview` will be
14956      * able to use browser plugins. Plugins are disabled by default.
14957      */
14958     plugins: boolean;
14959     /**
14960      * A `string` that specifies a script that will be loaded before other scripts run
14961      * in the guest page. The protocol of script's URL must be `file:` (even when using
14962      * `asar:` archives) because it will be loaded by Node's `require` under the hood,
14963      * which treats `asar:` archives as virtual directories.
14964      *
14965      * When the guest page doesn't have node integration this script will still have
14966      * access to all Node APIs, but global objects injected by Node will be deleted
14967      * after this script has finished executing.
14968      */
14969     preload: string;
14970     /**
14971      * A `string` representing the visible URL. Writing to this attribute initiates
14972      * top-level navigation.
14973      *
14974      * Assigning `src` its own value will reload the current page.
14975      *
14976      * The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
14977      * world!`.
14978      */
14979     src: string;
14980     /**
14981      * A `string` that sets the user agent for the guest page before the page is
14982      * navigated to. Once the page is loaded, use the `setUserAgent` method to change
14983      * the user agent.
14984      */
14985     useragent: string;
14986     /**
14987      * A `string` which is a comma separated list of strings which specifies the web
14988      * preferences to be set on the webview. The full list of supported preference
14989      * strings can be found in BrowserWindow.
14990      *
14991      * The string follows the same format as the features string in `window.open`. A
14992      * name by itself is given a `true` boolean value. A preference can be set to
14993      * another value by including an `=`, followed by the value. Special values `yes`
14994      * and `1` are interpreted as `true`, while `no` and `0` are interpreted as
14995      * `false`.
14996      */
14997     webpreferences: string;
14998   }
14999
15000   interface AboutPanelOptionsOptions {
15001     /**
15002      * The app's name.
15003      */
15004     applicationName?: string;
15005     /**
15006      * The app's version.
15007      */
15008     applicationVersion?: string;
15009     /**
15010      * Copyright information.
15011      */
15012     copyright?: string;
15013     /**
15014      * The app's build version number.
15015      *
15016      * @platform darwin
15017      */
15018     version?: string;
15019     /**
15020      * Credit information.
15021      *
15022      * @platform darwin,win32
15023      */
15024     credits?: string;
15025     /**
15026      * List of app authors.
15027      *
15028      * @platform linux
15029      */
15030     authors?: string[];
15031     /**
15032      * The app's website.
15033      *
15034      * @platform linux
15035      */
15036     website?: string;
15037     /**
15038      * Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as
15039      * 64x64 pixels while retaining aspect ratio.
15040      *
15041      * @platform linux,win32
15042      */
15043     iconPath?: string;
15044   }
15045
15046   interface AddRepresentationOptions {
15047     /**
15048      * The scale factor to add the image representation for.
15049      */
15050     scaleFactor?: number;
15051     /**
15052      * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
15053      */
15054     width?: number;
15055     /**
15056      * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
15057      */
15058     height?: number;
15059     /**
15060      * The buffer containing the raw image data.
15061      */
15062     buffer?: Buffer;
15063     /**
15064      * The data URL containing either a base 64 encoded PNG or JPEG image.
15065      */
15066     dataURL?: string;
15067   }
15068
15069   interface AdjustSelectionOptions {
15070     /**
15071      * Amount to shift the start index of the current selection.
15072      */
15073     start?: number;
15074     /**
15075      * Amount to shift the end index of the current selection.
15076      */
15077     end?: number;
15078   }
15079
15080   interface AnimationSettings {
15081     /**
15082      * Returns true if rich animations should be rendered. Looks at session type (e.g.
15083      * remote desktop) and accessibility settings to give guidance for heavy
15084      * animations.
15085      */
15086     shouldRenderRichAnimation: boolean;
15087     /**
15088      * Determines on a per-platform basis whether scroll animations (e.g. produced by
15089      * home/end key) should be enabled.
15090      */
15091     scrollAnimationsEnabledBySystem: boolean;
15092     /**
15093      * Determines whether the user desires reduced motion based on platform APIs.
15094      */
15095     prefersReducedMotion: boolean;
15096   }
15097
15098   interface AppDetailsOptions {
15099     /**
15100      * Window's App User Model ID. It has to be set, otherwise the other options will
15101      * have no effect.
15102      */
15103     appId?: string;
15104     /**
15105      * Window's Relaunch Icon.
15106      */
15107     appIconPath?: string;
15108     /**
15109      * Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
15110      * Default is `0`.
15111      */
15112     appIconIndex?: number;
15113     /**
15114      * Window's Relaunch Command.
15115      */
15116     relaunchCommand?: string;
15117     /**
15118      * Window's Relaunch Display Name.
15119      */
15120     relaunchDisplayName?: string;
15121   }
15122
15123   interface ApplicationInfoForProtocolReturnValue {
15124     /**
15125      * the display icon of the app handling the protocol.
15126      */
15127     icon: NativeImage;
15128     /**
15129      * installation path of the app handling the protocol.
15130      */
15131     path: string;
15132     /**
15133      * display name of the app handling the protocol.
15134      */
15135     name: string;
15136   }
15137
15138   interface AuthenticationResponseDetails {
15139     url: string;
15140   }
15141
15142   interface AuthInfo {
15143     isProxy: boolean;
15144     scheme: string;
15145     host: string;
15146     port: number;
15147     realm: string;
15148   }
15149
15150   interface AutoResizeOptions {
15151     /**
15152      * If `true`, the view's width will grow and shrink together with the window.
15153      * `false` by default.
15154      */
15155     width?: boolean;
15156     /**
15157      * If `true`, the view's height will grow and shrink together with the window.
15158      * `false` by default.
15159      */
15160     height?: boolean;
15161     /**
15162      * If `true`, the view's x position and width will grow and shrink proportionally
15163      * with the window. `false` by default.
15164      */
15165     horizontal?: boolean;
15166     /**
15167      * If `true`, the view's y position and height will grow and shrink proportionally
15168      * with the window. `false` by default.
15169      */
15170     vertical?: boolean;
15171   }
15172
15173   interface BeforeSendResponse {
15174     cancel?: boolean;
15175     /**
15176      * When provided, request will be made with these headers.
15177      */
15178     requestHeaders?: Record<string, (string) | (string[])>;
15179   }
15180
15181   interface BitmapOptions {
15182     /**
15183      * Defaults to 1.0.
15184      */
15185     scaleFactor?: number;
15186   }
15187
15188   interface BlinkMemoryInfo {
15189     /**
15190      * Size of all allocated objects in Kilobytes.
15191      */
15192     allocated: number;
15193     /**
15194      * Total allocated space in Kilobytes.
15195      */
15196     total: number;
15197   }
15198
15199   interface BluetoothPairingHandlerHandlerDetails {
15200     deviceId: string;
15201     /**
15202      * The type of pairing prompt being requested. One of the following values:
15203      */
15204     pairingKind: ('confirm' | 'confirmPin' | 'providePin');
15205     frame: WebFrameMain;
15206     /**
15207      * The pin value to verify if `pairingKind` is `confirmPin`.
15208      */
15209     pin?: string;
15210   }
15211
15212   interface BrowserViewConstructorOptions {
15213     /**
15214      * Settings of web page's features.
15215      */
15216     webPreferences?: WebPreferences;
15217   }
15218
15219   interface CallbackResponse {
15220     cancel?: boolean;
15221     /**
15222      * The original request is prevented from being sent or completed and is instead
15223      * redirected to the given URL.
15224      */
15225     redirectURL?: string;
15226   }
15227
15228   interface CertificateTrustDialogOptions {
15229     /**
15230      * The certificate to trust/import.
15231      */
15232     certificate: Certificate;
15233     /**
15234      * The message to display to the user.
15235      */
15236     message: string;
15237   }
15238
15239   interface ClearCodeCachesOptions {
15240     /**
15241      * An array of url corresponding to the resource whose generated code cache needs
15242      * to be removed. If the list is empty then all entries in the cache directory will
15243      * be removed.
15244      */
15245     urls?: string[];
15246   }
15247
15248   interface ClearStorageDataOptions {
15249     /**
15250      * Should follow `window.location.origin`’s representation `scheme://host:port`.
15251      */
15252     origin?: string;
15253     /**
15254      * The types of storages to clear, can be `cookies`, `filesystem`, `indexdb`,
15255      * `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If
15256      * not specified, clear all storage types.
15257      */
15258     storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers' | 'cachestorage'>;
15259     /**
15260      * The types of quotas to clear, can be `temporary`, `syncable`. If not specified,
15261      * clear all quotas.
15262      */
15263     quotas?: Array<'temporary' | 'syncable'>;
15264   }
15265
15266   interface ClientRequestConstructorOptions {
15267     /**
15268      * The HTTP request method. Defaults to the GET method.
15269      */
15270     method?: string;
15271     /**
15272      * The request URL. Must be provided in the absolute form with the protocol scheme
15273      * specified as http or https.
15274      */
15275     url?: string;
15276     /**
15277      * The `Session` instance with which the request is associated.
15278      */
15279     session?: Session;
15280     /**
15281      * The name of the `partition` with which the request is associated. Defaults to
15282      * the empty string. The `session` option supersedes `partition`. Thus if a
15283      * `session` is explicitly specified, `partition` is ignored.
15284      */
15285     partition?: string;
15286     /**
15287      * Can be `include`, `omit` or `same-origin`. Whether to send credentials with this
15288      * request. If set to `include`, credentials from the session associated with the
15289      * request will be used. If set to `omit`, credentials will not be sent with the
15290      * request (and the `'login'` event will not be triggered in the event of a 401).
15291      * If set to `same-origin`, `origin` must also be specified. This matches the
15292      * behavior of the fetch option of the same name. If this option is not specified,
15293      * authentication data from the session will be sent, and cookies will not be sent
15294      * (unless `useSessionCookies` is set).
15295      */
15296     credentials?: ('include' | 'omit' | 'same-origin');
15297     /**
15298      * Whether to send cookies with this request from the provided session. If
15299      * `credentials` is specified, this option has no effect. Default is `false`.
15300      */
15301     useSessionCookies?: boolean;
15302     /**
15303      * Can be `http:` or `https:`. The protocol scheme in the form 'scheme:'. Defaults
15304      * to 'http:'.
15305      */
15306     protocol?: ('http:' | 'https:');
15307     /**
15308      * The server host provided as a concatenation of the hostname and the port number
15309      * 'hostname:port'.
15310      */
15311     host?: string;
15312     /**
15313      * The server host name.
15314      */
15315     hostname?: string;
15316     /**
15317      * The server's listening port number.
15318      */
15319     port?: number;
15320     /**
15321      * The path part of the request URL.
15322      */
15323     path?: string;
15324     /**
15325      * Can be `follow`, `error` or `manual`. The redirect mode for this request. When
15326      * mode is `error`, any redirection will be aborted. When mode is `manual` the
15327      * redirection will be cancelled unless `request.followRedirect` is invoked
15328      * synchronously during the `redirect` event.  Defaults to `follow`.
15329      */
15330     redirect?: ('follow' | 'error' | 'manual');
15331     /**
15332      * The origin URL of the request.
15333      */
15334     origin?: string;
15335     /**
15336      * can be `""`, `no-referrer`, `no-referrer-when-downgrade`, `origin`,
15337      * `origin-when-cross-origin`, `unsafe-url`, `same-origin`, `strict-origin`, or
15338      * `strict-origin-when-cross-origin`. Defaults to
15339      * `strict-origin-when-cross-origin`.
15340      */
15341     referrerPolicy?: string;
15342     /**
15343      * can be `default`, `no-store`, `reload`, `no-cache`, `force-cache` or
15344      * `only-if-cached`.
15345      */
15346     cache?: ('default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached');
15347   }
15348
15349   interface CloseOpts {
15350     /**
15351      * if true, fire the `beforeunload` event before closing the page. If the page
15352      * prevents the unload, the WebContents will not be closed. The
15353      * `will-prevent-unload` will be fired if the page requests prevention of unload.
15354      */
15355     waitForBeforeUnload: boolean;
15356   }
15357
15358   interface Config {
15359     /**
15360      * The proxy mode. Should be one of `direct`, `auto_detect`, `pac_script`,
15361      * `fixed_servers` or `system`. If it's unspecified, it will be automatically
15362      * determined based on other specified options.
15363      */
15364     mode?: ('direct' | 'auto_detect' | 'pac_script' | 'fixed_servers' | 'system');
15365     /**
15366      * The URL associated with the PAC file.
15367      */
15368     pacScript?: string;
15369     /**
15370      * Rules indicating which proxies to use.
15371      */
15372     proxyRules?: string;
15373     /**
15374      * Rules indicating which URLs should bypass the proxy settings.
15375      */
15376     proxyBypassRules?: string;
15377   }
15378
15379   interface ConfigureHostResolverOptions {
15380     /**
15381      * Whether the built-in host resolver is used in preference to getaddrinfo. When
15382      * enabled, the built-in resolver will attempt to use the system's DNS settings to
15383      * do DNS lookups itself. Enabled by default on macOS, disabled by default on
15384      * Windows and Linux.
15385      */
15386     enableBuiltInResolver?: boolean;
15387     /**
15388      * Can be 'off', 'automatic' or 'secure'. Configures the DNS-over-HTTP mode. When
15389      * 'off', no DoH lookups will be performed. When 'automatic', DoH lookups will be
15390      * performed first if DoH is available, and insecure DNS lookups will be performed
15391      * as a fallback. When 'secure', only DoH lookups will be performed. Defaults to
15392      * 'automatic'.
15393      */
15394     secureDnsMode?: ('off' | 'automatic' | 'secure');
15395     /**
15396      * A list of DNS-over-HTTP server templates. See RFC8484 § 3 for details on the
15397      * template format. Most servers support the POST method; the template for such
15398      * servers is simply a URI. Note that for some DNS providers, the resolver will
15399      * automatically upgrade to DoH unless DoH is explicitly disabled, even if there
15400      * are no DoH servers provided in this list.
15401      */
15402     secureDnsServers?: string[];
15403     /**
15404      * Controls whether additional DNS query types, e.g. HTTPS (DNS type 65) will be
15405      * allowed besides the traditional A and AAAA queries when a request is being made
15406      * via insecure DNS. Has no effect on Secure DNS which always allows additional
15407      * types. Defaults to true.
15408      */
15409     enableAdditionalDnsQueryTypes?: boolean;
15410   }
15411
15412   interface ConsoleMessageEvent extends DOMEvent {
15413     /**
15414      * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
15415      * `error`.
15416      */
15417     level: number;
15418     /**
15419      * The actual console message
15420      */
15421     message: string;
15422     /**
15423      * The line number of the source that triggered this console message
15424      */
15425     line: number;
15426     sourceId: string;
15427   }
15428
15429   interface ContextMenuEvent extends DOMEvent {
15430     params: Params;
15431   }
15432
15433   interface ContextMenuParams {
15434     /**
15435      * x coordinate.
15436      */
15437     x: number;
15438     /**
15439      * y coordinate.
15440      */
15441     y: number;
15442     /**
15443      * Frame from which the context menu was invoked.
15444      */
15445     frame: WebFrameMain;
15446     /**
15447      * URL of the link that encloses the node the context menu was invoked on.
15448      */
15449     linkURL: string;
15450     /**
15451      * Text associated with the link. May be an empty string if the contents of the
15452      * link are an image.
15453      */
15454     linkText: string;
15455     /**
15456      * URL of the top level page that the context menu was invoked on.
15457      */
15458     pageURL: string;
15459     /**
15460      * URL of the subframe that the context menu was invoked on.
15461      */
15462     frameURL: string;
15463     /**
15464      * Source URL for the element that the context menu was invoked on. Elements with
15465      * source URLs are images, audio and video.
15466      */
15467     srcURL: string;
15468     /**
15469      * Type of the node the context menu was invoked on. Can be `none`, `image`,
15470      * `audio`, `video`, `canvas`, `file` or `plugin`.
15471      */
15472     mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
15473     /**
15474      * Whether the context menu was invoked on an image which has non-empty contents.
15475      */
15476     hasImageContents: boolean;
15477     /**
15478      * Whether the context is editable.
15479      */
15480     isEditable: boolean;
15481     /**
15482      * Text of the selection that the context menu was invoked on.
15483      */
15484     selectionText: string;
15485     /**
15486      * Title text of the selection that the context menu was invoked on.
15487      */
15488     titleText: string;
15489     /**
15490      * Alt text of the selection that the context menu was invoked on.
15491      */
15492     altText: string;
15493     /**
15494      * Suggested filename to be used when saving file through 'Save Link As' option of
15495      * context menu.
15496      */
15497     suggestedFilename: string;
15498     /**
15499      * Rect representing the coordinates in the document space of the selection.
15500      */
15501     selectionRect: Rectangle;
15502     /**
15503      * Start position of the selection text.
15504      */
15505     selectionStartOffset: number;
15506     /**
15507      * The referrer policy of the frame on which the menu is invoked.
15508      */
15509     referrerPolicy: Referrer;
15510     /**
15511      * The misspelled word under the cursor, if any.
15512      */
15513     misspelledWord: string;
15514     /**
15515      * An array of suggested words to show the user to replace the `misspelledWord`.
15516      * Only available if there is a misspelled word and spellchecker is enabled.
15517      */
15518     dictionarySuggestions: string[];
15519     /**
15520      * The character encoding of the frame on which the menu was invoked.
15521      */
15522     frameCharset: string;
15523     /**
15524      * The source that the context menu was invoked on. Possible values include `none`,
15525      * `button-button`, `field-set`, `input-button`, `input-checkbox`, `input-color`,
15526      * `input-date`, `input-datetime-local`, `input-email`, `input-file`,
15527      * `input-hidden`, `input-image`, `input-month`, `input-number`, `input-password`,
15528      * `input-radio`, `input-range`, `input-reset`, `input-search`, `input-submit`,
15529      * `input-telephone`, `input-text`, `input-time`, `input-url`, `input-week`,
15530      * `output`, `reset-button`, `select-list`, `select-list`, `select-multiple`,
15531      * `select-one`, `submit-button`, and `text-area`,
15532      */
15533     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');
15534     /**
15535      * If the context menu was invoked on an input field, the type of that field.
15536      * Possible values include `none`, `plainText`, `password`, `other`.
15537      *
15538      * @deprecated
15539      */
15540     inputFieldType: ('none' | 'plainText' | 'password' | 'other');
15541     /**
15542      * If the context is editable, whether or not spellchecking is enabled.
15543      */
15544     spellcheckEnabled: boolean;
15545     /**
15546      * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
15547      * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
15548      * `adjustSelection`, or `adjustSelectionReset`.
15549      */
15550     menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
15551     /**
15552      * The flags for the media element the context menu was invoked on.
15553      */
15554     mediaFlags: MediaFlags;
15555     /**
15556      * These flags indicate whether the renderer believes it is able to perform the
15557      * corresponding action.
15558      */
15559     editFlags: EditFlags;
15560   }
15561
15562   interface ContinueActivityDetails {
15563     /**
15564      * A string identifying the URL of the webpage accessed by the activity on another
15565      * device, if available.
15566      */
15567     webpageURL?: string;
15568   }
15569
15570   interface CookiesGetFilter {
15571     /**
15572      * Retrieves cookies which are associated with `url`. Empty implies retrieving
15573      * cookies of all URLs.
15574      */
15575     url?: string;
15576     /**
15577      * Filters cookies by name.
15578      */
15579     name?: string;
15580     /**
15581      * Retrieves cookies whose domains match or are subdomains of `domains`.
15582      */
15583     domain?: string;
15584     /**
15585      * Retrieves cookies whose path matches `path`.
15586      */
15587     path?: string;
15588     /**
15589      * Filters cookies by their Secure property.
15590      */
15591     secure?: boolean;
15592     /**
15593      * Filters out session or persistent cookies.
15594      */
15595     session?: boolean;
15596     /**
15597      * Filters cookies by httpOnly.
15598      */
15599     httpOnly?: boolean;
15600   }
15601
15602   interface CookiesSetDetails {
15603     /**
15604      * The URL to associate the cookie with. The promise will be rejected if the URL is
15605      * invalid.
15606      */
15607     url: string;
15608     /**
15609      * The name of the cookie. Empty by default if omitted.
15610      */
15611     name?: string;
15612     /**
15613      * The value of the cookie. Empty by default if omitted.
15614      */
15615     value?: string;
15616     /**
15617      * The domain of the cookie; this will be normalized with a preceding dot so that
15618      * it's also valid for subdomains. Empty by default if omitted.
15619      */
15620     domain?: string;
15621     /**
15622      * The path of the cookie. Empty by default if omitted.
15623      */
15624     path?: string;
15625     /**
15626      * Whether the cookie should be marked as Secure. Defaults to false unless Same
15627      * Site=None attribute is used.
15628      */
15629     secure?: boolean;
15630     /**
15631      * Whether the cookie should be marked as HTTP only. Defaults to false.
15632      */
15633     httpOnly?: boolean;
15634     /**
15635      * The expiration date of the cookie as the number of seconds since the UNIX epoch.
15636      * If omitted then the cookie becomes a session cookie and will not be retained
15637      * between sessions.
15638      */
15639     expirationDate?: number;
15640     /**
15641      * The Same Site policy to apply to this cookie.  Can be `unspecified`,
15642      * `no_restriction`, `lax` or `strict`.  Default is `lax`.
15643      */
15644     sameSite?: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
15645   }
15646
15647   interface CrashReporterStartOptions {
15648     /**
15649      * URL that crash reports will be sent to as POST. Required unless `uploadToServer`
15650      * is `false`.
15651      */
15652     submitURL?: string;
15653     /**
15654      * Defaults to `app.name`.
15655      */
15656     productName?: string;
15657     /**
15658      * Deprecated alias for `{ globalExtra: { _companyName: ... } }`.
15659      *
15660      * @deprecated
15661      */
15662     companyName?: string;
15663     /**
15664      * Whether crash reports should be sent to the server. If false, crash reports will
15665      * be collected and stored in the crashes directory, but not uploaded. Default is
15666      * `true`.
15667      */
15668     uploadToServer?: boolean;
15669     /**
15670      * If true, crashes generated in the main process will not be forwarded to the
15671      * system crash handler. Default is `false`.
15672      */
15673     ignoreSystemCrashHandler?: boolean;
15674     /**
15675      * If true, limit the number of crashes uploaded to 1/hour. Default is `false`.
15676      *
15677      * @platform darwin,win32
15678      */
15679     rateLimit?: boolean;
15680     /**
15681      * If true, crash reports will be compressed and uploaded with `Content-Encoding:
15682      * gzip`. Default is `true`.
15683      */
15684     compress?: boolean;
15685     /**
15686      * Extra string key/value annotations that will be sent along with crash reports
15687      * that are generated in the main process. Only string values are supported.
15688      * Crashes generated in child processes will not contain these extra parameters to
15689      * crash reports generated from child processes, call `addExtraParameter` from the
15690      * child process.
15691      */
15692     extra?: Record<string, string>;
15693     /**
15694      * Extra string key/value annotations that will be sent along with any crash
15695      * reports generated in any process. These annotations cannot be changed once the
15696      * crash reporter has been started. If a key is present in both the global extra
15697      * parameters and the process-specific extra parameters, then the global one will
15698      * take precedence. By default, `productName` and the app version are included, as
15699      * well as the Electron version.
15700      */
15701     globalExtra?: Record<string, string>;
15702   }
15703
15704   interface CreateFromBitmapOptions {
15705     width: number;
15706     height: number;
15707     /**
15708      * Defaults to 1.0.
15709      */
15710     scaleFactor?: number;
15711   }
15712
15713   interface CreateFromBufferOptions {
15714     /**
15715      * Required for bitmap buffers.
15716      */
15717     width?: number;
15718     /**
15719      * Required for bitmap buffers.
15720      */
15721     height?: number;
15722     /**
15723      * Defaults to 1.0.
15724      */
15725     scaleFactor?: number;
15726   }
15727
15728   interface CreateInterruptedDownloadOptions {
15729     /**
15730      * Absolute path of the download.
15731      */
15732     path: string;
15733     /**
15734      * Complete URL chain for the download.
15735      */
15736     urlChain: string[];
15737     mimeType?: string;
15738     /**
15739      * Start range for the download.
15740      */
15741     offset: number;
15742     /**
15743      * Total length of the download.
15744      */
15745     length: number;
15746     /**
15747      * Last-Modified header value.
15748      */
15749     lastModified?: string;
15750     /**
15751      * ETag header value.
15752      */
15753     eTag?: string;
15754     /**
15755      * Time when download was started in number of seconds since UNIX epoch.
15756      */
15757     startTime?: number;
15758   }
15759
15760   interface Data {
15761     text?: string;
15762     html?: string;
15763     image?: NativeImage;
15764     rtf?: string;
15765     /**
15766      * The title of the URL at `text`.
15767      */
15768     bookmark?: string;
15769   }
15770
15771   interface DefaultFontFamily {
15772     /**
15773      * Defaults to `Times New Roman`.
15774      */
15775     standard?: string;
15776     /**
15777      * Defaults to `Times New Roman`.
15778      */
15779     serif?: string;
15780     /**
15781      * Defaults to `Arial`.
15782      */
15783     sansSerif?: string;
15784     /**
15785      * Defaults to `Courier New`.
15786      */
15787     monospace?: string;
15788     /**
15789      * Defaults to `Script`.
15790      */
15791     cursive?: string;
15792     /**
15793      * Defaults to `Impact`.
15794      */
15795     fantasy?: string;
15796     /**
15797      * Defaults to `Latin Modern Math`.
15798      */
15799     math?: string;
15800   }
15801
15802   interface Details {
15803     /**
15804      * Process type. One of the following values:
15805      */
15806     type: ('Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
15807     /**
15808      * The reason the child process is gone. Possible values:
15809      */
15810     reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
15811     /**
15812      * The exit code for the process (e.g. status from waitpid if on posix, from
15813      * GetExitCodeProcess on Windows).
15814      */
15815     exitCode: number;
15816     /**
15817      * The non-localized name of the process.
15818      */
15819     serviceName?: string;
15820     /**
15821      * The name of the process. Examples for utility: `Audio Service`, `Content
15822      * Decryption Module Service`, `Network Service`, `Video Capture`, etc.
15823      */
15824     name?: string;
15825   }
15826
15827   interface DevicePermissionHandlerHandlerDetails {
15828     /**
15829      * The type of device that permission is being requested on, can be `hid`,
15830      * `serial`, or `usb`.
15831      */
15832     deviceType: ('hid' | 'serial' | 'usb');
15833     /**
15834      * The origin URL of the device permission check.
15835      */
15836     origin: string;
15837     /**
15838      * the device that permission is being requested for.
15839      */
15840     device: (HIDDevice) | (SerialPort) | (USBDevice);
15841   }
15842
15843   interface DevtoolsOpenUrlEvent extends DOMEvent {
15844     /**
15845      * URL of the link that was clicked or selected.
15846      */
15847     url: string;
15848   }
15849
15850   interface DidChangeThemeColorEvent extends DOMEvent {
15851     themeColor: string;
15852   }
15853
15854   interface DidCreateWindowDetails {
15855     /**
15856      * URL for the created window.
15857      */
15858     url: string;
15859     /**
15860      * Name given to the created window in the `window.open()` call.
15861      */
15862     frameName: string;
15863     /**
15864      * The options used to create the BrowserWindow. They are merged in increasing
15865      * precedence: parsed options from the `features` string from `window.open()`,
15866      * security-related webPreferences inherited from the parent, and options given by
15867      * `webContents.setWindowOpenHandler`. Unrecognized options are not filtered out.
15868      */
15869     options: BrowserWindowConstructorOptions;
15870     /**
15871      * The referrer that will be passed to the new window. May or may not result in the
15872      * `Referer` header being sent, depending on the referrer policy.
15873      */
15874     referrer: Referrer;
15875     /**
15876      * The post data that will be sent to the new window, along with the appropriate
15877      * headers that will be set. If no post data is to be sent, the value will be
15878      * `null`. Only defined when the window is being created by a form that set
15879      * `target=_blank`.
15880      */
15881     postBody?: PostBody;
15882     /**
15883      * Can be `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
15884      */
15885     disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
15886   }
15887
15888   interface DidFailLoadEvent extends DOMEvent {
15889     errorCode: number;
15890     errorDescription: string;
15891     validatedURL: string;
15892     isMainFrame: boolean;
15893   }
15894
15895   interface DidFrameFinishLoadEvent extends DOMEvent {
15896     isMainFrame: boolean;
15897   }
15898
15899   interface DidFrameNavigateEvent extends DOMEvent {
15900     url: string;
15901     /**
15902      * -1 for non HTTP navigations
15903      */
15904     httpResponseCode: number;
15905     /**
15906      * empty for non HTTP navigations,
15907      */
15908     httpStatusText: string;
15909     isMainFrame: boolean;
15910     frameProcessId: number;
15911     frameRoutingId: number;
15912   }
15913
15914   interface DidNavigateEvent extends DOMEvent {
15915     url: string;
15916   }
15917
15918   interface DidNavigateInPageEvent extends DOMEvent {
15919     isMainFrame: boolean;
15920     url: string;
15921   }
15922
15923   interface DidRedirectNavigationEvent extends DOMEvent {
15924     url: string;
15925     isInPlace: boolean;
15926     isMainFrame: boolean;
15927     frameProcessId: number;
15928     frameRoutingId: number;
15929   }
15930
15931   interface DidStartNavigationEvent extends DOMEvent {
15932     url: string;
15933     isInPlace: boolean;
15934     isMainFrame: boolean;
15935     frameProcessId: number;
15936     frameRoutingId: number;
15937   }
15938
15939   interface DisplayBalloonOptions {
15940     /**
15941      * Icon to use when `iconType` is `custom`.
15942      */
15943     icon?: (NativeImage) | (string);
15944     /**
15945      * Can be `none`, `info`, `warning`, `error` or `custom`. Default is `custom`.
15946      */
15947     iconType?: ('none' | 'info' | 'warning' | 'error' | 'custom');
15948     title: string;
15949     content: string;
15950     /**
15951      * The large version of the icon should be used. Default is `true`. Maps to
15952      * `NIIF_LARGE_ICON`.
15953      */
15954     largeIcon?: boolean;
15955     /**
15956      * Do not play the associated sound. Default is `false`. Maps to `NIIF_NOSOUND`.
15957      */
15958     noSound?: boolean;
15959     /**
15960      * Do not display the balloon notification if the current user is in "quiet time".
15961      * Default is `false`. Maps to `NIIF_RESPECT_QUIET_TIME`.
15962      */
15963     respectQuietTime?: boolean;
15964   }
15965
15966   interface DisplayMediaRequestHandlerHandlerRequest {
15967     /**
15968      * Frame that is requesting access to media.
15969      */
15970     frame: WebFrameMain;
15971     /**
15972      * Origin of the page making the request.
15973      */
15974     securityOrigin: string;
15975     /**
15976      * true if the web content requested a video stream.
15977      */
15978     videoRequested: boolean;
15979     /**
15980      * true if the web content requested an audio stream.
15981      */
15982     audioRequested: boolean;
15983     /**
15984      * Whether a user gesture was active when this request was triggered.
15985      */
15986     userGesture: boolean;
15987   }
15988
15989   interface DownloadURLOptions {
15990     /**
15991      * HTTP request headers.
15992      */
15993     headers?: Record<string, string>;
15994   }
15995
15996   interface EnableNetworkEmulationOptions {
15997     /**
15998      * Whether to emulate network outage. Defaults to false.
15999      */
16000     offline?: boolean;
16001     /**
16002      * RTT in ms. Defaults to 0 which will disable latency throttling.
16003      */
16004     latency?: number;
16005     /**
16006      * Download rate in Bps. Defaults to 0 which will disable download throttling.
16007      */
16008     downloadThroughput?: number;
16009     /**
16010      * Upload rate in Bps. Defaults to 0 which will disable upload throttling.
16011      */
16012     uploadThroughput?: number;
16013   }
16014
16015   interface FeedURLOptions {
16016     url: string;
16017     /**
16018      * HTTP request headers.
16019      *
16020      * @platform darwin
16021      */
16022     headers?: Record<string, string>;
16023     /**
16024      * Can be `json` or `default`, see the Squirrel.Mac README for more information.
16025      *
16026      * @platform darwin
16027      */
16028     serverType?: ('json' | 'default');
16029   }
16030
16031   interface FileIconOptions {
16032     size: ('small' | 'normal' | 'large');
16033   }
16034
16035   interface FindInPageOptions {
16036     /**
16037      * Whether to search forward or backward, defaults to `true`.
16038      */
16039     forward?: boolean;
16040     /**
16041      * Whether to begin a new text finding session with this request. Should be `true`
16042      * for initial requests, and `false` for follow-up requests. Defaults to `false`.
16043      */
16044     findNext?: boolean;
16045     /**
16046      * Whether search should be case-sensitive, defaults to `false`.
16047      */
16048     matchCase?: boolean;
16049   }
16050
16051   interface FocusOptions {
16052     /**
16053      * Make the receiver the active app even if another app is currently active.
16054      *
16055      * @platform darwin
16056      */
16057     steal: boolean;
16058   }
16059
16060   interface ForkOptions {
16061     /**
16062      * Environment key-value pairs. Default is `process.env`.
16063      */
16064     env?: Env;
16065     /**
16066      * List of string arguments passed to the executable.
16067      */
16068     execArgv?: string[];
16069     /**
16070      * Current working directory of the child process.
16071      */
16072     cwd?: string;
16073     /**
16074      * Allows configuring the mode for `stdout` and `stderr` of the child process.
16075      * Default is `inherit`. String value can be one of `pipe`, `ignore`, `inherit`,
16076      * for more details on these values you can refer to stdio documentation from
16077      * Node.js. Currently this option only supports configuring `stdout` and `stderr`
16078      * to either `pipe`, `inherit` or `ignore`. Configuring `stdin` is not supported;
16079      * `stdin` will always be ignored. For example, the supported values will be
16080      * processed as following:
16081      */
16082     stdio?: (Array<'pipe' | 'ignore' | 'inherit'>) | (string);
16083     /**
16084      * Name of the process that will appear in `name` property of `ProcessMetric`
16085      * returned by `app.getAppMetrics` and `child-process-gone` event of `app`. Default
16086      * is `Node Utility Process`.
16087      */
16088     serviceName?: string;
16089     /**
16090      * With this flag, the utility process will be launched via the `Electron Helper
16091      * (Plugin).app` helper executable on macOS, which can be codesigned with
16092      * `com.apple.security.cs.disable-library-validation` and
16093      * `com.apple.security.cs.allow-unsigned-executable-memory` entitlements. This will
16094      * allow the utility process to load unsigned libraries. Unless you specifically
16095      * need this capability, it is best to leave this disabled. Default is `false`.
16096      *
16097      * @platform darwin
16098      */
16099     allowLoadingUnsignedLibraries?: boolean;
16100   }
16101
16102   interface FoundInPageEvent extends DOMEvent {
16103     result: FoundInPageResult;
16104   }
16105
16106   interface FrameCreatedDetails {
16107     frame: WebFrameMain;
16108   }
16109
16110   interface FromPartitionOptions {
16111     /**
16112      * Whether to enable cache.
16113      */
16114     cache: boolean;
16115   }
16116
16117   interface FromPathOptions {
16118     /**
16119      * Whether to enable cache.
16120      */
16121     cache: boolean;
16122   }
16123
16124   interface HandlerDetails {
16125     /**
16126      * The _resolved_ version of the URL passed to `window.open()`. e.g. opening a
16127      * window with `window.open('foo')` will yield something like
16128      * `https://the-origin/the/current/path/foo`.
16129      */
16130     url: string;
16131     /**
16132      * Name of the window provided in `window.open()`
16133      */
16134     frameName: string;
16135     /**
16136      * Comma separated list of window features provided to `window.open()`.
16137      */
16138     features: string;
16139     /**
16140      * Can be `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
16141      */
16142     disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
16143     /**
16144      * The referrer that will be passed to the new window. May or may not result in the
16145      * `Referer` header being sent, depending on the referrer policy.
16146      */
16147     referrer: Referrer;
16148     /**
16149      * The post data that will be sent to the new window, along with the appropriate
16150      * headers that will be set. If no post data is to be sent, the value will be
16151      * `null`. Only defined when the window is being created by a form that set
16152      * `target=_blank`.
16153      */
16154     postBody?: PostBody;
16155   }
16156
16157   interface HeadersReceivedResponse {
16158     cancel?: boolean;
16159     /**
16160      * When provided, the server is assumed to have responded with these headers.
16161      */
16162     responseHeaders?: Record<string, (string) | (string[])>;
16163     /**
16164      * Should be provided when overriding `responseHeaders` to change header status
16165      * otherwise original response header's status will be used.
16166      */
16167     statusLine?: string;
16168   }
16169
16170   interface HeapStatistics {
16171     totalHeapSize: number;
16172     totalHeapSizeExecutable: number;
16173     totalPhysicalSize: number;
16174     totalAvailableSize: number;
16175     usedHeapSize: number;
16176     heapSizeLimit: number;
16177     mallocedMemory: number;
16178     peakMallocedMemory: number;
16179     doesZapGarbage: boolean;
16180   }
16181
16182   interface HidDeviceAddedDetails {
16183     device: HIDDevice;
16184     frame: WebFrameMain;
16185   }
16186
16187   interface HidDeviceRemovedDetails {
16188     device: HIDDevice;
16189     frame: WebFrameMain;
16190   }
16191
16192   interface HidDeviceRevokedDetails {
16193     device: HIDDevice;
16194     /**
16195      * The origin that the device has been revoked from.
16196      */
16197     origin?: string;
16198   }
16199
16200   interface IgnoreMouseEventsOptions {
16201     /**
16202      * If true, forwards mouse move messages to Chromium, enabling mouse related events
16203      * such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false,
16204      * forwarding is always disabled regardless of this value.
16205      *
16206      * @platform darwin,win32
16207      */
16208     forward?: boolean;
16209   }
16210
16211   interface ImportCertificateOptions {
16212     /**
16213      * Path for the pkcs12 file.
16214      */
16215     certificate: string;
16216     /**
16217      * Passphrase for the certificate.
16218      */
16219     password: string;
16220   }
16221
16222   interface Info {
16223     /**
16224      * Security origin for the isolated world.
16225      */
16226     securityOrigin?: string;
16227     /**
16228      * Content Security Policy for the isolated world.
16229      */
16230     csp?: string;
16231     /**
16232      * Name for isolated world. Useful in devtools.
16233      */
16234     name?: string;
16235   }
16236
16237   interface Input {
16238     /**
16239      * Either `keyUp` or `keyDown`.
16240      */
16241     type: string;
16242     /**
16243      * Equivalent to KeyboardEvent.key.
16244      */
16245     key: string;
16246     /**
16247      * Equivalent to KeyboardEvent.code.
16248      */
16249     code: string;
16250     /**
16251      * Equivalent to KeyboardEvent.repeat.
16252      */
16253     isAutoRepeat: boolean;
16254     /**
16255      * Equivalent to KeyboardEvent.isComposing.
16256      */
16257     isComposing: boolean;
16258     /**
16259      * Equivalent to KeyboardEvent.shiftKey.
16260      */
16261     shift: boolean;
16262     /**
16263      * Equivalent to KeyboardEvent.controlKey.
16264      */
16265     control: boolean;
16266     /**
16267      * Equivalent to KeyboardEvent.altKey.
16268      */
16269     alt: boolean;
16270     /**
16271      * Equivalent to KeyboardEvent.metaKey.
16272      */
16273     meta: boolean;
16274     /**
16275      * Equivalent to KeyboardEvent.location.
16276      */
16277     location: number;
16278     /**
16279      * See InputEvent.modifiers.
16280      */
16281     modifiers: string[];
16282   }
16283
16284   interface InsertCSSOptions {
16285     /**
16286      * Can be 'user' or 'author'. Sets the cascade origin of the inserted stylesheet.
16287      * Default is 'author'.
16288      */
16289     cssOrigin?: ('user' | 'author');
16290   }
16291
16292   interface IpcMessageEvent extends DOMEvent {
16293     /**
16294      * pair of `[processId, frameId]`.
16295      */
16296     frameId: [number, number];
16297     channel: string;
16298     args: any[];
16299   }
16300
16301   interface Item {
16302     /**
16303      * The path to the file being dragged.
16304      */
16305     file: string;
16306     /**
16307      * The paths to the files being dragged. (`files` will override `file` field)
16308      */
16309     files?: string[];
16310     /**
16311      * The image must be non-empty on macOS.
16312      */
16313     icon: (NativeImage) | (string);
16314   }
16315
16316   interface JumpListSettings {
16317     /**
16318      * The minimum number of items that will be shown in the Jump List (for a more
16319      * detailed description of this value see the MSDN docs).
16320      */
16321     minItems: number;
16322     /**
16323      * Array of `JumpListItem` objects that correspond to items that the user has
16324      * explicitly removed from custom categories in the Jump List. These items must not
16325      * be re-added to the Jump List in the **next** call to `app.setJumpList()`,
16326      * Windows will not display any custom category that contains any of the removed
16327      * items.
16328      */
16329     removedItems: JumpListItem[];
16330   }
16331
16332   interface LoadCommitEvent extends DOMEvent {
16333     url: string;
16334     isMainFrame: boolean;
16335   }
16336
16337   interface LoadExtensionOptions {
16338     /**
16339      * Whether to allow the extension to read local files over `file://` protocol and
16340      * inject content scripts into `file://` pages. This is required e.g. for loading
16341      * devtools extensions on `file://` URLs. Defaults to false.
16342      */
16343     allowFileAccess: boolean;
16344   }
16345
16346   interface LoadFileOptions {
16347     /**
16348      * Passed to `url.format()`.
16349      */
16350     query?: Record<string, string>;
16351     /**
16352      * Passed to `url.format()`.
16353      */
16354     search?: string;
16355     /**
16356      * Passed to `url.format()`.
16357      */
16358     hash?: string;
16359   }
16360
16361   interface LoadURLOptions {
16362     /**
16363      * An HTTP Referrer url.
16364      */
16365     httpReferrer?: (string) | (Referrer);
16366     /**
16367      * A user agent originating the request.
16368      */
16369     userAgent?: string;
16370     /**
16371      * Extra headers separated by "\n"
16372      */
16373     extraHeaders?: string;
16374     postData?: Array<(UploadRawData) | (UploadFile)>;
16375     /**
16376      * Base url (with trailing path separator) for files to be loaded by the data url.
16377      * This is needed only if the specified `url` is a data url and needs to load other
16378      * files.
16379      */
16380     baseURLForDataURL?: string;
16381   }
16382
16383   interface LoginItemSettings {
16384     /**
16385      * `true` if the app is set to open at login.
16386      */
16387     openAtLogin: boolean;
16388     /**
16389      * `true` if the app is set to open as hidden at login. This setting is not
16390      * available on MAS builds.
16391      *
16392      * @platform darwin
16393      */
16394     openAsHidden: boolean;
16395     /**
16396      * `true` if the app was opened at login automatically. This setting is not
16397      * available on MAS builds.
16398      *
16399      * @platform darwin
16400      */
16401     wasOpenedAtLogin: boolean;
16402     /**
16403      * `true` if the app was opened as a hidden login item. This indicates that the app
16404      * should not open any windows at startup. This setting is not available on MAS
16405      * builds.
16406      *
16407      * @platform darwin
16408      */
16409     wasOpenedAsHidden: boolean;
16410     /**
16411      * `true` if the app was opened as a login item that should restore the state from
16412      * the previous session. This indicates that the app should restore the windows
16413      * that were open the last time the app was closed. This setting is not available
16414      * on MAS builds.
16415      *
16416      * @platform darwin
16417      */
16418     restoreState: boolean;
16419     /**
16420      * `true` if app is set to open at login and its run key is not deactivated. This
16421      * differs from `openAtLogin` as it ignores the `args` option, this property will
16422      * be true if the given executable would be launched at login with **any**
16423      * arguments.
16424      *
16425      * @platform win32
16426      */
16427     executableWillLaunchAtLogin: boolean;
16428     launchItems: LaunchItems[];
16429   }
16430
16431   interface LoginItemSettingsOptions {
16432     /**
16433      * The executable path to compare against. Defaults to `process.execPath`.
16434      *
16435      * @platform win32
16436      */
16437     path?: string;
16438     /**
16439      * The command-line arguments to compare against. Defaults to an empty array.
16440      *
16441      * @platform win32
16442      */
16443     args?: string[];
16444   }
16445
16446   interface MenuItemConstructorOptions {
16447     /**
16448      * Will be called with `click(menuItem, browserWindow, event)` when the menu item
16449      * is clicked.
16450      */
16451     click?: (menuItem: MenuItem, browserWindow: (BrowserWindow) | (undefined), event: KeyboardEvent) => void;
16452     /**
16453      * Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`,
16454      * `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`,
16455      * `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`,
16456      * `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`,
16457      * `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`,
16458      * `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`,
16459      * `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`,
16460      * `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`,
16461      * `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
16462      * - Define the action of the menu item, when specified the `click` property will
16463      * be ignored. See roles.
16464      */
16465     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');
16466     /**
16467      * Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
16468      */
16469     type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
16470     label?: string;
16471     sublabel?: string;
16472     /**
16473      * Hover text for this menu item.
16474      *
16475      * @platform darwin
16476      */
16477     toolTip?: string;
16478     accelerator?: Accelerator;
16479     icon?: (NativeImage) | (string);
16480     /**
16481      * If false, the menu item will be greyed out and unclickable.
16482      */
16483     enabled?: boolean;
16484     /**
16485      * default is `true`, and when `false` will prevent the accelerator from triggering
16486      * the item if the item is not visible.
16487      *
16488      * @platform darwin
16489      */
16490     acceleratorWorksWhenHidden?: boolean;
16491     /**
16492      * If false, the menu item will be entirely hidden.
16493      */
16494     visible?: boolean;
16495     /**
16496      * Should only be specified for `checkbox` or `radio` type menu items.
16497      */
16498     checked?: boolean;
16499     /**
16500      * If false, the accelerator won't be registered with the system, but it will still
16501      * be displayed. Defaults to true.
16502      *
16503      * @platform linux,win32
16504      */
16505     registerAccelerator?: boolean;
16506     /**
16507      * The item to share when the `role` is `shareMenu`.
16508      *
16509      * @platform darwin
16510      */
16511     sharingItem?: SharingItem;
16512     /**
16513      * Should be specified for `submenu` type menu items. If `submenu` is specified,
16514      * the `type: 'submenu'` can be omitted. If the value is not a `Menu` then it will
16515      * be automatically converted to one using `Menu.buildFromTemplate`.
16516      */
16517     submenu?: (MenuItemConstructorOptions[]) | (Menu);
16518     /**
16519      * Unique within a single menu. If defined then it can be used as a reference to
16520      * this item by the position attribute.
16521      */
16522     id?: string;
16523     /**
16524      * Inserts this item before the item with the specified label. If the referenced
16525      * item doesn't exist the item will be inserted at the end of  the menu. Also
16526      * implies that the menu item in question should be placed in the same “group” as
16527      * the item.
16528      */
16529     before?: string[];
16530     /**
16531      * Inserts this item after the item with the specified label. If the referenced
16532      * item doesn't exist the item will be inserted at the end of the menu.
16533      */
16534     after?: string[];
16535     /**
16536      * Provides a means for a single context menu to declare the placement of their
16537      * containing group before the containing group of the item with the specified
16538      * label.
16539      */
16540     beforeGroupContaining?: string[];
16541     /**
16542      * Provides a means for a single context menu to declare the placement of their
16543      * containing group after the containing group of the item with the specified
16544      * label.
16545      */
16546     afterGroupContaining?: string[];
16547   }
16548
16549   interface MessageBoxOptions {
16550     /**
16551      * Content of the message box.
16552      */
16553     message: string;
16554     /**
16555      * Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
16556      * displays the same icon as `info`, unless you set an icon using the `icon`
16557      * option. On macOS, both `warning` and `error` display the same warning icon.
16558      */
16559     type?: ('none' | 'info' | 'error' | 'question' | 'warning');
16560     /**
16561      * Array of texts for buttons. On Windows, an empty array will result in one button
16562      * labeled "OK".
16563      */
16564     buttons?: string[];
16565     /**
16566      * Index of the button in the buttons array which will be selected by default when
16567      * the message box opens.
16568      */
16569     defaultId?: number;
16570     /**
16571      * Pass an instance of AbortSignal to optionally close the message box, the message
16572      * box will behave as if it was cancelled by the user. On macOS, `signal` does not
16573      * work with message boxes that do not have a parent window, since those message
16574      * boxes run synchronously due to platform limitations.
16575      */
16576     signal?: AbortSignal;
16577     /**
16578      * Title of the message box, some platforms will not show it.
16579      */
16580     title?: string;
16581     /**
16582      * Extra information of the message.
16583      */
16584     detail?: string;
16585     /**
16586      * If provided, the message box will include a checkbox with the given label.
16587      */
16588     checkboxLabel?: string;
16589     /**
16590      * Initial checked state of the checkbox. `false` by default.
16591      */
16592     checkboxChecked?: boolean;
16593     icon?: (NativeImage) | (string);
16594     /**
16595      * Custom width of the text in the message box.
16596      *
16597      * @platform darwin
16598      */
16599     textWidth?: number;
16600     /**
16601      * The index of the button to be used to cancel the dialog, via the `Esc` key. By
16602      * default this is assigned to the first button with "cancel" or "no" as the label.
16603      * If no such labeled buttons exist and this option is not set, `0` will be used as
16604      * the return value.
16605      */
16606     cancelId?: number;
16607     /**
16608      * On Windows Electron will try to figure out which one of the `buttons` are common
16609      * buttons (like "Cancel" or "Yes"), and show the others as command links in the
16610      * dialog. This can make the dialog appear in the style of modern Windows apps. If
16611      * you don't like this behavior, you can set `noLink` to `true`.
16612      */
16613     noLink?: boolean;
16614     /**
16615      * Normalize the keyboard access keys across platforms. Default is `false`.
16616      * Enabling this assumes `&` is used in the button labels for the placement of the
16617      * keyboard shortcut access key and labels will be converted so they work correctly
16618      * on each platform, `&` characters are removed on macOS, converted to `_` on
16619      * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
16620      * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
16621      * via `Alt-W` on Windows and Linux.
16622      */
16623     normalizeAccessKeys?: boolean;
16624   }
16625
16626   interface MessageBoxReturnValue {
16627     /**
16628      * The index of the clicked button.
16629      */
16630     response: number;
16631     /**
16632      * The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.
16633      */
16634     checkboxChecked: boolean;
16635   }
16636
16637   interface MessageBoxSyncOptions {
16638     /**
16639      * Content of the message box.
16640      */
16641     message: string;
16642     /**
16643      * Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
16644      * displays the same icon as `info`, unless you set an icon using the `icon`
16645      * option. On macOS, both `warning` and `error` display the same warning icon.
16646      */
16647     type?: ('none' | 'info' | 'error' | 'question' | 'warning');
16648     /**
16649      * Array of texts for buttons. On Windows, an empty array will result in one button
16650      * labeled "OK".
16651      */
16652     buttons?: string[];
16653     /**
16654      * Index of the button in the buttons array which will be selected by default when
16655      * the message box opens.
16656      */
16657     defaultId?: number;
16658     /**
16659      * Title of the message box, some platforms will not show it.
16660      */
16661     title?: string;
16662     /**
16663      * Extra information of the message.
16664      */
16665     detail?: string;
16666     icon?: (NativeImage) | (string);
16667     /**
16668      * Custom width of the text in the message box.
16669      *
16670      * @platform darwin
16671      */
16672     textWidth?: number;
16673     /**
16674      * The index of the button to be used to cancel the dialog, via the `Esc` key. By
16675      * default this is assigned to the first button with "cancel" or "no" as the label.
16676      * If no such labeled buttons exist and this option is not set, `0` will be used as
16677      * the return value.
16678      */
16679     cancelId?: number;
16680     /**
16681      * On Windows Electron will try to figure out which one of the `buttons` are common
16682      * buttons (like "Cancel" or "Yes"), and show the others as command links in the
16683      * dialog. This can make the dialog appear in the style of modern Windows apps. If
16684      * you don't like this behavior, you can set `noLink` to `true`.
16685      */
16686     noLink?: boolean;
16687     /**
16688      * Normalize the keyboard access keys across platforms. Default is `false`.
16689      * Enabling this assumes `&` is used in the button labels for the placement of the
16690      * keyboard shortcut access key and labels will be converted so they work correctly
16691      * on each platform, `&` characters are removed on macOS, converted to `_` on
16692      * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
16693      * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
16694      * via `Alt-W` on Windows and Linux.
16695      */
16696     normalizeAccessKeys?: boolean;
16697   }
16698
16699   interface MessageDetails {
16700     /**
16701      * The actual console message
16702      */
16703     message: string;
16704     /**
16705      * The version ID of the service worker that sent the log message
16706      */
16707     versionId: number;
16708     /**
16709      * The type of source for this message.  Can be `javascript`, `xml`, `network`,
16710      * `console-api`, `storage`, `rendering`, `security`, `deprecation`, `worker`,
16711      * `violation`, `intervention`, `recommendation` or `other`.
16712      */
16713     source: ('javascript' | 'xml' | 'network' | 'console-api' | 'storage' | 'rendering' | 'security' | 'deprecation' | 'worker' | 'violation' | 'intervention' | 'recommendation' | 'other');
16714     /**
16715      * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
16716      * `error`.
16717      */
16718     level: number;
16719     /**
16720      * The URL the message came from
16721      */
16722     sourceUrl: string;
16723     /**
16724      * The line number of the source that triggered this console message
16725      */
16726     lineNumber: number;
16727   }
16728
16729   interface MessageEvent {
16730     data: any;
16731     ports: MessagePortMain[];
16732   }
16733
16734   interface MoveToApplicationsFolderOptions {
16735     /**
16736      * A handler for potential conflict in move failure.
16737      */
16738     conflictHandler?: (conflictType: 'exists' | 'existsAndRunning') => boolean;
16739   }
16740
16741   interface NotificationConstructorOptions {
16742     /**
16743      * A title for the notification, which will be displayed at the top of the
16744      * notification window when it is shown.
16745      */
16746     title?: string;
16747     /**
16748      * A subtitle for the notification, which will be displayed below the title.
16749      *
16750      * @platform darwin
16751      */
16752     subtitle?: string;
16753     /**
16754      * The body text of the notification, which will be displayed below the title or
16755      * subtitle.
16756      */
16757     body?: string;
16758     /**
16759      * Whether or not to suppress the OS notification noise when showing the
16760      * notification.
16761      */
16762     silent?: boolean;
16763     /**
16764      * An icon to use in the notification.
16765      */
16766     icon?: (string) | (NativeImage);
16767     /**
16768      * Whether or not to add an inline reply option to the notification.
16769      *
16770      * @platform darwin
16771      */
16772     hasReply?: boolean;
16773     /**
16774      * The timeout duration of the notification. Can be 'default' or 'never'.
16775      *
16776      * @platform linux,win32
16777      */
16778     timeoutType?: ('default' | 'never');
16779     /**
16780      * The placeholder to write in the inline reply input field.
16781      *
16782      * @platform darwin
16783      */
16784     replyPlaceholder?: string;
16785     /**
16786      * The name of the sound file to play when the notification is shown.
16787      *
16788      * @platform darwin
16789      */
16790     sound?: string;
16791     /**
16792      * The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
16793      *
16794      * @platform linux
16795      */
16796     urgency?: ('normal' | 'critical' | 'low');
16797     /**
16798      * Actions to add to the notification. Please read the available actions and
16799      * limitations in the `NotificationAction` documentation.
16800      *
16801      * @platform darwin
16802      */
16803     actions?: NotificationAction[];
16804     /**
16805      * A custom title for the close button of an alert. An empty string will cause the
16806      * default localized text to be used.
16807      *
16808      * @platform darwin
16809      */
16810     closeButtonText?: string;
16811     /**
16812      * A custom description of the Notification on Windows superseding all properties
16813      * above. Provides full customization of design and behavior of the notification.
16814      *
16815      * @platform win32
16816      */
16817     toastXml?: string;
16818   }
16819
16820   interface OnBeforeRedirectListenerDetails {
16821     id: number;
16822     url: string;
16823     method: string;
16824     webContentsId?: number;
16825     webContents?: WebContents;
16826     frame?: WebFrameMain;
16827     /**
16828      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
16829      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
16830      */
16831     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
16832     referrer: string;
16833     timestamp: number;
16834     redirectURL: string;
16835     statusCode: number;
16836     statusLine: string;
16837     /**
16838      * The server IP address that the request was actually sent to.
16839      */
16840     ip?: string;
16841     fromCache: boolean;
16842     responseHeaders?: Record<string, string[]>;
16843   }
16844
16845   interface OnBeforeRequestListenerDetails {
16846     id: number;
16847     url: string;
16848     method: string;
16849     webContentsId?: number;
16850     webContents?: WebContents;
16851     frame?: WebFrameMain;
16852     /**
16853      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
16854      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
16855      */
16856     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
16857     referrer: string;
16858     timestamp: number;
16859     uploadData: UploadData[];
16860   }
16861
16862   interface OnBeforeSendHeadersListenerDetails {
16863     id: number;
16864     url: string;
16865     method: string;
16866     webContentsId?: number;
16867     webContents?: WebContents;
16868     frame?: WebFrameMain;
16869     /**
16870      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
16871      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
16872      */
16873     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
16874     referrer: string;
16875     timestamp: number;
16876     uploadData?: UploadData[];
16877     requestHeaders: Record<string, string>;
16878   }
16879
16880   interface OnCompletedListenerDetails {
16881     id: number;
16882     url: string;
16883     method: string;
16884     webContentsId?: number;
16885     webContents?: WebContents;
16886     frame?: WebFrameMain;
16887     /**
16888      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
16889      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
16890      */
16891     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
16892     referrer: string;
16893     timestamp: number;
16894     responseHeaders?: Record<string, string[]>;
16895     fromCache: boolean;
16896     statusCode: number;
16897     statusLine: string;
16898     error: string;
16899   }
16900
16901   interface OnErrorOccurredListenerDetails {
16902     id: number;
16903     url: string;
16904     method: string;
16905     webContentsId?: number;
16906     webContents?: WebContents;
16907     frame?: WebFrameMain;
16908     /**
16909      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
16910      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
16911      */
16912     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
16913     referrer: string;
16914     timestamp: number;
16915     fromCache: boolean;
16916     /**
16917      * The error description.
16918      */
16919     error: string;
16920   }
16921
16922   interface OnHeadersReceivedListenerDetails {
16923     id: number;
16924     url: string;
16925     method: string;
16926     webContentsId?: number;
16927     webContents?: WebContents;
16928     frame?: WebFrameMain;
16929     /**
16930      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
16931      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
16932      */
16933     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
16934     referrer: string;
16935     timestamp: number;
16936     statusLine: string;
16937     statusCode: number;
16938     responseHeaders?: Record<string, string[]>;
16939   }
16940
16941   interface OnResponseStartedListenerDetails {
16942     id: number;
16943     url: string;
16944     method: string;
16945     webContentsId?: number;
16946     webContents?: WebContents;
16947     frame?: WebFrameMain;
16948     /**
16949      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
16950      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
16951      */
16952     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
16953     referrer: string;
16954     timestamp: number;
16955     responseHeaders?: Record<string, string[]>;
16956     /**
16957      * Indicates whether the response was fetched from disk cache.
16958      */
16959     fromCache: boolean;
16960     statusCode: number;
16961     statusLine: string;
16962   }
16963
16964   interface OnSendHeadersListenerDetails {
16965     id: number;
16966     url: string;
16967     method: string;
16968     webContentsId?: number;
16969     webContents?: WebContents;
16970     frame?: WebFrameMain;
16971     /**
16972      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
16973      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
16974      */
16975     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
16976     referrer: string;
16977     timestamp: number;
16978     requestHeaders: Record<string, string>;
16979   }
16980
16981   interface OpenDevToolsOptions {
16982     /**
16983      * Opens the devtools with specified dock state, can be `left`, `right`, `bottom`,
16984      * `undocked`, `detach`. Defaults to last used dock state. In `undocked` mode it's
16985      * possible to dock back. In `detach` mode it's not.
16986      */
16987     mode: ('left' | 'right' | 'bottom' | 'undocked' | 'detach');
16988     /**
16989      * Whether to bring the opened devtools window to the foreground. The default is
16990      * `true`.
16991      */
16992     activate?: boolean;
16993     /**
16994      * A title for the DevTools window (only in `undocked` or `detach` mode).
16995      */
16996     title?: string;
16997   }
16998
16999   interface OpenDialogOptions {
17000     title?: string;
17001     defaultPath?: string;
17002     /**
17003      * Custom label for the confirmation button, when left empty the default label will
17004      * be used.
17005      */
17006     buttonLabel?: string;
17007     filters?: FileFilter[];
17008     /**
17009      * Contains which features the dialog should use. The following values are
17010      * supported:
17011      */
17012     properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
17013     /**
17014      * Message to display above input boxes.
17015      *
17016      * @platform darwin
17017      */
17018     message?: string;
17019     /**
17020      * Create security scoped bookmarks when packaged for the Mac App Store.
17021      *
17022      * @platform darwin,mas
17023      */
17024     securityScopedBookmarks?: boolean;
17025   }
17026
17027   interface OpenDialogReturnValue {
17028     /**
17029      * whether or not the dialog was canceled.
17030      */
17031     canceled: boolean;
17032     /**
17033      * An array of file paths chosen by the user. If the dialog is cancelled this will
17034      * be an empty array.
17035      */
17036     filePaths: string[];
17037     /**
17038      * An array matching the `filePaths` array of base64 encoded strings which contains
17039      * security scoped bookmark data. `securityScopedBookmarks` must be enabled for
17040      * this to be populated. (For return values, see table here.)
17041      *
17042      * @platform darwin,mas
17043      */
17044     bookmarks?: string[];
17045   }
17046
17047   interface OpenDialogSyncOptions {
17048     title?: string;
17049     defaultPath?: string;
17050     /**
17051      * Custom label for the confirmation button, when left empty the default label will
17052      * be used.
17053      */
17054     buttonLabel?: string;
17055     filters?: FileFilter[];
17056     /**
17057      * Contains which features the dialog should use. The following values are
17058      * supported:
17059      */
17060     properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
17061     /**
17062      * Message to display above input boxes.
17063      *
17064      * @platform darwin
17065      */
17066     message?: string;
17067     /**
17068      * Create security scoped bookmarks when packaged for the Mac App Store.
17069      *
17070      * @platform darwin,mas
17071      */
17072     securityScopedBookmarks?: boolean;
17073   }
17074
17075   interface OpenExternalOptions {
17076     /**
17077      * `true` to bring the opened application to the foreground. The default is `true`.
17078      *
17079      * @platform darwin
17080      */
17081     activate?: boolean;
17082     /**
17083      * The working directory.
17084      *
17085      * @platform win32
17086      */
17087     workingDirectory?: string;
17088     /**
17089      * Indicates a user initiated launch that enables tracking of frequently used
17090      * programs and other behaviors. The default is `false`.
17091      *
17092      * @platform win32
17093      */
17094     logUsage?: boolean;
17095   }
17096
17097   interface Options {
17098   }
17099
17100   interface Opts {
17101     /**
17102      *  Keep the page hidden instead of visible. Default is `false`.
17103      */
17104     stayHidden?: boolean;
17105     /**
17106      *  Keep the system awake instead of allowing it to sleep. Default is `false`.
17107      */
17108     stayAwake?: boolean;
17109   }
17110
17111   interface PageFaviconUpdatedEvent extends DOMEvent {
17112     /**
17113      * Array of URLs.
17114      */
17115     favicons: string[];
17116   }
17117
17118   interface PageTitleUpdatedEvent extends DOMEvent {
17119     title: string;
17120     explicitSet: boolean;
17121   }
17122
17123   interface Parameters {
17124     /**
17125      * Specify the screen type to emulate (default: `desktop`):
17126      */
17127     screenPosition: ('desktop' | 'mobile');
17128     /**
17129      * Set the emulated screen size (screenPosition == mobile).
17130      */
17131     screenSize: Size;
17132     /**
17133      * Position the view on the screen (screenPosition == mobile) (default: `{ x: 0, y:
17134      * 0 }`).
17135      */
17136     viewPosition: Point;
17137     /**
17138      * Set the device scale factor (if zero defaults to original device scale factor)
17139      * (default: `0`).
17140      */
17141     deviceScaleFactor: number;
17142     /**
17143      * Set the emulated view size (empty means no override)
17144      */
17145     viewSize: Size;
17146     /**
17147      * Scale of emulated view inside available space (not in fit to view mode)
17148      * (default: `1`).
17149      */
17150     scale: number;
17151   }
17152
17153   interface Payment {
17154     /**
17155      * The identifier of the purchased product.
17156      */
17157     productIdentifier: string;
17158     /**
17159      * The quantity purchased.
17160      */
17161     quantity: number;
17162     /**
17163      * An opaque identifier for the user’s account on your system.
17164      */
17165     applicationUsername: string;
17166     /**
17167      * The details of the discount offer to apply to the payment.
17168      */
17169     paymentDiscount?: PaymentDiscount;
17170   }
17171
17172   interface PermissionCheckHandlerHandlerDetails {
17173     /**
17174      * The origin of the frame embedding the frame that made the permission check.
17175      * Only set for cross-origin sub frames making permission checks.
17176      */
17177     embeddingOrigin?: string;
17178     /**
17179      * The security origin of the `media` check.
17180      */
17181     securityOrigin?: string;
17182     /**
17183      * The type of media access being requested, can be `video`, `audio` or `unknown`
17184      */
17185     mediaType?: ('video' | 'audio' | 'unknown');
17186     /**
17187      * The last URL the requesting frame loaded.  This is not provided for cross-origin
17188      * sub frames making permission checks.
17189      */
17190     requestingUrl?: string;
17191     /**
17192      * Whether the frame making the request is the main frame
17193      */
17194     isMainFrame: boolean;
17195   }
17196
17197   interface PermissionRequestHandlerHandlerDetails {
17198     /**
17199      * The url of the `openExternal` request.
17200      */
17201     externalURL?: string;
17202     /**
17203      * The security origin of the `media` request.
17204      */
17205     securityOrigin?: string;
17206     /**
17207      * The types of media access being requested, elements can be `video` or `audio`
17208      */
17209     mediaTypes?: Array<'video' | 'audio'>;
17210     /**
17211      * The last URL the requesting frame loaded
17212      */
17213     requestingUrl: string;
17214     /**
17215      * Whether the frame making the request is the main frame
17216      */
17217     isMainFrame: boolean;
17218   }
17219
17220   interface PluginCrashedEvent extends DOMEvent {
17221     name: string;
17222     version: string;
17223   }
17224
17225   interface PopupOptions {
17226     /**
17227      * Default is the focused window.
17228      */
17229     window?: BrowserWindow;
17230     /**
17231      * Default is the current mouse cursor position. Must be declared if `y` is
17232      * declared.
17233      */
17234     x?: number;
17235     /**
17236      * Default is the current mouse cursor position. Must be declared if `x` is
17237      * declared.
17238      */
17239     y?: number;
17240     /**
17241      * The index of the menu item to be positioned under the mouse cursor at the
17242      * specified coordinates. Default is -1.
17243      *
17244      * @platform darwin
17245      */
17246     positioningItem?: number;
17247     /**
17248      * This should map to the `menuSourceType` provided by the `context-menu` event. It
17249      * is not recommended to set this value manually, only provide values you receive
17250      * from other APIs or leave it `undefined`. Can be `none`, `mouse`, `keyboard`,
17251      * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
17252      * `adjustSelection`, or `adjustSelectionReset`.
17253      *
17254      * @platform win32,linux
17255      */
17256     sourceType?: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
17257     /**
17258      * Called when menu is closed.
17259      */
17260     callback?: () => void;
17261   }
17262
17263   interface PreconnectOptions {
17264     /**
17265      * URL for preconnect. Only the origin is relevant for opening the socket.
17266      */
17267     url: string;
17268     /**
17269      * number of sockets to preconnect. Must be between 1 and 6. Defaults to 1.
17270      */
17271     numSockets?: number;
17272   }
17273
17274   interface PrintToPDFOptions {
17275     /**
17276      * Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
17277      */
17278     landscape?: boolean;
17279     /**
17280      * Whether to display header and footer. Defaults to false.
17281      */
17282     displayHeaderFooter?: boolean;
17283     /**
17284      * Whether to print background graphics. Defaults to false.
17285      */
17286     printBackground?: boolean;
17287     /**
17288      * Scale of the webpage rendering. Defaults to 1.
17289      */
17290     scale?: number;
17291     /**
17292      * Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
17293      * `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
17294      * `height` and `width` in inches. Defaults to `Letter`.
17295      */
17296     pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid' | 'Ledger')) | (Size);
17297     margins?: Margins;
17298     /**
17299      * Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which
17300      * means print all pages.
17301      */
17302     pageRanges?: string;
17303     /**
17304      * HTML template for the print header. Should be valid HTML markup with following
17305      * classes used to inject printing values into them: `date` (formatted print date),
17306      * `title` (document title), `url` (document location), `pageNumber` (current page
17307      * number) and `totalPages` (total pages in the document). For example, `<span
17308      * class=title></span>` would generate span containing the title.
17309      */
17310     headerTemplate?: string;
17311     /**
17312      * HTML template for the print footer. Should use the same format as the
17313      * `headerTemplate`.
17314      */
17315     footerTemplate?: string;
17316     /**
17317      * Whether or not to prefer page size as defined by css. Defaults to false, in
17318      * which case the content will be scaled to fit the paper size.
17319      */
17320     preferCSSPageSize?: boolean;
17321     /**
17322      * Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this
17323      * property is experimental, the generated PDF may not adhere fully to PDF/UA and
17324      * WCAG standards.
17325      *
17326      * @experimental
17327      */
17328     generateTaggedPDF?: boolean;
17329   }
17330
17331   interface Privileges {
17332     /**
17333      * Default false.
17334      */
17335     standard?: boolean;
17336     /**
17337      * Default false.
17338      */
17339     secure?: boolean;
17340     /**
17341      * Default false.
17342      */
17343     bypassCSP?: boolean;
17344     /**
17345      * Default false.
17346      */
17347     allowServiceWorkers?: boolean;
17348     /**
17349      * Default false.
17350      */
17351     supportFetchAPI?: boolean;
17352     /**
17353      * Default false.
17354      */
17355     corsEnabled?: boolean;
17356     /**
17357      * Default false.
17358      */
17359     stream?: boolean;
17360     /**
17361      * Enable V8 code cache for the scheme, only works when `standard` is also set to
17362      * true. Default false.
17363      */
17364     codeCache?: boolean;
17365   }
17366
17367   interface ProgressBarOptions {
17368     /**
17369      * Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or
17370      * `paused`.
17371      *
17372      * @platform win32
17373      */
17374     mode: ('none' | 'normal' | 'indeterminate' | 'error' | 'paused');
17375   }
17376
17377   interface Provider {
17378     spellCheck: (words: string[], callback: (misspeltWords: string[]) => void) => void;
17379   }
17380
17381   interface PurchaseProductOpts {
17382     /**
17383      * The number of items the user wants to purchase.
17384      */
17385     quantity?: number;
17386     /**
17387      * The string that associates the transaction with a user account on your service
17388      * (applicationUsername).
17389      */
17390     username?: string;
17391   }
17392
17393   interface ReadBookmark {
17394     title: string;
17395     url: string;
17396   }
17397
17398   interface RegistrationCompletedDetails {
17399     /**
17400      * The base URL that a service worker is registered for
17401      */
17402     scope: string;
17403   }
17404
17405   interface RelaunchOptions {
17406     args?: string[];
17407     execPath?: string;
17408   }
17409
17410   interface RenderProcessGoneEvent extends DOMEvent {
17411     details: RenderProcessGoneDetails;
17412   }
17413
17414   interface Request {
17415     hostname: string;
17416     certificate: Certificate;
17417     validatedCertificate: Certificate;
17418     /**
17419      * `true` if Chromium recognises the root CA as a standard root. If it isn't then
17420      * it's probably the case that this certificate was generated by a MITM proxy whose
17421      * root has been installed locally (for example, by a corporate proxy). This should
17422      * not be trusted if the `verificationResult` is not `OK`.
17423      */
17424     isIssuedByKnownRoot: boolean;
17425     /**
17426      * `OK` if the certificate is trusted, otherwise an error like `CERT_REVOKED`.
17427      */
17428     verificationResult: string;
17429     /**
17430      * Error code.
17431      */
17432     errorCode: number;
17433   }
17434
17435   interface ResizeOptions {
17436     /**
17437      * Defaults to the image's width.
17438      */
17439     width?: number;
17440     /**
17441      * Defaults to the image's height.
17442      */
17443     height?: number;
17444     /**
17445      * The desired quality of the resize image. Possible values include `good`,
17446      * `better`, or `best`. The default is `best`. These values express a desired
17447      * quality/speed tradeoff. They are translated into an algorithm-specific method
17448      * that depends on the capabilities (CPU, GPU) of the underlying platform. It is
17449      * possible for all three methods to be mapped to the same algorithm on a given
17450      * platform.
17451      */
17452     quality?: ('good' | 'better' | 'best');
17453   }
17454
17455   interface ResolveHostOptions {
17456     /**
17457      * Requested DNS query type. If unspecified, resolver will pick A or AAAA (or both)
17458      * based on IPv4/IPv6 settings:
17459      */
17460     queryType?: ('A' | 'AAAA');
17461     /**
17462      * The source to use for resolved addresses. Default allows the resolver to pick an
17463      * appropriate source. Only affects use of big external sources (e.g. calling the
17464      * system for resolution or using DNS). Even if a source is specified, results can
17465      * still come from cache, resolving "localhost" or IP literals, etc. One of the
17466      * following values:
17467      */
17468     source?: ('any' | 'system' | 'dns' | 'mdns' | 'localOnly');
17469     /**
17470      * Indicates what DNS cache entries, if any, can be used to provide a response. One
17471      * of the following values:
17472      */
17473     cacheUsage?: ('allowed' | 'staleAllowed' | 'disallowed');
17474     /**
17475      * Controls the resolver's Secure DNS behavior for this request. One of the
17476      * following values:
17477      */
17478     secureDnsPolicy?: ('allow' | 'disable');
17479   }
17480
17481   interface ResourceUsage {
17482     images: MemoryUsageDetails;
17483     scripts: MemoryUsageDetails;
17484     cssStyleSheets: MemoryUsageDetails;
17485     xslStyleSheets: MemoryUsageDetails;
17486     fonts: MemoryUsageDetails;
17487     other: MemoryUsageDetails;
17488   }
17489
17490   interface Response {
17491     /**
17492      * `false` should be passed in if the dialog is canceled. If the `pairingKind` is
17493      * `confirm` or `confirmPin`, this value should indicate if the pairing is
17494      * confirmed.  If the `pairingKind` is `providePin` the value should be `true` when
17495      * a value is provided.
17496      */
17497     confirmed: boolean;
17498     /**
17499      * When the `pairingKind` is `providePin` this value should be the required pin for
17500      * the Bluetooth device.
17501      */
17502     pin?: (string) | (null);
17503   }
17504
17505   interface Result {
17506     requestId: number;
17507     /**
17508      * Position of the active match.
17509      */
17510     activeMatchOrdinal: number;
17511     /**
17512      * Number of Matches.
17513      */
17514     matches: number;
17515     /**
17516      * Coordinates of first match region.
17517      */
17518     selectionArea: Rectangle;
17519     finalUpdate: boolean;
17520   }
17521
17522   interface SaveDialogOptions {
17523     /**
17524      * The dialog title. Cannot be displayed on some _Linux_ desktop environments.
17525      */
17526     title?: string;
17527     /**
17528      * Absolute directory path, absolute file path, or file name to use by default.
17529      */
17530     defaultPath?: string;
17531     /**
17532      * Custom label for the confirmation button, when left empty the default label will
17533      * be used.
17534      */
17535     buttonLabel?: string;
17536     filters?: FileFilter[];
17537     /**
17538      * Message to display above text fields.
17539      *
17540      * @platform darwin
17541      */
17542     message?: string;
17543     /**
17544      * Custom label for the text displayed in front of the filename text field.
17545      *
17546      * @platform darwin
17547      */
17548     nameFieldLabel?: string;
17549     /**
17550      * Show the tags input box, defaults to `true`.
17551      *
17552      * @platform darwin
17553      */
17554     showsTagField?: boolean;
17555     properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
17556     /**
17557      * Create a security scoped bookmark when packaged for the Mac App Store. If this
17558      * option is enabled and the file doesn't already exist a blank file will be
17559      * created at the chosen path.
17560      *
17561      * @platform darwin,mas
17562      */
17563     securityScopedBookmarks?: boolean;
17564   }
17565
17566   interface SaveDialogReturnValue {
17567     /**
17568      * whether or not the dialog was canceled.
17569      */
17570     canceled: boolean;
17571     /**
17572      * If the dialog is canceled, this will be `undefined`.
17573      */
17574     filePath?: string;
17575     /**
17576      * Base64 encoded string which contains the security scoped bookmark data for the
17577      * saved file. `securityScopedBookmarks` must be enabled for this to be present.
17578      * (For return values, see table here.)
17579      *
17580      * @platform darwin,mas
17581      */
17582     bookmark?: string;
17583   }
17584
17585   interface SaveDialogSyncOptions {
17586     /**
17587      * The dialog title. Cannot be displayed on some _Linux_ desktop environments.
17588      */
17589     title?: string;
17590     /**
17591      * Absolute directory path, absolute file path, or file name to use by default.
17592      */
17593     defaultPath?: string;
17594     /**
17595      * Custom label for the confirmation button, when left empty the default label will
17596      * be used.
17597      */
17598     buttonLabel?: string;
17599     filters?: FileFilter[];
17600     /**
17601      * Message to display above text fields.
17602      *
17603      * @platform darwin
17604      */
17605     message?: string;
17606     /**
17607      * Custom label for the text displayed in front of the filename text field.
17608      *
17609      * @platform darwin
17610      */
17611     nameFieldLabel?: string;
17612     /**
17613      * Show the tags input box, defaults to `true`.
17614      *
17615      * @platform darwin
17616      */
17617     showsTagField?: boolean;
17618     properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
17619     /**
17620      * Create a security scoped bookmark when packaged for the Mac App Store. If this
17621      * option is enabled and the file doesn't already exist a blank file will be
17622      * created at the chosen path.
17623      *
17624      * @platform darwin,mas
17625      */
17626     securityScopedBookmarks?: boolean;
17627   }
17628
17629   interface SelectHidDeviceDetails {
17630     deviceList: HIDDevice[];
17631     frame: WebFrameMain;
17632   }
17633
17634   interface SelectUsbDeviceDetails {
17635     deviceList: USBDevice[];
17636     frame: WebFrameMain;
17637   }
17638
17639   interface SerialPortRevokedDetails {
17640     port: SerialPort;
17641     frame: WebFrameMain;
17642     /**
17643      * The origin that the device has been revoked from.
17644      */
17645     origin: string;
17646   }
17647
17648   interface Settings {
17649     /**
17650      * `true` to open the app at login, `false` to remove the app as a login item.
17651      * Defaults to `false`.
17652      */
17653     openAtLogin?: boolean;
17654     /**
17655      * `true` to open the app as hidden. Defaults to `false`. The user can edit this
17656      * setting from the System Preferences so
17657      * `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is
17658      * opened to know the current value. This setting is not available on MAS builds.
17659      *
17660      * @platform darwin
17661      */
17662     openAsHidden?: boolean;
17663     /**
17664      * The executable to launch at login. Defaults to `process.execPath`.
17665      *
17666      * @platform win32
17667      */
17668     path?: string;
17669     /**
17670      * The command-line arguments to pass to the executable. Defaults to an empty
17671      * array. Take care to wrap paths in quotes.
17672      *
17673      * @platform win32
17674      */
17675     args?: string[];
17676     /**
17677      * `true` will change the startup approved registry key and `enable / disable` the
17678      * App in Task Manager and Windows Settings. Defaults to `true`.
17679      *
17680      * @platform win32
17681      */
17682     enabled?: boolean;
17683     /**
17684      * value name to write into registry. Defaults to the app's AppUserModelId(). Set
17685      * the app's login item settings.
17686      *
17687      * @platform win32
17688      */
17689     name?: string;
17690   }
17691
17692   interface SourcesOptions {
17693     /**
17694      * An array of strings that lists the types of desktop sources to be captured,
17695      * available types can be `screen` and `window`.
17696      */
17697     types: Array<'screen' | 'window'>;
17698     /**
17699      * The size that the media source thumbnail should be scaled to. Default is `150` x
17700      * `150`. Set width or height to 0 when you do not need the thumbnails. This will
17701      * save the processing time required for capturing the content of each window and
17702      * screen.
17703      */
17704     thumbnailSize?: Size;
17705     /**
17706      * Set to true to enable fetching window icons. The default value is false. When
17707      * false the appIcon property of the sources return null. Same if a source has the
17708      * type screen.
17709      */
17710     fetchWindowIcons?: boolean;
17711   }
17712
17713   interface SSLConfigConfig {
17714     /**
17715      * Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The minimum SSL version to allow
17716      * when connecting to remote servers. Defaults to `tls1`.
17717      */
17718     minVersion?: ('tls1' | 'tls1.1' | 'tls1.2' | 'tls1.3');
17719     /**
17720      * Can be `tls1.2` or `tls1.3`. The maximum SSL version to allow when connecting to
17721      * remote servers. Defaults to `tls1.3`.
17722      */
17723     maxVersion?: ('tls1.2' | 'tls1.3');
17724     /**
17725      * List of cipher suites which should be explicitly prevented from being used in
17726      * addition to those disabled by the net built-in policy. Supported literal forms:
17727      * 0xAABB, where AA is `cipher_suite[0]` and BB is `cipher_suite[1]`, as defined in
17728      * RFC 2246, Section 7.4.1.2. Unrecognized but parsable cipher suites in this form
17729      * will not return an error. Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify
17730      * 0x0004, while to disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002. Note
17731      * that TLSv1.3 ciphers cannot be disabled using this mechanism.
17732      */
17733     disabledCipherSuites?: number[];
17734   }
17735
17736   interface StartLoggingOptions {
17737     /**
17738      * What kinds of data should be captured. By default, only metadata about requests
17739      * will be captured. Setting this to `includeSensitive` will include cookies and
17740      * authentication data. Setting it to `everything` will include all bytes
17741      * transferred on sockets. Can be `default`, `includeSensitive` or `everything`.
17742      */
17743     captureMode?: ('default' | 'includeSensitive' | 'everything');
17744     /**
17745      * When the log grows beyond this size, logging will automatically stop. Defaults
17746      * to unlimited.
17747      */
17748     maxFileSize?: number;
17749   }
17750
17751   interface Streams {
17752     video?: (Video) | (WebFrameMain);
17753     /**
17754      * If a string is specified, can be `loopback` or `loopbackWithMute`. Specifying a
17755      * loopback device will capture system audio, and is currently only supported on
17756      * Windows. If a WebFrameMain is specified, will capture audio from that frame.
17757      */
17758     audio?: (('loopback' | 'loopbackWithMute')) | (WebFrameMain);
17759     /**
17760      * If `audio` is a WebFrameMain and this is set to `true`, then local playback of
17761      * audio will not be muted (e.g. using `MediaRecorder` to record `WebFrameMain`
17762      * with this flag set to `true` will allow audio to pass through to the speakers
17763      * while recording). Default is `false`.
17764      */
17765     enableLocalEcho?: boolean;
17766   }
17767
17768   interface SystemMemoryInfo {
17769     /**
17770      * The total amount of physical memory in Kilobytes available to the system.
17771      */
17772     total: number;
17773     /**
17774      * The total amount of memory not being used by applications or disk cache.
17775      */
17776     free: number;
17777     /**
17778      * The total amount of swap memory in Kilobytes available to the system.
17779      *
17780      * @platform win32,linux
17781      */
17782     swapTotal: number;
17783     /**
17784      * The free amount of swap memory in Kilobytes available to the system.
17785      *
17786      * @platform win32,linux
17787      */
17788     swapFree: number;
17789   }
17790
17791   interface TitleBarOverlay {
17792     /**
17793      * The CSS color of the Window Controls Overlay when enabled. Default is the system
17794      * color.
17795      *
17796      * @platform win32
17797      */
17798     color?: string;
17799     /**
17800      * The CSS color of the symbols on the Window Controls Overlay when enabled.
17801      * Default is the system color.
17802      *
17803      * @platform win32
17804      */
17805     symbolColor?: string;
17806     /**
17807      * The height of the title bar and Window Controls Overlay in pixels. Default is
17808      * system height.
17809      *
17810      * @platform darwin,win32
17811      */
17812     height?: number;
17813   }
17814
17815   interface TitleBarOverlayOptions {
17816     /**
17817      * The CSS color of the Window Controls Overlay when enabled.
17818      *
17819      * @platform win32
17820      */
17821     color?: string;
17822     /**
17823      * The CSS color of the symbols on the Window Controls Overlay when enabled.
17824      *
17825      * @platform win32
17826      */
17827     symbolColor?: string;
17828     /**
17829      * The height of the title bar and Window Controls Overlay in pixels.
17830      *
17831      * @platform darwin,win32
17832      */
17833     height?: number;
17834   }
17835
17836   interface TitleOptions {
17837     /**
17838      * The font family variant to display, can be `monospaced` or `monospacedDigit`.
17839      * `monospaced` is available in macOS 10.15+ When left blank, the title uses the
17840      * default system font.
17841      */
17842     fontType?: ('monospaced' | 'monospacedDigit');
17843   }
17844
17845   interface ToBitmapOptions {
17846     /**
17847      * Defaults to 1.0.
17848      */
17849     scaleFactor?: number;
17850   }
17851
17852   interface ToDataURLOptions {
17853     /**
17854      * Defaults to 1.0.
17855      */
17856     scaleFactor?: number;
17857   }
17858
17859   interface ToPNGOptions {
17860     /**
17861      * Defaults to 1.0.
17862      */
17863     scaleFactor?: number;
17864   }
17865
17866   interface TouchBarButtonConstructorOptions {
17867     /**
17868      * Button text.
17869      */
17870     label?: string;
17871     /**
17872      * A short description of the button for use by screenreaders like VoiceOver.
17873      */
17874     accessibilityLabel?: string;
17875     /**
17876      * Button background color in hex format, i.e `#ABCDEF`.
17877      */
17878     backgroundColor?: string;
17879     /**
17880      * Button icon.
17881      */
17882     icon?: (NativeImage) | (string);
17883     /**
17884      * Can be `left`, `right` or `overlay`. Defaults to `overlay`.
17885      */
17886     iconPosition?: ('left' | 'right' | 'overlay');
17887     /**
17888      * Function to call when the button is clicked.
17889      */
17890     click?: () => void;
17891     /**
17892      * Whether the button is in an enabled state.  Default is `true`.
17893      */
17894     enabled?: boolean;
17895   }
17896
17897   interface TouchBarColorPickerConstructorOptions {
17898     /**
17899      * Array of hex color strings to appear as possible colors to select.
17900      */
17901     availableColors?: string[];
17902     /**
17903      * The selected hex color in the picker, i.e `#ABCDEF`.
17904      */
17905     selectedColor?: string;
17906     /**
17907      * Function to call when a color is selected.
17908      */
17909     change?: (color: string) => void;
17910   }
17911
17912   interface TouchBarConstructorOptions {
17913     items?: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>;
17914     escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null);
17915   }
17916
17917   interface TouchBarGroupConstructorOptions {
17918     /**
17919      * Items to display as a group.
17920      */
17921     items: TouchBar;
17922   }
17923
17924   interface TouchBarLabelConstructorOptions {
17925     /**
17926      * Text to display.
17927      */
17928     label?: string;
17929     /**
17930      * A short description of the button for use by screenreaders like VoiceOver.
17931      */
17932     accessibilityLabel?: string;
17933     /**
17934      * Hex color of text, i.e `#ABCDEF`.
17935      */
17936     textColor?: string;
17937   }
17938
17939   interface TouchBarPopoverConstructorOptions {
17940     /**
17941      * Popover button text.
17942      */
17943     label?: string;
17944     /**
17945      * Popover button icon.
17946      */
17947     icon?: NativeImage;
17948     /**
17949      * Items to display in the popover.
17950      */
17951     items: TouchBar;
17952     /**
17953      * `true` to display a close button on the left of the popover, `false` to not show
17954      * it. Default is `true`.
17955      */
17956     showCloseButton?: boolean;
17957   }
17958
17959   interface TouchBarScrubberConstructorOptions {
17960     /**
17961      * An array of items to place in this scrubber.
17962      */
17963     items: ScrubberItem[];
17964     /**
17965      * Called when the user taps an item that was not the last tapped item.
17966      */
17967     select?: (selectedIndex: number) => void;
17968     /**
17969      * Called when the user taps any item.
17970      */
17971     highlight?: (highlightedIndex: number) => void;
17972     /**
17973      * Selected item style. Can be `background`, `outline` or `none`. Defaults to
17974      * `none`.
17975      */
17976     selectedStyle?: ('background' | 'outline' | 'none');
17977     /**
17978      * Selected overlay item style. Can be `background`, `outline` or `none`. Defaults
17979      * to `none`.
17980      */
17981     overlayStyle?: ('background' | 'outline' | 'none');
17982     /**
17983      * Whether to show arrow buttons. Defaults to `false` and is only shown if `items`
17984      * is non-empty.
17985      */
17986     showArrowButtons?: boolean;
17987     /**
17988      * Can be `fixed` or `free`. The default is `free`.
17989      */
17990     mode?: ('fixed' | 'free');
17991     /**
17992      * Defaults to `true`.
17993      */
17994     continuous?: boolean;
17995   }
17996
17997   interface TouchBarSegmentedControlConstructorOptions {
17998     /**
17999      * Style of the segments:
18000      */
18001     segmentStyle?: ('automatic' | 'rounded' | 'textured-rounded' | 'round-rect' | 'textured-square' | 'capsule' | 'small-square' | 'separated');
18002     /**
18003      * The selection mode of the control:
18004      */
18005     mode?: ('single' | 'multiple' | 'buttons');
18006     /**
18007      * An array of segments to place in this control.
18008      */
18009     segments: SegmentedControlSegment[];
18010     /**
18011      * The index of the currently selected segment, will update automatically with user
18012      * interaction. When the mode is `multiple` it will be the last selected item.
18013      */
18014     selectedIndex?: number;
18015     /**
18016      * Called when the user selects a new segment.
18017      */
18018     change?: (selectedIndex: number, isSelected: boolean) => void;
18019   }
18020
18021   interface TouchBarSliderConstructorOptions {
18022     /**
18023      * Label text.
18024      */
18025     label?: string;
18026     /**
18027      * Selected value.
18028      */
18029     value?: number;
18030     /**
18031      * Minimum value.
18032      */
18033     minValue?: number;
18034     /**
18035      * Maximum value.
18036      */
18037     maxValue?: number;
18038     /**
18039      * Function to call when the slider is changed.
18040      */
18041     change?: (newValue: number) => void;
18042   }
18043
18044   interface TouchBarSpacerConstructorOptions {
18045     /**
18046      * Size of spacer, possible values are:
18047      */
18048     size?: ('small' | 'large' | 'flexible');
18049   }
18050
18051   interface TraceBufferUsageReturnValue {
18052     value: number;
18053     percentage: number;
18054   }
18055
18056   interface UdpPortRange {
18057     /**
18058      * The minimum UDP port number that WebRTC should use.
18059      */
18060     min: number;
18061     /**
18062      * The maximum UDP port number that WebRTC should use.
18063      */
18064     max: number;
18065   }
18066
18067   interface UpdateTargetUrlEvent extends DOMEvent {
18068     url: string;
18069   }
18070
18071   interface UploadProgress {
18072     /**
18073      * Whether the request is currently active. If this is false no other properties
18074      * will be set
18075      */
18076     active: boolean;
18077     /**
18078      * Whether the upload has started. If this is false both `current` and `total` will
18079      * be set to 0.
18080      */
18081     started: boolean;
18082     /**
18083      * The number of bytes that have been uploaded so far
18084      */
18085     current: number;
18086     /**
18087      * The number of bytes that will be uploaded this request
18088      */
18089     total: number;
18090   }
18091
18092   interface UsbDeviceRevokedDetails {
18093     device: USBDevice;
18094     /**
18095      * The origin that the device has been revoked from.
18096      */
18097     origin?: string;
18098   }
18099
18100   interface USBProtectedClassesHandlerHandlerDetails {
18101     /**
18102      * The current list of protected USB classes. Possible class values include:
18103      */
18104     protectedClasses: Array<'audio' | 'audio-video' | 'hid' | 'mass-storage' | 'smart-card' | 'video' | 'wireless'>;
18105   }
18106
18107   interface VisibleOnAllWorkspacesOptions {
18108     /**
18109      * Sets whether the window should be visible above fullscreen windows.
18110      *
18111      * @platform darwin
18112      */
18113     visibleOnFullScreen?: boolean;
18114     /**
18115      * Calling setVisibleOnAllWorkspaces will by default transform the process type
18116      * between UIElementApplication and ForegroundApplication to ensure the correct
18117      * behavior. However, this will hide the window and dock for a short time every
18118      * time it is called. If your window is already of type UIElementApplication, you
18119      * can bypass this transformation by passing true to skipTransformProcessType.
18120      *
18121      * @platform darwin
18122      */
18123     skipTransformProcessType?: boolean;
18124   }
18125
18126   interface WebContentsAudioStateChangedEventParams {
18127     /**
18128      * True if one or more frames or child `webContents` are emitting audio.
18129      */
18130     audible: boolean;
18131   }
18132
18133   interface WebContentsDidRedirectNavigationEventParams {
18134     /**
18135      * The URL the frame is navigating to.
18136      */
18137     url: string;
18138     /**
18139      * Whether the navigation happened without changing document. Examples of same
18140      * document navigations are reference fragment navigations, pushState/replaceState,
18141      * and same page history navigation.
18142      */
18143     isSameDocument: boolean;
18144     /**
18145      * True if the navigation is taking place in a main frame.
18146      */
18147     isMainFrame: boolean;
18148     /**
18149      * The frame to be navigated.
18150      */
18151     frame: WebFrameMain;
18152     /**
18153      * The frame which initiated the navigation, which can be a parent frame (e.g. via
18154      * `window.open` with a frame's name), or null if the navigation was not initiated
18155      * by a frame. This can also be null if the initiating frame was deleted before the
18156      * event was emitted.
18157      */
18158     initiator?: WebFrameMain;
18159   }
18160
18161   interface WebContentsDidStartNavigationEventParams {
18162     /**
18163      * The URL the frame is navigating to.
18164      */
18165     url: string;
18166     /**
18167      * Whether the navigation happened without changing document. Examples of same
18168      * document navigations are reference fragment navigations, pushState/replaceState,
18169      * and same page history navigation.
18170      */
18171     isSameDocument: boolean;
18172     /**
18173      * True if the navigation is taking place in a main frame.
18174      */
18175     isMainFrame: boolean;
18176     /**
18177      * The frame to be navigated.
18178      */
18179     frame: WebFrameMain;
18180     /**
18181      * The frame which initiated the navigation, which can be a parent frame (e.g. via
18182      * `window.open` with a frame's name), or null if the navigation was not initiated
18183      * by a frame. This can also be null if the initiating frame was deleted before the
18184      * event was emitted.
18185      */
18186     initiator?: WebFrameMain;
18187   }
18188
18189   interface WebContentsPrintOptions {
18190     /**
18191      * Don't ask user for print settings. Default is `false`.
18192      */
18193     silent?: boolean;
18194     /**
18195      * Prints the background color and image of the web page. Default is `false`.
18196      */
18197     printBackground?: boolean;
18198     /**
18199      * Set the printer device name to use. Must be the system-defined name and not the
18200      * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
18201      */
18202     deviceName?: string;
18203     /**
18204      * Set whether the printed web page will be in color or grayscale. Default is
18205      * `true`.
18206      */
18207     color?: boolean;
18208     margins?: Margins;
18209     /**
18210      * Whether the web page should be printed in landscape mode. Default is `false`.
18211      */
18212     landscape?: boolean;
18213     /**
18214      * The scale factor of the web page.
18215      */
18216     scaleFactor?: number;
18217     /**
18218      * The number of pages to print per page sheet.
18219      */
18220     pagesPerSheet?: number;
18221     /**
18222      * Whether the web page should be collated.
18223      */
18224     collate?: boolean;
18225     /**
18226      * The number of copies of the web page to print.
18227      */
18228     copies?: number;
18229     /**
18230      * The page range to print. On macOS, only one range is honored.
18231      */
18232     pageRanges?: PageRanges[];
18233     /**
18234      * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
18235      * `longEdge`.
18236      */
18237     duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
18238     dpi?: Record<string, number>;
18239     /**
18240      * string to be printed as page header.
18241      */
18242     header?: string;
18243     /**
18244      * string to be printed as page footer.
18245      */
18246     footer?: string;
18247     /**
18248      * Specify page size of the printed document. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
18249      * `A5`, `A6`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and
18250      * `width`.
18251      */
18252     pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
18253   }
18254
18255   interface WebContentsWillFrameNavigateEventParams {
18256     /**
18257      * The URL the frame is navigating to.
18258      */
18259     url: string;
18260     /**
18261      * This event does not fire for same document navigations using window.history api
18262      * and reference fragment navigations. This property is always set to `false` for
18263      * this event.
18264      */
18265     isSameDocument: boolean;
18266     /**
18267      * True if the navigation is taking place in a main frame.
18268      */
18269     isMainFrame: boolean;
18270     /**
18271      * The frame to be navigated.
18272      */
18273     frame: WebFrameMain;
18274     /**
18275      * The frame which initiated the navigation, which can be a parent frame (e.g. via
18276      * `window.open` with a frame's name), or null if the navigation was not initiated
18277      * by a frame. This can also be null if the initiating frame was deleted before the
18278      * event was emitted.
18279      */
18280     initiator?: WebFrameMain;
18281   }
18282
18283   interface WebContentsWillNavigateEventParams {
18284     /**
18285      * The URL the frame is navigating to.
18286      */
18287     url: string;
18288     /**
18289      * This event does not fire for same document navigations using window.history api
18290      * and reference fragment navigations. This property is always set to `false` for
18291      * this event.
18292      */
18293     isSameDocument: boolean;
18294     /**
18295      * True if the navigation is taking place in a main frame.
18296      */
18297     isMainFrame: boolean;
18298     /**
18299      * The frame to be navigated.
18300      */
18301     frame: WebFrameMain;
18302     /**
18303      * The frame which initiated the navigation, which can be a parent frame (e.g. via
18304      * `window.open` with a frame's name), or null if the navigation was not initiated
18305      * by a frame. This can also be null if the initiating frame was deleted before the
18306      * event was emitted.
18307      */
18308     initiator?: WebFrameMain;
18309   }
18310
18311   interface WebContentsWillRedirectEventParams {
18312     /**
18313      * The URL the frame is navigating to.
18314      */
18315     url: string;
18316     /**
18317      * Whether the navigation happened without changing document. Examples of same
18318      * document navigations are reference fragment navigations, pushState/replaceState,
18319      * and same page history navigation.
18320      */
18321     isSameDocument: boolean;
18322     /**
18323      * True if the navigation is taking place in a main frame.
18324      */
18325     isMainFrame: boolean;
18326     /**
18327      * The frame to be navigated.
18328      */
18329     frame: WebFrameMain;
18330     /**
18331      * The frame which initiated the navigation, which can be a parent frame (e.g. via
18332      * `window.open` with a frame's name), or null if the navigation was not initiated
18333      * by a frame. This can also be null if the initiating frame was deleted before the
18334      * event was emitted.
18335      */
18336     initiator?: WebFrameMain;
18337   }
18338
18339   interface WebRTCUDPPortRange {
18340     /**
18341      * The minimum UDP port number that WebRTC should use.
18342      */
18343     min: number;
18344     /**
18345      * The maximum UDP port number that WebRTC should use.
18346      */
18347     max: number;
18348   }
18349
18350   interface WebviewTagPrintOptions {
18351     /**
18352      * Don't ask user for print settings. Default is `false`.
18353      */
18354     silent?: boolean;
18355     /**
18356      * Prints the background color and image of the web page. Default is `false`.
18357      */
18358     printBackground?: boolean;
18359     /**
18360      * Set the printer device name to use. Must be the system-defined name and not the
18361      * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
18362      */
18363     deviceName?: string;
18364     /**
18365      * Set whether the printed web page will be in color or grayscale. Default is
18366      * `true`.
18367      */
18368     color?: boolean;
18369     margins?: Margins;
18370     /**
18371      * Whether the web page should be printed in landscape mode. Default is `false`.
18372      */
18373     landscape?: boolean;
18374     /**
18375      * The scale factor of the web page.
18376      */
18377     scaleFactor?: number;
18378     /**
18379      * The number of pages to print per page sheet.
18380      */
18381     pagesPerSheet?: number;
18382     /**
18383      * Whether the web page should be collated.
18384      */
18385     collate?: boolean;
18386     /**
18387      * The number of copies of the web page to print.
18388      */
18389     copies?: number;
18390     /**
18391      * The page range to print.
18392      */
18393     pageRanges?: PageRanges[];
18394     /**
18395      * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
18396      * `longEdge`.
18397      */
18398     duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
18399     dpi?: Record<string, number>;
18400     /**
18401      * string to be printed as page header.
18402      */
18403     header?: string;
18404     /**
18405      * string to be printed as page footer.
18406      */
18407     footer?: string;
18408     /**
18409      * Specify page size of the printed document. Can be `A3`, `A4`, `A5`, `Legal`,
18410      * `Letter`, `Tabloid` or an Object containing `height` in microns.
18411      */
18412     pageSize?: (('A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
18413   }
18414
18415   interface WillFrameNavigateEvent extends DOMEvent {
18416     url: string;
18417     isMainFrame: boolean;
18418     frameProcessId: number;
18419     frameRoutingId: number;
18420   }
18421
18422   interface WillNavigateEvent extends DOMEvent {
18423     url: string;
18424   }
18425
18426   interface WillResizeDetails {
18427     /**
18428      * The edge of the window being dragged for resizing. Can be `bottom`, `left`,
18429      * `right`, `top-left`, `top-right`, `bottom-left` or `bottom-right`.
18430      */
18431     edge: ('bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right');
18432   }
18433
18434   interface EditFlags {
18435     /**
18436      * Whether the renderer believes it can undo.
18437      */
18438     canUndo: boolean;
18439     /**
18440      * Whether the renderer believes it can redo.
18441      */
18442     canRedo: boolean;
18443     /**
18444      * Whether the renderer believes it can cut.
18445      */
18446     canCut: boolean;
18447     /**
18448      * Whether the renderer believes it can copy.
18449      */
18450     canCopy: boolean;
18451     /**
18452      * Whether the renderer believes it can paste.
18453      */
18454     canPaste: boolean;
18455     /**
18456      * Whether the renderer believes it can delete.
18457      */
18458     canDelete: boolean;
18459     /**
18460      * Whether the renderer believes it can select all.
18461      */
18462     canSelectAll: boolean;
18463     /**
18464      * Whether the renderer believes it can edit text richly.
18465      */
18466     canEditRichly: boolean;
18467   }
18468
18469   interface Env {
18470   }
18471
18472   interface FoundInPageResult {
18473     requestId: number;
18474     /**
18475      * Position of the active match.
18476      */
18477     activeMatchOrdinal: number;
18478     /**
18479      * Number of Matches.
18480      */
18481     matches: number;
18482     /**
18483      * Coordinates of first match region.
18484      */
18485     selectionArea: Rectangle;
18486     finalUpdate: boolean;
18487   }
18488
18489   interface LaunchItems {
18490     /**
18491      * name value of a registry entry.
18492      *
18493      * @platform win32
18494      */
18495     name: string;
18496     /**
18497      * The executable to an app that corresponds to a registry entry.
18498      *
18499      * @platform win32
18500      */
18501     path: string;
18502     /**
18503      * the command-line arguments to pass to the executable.
18504      *
18505      * @platform win32
18506      */
18507     args: string[];
18508     /**
18509      * one of `user` or `machine`. Indicates whether the registry entry is under
18510      * `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
18511      *
18512      * @platform win32
18513      */
18514     scope: string;
18515     /**
18516      * `true` if the app registry key is startup approved and therefore shows as
18517      * `enabled` in Task Manager and Windows settings.
18518      *
18519      * @platform win32
18520      */
18521     enabled: boolean;
18522   }
18523
18524   interface Margins {
18525     /**
18526      * Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
18527      * you will also need to specify `top`, `bottom`, `left`, and `right`.
18528      */
18529     marginType?: ('default' | 'none' | 'printableArea' | 'custom');
18530     /**
18531      * The top margin of the printed web page, in pixels.
18532      */
18533     top?: number;
18534     /**
18535      * The bottom margin of the printed web page, in pixels.
18536      */
18537     bottom?: number;
18538     /**
18539      * The left margin of the printed web page, in pixels.
18540      */
18541     left?: number;
18542     /**
18543      * The right margin of the printed web page, in pixels.
18544      */
18545     right?: number;
18546   }
18547
18548   interface MediaFlags {
18549     /**
18550      * Whether the media element has crashed.
18551      */
18552     inError: boolean;
18553     /**
18554      * Whether the media element is paused.
18555      */
18556     isPaused: boolean;
18557     /**
18558      * Whether the media element is muted.
18559      */
18560     isMuted: boolean;
18561     /**
18562      * Whether the media element has audio.
18563      */
18564     hasAudio: boolean;
18565     /**
18566      * Whether the media element is looping.
18567      */
18568     isLooping: boolean;
18569     /**
18570      * Whether the media element's controls are visible.
18571      */
18572     isControlsVisible: boolean;
18573     /**
18574      * Whether the media element's controls are toggleable.
18575      */
18576     canToggleControls: boolean;
18577     /**
18578      * Whether the media element can be printed.
18579      */
18580     canPrint: boolean;
18581     /**
18582      * Whether or not the media element can be downloaded.
18583      */
18584     canSave: boolean;
18585     /**
18586      * Whether the media element can show picture-in-picture.
18587      */
18588     canShowPictureInPicture: boolean;
18589     /**
18590      * Whether the media element is currently showing picture-in-picture.
18591      */
18592     isShowingPictureInPicture: boolean;
18593     /**
18594      * Whether the media element can be rotated.
18595      */
18596     canRotate: boolean;
18597     /**
18598      * Whether the media element can be looped.
18599      */
18600     canLoop: boolean;
18601   }
18602
18603   interface PageRanges {
18604     /**
18605      * Index of the first page to print (0-based).
18606      */
18607     from: number;
18608     /**
18609      * Index of the last page to print (inclusive) (0-based).
18610      */
18611     to: number;
18612   }
18613
18614   interface Params {
18615     /**
18616      * x coordinate.
18617      */
18618     x: number;
18619     /**
18620      * y coordinate.
18621      */
18622     y: number;
18623     /**
18624      * URL of the link that encloses the node the context menu was invoked on.
18625      */
18626     linkURL: string;
18627     /**
18628      * Text associated with the link. May be an empty string if the contents of the
18629      * link are an image.
18630      */
18631     linkText: string;
18632     /**
18633      * URL of the top level page that the context menu was invoked on.
18634      */
18635     pageURL: string;
18636     /**
18637      * URL of the subframe that the context menu was invoked on.
18638      */
18639     frameURL: string;
18640     /**
18641      * Source URL for the element that the context menu was invoked on. Elements with
18642      * source URLs are images, audio and video.
18643      */
18644     srcURL: string;
18645     /**
18646      * Type of the node the context menu was invoked on. Can be `none`, `image`,
18647      * `audio`, `video`, `canvas`, `file` or `plugin`.
18648      */
18649     mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
18650     /**
18651      * Whether the context menu was invoked on an image which has non-empty contents.
18652      */
18653     hasImageContents: boolean;
18654     /**
18655      * Whether the context is editable.
18656      */
18657     isEditable: boolean;
18658     /**
18659      * Text of the selection that the context menu was invoked on.
18660      */
18661     selectionText: string;
18662     /**
18663      * Title text of the selection that the context menu was invoked on.
18664      */
18665     titleText: string;
18666     /**
18667      * Alt text of the selection that the context menu was invoked on.
18668      */
18669     altText: string;
18670     /**
18671      * Suggested filename to be used when saving file through 'Save Link As' option of
18672      * context menu.
18673      */
18674     suggestedFilename: string;
18675     /**
18676      * Rect representing the coordinates in the document space of the selection.
18677      */
18678     selectionRect: Rectangle;
18679     /**
18680      * Start position of the selection text.
18681      */
18682     selectionStartOffset: number;
18683     /**
18684      * The referrer policy of the frame on which the menu is invoked.
18685      */
18686     referrerPolicy: Referrer;
18687     /**
18688      * The misspelled word under the cursor, if any.
18689      */
18690     misspelledWord: string;
18691     /**
18692      * An array of suggested words to show the user to replace the `misspelledWord`.
18693      * Only available if there is a misspelled word and spellchecker is enabled.
18694      */
18695     dictionarySuggestions: string[];
18696     /**
18697      * The character encoding of the frame on which the menu was invoked.
18698      */
18699     frameCharset: string;
18700     /**
18701      * The source that the context menu was invoked on. Possible values include `none`,
18702      * `button-button`, `field-set`, `input-button`, `input-checkbox`, `input-color`,
18703      * `input-date`, `input-datetime-local`, `input-email`, `input-file`,
18704      * `input-hidden`, `input-image`, `input-month`, `input-number`, `input-password`,
18705      * `input-radio`, `input-range`, `input-reset`, `input-search`, `input-submit`,
18706      * `input-telephone`, `input-text`, `input-time`, `input-url`, `input-week`,
18707      * `output`, `reset-button`, `select-list`, `select-list`, `select-multiple`,
18708      * `select-one`, `submit-button`, and `text-area`,
18709      */
18710     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');
18711     /**
18712      * If the context menu was invoked on an input field, the type of that field.
18713      * Possible values include `none`, `plainText`, `password`, `other`.
18714      *
18715      * @deprecated
18716      */
18717     inputFieldType: ('none' | 'plainText' | 'password' | 'other');
18718     /**
18719      * If the context is editable, whether or not spellchecking is enabled.
18720      */
18721     spellcheckEnabled: boolean;
18722     /**
18723      * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
18724      * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
18725      * `adjustSelection`, or `adjustSelectionReset`.
18726      */
18727     menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
18728     /**
18729      * The flags for the media element the context menu was invoked on.
18730      */
18731     mediaFlags: MediaFlags;
18732     /**
18733      * These flags indicate whether the renderer believes it is able to perform the
18734      * corresponding action.
18735      */
18736     editFlags: EditFlags;
18737   }
18738
18739   interface Video {
18740     /**
18741      * The id of the stream being granted. This will usually come from a
18742      * DesktopCapturerSource object.
18743      */
18744     id: string;
18745     /**
18746      * The name of the stream being granted. This will usually come from a
18747      * DesktopCapturerSource object.
18748      */
18749     name: string;
18750   }
18751
18752   interface RemoteMainInterface {
18753     app: App;
18754     autoUpdater: AutoUpdater;
18755     BrowserView: typeof BrowserView;
18756     BrowserWindow: typeof BrowserWindow;
18757     clipboard: Clipboard;
18758     contentTracing: ContentTracing;
18759     crashReporter: CrashReporter;
18760     desktopCapturer: DesktopCapturer;
18761     dialog: Dialog;
18762     globalShortcut: GlobalShortcut;
18763     inAppPurchase: InAppPurchase;
18764     ipcMain: IpcMain;
18765     Menu: typeof Menu;
18766     MenuItem: typeof MenuItem;
18767     MessageChannelMain: typeof MessageChannelMain;
18768     nativeImage: typeof NativeImage;
18769     nativeTheme: NativeTheme;
18770     net: Net;
18771     netLog: NetLog;
18772     Notification: typeof Notification;
18773     powerMonitor: PowerMonitor;
18774     powerSaveBlocker: PowerSaveBlocker;
18775     protocol: Protocol;
18776     pushNotifications: PushNotifications;
18777     safeStorage: SafeStorage;
18778     screen: Screen;
18779     session: typeof Session;
18780     ShareMenu: typeof ShareMenu;
18781     shell: Shell;
18782     systemPreferences: SystemPreferences;
18783     TouchBar: typeof TouchBar;
18784     Tray: typeof Tray;
18785     utilityProcess: typeof UtilityProcess;
18786     webContents: typeof WebContents;
18787     webFrameMain: typeof WebFrameMain;
18788   }
18789
18790
18791
18792   namespace Common {
18793     type Event<Params extends object = {}> = Electron.Event<Params>;
18794     const clipboard: Clipboard;
18795     type Clipboard = Electron.Clipboard;
18796     const crashReporter: CrashReporter;
18797     type CrashReporter = Electron.CrashReporter;
18798     const nativeImage: typeof NativeImage;
18799     type NativeImage = Electron.NativeImage;
18800     const shell: Shell;
18801     type Shell = Electron.Shell;
18802     type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
18803     type AddRepresentationOptions = Electron.AddRepresentationOptions;
18804     type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
18805     type AnimationSettings = Electron.AnimationSettings;
18806     type AppDetailsOptions = Electron.AppDetailsOptions;
18807     type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
18808     type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
18809     type AuthInfo = Electron.AuthInfo;
18810     type AutoResizeOptions = Electron.AutoResizeOptions;
18811     type BeforeSendResponse = Electron.BeforeSendResponse;
18812     type BitmapOptions = Electron.BitmapOptions;
18813     type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
18814     type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
18815     type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
18816     type CallbackResponse = Electron.CallbackResponse;
18817     type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
18818     type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
18819     type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
18820     type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
18821     type CloseOpts = Electron.CloseOpts;
18822     type Config = Electron.Config;
18823     type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
18824     type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
18825     type ContextMenuEvent = Electron.ContextMenuEvent;
18826     type ContextMenuParams = Electron.ContextMenuParams;
18827     type ContinueActivityDetails = Electron.ContinueActivityDetails;
18828     type CookiesGetFilter = Electron.CookiesGetFilter;
18829     type CookiesSetDetails = Electron.CookiesSetDetails;
18830     type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
18831     type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
18832     type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
18833     type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
18834     type Data = Electron.Data;
18835     type DefaultFontFamily = Electron.DefaultFontFamily;
18836     type Details = Electron.Details;
18837     type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
18838     type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
18839     type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
18840     type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
18841     type DidFailLoadEvent = Electron.DidFailLoadEvent;
18842     type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
18843     type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
18844     type DidNavigateEvent = Electron.DidNavigateEvent;
18845     type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
18846     type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
18847     type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
18848     type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
18849     type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
18850     type DownloadURLOptions = Electron.DownloadURLOptions;
18851     type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
18852     type FeedURLOptions = Electron.FeedURLOptions;
18853     type FileIconOptions = Electron.FileIconOptions;
18854     type FindInPageOptions = Electron.FindInPageOptions;
18855     type FocusOptions = Electron.FocusOptions;
18856     type ForkOptions = Electron.ForkOptions;
18857     type FoundInPageEvent = Electron.FoundInPageEvent;
18858     type FrameCreatedDetails = Electron.FrameCreatedDetails;
18859     type FromPartitionOptions = Electron.FromPartitionOptions;
18860     type FromPathOptions = Electron.FromPathOptions;
18861     type HandlerDetails = Electron.HandlerDetails;
18862     type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
18863     type HeapStatistics = Electron.HeapStatistics;
18864     type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
18865     type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
18866     type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
18867     type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
18868     type ImportCertificateOptions = Electron.ImportCertificateOptions;
18869     type Info = Electron.Info;
18870     type Input = Electron.Input;
18871     type InsertCSSOptions = Electron.InsertCSSOptions;
18872     type IpcMessageEvent = Electron.IpcMessageEvent;
18873     type Item = Electron.Item;
18874     type JumpListSettings = Electron.JumpListSettings;
18875     type LoadCommitEvent = Electron.LoadCommitEvent;
18876     type LoadExtensionOptions = Electron.LoadExtensionOptions;
18877     type LoadFileOptions = Electron.LoadFileOptions;
18878     type LoadURLOptions = Electron.LoadURLOptions;
18879     type LoginItemSettings = Electron.LoginItemSettings;
18880     type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
18881     type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
18882     type MessageBoxOptions = Electron.MessageBoxOptions;
18883     type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
18884     type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
18885     type MessageDetails = Electron.MessageDetails;
18886     type MessageEvent = Electron.MessageEvent;
18887     type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
18888     type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
18889     type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
18890     type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
18891     type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
18892     type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
18893     type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
18894     type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
18895     type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
18896     type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
18897     type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
18898     type OpenDialogOptions = Electron.OpenDialogOptions;
18899     type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
18900     type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
18901     type OpenExternalOptions = Electron.OpenExternalOptions;
18902     type Options = Electron.Options;
18903     type Opts = Electron.Opts;
18904     type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
18905     type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
18906     type Parameters = Electron.Parameters;
18907     type Payment = Electron.Payment;
18908     type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
18909     type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
18910     type PluginCrashedEvent = Electron.PluginCrashedEvent;
18911     type PopupOptions = Electron.PopupOptions;
18912     type PreconnectOptions = Electron.PreconnectOptions;
18913     type PrintToPDFOptions = Electron.PrintToPDFOptions;
18914     type Privileges = Electron.Privileges;
18915     type ProgressBarOptions = Electron.ProgressBarOptions;
18916     type Provider = Electron.Provider;
18917     type PurchaseProductOpts = Electron.PurchaseProductOpts;
18918     type ReadBookmark = Electron.ReadBookmark;
18919     type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
18920     type RelaunchOptions = Electron.RelaunchOptions;
18921     type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
18922     type Request = Electron.Request;
18923     type ResizeOptions = Electron.ResizeOptions;
18924     type ResolveHostOptions = Electron.ResolveHostOptions;
18925     type ResourceUsage = Electron.ResourceUsage;
18926     type Response = Electron.Response;
18927     type Result = Electron.Result;
18928     type SaveDialogOptions = Electron.SaveDialogOptions;
18929     type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
18930     type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
18931     type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
18932     type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
18933     type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
18934     type Settings = Electron.Settings;
18935     type SourcesOptions = Electron.SourcesOptions;
18936     type SSLConfigConfig = Electron.SSLConfigConfig;
18937     type StartLoggingOptions = Electron.StartLoggingOptions;
18938     type Streams = Electron.Streams;
18939     type SystemMemoryInfo = Electron.SystemMemoryInfo;
18940     type TitleBarOverlay = Electron.TitleBarOverlay;
18941     type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
18942     type TitleOptions = Electron.TitleOptions;
18943     type ToBitmapOptions = Electron.ToBitmapOptions;
18944     type ToDataURLOptions = Electron.ToDataURLOptions;
18945     type ToPNGOptions = Electron.ToPNGOptions;
18946     type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
18947     type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
18948     type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
18949     type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
18950     type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
18951     type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
18952     type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
18953     type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
18954     type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
18955     type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
18956     type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
18957     type UdpPortRange = Electron.UdpPortRange;
18958     type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
18959     type UploadProgress = Electron.UploadProgress;
18960     type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
18961     type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
18962     type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18963     type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18964     type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
18965     type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
18966     type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
18967     type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
18968     type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
18969     type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
18970     type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
18971     type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
18972     type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
18973     type WillNavigateEvent = Electron.WillNavigateEvent;
18974     type WillResizeDetails = Electron.WillResizeDetails;
18975     type EditFlags = Electron.EditFlags;
18976     type Env = Electron.Env;
18977     type FoundInPageResult = Electron.FoundInPageResult;
18978     type LaunchItems = Electron.LaunchItems;
18979     type Margins = Electron.Margins;
18980     type MediaFlags = Electron.MediaFlags;
18981     type PageRanges = Electron.PageRanges;
18982     type Params = Electron.Params;
18983     type Video = Electron.Video;
18984     type BluetoothDevice = Electron.BluetoothDevice;
18985     type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
18986     type Certificate = Electron.Certificate;
18987     type CertificatePrincipal = Electron.CertificatePrincipal;
18988     type Cookie = Electron.Cookie;
18989     type CPUUsage = Electron.CPUUsage;
18990     type CrashReport = Electron.CrashReport;
18991     type CustomScheme = Electron.CustomScheme;
18992     type DesktopCapturerSource = Electron.DesktopCapturerSource;
18993     type Display = Electron.Display;
18994     type Extension = Electron.Extension;
18995     type ExtensionInfo = Electron.ExtensionInfo;
18996     type FileFilter = Electron.FileFilter;
18997     type FilePathWithHeaders = Electron.FilePathWithHeaders;
18998     type GPUFeatureStatus = Electron.GPUFeatureStatus;
18999     type HIDDevice = Electron.HIDDevice;
19000     type InputEvent = Electron.InputEvent;
19001     type IOCounters = Electron.IOCounters;
19002     type IpcMainEvent = Electron.IpcMainEvent;
19003     type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
19004     type IpcRendererEvent = Electron.IpcRendererEvent;
19005     type JumpListCategory = Electron.JumpListCategory;
19006     type JumpListItem = Electron.JumpListItem;
19007     type KeyboardEvent = Electron.KeyboardEvent;
19008     type KeyboardInputEvent = Electron.KeyboardInputEvent;
19009     type MemoryInfo = Electron.MemoryInfo;
19010     type MemoryUsageDetails = Electron.MemoryUsageDetails;
19011     type MimeTypedBuffer = Electron.MimeTypedBuffer;
19012     type MouseInputEvent = Electron.MouseInputEvent;
19013     type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
19014     type NotificationAction = Electron.NotificationAction;
19015     type NotificationResponse = Electron.NotificationResponse;
19016     type PaymentDiscount = Electron.PaymentDiscount;
19017     type Point = Electron.Point;
19018     type PostBody = Electron.PostBody;
19019     type PrinterInfo = Electron.PrinterInfo;
19020     type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
19021     type ProcessMetric = Electron.ProcessMetric;
19022     type Product = Electron.Product;
19023     type ProductDiscount = Electron.ProductDiscount;
19024     type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
19025     type ProtocolRequest = Electron.ProtocolRequest;
19026     type ProtocolResponse = Electron.ProtocolResponse;
19027     type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
19028     type Rectangle = Electron.Rectangle;
19029     type Referrer = Electron.Referrer;
19030     type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
19031     type ResolvedEndpoint = Electron.ResolvedEndpoint;
19032     type ResolvedHost = Electron.ResolvedHost;
19033     type ScrubberItem = Electron.ScrubberItem;
19034     type SegmentedControlSegment = Electron.SegmentedControlSegment;
19035     type SerialPort = Electron.SerialPort;
19036     type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
19037     type SharedWorkerInfo = Electron.SharedWorkerInfo;
19038     type SharingItem = Electron.SharingItem;
19039     type ShortcutDetails = Electron.ShortcutDetails;
19040     type Size = Electron.Size;
19041     type Task = Electron.Task;
19042     type ThumbarButton = Electron.ThumbarButton;
19043     type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
19044     type TraceConfig = Electron.TraceConfig;
19045     type Transaction = Electron.Transaction;
19046     type UploadData = Electron.UploadData;
19047     type UploadFile = Electron.UploadFile;
19048     type UploadRawData = Electron.UploadRawData;
19049     type USBDevice = Electron.USBDevice;
19050     type UserDefaultTypes = Electron.UserDefaultTypes;
19051     type WebPreferences = Electron.WebPreferences;
19052     type WebRequestFilter = Electron.WebRequestFilter;
19053     type WebSource = Electron.WebSource;
19054   }
19055
19056   namespace Main {
19057     type Event<Params extends object = {}> = Electron.Event<Params>;
19058     const app: App;
19059     type App = Electron.App;
19060     const autoUpdater: AutoUpdater;
19061     type AutoUpdater = Electron.AutoUpdater;
19062     class BrowserView extends Electron.BrowserView {}
19063     class BrowserWindow extends Electron.BrowserWindow {}
19064     type ClientRequest = Electron.ClientRequest;
19065     type CommandLine = Electron.CommandLine;
19066     const contentTracing: ContentTracing;
19067     type ContentTracing = Electron.ContentTracing;
19068     type Cookies = Electron.Cookies;
19069     type Debugger = Electron.Debugger;
19070     const desktopCapturer: DesktopCapturer;
19071     type DesktopCapturer = Electron.DesktopCapturer;
19072     const dialog: Dialog;
19073     type Dialog = Electron.Dialog;
19074     type Dock = Electron.Dock;
19075     type DownloadItem = Electron.DownloadItem;
19076     const globalShortcut: GlobalShortcut;
19077     type GlobalShortcut = Electron.GlobalShortcut;
19078     const inAppPurchase: InAppPurchase;
19079     type InAppPurchase = Electron.InAppPurchase;
19080     type IncomingMessage = Electron.IncomingMessage;
19081     const ipcMain: IpcMain;
19082     type IpcMain = Electron.IpcMain;
19083     class Menu extends Electron.Menu {}
19084     class MenuItem extends Electron.MenuItem {}
19085     class MessageChannelMain extends Electron.MessageChannelMain {}
19086     type MessagePortMain = Electron.MessagePortMain;
19087     const nativeTheme: NativeTheme;
19088     type NativeTheme = Electron.NativeTheme;
19089     const net: Net;
19090     type Net = Electron.Net;
19091     const netLog: NetLog;
19092     type NetLog = Electron.NetLog;
19093     class Notification extends Electron.Notification {}
19094     const powerMonitor: PowerMonitor;
19095     type PowerMonitor = Electron.PowerMonitor;
19096     const powerSaveBlocker: PowerSaveBlocker;
19097     type PowerSaveBlocker = Electron.PowerSaveBlocker;
19098     const protocol: Protocol;
19099     type Protocol = Electron.Protocol;
19100     const pushNotifications: PushNotifications;
19101     type PushNotifications = Electron.PushNotifications;
19102     const safeStorage: SafeStorage;
19103     type SafeStorage = Electron.SafeStorage;
19104     const screen: Screen;
19105     type Screen = Electron.Screen;
19106     type ServiceWorkers = Electron.ServiceWorkers;
19107     const session: typeof Session;
19108     type Session = Electron.Session;
19109     class ShareMenu extends Electron.ShareMenu {}
19110     const systemPreferences: SystemPreferences;
19111     type SystemPreferences = Electron.SystemPreferences;
19112     class TouchBar extends Electron.TouchBar {}
19113     type TouchBarButton = Electron.TouchBarButton;
19114     type TouchBarColorPicker = Electron.TouchBarColorPicker;
19115     type TouchBarGroup = Electron.TouchBarGroup;
19116     type TouchBarLabel = Electron.TouchBarLabel;
19117     type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
19118     type TouchBarPopover = Electron.TouchBarPopover;
19119     type TouchBarScrubber = Electron.TouchBarScrubber;
19120     type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
19121     type TouchBarSlider = Electron.TouchBarSlider;
19122     type TouchBarSpacer = Electron.TouchBarSpacer;
19123     class Tray extends Electron.Tray {}
19124     const utilityProcess: typeof UtilityProcess;
19125     type UtilityProcess = Electron.UtilityProcess;
19126     const webContents: typeof WebContents;
19127     type WebContents = Electron.WebContents;
19128     const webFrameMain: typeof WebFrameMain;
19129     type WebFrameMain = Electron.WebFrameMain;
19130     type WebRequest = Electron.WebRequest;
19131     type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
19132     type AddRepresentationOptions = Electron.AddRepresentationOptions;
19133     type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
19134     type AnimationSettings = Electron.AnimationSettings;
19135     type AppDetailsOptions = Electron.AppDetailsOptions;
19136     type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
19137     type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
19138     type AuthInfo = Electron.AuthInfo;
19139     type AutoResizeOptions = Electron.AutoResizeOptions;
19140     type BeforeSendResponse = Electron.BeforeSendResponse;
19141     type BitmapOptions = Electron.BitmapOptions;
19142     type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
19143     type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
19144     type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
19145     type CallbackResponse = Electron.CallbackResponse;
19146     type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
19147     type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
19148     type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
19149     type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
19150     type CloseOpts = Electron.CloseOpts;
19151     type Config = Electron.Config;
19152     type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
19153     type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
19154     type ContextMenuEvent = Electron.ContextMenuEvent;
19155     type ContextMenuParams = Electron.ContextMenuParams;
19156     type ContinueActivityDetails = Electron.ContinueActivityDetails;
19157     type CookiesGetFilter = Electron.CookiesGetFilter;
19158     type CookiesSetDetails = Electron.CookiesSetDetails;
19159     type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
19160     type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
19161     type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
19162     type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
19163     type Data = Electron.Data;
19164     type DefaultFontFamily = Electron.DefaultFontFamily;
19165     type Details = Electron.Details;
19166     type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
19167     type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
19168     type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
19169     type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
19170     type DidFailLoadEvent = Electron.DidFailLoadEvent;
19171     type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
19172     type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
19173     type DidNavigateEvent = Electron.DidNavigateEvent;
19174     type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
19175     type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
19176     type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
19177     type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
19178     type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
19179     type DownloadURLOptions = Electron.DownloadURLOptions;
19180     type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
19181     type FeedURLOptions = Electron.FeedURLOptions;
19182     type FileIconOptions = Electron.FileIconOptions;
19183     type FindInPageOptions = Electron.FindInPageOptions;
19184     type FocusOptions = Electron.FocusOptions;
19185     type ForkOptions = Electron.ForkOptions;
19186     type FoundInPageEvent = Electron.FoundInPageEvent;
19187     type FrameCreatedDetails = Electron.FrameCreatedDetails;
19188     type FromPartitionOptions = Electron.FromPartitionOptions;
19189     type FromPathOptions = Electron.FromPathOptions;
19190     type HandlerDetails = Electron.HandlerDetails;
19191     type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
19192     type HeapStatistics = Electron.HeapStatistics;
19193     type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
19194     type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
19195     type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
19196     type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
19197     type ImportCertificateOptions = Electron.ImportCertificateOptions;
19198     type Info = Electron.Info;
19199     type Input = Electron.Input;
19200     type InsertCSSOptions = Electron.InsertCSSOptions;
19201     type IpcMessageEvent = Electron.IpcMessageEvent;
19202     type Item = Electron.Item;
19203     type JumpListSettings = Electron.JumpListSettings;
19204     type LoadCommitEvent = Electron.LoadCommitEvent;
19205     type LoadExtensionOptions = Electron.LoadExtensionOptions;
19206     type LoadFileOptions = Electron.LoadFileOptions;
19207     type LoadURLOptions = Electron.LoadURLOptions;
19208     type LoginItemSettings = Electron.LoginItemSettings;
19209     type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
19210     type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
19211     type MessageBoxOptions = Electron.MessageBoxOptions;
19212     type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
19213     type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
19214     type MessageDetails = Electron.MessageDetails;
19215     type MessageEvent = Electron.MessageEvent;
19216     type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
19217     type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
19218     type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
19219     type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
19220     type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
19221     type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
19222     type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
19223     type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
19224     type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
19225     type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
19226     type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
19227     type OpenDialogOptions = Electron.OpenDialogOptions;
19228     type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
19229     type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
19230     type OpenExternalOptions = Electron.OpenExternalOptions;
19231     type Options = Electron.Options;
19232     type Opts = Electron.Opts;
19233     type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
19234     type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
19235     type Parameters = Electron.Parameters;
19236     type Payment = Electron.Payment;
19237     type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
19238     type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
19239     type PluginCrashedEvent = Electron.PluginCrashedEvent;
19240     type PopupOptions = Electron.PopupOptions;
19241     type PreconnectOptions = Electron.PreconnectOptions;
19242     type PrintToPDFOptions = Electron.PrintToPDFOptions;
19243     type Privileges = Electron.Privileges;
19244     type ProgressBarOptions = Electron.ProgressBarOptions;
19245     type Provider = Electron.Provider;
19246     type PurchaseProductOpts = Electron.PurchaseProductOpts;
19247     type ReadBookmark = Electron.ReadBookmark;
19248     type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
19249     type RelaunchOptions = Electron.RelaunchOptions;
19250     type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
19251     type Request = Electron.Request;
19252     type ResizeOptions = Electron.ResizeOptions;
19253     type ResolveHostOptions = Electron.ResolveHostOptions;
19254     type ResourceUsage = Electron.ResourceUsage;
19255     type Response = Electron.Response;
19256     type Result = Electron.Result;
19257     type SaveDialogOptions = Electron.SaveDialogOptions;
19258     type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
19259     type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
19260     type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
19261     type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
19262     type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
19263     type Settings = Electron.Settings;
19264     type SourcesOptions = Electron.SourcesOptions;
19265     type SSLConfigConfig = Electron.SSLConfigConfig;
19266     type StartLoggingOptions = Electron.StartLoggingOptions;
19267     type Streams = Electron.Streams;
19268     type SystemMemoryInfo = Electron.SystemMemoryInfo;
19269     type TitleBarOverlay = Electron.TitleBarOverlay;
19270     type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
19271     type TitleOptions = Electron.TitleOptions;
19272     type ToBitmapOptions = Electron.ToBitmapOptions;
19273     type ToDataURLOptions = Electron.ToDataURLOptions;
19274     type ToPNGOptions = Electron.ToPNGOptions;
19275     type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
19276     type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
19277     type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
19278     type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
19279     type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
19280     type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
19281     type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
19282     type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
19283     type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
19284     type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
19285     type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
19286     type UdpPortRange = Electron.UdpPortRange;
19287     type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
19288     type UploadProgress = Electron.UploadProgress;
19289     type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
19290     type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
19291     type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
19292     type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
19293     type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
19294     type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
19295     type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
19296     type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
19297     type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
19298     type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
19299     type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
19300     type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
19301     type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
19302     type WillNavigateEvent = Electron.WillNavigateEvent;
19303     type WillResizeDetails = Electron.WillResizeDetails;
19304     type EditFlags = Electron.EditFlags;
19305     type Env = Electron.Env;
19306     type FoundInPageResult = Electron.FoundInPageResult;
19307     type LaunchItems = Electron.LaunchItems;
19308     type Margins = Electron.Margins;
19309     type MediaFlags = Electron.MediaFlags;
19310     type PageRanges = Electron.PageRanges;
19311     type Params = Electron.Params;
19312     type Video = Electron.Video;
19313     type BluetoothDevice = Electron.BluetoothDevice;
19314     type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
19315     type Certificate = Electron.Certificate;
19316     type CertificatePrincipal = Electron.CertificatePrincipal;
19317     type Cookie = Electron.Cookie;
19318     type CPUUsage = Electron.CPUUsage;
19319     type CrashReport = Electron.CrashReport;
19320     type CustomScheme = Electron.CustomScheme;
19321     type DesktopCapturerSource = Electron.DesktopCapturerSource;
19322     type Display = Electron.Display;
19323     type Extension = Electron.Extension;
19324     type ExtensionInfo = Electron.ExtensionInfo;
19325     type FileFilter = Electron.FileFilter;
19326     type FilePathWithHeaders = Electron.FilePathWithHeaders;
19327     type GPUFeatureStatus = Electron.GPUFeatureStatus;
19328     type HIDDevice = Electron.HIDDevice;
19329     type InputEvent = Electron.InputEvent;
19330     type IOCounters = Electron.IOCounters;
19331     type IpcMainEvent = Electron.IpcMainEvent;
19332     type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
19333     type IpcRendererEvent = Electron.IpcRendererEvent;
19334     type JumpListCategory = Electron.JumpListCategory;
19335     type JumpListItem = Electron.JumpListItem;
19336     type KeyboardEvent = Electron.KeyboardEvent;
19337     type KeyboardInputEvent = Electron.KeyboardInputEvent;
19338     type MemoryInfo = Electron.MemoryInfo;
19339     type MemoryUsageDetails = Electron.MemoryUsageDetails;
19340     type MimeTypedBuffer = Electron.MimeTypedBuffer;
19341     type MouseInputEvent = Electron.MouseInputEvent;
19342     type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
19343     type NotificationAction = Electron.NotificationAction;
19344     type NotificationResponse = Electron.NotificationResponse;
19345     type PaymentDiscount = Electron.PaymentDiscount;
19346     type Point = Electron.Point;
19347     type PostBody = Electron.PostBody;
19348     type PrinterInfo = Electron.PrinterInfo;
19349     type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
19350     type ProcessMetric = Electron.ProcessMetric;
19351     type Product = Electron.Product;
19352     type ProductDiscount = Electron.ProductDiscount;
19353     type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
19354     type ProtocolRequest = Electron.ProtocolRequest;
19355     type ProtocolResponse = Electron.ProtocolResponse;
19356     type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
19357     type Rectangle = Electron.Rectangle;
19358     type Referrer = Electron.Referrer;
19359     type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
19360     type ResolvedEndpoint = Electron.ResolvedEndpoint;
19361     type ResolvedHost = Electron.ResolvedHost;
19362     type ScrubberItem = Electron.ScrubberItem;
19363     type SegmentedControlSegment = Electron.SegmentedControlSegment;
19364     type SerialPort = Electron.SerialPort;
19365     type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
19366     type SharedWorkerInfo = Electron.SharedWorkerInfo;
19367     type SharingItem = Electron.SharingItem;
19368     type ShortcutDetails = Electron.ShortcutDetails;
19369     type Size = Electron.Size;
19370     type Task = Electron.Task;
19371     type ThumbarButton = Electron.ThumbarButton;
19372     type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
19373     type TraceConfig = Electron.TraceConfig;
19374     type Transaction = Electron.Transaction;
19375     type UploadData = Electron.UploadData;
19376     type UploadFile = Electron.UploadFile;
19377     type UploadRawData = Electron.UploadRawData;
19378     type USBDevice = Electron.USBDevice;
19379     type UserDefaultTypes = Electron.UserDefaultTypes;
19380     type WebPreferences = Electron.WebPreferences;
19381     type WebRequestFilter = Electron.WebRequestFilter;
19382     type WebSource = Electron.WebSource;
19383   }
19384
19385   namespace Renderer {
19386     type Event<Params extends object = {}> = Electron.Event<Params>;
19387     const contextBridge: ContextBridge;
19388     type ContextBridge = Electron.ContextBridge;
19389     const ipcRenderer: IpcRenderer;
19390     type IpcRenderer = Electron.IpcRenderer;
19391     const webFrame: WebFrame;
19392     type WebFrame = Electron.WebFrame;
19393     type WebviewTag = Electron.WebviewTag;
19394     type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
19395     type AddRepresentationOptions = Electron.AddRepresentationOptions;
19396     type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
19397     type AnimationSettings = Electron.AnimationSettings;
19398     type AppDetailsOptions = Electron.AppDetailsOptions;
19399     type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
19400     type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
19401     type AuthInfo = Electron.AuthInfo;
19402     type AutoResizeOptions = Electron.AutoResizeOptions;
19403     type BeforeSendResponse = Electron.BeforeSendResponse;
19404     type BitmapOptions = Electron.BitmapOptions;
19405     type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
19406     type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
19407     type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
19408     type CallbackResponse = Electron.CallbackResponse;
19409     type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
19410     type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
19411     type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
19412     type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
19413     type CloseOpts = Electron.CloseOpts;
19414     type Config = Electron.Config;
19415     type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
19416     type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
19417     type ContextMenuEvent = Electron.ContextMenuEvent;
19418     type ContextMenuParams = Electron.ContextMenuParams;
19419     type ContinueActivityDetails = Electron.ContinueActivityDetails;
19420     type CookiesGetFilter = Electron.CookiesGetFilter;
19421     type CookiesSetDetails = Electron.CookiesSetDetails;
19422     type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
19423     type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
19424     type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
19425     type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
19426     type Data = Electron.Data;
19427     type DefaultFontFamily = Electron.DefaultFontFamily;
19428     type Details = Electron.Details;
19429     type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
19430     type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
19431     type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
19432     type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
19433     type DidFailLoadEvent = Electron.DidFailLoadEvent;
19434     type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
19435     type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
19436     type DidNavigateEvent = Electron.DidNavigateEvent;
19437     type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
19438     type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
19439     type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
19440     type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
19441     type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
19442     type DownloadURLOptions = Electron.DownloadURLOptions;
19443     type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
19444     type FeedURLOptions = Electron.FeedURLOptions;
19445     type FileIconOptions = Electron.FileIconOptions;
19446     type FindInPageOptions = Electron.FindInPageOptions;
19447     type FocusOptions = Electron.FocusOptions;
19448     type ForkOptions = Electron.ForkOptions;
19449     type FoundInPageEvent = Electron.FoundInPageEvent;
19450     type FrameCreatedDetails = Electron.FrameCreatedDetails;
19451     type FromPartitionOptions = Electron.FromPartitionOptions;
19452     type FromPathOptions = Electron.FromPathOptions;
19453     type HandlerDetails = Electron.HandlerDetails;
19454     type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
19455     type HeapStatistics = Electron.HeapStatistics;
19456     type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
19457     type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
19458     type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
19459     type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
19460     type ImportCertificateOptions = Electron.ImportCertificateOptions;
19461     type Info = Electron.Info;
19462     type Input = Electron.Input;
19463     type InsertCSSOptions = Electron.InsertCSSOptions;
19464     type IpcMessageEvent = Electron.IpcMessageEvent;
19465     type Item = Electron.Item;
19466     type JumpListSettings = Electron.JumpListSettings;
19467     type LoadCommitEvent = Electron.LoadCommitEvent;
19468     type LoadExtensionOptions = Electron.LoadExtensionOptions;
19469     type LoadFileOptions = Electron.LoadFileOptions;
19470     type LoadURLOptions = Electron.LoadURLOptions;
19471     type LoginItemSettings = Electron.LoginItemSettings;
19472     type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
19473     type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
19474     type MessageBoxOptions = Electron.MessageBoxOptions;
19475     type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
19476     type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
19477     type MessageDetails = Electron.MessageDetails;
19478     type MessageEvent = Electron.MessageEvent;
19479     type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
19480     type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
19481     type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
19482     type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
19483     type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
19484     type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
19485     type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
19486     type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
19487     type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
19488     type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
19489     type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
19490     type OpenDialogOptions = Electron.OpenDialogOptions;
19491     type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
19492     type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
19493     type OpenExternalOptions = Electron.OpenExternalOptions;
19494     type Options = Electron.Options;
19495     type Opts = Electron.Opts;
19496     type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
19497     type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
19498     type Parameters = Electron.Parameters;
19499     type Payment = Electron.Payment;
19500     type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
19501     type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
19502     type PluginCrashedEvent = Electron.PluginCrashedEvent;
19503     type PopupOptions = Electron.PopupOptions;
19504     type PreconnectOptions = Electron.PreconnectOptions;
19505     type PrintToPDFOptions = Electron.PrintToPDFOptions;
19506     type Privileges = Electron.Privileges;
19507     type ProgressBarOptions = Electron.ProgressBarOptions;
19508     type Provider = Electron.Provider;
19509     type PurchaseProductOpts = Electron.PurchaseProductOpts;
19510     type ReadBookmark = Electron.ReadBookmark;
19511     type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
19512     type RelaunchOptions = Electron.RelaunchOptions;
19513     type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
19514     type Request = Electron.Request;
19515     type ResizeOptions = Electron.ResizeOptions;
19516     type ResolveHostOptions = Electron.ResolveHostOptions;
19517     type ResourceUsage = Electron.ResourceUsage;
19518     type Response = Electron.Response;
19519     type Result = Electron.Result;
19520     type SaveDialogOptions = Electron.SaveDialogOptions;
19521     type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
19522     type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
19523     type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
19524     type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
19525     type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
19526     type Settings = Electron.Settings;
19527     type SourcesOptions = Electron.SourcesOptions;
19528     type SSLConfigConfig = Electron.SSLConfigConfig;
19529     type StartLoggingOptions = Electron.StartLoggingOptions;
19530     type Streams = Electron.Streams;
19531     type SystemMemoryInfo = Electron.SystemMemoryInfo;
19532     type TitleBarOverlay = Electron.TitleBarOverlay;
19533     type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
19534     type TitleOptions = Electron.TitleOptions;
19535     type ToBitmapOptions = Electron.ToBitmapOptions;
19536     type ToDataURLOptions = Electron.ToDataURLOptions;
19537     type ToPNGOptions = Electron.ToPNGOptions;
19538     type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
19539     type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
19540     type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
19541     type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
19542     type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
19543     type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
19544     type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
19545     type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
19546     type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
19547     type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
19548     type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
19549     type UdpPortRange = Electron.UdpPortRange;
19550     type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
19551     type UploadProgress = Electron.UploadProgress;
19552     type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
19553     type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
19554     type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
19555     type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
19556     type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
19557     type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
19558     type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
19559     type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
19560     type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
19561     type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
19562     type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
19563     type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
19564     type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
19565     type WillNavigateEvent = Electron.WillNavigateEvent;
19566     type WillResizeDetails = Electron.WillResizeDetails;
19567     type EditFlags = Electron.EditFlags;
19568     type Env = Electron.Env;
19569     type FoundInPageResult = Electron.FoundInPageResult;
19570     type LaunchItems = Electron.LaunchItems;
19571     type Margins = Electron.Margins;
19572     type MediaFlags = Electron.MediaFlags;
19573     type PageRanges = Electron.PageRanges;
19574     type Params = Electron.Params;
19575     type Video = Electron.Video;
19576     type BluetoothDevice = Electron.BluetoothDevice;
19577     type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
19578     type Certificate = Electron.Certificate;
19579     type CertificatePrincipal = Electron.CertificatePrincipal;
19580     type Cookie = Electron.Cookie;
19581     type CPUUsage = Electron.CPUUsage;
19582     type CrashReport = Electron.CrashReport;
19583     type CustomScheme = Electron.CustomScheme;
19584     type DesktopCapturerSource = Electron.DesktopCapturerSource;
19585     type Display = Electron.Display;
19586     type Extension = Electron.Extension;
19587     type ExtensionInfo = Electron.ExtensionInfo;
19588     type FileFilter = Electron.FileFilter;
19589     type FilePathWithHeaders = Electron.FilePathWithHeaders;
19590     type GPUFeatureStatus = Electron.GPUFeatureStatus;
19591     type HIDDevice = Electron.HIDDevice;
19592     type InputEvent = Electron.InputEvent;
19593     type IOCounters = Electron.IOCounters;
19594     type IpcMainEvent = Electron.IpcMainEvent;
19595     type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
19596     type IpcRendererEvent = Electron.IpcRendererEvent;
19597     type JumpListCategory = Electron.JumpListCategory;
19598     type JumpListItem = Electron.JumpListItem;
19599     type KeyboardEvent = Electron.KeyboardEvent;
19600     type KeyboardInputEvent = Electron.KeyboardInputEvent;
19601     type MemoryInfo = Electron.MemoryInfo;
19602     type MemoryUsageDetails = Electron.MemoryUsageDetails;
19603     type MimeTypedBuffer = Electron.MimeTypedBuffer;
19604     type MouseInputEvent = Electron.MouseInputEvent;
19605     type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
19606     type NotificationAction = Electron.NotificationAction;
19607     type NotificationResponse = Electron.NotificationResponse;
19608     type PaymentDiscount = Electron.PaymentDiscount;
19609     type Point = Electron.Point;
19610     type PostBody = Electron.PostBody;
19611     type PrinterInfo = Electron.PrinterInfo;
19612     type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
19613     type ProcessMetric = Electron.ProcessMetric;
19614     type Product = Electron.Product;
19615     type ProductDiscount = Electron.ProductDiscount;
19616     type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
19617     type ProtocolRequest = Electron.ProtocolRequest;
19618     type ProtocolResponse = Electron.ProtocolResponse;
19619     type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
19620     type Rectangle = Electron.Rectangle;
19621     type Referrer = Electron.Referrer;
19622     type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
19623     type ResolvedEndpoint = Electron.ResolvedEndpoint;
19624     type ResolvedHost = Electron.ResolvedHost;
19625     type ScrubberItem = Electron.ScrubberItem;
19626     type SegmentedControlSegment = Electron.SegmentedControlSegment;
19627     type SerialPort = Electron.SerialPort;
19628     type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
19629     type SharedWorkerInfo = Electron.SharedWorkerInfo;
19630     type SharingItem = Electron.SharingItem;
19631     type ShortcutDetails = Electron.ShortcutDetails;
19632     type Size = Electron.Size;
19633     type Task = Electron.Task;
19634     type ThumbarButton = Electron.ThumbarButton;
19635     type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
19636     type TraceConfig = Electron.TraceConfig;
19637     type Transaction = Electron.Transaction;
19638     type UploadData = Electron.UploadData;
19639     type UploadFile = Electron.UploadFile;
19640     type UploadRawData = Electron.UploadRawData;
19641     type USBDevice = Electron.USBDevice;
19642     type UserDefaultTypes = Electron.UserDefaultTypes;
19643     type WebPreferences = Electron.WebPreferences;
19644     type WebRequestFilter = Electron.WebRequestFilter;
19645     type WebSource = Electron.WebSource;
19646   }
19647
19648   namespace CrossProcessExports {
19649     type Event<Params extends object = {}> = Electron.Event<Params>;
19650     const app: App;
19651     type App = Electron.App;
19652     const autoUpdater: AutoUpdater;
19653     type AutoUpdater = Electron.AutoUpdater;
19654     class BrowserView extends Electron.BrowserView {}
19655     class BrowserWindow extends Electron.BrowserWindow {}
19656     type ClientRequest = Electron.ClientRequest;
19657     const clipboard: Clipboard;
19658     type Clipboard = Electron.Clipboard;
19659     type CommandLine = Electron.CommandLine;
19660     const contentTracing: ContentTracing;
19661     type ContentTracing = Electron.ContentTracing;
19662     const contextBridge: ContextBridge;
19663     type ContextBridge = Electron.ContextBridge;
19664     type Cookies = Electron.Cookies;
19665     const crashReporter: CrashReporter;
19666     type CrashReporter = Electron.CrashReporter;
19667     type Debugger = Electron.Debugger;
19668     const desktopCapturer: DesktopCapturer;
19669     type DesktopCapturer = Electron.DesktopCapturer;
19670     const dialog: Dialog;
19671     type Dialog = Electron.Dialog;
19672     type Dock = Electron.Dock;
19673     type DownloadItem = Electron.DownloadItem;
19674     const globalShortcut: GlobalShortcut;
19675     type GlobalShortcut = Electron.GlobalShortcut;
19676     const inAppPurchase: InAppPurchase;
19677     type InAppPurchase = Electron.InAppPurchase;
19678     type IncomingMessage = Electron.IncomingMessage;
19679     const ipcMain: IpcMain;
19680     type IpcMain = Electron.IpcMain;
19681     const ipcRenderer: IpcRenderer;
19682     type IpcRenderer = Electron.IpcRenderer;
19683     class Menu extends Electron.Menu {}
19684     class MenuItem extends Electron.MenuItem {}
19685     class MessageChannelMain extends Electron.MessageChannelMain {}
19686     type MessagePortMain = Electron.MessagePortMain;
19687     const nativeImage: typeof NativeImage;
19688     type NativeImage = Electron.NativeImage;
19689     const nativeTheme: NativeTheme;
19690     type NativeTheme = Electron.NativeTheme;
19691     const net: Net;
19692     type Net = Electron.Net;
19693     const netLog: NetLog;
19694     type NetLog = Electron.NetLog;
19695     class Notification extends Electron.Notification {}
19696     const powerMonitor: PowerMonitor;
19697     type PowerMonitor = Electron.PowerMonitor;
19698     const powerSaveBlocker: PowerSaveBlocker;
19699     type PowerSaveBlocker = Electron.PowerSaveBlocker;
19700     const protocol: Protocol;
19701     type Protocol = Electron.Protocol;
19702     const pushNotifications: PushNotifications;
19703     type PushNotifications = Electron.PushNotifications;
19704     const safeStorage: SafeStorage;
19705     type SafeStorage = Electron.SafeStorage;
19706     const screen: Screen;
19707     type Screen = Electron.Screen;
19708     type ServiceWorkers = Electron.ServiceWorkers;
19709     const session: typeof Session;
19710     type Session = Electron.Session;
19711     class ShareMenu extends Electron.ShareMenu {}
19712     const shell: Shell;
19713     type Shell = Electron.Shell;
19714     const systemPreferences: SystemPreferences;
19715     type SystemPreferences = Electron.SystemPreferences;
19716     class TouchBar extends Electron.TouchBar {}
19717     type TouchBarButton = Electron.TouchBarButton;
19718     type TouchBarColorPicker = Electron.TouchBarColorPicker;
19719     type TouchBarGroup = Electron.TouchBarGroup;
19720     type TouchBarLabel = Electron.TouchBarLabel;
19721     type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
19722     type TouchBarPopover = Electron.TouchBarPopover;
19723     type TouchBarScrubber = Electron.TouchBarScrubber;
19724     type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
19725     type TouchBarSlider = Electron.TouchBarSlider;
19726     type TouchBarSpacer = Electron.TouchBarSpacer;
19727     class Tray extends Electron.Tray {}
19728     const utilityProcess: typeof UtilityProcess;
19729     type UtilityProcess = Electron.UtilityProcess;
19730     const webContents: typeof WebContents;
19731     type WebContents = Electron.WebContents;
19732     const webFrame: WebFrame;
19733     type WebFrame = Electron.WebFrame;
19734     const webFrameMain: typeof WebFrameMain;
19735     type WebFrameMain = Electron.WebFrameMain;
19736     type WebRequest = Electron.WebRequest;
19737     type WebviewTag = Electron.WebviewTag;
19738     type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
19739     type AddRepresentationOptions = Electron.AddRepresentationOptions;
19740     type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
19741     type AnimationSettings = Electron.AnimationSettings;
19742     type AppDetailsOptions = Electron.AppDetailsOptions;
19743     type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
19744     type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
19745     type AuthInfo = Electron.AuthInfo;
19746     type AutoResizeOptions = Electron.AutoResizeOptions;
19747     type BeforeSendResponse = Electron.BeforeSendResponse;
19748     type BitmapOptions = Electron.BitmapOptions;
19749     type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
19750     type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
19751     type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
19752     type CallbackResponse = Electron.CallbackResponse;
19753     type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
19754     type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
19755     type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
19756     type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
19757     type CloseOpts = Electron.CloseOpts;
19758     type Config = Electron.Config;
19759     type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
19760     type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
19761     type ContextMenuEvent = Electron.ContextMenuEvent;
19762     type ContextMenuParams = Electron.ContextMenuParams;
19763     type ContinueActivityDetails = Electron.ContinueActivityDetails;
19764     type CookiesGetFilter = Electron.CookiesGetFilter;
19765     type CookiesSetDetails = Electron.CookiesSetDetails;
19766     type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
19767     type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
19768     type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
19769     type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
19770     type Data = Electron.Data;
19771     type DefaultFontFamily = Electron.DefaultFontFamily;
19772     type Details = Electron.Details;
19773     type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
19774     type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
19775     type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
19776     type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
19777     type DidFailLoadEvent = Electron.DidFailLoadEvent;
19778     type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
19779     type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
19780     type DidNavigateEvent = Electron.DidNavigateEvent;
19781     type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
19782     type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
19783     type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
19784     type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
19785     type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
19786     type DownloadURLOptions = Electron.DownloadURLOptions;
19787     type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
19788     type FeedURLOptions = Electron.FeedURLOptions;
19789     type FileIconOptions = Electron.FileIconOptions;
19790     type FindInPageOptions = Electron.FindInPageOptions;
19791     type FocusOptions = Electron.FocusOptions;
19792     type ForkOptions = Electron.ForkOptions;
19793     type FoundInPageEvent = Electron.FoundInPageEvent;
19794     type FrameCreatedDetails = Electron.FrameCreatedDetails;
19795     type FromPartitionOptions = Electron.FromPartitionOptions;
19796     type FromPathOptions = Electron.FromPathOptions;
19797     type HandlerDetails = Electron.HandlerDetails;
19798     type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
19799     type HeapStatistics = Electron.HeapStatistics;
19800     type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
19801     type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
19802     type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
19803     type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
19804     type ImportCertificateOptions = Electron.ImportCertificateOptions;
19805     type Info = Electron.Info;
19806     type Input = Electron.Input;
19807     type InsertCSSOptions = Electron.InsertCSSOptions;
19808     type IpcMessageEvent = Electron.IpcMessageEvent;
19809     type Item = Electron.Item;
19810     type JumpListSettings = Electron.JumpListSettings;
19811     type LoadCommitEvent = Electron.LoadCommitEvent;
19812     type LoadExtensionOptions = Electron.LoadExtensionOptions;
19813     type LoadFileOptions = Electron.LoadFileOptions;
19814     type LoadURLOptions = Electron.LoadURLOptions;
19815     type LoginItemSettings = Electron.LoginItemSettings;
19816     type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
19817     type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
19818     type MessageBoxOptions = Electron.MessageBoxOptions;
19819     type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
19820     type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
19821     type MessageDetails = Electron.MessageDetails;
19822     type MessageEvent = Electron.MessageEvent;
19823     type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
19824     type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
19825     type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
19826     type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
19827     type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
19828     type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
19829     type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
19830     type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
19831     type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
19832     type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
19833     type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
19834     type OpenDialogOptions = Electron.OpenDialogOptions;
19835     type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
19836     type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
19837     type OpenExternalOptions = Electron.OpenExternalOptions;
19838     type Options = Electron.Options;
19839     type Opts = Electron.Opts;
19840     type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
19841     type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
19842     type Parameters = Electron.Parameters;
19843     type Payment = Electron.Payment;
19844     type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
19845     type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
19846     type PluginCrashedEvent = Electron.PluginCrashedEvent;
19847     type PopupOptions = Electron.PopupOptions;
19848     type PreconnectOptions = Electron.PreconnectOptions;
19849     type PrintToPDFOptions = Electron.PrintToPDFOptions;
19850     type Privileges = Electron.Privileges;
19851     type ProgressBarOptions = Electron.ProgressBarOptions;
19852     type Provider = Electron.Provider;
19853     type PurchaseProductOpts = Electron.PurchaseProductOpts;
19854     type ReadBookmark = Electron.ReadBookmark;
19855     type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
19856     type RelaunchOptions = Electron.RelaunchOptions;
19857     type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
19858     type Request = Electron.Request;
19859     type ResizeOptions = Electron.ResizeOptions;
19860     type ResolveHostOptions = Electron.ResolveHostOptions;
19861     type ResourceUsage = Electron.ResourceUsage;
19862     type Response = Electron.Response;
19863     type Result = Electron.Result;
19864     type SaveDialogOptions = Electron.SaveDialogOptions;
19865     type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
19866     type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
19867     type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
19868     type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
19869     type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
19870     type Settings = Electron.Settings;
19871     type SourcesOptions = Electron.SourcesOptions;
19872     type SSLConfigConfig = Electron.SSLConfigConfig;
19873     type StartLoggingOptions = Electron.StartLoggingOptions;
19874     type Streams = Electron.Streams;
19875     type SystemMemoryInfo = Electron.SystemMemoryInfo;
19876     type TitleBarOverlay = Electron.TitleBarOverlay;
19877     type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
19878     type TitleOptions = Electron.TitleOptions;
19879     type ToBitmapOptions = Electron.ToBitmapOptions;
19880     type ToDataURLOptions = Electron.ToDataURLOptions;
19881     type ToPNGOptions = Electron.ToPNGOptions;
19882     type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
19883     type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
19884     type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
19885     type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
19886     type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
19887     type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
19888     type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
19889     type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
19890     type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
19891     type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
19892     type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
19893     type UdpPortRange = Electron.UdpPortRange;
19894     type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
19895     type UploadProgress = Electron.UploadProgress;
19896     type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
19897     type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
19898     type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
19899     type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
19900     type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
19901     type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
19902     type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
19903     type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
19904     type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
19905     type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
19906     type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
19907     type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
19908     type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
19909     type WillNavigateEvent = Electron.WillNavigateEvent;
19910     type WillResizeDetails = Electron.WillResizeDetails;
19911     type EditFlags = Electron.EditFlags;
19912     type Env = Electron.Env;
19913     type FoundInPageResult = Electron.FoundInPageResult;
19914     type LaunchItems = Electron.LaunchItems;
19915     type Margins = Electron.Margins;
19916     type MediaFlags = Electron.MediaFlags;
19917     type PageRanges = Electron.PageRanges;
19918     type Params = Electron.Params;
19919     type Video = Electron.Video;
19920     type BluetoothDevice = Electron.BluetoothDevice;
19921     type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
19922     type Certificate = Electron.Certificate;
19923     type CertificatePrincipal = Electron.CertificatePrincipal;
19924     type Cookie = Electron.Cookie;
19925     type CPUUsage = Electron.CPUUsage;
19926     type CrashReport = Electron.CrashReport;
19927     type CustomScheme = Electron.CustomScheme;
19928     type DesktopCapturerSource = Electron.DesktopCapturerSource;
19929     type Display = Electron.Display;
19930     type Extension = Electron.Extension;
19931     type ExtensionInfo = Electron.ExtensionInfo;
19932     type FileFilter = Electron.FileFilter;
19933     type FilePathWithHeaders = Electron.FilePathWithHeaders;
19934     type GPUFeatureStatus = Electron.GPUFeatureStatus;
19935     type HIDDevice = Electron.HIDDevice;
19936     type InputEvent = Electron.InputEvent;
19937     type IOCounters = Electron.IOCounters;
19938     type IpcMainEvent = Electron.IpcMainEvent;
19939     type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
19940     type IpcRendererEvent = Electron.IpcRendererEvent;
19941     type JumpListCategory = Electron.JumpListCategory;
19942     type JumpListItem = Electron.JumpListItem;
19943     type KeyboardEvent = Electron.KeyboardEvent;
19944     type KeyboardInputEvent = Electron.KeyboardInputEvent;
19945     type MemoryInfo = Electron.MemoryInfo;
19946     type MemoryUsageDetails = Electron.MemoryUsageDetails;
19947     type MimeTypedBuffer = Electron.MimeTypedBuffer;
19948     type MouseInputEvent = Electron.MouseInputEvent;
19949     type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
19950     type NotificationAction = Electron.NotificationAction;
19951     type NotificationResponse = Electron.NotificationResponse;
19952     type PaymentDiscount = Electron.PaymentDiscount;
19953     type Point = Electron.Point;
19954     type PostBody = Electron.PostBody;
19955     type PrinterInfo = Electron.PrinterInfo;
19956     type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
19957     type ProcessMetric = Electron.ProcessMetric;
19958     type Product = Electron.Product;
19959     type ProductDiscount = Electron.ProductDiscount;
19960     type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
19961     type ProtocolRequest = Electron.ProtocolRequest;
19962     type ProtocolResponse = Electron.ProtocolResponse;
19963     type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
19964     type Rectangle = Electron.Rectangle;
19965     type Referrer = Electron.Referrer;
19966     type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
19967     type ResolvedEndpoint = Electron.ResolvedEndpoint;
19968     type ResolvedHost = Electron.ResolvedHost;
19969     type ScrubberItem = Electron.ScrubberItem;
19970     type SegmentedControlSegment = Electron.SegmentedControlSegment;
19971     type SerialPort = Electron.SerialPort;
19972     type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
19973     type SharedWorkerInfo = Electron.SharedWorkerInfo;
19974     type SharingItem = Electron.SharingItem;
19975     type ShortcutDetails = Electron.ShortcutDetails;
19976     type Size = Electron.Size;
19977     type Task = Electron.Task;
19978     type ThumbarButton = Electron.ThumbarButton;
19979     type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
19980     type TraceConfig = Electron.TraceConfig;
19981     type Transaction = Electron.Transaction;
19982     type UploadData = Electron.UploadData;
19983     type UploadFile = Electron.UploadFile;
19984     type UploadRawData = Electron.UploadRawData;
19985     type USBDevice = Electron.USBDevice;
19986     type UserDefaultTypes = Electron.UserDefaultTypes;
19987     type WebPreferences = Electron.WebPreferences;
19988     type WebRequestFilter = Electron.WebRequestFilter;
19989     type WebSource = Electron.WebSource;
19990   }
19991
19992   const app: App;
19993   const autoUpdater: AutoUpdater;
19994   const clipboard: Clipboard;
19995   const contentTracing: ContentTracing;
19996   const contextBridge: ContextBridge;
19997   const crashReporter: CrashReporter;
19998   const desktopCapturer: DesktopCapturer;
19999   const dialog: Dialog;
20000   const globalShortcut: GlobalShortcut;
20001   const inAppPurchase: InAppPurchase;
20002   const ipcMain: IpcMain;
20003   const ipcRenderer: IpcRenderer;
20004   const nativeImage: typeof NativeImage;
20005   const nativeTheme: NativeTheme;
20006   const net: Net;
20007   const netLog: NetLog;
20008   const parentPort: ParentPort;
20009   const powerMonitor: PowerMonitor;
20010   const powerSaveBlocker: PowerSaveBlocker;
20011   const protocol: Protocol;
20012   const pushNotifications: PushNotifications;
20013   const safeStorage: SafeStorage;
20014   const screen: Screen;
20015   const session: typeof Session;
20016   const shell: Shell;
20017   const systemPreferences: SystemPreferences;
20018   const utilityProcess: typeof UtilityProcess;
20019   const webContents: typeof WebContents;
20020   const webFrame: WebFrame;
20021   const webFrameMain: typeof WebFrameMain;
20022
20023 }
20024
20025 declare module 'electron' {
20026   export = Electron.CrossProcessExports;
20027 }
20028
20029 declare module 'electron/main' {
20030   export = Electron.Main;
20031 }
20032
20033 declare module 'electron/common' {
20034   export = Electron.Common;
20035 }
20036
20037 declare module 'electron/renderer' {
20038   export = Electron.Renderer;
20039 }
20040
20041 interface NodeRequireFunction {
20042   (moduleName: 'electron'): typeof Electron.CrossProcessExports;
20043   (moduleName: 'electron/main'): typeof Electron.Main;
20044   (moduleName: 'electron/common'): typeof Electron.Common;
20045   (moduleName: 'electron/renderer'): typeof Electron.Renderer;
20046 }
20047
20048 interface NodeRequire {
20049   (moduleName: 'electron'): typeof Electron.CrossProcessExports;
20050   (moduleName: 'electron/main'): typeof Electron.Main;
20051   (moduleName: 'electron/common'): typeof Electron.Common;
20052   (moduleName: 'electron/renderer'): typeof Electron.Renderer;
20053 }
20054
20055 interface File {
20056   /**
20057    * The real path to the file on the users filesystem
20058    */
20059   path: string;
20060 }
20061
20062 declare module 'original-fs' {
20063   import * as fs from 'fs';
20064   export = fs;
20065 }
20066
20067 declare module 'node:original-fs' {
20068   import * as fs from 'fs';
20069   export = fs;
20070 }
20071
20072 interface Document {
20073   createElement(tagName: 'webview'): Electron.WebviewTag;
20074 }
20075
20076
20077 declare namespace NodeJS {
20078   interface Process extends NodeJS.EventEmitter {
20079
20080     // Docs: https://electronjs.org/docs/api/process
20081
20082     /**
20083      * Emitted when Electron has loaded its internal initialization script and is
20084      * beginning to load the web page or the main script.
20085      */
20086     on(event: 'loaded', listener: Function): this;
20087     off(event: 'loaded', listener: Function): this;
20088     once(event: 'loaded', listener: Function): this;
20089     addListener(event: 'loaded', listener: Function): this;
20090     removeListener(event: 'loaded', listener: Function): this;
20091     /**
20092      * Causes the main thread of the current process crash.
20093      */
20094     crash(): void;
20095     /**
20096      * * `allocated` Integer - Size of all allocated objects in Kilobytes.
20097      * * `total` Integer - Total allocated space in Kilobytes.
20098      * 
20099      * Returns an object with Blink memory information. It can be useful for debugging
20100      * rendering / DOM related memory issues. Note that all values are reported in
20101      * Kilobytes.
20102      */
20103     getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
20104     getCPUUsage(): Electron.CPUUsage;
20105     /**
20106      * The number of milliseconds since epoch, or `null` if the information is
20107      * unavailable
20108      * 
20109      * Indicates the creation time of the application. The time is represented as
20110      * number of milliseconds since epoch. It returns null if it is unable to get the
20111      * process creation time.
20112      */
20113     getCreationTime(): (number) | (null);
20114     /**
20115      * * `totalHeapSize` Integer
20116      * * `totalHeapSizeExecutable` Integer
20117      * * `totalPhysicalSize` Integer
20118      * * `totalAvailableSize` Integer
20119      * * `usedHeapSize` Integer
20120      * * `heapSizeLimit` Integer
20121      * * `mallocedMemory` Integer
20122      * * `peakMallocedMemory` Integer
20123      * * `doesZapGarbage` boolean
20124      * 
20125      * Returns an object with V8 heap statistics. Note that all statistics are reported
20126      * in Kilobytes.
20127      */
20128     getHeapStatistics(): Electron.HeapStatistics;
20129     /**
20130      * @platform win32,linux
20131      */
20132     getIOCounters(): Electron.IOCounters;
20133     /**
20134      * Resolves with a ProcessMemoryInfo
20135      * 
20136      * Returns an object giving memory usage statistics about the current process. Note
20137      * that all statistics are reported in Kilobytes. This api should be called after
20138      * app ready.
20139      * 
20140      * Chromium does not provide `residentSet` value for macOS. This is because macOS
20141      * performs in-memory compression of pages that haven't been recently used. As a
20142      * result the resident set size value is not what one would expect. `private`
20143      * memory is more representative of the actual pre-compression memory usage of the
20144      * process on macOS.
20145      */
20146     getProcessMemoryInfo(): Promise<Electron.ProcessMemoryInfo>;
20147     /**
20148      * * `total` Integer - The total amount of physical memory in Kilobytes available
20149      * to the system.
20150      * * `free` Integer - The total amount of memory not being used by applications or
20151      * disk cache.
20152      * * `swapTotal` Integer _Windows_ _Linux_ - The total amount of swap memory in
20153      * Kilobytes available to the system.
20154      * * `swapFree` Integer _Windows_ _Linux_ - The free amount of swap memory in
20155      * Kilobytes available to the system.
20156      * 
20157      * Returns an object giving memory usage statistics about the entire system. Note
20158      * that all statistics are reported in Kilobytes.
20159      */
20160     getSystemMemoryInfo(): Electron.SystemMemoryInfo;
20161     /**
20162      * The version of the host operating system.
20163      * 
20164      * Example:
20165      * 
20166      * **Note:** It returns the actual operating system version instead of kernel
20167      * version on macOS unlike `os.release()`.
20168      */
20169     getSystemVersion(): string;
20170     /**
20171      * Causes the main thread of the current process hang.
20172      */
20173     hang(): void;
20174     /**
20175      * Sets the file descriptor soft limit to `maxDescriptors` or the OS hard limit,
20176      * whichever is lower for the current process.
20177      *
20178      * @platform darwin,linux
20179      */
20180     setFdLimit(maxDescriptors: number): void;
20181     /**
20182      * Indicates whether the snapshot has been created successfully.
20183      * 
20184      * Takes a V8 heap snapshot and saves it to `filePath`.
20185      */
20186     takeHeapSnapshot(filePath: string): boolean;
20187     /**
20188      * A `string` representing Chrome's version string.
20189      *
20190      */
20191     readonly chrome: string;
20192     /**
20193      * A `string` (optional) representing a globally unique ID of the current
20194      * JavaScript context. Each frame has its own JavaScript context. When
20195      * contextIsolation is enabled, the isolated world also has a separate JavaScript
20196      * context. This property is only available in the renderer process.
20197      *
20198      */
20199     readonly contextId?: string;
20200     /**
20201      * A `boolean` that indicates whether the current renderer context has
20202      * `contextIsolation` enabled. It is `undefined` in the main process.
20203      *
20204      */
20205     readonly contextIsolated: boolean;
20206     /**
20207      * A `boolean`. When the app is started by being passed as parameter to the default
20208      * Electron executable, this property is `true` in the main process, otherwise it
20209      * is `undefined`. For example when running the app with `electron .`, it is
20210      * `true`, even if the app is packaged (`isPackaged`) is `true`. This can be useful
20211      * to determine how many arguments will need to be sliced off from `process.argv`.
20212      *
20213      */
20214     readonly defaultApp: boolean;
20215     /**
20216      * A `string` representing Electron's version string.
20217      *
20218      */
20219     readonly electron: string;
20220     /**
20221      * A `boolean`, `true` when the current renderer context is the "main" renderer
20222      * frame. If you want the ID of the current frame you should use
20223      * `webFrame.routingId`.
20224      *
20225      */
20226     readonly isMainFrame: boolean;
20227     /**
20228      * A `boolean`. For Mac App Store build, this property is `true`, for other builds
20229      * it is `undefined`.
20230      *
20231      */
20232     readonly mas: boolean;
20233     /**
20234      * A `boolean` that controls ASAR support inside your application. Setting this to
20235      * `true` will disable the support for `asar` archives in Node's built-in modules.
20236      */
20237     noAsar: boolean;
20238     /**
20239      * A `boolean` that controls whether or not deprecation warnings are printed to
20240      * `stderr`. Setting this to `true` will silence deprecation warnings. This
20241      * property is used instead of the `--no-deprecation` command line flag.
20242      */
20243     noDeprecation: boolean;
20244     /**
20245      * A `Electron.ParentPort` property if this is a `UtilityProcess` (or `null`
20246      * otherwise) allowing communication with the parent process.
20247      */
20248     parentPort: Electron.ParentPort;
20249     /**
20250      * A `string` representing the path to the resources directory.
20251      *
20252      */
20253     readonly resourcesPath: string;
20254     /**
20255      * A `boolean`. When the renderer process is sandboxed, this property is `true`,
20256      * otherwise it is `undefined`.
20257      *
20258      */
20259     readonly sandboxed: boolean;
20260     /**
20261      * A `boolean` that controls whether or not deprecation warnings will be thrown as
20262      * exceptions. Setting this to `true` will throw errors for deprecations. This
20263      * property is used instead of the `--throw-deprecation` command line flag.
20264      */
20265     throwDeprecation: boolean;
20266     /**
20267      * A `boolean` that controls whether or not deprecations printed to `stderr`
20268      * include their stack trace. Setting this to `true` will print stack traces for
20269      * deprecations. This property is instead of the `--trace-deprecation` command line
20270      * flag.
20271      */
20272     traceDeprecation: boolean;
20273     /**
20274      * A `boolean` that controls whether or not process warnings printed to `stderr`
20275      * include their stack trace. Setting this to `true` will print stack traces for
20276      * process warnings (including deprecations). This property is instead of the
20277      * `--trace-warnings` command line flag.
20278      */
20279     traceProcessWarnings: boolean;
20280     /**
20281      * A `string` representing the current process's type, can be:
20282      * 
20283      * * `browser` - The main process
20284      * * `renderer` - A renderer process
20285      * * `worker` - In a web worker
20286      * * `utility` - In a node process launched as a service
20287      *
20288      */
20289     readonly type: ('browser' | 'renderer' | 'worker' | 'utility');
20290     /**
20291      * A `boolean`. If the app is running as a Windows Store app (appx), this property
20292      * is `true`, for otherwise it is `undefined`.
20293      *
20294      */
20295     readonly windowsStore: boolean;
20296   }
20297   interface ProcessVersions {
20298     readonly electron: string;
20299     readonly chrome: string;
20300   }
20301 }