[WRTJS] Fix a gcc build error caused by function/class ambiguity
[platform/framework/web/chromium-efl.git] / electron / electron.d.ts
1 // Type definitions for Electron 22.0.0
2 // Project: http://electronjs.org/
3 // Definitions by: The Electron Team <https://github.com/electron/electron>
4 // Definitions: https://github.com/electron/electron-typescript-definitions
5
6 /// <reference types="node" />
7
8 type GlobalEvent = Event & { returnValue: any };
9
10 declare namespace Electron {
11   const NodeEventEmitter: typeof import('events').EventEmitter;
12
13   class Accelerator extends String {
14
15   }
16   interface App extends NodeJS.EventEmitter {
17
18     // Docs: https://electronjs.org/docs/api/app
19
20     /**
21      * Emitted when Chrome's accessibility support changes. This event fires when
22      * assistive technologies, such as screen readers, are enabled or disabled. See
23      * https://www.chromium.org/developers/design-documents/accessibility for more
24      * details.
25      *
26      * @platform darwin,win32
27      */
28     on(event: 'accessibility-support-changed', listener: (event: Event,
29                                                           /**
30                                                            * `true` when Chrome's accessibility support is enabled, `false` otherwise.
31                                                            */
32                                                           accessibilitySupportEnabled: boolean) => void): this;
33     once(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     addListener(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     removeListener(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     /**
49      * Emitted when the application is activated. Various actions can trigger this
50      * event, such as launching the application for the first time, attempting to
51      * re-launch the application when it's already running, or clicking on the
52      * application's dock or taskbar icon.
53      *
54      * @platform darwin
55      */
56     on(event: 'activate', listener: (event: Event,
57                                      hasVisibleWindows: boolean) => void): this;
58     once(event: 'activate', listener: (event: Event,
59                                      hasVisibleWindows: boolean) => void): this;
60     addListener(event: 'activate', listener: (event: Event,
61                                      hasVisibleWindows: boolean) => void): this;
62     removeListener(event: 'activate', listener: (event: Event,
63                                      hasVisibleWindows: boolean) => void): this;
64     /**
65      * Emitted during Handoff after an activity from this device was successfully
66      * resumed on another one.
67      *
68      * @platform darwin
69      */
70     on(event: 'activity-was-continued', listener: (event: Event,
71                                                    /**
72                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
73                                                     */
74                                                    type: string,
75                                                    /**
76                                                     * Contains app-specific state stored by the activity.
77                                                     */
78                                                    userInfo: unknown) => void): this;
79     once(event: 'activity-was-continued', listener: (event: Event,
80                                                    /**
81                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
82                                                     */
83                                                    type: string,
84                                                    /**
85                                                     * Contains app-specific state stored by the activity.
86                                                     */
87                                                    userInfo: unknown) => void): this;
88     addListener(event: 'activity-was-continued', listener: (event: Event,
89                                                    /**
90                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
91                                                     */
92                                                    type: string,
93                                                    /**
94                                                     * Contains app-specific state stored by the activity.
95                                                     */
96                                                    userInfo: unknown) => void): this;
97     removeListener(event: 'activity-was-continued', listener: (event: Event,
98                                                    /**
99                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
100                                                     */
101                                                    type: string,
102                                                    /**
103                                                     * Contains app-specific state stored by the activity.
104                                                     */
105                                                    userInfo: unknown) => void): this;
106     /**
107      * Emitted before the application starts closing its windows. Calling
108      * `event.preventDefault()` will prevent the default behavior, which is terminating
109      * the application.
110      *
111      * **Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
112      * then `before-quit` is emitted *after* emitting `close` event on all windows and
113      * closing them.
114      *
115      * **Note:** On Windows, this event will not be emitted if the app is closed due to
116      * a shutdown/restart of the system or a user logout.
117      */
118     on(event: 'before-quit', listener: (event: Event) => void): this;
119     once(event: 'before-quit', listener: (event: Event) => void): this;
120     addListener(event: 'before-quit', listener: (event: Event) => void): this;
121     removeListener(event: 'before-quit', listener: (event: Event) => void): this;
122     /**
123      * Emitted when a browserWindow gets blurred.
124      */
125     on(event: 'browser-window-blur', listener: (event: Event,
126                                                 window: BrowserWindow) => void): this;
127     once(event: 'browser-window-blur', listener: (event: Event,
128                                                 window: BrowserWindow) => void): this;
129     addListener(event: 'browser-window-blur', listener: (event: Event,
130                                                 window: BrowserWindow) => void): this;
131     removeListener(event: 'browser-window-blur', listener: (event: Event,
132                                                 window: BrowserWindow) => void): this;
133     /**
134      * Emitted when a new browserWindow is created.
135      */
136     on(event: 'browser-window-created', listener: (event: Event,
137                                                    window: BrowserWindow) => void): this;
138     once(event: 'browser-window-created', listener: (event: Event,
139                                                    window: BrowserWindow) => void): this;
140     addListener(event: 'browser-window-created', listener: (event: Event,
141                                                    window: BrowserWindow) => void): this;
142     removeListener(event: 'browser-window-created', listener: (event: Event,
143                                                    window: BrowserWindow) => void): this;
144     /**
145      * Emitted when a browserWindow gets focused.
146      */
147     on(event: 'browser-window-focus', listener: (event: Event,
148                                                  window: BrowserWindow) => void): this;
149     once(event: 'browser-window-focus', listener: (event: Event,
150                                                  window: BrowserWindow) => void): this;
151     addListener(event: 'browser-window-focus', listener: (event: Event,
152                                                  window: BrowserWindow) => void): this;
153     removeListener(event: 'browser-window-focus', listener: (event: Event,
154                                                  window: BrowserWindow) => void): this;
155     /**
156      * Emitted when failed to verify the `certificate` for `url`, to trust the
157      * certificate you should prevent the default behavior with
158      * `event.preventDefault()` and call `callback(true)`.
159      */
160     on(event: 'certificate-error', listener: (event: Event,
161                                               webContents: WebContents,
162                                               url: string,
163                                               /**
164                                                * The error code
165                                                */
166                                               error: string,
167                                               certificate: Certificate,
168                                               callback: (isTrusted: boolean) => void,
169                                               isMainFrame: boolean) => void): this;
170     once(event: 'certificate-error', listener: (event: Event,
171                                               webContents: WebContents,
172                                               url: string,
173                                               /**
174                                                * The error code
175                                                */
176                                               error: string,
177                                               certificate: Certificate,
178                                               callback: (isTrusted: boolean) => void,
179                                               isMainFrame: boolean) => void): this;
180     addListener(event: 'certificate-error', listener: (event: Event,
181                                               webContents: WebContents,
182                                               url: string,
183                                               /**
184                                                * The error code
185                                                */
186                                               error: string,
187                                               certificate: Certificate,
188                                               callback: (isTrusted: boolean) => void,
189                                               isMainFrame: boolean) => void): this;
190     removeListener(event: 'certificate-error', listener: (event: Event,
191                                               webContents: WebContents,
192                                               url: string,
193                                               /**
194                                                * The error code
195                                                */
196                                               error: string,
197                                               certificate: Certificate,
198                                               callback: (isTrusted: boolean) => void,
199                                               isMainFrame: boolean) => void): this;
200     /**
201      * Emitted when the child process unexpectedly disappears. This is normally because
202      * it was crashed or killed. It does not include renderer processes.
203      */
204     on(event: 'child-process-gone', listener: (event: Event,
205                                                details: Details) => void): this;
206     once(event: 'child-process-gone', listener: (event: Event,
207                                                details: Details) => void): this;
208     addListener(event: 'child-process-gone', listener: (event: Event,
209                                                details: Details) => void): this;
210     removeListener(event: 'child-process-gone', listener: (event: Event,
211                                                details: Details) => void): this;
212     /**
213      * Emitted during Handoff when an activity from a different device wants to be
214      * resumed. You should call `event.preventDefault()` if you want to handle this
215      * event.
216      *
217      * A user activity can be continued only in an app that has the same developer Team
218      * ID as the activity's source app and that supports the activity's type. Supported
219      * activity types are specified in the app's `Info.plist` under the
220      * `NSUserActivityTypes` key.
221      *
222      * @platform darwin
223      */
224     on(event: 'continue-activity', listener: (event: Event,
225                                               /**
226                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
227                                                */
228                                               type: string,
229                                               /**
230                                                * Contains app-specific state stored by the activity on another device.
231                                                */
232                                               userInfo: unknown,
233                                               details: ContinueActivityDetails) => void): this;
234     once(event: 'continue-activity', listener: (event: Event,
235                                               /**
236                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
237                                                */
238                                               type: string,
239                                               /**
240                                                * Contains app-specific state stored by the activity on another device.
241                                                */
242                                               userInfo: unknown,
243                                               details: ContinueActivityDetails) => void): this;
244     addListener(event: 'continue-activity', listener: (event: Event,
245                                               /**
246                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
247                                                */
248                                               type: string,
249                                               /**
250                                                * Contains app-specific state stored by the activity on another device.
251                                                */
252                                               userInfo: unknown,
253                                               details: ContinueActivityDetails) => void): this;
254     removeListener(event: 'continue-activity', listener: (event: Event,
255                                               /**
256                                                * A string identifying the activity. Maps to `NSUserActivity.activityType`.
257                                                */
258                                               type: string,
259                                               /**
260                                                * Contains app-specific state stored by the activity on another device.
261                                                */
262                                               userInfo: unknown,
263                                               details: ContinueActivityDetails) => void): this;
264     /**
265      * Emitted during Handoff when an activity from a different device fails to be
266      * resumed.
267      *
268      * @platform darwin
269      */
270     on(event: 'continue-activity-error', listener: (event: Event,
271                                                     /**
272                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
273                                                      */
274                                                     type: string,
275                                                     /**
276                                                      * A string with the error's localized description.
277                                                      */
278                                                     error: string) => void): this;
279     once(event: 'continue-activity-error', listener: (event: Event,
280                                                     /**
281                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
282                                                      */
283                                                     type: string,
284                                                     /**
285                                                      * A string with the error's localized description.
286                                                      */
287                                                     error: string) => void): this;
288     addListener(event: 'continue-activity-error', listener: (event: Event,
289                                                     /**
290                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
291                                                      */
292                                                     type: string,
293                                                     /**
294                                                      * A string with the error's localized description.
295                                                      */
296                                                     error: string) => void): this;
297     removeListener(event: 'continue-activity-error', listener: (event: Event,
298                                                     /**
299                                                      * A string identifying the activity. Maps to `NSUserActivity.activityType`.
300                                                      */
301                                                     type: string,
302                                                     /**
303                                                      * A string with the error's localized description.
304                                                      */
305                                                     error: string) => void): this;
306     /**
307      * Emitted when mac application become active. Difference from `activate` event is
308      * that `did-become-active` is emitted every time the app becomes active, not only
309      * when Dock icon is clicked or application is re-launched.
310      *
311      * @platform darwin
312      */
313     on(event: 'did-become-active', listener: (event: Event) => void): this;
314     once(event: 'did-become-active', listener: (event: Event) => void): this;
315     addListener(event: 'did-become-active', listener: (event: Event) => void): this;
316     removeListener(event: 'did-become-active', listener: (event: Event) => void): this;
317     /**
318      * Emitted whenever there is a GPU info update.
319      */
320     on(event: 'gpu-info-update', listener: Function): this;
321     once(event: 'gpu-info-update', listener: Function): this;
322     addListener(event: 'gpu-info-update', listener: Function): this;
323     removeListener(event: 'gpu-info-update', listener: Function): this;
324     /**
325      * Emitted when the GPU process crashes or is killed.
326      *
327      * **Deprecated:** This event is superceded by the `child-process-gone` event which
328      * contains more information about why the child process disappeared. It isn't
329      * always because it crashed. The `killed` boolean can be replaced by checking
330      * `reason === 'killed'` when you switch to that event.
331      *
332      * @deprecated
333      */
334     on(event: 'gpu-process-crashed', listener: (event: Event,
335                                                 killed: boolean) => void): this;
336     once(event: 'gpu-process-crashed', listener: (event: Event,
337                                                 killed: boolean) => void): this;
338     addListener(event: 'gpu-process-crashed', listener: (event: Event,
339                                                 killed: boolean) => void): this;
340     removeListener(event: 'gpu-process-crashed', listener: (event: Event,
341                                                 killed: boolean) => void): this;
342     /**
343      * Emitted when `webContents` wants to do basic auth.
344      *
345      * The default behavior is to cancel all authentications. To override this you
346      * should prevent the default behavior with `event.preventDefault()` and call
347      * `callback(username, password)` with the credentials.
348      *
349      * If `callback` is called without a username or password, the authentication
350      * request will be cancelled and the authentication error will be returned to the
351      * page.
352      */
353     on(event: 'login', listener: (event: Event,
354                                   webContents: WebContents,
355                                   authenticationResponseDetails: AuthenticationResponseDetails,
356                                   authInfo: AuthInfo,
357                                   callback: (username?: string, password?: string) => void) => void): this;
358     once(event: 'login', listener: (event: Event,
359                                   webContents: WebContents,
360                                   authenticationResponseDetails: AuthenticationResponseDetails,
361                                   authInfo: AuthInfo,
362                                   callback: (username?: string, password?: string) => void) => void): this;
363     addListener(event: 'login', listener: (event: Event,
364                                   webContents: WebContents,
365                                   authenticationResponseDetails: AuthenticationResponseDetails,
366                                   authInfo: AuthInfo,
367                                   callback: (username?: string, password?: string) => void) => void): this;
368     removeListener(event: 'login', listener: (event: Event,
369                                   webContents: WebContents,
370                                   authenticationResponseDetails: AuthenticationResponseDetails,
371                                   authInfo: AuthInfo,
372                                   callback: (username?: string, password?: string) => void) => void): this;
373     /**
374      * Emitted when the user clicks the native macOS new tab button. The new tab button
375      * is only visible if the current `BrowserWindow` has a `tabbingIdentifier`
376      *
377      * @platform darwin
378      */
379     on(event: 'new-window-for-tab', listener: (event: Event) => void): this;
380     once(event: 'new-window-for-tab', listener: (event: Event) => void): this;
381     addListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
382     removeListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
383     /**
384      * Emitted when the user wants to open a file with the application. The `open-file`
385      * event is usually emitted when the application is already open and the OS wants
386      * to reuse the application to open the file. `open-file` is also emitted when a
387      * file is dropped onto the dock and the application is not yet running. Make sure
388      * to listen for the `open-file` event very early in your application startup to
389      * handle this case (even before the `ready` event is emitted).
390      *
391      * You should call `event.preventDefault()` if you want to handle this event.
392      *
393      * On Windows, you have to parse `process.argv` (in the main process) to get the
394      * filepath.
395      *
396      * @platform darwin
397      */
398     on(event: 'open-file', listener: (event: Event,
399                                       path: string) => void): this;
400     once(event: 'open-file', listener: (event: Event,
401                                       path: string) => void): this;
402     addListener(event: 'open-file', listener: (event: Event,
403                                       path: string) => void): this;
404     removeListener(event: 'open-file', listener: (event: Event,
405                                       path: string) => void): this;
406     /**
407      * Emitted when the user wants to open a URL with the application. Your
408      * application's `Info.plist` file must define the URL scheme within the
409      * `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`.
410      *
411      * You should call `event.preventDefault()` if you want to handle this event.
412      *
413      * As with the `open-file` event, be sure to register a listener for the `open-url`
414      * event early in your application startup to detect if the the application being
415      * is being opened to handle a URL. If you register the listener in response to a
416      * `ready` event, you'll miss URLs that trigger the launch of your application.
417      *
418      * @platform darwin
419      */
420     on(event: 'open-url', listener: (event: Event,
421                                      url: string) => void): this;
422     once(event: 'open-url', listener: (event: Event,
423                                      url: string) => void): this;
424     addListener(event: 'open-url', listener: (event: Event,
425                                      url: string) => void): this;
426     removeListener(event: 'open-url', listener: (event: Event,
427                                      url: string) => void): this;
428     /**
429      * Emitted when the application is quitting.
430      *
431      * **Note:** On Windows, this event will not be emitted if the app is closed due to
432      * a shutdown/restart of the system or a user logout.
433      */
434     on(event: 'quit', listener: (event: Event,
435                                  exitCode: number) => void): this;
436     once(event: 'quit', listener: (event: Event,
437                                  exitCode: number) => void): this;
438     addListener(event: 'quit', listener: (event: Event,
439                                  exitCode: number) => void): this;
440     removeListener(event: 'quit', listener: (event: Event,
441                                  exitCode: number) => void): this;
442     /**
443      * Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
444      * holds the `userInfo` of the `NSUserNotification` or information from
445      * `UNNotificationResponse` that was used to open the application, if it was
446      * launched from Notification Center. You can also call `app.isReady()` to check if
447      * this event has already fired and `app.whenReady()` to get a Promise that is
448      * fulfilled when Electron is initialized.
449      */
450     on(event: 'ready', listener: (event: Event,
451                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
452     once(event: 'ready', listener: (event: Event,
453                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
454     addListener(event: 'ready', listener: (event: Event,
455                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
456     removeListener(event: 'ready', listener: (event: Event,
457                                   launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
458     /**
459      * Emitted when the renderer process unexpectedly disappears.  This is normally
460      * because it was crashed or killed.
461      */
462     on(event: 'render-process-gone', listener: (event: Event,
463                                                 webContents: WebContents,
464                                                 details: RenderProcessGoneDetails) => void): this;
465     once(event: 'render-process-gone', listener: (event: Event,
466                                                 webContents: WebContents,
467                                                 details: RenderProcessGoneDetails) => void): this;
468     addListener(event: 'render-process-gone', listener: (event: Event,
469                                                 webContents: WebContents,
470                                                 details: RenderProcessGoneDetails) => void): this;
471     removeListener(event: 'render-process-gone', listener: (event: Event,
472                                                 webContents: WebContents,
473                                                 details: RenderProcessGoneDetails) => void): this;
474     /**
475      * Emitted when the renderer process of `webContents` crashes or is killed.
476      *
477      * **Deprecated:** This event is superceded by the `render-process-gone` event
478      * which contains more information about why the render process disappeared. It
479      * isn't always because it crashed.  The `killed` boolean can be replaced by
480      * checking `reason === 'killed'` when you switch to that event.
481      *
482      * @deprecated
483      */
484     on(event: 'renderer-process-crashed', listener: (event: Event,
485                                                      webContents: WebContents,
486                                                      killed: boolean) => void): this;
487     once(event: 'renderer-process-crashed', listener: (event: Event,
488                                                      webContents: WebContents,
489                                                      killed: boolean) => void): this;
490     addListener(event: 'renderer-process-crashed', listener: (event: Event,
491                                                      webContents: WebContents,
492                                                      killed: boolean) => void): this;
493     removeListener(event: 'renderer-process-crashed', listener: (event: Event,
494                                                      webContents: WebContents,
495                                                      killed: boolean) => void): this;
496     /**
497      * This event will be emitted inside the primary instance of your application when
498      * a second instance has been executed and calls `app.requestSingleInstanceLock()`.
499      *
500      * `argv` is an Array of the second instance's command line arguments, and
501      * `workingDirectory` is its current working directory. Usually applications
502      * respond to this by making their primary window focused and non-minimized.
503      *
504      * **Note:** If the second instance is started by a different user than the first,
505      * the `argv` array will not include the arguments.
506      *
507      * This event is guaranteed to be emitted after the `ready` event of `app` gets
508      * emitted.
509      *
510      * **Note:** Extra command line arguments might be added by Chromium, such as
511      * `--original-process-start-time`.
512      */
513     on(event: 'second-instance', listener: (event: Event,
514                                             /**
515                                              * An array of the second instance's command line arguments
516                                              */
517                                             argv: string[],
518                                             /**
519                                              * The second instance's working directory
520                                              */
521                                             workingDirectory: string,
522                                             /**
523                                              * A JSON object of additional data passed from the second instance
524                                              */
525                                             additionalData: unknown) => void): this;
526     once(event: 'second-instance', listener: (event: Event,
527                                             /**
528                                              * An array of the second instance's command line arguments
529                                              */
530                                             argv: string[],
531                                             /**
532                                              * The second instance's working directory
533                                              */
534                                             workingDirectory: string,
535                                             /**
536                                              * A JSON object of additional data passed from the second instance
537                                              */
538                                             additionalData: unknown) => void): this;
539     addListener(event: 'second-instance', listener: (event: Event,
540                                             /**
541                                              * An array of the second instance's command line arguments
542                                              */
543                                             argv: string[],
544                                             /**
545                                              * The second instance's working directory
546                                              */
547                                             workingDirectory: string,
548                                             /**
549                                              * A JSON object of additional data passed from the second instance
550                                              */
551                                             additionalData: unknown) => void): this;
552     removeListener(event: 'second-instance', listener: (event: Event,
553                                             /**
554                                              * An array of the second instance's command line arguments
555                                              */
556                                             argv: string[],
557                                             /**
558                                              * The second instance's working directory
559                                              */
560                                             workingDirectory: string,
561                                             /**
562                                              * A JSON object of additional data passed from the second instance
563                                              */
564                                             additionalData: unknown) => void): this;
565     /**
566      * Emitted when a client certificate is requested.
567      *
568      * The `url` corresponds to the navigation entry requesting the client certificate
569      * and `callback` can be called with an entry filtered from the list. Using
570      * `event.preventDefault()` prevents the application from using the first
571      * certificate from the store.
572      */
573     on(event: 'select-client-certificate', listener: (event: Event,
574                                                       webContents: WebContents,
575                                                       url: string,
576                                                       certificateList: Certificate[],
577                                                       callback: (certificate?: Certificate) => void) => void): this;
578     once(event: 'select-client-certificate', listener: (event: Event,
579                                                       webContents: WebContents,
580                                                       url: string,
581                                                       certificateList: Certificate[],
582                                                       callback: (certificate?: Certificate) => void) => void): this;
583     addListener(event: 'select-client-certificate', listener: (event: Event,
584                                                       webContents: WebContents,
585                                                       url: string,
586                                                       certificateList: Certificate[],
587                                                       callback: (certificate?: Certificate) => void) => void): this;
588     removeListener(event: 'select-client-certificate', listener: (event: Event,
589                                                       webContents: WebContents,
590                                                       url: string,
591                                                       certificateList: Certificate[],
592                                                       callback: (certificate?: Certificate) => void) => void): this;
593     /**
594      * Emitted when Electron has created a new `session`.
595      */
596     on(event: 'session-created', listener: (session: Session) => void): this;
597     once(event: 'session-created', listener: (session: Session) => void): this;
598     addListener(event: 'session-created', listener: (session: Session) => void): this;
599     removeListener(event: 'session-created', listener: (session: Session) => void): this;
600     /**
601      * Emitted when Handoff is about to be resumed on another device. If you need to
602      * update the state to be transferred, you should call `event.preventDefault()`
603      * immediately, construct a new `userInfo` dictionary and call
604      * `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will
605      * fail and `continue-activity-error` will be called.
606      *
607      * @platform darwin
608      */
609     on(event: 'update-activity-state', listener: (event: Event,
610                                                   /**
611                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
612                                                    */
613                                                   type: string,
614                                                   /**
615                                                    * Contains app-specific state stored by the activity.
616                                                    */
617                                                   userInfo: unknown) => void): this;
618     once(event: 'update-activity-state', listener: (event: Event,
619                                                   /**
620                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
621                                                    */
622                                                   type: string,
623                                                   /**
624                                                    * Contains app-specific state stored by the activity.
625                                                    */
626                                                   userInfo: unknown) => void): this;
627     addListener(event: 'update-activity-state', listener: (event: Event,
628                                                   /**
629                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
630                                                    */
631                                                   type: string,
632                                                   /**
633                                                    * Contains app-specific state stored by the activity.
634                                                    */
635                                                   userInfo: unknown) => void): this;
636     removeListener(event: 'update-activity-state', listener: (event: Event,
637                                                   /**
638                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
639                                                    */
640                                                   type: string,
641                                                   /**
642                                                    * Contains app-specific state stored by the activity.
643                                                    */
644                                                   userInfo: unknown) => void): this;
645     /**
646      * Emitted when a new webContents is created.
647      */
648     on(event: 'web-contents-created', listener: (event: Event,
649                                                  webContents: WebContents) => void): this;
650     once(event: 'web-contents-created', listener: (event: Event,
651                                                  webContents: WebContents) => void): this;
652     addListener(event: 'web-contents-created', listener: (event: Event,
653                                                  webContents: WebContents) => void): this;
654     removeListener(event: 'web-contents-created', listener: (event: Event,
655                                                  webContents: WebContents) => void): this;
656     /**
657      * Emitted during Handoff before an activity from a different device wants to be
658      * resumed. You should call `event.preventDefault()` if you want to handle this
659      * event.
660      *
661      * @platform darwin
662      */
663     on(event: 'will-continue-activity', listener: (event: Event,
664                                                    /**
665                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
666                                                     */
667                                                    type: string) => void): this;
668     once(event: 'will-continue-activity', listener: (event: Event,
669                                                    /**
670                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
671                                                     */
672                                                    type: string) => void): this;
673     addListener(event: 'will-continue-activity', listener: (event: Event,
674                                                    /**
675                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
676                                                     */
677                                                    type: string) => void): this;
678     removeListener(event: 'will-continue-activity', listener: (event: Event,
679                                                    /**
680                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
681                                                     */
682                                                    type: string) => void): this;
683     /**
684      * Emitted when the application has finished basic startup. On Windows and Linux,
685      * the `will-finish-launching` event is the same as the `ready` event; on macOS,
686      * this event represents the `applicationWillFinishLaunching` notification of
687      * `NSApplication`. You would usually set up listeners for the `open-file` and
688      * `open-url` events here, and start the crash reporter and auto updater.
689      *
690      * In most cases, you should do everything in the `ready` event handler.
691      */
692     on(event: 'will-finish-launching', listener: Function): this;
693     once(event: 'will-finish-launching', listener: Function): this;
694     addListener(event: 'will-finish-launching', listener: Function): this;
695     removeListener(event: 'will-finish-launching', listener: Function): this;
696     /**
697      * Emitted when all windows have been closed and the application will quit. Calling
698      * `event.preventDefault()` will prevent the default behavior, which is terminating
699      * the application.
700      *
701      * See the description of the `window-all-closed` event for the differences between
702      * the `will-quit` and `window-all-closed` events.
703      *
704      * **Note:** On Windows, this event will not be emitted if the app is closed due to
705      * a shutdown/restart of the system or a user logout.
706      */
707     on(event: 'will-quit', listener: (event: Event) => void): this;
708     once(event: 'will-quit', listener: (event: Event) => void): this;
709     addListener(event: 'will-quit', listener: (event: Event) => void): this;
710     removeListener(event: 'will-quit', listener: (event: Event) => void): this;
711     /**
712      * Emitted when all windows have been closed.
713      *
714      * If you do not subscribe to this event and all windows are closed, the default
715      * behavior is to quit the app; however, if you subscribe, you control whether the
716      * app quits or not. If the user pressed `Cmd + Q`, or the developer called
717      * `app.quit()`, Electron will first try to close all the windows and then emit the
718      * `will-quit` event, and in this case the `window-all-closed` event would not be
719      * emitted.
720      */
721     on(event: 'window-all-closed', listener: Function): this;
722     once(event: 'window-all-closed', listener: Function): this;
723     addListener(event: 'window-all-closed', listener: Function): this;
724     removeListener(event: 'window-all-closed', listener: Function): this;
725     /**
726      * Adds `path` to the recent documents list.
727      *
728      * This list is managed by the OS. On Windows, you can visit the list from the task
729      * bar, and on macOS, you can visit it from dock menu.
730      *
731      * @platform darwin,win32
732      */
733     addRecentDocument(path: string): void;
734     /**
735      * Clears the recent documents list.
736      *
737      * @platform darwin,win32
738      */
739     clearRecentDocuments(): void;
740     /**
741      * Configures host resolution (DNS and DNS-over-HTTPS). By default, the following
742      * resolvers will be used, in order:
743      *
744      * * DNS-over-HTTPS, if the DNS provider supports it, then
745      * * the built-in resolver (enabled on macOS only by default), then
746      * * the system's resolver (e.g. `getaddrinfo`).
747      *
748      * This can be configured to either restrict usage of non-encrypted DNS
749      * (`secureDnsMode: "secure"`), or disable DNS-over-HTTPS (`secureDnsMode: "off"`).
750      * It is also possible to enable or disable the built-in resolver.
751      *
752      * To disable insecure DNS, you can specify a `secureDnsMode` of `"secure"`. If you
753      * do so, you should make sure to provide a list of DNS-over-HTTPS servers to use,
754      * in case the user's DNS configuration does not include a provider that supports
755      * DoH.
756      *
757      * This API must be called after the `ready` event is emitted.
758      */
759     configureHostResolver(options: ConfigureHostResolverOptions): void;
760     /**
761      * By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain
762      * basis if the GPU processes crashes too frequently. This function disables that
763      * behavior.
764      *
765      * This method can only be called before app is ready.
766      */
767     disableDomainBlockingFor3DAPIs(): void;
768     /**
769      * Disables hardware acceleration for current app.
770      *
771      * This method can only be called before app is ready.
772      */
773     disableHardwareAcceleration(): void;
774     /**
775      * Enables full sandbox mode on the app. This means that all renderers will be
776      * launched sandboxed, regardless of the value of the `sandbox` flag in
777      * WebPreferences.
778      *
779      * This method can only be called before app is ready.
780      */
781     enableSandbox(): void;
782     /**
783      * Exits immediately with `exitCode`. `exitCode` defaults to 0.
784      *
785      * All windows will be closed immediately without asking the user, and the
786      * `before-quit` and `will-quit` events will not be emitted.
787      */
788     exit(exitCode?: number): void;
789     /**
790      * On Linux, focuses on the first visible window. On macOS, makes the application
791      * the active app. On Windows, focuses on the application's first window.
792      *
793      * You should seek to use the `steal` option as sparingly as possible.
794      */
795     focus(options?: FocusOptions): void;
796     /**
797      * Resolve with an object containing the following:
798      *
799      * * `icon` NativeImage - the display icon of the app handling the protocol.
800      * * `path` string  - installation path of the app handling the protocol.
801      * * `name` string - display name of the app handling the protocol.
802      *
803      * This method returns a promise that contains the application name, icon and path
804      * of the default handler for the protocol (aka URI scheme) of a URL.
805      *
806      * @platform darwin,win32
807      */
808     getApplicationInfoForProtocol(url: string): Promise<Electron.ApplicationInfoForProtocolReturnValue>;
809     /**
810      * Name of the application handling the protocol, or an empty string if there is no
811      * handler. For instance, if Electron is the default handler of the URL, this could
812      * be `Electron` on Windows and Mac. However, don't rely on the precise format
813      * which is not guaranteed to remain unchanged. Expect a different format on Linux,
814      * possibly with a `.desktop` suffix.
815      *
816      * This method returns the application name of the default handler for the protocol
817      * (aka URI scheme) of a URL.
818      */
819     getApplicationNameForProtocol(url: string): string;
820     /**
821      * Array of `ProcessMetric` objects that correspond to memory and CPU usage
822      * statistics of all the processes associated with the app.
823      */
824     getAppMetrics(): ProcessMetric[];
825     /**
826      * The current application directory.
827      */
828     getAppPath(): string;
829     /**
830      * The current value displayed in the counter badge.
831      *
832      * @platform linux,darwin
833      */
834     getBadgeCount(): number;
835     /**
836      * The type of the currently running activity.
837      *
838      * @platform darwin
839      */
840     getCurrentActivityType(): string;
841     /**
842      * fulfilled with the app's icon, which is a NativeImage.
843      *
844      * Fetches a path's associated icon.
845      *
846      * On _Windows_, there a 2 kinds of icons:
847      *
848      * * Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
849      * * Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
850      *
851      * On _Linux_ and _macOS_, icons depend on the application associated with file
852      * mime type.
853      */
854     getFileIcon(path: string, options?: FileIconOptions): Promise<Electron.NativeImage>;
855     /**
856      * The Graphics Feature Status from `chrome://gpu/`.
857      *
858      * **Note:** This information is only usable after the `gpu-info-update` event is
859      * emitted.
860      */
861     getGPUFeatureStatus(): GPUFeatureStatus;
862     /**
863      * For `infoType` equal to `complete`: Promise is fulfilled with `Object`
864      * containing all the GPU Information as in chromium's GPUInfo object. This
865      * includes the version and driver information that's shown on `chrome://gpu` page.
866      *
867      * For `infoType` equal to `basic`: Promise is fulfilled with `Object` containing
868      * fewer attributes than when requested with `complete`. Here's an example of basic
869      * response:
870      *
871      * Using `basic` should be preferred if only basic information like `vendorId` or
872      * `deviceId` is needed.
873      */
874     getGPUInfo(infoType: 'basic' | 'complete'): Promise<unknown>;
875     /**
876      * * `minItems` Integer - The minimum number of items that will be shown in the
877      * Jump List (for a more detailed description of this value see the MSDN docs).
878      * * `removedItems` JumpListItem[] - Array of `JumpListItem` objects that
879      * correspond to items that the user has explicitly removed from custom categories
880      * in the Jump List. These items must not be re-added to the Jump List in the
881      * **next** call to `app.setJumpList()`, Windows will not display any custom
882      * category that contains any of the removed items.
883      *
884      * @platform win32
885      */
886     getJumpListSettings(): JumpListSettings;
887     /**
888      * The current application locale, fetched using Chromium's `l10n_util` library.
889      * Possible return values are documented here.
890      *
891      * To set the locale, you'll want to use a command line switch at app startup,
892      * which may be found here.
893      *
894      * **Note:** When distributing your packaged app, you have to also ship the
895      * `locales` folder.
896      *
897      * **Note:** This API must be called after the `ready` event is emitted.
898      *
899      * **Note:** To see example return values of this API compared to other locale and
900      * language APIs, see `app.getPreferredSystemLanguages()`.
901      */
902     getLocale(): string;
903     /**
904      * User operating system's locale two-letter ISO 3166 country code. The value is
905      * taken from native OS APIs.
906      *
907      * **Note:** When unable to detect locale country code, it returns empty string.
908      */
909     getLocaleCountryCode(): string;
910     /**
911      * If you provided `path` and `args` options to `app.setLoginItemSettings`, then
912      * you need to pass the same arguments here for `openAtLogin` to be set correctly.
913      *
914      *
915      * * `openAtLogin` boolean - `true` if the app is set to open at login.
916      * * `openAsHidden` boolean _macOS_ - `true` if the app is set to open as hidden at
917      * login. This setting is not available on MAS builds.
918      * * `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
919      * automatically. This setting is not available on MAS builds.
920      * * `wasOpenedAsHidden` boolean _macOS_ - `true` if the app was opened as a hidden
921      * login item. This indicates that the app should not open any windows at startup.
922      * This setting is not available on MAS builds.
923      * * `restoreState` boolean _macOS_ - `true` if the app was opened as a login item
924      * that should restore the state from the previous session. This indicates that the
925      * app should restore the windows that were open the last time the app was closed.
926      * This setting is not available on MAS builds.
927      * * `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open
928      * at login and its run key is not deactivated. This differs from `openAtLogin` as
929      * it ignores the `args` option, this property will be true if the given executable
930      * would be launched at login with **any** arguments.
931      * * `launchItems` Object[] _Windows_
932      *   * `name` string _Windows_ - name value of a registry entry.
933      *   * `path` string _Windows_ - The executable to an app that corresponds to a
934      * registry entry.
935      *   * `args` string[] _Windows_ - the command-line arguments to pass to the
936      * executable.
937      *   * `scope` string _Windows_ - one of `user` or `machine`. Indicates whether the
938      * registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
939      *   * `enabled` boolean _Windows_ - `true` if the app registry key is startup
940      * approved and therefore shows as `enabled` in Task Manager and Windows settings.
941      *
942      * @platform darwin,win32
943      */
944     getLoginItemSettings(options?: LoginItemSettingsOptions): LoginItemSettings;
945     /**
946      * The current application's name, which is the name in the application's
947      * `package.json` file.
948      *
949      * Usually the `name` field of `package.json` is a short lowercase name, according
950      * to the npm modules spec. You should usually also specify a `productName` field,
951      * which is your application's full capitalized name, and which will be preferred
952      * over `name` by Electron.
953      */
954     getName(): string;
955     /**
956      * A path to a special directory or file associated with `name`. On failure, an
957      * `Error` is thrown.
958      *
959      * If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being
960      * called first, a default log directory will be created equivalent to calling
961      * `app.setAppLogsPath()` without a `path` parameter.
962      */
963     getPath(name: 'home' | 'appData' | 'userData' | 'sessionData' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'recent' | 'logs' | 'crashDumps'): string;
964     /**
965      * The user's preferred system languages from most preferred to least preferred,
966      * including the country codes if applicable. A user can modify and add to this
967      * list on Windows or macOS through the Language and Region settings.
968      *
969      * The API uses `GlobalizationPreferences` (with a fallback to
970      * `GetSystemPreferredUILanguages`) on Windows, `\[NSLocale preferredLanguages\]`
971      * on macOS, and `g_get_language_names` on Linux.
972      *
973      * This API can be used for purposes such as deciding what language to present the
974      * application in.
975      *
976      * Here are some examples of return values of the various language and locale APIs
977      * with different configurations:
978      *
979      * * For Windows, where the application locale is German, the regional format is
980      * Finnish (Finland), and the preferred system languages from most to least
981      * preferred are French (Canada), English (US), Simplified Chinese (China),
982      * Finnish, and Spanish (Latin America):
983      *   * `app.getLocale()` returns `'de'`
984      *   * `app.getSystemLocale()` returns `'fi-FI'`
985      *   * `app.getPreferredSystemLanguages()` returns `['fr-CA', 'en-US',
986      * 'zh-Hans-CN', 'fi', 'es-419']`
987      * * On macOS, where the application locale is German, the region is Finland, and
988      * the preferred system languages from most to least preferred are French (Canada),
989      * English (US), Simplified Chinese, and Spanish (Latin America):
990      *   * `app.getLocale()` returns `'de'`
991      *   * `app.getSystemLocale()` returns `'fr-FI'`
992      *   * `app.getPreferredSystemLanguages()` returns `['fr-CA', 'en-US',
993      * 'zh-Hans-FI', 'es-419']`
994      *
995      * Both the available languages and regions and the possible return values differ
996      * between the two operating systems.
997      *
998      * As can be seen with the example above, on Windows, it is possible that a
999      * preferred system language has no country code, and that one of the preferred
1000      * system languages corresponds with the language used for the regional format. On
1001      * macOS, the region serves more as a default country code: the user doesn't need
1002      * to have Finnish as a preferred language to use Finland as the region,and the
1003      * country code `FI` is used as the country code for preferred system languages
1004      * that do not have associated countries in the language name.
1005      */
1006     getPreferredSystemLanguages(): Array<'app.getLocale()' | 'app.getSystemLocale()' | 'app.getPreferredSystemLanguages()' | 'app.getLocale()' | 'app.getSystemLocale()' | 'app.getPreferredSystemLanguages()'>;
1007     /**
1008      * The current system locale. On Windows and Linux, it is fetched using Chromium's
1009      * `i18n` library. On macOS, `[NSLocale currentLocale]` is used instead. To get the
1010      * user's current system language, which is not always the same as the locale, it
1011      * is better to use `app.getPreferredSystemLanguages()`.
1012      *
1013      * Different operating systems also use the regional data differently:
1014      *
1015      * * Windows 11 uses the regional format for numbers, dates, and times.
1016      * * macOS Monterey uses the region for formatting numbers, dates, times, and for
1017      * selecting the currency symbol to use.
1018      *
1019      * Therefore, this API can be used for purposes such as choosing a format for
1020      * rendering dates and times in a calendar app, especially when the developer wants
1021      * the format to be consistent with the OS.
1022      *
1023      * **Note:** This API must be called after the `ready` event is emitted.
1024      *
1025      * **Note:** To see example return values of this API compared to other locale and
1026      * language APIs, see `app.getPreferredSystemLanguages()`.
1027      */
1028     getSystemLocale(): string;
1029     /**
1030      * The version of the loaded application. If no version is found in the
1031      * application's `package.json` file, the version of the current bundle or
1032      * executable is returned.
1033      */
1034     getVersion(): string;
1035     /**
1036      * This method returns whether or not this instance of your app is currently
1037      * holding the single instance lock.  You can request the lock with
1038      * `app.requestSingleInstanceLock()` and release with
1039      * `app.releaseSingleInstanceLock()`
1040      */
1041     hasSingleInstanceLock(): boolean;
1042     /**
1043      * Hides all application windows without minimizing them.
1044      *
1045      * @platform darwin
1046      */
1047     hide(): void;
1048     /**
1049      * Imports the certificate in pkcs12 format into the platform certificate store.
1050      * `callback` is called with the `result` of import operation, a value of `0`
1051      * indicates success while any other value indicates failure according to Chromium
1052      * net_error_list.
1053      *
1054      * @platform linux
1055      */
1056     importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void;
1057     /**
1058      * Invalidates the current Handoff user activity.
1059      *
1060      * @platform darwin
1061      */
1062     invalidateCurrentActivity(): void;
1063     /**
1064      * `true` if Chrome's accessibility support is enabled, `false` otherwise. This API
1065      * will return `true` if the use of assistive technologies, such as screen readers,
1066      * has been detected. See
1067      * https://www.chromium.org/developers/design-documents/accessibility for more
1068      * details.
1069      *
1070      * @platform darwin,win32
1071      */
1072     isAccessibilitySupportEnabled(): boolean;
1073     /**
1074      * Whether the current executable is the default handler for a protocol (aka URI
1075      * scheme).
1076      *
1077      * **Note:** On macOS, you can use this method to check if the app has been
1078      * registered as the default protocol handler for a protocol. You can also verify
1079      * this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
1080      * macOS machine. Please refer to Apple's documentation for details.
1081      *
1082      * The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme`
1083      * internally.
1084      */
1085     isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1086     /**
1087      * whether or not the current OS version allows for native emoji pickers.
1088      */
1089     isEmojiPanelSupported(): boolean;
1090     /**
1091      * `true` if the application—including all of its windows—is hidden (e.g. with
1092      * `Command-H`), `false` otherwise.
1093      *
1094      * @platform darwin
1095      */
1096     isHidden(): boolean;
1097     /**
1098      * Whether the application is currently running from the systems Application
1099      * folder. Use in combination with `app.moveToApplicationsFolder()`
1100      *
1101      * @platform darwin
1102      */
1103     isInApplicationsFolder(): boolean;
1104     /**
1105      * `true` if Electron has finished initializing, `false` otherwise. See also
1106      * `app.whenReady()`.
1107      */
1108     isReady(): boolean;
1109     /**
1110      * whether `Secure Keyboard Entry` is enabled.
1111      *
1112      * By default this API will return `false`.
1113      *
1114      * @platform darwin
1115      */
1116     isSecureKeyboardEntryEnabled(): boolean;
1117     /**
1118      * Whether the current desktop environment is Unity launcher.
1119      *
1120      * @platform linux
1121      */
1122     isUnityRunning(): boolean;
1123     /**
1124      * Whether the move was successful. Please note that if the move is successful,
1125      * your application will quit and relaunch.
1126      *
1127      * No confirmation dialog will be presented by default. If you wish to allow the
1128      * user to confirm the operation, you may do so using the `dialog` API.
1129      *
1130      * **NOTE:** This method throws errors if anything other than the user causes the
1131      * move to fail. For instance if the user cancels the authorization dialog, this
1132      * method returns false. If we fail to perform the copy, then this method will
1133      * throw an error. The message in the error should be informative and tell you
1134      * exactly what went wrong.
1135      *
1136      * By default, if an app of the same name as the one being moved exists in the
1137      * Applications directory and is _not_ running, the existing app will be trashed
1138      * and the active app moved into its place. If it _is_ running, the preexisting
1139      * running app will assume focus and the previously active app will quit itself.
1140      * This behavior can be changed by providing the optional conflict handler, where
1141      * the boolean returned by the handler determines whether or not the move conflict
1142      * is resolved with default behavior.  i.e. returning `false` will ensure no
1143      * further action is taken, returning `true` will result in the default behavior
1144      * and the method continuing.
1145      *
1146      * For example:
1147      *
1148      * Would mean that if an app already exists in the user directory, if the user
1149      * chooses to 'Continue Move' then the function would continue with its default
1150      * behavior and the existing app will be trashed and the active app moved into its
1151      * place.
1152      *
1153      * @platform darwin
1154      */
1155     moveToApplicationsFolder(options?: MoveToApplicationsFolderOptions): boolean;
1156     /**
1157      * Try to close all windows. The `before-quit` event will be emitted first. If all
1158      * windows are successfully closed, the `will-quit` event will be emitted and by
1159      * default the application will terminate.
1160      *
1161      * This method guarantees that all `beforeunload` and `unload` event handlers are
1162      * correctly executed. It is possible that a window cancels the quitting by
1163      * returning `false` in the `beforeunload` event handler.
1164      */
1165     quit(): void;
1166     /**
1167      * Relaunches the app when current instance exits.
1168      *
1169      * By default, the new instance will use the same working directory and command
1170      * line arguments with current instance. When `args` is specified, the `args` will
1171      * be passed as command line arguments instead. When `execPath` is specified, the
1172      * `execPath` will be executed for relaunch instead of current app.
1173      *
1174      * Note that this method does not quit the app when executed, you have to call
1175      * `app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.
1176      *
1177      * When `app.relaunch` is called for multiple times, multiple instances will be
1178      * started after current instance exited.
1179      *
1180      * An example of restarting current instance immediately and adding a new command
1181      * line argument to the new instance:
1182      */
1183     relaunch(options?: RelaunchOptions): void;
1184     /**
1185      * Releases all locks that were created by `requestSingleInstanceLock`. This will
1186      * allow multiple instances of the application to once again run side by side.
1187      */
1188     releaseSingleInstanceLock(): void;
1189     /**
1190      * Whether the call succeeded.
1191      *
1192      * This method checks if the current executable as the default handler for a
1193      * protocol (aka URI scheme). If so, it will remove the app as the default handler.
1194      *
1195      * @platform darwin,win32
1196      */
1197     removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1198     /**
1199      * The return value of this method indicates whether or not this instance of your
1200      * application successfully obtained the lock.  If it failed to obtain the lock,
1201      * you can assume that another instance of your application is already running with
1202      * the lock and exit immediately.
1203      *
1204      * I.e. This method returns `true` if your process is the primary instance of your
1205      * application and your app should continue loading.  It returns `false` if your
1206      * process should immediately quit as it has sent its parameters to another
1207      * instance that has already acquired the lock.
1208      *
1209      * On macOS, the system enforces single instance automatically when users try to
1210      * open a second instance of your app in Finder, and the `open-file` and `open-url`
1211      * events will be emitted for that. However when users start your app in command
1212      * line, the system's single instance mechanism will be bypassed, and you have to
1213      * use this method to ensure single instance.
1214      *
1215      * An example of activating the window of primary instance when a second instance
1216      * starts:
1217      */
1218     requestSingleInstanceLock(additionalData?: Record<any, any>): boolean;
1219     /**
1220      * Marks the current Handoff user activity as inactive without invalidating it.
1221      *
1222      * @platform darwin
1223      */
1224     resignCurrentActivity(): void;
1225     /**
1226      * Set the about panel options. This will override the values defined in the app's
1227      * `.plist` file on macOS. See the Apple docs for more details. On Linux, values
1228      * must be set in order to be shown; there are no defaults.
1229      *
1230      * If you do not set `credits` but still wish to surface them in your app, AppKit
1231      * will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in
1232      * that order, in the bundle returned by the NSBundle class method main. The first
1233      * file found is used, and if none is found, the info area is left blank. See Apple
1234      * documentation for more information.
1235      */
1236     setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
1237     /**
1238      * Manually enables Chrome's accessibility support, allowing to expose
1239      * accessibility switch to users in application settings. See Chromium's
1240      * accessibility docs for more details. Disabled by default.
1241      *
1242      * This API must be called after the `ready` event is emitted.
1243      *
1244      * **Note:** Rendering accessibility tree can significantly affect the performance
1245      * of your app. It should not be enabled by default.
1246      *
1247      * @platform darwin,win32
1248      */
1249     setAccessibilitySupportEnabled(enabled: boolean): void;
1250     /**
1251      * Sets the activation policy for a given app.
1252      *
1253      * Activation policy types:
1254      *
1255      * * 'regular' - The application is an ordinary app that appears in the Dock and
1256      * may have a user interface.
1257      * * 'accessory' - The application doesn’t appear in the Dock and doesn’t have a
1258      * menu bar, but it may be activated programmatically or by clicking on one of its
1259      * windows.
1260      * * 'prohibited' - The application doesn’t appear in the Dock and may not create
1261      * windows or be activated.
1262      *
1263      * @platform darwin
1264      */
1265     setActivationPolicy(policy: 'regular' | 'accessory' | 'prohibited'): void;
1266     /**
1267      * Sets or creates a directory your app's logs which can then be manipulated with
1268      * `app.getPath()` or `app.setPath(pathName, newPath)`.
1269      *
1270      * Calling `app.setAppLogsPath()` without a `path` parameter will result in this
1271      * directory being set to `~/Library/Logs/YourAppName` on _macOS_, and inside the
1272      * `userData` directory on _Linux_ and _Windows_.
1273      */
1274     setAppLogsPath(path?: string): void;
1275     /**
1276      * Changes the Application User Model ID to `id`.
1277      *
1278      * @platform win32
1279      */
1280     setAppUserModelId(id: string): void;
1281     /**
1282      * Whether the call succeeded.
1283      *
1284      * Sets the current executable as the default handler for a protocol (aka URI
1285      * scheme). It allows you to integrate your app deeper into the operating system.
1286      * Once registered, all links with `your-protocol://` will be opened with the
1287      * current executable. The whole link, including protocol, will be passed to your
1288      * application as a parameter.
1289      *
1290      * **Note:** On macOS, you can only register protocols that have been added to your
1291      * app's `info.plist`, which cannot be modified at runtime. However, you can change
1292      * the file during build time via Electron Forge, Electron Packager, or by editing
1293      * `info.plist` with a text editor. Please refer to Apple's documentation for
1294      * details.
1295      *
1296      * **Note:** In a Windows Store environment (when packaged as an `appx`) this API
1297      * will return `true` for all calls but the registry key it sets won't be
1298      * accessible by other applications.  In order to register your Windows Store
1299      * application as a default protocol handler you must declare the protocol in your
1300      * manifest.
1301      *
1302      * The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme`
1303      * internally.
1304      */
1305     setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1306     /**
1307      * Whether the call succeeded.
1308      *
1309      * Sets the counter badge for current app. Setting the count to `0` will hide the
1310      * badge.
1311      *
1312      * On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
1313      *
1314      * **Note:** Unity launcher requires a `.desktop` file to work. For more
1315      * information, please read the Unity integration documentation.
1316      *
1317      * @platform linux,darwin
1318      */
1319     setBadgeCount(count?: number): boolean;
1320     /**
1321      * Sets or removes a custom Jump List for the application, and returns one of the
1322      * following strings:
1323      *
1324      * * `ok` - Nothing went wrong.
1325      * * `error` - One or more errors occurred, enable runtime logging to figure out
1326      * the likely cause.
1327      * * `invalidSeparatorError` - An attempt was made to add a separator to a custom
1328      * category in the Jump List. Separators are only allowed in the standard `Tasks`
1329      * category.
1330      * * `fileTypeRegistrationError` - An attempt was made to add a file link to the
1331      * Jump List for a file type the app isn't registered to handle.
1332      * * `customCategoryAccessDeniedError` - Custom categories can't be added to the
1333      * Jump List due to user privacy or group policy settings.
1334      *
1335      * If `categories` is `null` the previously set custom Jump List (if any) will be
1336      * replaced by the standard Jump List for the app (managed by Windows).
1337      *
1338      * **Note:** If a `JumpListCategory` object has neither the `type` nor the `name`
1339      * property set then its `type` is assumed to be `tasks`. If the `name` property is
1340      * set but the `type` property is omitted then the `type` is assumed to be
1341      * `custom`.
1342      *
1343      * **Note:** Users can remove items from custom categories, and Windows will not
1344      * allow a removed item to be added back into a custom category until **after** the
1345      * next successful call to `app.setJumpList(categories)`. Any attempt to re-add a
1346      * removed item to a custom category earlier than that will result in the entire
1347      * custom category being omitted from the Jump List. The list of removed items can
1348      * be obtained using `app.getJumpListSettings()`.
1349      *
1350      * **Note:** The maximum length of a Jump List item's `description` property is 260
1351      * characters. Beyond this limit, the item will not be added to the Jump List, nor
1352      * will it be displayed.
1353      *
1354      * Here's a very simple example of creating a custom Jump List:
1355      *
1356      * @platform win32
1357      */
1358     setJumpList(categories: (JumpListCategory[]) | (null)): ('ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError');
1359     /**
1360      * To work with Electron's `autoUpdater` on Windows, which uses Squirrel, you'll
1361      * want to set the launch path to Update.exe, and pass arguments that specify your
1362      * application name. For example:
1363      *
1364      * @platform darwin,win32
1365      */
1366     setLoginItemSettings(settings: Settings): void;
1367     /**
1368      * Overrides the current application's name.
1369      *
1370      * **Note:** This function overrides the name used internally by Electron; it does
1371      * not affect the name that the OS uses.
1372      */
1373     setName(name: string): void;
1374     /**
1375      * Overrides the `path` to a special directory or file associated with `name`. If
1376      * the path specifies a directory that does not exist, an `Error` is thrown. In
1377      * that case, the directory should be created with `fs.mkdirSync` or similar.
1378      *
1379      * You can only override paths of a `name` defined in `app.getPath`.
1380      *
1381      * By default, web pages' cookies and caches will be stored under the `sessionData`
1382      * directory. If you want to change this location, you have to override the
1383      * `sessionData` path before the `ready` event of the `app` module is emitted.
1384      */
1385     setPath(name: string, path: string): void;
1386     /**
1387      * Set the `Secure Keyboard Entry` is enabled in your application.
1388      *
1389      * By using this API, important information such as password and other sensitive
1390      * information can be prevented from being intercepted by other processes.
1391      *
1392      * See Apple's documentation for more details.
1393      *
1394      * **Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it
1395      * when it is no longer needed.
1396      *
1397      * @platform darwin
1398      */
1399     setSecureKeyboardEntryEnabled(enabled: boolean): void;
1400     /**
1401      * Creates an `NSUserActivity` and sets it as the current activity. The activity is
1402      * eligible for Handoff to another device afterward.
1403      *
1404      * @platform darwin
1405      */
1406     setUserActivity(type: string, userInfo: any, webpageURL?: string): void;
1407     /**
1408      * Adds `tasks` to the Tasks category of the Jump List on Windows.
1409      *
1410      * `tasks` is an array of `Task` objects.
1411      *
1412      * Whether the call succeeded.
1413      *
1414      * **Note:** If you'd like to customize the Jump List even more use
1415      * `app.setJumpList(categories)` instead.
1416      *
1417      * @platform win32
1418      */
1419     setUserTasks(tasks: Task[]): boolean;
1420     /**
1421      * Shows application windows after they were hidden. Does not automatically focus
1422      * them.
1423      *
1424      * @platform darwin
1425      */
1426     show(): void;
1427     /**
1428      * Show the app's about panel options. These options can be overridden with
1429      * `app.setAboutPanelOptions(options)`.
1430      */
1431     showAboutPanel(): void;
1432     /**
1433      * Show the platform's native emoji picker.
1434      *
1435      * @platform darwin,win32
1436      */
1437     showEmojiPanel(): void;
1438     /**
1439      * This function **must** be called once you have finished accessing the security
1440      * scoped file. If you do not remember to stop accessing the bookmark, kernel
1441      * resources will be leaked and your app will lose its ability to reach outside the
1442      * sandbox completely, until your app is restarted.
1443      *
1444      * Start accessing a security scoped resource. With this method Electron
1445      * applications that are packaged for the Mac App Store may reach outside their
1446      * sandbox to access files chosen by the user. See Apple's documentation for a
1447      * description of how this system works.
1448      *
1449      * @platform mas
1450      */
1451     startAccessingSecurityScopedResource(bookmarkData: string): Function;
1452     /**
1453      * Updates the current activity if its type matches `type`, merging the entries
1454      * from `userInfo` into its current `userInfo` dictionary.
1455      *
1456      * @platform darwin
1457      */
1458     updateCurrentActivity(type: string, userInfo: any): void;
1459     /**
1460      * fulfilled when Electron is initialized. May be used as a convenient alternative
1461      * to checking `app.isReady()` and subscribing to the `ready` event if the app is
1462      * not ready yet.
1463      */
1464     whenReady(): Promise<void>;
1465     /**
1466      * A `boolean` property that's `true` if Chrome's accessibility support is enabled,
1467      * `false` otherwise. This property will be `true` if the use of assistive
1468      * technologies, such as screen readers, has been detected. Setting this property
1469      * to `true` manually enables Chrome's accessibility support, allowing developers
1470      * to expose accessibility switch to users in application settings.
1471      *
1472      * See Chromium's accessibility docs for more details. Disabled by default.
1473      *
1474      * This API must be called after the `ready` event is emitted.
1475      *
1476      * **Note:** Rendering accessibility tree can significantly affect the performance
1477      * of your app. It should not be enabled by default.
1478      *
1479      * @platform darwin,win32
1480      */
1481     accessibilitySupportEnabled: boolean;
1482     /**
1483      * A `Menu | null` property that returns `Menu` if one has been set and `null`
1484      * otherwise. Users can pass a Menu to set this property.
1485      */
1486     applicationMenu: (Menu) | (null);
1487     /**
1488      * An `Integer` property that returns the badge count for current app. Setting the
1489      * count to `0` will hide the badge.
1490      *
1491      * On macOS, setting this with any nonzero integer shows on the dock icon. On
1492      * Linux, this property only works for Unity launcher.
1493      *
1494      * **Note:** Unity launcher requires a `.desktop` file to work. For more
1495      * information, please read the Unity integration documentation.
1496      *
1497      * **Note:** On macOS, you need to ensure that your application has the permission
1498      * to display notifications for this property to take effect.
1499      *
1500      * @platform linux,darwin
1501      */
1502     badgeCount: number;
1503     /**
1504      * A `CommandLine` object that allows you to read and manipulate the command line
1505      * arguments that Chromium uses.
1506      *
1507      */
1508     readonly commandLine: CommandLine;
1509     /**
1510      * A `Dock` `| undefined` object that allows you to perform actions on your app
1511      * icon in the user's dock on macOS.
1512      *
1513      * @platform darwin
1514      */
1515     readonly dock: Dock;
1516     /**
1517      * A `boolean` property that returns  `true` if the app is packaged, `false`
1518      * otherwise. For many apps, this property can be used to distinguish development
1519      * and production environments.
1520      *
1521      */
1522     readonly isPackaged: boolean;
1523     /**
1524      * A `string` property that indicates the current application's name, which is the
1525      * name in the application's `package.json` file.
1526      *
1527      * Usually the `name` field of `package.json` is a short lowercase name, according
1528      * to the npm modules spec. You should usually also specify a `productName` field,
1529      * which is your application's full capitalized name, and which will be preferred
1530      * over `name` by Electron.
1531      */
1532     name: string;
1533     /**
1534      * A `boolean` which when `true` indicates that the app is currently running under
1535      * an ARM64 translator (like the macOS Rosetta Translator Environment or Windows
1536      * WOW).
1537      *
1538      * You can use this property to prompt users to download the arm64 version of your
1539      * application when they are running the x64 version under Rosetta incorrectly.
1540      *
1541      * @platform darwin,win32
1542      */
1543     readonly runningUnderARM64Translation: boolean;
1544     /**
1545      * A `boolean` which when `true` indicates that the app is currently running under
1546      * the Rosetta Translator Environment.
1547      *
1548      * You can use this property to prompt users to download the arm64 version of your
1549      * application when they are running the x64 version under Rosetta incorrectly.
1550      *
1551      * **Deprecated:** This property is superceded by the
1552      * `runningUnderARM64Translation` property which detects when the app is being
1553      * translated to ARM64 in both macOS and Windows.
1554      *
1555      * @deprecated
1556      * @platform darwin
1557      */
1558     readonly runningUnderRosettaTranslation: boolean;
1559     /**
1560      * A `string` which is the user agent string Electron will use as a global
1561      * fallback.
1562      *
1563      * This is the user agent that will be used when no user agent is set at the
1564      * `webContents` or `session` level.  It is useful for ensuring that your entire
1565      * app has the same user agent.  Set to a custom value as early as possible in your
1566      * app's initialization to ensure that your overridden value is used.
1567      */
1568     userAgentFallback: string;
1569   }
1570
1571   interface AutoUpdater extends NodeJS.EventEmitter {
1572
1573     // Docs: https://electronjs.org/docs/api/auto-updater
1574
1575     /**
1576      * This event is emitted after a user calls `quitAndInstall()`.
1577      *
1578      * When this API is called, the `before-quit` event is not emitted before all
1579      * windows are closed. As a result you should listen to this event if you wish to
1580      * perform actions before the windows are closed while a process is quitting, as
1581      * well as listening to `before-quit`.
1582      */
1583     on(event: 'before-quit-for-update', listener: Function): this;
1584     once(event: 'before-quit-for-update', listener: Function): this;
1585     addListener(event: 'before-quit-for-update', listener: Function): this;
1586     removeListener(event: 'before-quit-for-update', listener: Function): this;
1587     /**
1588      * Emitted when checking if an update has started.
1589      */
1590     on(event: 'checking-for-update', listener: Function): this;
1591     once(event: 'checking-for-update', listener: Function): this;
1592     addListener(event: 'checking-for-update', listener: Function): this;
1593     removeListener(event: 'checking-for-update', listener: Function): this;
1594     /**
1595      * Emitted when there is an error while updating.
1596      */
1597     on(event: 'error', listener: (error: Error) => void): this;
1598     once(event: 'error', listener: (error: Error) => void): this;
1599     addListener(event: 'error', listener: (error: Error) => void): this;
1600     removeListener(event: 'error', listener: (error: Error) => void): this;
1601     /**
1602      * Emitted when there is an available update. The update is downloaded
1603      * automatically.
1604      */
1605     on(event: 'update-available', listener: Function): this;
1606     once(event: 'update-available', listener: Function): this;
1607     addListener(event: 'update-available', listener: Function): this;
1608     removeListener(event: 'update-available', listener: Function): this;
1609     /**
1610      * Emitted when an update has been downloaded.
1611      *
1612      * On Windows only `releaseName` is available.
1613      *
1614      * **Note:** It is not strictly necessary to handle this event. A successfully
1615      * downloaded update will still be applied the next time the application starts.
1616      */
1617     on(event: 'update-downloaded', listener: (event: Event,
1618                                               releaseNotes: string,
1619                                               releaseName: string,
1620                                               releaseDate: Date,
1621                                               updateURL: string) => void): this;
1622     once(event: 'update-downloaded', listener: (event: Event,
1623                                               releaseNotes: string,
1624                                               releaseName: string,
1625                                               releaseDate: Date,
1626                                               updateURL: string) => void): this;
1627     addListener(event: 'update-downloaded', listener: (event: Event,
1628                                               releaseNotes: string,
1629                                               releaseName: string,
1630                                               releaseDate: Date,
1631                                               updateURL: string) => void): this;
1632     removeListener(event: 'update-downloaded', listener: (event: Event,
1633                                               releaseNotes: string,
1634                                               releaseName: string,
1635                                               releaseDate: Date,
1636                                               updateURL: string) => void): this;
1637     /**
1638      * Emitted when there is no available update.
1639      */
1640     on(event: 'update-not-available', listener: Function): this;
1641     once(event: 'update-not-available', listener: Function): this;
1642     addListener(event: 'update-not-available', listener: Function): this;
1643     removeListener(event: 'update-not-available', listener: Function): this;
1644     /**
1645      * Asks the server whether there is an update. You must call `setFeedURL` before
1646      * using this API.
1647      *
1648      * **Note:** If an update is available it will be downloaded automatically. Calling
1649      * `autoUpdater.checkForUpdates()` twice will download the update two times.
1650      */
1651     checkForUpdates(): void;
1652     /**
1653      * The current update feed URL.
1654      */
1655     getFeedURL(): string;
1656     /**
1657      * Restarts the app and installs the update after it has been downloaded. It should
1658      * only be called after `update-downloaded` has been emitted.
1659      *
1660      * Under the hood calling `autoUpdater.quitAndInstall()` will close all application
1661      * windows first, and automatically call `app.quit()` after all windows have been
1662      * closed.
1663      *
1664      * **Note:** It is not strictly necessary to call this function to apply an update,
1665      * as a successfully downloaded update will always be applied the next time the
1666      * application starts.
1667      */
1668     quitAndInstall(): void;
1669     /**
1670      * Sets the `url` and initialize the auto updater.
1671      */
1672     setFeedURL(options: FeedURLOptions): void;
1673   }
1674
1675   interface BluetoothDevice {
1676
1677     // Docs: https://electronjs.org/docs/api/structures/bluetooth-device
1678
1679     deviceId: string;
1680     deviceName: string;
1681   }
1682
1683   class BrowserView {
1684
1685     // Docs: https://electronjs.org/docs/api/browser-view
1686
1687     /**
1688      * BrowserView
1689      */
1690     constructor(options?: BrowserViewConstructorOptions);
1691     /**
1692      * The `bounds` of this BrowserView instance as `Object`.
1693      *
1694      * @experimental
1695      */
1696     getBounds(): Rectangle;
1697     setAutoResize(options: AutoResizeOptions): void;
1698     /**
1699      * Examples of valid `color` values:
1700      *
1701      * * Hex
1702      *   * #fff (RGB)
1703      *   * #ffff (ARGB)
1704      *   * #ffffff (RRGGBB)
1705      *   * #ffffffff (AARRGGBB)
1706      * * RGB
1707      *   * rgb(([\d]+),\s*([\d]+),\s*([\d]+))
1708      *     * e.g. rgb(255, 255, 255)
1709      * * RGBA
1710      *   * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))
1711      *     * e.g. rgba(255, 255, 255, 1.0)
1712      * * HSL
1713      *   * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%)
1714      *     * e.g. hsl(200, 20%, 50%)
1715      * * HSLA
1716      *   * hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+))
1717      *     * e.g. hsla(200, 20%, 50%, 0.5)
1718      * * Color name
1719      *   * Options are listed in SkParseColor.cpp
1720      *   * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
1721      *     * e.g. `blueviolet` or `red`
1722      *
1723      * **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBA` or
1724      * `RGA`.
1725      *
1726      * @experimental
1727      */
1728     setBackgroundColor(color: string): void;
1729     /**
1730      * Resizes and moves the view to the supplied bounds relative to the window.
1731      *
1732      * @experimental
1733      */
1734     setBounds(bounds: Rectangle): void;
1735     /**
1736      * A `WebContents` object owned by this view.
1737      *
1738      * @experimental
1739      */
1740     webContents: WebContents;
1741   }
1742
1743   class BrowserWindow extends NodeEventEmitter {
1744
1745     // Docs: https://electronjs.org/docs/api/browser-window
1746
1747     /**
1748      * Emitted when the window is set or unset to show always on top of other windows.
1749      */
1750     on(event: 'always-on-top-changed', listener: (event: Event,
1751                                                   isAlwaysOnTop: boolean) => void): this;
1752     once(event: 'always-on-top-changed', listener: (event: Event,
1753                                                   isAlwaysOnTop: boolean) => void): this;
1754     addListener(event: 'always-on-top-changed', listener: (event: Event,
1755                                                   isAlwaysOnTop: boolean) => void): this;
1756     removeListener(event: 'always-on-top-changed', listener: (event: Event,
1757                                                   isAlwaysOnTop: boolean) => void): this;
1758     /**
1759      * Emitted when an App Command is invoked. These are typically related to keyboard
1760      * media keys or browser commands, as well as the "Back" button built into some
1761      * mice on Windows.
1762      *
1763      * Commands are lowercased, underscores are replaced with hyphens, and the
1764      * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
1765      * emitted as `browser-backward`.
1766      *
1767      * The following app commands are explicitly supported on Linux:
1768      *
1769      * * `browser-backward`
1770      * * `browser-forward`
1771      *
1772      * @platform win32,linux
1773      */
1774     on(event: 'app-command', listener: (event: Event,
1775                                         command: string) => void): this;
1776     once(event: 'app-command', listener: (event: Event,
1777                                         command: string) => void): this;
1778     addListener(event: 'app-command', listener: (event: Event,
1779                                         command: string) => void): this;
1780     removeListener(event: 'app-command', listener: (event: Event,
1781                                         command: string) => void): this;
1782     /**
1783      * Emitted when the window loses focus.
1784      */
1785     on(event: 'blur', listener: Function): this;
1786     once(event: 'blur', listener: Function): this;
1787     addListener(event: 'blur', listener: Function): this;
1788     removeListener(event: 'blur', listener: Function): this;
1789     /**
1790      * Emitted when the window is going to be closed. It's emitted before the
1791      * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
1792      * will cancel the close.
1793      *
1794      * Usually you would want to use the `beforeunload` handler to decide whether the
1795      * window should be closed, which will also be called when the window is reloaded.
1796      * In Electron, returning any value other than `undefined` would cancel the close.
1797      * For example:
1798      *
1799      * _**Note**: There is a subtle difference between the behaviors of
1800      * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
1801      * handler)`. It is recommended to always set the `event.returnValue` explicitly,
1802      * instead of only returning a value, as the former works more consistently within
1803      * Electron._
1804      */
1805     on(event: 'close', listener: (event: Event) => void): this;
1806     once(event: 'close', listener: (event: Event) => void): this;
1807     addListener(event: 'close', listener: (event: Event) => void): this;
1808     removeListener(event: 'close', listener: (event: Event) => void): this;
1809     /**
1810      * Emitted when the window is closed. After you have received this event you should
1811      * remove the reference to the window and avoid using it any more.
1812      */
1813     on(event: 'closed', listener: Function): this;
1814     once(event: 'closed', listener: Function): this;
1815     addListener(event: 'closed', listener: Function): this;
1816     removeListener(event: 'closed', listener: Function): this;
1817     /**
1818      * Emitted when the window enters a full-screen state.
1819      */
1820     on(event: 'enter-full-screen', listener: Function): this;
1821     once(event: 'enter-full-screen', listener: Function): this;
1822     addListener(event: 'enter-full-screen', listener: Function): this;
1823     removeListener(event: 'enter-full-screen', listener: Function): this;
1824     /**
1825      * Emitted when the window enters a full-screen state triggered by HTML API.
1826      */
1827     on(event: 'enter-html-full-screen', listener: Function): this;
1828     once(event: 'enter-html-full-screen', listener: Function): this;
1829     addListener(event: 'enter-html-full-screen', listener: Function): this;
1830     removeListener(event: 'enter-html-full-screen', listener: Function): this;
1831     /**
1832      * Emitted when the window gains focus.
1833      */
1834     on(event: 'focus', listener: Function): this;
1835     once(event: 'focus', listener: Function): this;
1836     addListener(event: 'focus', listener: Function): this;
1837     removeListener(event: 'focus', listener: Function): this;
1838     /**
1839      * Emitted when the window is hidden.
1840      */
1841     on(event: 'hide', listener: Function): this;
1842     once(event: 'hide', listener: Function): this;
1843     addListener(event: 'hide', listener: Function): this;
1844     removeListener(event: 'hide', listener: Function): this;
1845     /**
1846      * Emitted when the window leaves a full-screen state.
1847      */
1848     on(event: 'leave-full-screen', listener: Function): this;
1849     once(event: 'leave-full-screen', listener: Function): this;
1850     addListener(event: 'leave-full-screen', listener: Function): this;
1851     removeListener(event: 'leave-full-screen', listener: Function): this;
1852     /**
1853      * Emitted when the window leaves a full-screen state triggered by HTML API.
1854      */
1855     on(event: 'leave-html-full-screen', listener: Function): this;
1856     once(event: 'leave-html-full-screen', listener: Function): this;
1857     addListener(event: 'leave-html-full-screen', listener: Function): this;
1858     removeListener(event: 'leave-html-full-screen', listener: Function): this;
1859     /**
1860      * Emitted when window is maximized.
1861      */
1862     on(event: 'maximize', listener: Function): this;
1863     once(event: 'maximize', listener: Function): this;
1864     addListener(event: 'maximize', listener: Function): this;
1865     removeListener(event: 'maximize', listener: Function): this;
1866     /**
1867      * Emitted when the window is minimized.
1868      */
1869     on(event: 'minimize', listener: Function): this;
1870     once(event: 'minimize', listener: Function): this;
1871     addListener(event: 'minimize', listener: Function): this;
1872     removeListener(event: 'minimize', listener: Function): this;
1873     /**
1874      * Emitted when the window is being moved to a new position.
1875      */
1876     on(event: 'move', listener: Function): this;
1877     once(event: 'move', listener: Function): this;
1878     addListener(event: 'move', listener: Function): this;
1879     removeListener(event: 'move', listener: Function): this;
1880     /**
1881      * Emitted once when the window is moved to a new position.
1882      *
1883      * __Note__: On macOS this event is an alias of `move`.
1884      *
1885      * @platform darwin,win32
1886      */
1887     on(event: 'moved', listener: Function): this;
1888     once(event: 'moved', listener: Function): this;
1889     addListener(event: 'moved', listener: Function): this;
1890     removeListener(event: 'moved', listener: Function): this;
1891     /**
1892      * Emitted when the native new tab button is clicked.
1893      *
1894      * @platform darwin
1895      */
1896     on(event: 'new-window-for-tab', listener: Function): this;
1897     once(event: 'new-window-for-tab', listener: Function): this;
1898     addListener(event: 'new-window-for-tab', listener: Function): this;
1899     removeListener(event: 'new-window-for-tab', listener: Function): this;
1900     /**
1901      * Emitted when the document changed its title, calling `event.preventDefault()`
1902      * will prevent the native window's title from changing. `explicitSet` is false
1903      * when title is synthesized from file URL.
1904      */
1905     on(event: 'page-title-updated', listener: (event: Event,
1906                                                title: string,
1907                                                explicitSet: boolean) => void): this;
1908     once(event: 'page-title-updated', listener: (event: Event,
1909                                                title: string,
1910                                                explicitSet: boolean) => void): this;
1911     addListener(event: 'page-title-updated', listener: (event: Event,
1912                                                title: string,
1913                                                explicitSet: boolean) => void): this;
1914     removeListener(event: 'page-title-updated', listener: (event: Event,
1915                                                title: string,
1916                                                explicitSet: boolean) => void): this;
1917     /**
1918      * Emitted when the web page has been rendered (while not being shown) and window
1919      * can be displayed without a visual flash.
1920      *
1921      * Please note that using this event implies that the renderer will be considered
1922      * "visible" and paint even though `show` is false.  This event will never fire if
1923      * you use `paintWhenInitiallyHidden: false`
1924      */
1925     on(event: 'ready-to-show', listener: Function): this;
1926     once(event: 'ready-to-show', listener: Function): this;
1927     addListener(event: 'ready-to-show', listener: Function): this;
1928     removeListener(event: 'ready-to-show', listener: Function): this;
1929     /**
1930      * Emitted after the window has been resized.
1931      */
1932     on(event: 'resize', listener: Function): this;
1933     once(event: 'resize', listener: Function): this;
1934     addListener(event: 'resize', listener: Function): this;
1935     removeListener(event: 'resize', listener: Function): this;
1936     /**
1937      * Emitted once when the window has finished being resized.
1938      *
1939      * This is usually emitted when the window has been resized manually. On macOS,
1940      * resizing the window with `setBounds`/`setSize` and setting the `animate`
1941      * parameter to `true` will also emit this event once resizing has finished.
1942      *
1943      * @platform darwin,win32
1944      */
1945     on(event: 'resized', listener: Function): this;
1946     once(event: 'resized', listener: Function): this;
1947     addListener(event: 'resized', listener: Function): this;
1948     removeListener(event: 'resized', listener: Function): this;
1949     /**
1950      * Emitted when the unresponsive web page becomes responsive again.
1951      */
1952     on(event: 'responsive', listener: Function): this;
1953     once(event: 'responsive', listener: Function): this;
1954     addListener(event: 'responsive', listener: Function): this;
1955     removeListener(event: 'responsive', listener: Function): this;
1956     /**
1957      * Emitted when the window is restored from a minimized state.
1958      */
1959     on(event: 'restore', listener: Function): this;
1960     once(event: 'restore', listener: Function): this;
1961     addListener(event: 'restore', listener: Function): this;
1962     removeListener(event: 'restore', listener: Function): this;
1963     /**
1964      * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
1965      * is ended. The `rotation` value on each emission is the angle in degrees rotated
1966      * since the last emission. The last emitted event upon a rotation gesture will
1967      * always be of value `0`. Counter-clockwise rotation values are positive, while
1968      * clockwise ones are negative.
1969      *
1970      * @platform darwin
1971      */
1972     on(event: 'rotate-gesture', listener: (event: Event,
1973                                            rotation: number) => void): this;
1974     once(event: 'rotate-gesture', listener: (event: Event,
1975                                            rotation: number) => void): this;
1976     addListener(event: 'rotate-gesture', listener: (event: Event,
1977                                            rotation: number) => void): this;
1978     removeListener(event: 'rotate-gesture', listener: (event: Event,
1979                                            rotation: number) => void): this;
1980     /**
1981      * Emitted when scroll wheel event phase has begun.
1982      *
1983      * > **Note** This event is deprecated beginning in Electron 22.0.0. See Breaking
1984      * Changes for details of how to migrate to using the WebContents `input-event`
1985      * event.
1986      *
1987      * @deprecated
1988      * @platform darwin
1989      */
1990     on(event: 'scroll-touch-begin', listener: Function): this;
1991     once(event: 'scroll-touch-begin', listener: Function): this;
1992     addListener(event: 'scroll-touch-begin', listener: Function): this;
1993     removeListener(event: 'scroll-touch-begin', listener: Function): this;
1994     /**
1995      * Emitted when scroll wheel event phase filed upon reaching the edge of element.
1996      *
1997      * > **Note** This event is deprecated beginning in Electron 22.0.0. See Breaking
1998      * Changes for details of how to migrate to using the WebContents `input-event`
1999      * event.
2000      *
2001      * @deprecated
2002      * @platform darwin
2003      */
2004     on(event: 'scroll-touch-edge', listener: Function): this;
2005     once(event: 'scroll-touch-edge', listener: Function): this;
2006     addListener(event: 'scroll-touch-edge', listener: Function): this;
2007     removeListener(event: 'scroll-touch-edge', listener: Function): this;
2008     /**
2009      * Emitted when scroll wheel event phase has ended.
2010      *
2011      * > **Note** This event is deprecated beginning in Electron 22.0.0. See Breaking
2012      * Changes for details of how to migrate to using the WebContents `input-event`
2013      * event.
2014      *
2015      * @deprecated
2016      * @platform darwin
2017      */
2018     on(event: 'scroll-touch-end', listener: Function): this;
2019     once(event: 'scroll-touch-end', listener: Function): this;
2020     addListener(event: 'scroll-touch-end', listener: Function): this;
2021     removeListener(event: 'scroll-touch-end', listener: Function): this;
2022     /**
2023      * Emitted when window session is going to end due to force shutdown or machine
2024      * restart or session log off.
2025      *
2026      * @platform win32
2027      */
2028     on(event: 'session-end', listener: Function): this;
2029     once(event: 'session-end', listener: Function): this;
2030     addListener(event: 'session-end', listener: Function): this;
2031     removeListener(event: 'session-end', listener: Function): this;
2032     /**
2033      * Emitted when the window opens a sheet.
2034      *
2035      * @platform darwin
2036      */
2037     on(event: 'sheet-begin', listener: Function): this;
2038     once(event: 'sheet-begin', listener: Function): this;
2039     addListener(event: 'sheet-begin', listener: Function): this;
2040     removeListener(event: 'sheet-begin', listener: Function): this;
2041     /**
2042      * Emitted when the window has closed a sheet.
2043      *
2044      * @platform darwin
2045      */
2046     on(event: 'sheet-end', listener: Function): this;
2047     once(event: 'sheet-end', listener: Function): this;
2048     addListener(event: 'sheet-end', listener: Function): this;
2049     removeListener(event: 'sheet-end', listener: Function): this;
2050     /**
2051      * Emitted when the window is shown.
2052      */
2053     on(event: 'show', listener: Function): this;
2054     once(event: 'show', listener: Function): this;
2055     addListener(event: 'show', listener: Function): this;
2056     removeListener(event: 'show', listener: Function): this;
2057     /**
2058      * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
2059      * `left`.
2060      *
2061      * The method underlying this event is built to handle older macOS-style trackpad
2062      * swiping, where the content on the screen doesn't move with the swipe. Most macOS
2063      * trackpads are not configured to allow this kind of swiping anymore, so in order
2064      * for it to emit properly the 'Swipe between pages' preference in `System
2065      * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
2066      * fingers'.
2067      *
2068      * @platform darwin
2069      */
2070     on(event: 'swipe', listener: (event: Event,
2071                                   direction: string) => void): this;
2072     once(event: 'swipe', listener: (event: Event,
2073                                   direction: string) => void): this;
2074     addListener(event: 'swipe', listener: (event: Event,
2075                                   direction: string) => void): this;
2076     removeListener(event: 'swipe', listener: (event: Event,
2077                                   direction: string) => void): this;
2078     /**
2079      * Emitted when the system context menu is triggered on the window, this is
2080      * normally only triggered when the user right clicks on the non-client area of
2081      * your window.  This is the window titlebar or any area you have declared as
2082      * `-webkit-app-region: drag` in a frameless window.
2083      *
2084      * Calling `event.preventDefault()` will prevent the menu from being displayed.
2085      *
2086      * @platform win32
2087      */
2088     on(event: 'system-context-menu', listener: (event: Event,
2089                                                 /**
2090                                                  * The screen coordinates the context menu was triggered at
2091                                                  */
2092                                                 point: Point) => void): this;
2093     once(event: 'system-context-menu', listener: (event: Event,
2094                                                 /**
2095                                                  * The screen coordinates the context menu was triggered at
2096                                                  */
2097                                                 point: Point) => void): this;
2098     addListener(event: 'system-context-menu', listener: (event: Event,
2099                                                 /**
2100                                                  * The screen coordinates the context menu was triggered at
2101                                                  */
2102                                                 point: Point) => void): this;
2103     removeListener(event: 'system-context-menu', listener: (event: Event,
2104                                                 /**
2105                                                  * The screen coordinates the context menu was triggered at
2106                                                  */
2107                                                 point: Point) => void): this;
2108     /**
2109      * Emitted when the window exits from a maximized state.
2110      */
2111     on(event: 'unmaximize', listener: Function): this;
2112     once(event: 'unmaximize', listener: Function): this;
2113     addListener(event: 'unmaximize', listener: Function): this;
2114     removeListener(event: 'unmaximize', listener: Function): this;
2115     /**
2116      * Emitted when the web page becomes unresponsive.
2117      */
2118     on(event: 'unresponsive', listener: Function): this;
2119     once(event: 'unresponsive', listener: Function): this;
2120     addListener(event: 'unresponsive', listener: Function): this;
2121     removeListener(event: 'unresponsive', listener: Function): this;
2122     /**
2123      * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
2124      * will prevent the window from being moved.
2125      *
2126      * Note that this is only emitted when the window is being moved manually. Moving
2127      * the window with `setPosition`/`setBounds`/`center` will not emit this event.
2128      *
2129      * @platform darwin,win32
2130      */
2131     on(event: 'will-move', listener: (event: Event,
2132                                       /**
2133                                        * Location the window is being moved to.
2134                                        */
2135                                       newBounds: Rectangle) => void): this;
2136     once(event: 'will-move', listener: (event: Event,
2137                                       /**
2138                                        * Location the window is being moved to.
2139                                        */
2140                                       newBounds: Rectangle) => void): this;
2141     addListener(event: 'will-move', listener: (event: Event,
2142                                       /**
2143                                        * Location the window is being moved to.
2144                                        */
2145                                       newBounds: Rectangle) => void): this;
2146     removeListener(event: 'will-move', listener: (event: Event,
2147                                       /**
2148                                        * Location the window is being moved to.
2149                                        */
2150                                       newBounds: Rectangle) => void): this;
2151     /**
2152      * Emitted before the window is resized. Calling `event.preventDefault()` will
2153      * prevent the window from being resized.
2154      *
2155      * Note that this is only emitted when the window is being resized manually.
2156      * Resizing the window with `setBounds`/`setSize` will not emit this event.
2157      *
2158      * The possible values and behaviors of the `edge` option are platform dependent.
2159      * Possible values are:
2160      *
2161      * * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
2162      * `top-right`, `bottom-left`, `bottom-right`.
2163      * * On macOS, possible values are `bottom` and `right`.
2164      *   * The value `bottom` is used to denote vertical resizing.
2165      *   * The value `right` is used to denote horizontal resizing.
2166      *
2167      * @platform darwin,win32
2168      */
2169     on(event: 'will-resize', listener: (event: Event,
2170                                         /**
2171                                          * Size the window is being resized to.
2172                                          */
2173                                         newBounds: Rectangle,
2174                                         details: WillResizeDetails) => void): this;
2175     once(event: 'will-resize', listener: (event: Event,
2176                                         /**
2177                                          * Size the window is being resized to.
2178                                          */
2179                                         newBounds: Rectangle,
2180                                         details: WillResizeDetails) => void): this;
2181     addListener(event: 'will-resize', listener: (event: Event,
2182                                         /**
2183                                          * Size the window is being resized to.
2184                                          */
2185                                         newBounds: Rectangle,
2186                                         details: WillResizeDetails) => void): this;
2187     removeListener(event: 'will-resize', listener: (event: Event,
2188                                         /**
2189                                          * Size the window is being resized to.
2190                                          */
2191                                         newBounds: Rectangle,
2192                                         details: WillResizeDetails) => void): this;
2193     /**
2194      * BrowserWindow
2195      */
2196     constructor(options?: BrowserWindowConstructorOptions);
2197     /**
2198      * The window that owns the given `browserView`. If the given view is not attached
2199      * to any window, returns `null`.
2200      */
2201     static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
2202     /**
2203      * The window with the given `id`.
2204      */
2205     static fromId(id: number): (BrowserWindow) | (null);
2206     /**
2207      * The window that owns the given `webContents` or `null` if the contents are not
2208      * owned by a window.
2209      */
2210     static fromWebContents(webContents: WebContents): (BrowserWindow) | (null);
2211     /**
2212      * An array of all opened browser windows.
2213      */
2214     static getAllWindows(): BrowserWindow[];
2215     /**
2216      * The window that is focused in this application, otherwise returns `null`.
2217      */
2218     static getFocusedWindow(): (BrowserWindow) | (null);
2219     /**
2220      * Replacement API for setBrowserView supporting work with multi browser views.
2221      *
2222      * @experimental
2223      */
2224     addBrowserView(browserView: BrowserView): void;
2225     /**
2226      * Adds a window as a tab on this window, after the tab for the window instance.
2227      *
2228      * @platform darwin
2229      */
2230     addTabbedWindow(browserWindow: BrowserWindow): void;
2231     /**
2232      * Removes focus from the window.
2233      */
2234     blur(): void;
2235     blurWebView(): void;
2236     /**
2237      * Resolves with a NativeImage
2238      *
2239      * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
2240      * whole visible page. If the page is not visible, `rect` may be empty.
2241      */
2242     capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
2243     /**
2244      * Moves window to the center of the screen.
2245      */
2246     center(): void;
2247     /**
2248      * Try to close the window. This has the same effect as a user manually clicking
2249      * the close button of the window. The web page may cancel the close though. See
2250      * the close event.
2251      */
2252     close(): void;
2253     /**
2254      * Closes the currently open Quick Look panel.
2255      *
2256      * @platform darwin
2257      */
2258     closeFilePreview(): void;
2259     /**
2260      * Force closing the window, the `unload` and `beforeunload` event won't be emitted
2261      * for the web page, and `close` event will also not be emitted for this window,
2262      * but it guarantees the `closed` event will be emitted.
2263      */
2264     destroy(): void;
2265     /**
2266      * Starts or stops flashing the window to attract user's attention.
2267      */
2268     flashFrame(flag: boolean): void;
2269     /**
2270      * Focuses on the window.
2271      */
2272     focus(): void;
2273     focusOnWebView(): void;
2274     /**
2275      * Gets the background color of the window in Hex (`#RRGGBB`) format.
2276      *
2277      * See Setting `backgroundColor`.
2278      *
2279      * **Note:** The alpha value is _not_ returned alongside the red, green, and blue
2280      * values.
2281      */
2282     getBackgroundColor(): string;
2283     /**
2284      * The `bounds` of the window as `Object`.
2285      */
2286     getBounds(): Rectangle;
2287     /**
2288      * The `BrowserView` attached to `win`. Returns `null` if one is not attached.
2289      * Throws an error if multiple `BrowserView`s are attached.
2290      *
2291      * @experimental
2292      */
2293     getBrowserView(): (BrowserView) | (null);
2294     /**
2295      * an array of all BrowserViews that have been attached with `addBrowserView` or
2296      * `setBrowserView`.
2297      *
2298      * **Note:** The BrowserView API is currently experimental and may change or be
2299      * removed in future Electron releases.
2300      *
2301      * @experimental
2302      */
2303     getBrowserViews(): BrowserView[];
2304     /**
2305      * All child windows.
2306      */
2307     getChildWindows(): BrowserWindow[];
2308     /**
2309      * The `bounds` of the window's client area as `Object`.
2310      */
2311     getContentBounds(): Rectangle;
2312     /**
2313      * Contains the window's client area's width and height.
2314      */
2315     getContentSize(): number[];
2316     /**
2317      * Contains the window's maximum width and height.
2318      */
2319     getMaximumSize(): number[];
2320     /**
2321      * Window id in the format of DesktopCapturerSource's id. For example
2322      * "window:1324:0".
2323      *
2324      * More precisely the format is `window:id:other_id` where `id` is `HWND` on
2325      * Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
2326      * Linux. `other_id` is used to identify web contents (tabs) so within the same top
2327      * level window.
2328      */
2329     getMediaSourceId(): string;
2330     /**
2331      * Contains the window's minimum width and height.
2332      */
2333     getMinimumSize(): number[];
2334     /**
2335      * The platform-specific handle of the window.
2336      *
2337      * The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
2338      * `Window` (`unsigned long`) on Linux.
2339      */
2340     getNativeWindowHandle(): Buffer;
2341     /**
2342      * Contains the window bounds of the normal state
2343      *
2344      * **Note:** whatever the current state of the window : maximized, minimized or in
2345      * fullscreen, this function always returns the position and size of the window in
2346      * normal state. In normal state, getBounds and getNormalBounds returns the same
2347      * `Rectangle`.
2348      */
2349     getNormalBounds(): Rectangle;
2350     /**
2351      * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
2352      * 1.
2353      */
2354     getOpacity(): number;
2355     /**
2356      * The parent window or `null` if there is no parent.
2357      */
2358     getParentWindow(): (BrowserWindow) | (null);
2359     /**
2360      * Contains the window's current position.
2361      */
2362     getPosition(): number[];
2363     /**
2364      * The pathname of the file the window represents.
2365      *
2366      * @platform darwin
2367      */
2368     getRepresentedFilename(): string;
2369     /**
2370      * Contains the window's width and height.
2371      */
2372     getSize(): number[];
2373     /**
2374      * The title of the native window.
2375      *
2376      * **Note:** The title of the web page can be different from the title of the
2377      * native window.
2378      */
2379     getTitle(): string;
2380     /**
2381      * The custom position for the traffic light buttons in frameless window.
2382      *
2383      * @platform darwin
2384      */
2385     getTrafficLightPosition(): Point;
2386     /**
2387      * Whether the window has a shadow.
2388      */
2389     hasShadow(): boolean;
2390     /**
2391      * Hides the window.
2392      */
2393     hide(): void;
2394     /**
2395      * Hooks a windows message. The `callback` is called when the message is received
2396      * in the WndProc.
2397      *
2398      * @platform win32
2399      */
2400     hookWindowMessage(message: number, callback: (wParam: any, lParam: any) => void): void;
2401     /**
2402      * Whether the window is always on top of other windows.
2403      */
2404     isAlwaysOnTop(): boolean;
2405     /**
2406      * Whether the window can be manually closed by user.
2407      *
2408      * On Linux always returns `true`.
2409      *
2410      * @platform darwin,win32
2411      */
2412     isClosable(): boolean;
2413     /**
2414      * Whether the window is destroyed.
2415      */
2416     isDestroyed(): boolean;
2417     /**
2418      * Whether the window's document has been edited.
2419      *
2420      * @platform darwin
2421      */
2422     isDocumentEdited(): boolean;
2423     /**
2424      * whether the window is enabled.
2425      */
2426     isEnabled(): boolean;
2427     /**
2428      * Returns whether the window can be focused.
2429      *
2430      * @platform darwin,win32
2431      */
2432     isFocusable(): void;
2433     /**
2434      * Whether the window is focused.
2435      */
2436     isFocused(): boolean;
2437     /**
2438      * Whether the window is in fullscreen mode.
2439      */
2440     isFullScreen(): boolean;
2441     /**
2442      * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
2443      * window.
2444      */
2445     isFullScreenable(): boolean;
2446     /**
2447      * Whether the window is in kiosk mode.
2448      */
2449     isKiosk(): boolean;
2450     /**
2451      * Whether the window can be manually maximized by user.
2452      *
2453      * On Linux always returns `true`.
2454      *
2455      * @platform darwin,win32
2456      */
2457     isMaximizable(): boolean;
2458     /**
2459      * Whether the window is maximized.
2460      */
2461     isMaximized(): boolean;
2462     /**
2463      * Whether menu bar automatically hides itself.
2464      *
2465      * @platform win32,linux
2466      */
2467     isMenuBarAutoHide(): boolean;
2468     /**
2469      * Whether the menu bar is visible.
2470      *
2471      * @platform win32,linux
2472      */
2473     isMenuBarVisible(): boolean;
2474     /**
2475      * Whether the window can be manually minimized by the user.
2476      *
2477      * On Linux always returns `true`.
2478      *
2479      * @platform darwin,win32
2480      */
2481     isMinimizable(): boolean;
2482     /**
2483      * Whether the window is minimized.
2484      */
2485     isMinimized(): boolean;
2486     /**
2487      * Whether current window is a modal window.
2488      */
2489     isModal(): boolean;
2490     /**
2491      * Whether the window can be moved by user.
2492      *
2493      * On Linux always returns `true`.
2494      *
2495      * @platform darwin,win32
2496      */
2497     isMovable(): boolean;
2498     /**
2499      * Whether the window is in normal state (not maximized, not minimized, not in
2500      * fullscreen mode).
2501      */
2502     isNormal(): boolean;
2503     /**
2504      * Whether the window can be manually resized by the user.
2505      */
2506     isResizable(): boolean;
2507     /**
2508      * Whether the window is in simple (pre-Lion) fullscreen mode.
2509      *
2510      * @platform darwin
2511      */
2512     isSimpleFullScreen(): boolean;
2513     /**
2514      * Whether the window is in Windows 10 tablet mode.
2515      *
2516      * Since Windows 10 users can use their PC as tablet, under this mode apps can
2517      * choose to optimize their UI for tablets, such as enlarging the titlebar and
2518      * hiding titlebar buttons.
2519      *
2520      * This API returns whether the window is in tablet mode, and the `resize` event
2521      * can be be used to listen to changes to tablet mode.
2522      *
2523      * @platform win32
2524      */
2525     isTabletMode(): boolean;
2526     /**
2527      * Whether the window is visible to the user.
2528      */
2529     isVisible(): boolean;
2530     /**
2531      * Whether the window is visible on all workspaces.
2532      *
2533      * **Note:** This API always returns false on Windows.
2534      *
2535      * @platform darwin,linux
2536      */
2537     isVisibleOnAllWorkspaces(): boolean;
2538     /**
2539      * `true` or `false` depending on whether the message is hooked.
2540      *
2541      * @platform win32
2542      */
2543     isWindowMessageHooked(message: number): boolean;
2544     /**
2545      * the promise will resolve when the page has finished loading (see
2546      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
2547      *
2548      * Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
2549      * relative to the root of your application.  See the `webContents` docs for more
2550      * information.
2551      */
2552     loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
2553     /**
2554      * the promise will resolve when the page has finished loading (see
2555      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
2556      *
2557      * Same as `webContents.loadURL(url[, options])`.
2558      *
2559      * The `url` can be a remote address (e.g. `http://`) or a path to a local HTML
2560      * file using the `file://` protocol.
2561      *
2562      * To ensure that file URLs are properly formatted, it is recommended to use Node's
2563      * `url.format` method:
2564      *
2565      * You can load a URL using a `POST` request with URL-encoded data by doing the
2566      * following:
2567      */
2568     loadURL(url: string, options?: LoadURLOptions): Promise<void>;
2569     /**
2570      * Maximizes the window. This will also show (but not focus) the window if it isn't
2571      * being displayed already.
2572      */
2573     maximize(): void;
2574     /**
2575      * Merges all windows into one window with multiple tabs when native tabs are
2576      * enabled and there is more than one open window.
2577      *
2578      * @platform darwin
2579      */
2580     mergeAllWindows(): void;
2581     /**
2582      * Minimizes the window. On some platforms the minimized window will be shown in
2583      * the Dock.
2584      */
2585     minimize(): void;
2586     /**
2587      * Moves window above the source window in the sense of z-order. If the
2588      * `mediaSourceId` is not of type window or if the window does not exist then this
2589      * method throws an error.
2590      */
2591     moveAbove(mediaSourceId: string): void;
2592     /**
2593      * Moves the current tab into a new window if native tabs are enabled and there is
2594      * more than one tab in the current window.
2595      *
2596      * @platform darwin
2597      */
2598     moveTabToNewWindow(): void;
2599     /**
2600      * Moves window to top(z-order) regardless of focus
2601      */
2602     moveTop(): void;
2603     /**
2604      * Uses Quick Look to preview a file at a given path.
2605      *
2606      * @platform darwin
2607      */
2608     previewFile(path: string, displayName?: string): void;
2609     /**
2610      * Same as `webContents.reload`.
2611      */
2612     reload(): void;
2613     removeBrowserView(browserView: BrowserView): void;
2614     /**
2615      * Remove the window's menu bar.
2616      *
2617      * @platform linux,win32
2618      */
2619     removeMenu(): void;
2620     /**
2621      * Restores the window from minimized state to its previous state.
2622      */
2623     restore(): void;
2624     /**
2625      * Selects the next tab when native tabs are enabled and there are other tabs in
2626      * the window.
2627      *
2628      * @platform darwin
2629      */
2630     selectNextTab(): void;
2631     /**
2632      * Selects the previous tab when native tabs are enabled and there are other tabs
2633      * in the window.
2634      *
2635      * @platform darwin
2636      */
2637     selectPreviousTab(): void;
2638     /**
2639      * Sets whether the window should show always on top of other windows. After
2640      * setting this, the window is still a normal window, not a toolbox window which
2641      * can not be focused on.
2642      */
2643     setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver', relativeLevel?: number): void;
2644     /**
2645      * Sets the properties for the window's taskbar button.
2646      *
2647      * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
2648      * together. If one of those properties is not set, then neither will be used.
2649      *
2650      * @platform win32
2651      */
2652     setAppDetails(options: AppDetailsOptions): void;
2653     /**
2654      * This will make a window maintain an aspect ratio. The extra size allows a
2655      * developer to have space, specified in pixels, not included within the aspect
2656      * ratio calculations. This API already takes into account the difference between a
2657      * window's size and its content size.
2658      *
2659      * Consider a normal window with an HD video player and associated controls.
2660      * Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
2661      * on the right edge and 50 pixels of controls below the player. In order to
2662      * maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
2663      * the player itself we would call this function with arguments of 16/9 and {
2664      * width: 40, height: 50 }. The second argument doesn't care where the extra width
2665      * and height are within the content view--only that they exist. Sum any extra
2666      * width and height areas you have within the overall content view.
2667      *
2668      * The aspect ratio is not respected when window is resized programmatically with
2669      * APIs like `win.setSize`.
2670      */
2671     setAspectRatio(aspectRatio: number, extraSize?: Size): void;
2672     /**
2673      * Controls whether to hide cursor when typing.
2674      *
2675      * @platform darwin
2676      */
2677     setAutoHideCursor(autoHide: boolean): void;
2678     /**
2679      * Sets whether the window menu bar should hide itself automatically. Once set the
2680      * menu bar will only show when users press the single `Alt` key.
2681      *
2682      * If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
2683      * hide it immediately.
2684      *
2685      * @platform win32,linux
2686      */
2687     setAutoHideMenuBar(hide: boolean): void;
2688     /**
2689      * Examples of valid `backgroundColor` values:
2690      *
2691      * * Hex
2692      *   * #fff (shorthand RGB)
2693      *   * #ffff (shorthand ARGB)
2694      *   * #ffffff (RGB)
2695      *   * #ffffffff (ARGB)
2696      * * RGB
2697      *   * rgb(([\d]+),\s*([\d]+),\s*([\d]+))
2698      *     * e.g. rgb(255, 255, 255)
2699      * * RGBA
2700      *   * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))
2701      *     * e.g. rgba(255, 255, 255, 1.0)
2702      * * HSL
2703      *   * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%)
2704      *     * e.g. hsl(200, 20%, 50%)
2705      * * HSLA
2706      *   * hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+))
2707      *     * e.g. hsla(200, 20%, 50%, 0.5)
2708      * * Color name
2709      *   * Options are listed in SkParseColor.cpp
2710      *   * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
2711      *     * e.g. `blueviolet` or `red`
2712      *
2713      * Sets the background color of the window. See Setting `backgroundColor`.
2714      */
2715     setBackgroundColor(backgroundColor: string): void;
2716     /**
2717      * Resizes and moves the window to the supplied bounds. Any properties that are not
2718      * supplied will default to their current values.
2719      */
2720     setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
2721     setBrowserView(browserView: (BrowserView) | (null)): void;
2722     /**
2723      * Sets whether the window can be manually closed by user. On Linux does nothing.
2724      *
2725      * @platform darwin,win32
2726      */
2727     setClosable(closable: boolean): void;
2728     /**
2729      * Resizes and moves the window's client area (e.g. the web page) to the supplied
2730      * bounds.
2731      */
2732     setContentBounds(bounds: Rectangle, animate?: boolean): void;
2733     /**
2734      * Prevents the window contents from being captured by other apps.
2735      *
2736      * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
2737      * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
2738      * version 2004 and up the window will be removed from capture entirely, older
2739      * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
2740      *
2741      * @platform darwin,win32
2742      */
2743     setContentProtection(enable: boolean): void;
2744     /**
2745      * Resizes the window's client area (e.g. the web page) to `width` and `height`.
2746      */
2747     setContentSize(width: number, height: number, animate?: boolean): void;
2748     /**
2749      * Specifies whether the window’s document has been edited, and the icon in title
2750      * bar will become gray when set to `true`.
2751      *
2752      * @platform darwin
2753      */
2754     setDocumentEdited(edited: boolean): void;
2755     /**
2756      * Disable or enable the window.
2757      */
2758     setEnabled(enable: boolean): void;
2759     /**
2760      * Changes whether the window can be focused.
2761      *
2762      * On macOS it does not remove the focus from the window.
2763      *
2764      * @platform darwin,win32
2765      */
2766     setFocusable(focusable: boolean): void;
2767     /**
2768      * Sets whether the window should be in fullscreen mode.
2769      */
2770     setFullScreen(flag: boolean): void;
2771     /**
2772      * Sets whether the maximize/zoom window button toggles fullscreen mode or
2773      * maximizes the window.
2774      */
2775     setFullScreenable(fullscreenable: boolean): void;
2776     /**
2777      * Sets whether the window should have a shadow.
2778      */
2779     setHasShadow(hasShadow: boolean): void;
2780     /**
2781      * Changes window icon.
2782      *
2783      * @platform win32,linux
2784      */
2785     setIcon(icon: (NativeImage) | (string)): void;
2786     /**
2787      * Makes the window ignore all mouse events.
2788      *
2789      * All mouse events happened in this window will be passed to the window below this
2790      * window, but if this window has focus, it will still receive keyboard events.
2791      */
2792     setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
2793     /**
2794      * Enters or leaves kiosk mode.
2795      */
2796     setKiosk(flag: boolean): void;
2797     /**
2798      * Sets whether the window can be manually maximized by user. On Linux does
2799      * nothing.
2800      *
2801      * @platform darwin,win32
2802      */
2803     setMaximizable(maximizable: boolean): void;
2804     /**
2805      * Sets the maximum size of window to `width` and `height`.
2806      */
2807     setMaximumSize(width: number, height: number): void;
2808     /**
2809      * Sets the `menu` as the window's menu bar.
2810      *
2811      * @platform linux,win32
2812      */
2813     setMenu(menu: (Menu) | (null)): void;
2814     /**
2815      * Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
2816      * can still bring up the menu bar by pressing the single `Alt` key.
2817      *
2818      * @platform win32,linux
2819      */
2820     setMenuBarVisibility(visible: boolean): void;
2821     /**
2822      * Sets whether the window can be manually minimized by user. On Linux does
2823      * nothing.
2824      *
2825      * @platform darwin,win32
2826      */
2827     setMinimizable(minimizable: boolean): void;
2828     /**
2829      * Sets the minimum size of window to `width` and `height`.
2830      */
2831     setMinimumSize(width: number, height: number): void;
2832     /**
2833      * Sets whether the window can be moved by user. On Linux does nothing.
2834      *
2835      * @platform darwin,win32
2836      */
2837     setMovable(movable: boolean): void;
2838     /**
2839      * Sets the opacity of the window. On Linux, does nothing. Out of bound number
2840      * values are clamped to the [0, 1] range.
2841      *
2842      * @platform win32,darwin
2843      */
2844     setOpacity(opacity: number): void;
2845     /**
2846      * Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
2847      * convey some sort of application status or to passively notify the user.
2848      *
2849      * @platform win32
2850      */
2851     setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
2852     /**
2853      * Sets `parent` as current window's parent window, passing `null` will turn
2854      * current window into a top-level window.
2855      */
2856     setParentWindow(parent: (BrowserWindow) | (null)): void;
2857     /**
2858      * Moves window to `x` and `y`.
2859      */
2860     setPosition(x: number, y: number, animate?: boolean): void;
2861     /**
2862      * Sets progress value in progress bar. Valid range is [0, 1.0].
2863      *
2864      * Remove progress bar when progress < 0; Change to indeterminate mode when
2865      * progress > 1.
2866      *
2867      * On Linux platform, only supports Unity desktop environment, you need to specify
2868      * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
2869      * it will assume `{app.name}.desktop`.
2870      *
2871      * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
2872      * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
2873      * mode set (but with a value within the valid range), `normal` will be assumed.
2874      */
2875     setProgressBar(progress: number, options?: ProgressBarOptions): void;
2876     /**
2877      * Sets the pathname of the file the window represents, and the icon of the file
2878      * will show in window's title bar.
2879      *
2880      * @platform darwin
2881      */
2882     setRepresentedFilename(filename: string): void;
2883     /**
2884      * Sets whether the window can be manually resized by the user.
2885      */
2886     setResizable(resizable: boolean): void;
2887     /**
2888      * Setting a window shape determines the area within the window where the system
2889      * permits drawing and user interaction. Outside of the given region, no pixels
2890      * will be drawn and no mouse events will be registered. Mouse events outside of
2891      * the region will not be received by that window, but will fall through to
2892      * whatever is behind the window.
2893      *
2894      * @experimental
2895      * @platform win32,linux
2896      */
2897     setShape(rects: Rectangle[]): void;
2898     /**
2899      * Changes the attachment point for sheets on macOS. By default, sheets are
2900      * attached just below the window frame, but you may want to display them beneath a
2901      * HTML-rendered toolbar. For example:
2902      *
2903      * @platform darwin
2904      */
2905     setSheetOffset(offsetY: number, offsetX?: number): void;
2906     /**
2907      * Enters or leaves simple fullscreen mode.
2908      *
2909      * Simple fullscreen mode emulates the native fullscreen behavior found in versions
2910      * of macOS prior to Lion (10.7).
2911      *
2912      * @platform darwin
2913      */
2914     setSimpleFullScreen(flag: boolean): void;
2915     /**
2916      * Resizes the window to `width` and `height`. If `width` or `height` are below any
2917      * set minimum size constraints the window will snap to its minimum size.
2918      */
2919     setSize(width: number, height: number, animate?: boolean): void;
2920     /**
2921      * Makes the window not show in the taskbar.
2922      *
2923      * @platform darwin,win32
2924      */
2925     setSkipTaskbar(skip: boolean): void;
2926     /**
2927      * Whether the buttons were added successfully
2928      *
2929      * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
2930      * of a window in a taskbar button layout. Returns a `boolean` object indicates
2931      * whether the thumbnail has been added successfully.
2932      *
2933      * The number of buttons in thumbnail toolbar should be no greater than 7 due to
2934      * the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
2935      * removed due to the platform's limitation. But you can call the API with an empty
2936      * array to clean the buttons.
2937      *
2938      * The `buttons` is an array of `Button` objects:
2939      *
2940      * * `Button` Object
2941      *   * `icon` NativeImage - The icon showing in thumbnail toolbar.
2942      *   * `click` Function
2943      *   * `tooltip` string (optional) - The text of the button's tooltip.
2944      *   * `flags` string[] (optional) - Control specific states and behaviors of the
2945      * button. By default, it is `['enabled']`.
2946      *
2947      * The `flags` is an array that can include following `string`s:
2948      *
2949      * * `enabled` - The button is active and available to the user.
2950      * * `disabled` - The button is disabled. It is present, but has a visual state
2951      * indicating it will not respond to user action.
2952      * * `dismissonclick` - When the button is clicked, the thumbnail window closes
2953      * immediately.
2954      * * `nobackground` - Do not draw a button border, use only the image.
2955      * * `hidden` - The button is not shown to the user.
2956      * * `noninteractive` - The button is enabled but not interactive; no pressed
2957      * button state is drawn. This value is intended for instances where the button is
2958      * used in a notification.
2959      *
2960      * @platform win32
2961      */
2962     setThumbarButtons(buttons: ThumbarButton[]): boolean;
2963     /**
2964      * Sets the region of the window to show as the thumbnail image displayed when
2965      * hovering over the window in the taskbar. You can reset the thumbnail to be the
2966      * entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
2967      * }`.
2968      *
2969      * @platform win32
2970      */
2971     setThumbnailClip(region: Rectangle): void;
2972     /**
2973      * Sets the toolTip that is displayed when hovering over the window thumbnail in
2974      * the taskbar.
2975      *
2976      * @platform win32
2977      */
2978     setThumbnailToolTip(toolTip: string): void;
2979     /**
2980      * Changes the title of native window to `title`.
2981      */
2982     setTitle(title: string): void;
2983     /**
2984      * On a Window with Window Controls Overlay already enabled, this method updates
2985      * the style of the title bar overlay.
2986      *
2987      * @platform win32
2988      */
2989     setTitleBarOverlay(options: TitleBarOverlayOptions): void;
2990     /**
2991      * Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
2992      * error if `browserView` is not attached to `win`.
2993      *
2994      * @experimental
2995      */
2996     setTopBrowserView(browserView: BrowserView): void;
2997     /**
2998      * Sets the touchBar layout for the current window. Specifying `null` or
2999      * `undefined` clears the touch bar. This method only has an effect if the machine
3000      * has a touch bar and is running on macOS 10.12.1+.
3001      *
3002      * **Note:** The TouchBar API is currently experimental and may change or be
3003      * removed in future Electron releases.
3004      *
3005      * @platform darwin
3006      */
3007     setTouchBar(touchBar: (TouchBar) | (null)): void;
3008     /**
3009      * Set a custom position for the traffic light buttons in frameless window.
3010      *
3011      * @platform darwin
3012      */
3013     setTrafficLightPosition(position: Point): void;
3014     /**
3015      * Adds a vibrancy effect to the browser window. Passing `null` or an empty string
3016      * will remove the vibrancy effect on the window.
3017      *
3018      * Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark`
3019      * have been deprecated and will be removed in an upcoming version of macOS.
3020      *
3021      * @platform darwin
3022      */
3023     setVibrancy(type: (('appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
3024     /**
3025      * Sets whether the window should be visible on all workspaces.
3026      *
3027      * **Note:** This API does nothing on Windows.
3028      *
3029      * @platform darwin,linux
3030      */
3031     setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
3032     /**
3033      * Sets whether the window traffic light buttons should be visible.
3034      *
3035      * @platform darwin
3036      */
3037     setWindowButtonVisibility(visible: boolean): void;
3038     /**
3039      * Shows and gives focus to the window.
3040      */
3041     show(): void;
3042     /**
3043      * Same as `webContents.showDefinitionForSelection()`.
3044      *
3045      * @platform darwin
3046      */
3047     showDefinitionForSelection(): void;
3048     /**
3049      * Shows the window but doesn't focus on it.
3050      */
3051     showInactive(): void;
3052     /**
3053      * Toggles the visibility of the tab bar if native tabs are enabled and there is
3054      * only one tab in the current window.
3055      *
3056      * @platform darwin
3057      */
3058     toggleTabBar(): void;
3059     /**
3060      * Unhooks all of the window messages.
3061      *
3062      * @platform win32
3063      */
3064     unhookAllWindowMessages(): void;
3065     /**
3066      * Unhook the window message.
3067      *
3068      * @platform win32
3069      */
3070     unhookWindowMessage(message: number): void;
3071     /**
3072      * Unmaximizes the window.
3073      */
3074     unmaximize(): void;
3075     /**
3076      * A `string` property that defines an alternative title provided only to
3077      * accessibility tools such as screen readers. This string is not directly visible
3078      * to users.
3079      */
3080     accessibleTitle: string;
3081     /**
3082      * A `boolean` property that determines whether the window menu bar should hide
3083      * itself automatically. Once set, the menu bar will only show when users press the
3084      * single `Alt` key.
3085      *
3086      * If the menu bar is already visible, setting this property to `true` won't hide
3087      * it immediately.
3088      */
3089     autoHideMenuBar: boolean;
3090     /**
3091      * A `boolean` property that determines whether the window can be manually closed
3092      * by user.
3093      *
3094      * On Linux the setter is a no-op, although the getter returns `true`.
3095      *
3096      * @platform darwin,win32
3097      */
3098     closable: boolean;
3099     /**
3100      * A `boolean` property that specifies whether the window’s document has been
3101      * edited.
3102      *
3103      * The icon in title bar will become gray when set to `true`.
3104      *
3105      * @platform darwin
3106      */
3107     documentEdited: boolean;
3108     /**
3109      * A `boolean` property that determines whether the window is excluded from the
3110      * application’s Windows menu. `false` by default.
3111      *
3112      * @platform darwin
3113      */
3114     excludedFromShownWindowsMenu: boolean;
3115     /**
3116      * A `boolean` property that determines whether the window is focusable.
3117      *
3118      * @platform win32,darwin
3119      */
3120     focusable: boolean;
3121     /**
3122      * A `boolean` property that determines whether the window is in fullscreen mode.
3123      */
3124     fullScreen: boolean;
3125     /**
3126      * A `boolean` property that determines whether the maximize/zoom window button
3127      * toggles fullscreen mode or maximizes the window.
3128      */
3129     fullScreenable: boolean;
3130     /**
3131      * A `Integer` property representing the unique ID of the window. Each ID is unique
3132      * among all `BrowserWindow` instances of the entire Electron application.
3133      *
3134      */
3135     readonly id: number;
3136     /**
3137      * A `boolean` property that determines whether the window is in kiosk mode.
3138      */
3139     kiosk: boolean;
3140     /**
3141      * A `boolean` property that determines whether the window can be manually
3142      * maximized by user.
3143      *
3144      * On Linux the setter is a no-op, although the getter returns `true`.
3145      *
3146      * @platform darwin,win32
3147      */
3148     maximizable: boolean;
3149     /**
3150      * A `boolean` property that determines whether the menu bar should be visible.
3151      *
3152      * **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
3153      * pressing the single `Alt` key.
3154      *
3155      * @platform win32,linux
3156      */
3157     menuBarVisible: boolean;
3158     /**
3159      * A `boolean` property that determines whether the window can be manually
3160      * minimized by user.
3161      *
3162      * On Linux the setter is a no-op, although the getter returns `true`.
3163      *
3164      * @platform darwin,win32
3165      */
3166     minimizable: boolean;
3167     /**
3168      * A `boolean` property that determines Whether the window can be moved by user.
3169      *
3170      * On Linux the setter is a no-op, although the getter returns `true`.
3171      *
3172      * @platform darwin,win32
3173      */
3174     movable: boolean;
3175     /**
3176      * A `string` property that determines the pathname of the file the window
3177      * represents, and the icon of the file will show in window's title bar.
3178      *
3179      * @platform darwin
3180      */
3181     representedFilename: string;
3182     /**
3183      * A `boolean` property that determines whether the window can be manually resized
3184      * by user.
3185      */
3186     resizable: boolean;
3187     /**
3188      * A `boolean` property that determines whether the window has a shadow.
3189      */
3190     shadow: boolean;
3191     /**
3192      * A `boolean` property that determines whether the window is in simple (pre-Lion)
3193      * fullscreen mode.
3194      */
3195     simpleFullScreen: boolean;
3196     /**
3197      * A `string` property that determines the title of the native window.
3198      *
3199      * **Note:** The title of the web page can be different from the title of the
3200      * native window.
3201      */
3202     title: string;
3203     /**
3204      * A `boolean` property that determines whether the window is visible on all
3205      * workspaces.
3206      *
3207      * **Note:** Always returns false on Windows.
3208      *
3209      * @platform darwin,linux
3210      */
3211     visibleOnAllWorkspaces: boolean;
3212     /**
3213      * A `WebContents` object this window owns. All web page related events and
3214      * operations will be done via it.
3215      *
3216      * See the `webContents` documentation for its methods and events.
3217      *
3218      */
3219     readonly webContents: WebContents;
3220   }
3221
3222   interface Certificate {
3223
3224     // Docs: https://electronjs.org/docs/api/structures/certificate
3225
3226     /**
3227      * PEM encoded data
3228      */
3229     data: string;
3230     /**
3231      * Fingerprint of the certificate
3232      */
3233     fingerprint: string;
3234     /**
3235      * Issuer principal
3236      */
3237     issuer: CertificatePrincipal;
3238     /**
3239      * Issuer certificate (if not self-signed)
3240      */
3241     issuerCert: Certificate;
3242     /**
3243      * Issuer's Common Name
3244      */
3245     issuerName: string;
3246     /**
3247      * Hex value represented string
3248      */
3249     serialNumber: string;
3250     /**
3251      * Subject principal
3252      */
3253     subject: CertificatePrincipal;
3254     /**
3255      * Subject's Common Name
3256      */
3257     subjectName: string;
3258     /**
3259      * End date of the certificate being valid in seconds
3260      */
3261     validExpiry: number;
3262     /**
3263      * Start date of the certificate being valid in seconds
3264      */
3265     validStart: number;
3266   }
3267
3268   interface CertificatePrincipal {
3269
3270     // Docs: https://electronjs.org/docs/api/structures/certificate-principal
3271
3272     /**
3273      * Common Name.
3274      */
3275     commonName: string;
3276     /**
3277      * Country or region.
3278      */
3279     country: string;
3280     /**
3281      * Locality.
3282      */
3283     locality: string;
3284     /**
3285      * Organization names.
3286      */
3287     organizations: string[];
3288     /**
3289      * Organization Unit names.
3290      */
3291     organizationUnits: string[];
3292     /**
3293      * State or province.
3294      */
3295     state: string;
3296   }
3297
3298   class ClientRequest extends NodeEventEmitter {
3299
3300     // Docs: https://electronjs.org/docs/api/client-request
3301
3302     /**
3303      * Emitted when the `request` is aborted. The `abort` event will not be fired if
3304      * the `request` is already closed.
3305      */
3306     on(event: 'abort', listener: Function): this;
3307     once(event: 'abort', listener: Function): this;
3308     addListener(event: 'abort', listener: Function): this;
3309     removeListener(event: 'abort', listener: Function): this;
3310     /**
3311      * Emitted as the last event in the HTTP request-response transaction. The `close`
3312      * event indicates that no more events will be emitted on either the `request` or
3313      * `response` objects.
3314      */
3315     on(event: 'close', listener: Function): this;
3316     once(event: 'close', listener: Function): this;
3317     addListener(event: 'close', listener: Function): this;
3318     removeListener(event: 'close', listener: Function): this;
3319     /**
3320      * Emitted when the `net` module fails to issue a network request. Typically when
3321      * the `request` object emits an `error` event, a `close` event will subsequently
3322      * follow and no response object will be provided.
3323      */
3324     on(event: 'error', listener: (
3325                                   /**
3326                                    * an error object providing some information about the failure.
3327                                    */
3328                                   error: Error) => void): this;
3329     once(event: 'error', listener: (
3330                                   /**
3331                                    * an error object providing some information about the failure.
3332                                    */
3333                                   error: Error) => void): this;
3334     addListener(event: 'error', listener: (
3335                                   /**
3336                                    * an error object providing some information about the failure.
3337                                    */
3338                                   error: Error) => void): this;
3339     removeListener(event: 'error', listener: (
3340                                   /**
3341                                    * an error object providing some information about the failure.
3342                                    */
3343                                   error: Error) => void): this;
3344     /**
3345      * Emitted just after the last chunk of the `request`'s data has been written into
3346      * the `request` object.
3347      */
3348     on(event: 'finish', listener: Function): this;
3349     once(event: 'finish', listener: Function): this;
3350     addListener(event: 'finish', listener: Function): this;
3351     removeListener(event: 'finish', listener: Function): this;
3352     /**
3353      * Emitted when an authenticating proxy is asking for user credentials.
3354      *
3355      * The `callback` function is expected to be called back with user credentials:
3356      *
3357      * * `username` string
3358      * * `password` string
3359      *
3360      * Providing empty credentials will cancel the request and report an authentication
3361      * error on the response object:
3362      */
3363     on(event: 'login', listener: (authInfo: AuthInfo,
3364                                   callback: (username?: string, password?: string) => void) => void): this;
3365     once(event: 'login', listener: (authInfo: AuthInfo,
3366                                   callback: (username?: string, password?: string) => void) => void): this;
3367     addListener(event: 'login', listener: (authInfo: AuthInfo,
3368                                   callback: (username?: string, password?: string) => void) => void): this;
3369     removeListener(event: 'login', listener: (authInfo: AuthInfo,
3370                                   callback: (username?: string, password?: string) => void) => void): this;
3371     /**
3372      * Emitted when the server returns a redirect response (e.g. 301 Moved
3373      * Permanently). Calling `request.followRedirect` will continue with the
3374      * redirection.  If this event is handled, `request.followRedirect` must be called
3375      * **synchronously**, otherwise the request will be cancelled.
3376      */
3377     on(event: 'redirect', listener: (statusCode: number,
3378                                      method: string,
3379                                      redirectUrl: string,
3380                                      responseHeaders: Record<string, string[]>) => void): this;
3381     once(event: 'redirect', listener: (statusCode: number,
3382                                      method: string,
3383                                      redirectUrl: string,
3384                                      responseHeaders: Record<string, string[]>) => void): this;
3385     addListener(event: 'redirect', listener: (statusCode: number,
3386                                      method: string,
3387                                      redirectUrl: string,
3388                                      responseHeaders: Record<string, string[]>) => void): this;
3389     removeListener(event: 'redirect', listener: (statusCode: number,
3390                                      method: string,
3391                                      redirectUrl: string,
3392                                      responseHeaders: Record<string, string[]>) => void): this;
3393     on(event: 'response', listener: (
3394                                      /**
3395                                       * An object representing the HTTP response message.
3396                                       */
3397                                      response: IncomingMessage) => void): this;
3398     once(event: 'response', listener: (
3399                                      /**
3400                                       * An object representing the HTTP response message.
3401                                       */
3402                                      response: IncomingMessage) => void): this;
3403     addListener(event: 'response', listener: (
3404                                      /**
3405                                       * An object representing the HTTP response message.
3406                                       */
3407                                      response: IncomingMessage) => void): this;
3408     removeListener(event: 'response', listener: (
3409                                      /**
3410                                       * An object representing the HTTP response message.
3411                                       */
3412                                      response: IncomingMessage) => void): this;
3413     /**
3414      * ClientRequest
3415      */
3416     constructor(options: (ClientRequestConstructorOptions) | (string));
3417     /**
3418      * Cancels an ongoing HTTP transaction. If the request has already emitted the
3419      * `close` event, the abort operation will have no effect. Otherwise an ongoing
3420      * event will emit `abort` and `close` events. Additionally, if there is an ongoing
3421      * response object,it will emit the `aborted` event.
3422      */
3423     abort(): void;
3424     /**
3425      * Sends the last chunk of the request data. Subsequent write or end operations
3426      * will not be allowed. The `finish` event is emitted just after the end operation.
3427      */
3428     end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): void;
3429     /**
3430      * Continues any pending redirection. Can only be called during a `'redirect'`
3431      * event.
3432      */
3433     followRedirect(): void;
3434     /**
3435      * The value of a previously set extra header name.
3436      */
3437     getHeader(name: string): string;
3438     /**
3439      * * `active` boolean - Whether the request is currently active. If this is false
3440      * no other properties will be set
3441      * * `started` boolean - Whether the upload has started. If this is false both
3442      * `current` and `total` will be set to 0.
3443      * * `current` Integer - The number of bytes that have been uploaded so far
3444      * * `total` Integer - The number of bytes that will be uploaded this request
3445      *
3446      * You can use this method in conjunction with `POST` requests to get the progress
3447      * of a file upload or other data transfer.
3448      */
3449     getUploadProgress(): UploadProgress;
3450     /**
3451      * Removes a previously set extra header name. This method can be called only
3452      * before first write. Trying to call it after the first write will throw an error.
3453      */
3454     removeHeader(name: string): void;
3455     /**
3456      * Adds an extra HTTP header. The header name will be issued as-is without
3457      * lowercasing. It can be called only before first write. Calling this method after
3458      * the first write will throw an error. If the passed value is not a `string`, its
3459      * `toString()` method will be called to obtain the final value.
3460      *
3461      * Certain headers are restricted from being set by apps. These headers are listed
3462      * below. More information on restricted headers can be found in Chromium's header
3463      * utils.
3464      *
3465      * * `Content-Length`
3466      * * `Host`
3467      * * `Trailer` or `Te`
3468      * * `Upgrade`
3469      * * `Cookie2`
3470      * * `Keep-Alive`
3471      * * `Transfer-Encoding`
3472      *
3473      * Additionally, setting the `Connection` header to the value `upgrade` is also
3474      * disallowed.
3475      */
3476     setHeader(name: string, value: string): void;
3477     /**
3478      * `callback` is essentially a dummy function introduced in the purpose of keeping
3479      * similarity with the Node.js API. It is called asynchronously in the next tick
3480      * after `chunk` content have been delivered to the Chromium networking layer.
3481      * Contrary to the Node.js implementation, it is not guaranteed that `chunk`
3482      * content have been flushed on the wire before `callback` is called.
3483      *
3484      * Adds a chunk of data to the request body. The first write operation may cause
3485      * the request headers to be issued on the wire. After the first write operation,
3486      * it is not allowed to add or remove a custom header.
3487      */
3488     write(chunk: (string) | (Buffer), encoding?: string, callback?: () => void): void;
3489     /**
3490      * A `boolean` specifying whether the request will use HTTP chunked transfer
3491      * encoding or not. Defaults to false. The property is readable and writable,
3492      * however it can be set only before the first write operation as the HTTP headers
3493      * are not yet put on the wire. Trying to set the `chunkedEncoding` property after
3494      * the first write will throw an error.
3495      *
3496      * Using chunked encoding is strongly recommended if you need to send a large
3497      * request body as data will be streamed in small chunks instead of being
3498      * internally buffered inside Electron process memory.
3499      */
3500     chunkedEncoding: boolean;
3501   }
3502
3503   interface Clipboard {
3504
3505     // Docs: https://electronjs.org/docs/api/clipboard
3506
3507     /**
3508      * An array of supported formats for the clipboard `type`.
3509      */
3510     availableFormats(type?: 'selection' | 'clipboard'): string[];
3511     /**
3512      * Clears the clipboard content.
3513      */
3514     clear(type?: 'selection' | 'clipboard'): void;
3515     /**
3516      * Whether the clipboard supports the specified `format`.
3517      *
3518      * @experimental
3519      */
3520     has(format: string, type?: 'selection' | 'clipboard'): boolean;
3521     /**
3522      * Reads `format` type from the clipboard.
3523      *
3524      * `format` should contain valid ASCII characters and have `/` separator. `a/c`,
3525      * `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid.
3526      *
3527      * @experimental
3528      */
3529     read(format: string): string;
3530     /**
3531      * * `title` string
3532      * * `url` string
3533      *
3534      * Returns an Object containing `title` and `url` keys representing the bookmark in
3535      * the clipboard. The `title` and `url` values will be empty strings when the
3536      * bookmark is unavailable.  The `title` value will always be empty on Windows.
3537      *
3538      * @platform darwin,win32
3539      */
3540     readBookmark(): ReadBookmark;
3541     /**
3542      * Reads `format` type from the clipboard.
3543      *
3544      * @experimental
3545      */
3546     readBuffer(format: string): Buffer;
3547     /**
3548      * The text on the find pasteboard, which is the pasteboard that holds information
3549      * about the current state of the active application’s find panel.
3550      *
3551      * This method uses synchronous IPC when called from the renderer process. The
3552      * cached value is reread from the find pasteboard whenever the application is
3553      * activated.
3554      *
3555      * @platform darwin
3556      */
3557     readFindText(): string;
3558     /**
3559      * The content in the clipboard as markup.
3560      */
3561     readHTML(type?: 'selection' | 'clipboard'): string;
3562     /**
3563      * The image content in the clipboard.
3564      */
3565     readImage(type?: 'selection' | 'clipboard'): NativeImage;
3566     /**
3567      * The content in the clipboard as RTF.
3568      */
3569     readRTF(type?: 'selection' | 'clipboard'): string;
3570     /**
3571      * The content in the clipboard as plain text.
3572      */
3573     readText(type?: 'selection' | 'clipboard'): string;
3574     /**
3575      * Writes `data` to the clipboard.
3576      */
3577     write(data: Data, type?: 'selection' | 'clipboard'): void;
3578     /**
3579      * Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
3580      *
3581      * **Note:** Most apps on Windows don't support pasting bookmarks into them so you
3582      * can use `clipboard.write` to write both a bookmark and fallback text to the
3583      * clipboard.
3584      *
3585      * @platform darwin,win32
3586      */
3587     writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
3588     /**
3589      * Writes the `buffer` into the clipboard as `format`.
3590      *
3591      * @experimental
3592      */
3593     writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
3594     /**
3595      * Writes the `text` into the find pasteboard (the pasteboard that holds
3596      * information about the current state of the active application’s find panel) as
3597      * plain text. This method uses synchronous IPC when called from the renderer
3598      * process.
3599      *
3600      * @platform darwin
3601      */
3602     writeFindText(text: string): void;
3603     /**
3604      * Writes `markup` to the clipboard.
3605      */
3606     writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
3607     /**
3608      * Writes `image` to the clipboard.
3609      */
3610     writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
3611     /**
3612      * Writes the `text` into the clipboard in RTF.
3613      */
3614     writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
3615     /**
3616      * Writes the `text` into the clipboard as plain text.
3617      */
3618     writeText(text: string, type?: 'selection' | 'clipboard'): void;
3619   }
3620
3621   class CommandLine {
3622
3623     // Docs: https://electronjs.org/docs/api/command-line
3624
3625     /**
3626      * Append an argument to Chromium's command line. The argument will be quoted
3627      * correctly. Switches will precede arguments regardless of appending order.
3628      *
3629      * If you're appending an argument like `--switch=value`, consider using
3630      * `appendSwitch('switch', 'value')` instead.
3631      *
3632      * **Note:** This will not affect `process.argv`. The intended usage of this
3633      * function is to control Chromium's behavior.
3634      */
3635     appendArgument(value: string): void;
3636     /**
3637      * Append a switch (with optional `value`) to Chromium's command line.
3638      *
3639      * **Note:** This will not affect `process.argv`. The intended usage of this
3640      * function is to control Chromium's behavior.
3641      */
3642     appendSwitch(the_switch: string, value?: string): void;
3643     /**
3644      * The command-line switch value.
3645      *
3646      * **Note:** When the switch is not present or has no value, it returns empty
3647      * string.
3648      */
3649     getSwitchValue(the_switch: string): string;
3650     /**
3651      * Whether the command-line switch is present.
3652      */
3653     hasSwitch(the_switch: string): boolean;
3654     /**
3655      * Removes the specified switch from Chromium's command line.
3656      *
3657      * **Note:** This will not affect `process.argv`. The intended usage of this
3658      * function is to control Chromium's behavior.
3659      */
3660     removeSwitch(the_switch: string): void;
3661   }
3662
3663   interface ContentTracing {
3664
3665     // Docs: https://electronjs.org/docs/api/content-tracing
3666
3667     /**
3668      * resolves with an array of category groups once all child processes have
3669      * acknowledged the `getCategories` request
3670      *
3671      * Get a set of category groups. The category groups can change as new code paths
3672      * are reached. See also the list of built-in tracing categories.
3673      *
3674      * > **NOTE:** Electron adds a non-default tracing category called `"electron"`.
3675      * This category can be used to capture Electron-specific tracing events.
3676      */
3677     getCategories(): Promise<string[]>;
3678     /**
3679      * Resolves with an object containing the `value` and `percentage` of trace buffer
3680      * maximum usage
3681      *
3682      * * `value` number
3683      * * `percentage` number
3684      *
3685      * Get the maximum usage across processes of trace buffer as a percentage of the
3686      * full state.
3687      */
3688     getTraceBufferUsage(): Promise<Electron.TraceBufferUsageReturnValue>;
3689     /**
3690      * resolved once all child processes have acknowledged the `startRecording`
3691      * request.
3692      *
3693      * Start recording on all processes.
3694      *
3695      * Recording begins immediately locally and asynchronously on child processes as
3696      * soon as they receive the EnableRecording request.
3697      *
3698      * If a recording is already running, the promise will be immediately resolved, as
3699      * only one trace operation can be in progress at a time.
3700      */
3701     startRecording(options: (TraceConfig) | (TraceCategoriesAndOptions)): Promise<void>;
3702     /**
3703      * resolves with a path to a file that contains the traced data once all child
3704      * processes have acknowledged the `stopRecording` request
3705      *
3706      * Stop recording on all processes.
3707      *
3708      * Child processes typically cache trace data and only rarely flush and send trace
3709      * data back to the main process. This helps to minimize the runtime overhead of
3710      * tracing since sending trace data over IPC can be an expensive operation. So, to
3711      * end tracing, Chromium asynchronously asks all child processes to flush any
3712      * pending trace data.
3713      *
3714      * Trace data will be written into `resultFilePath`. If `resultFilePath` is empty
3715      * or not provided, trace data will be written to a temporary file, and the path
3716      * will be returned in the promise.
3717      */
3718     stopRecording(resultFilePath?: string): Promise<string>;
3719   }
3720
3721   interface ContextBridge {
3722
3723     // Docs: https://electronjs.org/docs/api/context-bridge
3724
3725     exposeInIsolatedWorld(worldId: number, apiKey: string, api: any): void;
3726     exposeInMainWorld(apiKey: string, api: any): void;
3727   }
3728
3729   interface Cookie {
3730
3731     // Docs: https://electronjs.org/docs/api/structures/cookie
3732
3733     /**
3734      * The domain of the cookie; this will be normalized with a preceding dot so that
3735      * it's also valid for subdomains.
3736      */
3737     domain?: string;
3738     /**
3739      * The expiration date of the cookie as the number of seconds since the UNIX epoch.
3740      * Not provided for session cookies.
3741      */
3742     expirationDate?: number;
3743     /**
3744      * Whether the cookie is a host-only cookie; this will only be `true` if no domain
3745      * was passed.
3746      */
3747     hostOnly?: boolean;
3748     /**
3749      * Whether the cookie is marked as HTTP only.
3750      */
3751     httpOnly?: boolean;
3752     /**
3753      * The name of the cookie.
3754      */
3755     name: string;
3756     /**
3757      * The path of the cookie.
3758      */
3759     path?: string;
3760     /**
3761      * The Same Site policy applied to this cookie.  Can be `unspecified`,
3762      * `no_restriction`, `lax` or `strict`.
3763      */
3764     sameSite: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
3765     /**
3766      * Whether the cookie is marked as secure.
3767      */
3768     secure?: boolean;
3769     /**
3770      * Whether the cookie is a session cookie or a persistent cookie with an expiration
3771      * date.
3772      */
3773     session?: boolean;
3774     /**
3775      * The value of the cookie.
3776      */
3777     value: string;
3778   }
3779
3780   class Cookies extends NodeEventEmitter {
3781
3782     // Docs: https://electronjs.org/docs/api/cookies
3783
3784     /**
3785      * Emitted when a cookie is changed because it was added, edited, removed, or
3786      * expired.
3787      */
3788     on(event: 'changed', listener: (event: Event,
3789                                     /**
3790                                      * The cookie that was changed.
3791                                      */
3792                                     cookie: Cookie,
3793                                     /**
3794                                      * The cause of the change with one of the following values:
3795                                      */
3796                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
3797                                     /**
3798                                      * `true` if the cookie was removed, `false` otherwise.
3799                                      */
3800                                     removed: boolean) => void): this;
3801     once(event: 'changed', listener: (event: Event,
3802                                     /**
3803                                      * The cookie that was changed.
3804                                      */
3805                                     cookie: Cookie,
3806                                     /**
3807                                      * The cause of the change with one of the following values:
3808                                      */
3809                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
3810                                     /**
3811                                      * `true` if the cookie was removed, `false` otherwise.
3812                                      */
3813                                     removed: boolean) => void): this;
3814     addListener(event: 'changed', listener: (event: Event,
3815                                     /**
3816                                      * The cookie that was changed.
3817                                      */
3818                                     cookie: Cookie,
3819                                     /**
3820                                      * The cause of the change with one of the following values:
3821                                      */
3822                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
3823                                     /**
3824                                      * `true` if the cookie was removed, `false` otherwise.
3825                                      */
3826                                     removed: boolean) => void): this;
3827     removeListener(event: 'changed', listener: (event: Event,
3828                                     /**
3829                                      * The cookie that was changed.
3830                                      */
3831                                     cookie: Cookie,
3832                                     /**
3833                                      * The cause of the change with one of the following values:
3834                                      */
3835                                     cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
3836                                     /**
3837                                      * `true` if the cookie was removed, `false` otherwise.
3838                                      */
3839                                     removed: boolean) => void): this;
3840     /**
3841      * A promise which resolves when the cookie store has been flushed
3842      *
3843      * Writes any unwritten cookies data to disk.
3844      */
3845     flushStore(): Promise<void>;
3846     /**
3847      * A promise which resolves an array of cookie objects.
3848      *
3849      * Sends a request to get all cookies matching `filter`, and resolves a promise
3850      * with the response.
3851      */
3852     get(filter: CookiesGetFilter): Promise<Electron.Cookie[]>;
3853     /**
3854      * A promise which resolves when the cookie has been removed
3855      *
3856      * Removes the cookies matching `url` and `name`
3857      */
3858     remove(url: string, name: string): Promise<void>;
3859     /**
3860      * A promise which resolves when the cookie has been set
3861      *
3862      * Sets a cookie with `details`.
3863      */
3864     set(details: CookiesSetDetails): Promise<void>;
3865   }
3866
3867   interface CPUUsage {
3868
3869     // Docs: https://electronjs.org/docs/api/structures/cpu-usage
3870
3871     /**
3872      * The number of average idle CPU wakeups per second since the last call to
3873      * getCPUUsage. First call returns 0. Will always return 0 on Windows.
3874      */
3875     idleWakeupsPerSecond: number;
3876     /**
3877      * Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
3878      */
3879     percentCPUUsage: number;
3880   }
3881
3882   interface CrashReport {
3883
3884     // Docs: https://electronjs.org/docs/api/structures/crash-report
3885
3886     date: Date;
3887     id: string;
3888   }
3889
3890   interface CrashReporter {
3891
3892     // Docs: https://electronjs.org/docs/api/crash-reporter
3893
3894     /**
3895      * Set an extra parameter to be sent with the crash report. The values specified
3896      * here will be sent in addition to any values set via the `extra` option when
3897      * `start` was called.
3898      *
3899      * Parameters added in this fashion (or via the `extra` parameter to
3900      * `crashReporter.start`) are specific to the calling process. Adding extra
3901      * parameters in the main process will not cause those parameters to be sent along
3902      * with crashes from renderer or other child processes. Similarly, adding extra
3903      * parameters in a renderer process will not result in those parameters being sent
3904      * with crashes that occur in other renderer processes or in the main process.
3905      *
3906      * **Note:** Parameters have limits on the length of the keys and values. Key names
3907      * must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
3908      * Keys with names longer than the maximum will be silently ignored. Key values
3909      * longer than the maximum length will be truncated.
3910      */
3911     addExtraParameter(key: string, value: string): void;
3912     /**
3913      * The date and ID of the last crash report. Only crash reports that have been
3914      * uploaded will be returned; even if a crash report is present on disk it will not
3915      * be returned until it is uploaded. In the case that there are no uploaded
3916      * reports, `null` is returned.
3917      *
3918      * **Note:** This method is only available in the main process.
3919      */
3920     getLastCrashReport(): CrashReport;
3921     /**
3922      * The current 'extra' parameters of the crash reporter.
3923      */
3924     getParameters(): Record<string, string>;
3925     /**
3926      * Returns all uploaded crash reports. Each report contains the date and uploaded
3927      * ID.
3928      *
3929      * **Note:** This method is only available in the main process.
3930      */
3931     getUploadedReports(): CrashReport[];
3932     /**
3933      * Whether reports should be submitted to the server. Set through the `start`
3934      * method or `setUploadToServer`.
3935      *
3936      * **Note:** This method is only available in the main process.
3937      */
3938     getUploadToServer(): boolean;
3939     /**
3940      * Remove an extra parameter from the current set of parameters. Future crashes
3941      * will not include this parameter.
3942      */
3943     removeExtraParameter(key: string): void;
3944     /**
3945      * This would normally be controlled by user preferences. This has no effect if
3946      * called before `start` is called.
3947      *
3948      * **Note:** This method is only available in the main process.
3949      */
3950     setUploadToServer(uploadToServer: boolean): void;
3951     /**
3952      * This method must be called before using any other `crashReporter` APIs. Once
3953      * initialized this way, the crashpad handler collects crashes from all
3954      * subsequently created processes. The crash reporter cannot be disabled once
3955      * started.
3956      *
3957      * This method should be called as early as possible in app startup, preferably
3958      * before `app.on('ready')`. If the crash reporter is not initialized at the time a
3959      * renderer process is created, then that renderer process will not be monitored by
3960      * the crash reporter.
3961      *
3962      * **Note:** You can test out the crash reporter by generating a crash using
3963      * `process.crash()`.
3964      *
3965      * **Note:** If you need to send additional/updated `extra` parameters after your
3966      * first call `start` you can call `addExtraParameter`.
3967      *
3968      * **Note:** Parameters passed in `extra`, `globalExtra` or set with
3969      * `addExtraParameter` have limits on the length of the keys and values. Key names
3970      * must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
3971      * with names longer than the maximum will be silently ignored. Key values longer
3972      * than the maximum length will be truncated.
3973      *
3974      * **Note:** This method is only available in the main process.
3975      */
3976     start(options: CrashReporterStartOptions): void;
3977   }
3978
3979   interface CustomScheme {
3980
3981     // Docs: https://electronjs.org/docs/api/structures/custom-scheme
3982
3983     privileges?: Privileges;
3984     /**
3985      * Custom schemes to be registered with options.
3986      */
3987     scheme: string;
3988   }
3989
3990   class Debugger extends NodeEventEmitter {
3991
3992     // Docs: https://electronjs.org/docs/api/debugger
3993
3994     /**
3995      * Emitted when the debugging session is terminated. This happens either when
3996      * `webContents` is closed or devtools is invoked for the attached `webContents`.
3997      */
3998     on(event: 'detach', listener: (event: Event,
3999                                    /**
4000                                     * Reason for detaching debugger.
4001                                     */
4002                                    reason: string) => void): this;
4003     once(event: 'detach', listener: (event: Event,
4004                                    /**
4005                                     * Reason for detaching debugger.
4006                                     */
4007                                    reason: string) => void): this;
4008     addListener(event: 'detach', listener: (event: Event,
4009                                    /**
4010                                     * Reason for detaching debugger.
4011                                     */
4012                                    reason: string) => void): this;
4013     removeListener(event: 'detach', listener: (event: Event,
4014                                    /**
4015                                     * Reason for detaching debugger.
4016                                     */
4017                                    reason: string) => void): this;
4018     /**
4019      * Emitted whenever the debugging target issues an instrumentation event.
4020      */
4021     on(event: 'message', listener: (event: Event,
4022                                     /**
4023                                      * Method name.
4024                                      */
4025                                     method: string,
4026                                     /**
4027                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4028                                      * protocol.
4029                                      */
4030                                     params: any,
4031                                     /**
4032                                      * Unique identifier of attached debugging session, will match the value sent from
4033                                      * `debugger.sendCommand`.
4034                                      */
4035                                     sessionId: string) => void): this;
4036     once(event: 'message', listener: (event: Event,
4037                                     /**
4038                                      * Method name.
4039                                      */
4040                                     method: string,
4041                                     /**
4042                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4043                                      * protocol.
4044                                      */
4045                                     params: any,
4046                                     /**
4047                                      * Unique identifier of attached debugging session, will match the value sent from
4048                                      * `debugger.sendCommand`.
4049                                      */
4050                                     sessionId: string) => void): this;
4051     addListener(event: 'message', listener: (event: Event,
4052                                     /**
4053                                      * Method name.
4054                                      */
4055                                     method: string,
4056                                     /**
4057                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4058                                      * protocol.
4059                                      */
4060                                     params: any,
4061                                     /**
4062                                      * Unique identifier of attached debugging session, will match the value sent from
4063                                      * `debugger.sendCommand`.
4064                                      */
4065                                     sessionId: string) => void): this;
4066     removeListener(event: 'message', listener: (event: Event,
4067                                     /**
4068                                      * Method name.
4069                                      */
4070                                     method: string,
4071                                     /**
4072                                      * Event parameters defined by the 'parameters' attribute in the remote debugging
4073                                      * protocol.
4074                                      */
4075                                     params: any,
4076                                     /**
4077                                      * Unique identifier of attached debugging session, will match the value sent from
4078                                      * `debugger.sendCommand`.
4079                                      */
4080                                     sessionId: string) => void): this;
4081     /**
4082      * Attaches the debugger to the `webContents`.
4083      */
4084     attach(protocolVersion?: string): void;
4085     /**
4086      * Detaches the debugger from the `webContents`.
4087      */
4088     detach(): void;
4089     /**
4090      * Whether a debugger is attached to the `webContents`.
4091      */
4092     isAttached(): boolean;
4093     /**
4094      * A promise that resolves with the response defined by the 'returns' attribute of
4095      * the command description in the remote debugging protocol or is rejected
4096      * indicating the failure of the command.
4097      *
4098      * Send given command to the debugging target.
4099      */
4100     sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
4101   }
4102
4103   interface DesktopCapturer {
4104
4105     // Docs: https://electronjs.org/docs/api/desktop-capturer
4106
4107     /**
4108      * Resolves with an array of `DesktopCapturerSource` objects, each
4109      * `DesktopCapturerSource` represents a screen or an individual window that can be
4110      * captured.
4111      *
4112      * **Note** Capturing the screen contents requires user consent on macOS 10.15
4113      * Catalina or higher, which can detected by
4114      * `systemPreferences.getMediaAccessStatus`.
4115      */
4116     getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
4117   }
4118
4119   interface DesktopCapturerSource {
4120
4121     // Docs: https://electronjs.org/docs/api/structures/desktop-capturer-source
4122
4123     /**
4124      * An icon image of the application that owns the window or null if the source has
4125      * a type screen. The size of the icon is not known in advance and depends on what
4126      * the application provides.
4127      */
4128     appIcon: NativeImage;
4129     /**
4130      * A unique identifier that will correspond to the `id` of the matching Display
4131      * returned by the Screen API. On some platforms, this is equivalent to the `XX`
4132      * portion of the `id` field above and on others it will differ. It will be an
4133      * empty string if not available.
4134      */
4135     display_id: string;
4136     /**
4137      * The identifier of a window or screen that can be used as a `chromeMediaSourceId`
4138      * constraint when calling `navigator.getUserMedia`. The format of the identifier
4139      * will be `window:XX:YY` or `screen:ZZ:0`. XX is the windowID/handle. YY is 1 for
4140      * the current process, and 0 for all others. ZZ is a sequential number that
4141      * represents the screen, and it does not equal to the index in the source's name.
4142      */
4143     id: string;
4144     /**
4145      * A screen source will be named either `Entire Screen` or `Screen <index>`, while
4146      * the name of a window source will match the window title.
4147      */
4148     name: string;
4149     /**
4150      * A thumbnail image. **Note:** There is no guarantee that the size of the
4151      * thumbnail is the same as the `thumbnailSize` specified in the `options` passed
4152      * to `desktopCapturer.getSources`. The actual size depends on the scale of the
4153      * screen or window.
4154      */
4155     thumbnail: NativeImage;
4156   }
4157
4158   interface Dialog {
4159
4160     // Docs: https://electronjs.org/docs/api/dialog
4161
4162     /**
4163      * resolves when the certificate trust dialog is shown.
4164      *
4165      * On macOS, this displays a modal dialog that shows a message and certificate
4166      * information, and gives the user the option of trusting/importing the
4167      * certificate. If you provide a `browserWindow` argument the dialog will be
4168      * attached to the parent window, making it modal.
4169      *
4170      * On Windows the options are more limited, due to the Win32 APIs used:
4171      *
4172      * * The `message` argument is not used, as the OS provides its own confirmation
4173      * dialog.
4174      * * The `browserWindow` argument is ignored since it is not possible to make this
4175      * confirmation dialog modal.
4176      *
4177      * @platform darwin,win32
4178      */
4179     showCertificateTrustDialog(browserWindow: BrowserWindow, options: CertificateTrustDialogOptions): Promise<void>;
4180     /**
4181      * resolves when the certificate trust dialog is shown.
4182      *
4183      * On macOS, this displays a modal dialog that shows a message and certificate
4184      * information, and gives the user the option of trusting/importing the
4185      * certificate. If you provide a `browserWindow` argument the dialog will be
4186      * attached to the parent window, making it modal.
4187      *
4188      * On Windows the options are more limited, due to the Win32 APIs used:
4189      *
4190      * * The `message` argument is not used, as the OS provides its own confirmation
4191      * dialog.
4192      * * The `browserWindow` argument is ignored since it is not possible to make this
4193      * confirmation dialog modal.
4194      *
4195      * @platform darwin,win32
4196      */
4197     showCertificateTrustDialog(options: CertificateTrustDialogOptions): Promise<void>;
4198     /**
4199      * Displays a modal dialog that shows an error message.
4200      *
4201      * This API can be called safely before the `ready` event the `app` module emits,
4202      * it is usually used to report errors in early stage of startup. If called before
4203      * the app `ready`event on Linux, the message will be emitted to stderr, and no GUI
4204      * dialog will appear.
4205      */
4206     showErrorBox(title: string, content: string): void;
4207     /**
4208      * resolves with a promise containing the following properties:
4209      *
4210      * * `response` number - The index of the clicked button.
4211      * * `checkboxChecked` boolean - The checked state of the checkbox if
4212      * `checkboxLabel` was set. Otherwise `false`.
4213      *
4214      * Shows a message box.
4215      *
4216      * The `browserWindow` argument allows the dialog to attach itself to a parent
4217      * window, making it modal.
4218      */
4219     showMessageBox(browserWindow: BrowserWindow, options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
4220     /**
4221      * resolves with a promise containing the following properties:
4222      *
4223      * * `response` number - The index of the clicked button.
4224      * * `checkboxChecked` boolean - The checked state of the checkbox if
4225      * `checkboxLabel` was set. Otherwise `false`.
4226      *
4227      * Shows a message box.
4228      *
4229      * The `browserWindow` argument allows the dialog to attach itself to a parent
4230      * window, making it modal.
4231      */
4232     showMessageBox(options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
4233     /**
4234      * the index of the clicked button.
4235      *
4236      * Shows a message box, it will block the process until the message box is closed.
4237      * It returns the index of the clicked button.
4238      *
4239      * The `browserWindow` argument allows the dialog to attach itself to a parent
4240      * window, making it modal. If `browserWindow` is not shown dialog will not be
4241      * attached to it. In such case it will be displayed as an independent window.
4242      */
4243     showMessageBoxSync(browserWindow: BrowserWindow, options: MessageBoxSyncOptions): number;
4244     /**
4245      * the index of the clicked button.
4246      *
4247      * Shows a message box, it will block the process until the message box is closed.
4248      * It returns the index of the clicked button.
4249      *
4250      * The `browserWindow` argument allows the dialog to attach itself to a parent
4251      * window, making it modal. If `browserWindow` is not shown dialog will not be
4252      * attached to it. In such case it will be displayed as an independent window.
4253      */
4254     showMessageBoxSync(options: MessageBoxSyncOptions): number;
4255     /**
4256      * Resolve with an object containing the following:
4257      *
4258      * * `canceled` boolean - whether or not the dialog was canceled.
4259      * * `filePaths` string[] - An array of file paths chosen by the user. If the
4260      * dialog is cancelled this will be an empty array.
4261      * * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
4262      * `filePaths` array of base64 encoded strings which contains security scoped
4263      * bookmark data. `securityScopedBookmarks` must be enabled for this to be
4264      * populated. (For return values, see table here.)
4265      *
4266      * The `browserWindow` argument allows the dialog to attach itself to a parent
4267      * window, making it modal.
4268      *
4269      * The `filters` specifies an array of file types that can be displayed or selected
4270      * when you want to limit the user to a specific type. For example:
4271      *
4272      * The `extensions` array should contain extensions without wildcards or dots (e.g.
4273      * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
4274      * `'*'` wildcard (no other wildcard is supported).
4275      *
4276      * **Note:** On Windows and Linux an open dialog can not be both a file selector
4277      * and a directory selector, so if you set `properties` to `['openFile',
4278      * 'openDirectory']` on these platforms, a directory selector will be shown.
4279      */
4280     showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
4281     /**
4282      * Resolve with an object containing the following:
4283      *
4284      * * `canceled` boolean - whether or not the dialog was canceled.
4285      * * `filePaths` string[] - An array of file paths chosen by the user. If the
4286      * dialog is cancelled this will be an empty array.
4287      * * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
4288      * `filePaths` array of base64 encoded strings which contains security scoped
4289      * bookmark data. `securityScopedBookmarks` must be enabled for this to be
4290      * populated. (For return values, see table here.)
4291      *
4292      * The `browserWindow` argument allows the dialog to attach itself to a parent
4293      * window, making it modal.
4294      *
4295      * The `filters` specifies an array of file types that can be displayed or selected
4296      * when you want to limit the user to a specific type. For example:
4297      *
4298      * The `extensions` array should contain extensions without wildcards or dots (e.g.
4299      * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
4300      * `'*'` wildcard (no other wildcard is supported).
4301      *
4302      * **Note:** On Windows and Linux an open dialog can not be both a file selector
4303      * and a directory selector, so if you set `properties` to `['openFile',
4304      * 'openDirectory']` on these platforms, a directory selector will be shown.
4305      */
4306     showOpenDialog(options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
4307     /**
4308      * the file paths chosen by the user; if the dialog is cancelled it returns
4309      * `undefined`.
4310      *
4311      * The `browserWindow` argument allows the dialog to attach itself to a parent
4312      * window, making it modal.
4313      *
4314      * The `filters` specifies an array of file types that can be displayed or selected
4315      * when you want to limit the user to a specific type. For example:
4316      *
4317      * The `extensions` array should contain extensions without wildcards or dots (e.g.
4318      * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
4319      * `'*'` wildcard (no other wildcard is supported).
4320      *
4321      * **Note:** On Windows and Linux an open dialog can not be both a file selector
4322      * and a directory selector, so if you set `properties` to `['openFile',
4323      * 'openDirectory']` on these platforms, a directory selector will be shown.
4324      */
4325     showOpenDialogSync(browserWindow: BrowserWindow, options: OpenDialogSyncOptions): (string[]) | (undefined);
4326     /**
4327      * the file paths chosen by the user; if the dialog is cancelled it returns
4328      * `undefined`.
4329      *
4330      * The `browserWindow` argument allows the dialog to attach itself to a parent
4331      * window, making it modal.
4332      *
4333      * The `filters` specifies an array of file types that can be displayed or selected
4334      * when you want to limit the user to a specific type. For example:
4335      *
4336      * The `extensions` array should contain extensions without wildcards or dots (e.g.
4337      * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
4338      * `'*'` wildcard (no other wildcard is supported).
4339      *
4340      * **Note:** On Windows and Linux an open dialog can not be both a file selector
4341      * and a directory selector, so if you set `properties` to `['openFile',
4342      * 'openDirectory']` on these platforms, a directory selector will be shown.
4343      */
4344     showOpenDialogSync(options: OpenDialogSyncOptions): (string[]) | (undefined);
4345     /**
4346      * Resolve with an object containing the following:
4347      *
4348      * * `canceled` boolean - whether or not the dialog was canceled.
4349      * * `filePath` string (optional) - If the dialog is canceled, this will be
4350      * `undefined`.
4351      * * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
4352      * contains the security scoped bookmark data for the saved file.
4353      * `securityScopedBookmarks` must be enabled for this to be present. (For return
4354      * values, see table here.)
4355      *
4356      * The `browserWindow` argument allows the dialog to attach itself to a parent
4357      * window, making it modal.
4358      *
4359      * The `filters` specifies an array of file types that can be displayed, see
4360      * `dialog.showOpenDialog` for an example.
4361      *
4362      * **Note:** On macOS, using the asynchronous version is recommended to avoid
4363      * issues when expanding and collapsing the dialog.
4364      */
4365     showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
4366     /**
4367      * Resolve with an object containing the following:
4368      *
4369      * * `canceled` boolean - whether or not the dialog was canceled.
4370      * * `filePath` string (optional) - If the dialog is canceled, this will be
4371      * `undefined`.
4372      * * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
4373      * contains the security scoped bookmark data for the saved file.
4374      * `securityScopedBookmarks` must be enabled for this to be present. (For return
4375      * values, see table here.)
4376      *
4377      * The `browserWindow` argument allows the dialog to attach itself to a parent
4378      * window, making it modal.
4379      *
4380      * The `filters` specifies an array of file types that can be displayed, see
4381      * `dialog.showOpenDialog` for an example.
4382      *
4383      * **Note:** On macOS, using the asynchronous version is recommended to avoid
4384      * issues when expanding and collapsing the dialog.
4385      */
4386     showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
4387     /**
4388      * the path of the file chosen by the user; if the dialog is cancelled it returns
4389      * `undefined`.
4390      *
4391      * The `browserWindow` argument allows the dialog to attach itself to a parent
4392      * window, making it modal.
4393      *
4394      * The `filters` specifies an array of file types that can be displayed, see
4395      * `dialog.showOpenDialog` for an example.
4396      */
4397     showSaveDialogSync(browserWindow: BrowserWindow, options: SaveDialogSyncOptions): (string) | (undefined);
4398     /**
4399      * the path of the file chosen by the user; if the dialog is cancelled it returns
4400      * `undefined`.
4401      *
4402      * The `browserWindow` argument allows the dialog to attach itself to a parent
4403      * window, making it modal.
4404      *
4405      * The `filters` specifies an array of file types that can be displayed, see
4406      * `dialog.showOpenDialog` for an example.
4407      */
4408     showSaveDialogSync(options: SaveDialogSyncOptions): (string) | (undefined);
4409   }
4410
4411   interface Display {
4412
4413     // Docs: https://electronjs.org/docs/api/structures/display
4414
4415     /**
4416      * Can be `available`, `unavailable`, `unknown`.
4417      */
4418     accelerometerSupport: ('available' | 'unavailable' | 'unknown');
4419     /**
4420      * the bounds of the display in DIP points.
4421      */
4422     bounds: Rectangle;
4423     /**
4424      * The number of bits per pixel.
4425      */
4426     colorDepth: number;
4427     /**
4428      *  represent a color space (three-dimensional object which contains all realizable
4429      * color combinations) for the purpose of color conversions
4430      */
4431     colorSpace: string;
4432     /**
4433      * The number of bits per color component.
4434      */
4435     depthPerComponent: number;
4436     /**
4437      * The display refresh rate.
4438      */
4439     displayFrequency: number;
4440     /**
4441      * Unique identifier associated with the display.
4442      */
4443     id: number;
4444     /**
4445      * `true` for an internal display and `false` for an external display
4446      */
4447     internal: boolean;
4448     /**
4449      * Whether or not the display is a monochrome display.
4450      */
4451     monochrome: boolean;
4452     /**
4453      * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees.
4454      */
4455     rotation: number;
4456     /**
4457      * Output device's pixel scale factor.
4458      */
4459     scaleFactor: number;
4460     size: Size;
4461     /**
4462      * Can be `available`, `unavailable`, `unknown`.
4463      */
4464     touchSupport: ('available' | 'unavailable' | 'unknown');
4465     /**
4466      * the work area of the display in DIP points.
4467      */
4468     workArea: Rectangle;
4469     workAreaSize: Size;
4470   }
4471
4472   class Dock {
4473
4474     // Docs: https://electronjs.org/docs/api/dock
4475
4476     /**
4477      * an ID representing the request.
4478      *
4479      * When `critical` is passed, the dock icon will bounce until either the
4480      * application becomes active or the request is canceled.
4481      *
4482      * When `informational` is passed, the dock icon will bounce for one second.
4483      * However, the request remains active until either the application becomes active
4484      * or the request is canceled.
4485      *
4486      * **Note:** This method can only be used while the app is not focused; when the
4487      * app is focused it will return -1.
4488      *
4489      * @platform darwin
4490      */
4491     bounce(type?: 'critical' | 'informational'): number;
4492     /**
4493      * Cancel the bounce of `id`.
4494      *
4495      * @platform darwin
4496      */
4497     cancelBounce(id: number): void;
4498     /**
4499      * Bounces the Downloads stack if the filePath is inside the Downloads folder.
4500      *
4501      * @platform darwin
4502      */
4503     downloadFinished(filePath: string): void;
4504     /**
4505      * The badge string of the dock.
4506      *
4507      * @platform darwin
4508      */
4509     getBadge(): string;
4510     /**
4511      * The application's dock menu.
4512      *
4513      * @platform darwin
4514      */
4515     getMenu(): (Menu) | (null);
4516     /**
4517      * Hides the dock icon.
4518      *
4519      * @platform darwin
4520      */
4521     hide(): void;
4522     /**
4523      * Whether the dock icon is visible.
4524      *
4525      * @platform darwin
4526      */
4527     isVisible(): boolean;
4528     /**
4529      * Sets the string to be displayed in the dock’s badging area.
4530      *
4531      * @platform darwin
4532      */
4533     setBadge(text: string): void;
4534     /**
4535      * Sets the `image` associated with this dock icon.
4536      *
4537      * @platform darwin
4538      */
4539     setIcon(image: (NativeImage) | (string)): void;
4540     /**
4541      * Sets the application's dock menu.
4542      *
4543      * @platform darwin
4544      */
4545     setMenu(menu: Menu): void;
4546     /**
4547      * Resolves when the dock icon is shown.
4548      *
4549      * @platform darwin
4550      */
4551     show(): Promise<void>;
4552   }
4553
4554   class DownloadItem extends NodeEventEmitter {
4555
4556     // Docs: https://electronjs.org/docs/api/download-item
4557
4558     /**
4559      * Emitted when the download is in a terminal state. This includes a completed
4560      * download, a cancelled download (via `downloadItem.cancel()`), and interrupted
4561      * download that can't be resumed.
4562      *
4563      * The `state` can be one of following:
4564      *
4565      * * `completed` - The download completed successfully.
4566      * * `cancelled` - The download has been cancelled.
4567      * * `interrupted` - The download has interrupted and can not resume.
4568      */
4569     on(event: 'done', listener: (event: Event,
4570                                  /**
4571                                   * Can be `completed`, `cancelled` or `interrupted`.
4572                                   */
4573                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
4574     once(event: 'done', listener: (event: Event,
4575                                  /**
4576                                   * Can be `completed`, `cancelled` or `interrupted`.
4577                                   */
4578                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
4579     addListener(event: 'done', listener: (event: Event,
4580                                  /**
4581                                   * Can be `completed`, `cancelled` or `interrupted`.
4582                                   */
4583                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
4584     removeListener(event: 'done', listener: (event: Event,
4585                                  /**
4586                                   * Can be `completed`, `cancelled` or `interrupted`.
4587                                   */
4588                                  state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
4589     /**
4590      * Emitted when the download has been updated and is not done.
4591      *
4592      * The `state` can be one of following:
4593      *
4594      * * `progressing` - The download is in-progress.
4595      * * `interrupted` - The download has interrupted and can be resumed.
4596      */
4597     on(event: 'updated', listener: (event: Event,
4598                                     /**
4599                                      * Can be `progressing` or `interrupted`.
4600                                      */
4601                                     state: ('progressing' | 'interrupted')) => void): this;
4602     once(event: 'updated', listener: (event: Event,
4603                                     /**
4604                                      * Can be `progressing` or `interrupted`.
4605                                      */
4606                                     state: ('progressing' | 'interrupted')) => void): this;
4607     addListener(event: 'updated', listener: (event: Event,
4608                                     /**
4609                                      * Can be `progressing` or `interrupted`.
4610                                      */
4611                                     state: ('progressing' | 'interrupted')) => void): this;
4612     removeListener(event: 'updated', listener: (event: Event,
4613                                     /**
4614                                      * Can be `progressing` or `interrupted`.
4615                                      */
4616                                     state: ('progressing' | 'interrupted')) => void): this;
4617     /**
4618      * Cancels the download operation.
4619      */
4620     cancel(): void;
4621     /**
4622      * Whether the download can resume.
4623      */
4624     canResume(): boolean;
4625     /**
4626      * The Content-Disposition field from the response header.
4627      */
4628     getContentDisposition(): string;
4629     /**
4630      * ETag header value.
4631      */
4632     getETag(): string;
4633     /**
4634      * The file name of the download item.
4635      *
4636      * **Note:** The file name is not always the same as the actual one saved in local
4637      * disk. If user changes the file name in a prompted download saving dialog, the
4638      * actual name of saved file will be different.
4639      */
4640     getFilename(): string;
4641     /**
4642      * Last-Modified header value.
4643      */
4644     getLastModifiedTime(): string;
4645     /**
4646      * The files mime type.
4647      */
4648     getMimeType(): string;
4649     /**
4650      * The received bytes of the download item.
4651      */
4652     getReceivedBytes(): number;
4653     /**
4654      * Returns the object previously set by
4655      * `downloadItem.setSaveDialogOptions(options)`.
4656      */
4657     getSaveDialogOptions(): SaveDialogOptions;
4658     /**
4659      * The save path of the download item. This will be either the path set via
4660      * `downloadItem.setSavePath(path)` or the path selected from the shown save
4661      * dialog.
4662      */
4663     getSavePath(): string;
4664     /**
4665      * Number of seconds since the UNIX epoch when the download was started.
4666      */
4667     getStartTime(): number;
4668     /**
4669      * The current state. Can be `progressing`, `completed`, `cancelled` or
4670      * `interrupted`.
4671      *
4672      * **Note:** The following methods are useful specifically to resume a `cancelled`
4673      * item when session is restarted.
4674      */
4675     getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
4676     /**
4677      * The total size in bytes of the download item.
4678      *
4679      * If the size is unknown, it returns 0.
4680      */
4681     getTotalBytes(): number;
4682     /**
4683      * The origin URL where the item is downloaded from.
4684      */
4685     getURL(): string;
4686     /**
4687      * The complete URL chain of the item including any redirects.
4688      */
4689     getURLChain(): string[];
4690     /**
4691      * Whether the download has user gesture.
4692      */
4693     hasUserGesture(): boolean;
4694     /**
4695      * Whether the download is paused.
4696      */
4697     isPaused(): boolean;
4698     /**
4699      * Pauses the download.
4700      */
4701     pause(): void;
4702     /**
4703      * Resumes the download that has been paused.
4704      *
4705      * **Note:** To enable resumable downloads the server you are downloading from must
4706      * support range requests and provide both `Last-Modified` and `ETag` header
4707      * values. Otherwise `resume()` will dismiss previously received bytes and restart
4708      * the download from the beginning.
4709      */
4710     resume(): void;
4711     /**
4712      * This API allows the user to set custom options for the save dialog that opens
4713      * for the download item by default. The API is only available in session's
4714      * `will-download` callback function.
4715      */
4716     setSaveDialogOptions(options: SaveDialogOptions): void;
4717     /**
4718      * The API is only available in session's `will-download` callback function. If
4719      * `path` doesn't exist, Electron will try to make the directory recursively. If
4720      * user doesn't set the save path via the API, Electron will use the original
4721      * routine to determine the save path; this usually prompts a save dialog.
4722      */
4723     setSavePath(path: string): void;
4724     /**
4725      * A `string` property that determines the save file path of the download item.
4726      *
4727      * The property is only available in session's `will-download` callback function.
4728      * If user doesn't set the save path via the property, Electron will use the
4729      * original routine to determine the save path; this usually prompts a save dialog.
4730      */
4731     savePath: string;
4732   }
4733
4734   interface Event extends GlobalEvent {
4735
4736     // Docs: https://electronjs.org/docs/api/structures/event
4737
4738     preventDefault: (() => void);
4739   }
4740
4741   interface Extension {
4742
4743     // Docs: https://electronjs.org/docs/api/structures/extension
4744
4745     id: string;
4746     /**
4747      * Copy of the extension's manifest data.
4748      */
4749     manifest: any;
4750     name: string;
4751     /**
4752      * The extension's file path.
4753      */
4754     path: string;
4755     /**
4756      * The extension's `chrome-extension://` URL.
4757      */
4758     url: string;
4759     version: string;
4760   }
4761
4762   interface ExtensionInfo {
4763
4764     // Docs: https://electronjs.org/docs/api/structures/extension-info
4765
4766     name: string;
4767     version: string;
4768   }
4769
4770   interface FileFilter {
4771
4772     // Docs: https://electronjs.org/docs/api/structures/file-filter
4773
4774     extensions: string[];
4775     name: string;
4776   }
4777
4778   interface FilePathWithHeaders {
4779
4780     // Docs: https://electronjs.org/docs/api/structures/file-path-with-headers
4781
4782     /**
4783      * Additional headers to be sent.
4784      */
4785     headers?: Record<string, string>;
4786     /**
4787      * The path to the file to send.
4788      */
4789     path: string;
4790   }
4791
4792   interface GlobalShortcut {
4793
4794     // Docs: https://electronjs.org/docs/api/global-shortcut
4795
4796     /**
4797      * Whether this application has registered `accelerator`.
4798      *
4799      * When the accelerator is already taken by other applications, this call will
4800      * still return `false`. This behavior is intended by operating systems, since they
4801      * don't want applications to fight for global shortcuts.
4802      */
4803     isRegistered(accelerator: Accelerator): boolean;
4804     /**
4805      * Whether or not the shortcut was registered successfully.
4806      *
4807      * Registers a global shortcut of `accelerator`. The `callback` is called when the
4808      * registered shortcut is pressed by the user.
4809      *
4810      * When the accelerator is already taken by other applications, this call will
4811      * silently fail. This behavior is intended by operating systems, since they don't
4812      * want applications to fight for global shortcuts.
4813      *
4814      * The following accelerators will not be registered successfully on macOS 10.14
4815      * Mojave unless the app has been authorized as a trusted accessibility client:
4816      *
4817      * * "Media Play/Pause"
4818      * * "Media Next Track"
4819      * * "Media Previous Track"
4820      * * "Media Stop"
4821      */
4822     register(accelerator: Accelerator, callback: () => void): boolean;
4823     /**
4824      * Registers a global shortcut of all `accelerator` items in `accelerators`. The
4825      * `callback` is called when any of the registered shortcuts are pressed by the
4826      * user.
4827      *
4828      * When a given accelerator is already taken by other applications, this call will
4829      * silently fail. This behavior is intended by operating systems, since they don't
4830      * want applications to fight for global shortcuts.
4831      *
4832      * The following accelerators will not be registered successfully on macOS 10.14
4833      * Mojave unless the app has been authorized as a trusted accessibility client:
4834      *
4835      * * "Media Play/Pause"
4836      * * "Media Next Track"
4837      * * "Media Previous Track"
4838      * * "Media Stop"
4839      */
4840     registerAll(accelerators: string[], callback: () => void): void;
4841     /**
4842      * Unregisters the global shortcut of `accelerator`.
4843      */
4844     unregister(accelerator: Accelerator): void;
4845     /**
4846      * Unregisters all of the global shortcuts.
4847      */
4848     unregisterAll(): void;
4849   }
4850
4851   interface GPUFeatureStatus {
4852
4853     // Docs: https://electronjs.org/docs/api/structures/gpu-feature-status
4854
4855     /**
4856      * Canvas.
4857      */
4858     '2d_canvas': string;
4859     /**
4860      * Flash.
4861      */
4862     flash_3d: string;
4863     /**
4864      * Flash Stage3D.
4865      */
4866     flash_stage3d: string;
4867     /**
4868      * Flash Stage3D Baseline profile.
4869      */
4870     flash_stage3d_baseline: string;
4871     /**
4872      * Compositing.
4873      */
4874     gpu_compositing: string;
4875     /**
4876      * Multiple Raster Threads.
4877      */
4878     multiple_raster_threads: string;
4879     /**
4880      * Native GpuMemoryBuffers.
4881      */
4882     native_gpu_memory_buffers: string;
4883     /**
4884      * Rasterization.
4885      */
4886     rasterization: string;
4887     /**
4888      * Video Decode.
4889      */
4890     video_decode: string;
4891     /**
4892      * Video Encode.
4893      */
4894     video_encode: string;
4895     /**
4896      * VPx Video Decode.
4897      */
4898     vpx_decode: string;
4899     /**
4900      * WebGL.
4901      */
4902     webgl: string;
4903     /**
4904      * WebGL2.
4905      */
4906     webgl2: string;
4907   }
4908
4909   interface HIDDevice {
4910
4911     // Docs: https://electronjs.org/docs/api/structures/hid-device
4912
4913     /**
4914      * Unique identifier for the device.
4915      */
4916     deviceId: string;
4917     /**
4918      * Unique identifier for the HID interface.  A device may have multiple HID
4919      * interfaces.
4920      */
4921     guid?: string;
4922     /**
4923      * Name of the device.
4924      */
4925     name: string;
4926     /**
4927      * The USB product ID.
4928      */
4929     productId: number;
4930     /**
4931      * The USB device serial number.
4932      */
4933     serialNumber?: string;
4934     /**
4935      * The USB vendor ID.
4936      */
4937     vendorId: number;
4938   }
4939
4940   interface InAppPurchase extends NodeJS.EventEmitter {
4941
4942     // Docs: https://electronjs.org/docs/api/in-app-purchase
4943
4944     on(event: 'transactions-updated', listener: Function): this;
4945     once(event: 'transactions-updated', listener: Function): this;
4946     addListener(event: 'transactions-updated', listener: Function): this;
4947     removeListener(event: 'transactions-updated', listener: Function): this;
4948     /**
4949      * whether a user can make a payment.
4950      */
4951     canMakePayments(): boolean;
4952     /**
4953      * Completes all pending transactions.
4954      */
4955     finishAllTransactions(): void;
4956     /**
4957      * Completes the pending transactions corresponding to the date.
4958      */
4959     finishTransactionByDate(date: string): void;
4960     /**
4961      * Resolves with an array of `Product` objects.
4962      *
4963      * Retrieves the product descriptions.
4964      */
4965     getProducts(productIDs: string[]): Promise<Electron.Product[]>;
4966     /**
4967      * the path to the receipt.
4968      */
4969     getReceiptURL(): string;
4970     /**
4971      * Returns `true` if the product is valid and added to the payment queue.
4972      *
4973      * You should listen for the `transactions-updated` event as soon as possible and
4974      * certainly before you call `purchaseProduct`.
4975      */
4976     purchaseProduct(productID: string, quantity?: number): Promise<boolean>;
4977     /**
4978      * Restores finished transactions. This method can be called either to install
4979      * purchases on additional devices, or to restore purchases for an application that
4980      * the user deleted and reinstalled.
4981      *
4982      * The payment queue delivers a new transaction for each previously completed
4983      * transaction that can be restored. Each transaction includes a copy of the
4984      * original transaction.
4985      */
4986     restoreCompletedTransactions(): void;
4987   }
4988
4989   class IncomingMessage extends NodeEventEmitter {
4990
4991     // Docs: https://electronjs.org/docs/api/incoming-message
4992
4993     /**
4994      * Emitted when a request has been canceled during an ongoing HTTP transaction.
4995      */
4996     on(event: 'aborted', listener: Function): this;
4997     once(event: 'aborted', listener: Function): this;
4998     addListener(event: 'aborted', listener: Function): this;
4999     removeListener(event: 'aborted', listener: Function): this;
5000     /**
5001      * The `data` event is the usual method of transferring response data into
5002      * applicative code.
5003      */
5004     on(event: 'data', listener: (
5005                                  /**
5006                                   * A chunk of response body's data.
5007                                   */
5008                                  chunk: Buffer) => void): this;
5009     once(event: 'data', listener: (
5010                                  /**
5011                                   * A chunk of response body's data.
5012                                   */
5013                                  chunk: Buffer) => void): this;
5014     addListener(event: 'data', listener: (
5015                                  /**
5016                                   * A chunk of response body's data.
5017                                   */
5018                                  chunk: Buffer) => void): this;
5019     removeListener(event: 'data', listener: (
5020                                  /**
5021                                   * A chunk of response body's data.
5022                                   */
5023                                  chunk: Buffer) => void): this;
5024     /**
5025      * Indicates that response body has ended. Must be placed before 'data' event.
5026      */
5027     on(event: 'end', listener: Function): this;
5028     once(event: 'end', listener: Function): this;
5029     addListener(event: 'end', listener: Function): this;
5030     removeListener(event: 'end', listener: Function): this;
5031     /**
5032      * Returns:
5033      *
5034      * `error` Error - Typically holds an error string identifying failure root cause.
5035      *
5036      * Emitted when an error was encountered while streaming response data events. For
5037      * instance, if the server closes the underlying while the response is still
5038      * streaming, an `error` event will be emitted on the response object and a `close`
5039      * event will subsequently follow on the request object.
5040      */
5041     on(event: 'error', listener: Function): this;
5042     once(event: 'error', listener: Function): this;
5043     addListener(event: 'error', listener: Function): this;
5044     removeListener(event: 'error', listener: Function): this;
5045     /**
5046      * A `Record<string, string | string[]>` representing the HTTP response headers.
5047      * The `headers` object is formatted as follows:
5048      *
5049      * * All header names are lowercased.
5050      * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,
5051      * `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
5052      * `last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
5053      * `retry-after`, `server`, or `user-agent` are discarded.
5054      * * `set-cookie` is always an array. Duplicates are added to the array.
5055      * * For duplicate `cookie` headers, the values are joined together with '; '.
5056      * * For all other headers, the values are joined together with ', '.
5057      */
5058     headers: Record<string, (string) | (string[])>;
5059     /**
5060      * A `string` indicating the HTTP protocol version number. Typical values are '1.0'
5061      * or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two
5062      * Integer-valued readable properties that return respectively the HTTP major and
5063      * minor version numbers.
5064      */
5065     httpVersion: string;
5066     /**
5067      * An `Integer` indicating the HTTP protocol major version number.
5068      */
5069     httpVersionMajor: number;
5070     /**
5071      * An `Integer` indicating the HTTP protocol minor version number.
5072      */
5073     httpVersionMinor: number;
5074     /**
5075      * A `string[]` containing the raw HTTP response headers exactly as they were
5076      * received. The keys and values are in the same list. It is not a list of tuples.
5077      * So, the even-numbered offsets are key values, and the odd-numbered offsets are
5078      * the associated values. Header names are not lowercased, and duplicates are not
5079      * merged.
5080      */
5081     rawHeaders: string[];
5082     /**
5083      * An `Integer` indicating the HTTP response status code.
5084      */
5085     statusCode: number;
5086     /**
5087      * A `string` representing the HTTP status message.
5088      */
5089     statusMessage: string;
5090   }
5091
5092   interface InputEvent {
5093
5094     // Docs: https://electronjs.org/docs/api/structures/input-event
5095
5096     /**
5097      * An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`,
5098      * `meta`, `command`, `cmd`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`,
5099      * `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`.
5100      */
5101     modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>;
5102     /**
5103      * Can be `undefined`, `mouseDown`, `mouseUp`, `mouseMove`, `mouseEnter`,
5104      * `mouseLeave`, `contextMenu`, `mouseWheel`, `rawKeyDown`, `keyDown`, `keyUp`,
5105      * `char`, `gestureScrollBegin`, `gestureScrollEnd`, `gestureScrollUpdate`,
5106      * `gestureFlingStart`, `gestureFlingCancel`, `gesturePinchBegin`,
5107      * `gesturePinchEnd`, `gesturePinchUpdate`, `gestureTapDown`, `gestureShowPress`,
5108      * `gestureTap`, `gestureTapCancel`, `gestureShortPress`, `gestureLongPress`,
5109      * `gestureLongTap`, `gestureTwoFingerTap`, `gestureTapUnconfirmed`,
5110      * `gestureDoubleTap`, `touchStart`, `touchMove`, `touchEnd`, `touchCancel`,
5111      * `touchScrollStarted`, `pointerDown`, `pointerUp`, `pointerMove`,
5112      * `pointerRawUpdate`, `pointerCancel` or `pointerCausedUaAction`.
5113      */
5114     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');
5115   }
5116
5117   interface IOCounters {
5118
5119     // Docs: https://electronjs.org/docs/api/structures/io-counters
5120
5121     /**
5122      * Then number of I/O other operations.
5123      */
5124     otherOperationCount: number;
5125     /**
5126      * Then number of I/O other transfers.
5127      */
5128     otherTransferCount: number;
5129     /**
5130      * The number of I/O read operations.
5131      */
5132     readOperationCount: number;
5133     /**
5134      * The number of I/O read transfers.
5135      */
5136     readTransferCount: number;
5137     /**
5138      * The number of I/O write operations.
5139      */
5140     writeOperationCount: number;
5141     /**
5142      * The number of I/O write transfers.
5143      */
5144     writeTransferCount: number;
5145   }
5146
5147   interface IpcMain extends NodeJS.EventEmitter {
5148
5149     // Docs: https://electronjs.org/docs/api/ipc-main
5150
5151     /**
5152      * Adds a handler for an `invoke`able IPC. This handler will be called whenever a
5153      * renderer calls `ipcRenderer.invoke(channel, ...args)`.
5154      *
5155      * If `listener` returns a Promise, the eventual result of the promise will be
5156      * returned as a reply to the remote caller. Otherwise, the return value of the
5157      * listener will be used as the value of the reply.
5158      *
5159      * The `event` that is passed as the first argument to the handler is the same as
5160      * that passed to a regular event listener. It includes information about which
5161      * WebContents is the source of the invoke request.
5162      *
5163      * Errors thrown through `handle` in the main process are not transparent as they
5164      * are serialized and only the `message` property from the original error is
5165      * provided to the renderer process. Please refer to #24427 for details.
5166      */
5167     handle(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<void>) | (any)): void;
5168     /**
5169      * Handles a single `invoke`able IPC message, then removes the listener. See
5170      * `ipcMain.handle(channel, listener)`.
5171      */
5172     handleOnce(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<void>) | (any)): void;
5173     /**
5174      * Listens to `channel`, when a new message arrives `listener` would be called with
5175      * `listener(event, args...)`.
5176      */
5177     on(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
5178     /**
5179      * Adds a one time `listener` function for the event. This `listener` is invoked
5180      * only the next time a message is sent to `channel`, after which it is removed.
5181      */
5182     once(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
5183     /**
5184      * Removes listeners of the specified `channel`.
5185      */
5186     removeAllListeners(channel?: string): this;
5187     /**
5188      * Removes any handler for `channel`, if present.
5189      */
5190     removeHandler(channel: string): void;
5191     /**
5192      * Removes the specified `listener` from the listener array for the specified
5193      * `channel`.
5194      */
5195     removeListener(channel: string, listener: (...args: any[]) => void): this;
5196   }
5197
5198   interface IpcMainEvent extends Event {
5199
5200     // Docs: https://electronjs.org/docs/api/structures/ipc-main-event
5201
5202     /**
5203      * The ID of the renderer frame that sent this message
5204      */
5205     frameId: number;
5206     /**
5207      * A list of MessagePorts that were transferred with this message
5208      */
5209     ports: MessagePortMain[];
5210     /**
5211      * The internal ID of the renderer process that sent this message
5212      */
5213     processId: number;
5214     /**
5215      * A function that will send an IPC message to the renderer frame that sent the
5216      * original message that you are currently handling.  You should use this method to
5217      * "reply" to the sent message in order to guarantee the reply will go to the
5218      * correct process and frame.
5219      */
5220     reply: Function;
5221     /**
5222      * Set this to the value to be returned in a synchronous message
5223      */
5224     returnValue: any;
5225     /**
5226      * Returns the `webContents` that sent the message
5227      */
5228     sender: WebContents;
5229     /**
5230      * The frame that sent this message
5231      *
5232      */
5233     readonly senderFrame: WebFrameMain;
5234   }
5235
5236   interface IpcMainInvokeEvent extends Event {
5237
5238     // Docs: https://electronjs.org/docs/api/structures/ipc-main-invoke-event
5239
5240     /**
5241      * The ID of the renderer frame that sent this message
5242      */
5243     frameId: number;
5244     /**
5245      * The internal ID of the renderer process that sent this message
5246      */
5247     processId: number;
5248     /**
5249      * Returns the `webContents` that sent the message
5250      */
5251     sender: WebContents;
5252     /**
5253      * The frame that sent this message
5254      *
5255      */
5256     readonly senderFrame: WebFrameMain;
5257   }
5258
5259   interface IpcRenderer extends NodeJS.EventEmitter {
5260
5261     // Docs: https://electronjs.org/docs/api/ipc-renderer
5262
5263     /**
5264      * Resolves with the response from the main process.
5265      *
5266      * Send a message to the main process via `channel` and expect a result
5267      * asynchronously. Arguments will be serialized with the Structured Clone
5268      * Algorithm, just like `window.postMessage`, so prototype chains will not be
5269      * included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw
5270      * an exception.
5271      *
5272      * The main process should listen for `channel` with `ipcMain.handle()`.
5273      *
5274      * For example:
5275      *
5276      * If you need to transfer a `MessagePort` to the main process, use
5277      * `ipcRenderer.postMessage`.
5278      *
5279      * If you do not need a response to the message, consider using `ipcRenderer.send`.
5280      *
5281      * > **Note** Sending non-standard JavaScript types such as DOM objects or special
5282      * Electron objects will throw an exception.
5283      *
5284      * Since the main process does not have support for DOM objects such as
5285      * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
5286      * Electron's IPC to the main process, as the main process would have no way to
5287      * decode them. Attempting to send such objects over IPC will result in an error.
5288      *
5289      * > **Note** If the handler in the main process throws an error, the promise
5290      * returned by `invoke` will reject. However, the `Error` object in the renderer
5291      * process will not be the same as the one thrown in the main process.
5292      */
5293     invoke(channel: string, ...args: any[]): Promise<any>;
5294     /**
5295      * Listens to `channel`, when a new message arrives `listener` would be called with
5296      * `listener(event, args...)`.
5297      */
5298     on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
5299     /**
5300      * Adds a one time `listener` function for the event. This `listener` is invoked
5301      * only the next time a message is sent to `channel`, after which it is removed.
5302      */
5303     once(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
5304     /**
5305      * Send a message to the main process, optionally transferring ownership of zero or
5306      * more `MessagePort` objects.
5307      *
5308      * The transferred `MessagePort` objects will be available in the main process as
5309      * `MessagePortMain` objects by accessing the `ports` property of the emitted
5310      * event.
5311      *
5312      * For example:
5313      *
5314      * For more information on using `MessagePort` and `MessageChannel`, see the MDN
5315      * documentation.
5316      */
5317     postMessage(channel: string, message: any, transfer?: MessagePort[]): void;
5318     /**
5319      * Removes all listeners, or those of the specified `channel`.
5320      */
5321     removeAllListeners(channel: string): this;
5322     /**
5323      * Removes the specified `listener` from the listener array for the specified
5324      * `channel`.
5325      */
5326     removeListener(channel: string, listener: (...args: any[]) => void): this;
5327     /**
5328      * Send an asynchronous message to the main process via `channel`, along with
5329      * arguments. Arguments will be serialized with the Structured Clone Algorithm,
5330      * just like `window.postMessage`, so prototype chains will not be included.
5331      * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
5332      * exception.
5333      *
5334      * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
5335      * Electron objects will throw an exception.
5336      *
5337      * Since the main process does not have support for DOM objects such as
5338      * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
5339      * Electron's IPC to the main process, as the main process would have no way to
5340      * decode them. Attempting to send such objects over IPC will result in an error.
5341      *
5342      * The main process handles it by listening for `channel` with the `ipcMain`
5343      * module.
5344      *
5345      * If you need to transfer a `MessagePort` to the main process, use
5346      * `ipcRenderer.postMessage`.
5347      *
5348      * If you want to receive a single response from the main process, like the result
5349      * of a method call, consider using `ipcRenderer.invoke`.
5350      */
5351     send(channel: string, ...args: any[]): void;
5352     /**
5353      * The value sent back by the `ipcMain` handler.
5354      *
5355      * Send a message to the main process via `channel` and expect a result
5356      * synchronously. Arguments will be serialized with the Structured Clone Algorithm,
5357      * just like `window.postMessage`, so prototype chains will not be included.
5358      * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
5359      * exception.
5360      *
5361      * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
5362      * Electron objects will throw an exception.
5363      *
5364      * Since the main process does not have support for DOM objects such as
5365      * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
5366      * Electron's IPC to the main process, as the main process would have no way to
5367      * decode them. Attempting to send such objects over IPC will result in an error.
5368      *
5369      * The main process handles it by listening for `channel` with `ipcMain` module,
5370      * and replies by setting `event.returnValue`.
5371      *
5372      * > :warning: **WARNING**: Sending a synchronous message will block the whole
5373      * renderer process until the reply is received, so use this method only as a last
5374      * resort. It's much better to use the asynchronous version, `invoke()`.
5375      */
5376     sendSync(channel: string, ...args: any[]): any;
5377     /**
5378      * Sends a message to a window with `webContentsId` via `channel`.
5379      */
5380     sendTo(webContentsId: number, channel: string, ...args: any[]): void;
5381     /**
5382      * Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
5383      * the host page instead of the main process.
5384      */
5385     sendToHost(channel: string, ...args: any[]): void;
5386   }
5387
5388   interface IpcRendererEvent extends Event {
5389
5390     // Docs: https://electronjs.org/docs/api/structures/ipc-renderer-event
5391
5392     /**
5393      * A list of MessagePorts that were transferred with this message
5394      */
5395     ports: MessagePort[];
5396     /**
5397      * The `IpcRenderer` instance that emitted the event originally
5398      */
5399     sender: IpcRenderer;
5400     /**
5401      * The `webContents.id` that sent the message, you can call
5402      * `event.sender.sendTo(event.senderId, ...)` to reply to the message, see
5403      * ipcRenderer.sendTo for more information. This only applies to messages sent from
5404      * a different renderer. Messages sent directly from the main process set
5405      * `event.senderId` to `0`.
5406      */
5407     senderId: number;
5408   }
5409
5410   interface JumpListCategory {
5411
5412     // Docs: https://electronjs.org/docs/api/structures/jump-list-category
5413
5414     /**
5415      * Array of `JumpListItem` objects if `type` is `tasks` or `custom`, otherwise it
5416      * should be omitted.
5417      */
5418     items?: JumpListItem[];
5419     /**
5420      * Must be set if `type` is `custom`, otherwise it should be omitted.
5421      */
5422     name?: string;
5423     /**
5424      * One of the following:
5425      */
5426     type?: ('tasks' | 'frequent' | 'recent' | 'custom');
5427   }
5428
5429   interface JumpListItem {
5430
5431     // Docs: https://electronjs.org/docs/api/structures/jump-list-item
5432
5433     /**
5434      * The command line arguments when `program` is executed. Should only be set if
5435      * `type` is `task`.
5436      */
5437     args?: string;
5438     /**
5439      * Description of the task (displayed in a tooltip). Should only be set if `type`
5440      * is `task`. Maximum length 260 characters.
5441      */
5442     description?: string;
5443     /**
5444      * The index of the icon in the resource file. If a resource file contains multiple
5445      * icons this value can be used to specify the zero-based index of the icon that
5446      * should be displayed for this task. If a resource file contains only one icon,
5447      * this property should be set to zero.
5448      */
5449     iconIndex?: number;
5450     /**
5451      * The absolute path to an icon to be displayed in a Jump List, which can be an
5452      * arbitrary resource file that contains an icon (e.g. `.ico`, `.exe`, `.dll`). You
5453      * can usually specify `process.execPath` to show the program icon.
5454      */
5455     iconPath?: string;
5456     /**
5457      * Path of the file to open, should only be set if `type` is `file`.
5458      */
5459     path?: string;
5460     /**
5461      * Path of the program to execute, usually you should specify `process.execPath`
5462      * which opens the current program. Should only be set if `type` is `task`.
5463      */
5464     program?: string;
5465     /**
5466      * The text to be displayed for the item in the Jump List. Should only be set if
5467      * `type` is `task`.
5468      */
5469     title?: string;
5470     /**
5471      * One of the following:
5472      */
5473     type?: ('task' | 'separator' | 'file');
5474     /**
5475      * The working directory. Default is empty.
5476      */
5477     workingDirectory?: string;
5478   }
5479
5480   interface KeyboardEvent {
5481
5482     // Docs: https://electronjs.org/docs/api/structures/keyboard-event
5483
5484     /**
5485      * whether an Alt key was used in an accelerator to trigger the Event
5486      */
5487     altKey?: boolean;
5488     /**
5489      * whether the Control key was used in an accelerator to trigger the Event
5490      */
5491     ctrlKey?: boolean;
5492     /**
5493      * whether a meta key was used in an accelerator to trigger the Event
5494      */
5495     metaKey?: boolean;
5496     /**
5497      * whether a Shift key was used in an accelerator to trigger the Event
5498      */
5499     shiftKey?: boolean;
5500     /**
5501      * whether an accelerator was used to trigger the event as opposed to another user
5502      * gesture like mouse click
5503      */
5504     triggeredByAccelerator?: boolean;
5505   }
5506
5507   interface KeyboardInputEvent extends InputEvent {
5508
5509     // Docs: https://electronjs.org/docs/api/structures/keyboard-input-event
5510
5511     /**
5512      * The character that will be sent as the keyboard event. Should only use the valid
5513      * key codes in Accelerator.
5514      */
5515     keyCode: string;
5516     /**
5517      * The type of the event, can be `rawKeyDown`, `keyDown`, `keyUp` or `char`.
5518      */
5519     type: ('rawKeyDown' | 'keyDown' | 'keyUp' | 'char');
5520   }
5521
5522   interface MemoryInfo {
5523
5524     // Docs: https://electronjs.org/docs/api/structures/memory-info
5525
5526     /**
5527      * The maximum amount of memory that has ever been pinned to actual physical RAM.
5528      */
5529     peakWorkingSetSize: number;
5530     /**
5531      * The amount of memory not shared by other processes, such as JS heap or HTML
5532      * content.
5533      *
5534      * @platform win32
5535      */
5536     privateBytes?: number;
5537     /**
5538      * The amount of memory currently pinned to actual physical RAM.
5539      */
5540     workingSetSize: number;
5541   }
5542
5543   interface MemoryUsageDetails {
5544
5545     // Docs: https://electronjs.org/docs/api/structures/memory-usage-details
5546
5547     count: number;
5548     liveSize: number;
5549     size: number;
5550   }
5551
5552   class Menu {
5553
5554     // Docs: https://electronjs.org/docs/api/menu
5555
5556     /**
5557      * Emitted when a popup is closed either manually or with `menu.closePopup()`.
5558      */
5559     on(event: 'menu-will-close', listener: (event: Event) => void): this;
5560     once(event: 'menu-will-close', listener: (event: Event) => void): this;
5561     addListener(event: 'menu-will-close', listener: (event: Event) => void): this;
5562     removeListener(event: 'menu-will-close', listener: (event: Event) => void): this;
5563     /**
5564      * Emitted when `menu.popup()` is called.
5565      */
5566     on(event: 'menu-will-show', listener: (event: Event) => void): this;
5567     once(event: 'menu-will-show', listener: (event: Event) => void): this;
5568     addListener(event: 'menu-will-show', listener: (event: Event) => void): this;
5569     removeListener(event: 'menu-will-show', listener: (event: Event) => void): this;
5570     /**
5571      * Menu
5572      */
5573     constructor();
5574     /**
5575      * Generally, the `template` is an array of `options` for constructing a MenuItem.
5576      * The usage can be referenced above.
5577      *
5578      * You can also attach other fields to the element of the `template` and they will
5579      * become properties of the constructed menu items.
5580      */
5581     static buildFromTemplate(template: Array<(MenuItemConstructorOptions) | (MenuItem)>): Menu;
5582     /**
5583      * The application menu, if set, or `null`, if not set.
5584      *
5585      * **Note:** The returned `Menu` instance doesn't support dynamic addition or
5586      * removal of menu items. Instance properties can still be dynamically modified.
5587      */
5588     static getApplicationMenu(): (Menu) | (null);
5589     /**
5590      * Sends the `action` to the first responder of application. This is used for
5591      * emulating default macOS menu behaviors. Usually you would use the `role`
5592      * property of a `MenuItem`.
5593      *
5594      * See the macOS Cocoa Event Handling Guide for more information on macOS' native
5595      * actions.
5596      *
5597      * @platform darwin
5598      */
5599     static sendActionToFirstResponder(action: string): void;
5600     /**
5601      * Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
5602      * will be set as each window's top menu.
5603      *
5604      * Also on Windows and Linux, you can use a `&` in the top-level item name to
5605      * indicate which letter should get a generated accelerator. For example, using
5606      * `&File` for the file menu would result in a generated `Alt-F` accelerator that
5607      * opens the associated menu. The indicated character in the button label then gets
5608      * an underline, and the `&` character is not displayed on the button label.
5609      *
5610      * In order to escape the `&` character in an item name, add a proceeding `&`. For
5611      * example, `&&File` would result in `&File` displayed on the button label.
5612      *
5613      * Passing `null` will suppress the default menu. On Windows and Linux, this has
5614      * the additional effect of removing the menu bar from the window.
5615      *
5616      * **Note:** The default menu will be created automatically if the app does not set
5617      * one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
5618      * `Help`.
5619      */
5620     static setApplicationMenu(menu: (Menu) | (null)): void;
5621     /**
5622      * Appends the `menuItem` to the menu.
5623      */
5624     append(menuItem: MenuItem): void;
5625     /**
5626      * Closes the context menu in the `browserWindow`.
5627      */
5628     closePopup(browserWindow?: BrowserWindow): void;
5629     /**
5630      * the item with the specified `id`
5631      */
5632     getMenuItemById(id: string): (MenuItem) | (null);
5633     /**
5634      * Inserts the `menuItem` to the `pos` position of the menu.
5635      */
5636     insert(pos: number, menuItem: MenuItem): void;
5637     /**
5638      * Pops up this menu as a context menu in the `BrowserWindow`.
5639      */
5640     popup(options?: PopupOptions): void;
5641     /**
5642      * A `MenuItem[]` array containing the menu's items.
5643      *
5644      * Each `Menu` consists of multiple `MenuItem`s and each `MenuItem` can have a
5645      * submenu.
5646      */
5647     items: MenuItem[];
5648   }
5649
5650   class MenuItem {
5651
5652     // Docs: https://electronjs.org/docs/api/menu-item
5653
5654     /**
5655      * MenuItem
5656      */
5657     constructor(options: MenuItemConstructorOptions);
5658     /**
5659      * An `Accelerator` (optional) indicating the item's accelerator, if set.
5660      */
5661     accelerator?: Accelerator;
5662     /**
5663      * A `boolean` indicating whether the item is checked, this property can be
5664      * dynamically changed.
5665      *
5666      * A `checkbox` menu item will toggle the `checked` property on and off when
5667      * selected.
5668      *
5669      * A `radio` menu item will turn on its `checked` property when clicked, and will
5670      * turn off that property for all adjacent items in the same menu.
5671      *
5672      * You can add a `click` function for additional behavior.
5673      */
5674     checked: boolean;
5675     /**
5676      * A `Function` that is fired when the MenuItem receives a click event. It can be
5677      * called with `menuItem.click(event, focusedWindow, focusedWebContents)`.
5678      *
5679      * * `event` KeyboardEvent
5680      * * `focusedWindow` BrowserWindow
5681      * * `focusedWebContents` WebContents
5682      */
5683     click: Function;
5684     /**
5685      * A `number` indicating an item's sequential unique id.
5686      */
5687     commandId: number;
5688     /**
5689      * A `boolean` indicating whether the item is enabled, this property can be
5690      * dynamically changed.
5691      */
5692     enabled: boolean;
5693     /**
5694      * A `NativeImage | string` (optional) indicating the item's icon, if set.
5695      */
5696     icon?: (NativeImage) | (string);
5697     /**
5698      * A `string` indicating the item's unique id, this property can be dynamically
5699      * changed.
5700      */
5701     id: string;
5702     /**
5703      * A `string` indicating the item's visible label.
5704      */
5705     label: string;
5706     /**
5707      * A `Menu` that the item is a part of.
5708      */
5709     menu: Menu;
5710     /**
5711      * A `boolean` indicating if the accelerator should be registered with the system
5712      * or just displayed.
5713      *
5714      * This property can be dynamically changed.
5715      */
5716     registerAccelerator: boolean;
5717     /**
5718      * A `string` (optional) indicating the item's role, if set. Can be `undo`, `redo`,
5719      * `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`,
5720      * `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`,
5721      * `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`,
5722      * `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`,
5723      * `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`,
5724      * `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`,
5725      * `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`,
5726      * `moveTabToNewWindow` or `windowMenu`
5727      */
5728     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' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
5729     /**
5730      * A `SharingItem` indicating the item to share when the `role` is `shareMenu`.
5731      *
5732      * This property can be dynamically changed.
5733      *
5734      * @platform darwin
5735      */
5736     sharingItem: SharingItem;
5737     /**
5738      * A `string` indicating the item's sublabel.
5739      */
5740     sublabel: string;
5741     /**
5742      * A `Menu` (optional) containing the menu item's submenu, if present.
5743      */
5744     submenu?: Menu;
5745     /**
5746      * A `string` indicating the item's hover text.
5747      *
5748      * @platform darwin
5749      */
5750     toolTip: string;
5751     /**
5752      * A `string` indicating the type of the item. Can be `normal`, `separator`,
5753      * `submenu`, `checkbox` or `radio`.
5754      */
5755     type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
5756     /**
5757      * An `Accelerator | null` indicating the item's user-assigned accelerator for the
5758      * menu item.
5759      *
5760      * **Note:** This property is only initialized after the `MenuItem` has been added
5761      * to a `Menu`. Either via `Menu.buildFromTemplate` or via
5762      * `Menu.append()/insert()`.  Accessing before initialization will just return
5763      * `null`.
5764      *
5765      * @platform darwin
5766      */
5767     readonly userAccelerator: (Accelerator) | (null);
5768     /**
5769      * A `boolean` indicating whether the item is visible, this property can be
5770      * dynamically changed.
5771      */
5772     visible: boolean;
5773   }
5774
5775   class MessageChannelMain extends NodeEventEmitter {
5776
5777     // Docs: https://electronjs.org/docs/api/message-channel-main
5778
5779     /**
5780      * A `MessagePortMain` property.
5781      */
5782     port1: MessagePortMain;
5783     /**
5784      * A `MessagePortMain` property.
5785      */
5786     port2: MessagePortMain;
5787   }
5788
5789   class MessagePortMain extends NodeEventEmitter {
5790
5791     // Docs: https://electronjs.org/docs/api/message-port-main
5792
5793     /**
5794      * Emitted when the remote end of a MessagePortMain object becomes disconnected.
5795      */
5796     on(event: 'close', listener: Function): this;
5797     once(event: 'close', listener: Function): this;
5798     addListener(event: 'close', listener: Function): this;
5799     removeListener(event: 'close', listener: Function): this;
5800     /**
5801      * Emitted when a MessagePortMain object receives a message.
5802      */
5803     on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
5804     once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
5805     addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
5806     removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
5807     /**
5808      * Disconnects the port, so it is no longer active.
5809      */
5810     close(): void;
5811     /**
5812      * Sends a message from the port, and optionally, transfers ownership of objects to
5813      * other browsing contexts.
5814      */
5815     postMessage(message: any, transfer?: MessagePortMain[]): void;
5816     /**
5817      * Starts the sending of messages queued on the port. Messages will be queued until
5818      * this method is called.
5819      */
5820     start(): void;
5821   }
5822
5823   interface MimeTypedBuffer {
5824
5825     // Docs: https://electronjs.org/docs/api/structures/mime-typed-buffer
5826
5827     /**
5828      * Charset of the buffer.
5829      */
5830     charset?: string;
5831     /**
5832      * The actual Buffer content.
5833      */
5834     data: Buffer;
5835     /**
5836      * MIME type of the buffer.
5837      */
5838     mimeType?: string;
5839   }
5840
5841   interface MouseInputEvent extends InputEvent {
5842
5843     // Docs: https://electronjs.org/docs/api/structures/mouse-input-event
5844
5845     /**
5846      * The button pressed, can be `left`, `middle`, `right`.
5847      */
5848     button?: ('left' | 'middle' | 'right');
5849     clickCount?: number;
5850     globalX?: number;
5851     globalY?: number;
5852     movementX?: number;
5853     movementY?: number;
5854     /**
5855      * The type of the event, can be `mouseDown`, `mouseUp`, `mouseEnter`,
5856      * `mouseLeave`, `contextMenu`, `mouseWheel` or `mouseMove`.
5857      */
5858     type: ('mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove');
5859     x: number;
5860     y: number;
5861   }
5862
5863   interface MouseWheelInputEvent extends MouseInputEvent {
5864
5865     // Docs: https://electronjs.org/docs/api/structures/mouse-wheel-input-event
5866
5867     accelerationRatioX?: number;
5868     accelerationRatioY?: number;
5869     canScroll?: boolean;
5870     deltaX?: number;
5871     deltaY?: number;
5872     hasPreciseScrollingDeltas?: boolean;
5873     /**
5874      * The type of the event, can be `mouseWheel`.
5875      */
5876     type: ('mouseWheel');
5877     wheelTicksX?: number;
5878     wheelTicksY?: number;
5879   }
5880
5881   class NativeImage {
5882
5883     // Docs: https://electronjs.org/docs/api/native-image
5884
5885     /**
5886      * Creates an empty `NativeImage` instance.
5887      */
5888     static createEmpty(): NativeImage;
5889     /**
5890      * Creates a new `NativeImage` instance from `buffer` that contains the raw bitmap
5891      * pixel data returned by `toBitmap()`. The specific format is platform-dependent.
5892      */
5893     static createFromBitmap(buffer: Buffer, options: CreateFromBitmapOptions): NativeImage;
5894     /**
5895      * Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or
5896      * JPEG first.
5897      */
5898     static createFromBuffer(buffer: Buffer, options?: CreateFromBufferOptions): NativeImage;
5899     /**
5900      * Creates a new `NativeImage` instance from `dataURL`.
5901      */
5902     static createFromDataURL(dataURL: string): NativeImage;
5903     /**
5904      * Creates a new `NativeImage` instance from the NSImage that maps to the given
5905      * image name. See `System Icons` for a list of possible values.
5906      *
5907      * The `hslShift` is applied to the image with the following rules:
5908      *
5909      * * `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0
5910      * and 360 on the hue color wheel (red).
5911      * * `hsl_shift[1]` (saturation): A saturation shift for the image, with the
5912      * following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully
5913      * saturate the image.
5914      * * `hsl_shift[2]` (lightness): A lightness shift for the image, with the
5915      * following key values: 0 = remove all lightness (make all pixels black). 0.5 =
5916      * leave unchanged. 1 = full lightness (make all pixels white).
5917      *
5918      * This means that `[-1, 0, 1]` will make the image completely white and `[-1, 1,
5919      * 0]` will make the image completely black.
5920      *
5921      * In some cases, the `NSImageName` doesn't match its string representation; one
5922      * example of this is `NSFolderImageName`, whose string representation would
5923      * actually be `NSFolder`. Therefore, you'll need to determine the correct string
5924      * representation for your image before passing it in. This can be done with the
5925      * following:
5926      *
5927      * `echo -e '#import <Cocoa/Cocoa.h>\nint main() { NSLog(@"%@", SYSTEM_IMAGE_NAME);
5928      * }' | clang -otest -x objective-c -framework Cocoa - && ./test`
5929      *
5930      * where `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.
5931      *
5932      * @platform darwin
5933      */
5934     static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
5935     /**
5936      * Creates a new `NativeImage` instance from a file located at `path`. This method
5937      * returns an empty image if the `path` does not exist, cannot be read, or is not a
5938      * valid image.
5939      */
5940     static createFromPath(path: string): NativeImage;
5941     /**
5942      * fulfilled with the file's thumbnail preview image, which is a NativeImage.
5943      *
5944      * @platform darwin,win32
5945      */
5946     static createThumbnailFromPath(path: string, maxSize: Size): Promise<Electron.NativeImage>;
5947     /**
5948      * Add an image representation for a specific scale factor. This can be used to
5949      * explicitly add different scale factor representations to an image. This can be
5950      * called on empty images.
5951      */
5952     addRepresentation(options: AddRepresentationOptions): void;
5953     /**
5954      * The cropped image.
5955      */
5956     crop(rect: Rectangle): NativeImage;
5957     /**
5958      * The image's aspect ratio.
5959      *
5960      * If `scaleFactor` is passed, this will return the aspect ratio corresponding to
5961      * the image representation most closely matching the passed value.
5962      */
5963     getAspectRatio(scaleFactor?: number): number;
5964     /**
5965      * A Buffer that contains the image's raw bitmap pixel data.
5966      *
5967      * The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does
5968      * not copy the bitmap data, so you have to use the returned Buffer immediately in
5969      * current event loop tick; otherwise the data might be changed or destroyed.
5970      */
5971     getBitmap(options?: BitmapOptions): Buffer;
5972     /**
5973      * A Buffer that stores C pointer to underlying native handle of the image. On
5974      * macOS, a pointer to `NSImage` instance would be returned.
5975      *
5976      * Notice that the returned pointer is a weak pointer to the underlying native
5977      * image instead of a copy, so you _must_ ensure that the associated `nativeImage`
5978      * instance is kept around.
5979      *
5980      * @platform darwin
5981      */
5982     getNativeHandle(): Buffer;
5983     /**
5984      * An array of all scale factors corresponding to representations for a given
5985      * nativeImage.
5986      */
5987     getScaleFactors(): number[];
5988     /**
5989      * If `scaleFactor` is passed, this will return the size corresponding to the image
5990      * representation most closely matching the passed value.
5991      */
5992     getSize(scaleFactor?: number): Size;
5993     /**
5994      * Whether the image is empty.
5995      */
5996     isEmpty(): boolean;
5997     /**
5998      * Whether the image is a template image.
5999      */
6000     isTemplateImage(): boolean;
6001     /**
6002      * The resized image.
6003      *
6004      * If only the `height` or the `width` are specified then the current aspect ratio
6005      * will be preserved in the resized image.
6006      */
6007     resize(options: ResizeOptions): NativeImage;
6008     /**
6009      * Marks the image as a template image.
6010      */
6011     setTemplateImage(option: boolean): void;
6012     /**
6013      * A Buffer that contains a copy of the image's raw bitmap pixel data.
6014      */
6015     toBitmap(options?: ToBitmapOptions): Buffer;
6016     /**
6017      * The data URL of the image.
6018      */
6019     toDataURL(options?: ToDataURLOptions): string;
6020     /**
6021      * A Buffer that contains the image's `JPEG` encoded data.
6022      */
6023     toJPEG(quality: number): Buffer;
6024     /**
6025      * A Buffer that contains the image's `PNG` encoded data.
6026      */
6027     toPNG(options?: ToPNGOptions): Buffer;
6028     /**
6029      * A `boolean` property that determines whether the image is considered a template
6030      * image.
6031      *
6032      * Please note that this property only has an effect on macOS.
6033      *
6034      * @platform darwin
6035      */
6036     isMacTemplateImage: boolean;
6037   }
6038
6039   interface NativeTheme extends NodeJS.EventEmitter {
6040
6041     // Docs: https://electronjs.org/docs/api/native-theme
6042
6043     /**
6044      * Emitted when something in the underlying NativeTheme has changed. This normally
6045      * means that either the value of `shouldUseDarkColors`,
6046      * `shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed. You
6047      * will have to check them to determine which one has changed.
6048      */
6049     on(event: 'updated', listener: Function): this;
6050     once(event: 'updated', listener: Function): this;
6051     addListener(event: 'updated', listener: Function): this;
6052     removeListener(event: 'updated', listener: Function): this;
6053     /**
6054      * A `boolean` indicating whether Chromium is in forced colors mode, controlled by
6055      * system accessibility settings. Currently, Windows high contrast is the only
6056      * system setting that triggers forced colors mode.
6057      *
6058      * @platform win32
6059      */
6060     readonly inForcedColorsMode: boolean;
6061     /**
6062      * A `boolean` for if the OS / Chromium currently has a dark mode enabled or is
6063      * being instructed to show a dark-style UI.  If you want to modify this value you
6064      * should use `themeSource` below.
6065      *
6066      */
6067     readonly shouldUseDarkColors: boolean;
6068     /**
6069      * A `boolean` for if the OS / Chromium currently has high-contrast mode enabled or
6070      * is being instructed to show a high-contrast UI.
6071      *
6072      * @platform darwin,win32
6073      */
6074     readonly shouldUseHighContrastColors: boolean;
6075     /**
6076      * A `boolean` for if the OS / Chromium currently has an inverted color scheme or
6077      * is being instructed to use an inverted color scheme.
6078      *
6079      * @platform darwin,win32
6080      */
6081     readonly shouldUseInvertedColorScheme: boolean;
6082     /**
6083      * A `string` property that can be `system`, `light` or `dark`.  It is used to
6084      * override and supersede the value that Chromium has chosen to use internally.
6085      *
6086      * Setting this property to `system` will remove the override and everything will
6087      * be reset to the OS default.  By default `themeSource` is `system`.
6088      *
6089      * Settings this property to `dark` will have the following effects:
6090      *
6091      * * `nativeTheme.shouldUseDarkColors` will be `true` when accessed
6092      * * Any UI Electron renders on Linux and Windows including context menus,
6093      * devtools, etc. will use the dark UI.
6094      * * Any UI the OS renders on macOS including menus, window frames, etc. will use
6095      * the dark UI.
6096      * * The `prefers-color-scheme` CSS query will match `dark` mode.
6097      * * The `updated` event will be emitted
6098      *
6099      * Settings this property to `light` will have the following effects:
6100      *
6101      * * `nativeTheme.shouldUseDarkColors` will be `false` when accessed
6102      * * Any UI Electron renders on Linux and Windows including context menus,
6103      * devtools, etc. will use the light UI.
6104      * * Any UI the OS renders on macOS including menus, window frames, etc. will use
6105      * the light UI.
6106      * * The `prefers-color-scheme` CSS query will match `light` mode.
6107      * * The `updated` event will be emitted
6108      *
6109      * The usage of this property should align with a classic "dark mode" state machine
6110      * in your application where the user has three options.
6111      *
6112      * * `Follow OS` --> `themeSource = 'system'`
6113      * * `Dark Mode` --> `themeSource = 'dark'`
6114      * * `Light Mode` --> `themeSource = 'light'`
6115      *
6116      * Your application should then always use `shouldUseDarkColors` to determine what
6117      * CSS to apply.
6118      */
6119     themeSource: ('system' | 'light' | 'dark');
6120   }
6121
6122   interface Net {
6123
6124     // Docs: https://electronjs.org/docs/api/net
6125
6126     /**
6127      * Whether there is currently internet connection.
6128      *
6129      * A return value of `false` is a pretty strong indicator that the user won't be
6130      * able to connect to remote sites. However, a return value of `true` is
6131      * inconclusive; even if some link is up, it is uncertain whether a particular
6132      * connection attempt to a particular remote site will be successful.
6133      */
6134     isOnline(): boolean;
6135     /**
6136      * Creates a `ClientRequest` instance using the provided `options` which are
6137      * directly forwarded to the `ClientRequest` constructor. The `net.request` method
6138      * would be used to issue both secure and insecure HTTP requests according to the
6139      * specified protocol scheme in the `options` object.
6140      */
6141     request(options: (ClientRequestConstructorOptions) | (string)): ClientRequest;
6142     /**
6143      * A `boolean` property. Whether there is currently internet connection.
6144      *
6145      * A return value of `false` is a pretty strong indicator that the user won't be
6146      * able to connect to remote sites. However, a return value of `true` is
6147      * inconclusive; even if some link is up, it is uncertain whether a particular
6148      * connection attempt to a particular remote site will be successful.
6149      *
6150      */
6151     readonly online: boolean;
6152   }
6153
6154   interface NetLog {
6155
6156     // Docs: https://electronjs.org/docs/api/net-log
6157
6158     /**
6159      * resolves when the net log has begun recording.
6160      *
6161      * Starts recording network events to `path`.
6162      */
6163     startLogging(path: string, options?: StartLoggingOptions): Promise<void>;
6164     /**
6165      * resolves when the net log has been flushed to disk.
6166      *
6167      * Stops recording network events. If not called, net logging will automatically
6168      * end when app quits.
6169      */
6170     stopLogging(): Promise<void>;
6171     /**
6172      * A `boolean` property that indicates whether network logs are currently being
6173      * recorded.
6174      *
6175      */
6176     readonly currentlyLogging: boolean;
6177   }
6178
6179   class Notification extends NodeEventEmitter {
6180
6181     // Docs: https://electronjs.org/docs/api/notification
6182
6183     on(event: 'action', listener: (event: Event,
6184                                    /**
6185                                     * The index of the action that was activated.
6186                                     */
6187                                    index: number) => void): this;
6188     once(event: 'action', listener: (event: Event,
6189                                    /**
6190                                     * The index of the action that was activated.
6191                                     */
6192                                    index: number) => void): this;
6193     addListener(event: 'action', listener: (event: Event,
6194                                    /**
6195                                     * The index of the action that was activated.
6196                                     */
6197                                    index: number) => void): this;
6198     removeListener(event: 'action', listener: (event: Event,
6199                                    /**
6200                                     * The index of the action that was activated.
6201                                     */
6202                                    index: number) => void): this;
6203     /**
6204      * Emitted when the notification is clicked by the user.
6205      */
6206     on(event: 'click', listener: (event: Event) => void): this;
6207     once(event: 'click', listener: (event: Event) => void): this;
6208     addListener(event: 'click', listener: (event: Event) => void): this;
6209     removeListener(event: 'click', listener: (event: Event) => void): this;
6210     /**
6211      * Emitted when the notification is closed by manual intervention from the user.
6212      *
6213      * This event is not guaranteed to be emitted in all cases where the notification
6214      * is closed.
6215      */
6216     on(event: 'close', listener: (event: Event) => void): this;
6217     once(event: 'close', listener: (event: Event) => void): this;
6218     addListener(event: 'close', listener: (event: Event) => void): this;
6219     removeListener(event: 'close', listener: (event: Event) => void): this;
6220     /**
6221      * Emitted when an error is encountered while creating and showing the native
6222      * notification.
6223      *
6224      * @platform win32
6225      */
6226     on(event: 'failed', listener: (event: Event,
6227                                    /**
6228                                     * The error encountered during execution of the `show()` method.
6229                                     */
6230                                    error: string) => void): this;
6231     once(event: 'failed', listener: (event: Event,
6232                                    /**
6233                                     * The error encountered during execution of the `show()` method.
6234                                     */
6235                                    error: string) => void): this;
6236     addListener(event: 'failed', listener: (event: Event,
6237                                    /**
6238                                     * The error encountered during execution of the `show()` method.
6239                                     */
6240                                    error: string) => void): this;
6241     removeListener(event: 'failed', listener: (event: Event,
6242                                    /**
6243                                     * The error encountered during execution of the `show()` method.
6244                                     */
6245                                    error: string) => void): this;
6246     /**
6247      * Emitted when the user clicks the "Reply" button on a notification with
6248      * `hasReply: true`.
6249      *
6250      * @platform darwin
6251      */
6252     on(event: 'reply', listener: (event: Event,
6253                                   /**
6254                                    * The string the user entered into the inline reply field.
6255                                    */
6256                                   reply: string) => void): this;
6257     once(event: 'reply', listener: (event: Event,
6258                                   /**
6259                                    * The string the user entered into the inline reply field.
6260                                    */
6261                                   reply: string) => void): this;
6262     addListener(event: 'reply', listener: (event: Event,
6263                                   /**
6264                                    * The string the user entered into the inline reply field.
6265                                    */
6266                                   reply: string) => void): this;
6267     removeListener(event: 'reply', listener: (event: Event,
6268                                   /**
6269                                    * The string the user entered into the inline reply field.
6270                                    */
6271                                   reply: string) => void): this;
6272     /**
6273      * Emitted when the notification is shown to the user, note this could be fired
6274      * multiple times as a notification can be shown multiple times through the
6275      * `show()` method.
6276      */
6277     on(event: 'show', listener: (event: Event) => void): this;
6278     once(event: 'show', listener: (event: Event) => void): this;
6279     addListener(event: 'show', listener: (event: Event) => void): this;
6280     removeListener(event: 'show', listener: (event: Event) => void): this;
6281     /**
6282      * Notification
6283      */
6284     constructor(options?: NotificationConstructorOptions);
6285     /**
6286      * Whether or not desktop notifications are supported on the current system
6287      */
6288     static isSupported(): boolean;
6289     /**
6290      * Dismisses the notification.
6291      */
6292     close(): void;
6293     /**
6294      * Immediately shows the notification to the user, please note this means unlike
6295      * the HTML5 Notification implementation, instantiating a `new Notification` does
6296      * not immediately show it to the user, you need to call this method before the OS
6297      * will display it.
6298      *
6299      * If the notification has been shown before, this method will dismiss the
6300      * previously shown notification and create a new one with identical properties.
6301      */
6302     show(): void;
6303     /**
6304      * A `NotificationAction[]` property representing the actions of the notification.
6305      */
6306     actions: NotificationAction[];
6307     /**
6308      * A `string` property representing the body of the notification.
6309      */
6310     body: string;
6311     /**
6312      * A `string` property representing the close button text of the notification.
6313      */
6314     closeButtonText: string;
6315     /**
6316      * A `boolean` property representing whether the notification has a reply action.
6317      */
6318     hasReply: boolean;
6319     /**
6320      * A `string` property representing the reply placeholder of the notification.
6321      */
6322     replyPlaceholder: string;
6323     /**
6324      * A `boolean` property representing whether the notification is silent.
6325      */
6326     silent: boolean;
6327     /**
6328      * A `string` property representing the sound of the notification.
6329      */
6330     sound: string;
6331     /**
6332      * A `string` property representing the subtitle of the notification.
6333      */
6334     subtitle: string;
6335     /**
6336      * A `string` property representing the type of timeout duration for the
6337      * notification. Can be 'default' or 'never'.
6338      *
6339      * If `timeoutType` is set to 'never', the notification never expires. It stays
6340      * open until closed by the calling API or the user.
6341      *
6342      * @platform linux,win32
6343      */
6344     timeoutType: ('default' | 'never');
6345     /**
6346      * A `string` property representing the title of the notification.
6347      */
6348     title: string;
6349     /**
6350      * A `string` property representing the custom Toast XML of the notification.
6351      *
6352      * @platform win32
6353      */
6354     toastXml: string;
6355     /**
6356      * A `string` property representing the urgency level of the notification. Can be
6357      * 'normal', 'critical', or 'low'.
6358      *
6359      * Default is 'low' - see NotifyUrgency for more information.
6360      *
6361      * @platform linux
6362      */
6363     urgency: ('normal' | 'critical' | 'low');
6364   }
6365
6366   interface NotificationAction {
6367
6368     // Docs: https://electronjs.org/docs/api/structures/notification-action
6369
6370     /**
6371      * The label for the given action.
6372      */
6373     text?: string;
6374     /**
6375      * The type of action, can be `button`.
6376      */
6377     type: ('button');
6378   }
6379
6380   interface NotificationResponse {
6381
6382     // Docs: https://electronjs.org/docs/api/structures/notification-response
6383
6384     /**
6385      * The identifier string of the action that the user selected.
6386      */
6387     actionIdentifier: string;
6388     /**
6389      * The delivery date of the notification.
6390      */
6391     date: number;
6392     /**
6393      * The unique identifier for this notification request.
6394      */
6395     identifier: string;
6396     /**
6397      * A dictionary of custom information associated with the notification.
6398      */
6399     userInfo: Record<string, any>;
6400     /**
6401      * The text entered or chosen by the user.
6402      */
6403     userText?: string;
6404   }
6405
6406   interface ParentPort extends NodeJS.EventEmitter {
6407
6408     // Docs: https://electronjs.org/docs/api/parent-port
6409
6410     /**
6411      * Emitted when the process receives a message. Messages received on this port will
6412      * be queued up until a handler is registered for this event.
6413      */
6414     on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6415     once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6416     addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6417     removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
6418     /**
6419      * Sends a message from the process to its parent.
6420      */
6421     postMessage(message: any): void;
6422   }
6423
6424   interface PaymentDiscount {
6425
6426     // Docs: https://electronjs.org/docs/api/structures/payment-discount
6427
6428     /**
6429      * A string used to uniquely identify a discount offer for a product.
6430      */
6431     identifier: string;
6432     /**
6433      * A string that identifies the key used to generate the signature.
6434      */
6435     keyIdentifier: string;
6436     /**
6437      * A universally unique ID (UUID) value that you define.
6438      */
6439     nonce: string;
6440     /**
6441      * A UTF-8 string representing the properties of a specific discount offer,
6442      * cryptographically signed.
6443      */
6444     signature: string;
6445     /**
6446      * The date and time of the signature's creation in milliseconds, formatted in Unix
6447      * epoch time.
6448      */
6449     timestamp: number;
6450   }
6451
6452   interface Point {
6453
6454     // Docs: https://electronjs.org/docs/api/structures/point
6455
6456     x: number;
6457     y: number;
6458   }
6459
6460   interface PostBody {
6461
6462     // Docs: https://electronjs.org/docs/api/structures/post-body
6463
6464     /**
6465      * The boundary used to separate multiple parts of the message. Only valid when
6466      * `contentType` is `multipart/form-data`.
6467      */
6468     boundary?: string;
6469     /**
6470      * The `content-type` header used for the data. One of
6471      * `application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to the
6472      * `enctype` attribute of the submitted HTML form.
6473      */
6474     contentType: string;
6475     /**
6476      * The post data to be sent to the new window.
6477      */
6478     data: Array<(UploadRawData) | (UploadFile)>;
6479   }
6480
6481   interface PowerMonitor extends NodeJS.EventEmitter {
6482
6483     // Docs: https://electronjs.org/docs/api/power-monitor
6484
6485     /**
6486      * Emitted when the system is about to lock the screen.
6487      *
6488      * @platform darwin,win32
6489      */
6490     on(event: 'lock-screen', listener: Function): this;
6491     once(event: 'lock-screen', listener: Function): this;
6492     addListener(event: 'lock-screen', listener: Function): this;
6493     removeListener(event: 'lock-screen', listener: Function): this;
6494     /**
6495      * Emitted when the system changes to AC power.
6496      *
6497      * @platform darwin,win32
6498      */
6499     on(event: 'on-ac', listener: Function): this;
6500     once(event: 'on-ac', listener: Function): this;
6501     addListener(event: 'on-ac', listener: Function): this;
6502     removeListener(event: 'on-ac', listener: Function): this;
6503     /**
6504      * Emitted when system changes to battery power.
6505      *
6506      * @platform darwin
6507      */
6508     on(event: 'on-battery', listener: Function): this;
6509     once(event: 'on-battery', listener: Function): this;
6510     addListener(event: 'on-battery', listener: Function): this;
6511     removeListener(event: 'on-battery', listener: Function): this;
6512     /**
6513      * Emitted when system is resuming.
6514      */
6515     on(event: 'resume', listener: Function): this;
6516     once(event: 'resume', listener: Function): this;
6517     addListener(event: 'resume', listener: Function): this;
6518     removeListener(event: 'resume', listener: Function): this;
6519     /**
6520      * Emitted when the system is about to reboot or shut down. If the event handler
6521      * invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in
6522      * order for the app to exit cleanly. If `e.preventDefault()` is called, the app
6523      * should exit as soon as possible by calling something like `app.quit()`.
6524      *
6525      * @platform linux,darwin
6526      */
6527     on(event: 'shutdown', listener: Function): this;
6528     once(event: 'shutdown', listener: Function): this;
6529     addListener(event: 'shutdown', listener: Function): this;
6530     removeListener(event: 'shutdown', listener: Function): this;
6531     /**
6532      * Emitted when the system is suspending.
6533      */
6534     on(event: 'suspend', listener: Function): this;
6535     once(event: 'suspend', listener: Function): this;
6536     addListener(event: 'suspend', listener: Function): this;
6537     removeListener(event: 'suspend', listener: Function): this;
6538     /**
6539      * Emitted as soon as the systems screen is unlocked.
6540      *
6541      * @platform darwin,win32
6542      */
6543     on(event: 'unlock-screen', listener: Function): this;
6544     once(event: 'unlock-screen', listener: Function): this;
6545     addListener(event: 'unlock-screen', listener: Function): this;
6546     removeListener(event: 'unlock-screen', listener: Function): this;
6547     /**
6548      * Emitted when a login session is activated. See documentation for more
6549      * information.
6550      *
6551      * @platform darwin
6552      */
6553     on(event: 'user-did-become-active', listener: Function): this;
6554     once(event: 'user-did-become-active', listener: Function): this;
6555     addListener(event: 'user-did-become-active', listener: Function): this;
6556     removeListener(event: 'user-did-become-active', listener: Function): this;
6557     /**
6558      * Emitted when a login session is deactivated. See documentation for more
6559      * information.
6560      *
6561      * @platform darwin
6562      */
6563     on(event: 'user-did-resign-active', listener: Function): this;
6564     once(event: 'user-did-resign-active', listener: Function): this;
6565     addListener(event: 'user-did-resign-active', listener: Function): this;
6566     removeListener(event: 'user-did-resign-active', listener: Function): this;
6567     /**
6568      * The system's current state. Can be `active`, `idle`, `locked` or `unknown`.
6569      *
6570      * Calculate the system idle state. `idleThreshold` is the amount of time (in
6571      * seconds) before considered idle.  `locked` is available on supported systems
6572      * only.
6573      */
6574     getSystemIdleState(idleThreshold: number): ('active' | 'idle' | 'locked' | 'unknown');
6575     /**
6576      * Idle time in seconds
6577      *
6578      * Calculate system idle time in seconds.
6579      */
6580     getSystemIdleTime(): number;
6581     /**
6582      * Whether the system is on battery power.
6583      *
6584      * To monitor for changes in this property, use the `on-battery` and `on-ac`
6585      * events.
6586      */
6587     isOnBatteryPower(): boolean;
6588     /**
6589      * A `boolean` property. True if the system is on battery power.
6590      *
6591      * See `powerMonitor.isOnBatteryPower()`.
6592      */
6593     onBatteryPower: boolean;
6594   }
6595
6596   interface PowerSaveBlocker {
6597
6598     // Docs: https://electronjs.org/docs/api/power-save-blocker
6599
6600     /**
6601      * Whether the corresponding `powerSaveBlocker` has started.
6602      */
6603     isStarted(id: number): boolean;
6604     /**
6605      * The blocker ID that is assigned to this power blocker.
6606      *
6607      * Starts preventing the system from entering lower-power mode. Returns an integer
6608      * identifying the power save blocker.
6609      *
6610      * **Note:** `prevent-display-sleep` has higher precedence over
6611      * `prevent-app-suspension`. Only the highest precedence type takes effect. In
6612      * other words, `prevent-display-sleep` always takes precedence over
6613      * `prevent-app-suspension`.
6614      *
6615      * For example, an API calling A requests for `prevent-app-suspension`, and another
6616      * calling B requests for `prevent-display-sleep`. `prevent-display-sleep` will be
6617      * used until B stops its request. After that, `prevent-app-suspension` is used.
6618      */
6619     start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number;
6620     /**
6621      * Stops the specified power save blocker.
6622      */
6623     stop(id: number): void;
6624   }
6625
6626   interface PrinterInfo {
6627
6628     // Docs: https://electronjs.org/docs/api/structures/printer-info
6629
6630     /**
6631      * a longer description of the printer's type.
6632      */
6633     description: string;
6634     /**
6635      * the name of the printer as shown in Print Preview.
6636      */
6637     displayName: string;
6638     /**
6639      * whether or not a given printer is set as the default printer on the OS.
6640      */
6641     isDefault: boolean;
6642     /**
6643      * the name of the printer as understood by the OS.
6644      */
6645     name: string;
6646     /**
6647      * an object containing a variable number of platform-specific printer information.
6648      */
6649     options: Options;
6650     /**
6651      * the current status of the printer.
6652      */
6653     status: number;
6654   }
6655
6656   interface ProcessMemoryInfo {
6657
6658     // Docs: https://electronjs.org/docs/api/structures/process-memory-info
6659
6660     /**
6661      * The amount of memory not shared by other processes, such as JS heap or HTML
6662      * content in Kilobytes.
6663      */
6664     private: number;
6665     /**
6666      * The amount of memory currently pinned to actual physical RAM in Kilobytes.
6667      *
6668      * @platform linux,win32
6669      */
6670     residentSet: number;
6671     /**
6672      * The amount of memory shared between processes, typically memory consumed by the
6673      * Electron code itself in Kilobytes.
6674      */
6675     shared: number;
6676   }
6677
6678   interface ProcessMetric {
6679
6680     // Docs: https://electronjs.org/docs/api/structures/process-metric
6681
6682     /**
6683      * CPU usage of the process.
6684      */
6685     cpu: CPUUsage;
6686     /**
6687      * Creation time for this process. The time is represented as number of
6688      * milliseconds since epoch. Since the `pid` can be reused after a process dies, it
6689      * is useful to use both the `pid` and the `creationTime` to uniquely identify a
6690      * process.
6691      */
6692     creationTime: number;
6693     /**
6694      * One of the following values:
6695      *
6696      * @platform win32
6697      */
6698     integrityLevel?: ('untrusted' | 'low' | 'medium' | 'high' | 'unknown');
6699     /**
6700      * Memory information for the process.
6701      */
6702     memory: MemoryInfo;
6703     /**
6704      * The name of the process. Examples for utility: `Audio Service`, `Content
6705      * Decryption Module Service`, `Network Service`, `Video Capture`, etc.
6706      */
6707     name?: string;
6708     /**
6709      * Process id of the process.
6710      */
6711     pid: number;
6712     /**
6713      * Whether the process is sandboxed on OS level.
6714      *
6715      * @platform darwin,win32
6716      */
6717     sandboxed?: boolean;
6718     /**
6719      * The non-localized name of the process.
6720      */
6721     serviceName?: string;
6722     /**
6723      * Process type. One of the following values:
6724      */
6725     type: ('Browser' | 'Tab' | 'Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
6726   }
6727
6728   interface Product {
6729
6730     // Docs: https://electronjs.org/docs/api/structures/product
6731
6732     /**
6733      * The total size of the content, in bytes.
6734      */
6735     contentLengths: number[];
6736     /**
6737      * A string that identifies the version of the content.
6738      */
6739     contentVersion: string;
6740     /**
6741      * 3 character code presenting a product's currency based on the ISO 4217 standard.
6742      */
6743     currencyCode: string;
6744     /**
6745      * An array of discount offers
6746      */
6747     discounts: ProductDiscount[];
6748     /**
6749      * The total size of the content, in bytes.
6750      */
6751     downloadContentLengths: number[];
6752     /**
6753      * A string that identifies the version of the content.
6754      */
6755     downloadContentVersion: string;
6756     /**
6757      * The locale formatted price of the product.
6758      */
6759     formattedPrice: string;
6760     /**
6761      * The object containing introductory price information for the product. available
6762      * for the product.
6763      */
6764     introductoryPrice?: ProductDiscount;
6765     /**
6766      * A boolean value that indicates whether the App Store has downloadable content
6767      * for this product. `true` if at least one file has been associated with the
6768      * product.
6769      */
6770     isDownloadable: boolean;
6771     /**
6772      * A description of the product.
6773      */
6774     localizedDescription: string;
6775     /**
6776      * The name of the product.
6777      */
6778     localizedTitle: string;
6779     /**
6780      * The cost of the product in the local currency.
6781      */
6782     price: number;
6783     /**
6784      * The string that identifies the product to the Apple App Store.
6785      */
6786     productIdentifier: string;
6787     /**
6788      * The identifier of the subscription group to which the subscription belongs.
6789      */
6790     subscriptionGroupIdentifier: string;
6791     /**
6792      * The period details for products that are subscriptions.
6793      */
6794     subscriptionPeriod?: ProductSubscriptionPeriod;
6795   }
6796
6797   interface ProductDiscount {
6798
6799     // Docs: https://electronjs.org/docs/api/structures/product-discount
6800
6801     /**
6802      * A string used to uniquely identify a discount offer for a product.
6803      */
6804     identifier: string;
6805     /**
6806      * An integer that indicates the number of periods the product discount is
6807      * available.
6808      */
6809     numberOfPeriods: number;
6810     /**
6811      * The payment mode for this product discount. Can be `payAsYouGo`, `payUpFront`,
6812      * or `freeTrial`.
6813      */
6814     paymentMode: ('payAsYouGo' | 'payUpFront' | 'freeTrial');
6815     /**
6816      * The discount price of the product in the local currency.
6817      */
6818     price: number;
6819     /**
6820      * The locale used to format the discount price of the product.
6821      */
6822     priceLocale: string;
6823     /**
6824      * An object that defines the period for the product discount.
6825      */
6826     subscriptionPeriod?: ProductSubscriptionPeriod;
6827     /**
6828      * The type of discount offer.
6829      */
6830     type: number;
6831   }
6832
6833   interface ProductSubscriptionPeriod {
6834
6835     // Docs: https://electronjs.org/docs/api/structures/product-subscription-period
6836
6837     /**
6838      * The number of units per subscription period.
6839      */
6840     numberOfUnits: number;
6841     /**
6842      * The increment of time that a subscription period is specified in. Can be `day`,
6843      * `week`, `month`, `year`.
6844      */
6845     unit: ('day' | 'week' | 'month' | 'year');
6846   }
6847
6848   interface Protocol {
6849
6850     // Docs: https://electronjs.org/docs/api/protocol
6851
6852     /**
6853      * Whether the protocol was successfully intercepted
6854      *
6855      * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6856      * which sends a `Buffer` as a response.
6857      */
6858     interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
6859     /**
6860      * Whether the protocol was successfully intercepted
6861      *
6862      * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6863      * which sends a file as a response.
6864      */
6865     interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
6866     /**
6867      * Whether the protocol was successfully intercepted
6868      *
6869      * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6870      * which sends a new HTTP request as a response.
6871      */
6872     interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
6873     /**
6874      * Whether the protocol was successfully intercepted
6875      *
6876      * Same as `protocol.registerStreamProtocol`, except that it replaces an existing
6877      * protocol handler.
6878      */
6879     interceptStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
6880     /**
6881      * Whether the protocol was successfully intercepted
6882      *
6883      * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6884      * which sends a `string` as a response.
6885      */
6886     interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
6887     /**
6888      * Whether `scheme` is already intercepted.
6889      */
6890     isProtocolIntercepted(scheme: string): boolean;
6891     /**
6892      * Whether `scheme` is already registered.
6893      */
6894     isProtocolRegistered(scheme: string): boolean;
6895     /**
6896      * Whether the protocol was successfully registered
6897      *
6898      * Registers a protocol of `scheme` that will send a `Buffer` as a response.
6899      *
6900      * The usage is the same with `registerFileProtocol`, except that the `callback`
6901      * should be called with either a `Buffer` object or an object that has the `data`
6902      * property.
6903      *
6904      * Example:
6905      */
6906     registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
6907     /**
6908      * Whether the protocol was successfully registered
6909      *
6910      * Registers a protocol of `scheme` that will send a file as the response. The
6911      * `handler` will be called with `request` and `callback` where `request` is an
6912      * incoming request for the `scheme`.
6913      *
6914      * To handle the `request`, the `callback` should be called with either the file's
6915      * path or an object that has a `path` property, e.g. `callback(filePath)` or
6916      * `callback({ path: filePath })`. The `filePath` must be an absolute path.
6917      *
6918      * By default the `scheme` is treated like `http:`, which is parsed differently
6919      * from protocols that follow the "generic URI syntax" like `file:`.
6920      */
6921     registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
6922     /**
6923      * Whether the protocol was successfully registered
6924      *
6925      * Registers a protocol of `scheme` that will send an HTTP request as a response.
6926      *
6927      * The usage is the same with `registerFileProtocol`, except that the `callback`
6928      * should be called with an object that has the `url` property.
6929      */
6930     registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
6931     /**
6932      * **Note:** This method can only be used before the `ready` event of the `app`
6933      * module gets emitted and can be called only once.
6934      *
6935      * Registers the `scheme` as standard, secure, bypasses content security policy for
6936      * resources, allows registering ServiceWorker, supports fetch API, and streaming
6937      * video/audio. Specify a privilege with the value of `true` to enable the
6938      * capability.
6939      *
6940      * An example of registering a privileged scheme, that bypasses Content Security
6941      * Policy:
6942      *
6943      * A standard scheme adheres to what RFC 3986 calls generic URI syntax. For example
6944      * `http` and `https` are standard schemes, while `file` is not.
6945      *
6946      * Registering a scheme as standard allows relative and absolute resources to be
6947      * resolved correctly when served. Otherwise the scheme will behave like the `file`
6948      * protocol, but without the ability to resolve relative URLs.
6949      *
6950      * For example when you load following page with custom protocol without
6951      * registering it as standard scheme, the image will not be loaded because
6952      * non-standard schemes can not recognize relative URLs:
6953      *
6954      * Registering a scheme as standard will allow access to files through the
6955      * FileSystem API. Otherwise the renderer will throw a security error for the
6956      * scheme.
6957      *
6958      * By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
6959      * cookies) are disabled for non standard schemes. So in general if you want to
6960      * register a custom protocol to replace the `http` protocol, you have to register
6961      * it as a standard scheme.
6962      *
6963      * Protocols that use streams (http and stream protocols) should set `stream:
6964      * true`. The `<video>` and `<audio>` HTML elements expect protocols to buffer
6965      * their responses by default. The `stream` flag configures those elements to
6966      * correctly expect streaming responses.
6967      */
6968     registerSchemesAsPrivileged(customSchemes: CustomScheme[]): void;
6969     /**
6970      * Whether the protocol was successfully registered
6971      *
6972      * Registers a protocol of `scheme` that will send a stream as a response.
6973      *
6974      * The usage is the same with `registerFileProtocol`, except that the `callback`
6975      * should be called with either a `ReadableStream` object or an object that has the
6976      * `data` property.
6977      *
6978      * Example:
6979      *
6980      * It is possible to pass any object that implements the readable stream API (emits
6981      * `data`/`end`/`error` events). For example, here's how a file could be returned:
6982      */
6983     registerStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
6984     /**
6985      * Whether the protocol was successfully registered
6986      *
6987      * Registers a protocol of `scheme` that will send a `string` as a response.
6988      *
6989      * The usage is the same with `registerFileProtocol`, except that the `callback`
6990      * should be called with either a `string` or an object that has the `data`
6991      * property.
6992      */
6993     registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
6994     /**
6995      * Whether the protocol was successfully unintercepted
6996      *
6997      * Remove the interceptor installed for `scheme` and restore its original handler.
6998      */
6999     uninterceptProtocol(scheme: string): boolean;
7000     /**
7001      * Whether the protocol was successfully unregistered
7002      *
7003      * Unregisters the custom protocol of `scheme`.
7004      */
7005     unregisterProtocol(scheme: string): boolean;
7006   }
7007
7008   interface ProtocolRequest {
7009
7010     // Docs: https://electronjs.org/docs/api/structures/protocol-request
7011
7012     headers: Record<string, string>;
7013     method: string;
7014     referrer: string;
7015     uploadData?: UploadData[];
7016     url: string;
7017   }
7018
7019   interface ProtocolResponse {
7020
7021     // Docs: https://electronjs.org/docs/api/structures/protocol-response
7022
7023     /**
7024      * The charset of response body, default is `"utf-8"`.
7025      */
7026     charset?: string;
7027     /**
7028      * The response body. When returning stream as response, this is a Node.js readable
7029      * stream representing the response body. When returning `Buffer` as response, this
7030      * is a `Buffer`. When returning `string` as response, this is a `string`. This is
7031      * ignored for other types of responses.
7032      */
7033     data?: (Buffer) | (string) | (NodeJS.ReadableStream);
7034     /**
7035      * When assigned, the `request` will fail with the `error` number . For the
7036      * available error numbers you can use, please see the net error list.
7037      */
7038     error?: number;
7039     /**
7040      * An object containing the response headers. The keys must be string, and values
7041      * must be either string or Array of string.
7042      */
7043     headers?: Record<string, (string) | (string[])>;
7044     /**
7045      * The HTTP `method`. This is only used for file and URL responses.
7046      */
7047     method?: string;
7048     /**
7049      * The MIME type of response body, default is `"text/html"`. Setting `mimeType`
7050      * would implicitly set the `content-type` header in response, but if
7051      * `content-type` is already set in `headers`, the `mimeType` would be ignored.
7052      */
7053     mimeType?: string;
7054     /**
7055      * Path to the file which would be sent as response body. This is only used for
7056      * file responses.
7057      */
7058     path?: string;
7059     /**
7060      * The `referrer` URL. This is only used for file and URL responses.
7061      */
7062     referrer?: string;
7063     /**
7064      * The session used for requesting URL, by default the HTTP request will reuse the
7065      * current session. Setting `session` to `null` would use a random independent
7066      * session. This is only used for URL responses.
7067      */
7068     session?: Session;
7069     /**
7070      * The HTTP response code, default is 200.
7071      */
7072     statusCode?: number;
7073     /**
7074      * The data used as upload data. This is only used for URL responses when `method`
7075      * is `"POST"`.
7076      */
7077     uploadData?: ProtocolResponseUploadData;
7078     /**
7079      * Download the `url` and pipe the result as response body. This is only used for
7080      * URL responses.
7081      */
7082     url?: string;
7083   }
7084
7085   interface ProtocolResponseUploadData {
7086
7087     // Docs: https://electronjs.org/docs/api/structures/protocol-response-upload-data
7088
7089     /**
7090      * MIME type of the content.
7091      */
7092     contentType: string;
7093     /**
7094      * Content to be sent.
7095      */
7096     data: (string) | (Buffer);
7097   }
7098
7099   interface PushNotifications extends NodeJS.EventEmitter {
7100
7101     // Docs: https://electronjs.org/docs/api/push-notifications
7102
7103     /**
7104      * Emitted when the app receives a remote notification while running. See:
7105      *
7106      *
7107      *
7108      *
7109      *
7110      *
7111      *
7112      *
7113      *
7114      *
7115      *
7116      *
7117      *
7118      *
7119      *
7120      *
7121      *
7122      *
7123      *
7124      *
7125      *
7126      *
7127      *
7128      *
7129      * com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
7130      *
7131      * @platform darwin
7132      */
7133     on(event: 'received-apns-notification', listener: (userInfo: Record<string, any>) => void): this;
7134     once(event: 'received-apns-notification', listener: (userInfo: Record<string, any>) => void): this;
7135     addListener(event: 'received-apns-notification', listener: (userInfo: Record<string, any>) => void): this;
7136     removeListener(event: 'received-apns-notification', listener: (userInfo: Record<string, any>) => void): this;
7137     /**
7138      * Registers the app with Apple Push Notification service (APNS) to receive Badge,
7139      * Sound, and Alert notifications. If registration is successful, the promise will
7140      * be resolved with the APNS device token. Otherwise, the promise will be rejected
7141      * with an error message. See:
7142      *
7143      *
7144      *
7145      *
7146      *
7147      *
7148      *
7149      *
7150      *
7151      *
7152      *
7153      *
7154      *
7155      *
7156      *
7157      *
7158      *
7159      *
7160      *
7161      *
7162      *
7163      *
7164      *
7165      *
7166      *
7167      *
7168      *
7169      *
7170      *
7171      *
7172      *
7173      *
7174      *
7175      *
7176      *
7177      *
7178      *
7179      * tion/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
7180      *
7181      * @platform darwin
7182      */
7183     registerForAPNSNotifications(): Promise<string>;
7184     /**
7185      * Unregisters the app from notifications received from APNS. See:
7186      *
7187      *
7188      *
7189      *
7190      *
7191      *
7192      *
7193      *
7194      *
7195      *
7196      *
7197      *
7198      *
7199      *
7200      *
7201      *
7202      *
7203      *
7204      *
7205      *
7206      *
7207      *
7208      *
7209      *
7210      *
7211      *
7212      *
7213      *
7214      *
7215      *
7216      *
7217      *
7218      *
7219      *
7220      *
7221      *
7222      *
7223      * tion/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc
7224      *
7225      * @platform darwin
7226      */
7227     unregisterForAPNSNotifications(): void;
7228   }
7229
7230   interface Rectangle {
7231
7232     // Docs: https://electronjs.org/docs/api/structures/rectangle
7233
7234     /**
7235      * The height of the rectangle (must be an integer).
7236      */
7237     height: number;
7238     /**
7239      * The width of the rectangle (must be an integer).
7240      */
7241     width: number;
7242     /**
7243      * The x coordinate of the origin of the rectangle (must be an integer).
7244      */
7245     x: number;
7246     /**
7247      * The y coordinate of the origin of the rectangle (must be an integer).
7248      */
7249     y: number;
7250   }
7251
7252   interface Referrer {
7253
7254     // Docs: https://electronjs.org/docs/api/structures/referrer
7255
7256     /**
7257      * Can be `default`, `unsafe-url`, `no-referrer-when-downgrade`, `no-referrer`,
7258      * `origin`, `strict-origin-when-cross-origin`, `same-origin` or `strict-origin`.
7259      * See the Referrer-Policy spec for more details on the meaning of these values.
7260      */
7261     policy: ('default' | 'unsafe-url' | 'no-referrer-when-downgrade' | 'no-referrer' | 'origin' | 'strict-origin-when-cross-origin' | 'same-origin' | 'strict-origin');
7262     /**
7263      * HTTP Referrer URL.
7264      */
7265     url: string;
7266   }
7267
7268   interface SafeStorage extends NodeJS.EventEmitter {
7269
7270     // Docs: https://electronjs.org/docs/api/safe-storage
7271
7272     /**
7273      * the decrypted string. Decrypts the encrypted buffer obtained  with
7274      * `safeStorage.encryptString` back into a string.
7275      *
7276      * This function will throw an error if decryption fails.
7277      */
7278     decryptString(encrypted: Buffer): string;
7279     /**
7280      * An array of bytes representing the encrypted string.
7281      *
7282      * This function will throw an error if encryption fails.
7283      */
7284     encryptString(plainText: string): Buffer;
7285     /**
7286      * Whether encryption is available.
7287      *
7288      * On Linux, returns true if the app has emitted the `ready` event and the secret
7289      * key is available. On MacOS, returns true if Keychain is available. On Windows,
7290      * returns true once the app has emitted the `ready` event.
7291      */
7292     isEncryptionAvailable(): boolean;
7293   }
7294
7295   interface Screen extends NodeJS.EventEmitter {
7296
7297     // Docs: https://electronjs.org/docs/api/screen
7298
7299     /**
7300      * Emitted when `newDisplay` has been added.
7301      */
7302     on(event: 'display-added', listener: (event: Event,
7303                                           newDisplay: Display) => void): this;
7304     once(event: 'display-added', listener: (event: Event,
7305                                           newDisplay: Display) => void): this;
7306     addListener(event: 'display-added', listener: (event: Event,
7307                                           newDisplay: Display) => void): this;
7308     removeListener(event: 'display-added', listener: (event: Event,
7309                                           newDisplay: Display) => void): this;
7310     /**
7311      * Emitted when one or more metrics change in a `display`. The `changedMetrics` is
7312      * an array of strings that describe the changes. Possible changes are `bounds`,
7313      * `workArea`, `scaleFactor` and `rotation`.
7314      */
7315     on(event: 'display-metrics-changed', listener: (event: Event,
7316                                                     display: Display,
7317                                                     changedMetrics: string[]) => void): this;
7318     once(event: 'display-metrics-changed', listener: (event: Event,
7319                                                     display: Display,
7320                                                     changedMetrics: string[]) => void): this;
7321     addListener(event: 'display-metrics-changed', listener: (event: Event,
7322                                                     display: Display,
7323                                                     changedMetrics: string[]) => void): this;
7324     removeListener(event: 'display-metrics-changed', listener: (event: Event,
7325                                                     display: Display,
7326                                                     changedMetrics: string[]) => void): this;
7327     /**
7328      * Emitted when `oldDisplay` has been removed.
7329      */
7330     on(event: 'display-removed', listener: (event: Event,
7331                                             oldDisplay: Display) => void): this;
7332     once(event: 'display-removed', listener: (event: Event,
7333                                             oldDisplay: Display) => void): this;
7334     addListener(event: 'display-removed', listener: (event: Event,
7335                                             oldDisplay: Display) => void): this;
7336     removeListener(event: 'display-removed', listener: (event: Event,
7337                                             oldDisplay: Display) => void): this;
7338     /**
7339      * Converts a screen DIP point to a screen physical point. The DPI scale is
7340      * performed relative to the display containing the DIP point.
7341      *
7342      * @platform win32
7343      */
7344     dipToScreenPoint(point: Point): Point;
7345     /**
7346      * Converts a screen DIP rect to a screen physical rect. The DPI scale is performed
7347      * relative to the display nearest to `window`. If `window` is null, scaling will
7348      * be performed to the display nearest to `rect`.
7349      *
7350      * @platform win32
7351      */
7352     dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
7353     /**
7354      * An array of displays that are currently available.
7355      */
7356     getAllDisplays(): Display[];
7357     /**
7358      * The current absolute position of the mouse pointer.
7359      *
7360      * **Note:** The return value is a DIP point, not a screen physical point.
7361      */
7362     getCursorScreenPoint(): Point;
7363     /**
7364      * The display that most closely intersects the provided bounds.
7365      */
7366     getDisplayMatching(rect: Rectangle): Display;
7367     /**
7368      * The display nearest the specified point.
7369      */
7370     getDisplayNearestPoint(point: Point): Display;
7371     /**
7372      * The primary display.
7373      */
7374     getPrimaryDisplay(): Display;
7375     /**
7376      * Converts a screen physical point to a screen DIP point. The DPI scale is
7377      * performed relative to the display containing the physical point.
7378      *
7379      * @platform win32
7380      */
7381     screenToDipPoint(point: Point): Point;
7382     /**
7383      * Converts a screen physical rect to a screen DIP rect. The DPI scale is performed
7384      * relative to the display nearest to `window`. If `window` is null, scaling will
7385      * be performed to the display nearest to `rect`.
7386      *
7387      * @platform win32
7388      */
7389     screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
7390   }
7391
7392   interface ScrubberItem {
7393
7394     // Docs: https://electronjs.org/docs/api/structures/scrubber-item
7395
7396     /**
7397      * The image to appear in this item.
7398      */
7399     icon?: NativeImage;
7400     /**
7401      * The text to appear in this item.
7402      */
7403     label?: string;
7404   }
7405
7406   interface SegmentedControlSegment {
7407
7408     // Docs: https://electronjs.org/docs/api/structures/segmented-control-segment
7409
7410     /**
7411      * Whether this segment is selectable. Default: true.
7412      */
7413     enabled?: boolean;
7414     /**
7415      * The image to appear in this segment.
7416      */
7417     icon?: NativeImage;
7418     /**
7419      * The text to appear in this segment.
7420      */
7421     label?: string;
7422   }
7423
7424   interface SerialPort {
7425
7426     // Docs: https://electronjs.org/docs/api/structures/serial-port
7427
7428     /**
7429      * A stable identifier on Windows that can be used for device permissions.
7430      */
7431     deviceInstanceId?: string;
7432     /**
7433      * A string suitable for display to the user for describing this device.
7434      */
7435     displayName: string;
7436     /**
7437      * Unique identifier for the port.
7438      */
7439     portId: string;
7440     /**
7441      * Name of the port.
7442      */
7443     portName: string;
7444     /**
7445      * Optional USB product ID.
7446      */
7447     productId: string;
7448     /**
7449      * The USB device serial number.
7450      */
7451     serialNumber: string;
7452     /**
7453      * Represents a single serial port on macOS can be enumerated by multiple drivers.
7454      */
7455     usbDriverName?: string;
7456     /**
7457      * Optional USB vendor ID.
7458      */
7459     vendorId: string;
7460   }
7461
7462   interface ServiceWorkerInfo {
7463
7464     // Docs: https://electronjs.org/docs/api/structures/service-worker-info
7465
7466     /**
7467      * The virtual ID of the process that this service worker is running in.  This is
7468      * not an OS level PID.  This aligns with the ID set used for
7469      * `webContents.getProcessId()`.
7470      */
7471     renderProcessId: number;
7472     /**
7473      * The base URL that this service worker is active for.
7474      */
7475     scope: string;
7476     /**
7477      * The full URL to the script that this service worker runs
7478      */
7479     scriptUrl: string;
7480   }
7481
7482   class ServiceWorkers extends NodeEventEmitter {
7483
7484     // Docs: https://electronjs.org/docs/api/service-workers
7485
7486     /**
7487      * Emitted when a service worker logs something to the console.
7488      */
7489     on(event: 'console-message', listener: (event: Event,
7490                                             /**
7491                                              * Information about the console message
7492                                              */
7493                                             messageDetails: MessageDetails) => void): this;
7494     once(event: 'console-message', listener: (event: Event,
7495                                             /**
7496                                              * Information about the console message
7497                                              */
7498                                             messageDetails: MessageDetails) => void): this;
7499     addListener(event: 'console-message', listener: (event: Event,
7500                                             /**
7501                                              * Information about the console message
7502                                              */
7503                                             messageDetails: MessageDetails) => void): this;
7504     removeListener(event: 'console-message', listener: (event: Event,
7505                                             /**
7506                                              * Information about the console message
7507                                              */
7508                                             messageDetails: MessageDetails) => void): this;
7509     /**
7510      * Emitted when a service worker has been registered. Can occur after a call to
7511      * `navigator.serviceWorker.register('/sw.js')` successfully resolves or when a
7512      * Chrome extension is loaded.
7513      */
7514     on(event: 'registration-completed', listener: (event: Event,
7515                                                    /**
7516                                                     * Information about the registered service worker
7517                                                     */
7518                                                    details: RegistrationCompletedDetails) => void): this;
7519     once(event: 'registration-completed', listener: (event: Event,
7520                                                    /**
7521                                                     * Information about the registered service worker
7522                                                     */
7523                                                    details: RegistrationCompletedDetails) => void): this;
7524     addListener(event: 'registration-completed', listener: (event: Event,
7525                                                    /**
7526                                                     * Information about the registered service worker
7527                                                     */
7528                                                    details: RegistrationCompletedDetails) => void): this;
7529     removeListener(event: 'registration-completed', listener: (event: Event,
7530                                                    /**
7531                                                     * Information about the registered service worker
7532                                                     */
7533                                                    details: RegistrationCompletedDetails) => void): this;
7534     /**
7535      * A ServiceWorkerInfo object where the keys are the service worker version ID and
7536      * the values are the information about that service worker.
7537      */
7538     getAllRunning(): Record<number, ServiceWorkerInfo>;
7539     /**
7540      * Information about this service worker
7541      *
7542      * If the service worker does not exist or is not running this method will throw an
7543      * exception.
7544      */
7545     getFromVersionID(versionId: number): ServiceWorkerInfo;
7546   }
7547
7548   class Session extends NodeEventEmitter {
7549
7550     // Docs: https://electronjs.org/docs/api/session
7551
7552     /**
7553      * A session instance from `partition` string. When there is an existing `Session`
7554      * with the same `partition`, it will be returned; otherwise a new `Session`
7555      * instance will be created with `options`.
7556      *
7557      * If `partition` starts with `persist:`, the page will use a persistent session
7558      * available to all pages in the app with the same `partition`. if there is no
7559      * `persist:` prefix, the page will use an in-memory session. If the `partition` is
7560      * empty then default session of the app will be returned.
7561      *
7562      * To create a `Session` with `options`, you have to ensure the `Session` with the
7563      * `partition` has never been used before. There is no way to change the `options`
7564      * of an existing `Session` object.
7565      */
7566     static fromPartition(partition: string, options?: FromPartitionOptions): Session;
7567     /**
7568      * A `Session` object, the default session object of the app.
7569      */
7570     static defaultSession: Session;
7571     /**
7572      * Emitted after an extension is loaded. This occurs whenever an extension is added
7573      * to the "enabled" set of extensions. This includes:
7574      *
7575      * * Extensions being loaded from `Session.loadExtension`.
7576      * * Extensions being reloaded:
7577      *   * from a crash.
7578      *   * if the extension requested it (`chrome.runtime.reload()`).
7579      */
7580     on(event: 'extension-loaded', listener: (event: Event,
7581                                              extension: Extension) => void): this;
7582     once(event: 'extension-loaded', listener: (event: Event,
7583                                              extension: Extension) => void): this;
7584     addListener(event: 'extension-loaded', listener: (event: Event,
7585                                              extension: Extension) => void): this;
7586     removeListener(event: 'extension-loaded', listener: (event: Event,
7587                                              extension: Extension) => void): this;
7588     /**
7589      * Emitted after an extension is loaded and all necessary browser state is
7590      * initialized to support the start of the extension's background page.
7591      */
7592     on(event: 'extension-ready', listener: (event: Event,
7593                                             extension: Extension) => void): this;
7594     once(event: 'extension-ready', listener: (event: Event,
7595                                             extension: Extension) => void): this;
7596     addListener(event: 'extension-ready', listener: (event: Event,
7597                                             extension: Extension) => void): this;
7598     removeListener(event: 'extension-ready', listener: (event: Event,
7599                                             extension: Extension) => void): this;
7600     /**
7601      * Emitted after an extension is unloaded. This occurs when
7602      * `Session.removeExtension` is called.
7603      */
7604     on(event: 'extension-unloaded', listener: (event: Event,
7605                                                extension: Extension) => void): this;
7606     once(event: 'extension-unloaded', listener: (event: Event,
7607                                                extension: Extension) => void): this;
7608     addListener(event: 'extension-unloaded', listener: (event: Event,
7609                                                extension: Extension) => void): this;
7610     removeListener(event: 'extension-unloaded', listener: (event: Event,
7611                                                extension: Extension) => void): this;
7612     /**
7613      * Emitted after `navigator.hid.requestDevice` has been called and
7614      * `select-hid-device` has fired if a new device becomes available before the
7615      * callback from `select-hid-device` is called.  This event is intended for use
7616      * when using a UI to ask users to pick a device so that the UI can be updated with
7617      * the newly added device.
7618      */
7619     on(event: 'hid-device-added', listener: (event: Event,
7620                                              details: HidDeviceAddedDetails) => void): this;
7621     once(event: 'hid-device-added', listener: (event: Event,
7622                                              details: HidDeviceAddedDetails) => void): this;
7623     addListener(event: 'hid-device-added', listener: (event: Event,
7624                                              details: HidDeviceAddedDetails) => void): this;
7625     removeListener(event: 'hid-device-added', listener: (event: Event,
7626                                              details: HidDeviceAddedDetails) => void): this;
7627     /**
7628      * Emitted after `navigator.hid.requestDevice` has been called and
7629      * `select-hid-device` has fired if a device has been removed before the callback
7630      * from `select-hid-device` is called.  This event is intended for use when using a
7631      * UI to ask users to pick a device so that the UI can be updated to remove the
7632      * specified device.
7633      */
7634     on(event: 'hid-device-removed', listener: (event: Event,
7635                                                details: HidDeviceRemovedDetails) => void): this;
7636     once(event: 'hid-device-removed', listener: (event: Event,
7637                                                details: HidDeviceRemovedDetails) => void): this;
7638     addListener(event: 'hid-device-removed', listener: (event: Event,
7639                                                details: HidDeviceRemovedDetails) => void): this;
7640     removeListener(event: 'hid-device-removed', listener: (event: Event,
7641                                                details: HidDeviceRemovedDetails) => void): this;
7642     /**
7643      * Emitted after `HIDDevice.forget()` has been called.  This event can be used to
7644      * help maintain persistent storage of permissions when
7645      * `setDevicePermissionHandler` is used.
7646      */
7647     on(event: 'hid-device-revoked', listener: (event: Event,
7648                                                details: HidDeviceRevokedDetails) => void): this;
7649     once(event: 'hid-device-revoked', listener: (event: Event,
7650                                                details: HidDeviceRevokedDetails) => void): this;
7651     addListener(event: 'hid-device-revoked', listener: (event: Event,
7652                                                details: HidDeviceRevokedDetails) => void): this;
7653     removeListener(event: 'hid-device-revoked', listener: (event: Event,
7654                                                details: HidDeviceRevokedDetails) => void): this;
7655     /**
7656      * Emitted when a render process requests preconnection to a URL, generally due to
7657      * a resource hint.
7658      */
7659     on(event: 'preconnect', listener: (event: Event,
7660                                        /**
7661                                         * The URL being requested for preconnection by the renderer.
7662                                         */
7663                                        preconnectUrl: string,
7664                                        /**
7665                                         * True if the renderer is requesting that the connection include credentials (see
7666                                         * the spec for more details.)
7667                                         */
7668                                        allowCredentials: boolean) => void): this;
7669     once(event: 'preconnect', listener: (event: Event,
7670                                        /**
7671                                         * The URL being requested for preconnection by the renderer.
7672                                         */
7673                                        preconnectUrl: string,
7674                                        /**
7675                                         * True if the renderer is requesting that the connection include credentials (see
7676                                         * the spec for more details.)
7677                                         */
7678                                        allowCredentials: boolean) => void): this;
7679     addListener(event: 'preconnect', listener: (event: Event,
7680                                        /**
7681                                         * The URL being requested for preconnection by the renderer.
7682                                         */
7683                                        preconnectUrl: string,
7684                                        /**
7685                                         * True if the renderer is requesting that the connection include credentials (see
7686                                         * the spec for more details.)
7687                                         */
7688                                        allowCredentials: boolean) => void): this;
7689     removeListener(event: 'preconnect', listener: (event: Event,
7690                                        /**
7691                                         * The URL being requested for preconnection by the renderer.
7692                                         */
7693                                        preconnectUrl: string,
7694                                        /**
7695                                         * True if the renderer is requesting that the connection include credentials (see
7696                                         * the spec for more details.)
7697                                         */
7698                                        allowCredentials: boolean) => void): this;
7699     /**
7700      * Emitted when a HID device needs to be selected when a call to
7701      * `navigator.hid.requestDevice` is made. `callback` should be called with
7702      * `deviceId` to be selected; passing no arguments to `callback` will cancel the
7703      * request.  Additionally, permissioning on `navigator.hid` can be further managed
7704      * by using ses.setPermissionCheckHandler(handler) and
7705      * ses.setDevicePermissionHandler(handler)`.
7706      */
7707     on(event: 'select-hid-device', listener: (event: Event,
7708                                               details: SelectHidDeviceDetails,
7709                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
7710     once(event: 'select-hid-device', listener: (event: Event,
7711                                               details: SelectHidDeviceDetails,
7712                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
7713     addListener(event: 'select-hid-device', listener: (event: Event,
7714                                               details: SelectHidDeviceDetails,
7715                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
7716     removeListener(event: 'select-hid-device', listener: (event: Event,
7717                                               details: SelectHidDeviceDetails,
7718                                               callback: (deviceId?: (string) | (null)) => void) => void): this;
7719     /**
7720      * Emitted when a serial port needs to be selected when a call to
7721      * `navigator.serial.requestPort` is made. `callback` should be called with
7722      * `portId` to be selected, passing an empty string to `callback` will cancel the
7723      * request.  Additionally, permissioning on `navigator.serial` can be managed by
7724      * using ses.setPermissionCheckHandler(handler) with the `serial` permission.
7725      */
7726     on(event: 'select-serial-port', listener: (event: Event,
7727                                                portList: SerialPort[],
7728                                                webContents: WebContents,
7729                                                callback: (portId: string) => void) => void): this;
7730     once(event: 'select-serial-port', listener: (event: Event,
7731                                                portList: SerialPort[],
7732                                                webContents: WebContents,
7733                                                callback: (portId: string) => void) => void): this;
7734     addListener(event: 'select-serial-port', listener: (event: Event,
7735                                                portList: SerialPort[],
7736                                                webContents: WebContents,
7737                                                callback: (portId: string) => void) => void): this;
7738     removeListener(event: 'select-serial-port', listener: (event: Event,
7739                                                portList: SerialPort[],
7740                                                webContents: WebContents,
7741                                                callback: (portId: string) => void) => void): this;
7742     /**
7743      * Emitted after `navigator.serial.requestPort` has been called and
7744      * `select-serial-port` has fired if a new serial port becomes available before the
7745      * callback from `select-serial-port` is called.  This event is intended for use
7746      * when using a UI to ask users to pick a port so that the UI can be updated with
7747      * the newly added port.
7748      */
7749     on(event: 'serial-port-added', listener: (event: Event,
7750                                               port: SerialPort,
7751                                               webContents: WebContents) => void): this;
7752     once(event: 'serial-port-added', listener: (event: Event,
7753                                               port: SerialPort,
7754                                               webContents: WebContents) => void): this;
7755     addListener(event: 'serial-port-added', listener: (event: Event,
7756                                               port: SerialPort,
7757                                               webContents: WebContents) => void): this;
7758     removeListener(event: 'serial-port-added', listener: (event: Event,
7759                                               port: SerialPort,
7760                                               webContents: WebContents) => void): this;
7761     /**
7762      * Emitted after `navigator.serial.requestPort` has been called and
7763      * `select-serial-port` has fired if a serial port has been removed before the
7764      * callback from `select-serial-port` is called.  This event is intended for use
7765      * when using a UI to ask users to pick a port so that the UI can be updated to
7766      * remove the specified port.
7767      */
7768     on(event: 'serial-port-removed', listener: (event: Event,
7769                                                 port: SerialPort,
7770                                                 webContents: WebContents) => void): this;
7771     once(event: 'serial-port-removed', listener: (event: Event,
7772                                                 port: SerialPort,
7773                                                 webContents: WebContents) => void): this;
7774     addListener(event: 'serial-port-removed', listener: (event: Event,
7775                                                 port: SerialPort,
7776                                                 webContents: WebContents) => void): this;
7777     removeListener(event: 'serial-port-removed', listener: (event: Event,
7778                                                 port: SerialPort,
7779                                                 webContents: WebContents) => void): this;
7780     /**
7781      * Emitted after `SerialPort.forget()` has been called.  This event can be used to
7782      * help maintain persistent storage of permissions when
7783      * `setDevicePermissionHandler` is used.
7784      */
7785     on(event: 'serial-port-revoked', listener: (event: Event,
7786                                                 details: SerialPortRevokedDetails) => void): this;
7787     once(event: 'serial-port-revoked', listener: (event: Event,
7788                                                 details: SerialPortRevokedDetails) => void): this;
7789     addListener(event: 'serial-port-revoked', listener: (event: Event,
7790                                                 details: SerialPortRevokedDetails) => void): this;
7791     removeListener(event: 'serial-port-revoked', listener: (event: Event,
7792                                                 details: SerialPortRevokedDetails) => void): this;
7793     /**
7794      * Emitted when a hunspell dictionary file starts downloading
7795      */
7796     on(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
7797                                                                  /**
7798                                                                   * The language code of the dictionary file
7799                                                                   */
7800                                                                  languageCode: string) => void): this;
7801     once(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
7802                                                                  /**
7803                                                                   * The language code of the dictionary file
7804                                                                   */
7805                                                                  languageCode: string) => void): this;
7806     addListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
7807                                                                  /**
7808                                                                   * The language code of the dictionary file
7809                                                                   */
7810                                                                  languageCode: string) => void): this;
7811     removeListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
7812                                                                  /**
7813                                                                   * The language code of the dictionary file
7814                                                                   */
7815                                                                  languageCode: string) => void): this;
7816     /**
7817      * Emitted when a hunspell dictionary file download fails.  For details on the
7818      * failure you should collect a netlog and inspect the download request.
7819      */
7820     on(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
7821                                                                    /**
7822                                                                     * The language code of the dictionary file
7823                                                                     */
7824                                                                    languageCode: string) => void): this;
7825     once(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
7826                                                                    /**
7827                                                                     * The language code of the dictionary file
7828                                                                     */
7829                                                                    languageCode: string) => void): this;
7830     addListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
7831                                                                    /**
7832                                                                     * The language code of the dictionary file
7833                                                                     */
7834                                                                    languageCode: string) => void): this;
7835     removeListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
7836                                                                    /**
7837                                                                     * The language code of the dictionary file
7838                                                                     */
7839                                                                    languageCode: string) => void): this;
7840     /**
7841      * Emitted when a hunspell dictionary file has been successfully downloaded
7842      */
7843     on(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
7844                                                                    /**
7845                                                                     * The language code of the dictionary file
7846                                                                     */
7847                                                                    languageCode: string) => void): this;
7848     once(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
7849                                                                    /**
7850                                                                     * The language code of the dictionary file
7851                                                                     */
7852                                                                    languageCode: string) => void): this;
7853     addListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
7854                                                                    /**
7855                                                                     * The language code of the dictionary file
7856                                                                     */
7857                                                                    languageCode: string) => void): this;
7858     removeListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
7859                                                                    /**
7860                                                                     * The language code of the dictionary file
7861                                                                     */
7862                                                                    languageCode: string) => void): this;
7863     /**
7864      * Emitted when a hunspell dictionary file has been successfully initialized. This
7865      * occurs after the file has been downloaded.
7866      */
7867     on(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
7868                                                               /**
7869                                                                * The language code of the dictionary file
7870                                                                */
7871                                                               languageCode: string) => void): this;
7872     once(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
7873                                                               /**
7874                                                                * The language code of the dictionary file
7875                                                                */
7876                                                               languageCode: string) => void): this;
7877     addListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
7878                                                               /**
7879                                                                * The language code of the dictionary file
7880                                                                */
7881                                                               languageCode: string) => void): this;
7882     removeListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
7883                                                               /**
7884                                                                * The language code of the dictionary file
7885                                                                */
7886                                                               languageCode: string) => void): this;
7887     /**
7888      * Emitted when Electron is about to download `item` in `webContents`.
7889      *
7890      * Calling `event.preventDefault()` will cancel the download and `item` will not be
7891      * available from next tick of the process.
7892      */
7893     on(event: 'will-download', listener: (event: Event,
7894                                           item: DownloadItem,
7895                                           webContents: WebContents) => void): this;
7896     once(event: 'will-download', listener: (event: Event,
7897                                           item: DownloadItem,
7898                                           webContents: WebContents) => void): this;
7899     addListener(event: 'will-download', listener: (event: Event,
7900                                           item: DownloadItem,
7901                                           webContents: WebContents) => void): this;
7902     removeListener(event: 'will-download', listener: (event: Event,
7903                                           item: DownloadItem,
7904                                           webContents: WebContents) => void): this;
7905     /**
7906      * Whether the word was successfully written to the custom dictionary. This API
7907      * will not work on non-persistent (in-memory) sessions.
7908      *
7909      * **Note:** On macOS and Windows 10 this word will be written to the OS custom
7910      * dictionary as well
7911      */
7912     addWordToSpellCheckerDictionary(word: string): boolean;
7913     /**
7914      * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
7915      * authentication.
7916      */
7917     allowNTLMCredentialsForDomains(domains: string): void;
7918     /**
7919      * resolves when the session’s HTTP authentication cache has been cleared.
7920      */
7921     clearAuthCache(): Promise<void>;
7922     /**
7923      * resolves when the cache clear operation is complete.
7924      *
7925      * Clears the session’s HTTP cache.
7926      */
7927     clearCache(): Promise<void>;
7928     /**
7929      * resolves when the code cache clear operation is complete.
7930      */
7931     clearCodeCaches(options: ClearCodeCachesOptions): Promise<void>;
7932     /**
7933      * Resolves when the operation is complete.
7934      *
7935      * Clears the host resolver cache.
7936      */
7937     clearHostResolverCache(): Promise<void>;
7938     /**
7939      * resolves when the storage data has been cleared.
7940      */
7941     clearStorageData(options?: ClearStorageDataOptions): Promise<void>;
7942     /**
7943      * Resolves when all connections are closed.
7944      *
7945      * **Note:** It will terminate / fail all requests currently in flight.
7946      */
7947     closeAllConnections(): Promise<void>;
7948     /**
7949      * Allows resuming `cancelled` or `interrupted` downloads from previous `Session`.
7950      * The API will generate a DownloadItem that can be accessed with the will-download
7951      * event. The DownloadItem will not have any `WebContents` associated with it and
7952      * the initial state will be `interrupted`. The download will start only when the
7953      * `resume` API is called on the DownloadItem.
7954      */
7955     createInterruptedDownload(options: CreateInterruptedDownloadOptions): void;
7956     /**
7957      * Disables any network emulation already active for the `session`. Resets to the
7958      * original network configuration.
7959      */
7960     disableNetworkEmulation(): void;
7961     /**
7962      * Initiates a download of the resource at `url`. The API will generate a
7963      * DownloadItem that can be accessed with the will-download event.
7964      *
7965      * **Note:** This does not perform any security checks that relate to a page's
7966      * origin, unlike `webContents.downloadURL`.
7967      */
7968     downloadURL(url: string): void;
7969     /**
7970      * Emulates network with the given configuration for the `session`.
7971      */
7972     enableNetworkEmulation(options: EnableNetworkEmulationOptions): void;
7973     /**
7974      * Writes any unwritten DOMStorage data to disk.
7975      */
7976     flushStorageData(): void;
7977     /**
7978      * Resolves when the all internal states of proxy service is reset and the latest
7979      * proxy configuration is reapplied if it's already available. The pac script will
7980      * be fetched from `pacScript` again if the proxy mode is `pac_script`.
7981      */
7982     forceReloadProxyConfig(): Promise<void>;
7983     /**
7984      * A list of all loaded extensions.
7985      *
7986      * **Note:** This API cannot be called before the `ready` event of the `app` module
7987      * is emitted.
7988      */
7989     getAllExtensions(): Extension[];
7990     /**
7991      * resolves with blob data.
7992      */
7993     getBlobData(identifier: string): Promise<Buffer>;
7994     /**
7995      * the session's current cache size, in bytes.
7996      */
7997     getCacheSize(): Promise<number>;
7998     /**
7999      * | `null` - The loaded extension with the given ID.
8000      *
8001      * **Note:** This API cannot be called before the `ready` event of the `app` module
8002      * is emitted.
8003      */
8004     getExtension(extensionId: string): Extension;
8005     /**
8006      * an array of paths to preload scripts that have been registered.
8007      */
8008     getPreloads(): string[];
8009     /**
8010      * An array of language codes the spellchecker is enabled for.  If this list is
8011      * empty the spellchecker will fallback to using `en-US`.  By default on launch if
8012      * this setting is an empty list Electron will try to populate this setting with
8013      * the current OS locale.  This setting is persisted across restarts.
8014      *
8015      * **Note:** On macOS the OS spellchecker is used and has its own list of
8016      * languages. On macOS, this API will return whichever languages have been
8017      * configured by the OS.
8018      */
8019     getSpellCheckerLanguages(): string[];
8020     /**
8021      * The absolute file system path where data for this session is persisted on disk.
8022      * For in memory sessions this returns `null`.
8023      */
8024     getStoragePath(): (string) | (null);
8025     /**
8026      * The user agent for this session.
8027      */
8028     getUserAgent(): string;
8029     /**
8030      * Whether or not this session is a persistent one. The default `webContents`
8031      * session of a `BrowserWindow` is persistent. When creating a session from a
8032      * partition, session prefixed with `persist:` will be persistent, while others
8033      * will be temporary.
8034      */
8035     isPersistent(): boolean;
8036     /**
8037      * Whether the builtin spell checker is enabled.
8038      */
8039     isSpellCheckerEnabled(): boolean;
8040     /**
8041      * An array of all words in app's custom dictionary. Resolves when the full
8042      * dictionary is loaded from disk.
8043      */
8044     listWordsInSpellCheckerDictionary(): Promise<string[]>;
8045     /**
8046      * resolves when the extension is loaded.
8047      *
8048      * This method will raise an exception if the extension could not be loaded. If
8049      * there are warnings when installing the extension (e.g. if the extension requests
8050      * an API that Electron does not support) then they will be logged to the console.
8051      *
8052      * Note that Electron does not support the full range of Chrome extensions APIs.
8053      * See Supported Extensions APIs for more details on what is supported.
8054      *
8055      * Note that in previous versions of Electron, extensions that were loaded would be
8056      * remembered for future runs of the application. This is no longer the case:
8057      * `loadExtension` must be called on every boot of your app if you want the
8058      * extension to be loaded.
8059      *
8060      * This API does not support loading packed (.crx) extensions.
8061      *
8062      * **Note:** This API cannot be called before the `ready` event of the `app` module
8063      * is emitted.
8064      *
8065      * **Note:** Loading extensions into in-memory (non-persistent) sessions is not
8066      * supported and will throw an error.
8067      */
8068     loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
8069     /**
8070      * Preconnects the given number of sockets to an origin.
8071      */
8072     preconnect(options: PreconnectOptions): void;
8073     /**
8074      * Unloads an extension.
8075      *
8076      * **Note:** This API cannot be called before the `ready` event of the `app` module
8077      * is emitted.
8078      */
8079     removeExtension(extensionId: string): void;
8080     /**
8081      * Whether the word was successfully removed from the custom dictionary. This API
8082      * will not work on non-persistent (in-memory) sessions.
8083      *
8084      * **Note:** On macOS and Windows 10 this word will be removed from the OS custom
8085      * dictionary as well
8086      */
8087     removeWordFromSpellCheckerDictionary(word: string): boolean;
8088     /**
8089      * Resolves with the proxy information for `url`.
8090      */
8091     resolveProxy(url: string): Promise<string>;
8092     /**
8093      * Sets a handler to respond to Bluetooth pairing requests. This handler allows
8094      * developers to handle devices that require additional validation before pairing.
8095      * When a handler is not defined, any pairing on Linux or Windows that requires
8096      * additional validation will be automatically cancelled. macOS does not require a
8097      * handler because macOS handles the pairing automatically.  To clear the handler,
8098      * call `setBluetoothPairingHandler(null)`.
8099      *
8100      * @platform win32,linux
8101      */
8102     setBluetoothPairingHandler(handler: ((details: BluetoothPairingHandlerHandlerDetails, callback: (response: Response) => void) => void) | (null)): void;
8103     /**
8104      * Sets the certificate verify proc for `session`, the `proc` will be called with
8105      * `proc(request, callback)` whenever a server certificate verification is
8106      * requested. Calling `callback(0)` accepts the certificate, calling `callback(-2)`
8107      * rejects it.
8108      *
8109      * Calling `setCertificateVerifyProc(null)` will revert back to default certificate
8110      * verify proc.
8111      *
8112      * > **NOTE:** The result of this procedure is cached by the network service.
8113      */
8114     setCertificateVerifyProc(proc: ((request: Request, callback: (verificationResult: number) => void) => void) | (null)): void;
8115     /**
8116      * Sets the directory to store the generated JS code cache for this session. The
8117      * directory is not required to be created by the user before this call, the
8118      * runtime will create if it does not exist otherwise will use the existing
8119      * directory. If directory cannot be created, then code cache will not be used and
8120      * all operations related to code cache will fail silently inside the runtime. By
8121      * default, the directory will be `Code Cache` under the respective user data
8122      * folder.
8123      */
8124     setCodeCachePath(path: string): void;
8125     /**
8126      * Sets the handler which can be used to respond to device permission checks for
8127      * the `session`. Returning `true` will allow the device to be permitted and
8128      * `false` will reject it. To clear the handler, call
8129      * `setDevicePermissionHandler(null)`. This handler can be used to provide default
8130      * permissioning to devices without first calling for permission to devices (eg via
8131      * `navigator.hid.requestDevice`).  If this handler is not defined, the default
8132      * device permissions as granted through device selection (eg via
8133      * `navigator.hid.requestDevice`) will be used. Additionally, the default behavior
8134      * of Electron is to store granted device permision in memory. If longer term
8135      * storage is needed, a developer can store granted device permissions (eg when
8136      * handling the `select-hid-device` event) and then read from that storage with
8137      * `setDevicePermissionHandler`.
8138      */
8139     setDevicePermissionHandler(handler: ((details: DevicePermissionHandlerHandlerDetails) => boolean) | (null)): void;
8140     /**
8141      * This handler will be called when web content requests access to display media
8142      * via the `navigator.mediaDevices.getDisplayMedia` API. Use the desktopCapturer
8143      * API to choose which stream(s) to grant access to.
8144      *
8145      * Passing a WebFrameMain object as a video or audio stream will capture the video
8146      * or audio stream from that frame.
8147      *
8148      * Passing `null` instead of a function resets the handler to its default state.
8149      */
8150     setDisplayMediaRequestHandler(handler: ((request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: Streams) => void) => void) | (null)): void;
8151     /**
8152      * Sets download saving directory. By default, the download directory will be the
8153      * `Downloads` under the respective app folder.
8154      */
8155     setDownloadPath(path: string): void;
8156     /**
8157      * Sets the handler which can be used to respond to permission checks for the
8158      * `session`. Returning `true` will allow the permission and `false` will reject
8159      * it.  Please note that you must also implement `setPermissionRequestHandler` to
8160      * get complete permission handling. Most web APIs do a permission check and then
8161      * make a permission request if the check is denied. To clear the handler, call
8162      * `setPermissionCheckHandler(null)`.
8163      */
8164     setPermissionCheckHandler(handler: ((webContents: (WebContents) | (null), permission: string, requestingOrigin: string, details: PermissionCheckHandlerHandlerDetails) => boolean) | (null)): void;
8165     /**
8166      * Sets the handler which can be used to respond to permission requests for the
8167      * `session`. Calling `callback(true)` will allow the permission and
8168      * `callback(false)` will reject it. To clear the handler, call
8169      * `setPermissionRequestHandler(null)`.  Please note that you must also implement
8170      * `setPermissionCheckHandler` to get complete permission handling. Most web APIs
8171      * do a permission check and then make a permission request if the check is denied.
8172      */
8173     setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'media' | 'display-capture' | 'mediaKeySystem' | 'geolocation' | 'notifications' | 'midi' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal' | 'unknown', callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerHandlerDetails) => void) | (null)): void;
8174     /**
8175      * Adds scripts that will be executed on ALL web contents that are associated with
8176      * this session just before normal `preload` scripts run.
8177      */
8178     setPreloads(preloads: string[]): void;
8179     /**
8180      * Resolves when the proxy setting process is complete.
8181      *
8182      * Sets the proxy settings.
8183      *
8184      * When `mode` is unspecified, `pacScript` and `proxyRules` are provided together,
8185      * the `proxyRules` option is ignored and `pacScript` configuration is applied.
8186      *
8187      * You may need `ses.closeAllConnections` to close currently in flight connections
8188      * to prevent pooled sockets using previous proxy from being reused by future
8189      * requests.
8190      *
8191      * The `proxyRules` has to follow the rules below:
8192      *
8193      * For example:
8194      *
8195      * * `http=foopy:80;ftp=foopy2` - Use HTTP proxy `foopy:80` for `http://` URLs, and
8196      * HTTP proxy `foopy2:80` for `ftp://` URLs.
8197      * * `foopy:80` - Use HTTP proxy `foopy:80` for all URLs.
8198      * * `foopy:80,bar,direct://` - Use HTTP proxy `foopy:80` for all URLs, failing
8199      * over to `bar` if `foopy:80` is unavailable, and after that using no proxy.
8200      * * `socks4://foopy` - Use SOCKS v4 proxy `foopy:1080` for all URLs.
8201      * * `http=foopy,socks5://bar.com` - Use HTTP proxy `foopy` for http URLs, and fail
8202      * over to the SOCKS5 proxy `bar.com` if `foopy` is unavailable.
8203      * * `http=foopy,direct://` - Use HTTP proxy `foopy` for http URLs, and use no
8204      * proxy if `foopy` is unavailable.
8205      * * `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use
8206      * `socks4://foopy2` for all other URLs.
8207      *
8208      * The `proxyBypassRules` is a comma separated list of rules described below:
8209      *
8210      * * `[ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" <port> ]`
8211      *
8212      * Match all hostnames that match the pattern HOSTNAME_PATTERN.
8213      *
8214      * Examples: "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99",
8215      * "https://x.*.y.com:99"
8216      * * `"." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]`
8217      *
8218      * Match a particular domain suffix.
8219      *
8220      * Examples: ".google.com", ".com", "http://.google.com"
8221      * * `[ SCHEME "://" ] IP_LITERAL [ ":" PORT ]`
8222      *
8223      * Match URLs which are IP address literals.
8224      *
8225      * Examples: "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
8226      * * `IP_LITERAL "/" PREFIX_LENGTH_IN_BITS`
8227      *
8228      * Match any URL that is to an IP literal that falls between the given range. IP
8229      * range is specified using CIDR notation.
8230      *
8231      * Examples: "192.168.1.1/16", "fefe:13::abc/33".
8232      * * `<local>`
8233      *
8234      * Match local addresses. The meaning of `<local>` is whether the host matches one
8235      * of: "127.0.0.1", "::1", "localhost".
8236      */
8237     setProxy(config: Config): Promise<void>;
8238     /**
8239      * By default Electron will download hunspell dictionaries from the Chromium CDN.
8240      * If you want to override this behavior you can use this API to point the
8241      * dictionary downloader at your own hosted version of the hunspell dictionaries.
8242      * We publish a `hunspell_dictionaries.zip` file with each release which contains
8243      * the files you need to host here.
8244      *
8245      * The file server must be **case insensitive**. If you cannot do this, you must
8246      * upload each file twice: once with the case it has in the ZIP file and once with
8247      * the filename as all lowercase.
8248      *
8249      * If the files present in `hunspell_dictionaries.zip` are available at
8250      * `https://example.com/dictionaries/language-code.bdic` then you should call this
8251      * api with
8252      * `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`.
8253      *  Please note the trailing slash.  The URL to the dictionaries is formed as
8254      * `${url}${filename}`.
8255      *
8256      * **Note:** On macOS the OS spellchecker is used and therefore we do not download
8257      * any dictionary files.  This API is a no-op on macOS.
8258      */
8259     setSpellCheckerDictionaryDownloadURL(url: string): void;
8260     /**
8261      * Sets whether to enable the builtin spell checker.
8262      */
8263     setSpellCheckerEnabled(enable: boolean): void;
8264     /**
8265      * The built in spellchecker does not automatically detect what language a user is
8266      * typing in.  In order for the spell checker to correctly check their words you
8267      * must call this API with an array of language codes.  You can get the list of
8268      * supported language codes with the `ses.availableSpellCheckerLanguages` property.
8269      *
8270      * **Note:** On macOS the OS spellchecker is used and will detect your language
8271      * automatically.  This API is a no-op on macOS.
8272      */
8273     setSpellCheckerLanguages(languages: string[]): void;
8274     /**
8275      * Sets the SSL configuration for the session. All subsequent network requests will
8276      * use the new configuration. Existing network connections (such as WebSocket
8277      * connections) will not be terminated, but old sockets in the pool will not be
8278      * reused for new connections.
8279      */
8280     setSSLConfig(config: SSLConfigConfig): void;
8281     /**
8282      * Overrides the `userAgent` and `acceptLanguages` for this session.
8283      *
8284      * The `acceptLanguages` must a comma separated ordered list of language codes, for
8285      * example `"en-US,fr,de,ko,zh-CN,ja"`.
8286      *
8287      * This doesn't affect existing `WebContents`, and each `WebContents` can use
8288      * `webContents.setUserAgent` to override the session-wide user agent.
8289      */
8290     setUserAgent(userAgent: string, acceptLanguages?: string): void;
8291     /**
8292      * A `string[]` array which consists of all the known available spell checker
8293      * languages.  Providing a language code to the `setSpellCheckerLanguages` API that
8294      * isn't in this array will result in an error.
8295      *
8296      */
8297     readonly availableSpellCheckerLanguages: string[];
8298     /**
8299      * A `Cookies` object for this session.
8300      *
8301      */
8302     readonly cookies: Cookies;
8303     /**
8304      * A `NetLog` object for this session.
8305      *
8306      */
8307     readonly netLog: NetLog;
8308     /**
8309      * A `Protocol` object for this session.
8310      *
8311      */
8312     readonly protocol: Protocol;
8313     /**
8314      * A `ServiceWorkers` object for this session.
8315      *
8316      */
8317     readonly serviceWorkers: ServiceWorkers;
8318     /**
8319      * A `boolean` indicating whether builtin spell checker is enabled.
8320      */
8321     spellCheckerEnabled: boolean;
8322     /**
8323      * A `string | null` indicating the absolute file system path where data for this
8324      * session is persisted on disk.  For in memory sessions this returns `null`.
8325      *
8326      */
8327     readonly storagePath: (string) | (null);
8328     /**
8329      * A `WebRequest` object for this session.
8330      *
8331      */
8332     readonly webRequest: WebRequest;
8333   }
8334
8335   interface SharedWorkerInfo {
8336
8337     // Docs: https://electronjs.org/docs/api/structures/shared-worker-info
8338
8339     /**
8340      * The unique id of the shared worker.
8341      */
8342     id: string;
8343     /**
8344      * The url of the shared worker.
8345      */
8346     url: string;
8347   }
8348
8349   class ShareMenu extends NodeEventEmitter {
8350
8351     // Docs: https://electronjs.org/docs/api/share-menu
8352
8353     /**
8354      * ShareMenu
8355      */
8356     constructor(sharingItem: SharingItem);
8357     /**
8358      * Closes the context menu in the `browserWindow`.
8359      */
8360     closePopup(browserWindow?: BrowserWindow): void;
8361     /**
8362      * Pops up this menu as a context menu in the `BrowserWindow`.
8363      */
8364     popup(options?: PopupOptions): void;
8365   }
8366
8367   interface SharingItem {
8368
8369     // Docs: https://electronjs.org/docs/api/structures/sharing-item
8370
8371     /**
8372      * An array of files to share.
8373      */
8374     filePaths?: string[];
8375     /**
8376      * An array of text to share.
8377      */
8378     texts?: string[];
8379     /**
8380      * An array of URLs to share.
8381      */
8382     urls?: string[];
8383   }
8384
8385   interface Shell {
8386
8387     // Docs: https://electronjs.org/docs/api/shell
8388
8389     /**
8390      * Play the beep sound.
8391      */
8392     beep(): void;
8393     /**
8394      * Open the given external protocol URL in the desktop's default manner. (For
8395      * example, mailto: URLs in the user's default mail agent).
8396      */
8397     openExternal(url: string, options?: OpenExternalOptions): Promise<void>;
8398     /**
8399      * Resolves with a string containing the error message corresponding to the failure
8400      * if a failure occurred, otherwise "".
8401      *
8402      * Open the given file in the desktop's default manner.
8403      */
8404     openPath(path: string): Promise<string>;
8405     /**
8406      * Resolves the shortcut link at `shortcutPath`.
8407      *
8408      * An exception will be thrown when any error happens.
8409      *
8410      * @platform win32
8411      */
8412     readShortcutLink(shortcutPath: string): ShortcutDetails;
8413     /**
8414      * Show the given file in a file manager. If possible, select the file.
8415      */
8416     showItemInFolder(fullPath: string): void;
8417     /**
8418      * Resolves when the operation has been completed. Rejects if there was an error
8419      * while deleting the requested item.
8420      *
8421      * This moves a path to the OS-specific trash location (Trash on macOS, Recycle Bin
8422      * on Windows, and a desktop-environment-specific location on Linux).
8423      */
8424     trashItem(path: string): Promise<void>;
8425     /**
8426      * Whether the shortcut was created successfully.
8427      *
8428      * Creates or updates a shortcut link at `shortcutPath`.
8429      *
8430      * @platform win32
8431      */
8432     writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutDetails): boolean;
8433     /**
8434      * Whether the shortcut was created successfully.
8435      *
8436      * Creates or updates a shortcut link at `shortcutPath`.
8437      *
8438      * @platform win32
8439      */
8440     writeShortcutLink(shortcutPath: string, options: ShortcutDetails): boolean;
8441   }
8442
8443   interface ShortcutDetails {
8444
8445     // Docs: https://electronjs.org/docs/api/structures/shortcut-details
8446
8447     /**
8448      * The Application User Model ID. Default is empty.
8449      */
8450     appUserModelId?: string;
8451     /**
8452      * The arguments to be applied to `target` when launching from this shortcut.
8453      * Default is empty.
8454      */
8455     args?: string;
8456     /**
8457      * The working directory. Default is empty.
8458      */
8459     cwd?: string;
8460     /**
8461      * The description of the shortcut. Default is empty.
8462      */
8463     description?: string;
8464     /**
8465      * The path to the icon, can be a DLL or EXE. `icon` and `iconIndex` have to be set
8466      * together. Default is empty, which uses the target's icon.
8467      */
8468     icon?: string;
8469     /**
8470      * The resource ID of icon when `icon` is a DLL or EXE. Default is 0.
8471      */
8472     iconIndex?: number;
8473     /**
8474      * The target to launch from this shortcut.
8475      */
8476     target: string;
8477     /**
8478      * The Application Toast Activator CLSID. Needed for participating in Action
8479      * Center.
8480      */
8481     toastActivatorClsid?: string;
8482   }
8483
8484   interface Size {
8485
8486     // Docs: https://electronjs.org/docs/api/structures/size
8487
8488     height: number;
8489     width: number;
8490   }
8491
8492   interface SystemPreferences extends NodeJS.EventEmitter {
8493
8494     // Docs: https://electronjs.org/docs/api/system-preferences
8495
8496     on(event: 'accent-color-changed', listener: (event: Event,
8497                                                  /**
8498                                                   * The new RGBA color the user assigned to be their system accent color.
8499                                                   */
8500                                                  newColor: string) => void): this;
8501     once(event: 'accent-color-changed', listener: (event: Event,
8502                                                  /**
8503                                                   * The new RGBA color the user assigned to be their system accent color.
8504                                                   */
8505                                                  newColor: string) => void): this;
8506     addListener(event: 'accent-color-changed', listener: (event: Event,
8507                                                  /**
8508                                                   * The new RGBA color the user assigned to be their system accent color.
8509                                                   */
8510                                                  newColor: string) => void): this;
8511     removeListener(event: 'accent-color-changed', listener: (event: Event,
8512                                                  /**
8513                                                   * The new RGBA color the user assigned to be their system accent color.
8514                                                   */
8515                                                  newColor: string) => void): this;
8516     on(event: 'color-changed', listener: (event: Event) => void): this;
8517     once(event: 'color-changed', listener: (event: Event) => void): this;
8518     addListener(event: 'color-changed', listener: (event: Event) => void): this;
8519     removeListener(event: 'color-changed', listener: (event: Event) => void): this;
8520     /**
8521      * **Deprecated:** Should use the new `updated` event on the `nativeTheme` module.
8522      *
8523      * @deprecated
8524      * @platform win32
8525      */
8526     on(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
8527                                                                /**
8528                                                                 * `true` if a high contrast theme is being used, `false` otherwise.
8529                                                                 */
8530                                                                highContrastColorScheme: boolean) => void): this;
8531     once(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
8532                                                                /**
8533                                                                 * `true` if a high contrast theme is being used, `false` otherwise.
8534                                                                 */
8535                                                                highContrastColorScheme: boolean) => void): this;
8536     addListener(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
8537                                                                /**
8538                                                                 * `true` if a high contrast theme is being used, `false` otherwise.
8539                                                                 */
8540                                                                highContrastColorScheme: boolean) => void): this;
8541     removeListener(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
8542                                                                /**
8543                                                                 * `true` if a high contrast theme is being used, `false` otherwise.
8544                                                                 */
8545                                                                highContrastColorScheme: boolean) => void): this;
8546     /**
8547      * **Deprecated:** Should use the new `updated` event on the `nativeTheme` module.
8548      *
8549      * @deprecated
8550      * @platform win32
8551      */
8552     on(event: 'inverted-color-scheme-changed', listener: (event: Event,
8553                                                           /**
8554                                                            * `true` if an inverted color scheme (a high contrast color scheme with light text
8555                                                            * and dark backgrounds) is being used, `false` otherwise.
8556                                                            */
8557                                                           invertedColorScheme: boolean) => void): this;
8558     once(event: 'inverted-color-scheme-changed', listener: (event: Event,
8559                                                           /**
8560                                                            * `true` if an inverted color scheme (a high contrast color scheme with light text
8561                                                            * and dark backgrounds) is being used, `false` otherwise.
8562                                                            */
8563                                                           invertedColorScheme: boolean) => void): this;
8564     addListener(event: 'inverted-color-scheme-changed', listener: (event: Event,
8565                                                           /**
8566                                                            * `true` if an inverted color scheme (a high contrast color scheme with light text
8567                                                            * and dark backgrounds) is being used, `false` otherwise.
8568                                                            */
8569                                                           invertedColorScheme: boolean) => void): this;
8570     removeListener(event: 'inverted-color-scheme-changed', listener: (event: Event,
8571                                                           /**
8572                                                            * `true` if an inverted color scheme (a high contrast color scheme with light text
8573                                                            * and dark backgrounds) is being used, `false` otherwise.
8574                                                            */
8575                                                           invertedColorScheme: boolean) => void): this;
8576     /**
8577      * A promise that resolves with `true` if consent was granted and `false` if it was
8578      * denied. If an invalid `mediaType` is passed, the promise will be rejected. If an
8579      * access request was denied and later is changed through the System Preferences
8580      * pane, a restart of the app will be required for the new permissions to take
8581      * effect. If access has already been requested and denied, it _must_ be changed
8582      * through the preference pane; an alert will not pop up and the promise will
8583      * resolve with the existing access status.
8584      *
8585      * **Important:** In order to properly leverage this API, you must set the
8586      * `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your
8587      * app's `Info.plist` file. The values for these keys will be used to populate the
8588      * permission dialogs so that the user will be properly informed as to the purpose
8589      * of the permission request. See Electron Application Distribution for more
8590      * information about how to set these in the context of Electron.
8591      *
8592      * This user consent was not required until macOS 10.14 Mojave, so this method will
8593      * always return `true` if your system is running 10.13 High Sierra or lower.
8594      *
8595      * @platform darwin
8596      */
8597     askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise<boolean>;
8598     /**
8599      * whether or not this device has the ability to use Touch ID.
8600      *
8601      * **NOTE:** This API will return `false` on macOS systems older than Sierra
8602      * 10.12.2.
8603      *
8604      * @platform darwin
8605      */
8606     canPromptTouchID(): boolean;
8607     /**
8608      * The users current system wide accent color preference in RGBA hexadecimal form.
8609      *
8610      * This API is only available on macOS 10.14 Mojave or newer.
8611      *
8612      * @platform win32,darwin
8613      */
8614     getAccentColor(): string;
8615     /**
8616      * * `shouldRenderRichAnimation` boolean - Returns true if rich animations should
8617      * be rendered. Looks at session type (e.g. remote desktop) and accessibility
8618      * settings to give guidance for heavy animations.
8619      * * `scrollAnimationsEnabledBySystem` boolean - Determines on a per-platform basis
8620      * whether scroll animations (e.g. produced by home/end key) should be enabled.
8621      * * `prefersReducedMotion` boolean - Determines whether the user desires reduced
8622      * motion based on platform APIs.
8623      *
8624      * Returns an object with system animation settings.
8625      */
8626     getAnimationSettings(): AnimationSettings;
8627     /**
8628      * | `null` - Can be `dark`, `light` or `unknown`.
8629      *
8630      * Gets the macOS appearance setting that you have declared you want for your
8631      * application, maps to NSApplication.appearance. You can use the
8632      * `setAppLevelAppearance` API to set this value.
8633      *
8634      * @deprecated
8635      * @platform darwin
8636      */
8637     getAppLevelAppearance(): ('dark' | 'light' | 'unknown');
8638     /**
8639      * The system color setting in RGB hexadecimal form (`#ABCDEF`). See the Windows
8640      * docs and the macOS docs for more details.
8641      *
8642      * The following colors are only available on macOS 10.14: `find-highlight`,
8643      * `selected-content-background`, `separator`,
8644      * `unemphasized-selected-content-background`,
8645      * `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
8646      *
8647      * @platform win32,darwin
8648      */
8649     getColor(color: '3d-dark-shadow' | '3d-face' | '3d-highlight' | '3d-light' | '3d-shadow' | 'active-border' | 'active-caption' | 'active-caption-gradient' | 'app-workspace' | 'button-text' | 'caption-text' | 'desktop' | 'disabled-text' | 'highlight' | 'highlight-text' | 'hotlight' | 'inactive-border' | 'inactive-caption' | 'inactive-caption-gradient' | 'inactive-caption-text' | 'info-background' | 'info-text' | 'menu' | 'menu-highlight' | 'menubar' | 'menu-text' | 'scrollbar' | 'window' | 'window-frame' | 'window-text' | 'alternate-selected-control-text' | 'control-background' | 'control' | 'control-text' | 'disabled-control-text' | 'find-highlight' | 'grid' | 'header-text' | 'highlight' | 'keyboard-focus-indicator' | 'label' | 'link' | 'placeholder-text' | 'quaternary-label' | 'scrubber-textured-background' | 'secondary-label' | 'selected-content-background' | 'selected-control' | 'selected-control-text' | 'selected-menu-item-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;
8650     /**
8651      * Can be `dark`, `light` or `unknown`.
8652      *
8653      * Gets the macOS appearance setting that is currently applied to your application,
8654      * maps to NSApplication.effectiveAppearance
8655      *
8656      * @platform darwin
8657      */
8658     getEffectiveAppearance(): ('dark' | 'light' | 'unknown');
8659     /**
8660      * Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
8661      *
8662      * This user consent was not required on macOS 10.13 High Sierra or lower so this
8663      * method will always return `granted`. macOS 10.14 Mojave or higher requires
8664      * consent for `microphone` and `camera` access. macOS 10.15 Catalina or higher
8665      * requires consent for `screen` access.
8666      *
8667      * Windows 10 has a global setting controlling `microphone` and `camera` access for
8668      * all win32 applications. It will always return `granted` for `screen` and for all
8669      * media types on older versions of Windows.
8670      *
8671      * @platform win32,darwin
8672      */
8673     getMediaAccessStatus(mediaType: 'microphone' | 'camera' | 'screen'): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown');
8674     /**
8675      * The standard system color formatted as `#RRGGBBAA`.
8676      *
8677      * Returns one of several standard system colors that automatically adapt to
8678      * vibrancy and changes in accessibility settings like 'Increase contrast' and
8679      * 'Reduce transparency'. See Apple Documentation for  more details.
8680      *
8681      * @platform darwin
8682      */
8683     getSystemColor(color: 'blue' | 'brown' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow'): string;
8684     /**
8685      * The value of `key` in `NSUserDefaults`.
8686      *
8687      * Some popular `key` and `type`s are:
8688      *
8689      * * `AppleInterfaceStyle`: `string`
8690      * * `AppleAquaColorVariant`: `integer`
8691      * * `AppleHighlightColor`: `string`
8692      * * `AppleShowScrollBars`: `string`
8693      * * `NSNavRecentPlaces`: `array`
8694      * * `NSPreferredWebServices`: `dictionary`
8695      * * `NSUserDictionaryReplacementItems`: `array`
8696      *
8697      * @platform darwin
8698      */
8699     getUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type): UserDefaultTypes[Type];
8700     /**
8701      * `true` if DWM composition (Aero Glass) is enabled, and `false` otherwise.
8702      *
8703      * An example of using it to determine if you should create a transparent window or
8704      * not (transparent windows won't work correctly when DWM composition is disabled):
8705      *
8706      * @platform win32
8707      */
8708     isAeroGlassEnabled(): boolean;
8709     /**
8710      * Whether the system is in Dark Mode.
8711      *
8712      * **Deprecated:** Should use the new `nativeTheme.shouldUseDarkColors` API.
8713      *
8714      * @deprecated
8715      * @platform darwin,win32
8716      */
8717     isDarkMode(): boolean;
8718     /**
8719      * `true` if a high contrast theme is active, `false` otherwise.
8720      *
8721      * **Deprecated:** Should use the new `nativeTheme.shouldUseHighContrastColors`
8722      * API.
8723      *
8724      * @deprecated
8725      * @platform darwin,win32
8726      */
8727     isHighContrastColorScheme(): boolean;
8728     /**
8729      * `true` if an inverted color scheme (a high contrast color scheme with light text
8730      * and dark backgrounds) is active, `false` otherwise.
8731      *
8732      * **Deprecated:** Should use the new `nativeTheme.shouldUseInvertedColorScheme`
8733      * API.
8734      *
8735      * @deprecated
8736      * @platform win32
8737      */
8738     isInvertedColorScheme(): boolean;
8739     /**
8740      * Whether the Swipe between pages setting is on.
8741      *
8742      * @platform darwin
8743      */
8744     isSwipeTrackingFromScrollEventsEnabled(): boolean;
8745     /**
8746      * `true` if the current process is a trusted accessibility client and `false` if
8747      * it is not.
8748      *
8749      * @platform darwin
8750      */
8751     isTrustedAccessibilityClient(prompt: boolean): boolean;
8752     /**
8753      * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
8754      * contains the user information dictionary sent along with the notification.
8755      *
8756      * @platform darwin
8757      */
8758     postLocalNotification(event: string, userInfo: Record<string, any>): void;
8759     /**
8760      * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
8761      * contains the user information dictionary sent along with the notification.
8762      *
8763      * @platform darwin
8764      */
8765     postNotification(event: string, userInfo: Record<string, any>, deliverImmediately?: boolean): void;
8766     /**
8767      * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
8768      * contains the user information dictionary sent along with the notification.
8769      *
8770      * @platform darwin
8771      */
8772     postWorkspaceNotification(event: string, userInfo: Record<string, any>): void;
8773     /**
8774      * resolves if the user has successfully authenticated with Touch ID.
8775      *
8776      * This API itself will not protect your user data; rather, it is a mechanism to
8777      * allow you to do so. Native apps will need to set Access Control Constants like
8778      * `kSecAccessControlUserPresence` on their keychain entry so that reading it would
8779      * auto-prompt for Touch ID biometric consent. This could be done with
8780      * `node-keytar`, such that one would store an encryption key with `node-keytar`
8781      * and only fetch it if `promptTouchID()` resolves.
8782      *
8783      * **NOTE:** This API will return a rejected Promise on macOS systems older than
8784      * Sierra 10.12.2.
8785      *
8786      * @platform darwin
8787      */
8788     promptTouchID(reason: string): Promise<void>;
8789     /**
8790      * Add the specified defaults to your application's `NSUserDefaults`.
8791      *
8792      * @platform darwin
8793      */
8794     registerDefaults(defaults: Record<string, (string) | (boolean) | (number)>): void;
8795     /**
8796      * Removes the `key` in `NSUserDefaults`. This can be used to restore the default
8797      * or global value of a `key` previously set with `setUserDefault`.
8798      *
8799      * @platform darwin
8800      */
8801     removeUserDefault(key: string): void;
8802     /**
8803      * Sets the appearance setting for your application, this should override the
8804      * system default and override the value of `getEffectiveAppearance`.
8805      *
8806      * @deprecated
8807      * @platform darwin
8808      */
8809     setAppLevelAppearance(appearance: (('dark' | 'light')) | (null)): void;
8810     /**
8811      * Set the value of `key` in `NSUserDefaults`.
8812      *
8813      * Note that `type` should match actual type of `value`. An exception is thrown if
8814      * they don't.
8815      *
8816      * Some popular `key` and `type`s are:
8817      *
8818      * * `ApplePressAndHoldEnabled`: `boolean`
8819      *
8820      * @platform darwin
8821      */
8822     setUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type, value: UserDefaultTypes[Type]): void;
8823     /**
8824      * The ID of this subscription
8825      *
8826      * Same as `subscribeNotification`, but uses `NSNotificationCenter` for local
8827      * defaults. This is necessary for events such as
8828      * `NSUserDefaultsDidChangeNotification`.
8829      *
8830      * If `event` is null, the `NSNotificationCenter` doesn’t use it as criteria for
8831      * delivery to the observer. See docs for more information.
8832      *
8833      * @platform darwin
8834      */
8835     subscribeLocalNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
8836     /**
8837      * The ID of this subscription
8838      *
8839      * Subscribes to native notifications of macOS, `callback` will be called with
8840      * `callback(event, userInfo)` when the corresponding `event` happens. The
8841      * `userInfo` is an Object that contains the user information dictionary sent along
8842      * with the notification. The `object` is the sender of the notification, and only
8843      * supports `NSString` values for now.
8844      *
8845      * The `id` of the subscriber is returned, which can be used to unsubscribe the
8846      * `event`.
8847      *
8848      * Under the hood this API subscribes to `NSDistributedNotificationCenter`, example
8849      * values of `event` are:
8850      *
8851      * * `AppleInterfaceThemeChangedNotification`
8852      * * `AppleAquaColorVariantChanged`
8853      * * `AppleColorPreferencesChangedNotification`
8854      * * `AppleShowScrollBarsSettingChanged`
8855      *
8856      * If `event` is null, the `NSDistributedNotificationCenter` doesn’t use it as
8857      * criteria for delivery to the observer. See docs  for more information.
8858      *
8859      * @platform darwin
8860      */
8861     subscribeNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
8862     /**
8863      * The ID of this subscription
8864      *
8865      * Same as `subscribeNotification`, but uses
8866      * `NSWorkspace.sharedWorkspace.notificationCenter`. This is necessary for events
8867      * such as `NSWorkspaceDidActivateApplicationNotification`.
8868      *
8869      * If `event` is null, the `NSWorkspaceNotificationCenter` doesn’t use it as
8870      * criteria for delivery to the observer. See docs for more information.
8871      *
8872      * @platform darwin
8873      */
8874     subscribeWorkspaceNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
8875     /**
8876      * Same as `unsubscribeNotification`, but removes the subscriber from
8877      * `NSNotificationCenter`.
8878      *
8879      * @platform darwin
8880      */
8881     unsubscribeLocalNotification(id: number): void;
8882     /**
8883      * Removes the subscriber with `id`.
8884      *
8885      * @platform darwin
8886      */
8887     unsubscribeNotification(id: number): void;
8888     /**
8889      * Same as `unsubscribeNotification`, but removes the subscriber from
8890      * `NSWorkspace.sharedWorkspace.notificationCenter`.
8891      *
8892      * @platform darwin
8893      */
8894     unsubscribeWorkspaceNotification(id: number): void;
8895     /**
8896      * A `string` property that can be `dark`, `light` or `unknown`. It determines the
8897      * macOS appearance setting for your application. This maps to values in:
8898      * NSApplication.appearance. Setting this will override the system default as well
8899      * as the value of `getEffectiveAppearance`.
8900      *
8901      * Possible values that can be set are `dark` and `light`, and possible return
8902      * values are `dark`, `light`, and `unknown`.
8903      *
8904      * This property is only available on macOS 10.14 Mojave or newer.
8905      *
8906      * @platform darwin
8907      */
8908     appLevelAppearance: ('dark' | 'light' | 'unknown');
8909     /**
8910      * A `string` property that can be `dark`, `light` or `unknown`.
8911      *
8912      * Returns the macOS appearance setting that is currently applied to your
8913      * application, maps to NSApplication.effectiveAppearance
8914      *
8915      * @platform darwin
8916      */
8917     readonly effectiveAppearance: ('dark' | 'light' | 'unknown');
8918   }
8919
8920   interface Task {
8921
8922     // Docs: https://electronjs.org/docs/api/structures/task
8923
8924     /**
8925      * The command line arguments when `program` is executed.
8926      */
8927     arguments: string;
8928     /**
8929      * Description of this task.
8930      */
8931     description: string;
8932     /**
8933      * The icon index in the icon file. If an icon file consists of two or more icons,
8934      * set this value to identify the icon. If an icon file consists of one icon, this
8935      * value is 0.
8936      */
8937     iconIndex: number;
8938     /**
8939      * The absolute path to an icon to be displayed in a JumpList, which can be an
8940      * arbitrary resource file that contains an icon. You can usually specify
8941      * `process.execPath` to show the icon of the program.
8942      */
8943     iconPath: string;
8944     /**
8945      * Path of the program to execute, usually you should specify `process.execPath`
8946      * which opens the current program.
8947      */
8948     program: string;
8949     /**
8950      * The string to be displayed in a JumpList.
8951      */
8952     title: string;
8953     /**
8954      * The working directory. Default is empty.
8955      */
8956     workingDirectory?: string;
8957   }
8958
8959   interface ThumbarButton {
8960
8961     // Docs: https://electronjs.org/docs/api/structures/thumbar-button
8962
8963     click: Function;
8964     /**
8965      * Control specific states and behaviors of the button. By default, it is
8966      * `['enabled']`.
8967      */
8968     flags?: string[];
8969     /**
8970      * The icon showing in thumbnail toolbar.
8971      */
8972     icon: NativeImage;
8973     /**
8974      * The text of the button's tooltip.
8975      */
8976     tooltip?: string;
8977   }
8978
8979   class TouchBar {
8980
8981     // Docs: https://electronjs.org/docs/api/touch-bar
8982
8983     /**
8984      * TouchBar
8985      */
8986     constructor(options: TouchBarConstructorOptions);
8987     /**
8988      * A `TouchBarItem` that will replace the "esc" button on the touch bar when set.
8989      * Setting to `null` restores the default "esc" button. Changing this value
8990      * immediately updates the escape item in the touch bar.
8991      */
8992     escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null);
8993     /**
8994      * A `typeof TouchBarButton` reference to the `TouchBarButton` class.
8995      */
8996     static TouchBarButton: typeof TouchBarButton;
8997     /**
8998      * A `typeof TouchBarColorPicker` reference to the `TouchBarColorPicker` class.
8999      */
9000     static TouchBarColorPicker: typeof TouchBarColorPicker;
9001     /**
9002      * A `typeof TouchBarGroup` reference to the `TouchBarGroup` class.
9003      */
9004     static TouchBarGroup: typeof TouchBarGroup;
9005     /**
9006      * A `typeof TouchBarLabel` reference to the `TouchBarLabel` class.
9007      */
9008     static TouchBarLabel: typeof TouchBarLabel;
9009     /**
9010      * A `typeof TouchBarOtherItemsProxy` reference to the `TouchBarOtherItemsProxy`
9011      * class.
9012      */
9013     static TouchBarOtherItemsProxy: typeof TouchBarOtherItemsProxy;
9014     /**
9015      * A `typeof TouchBarPopover` reference to the `TouchBarPopover` class.
9016      */
9017     static TouchBarPopover: typeof TouchBarPopover;
9018     /**
9019      * A `typeof TouchBarScrubber` reference to the `TouchBarScrubber` class.
9020      */
9021     static TouchBarScrubber: typeof TouchBarScrubber;
9022     /**
9023      * A `typeof TouchBarSegmentedControl` reference to the `TouchBarSegmentedControl`
9024      * class.
9025      */
9026     static TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
9027     /**
9028      * A `typeof TouchBarSlider` reference to the `TouchBarSlider` class.
9029      */
9030     static TouchBarSlider: typeof TouchBarSlider;
9031     /**
9032      * A `typeof TouchBarSpacer` reference to the `TouchBarSpacer` class.
9033      */
9034     static TouchBarSpacer: typeof TouchBarSpacer;
9035   }
9036
9037   class TouchBarButton {
9038
9039     // Docs: https://electronjs.org/docs/api/touch-bar-button
9040
9041     /**
9042      * TouchBarButton
9043      */
9044     constructor(options: TouchBarButtonConstructorOptions);
9045     /**
9046      * A `string` representing the description of the button to be read by a screen
9047      * reader. Will only be read by screen readers if no label is set.
9048      */
9049     accessibilityLabel: string;
9050     /**
9051      * A `string` hex code representing the button's current background color. Changing
9052      * this value immediately updates the button in the touch bar.
9053      */
9054     backgroundColor: string;
9055     /**
9056      * A `boolean` representing whether the button is in an enabled state.
9057      */
9058     enabled: boolean;
9059     /**
9060      * A `NativeImage` representing the button's current icon. Changing this value
9061      * immediately updates the button in the touch bar.
9062      */
9063     icon: NativeImage;
9064     /**
9065      * A `string` - Can be `left`, `right` or `overlay`.  Defaults to `overlay`.
9066      */
9067     iconPosition: ('left' | 'right' | 'overlay');
9068     /**
9069      * A `string` representing the button's current text. Changing this value
9070      * immediately updates the button in the touch bar.
9071      */
9072     label: string;
9073   }
9074
9075   class TouchBarColorPicker extends NodeEventEmitter {
9076
9077     // Docs: https://electronjs.org/docs/api/touch-bar-color-picker
9078
9079     /**
9080      * TouchBarColorPicker
9081      */
9082     constructor(options: TouchBarColorPickerConstructorOptions);
9083     /**
9084      * A `string[]` array representing the color picker's available colors to select.
9085      * Changing this value immediately updates the color picker in the touch bar.
9086      */
9087     availableColors: string[];
9088     /**
9089      * A `string` hex code representing the color picker's currently selected color.
9090      * Changing this value immediately updates the color picker in the touch bar.
9091      */
9092     selectedColor: string;
9093   }
9094
9095   class TouchBarGroup extends NodeEventEmitter {
9096
9097     // Docs: https://electronjs.org/docs/api/touch-bar-group
9098
9099     /**
9100      * TouchBarGroup
9101      */
9102     constructor(options: TouchBarGroupConstructorOptions);
9103   }
9104
9105   class TouchBarLabel extends NodeEventEmitter {
9106
9107     // Docs: https://electronjs.org/docs/api/touch-bar-label
9108
9109     /**
9110      * TouchBarLabel
9111      */
9112     constructor(options: TouchBarLabelConstructorOptions);
9113     /**
9114      * A `string` representing the description of the label to be read by a screen
9115      * reader.
9116      */
9117     accessibilityLabel: string;
9118     /**
9119      * A `string` representing the label's current text. Changing this value
9120      * immediately updates the label in the touch bar.
9121      */
9122     label: string;
9123     /**
9124      * A `string` hex code representing the label's current text color. Changing this
9125      * value immediately updates the label in the touch bar.
9126      */
9127     textColor: string;
9128   }
9129
9130   class TouchBarOtherItemsProxy extends NodeEventEmitter {
9131
9132     // Docs: https://electronjs.org/docs/api/touch-bar-other-items-proxy
9133
9134     /**
9135      * TouchBarOtherItemsProxy
9136      */
9137     constructor();
9138   }
9139
9140   class TouchBarPopover extends NodeEventEmitter {
9141
9142     // Docs: https://electronjs.org/docs/api/touch-bar-popover
9143
9144     /**
9145      * TouchBarPopover
9146      */
9147     constructor(options: TouchBarPopoverConstructorOptions);
9148     /**
9149      * A `NativeImage` representing the popover's current button icon. Changing this
9150      * value immediately updates the popover in the touch bar.
9151      */
9152     icon: NativeImage;
9153     /**
9154      * A `string` representing the popover's current button text. Changing this value
9155      * immediately updates the popover in the touch bar.
9156      */
9157     label: string;
9158   }
9159
9160   class TouchBarScrubber extends NodeEventEmitter {
9161
9162     // Docs: https://electronjs.org/docs/api/touch-bar-scrubber
9163
9164     /**
9165      * TouchBarScrubber
9166      */
9167     constructor(options: TouchBarScrubberConstructorOptions);
9168     /**
9169      * A `boolean` representing whether this scrubber is continuous or not. Updating
9170      * this value immediately updates the control in the touch bar.
9171      */
9172     continuous: boolean;
9173     /**
9174      * A `ScrubberItem[]` array representing the items in this scrubber. Updating this
9175      * value immediately updates the control in the touch bar. Updating deep properties
9176      * inside this array **does not update the touch bar**.
9177      */
9178     items: ScrubberItem[];
9179     /**
9180      * A `string` representing the mode of this scrubber. Updating this value
9181      * immediately updates the control in the touch bar. Possible values:
9182      *
9183      * * `fixed` - Maps to `NSScrubberModeFixed`.
9184      * * `free` - Maps to `NSScrubberModeFree`.
9185      */
9186     mode: ('fixed' | 'free');
9187     /**
9188      * A `string` representing the style that selected items in the scrubber should
9189      * have. This style is overlayed on top of the scrubber item instead of being
9190      * placed behind it. Updating this value immediately updates the control in the
9191      * touch bar. Possible values:
9192      *
9193      * * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
9194      * * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
9195      * * `none` - Removes all styles.
9196      */
9197     overlayStyle: ('background' | 'outline' | 'none');
9198     /**
9199      * A `string` representing the style that selected items in the scrubber should
9200      * have. Updating this value immediately updates the control in the touch bar.
9201      * Possible values:
9202      *
9203      * * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
9204      * * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
9205      * * `none` - Removes all styles.
9206      */
9207     selectedStyle: ('background' | 'outline' | 'none');
9208     /**
9209      * A `boolean` representing whether to show the left / right selection arrows in
9210      * this scrubber. Updating this value immediately updates the control in the touch
9211      * bar.
9212      */
9213     showArrowButtons: boolean;
9214   }
9215
9216   class TouchBarSegmentedControl extends NodeEventEmitter {
9217
9218     // Docs: https://electronjs.org/docs/api/touch-bar-segmented-control
9219
9220     /**
9221      * TouchBarSegmentedControl
9222      */
9223     constructor(options: TouchBarSegmentedControlConstructorOptions);
9224     /**
9225      * A `string` representing the current selection mode of the control.  Can be
9226      * `single`, `multiple` or `buttons`.
9227      */
9228     mode: ('single' | 'multiple' | 'buttons');
9229     /**
9230      * A `SegmentedControlSegment[]` array representing the segments in this control.
9231      * Updating this value immediately updates the control in the touch bar. Updating
9232      * deep properties inside this array **does not update the touch bar**.
9233      */
9234     segments: SegmentedControlSegment[];
9235     /**
9236      * A `string` representing the controls current segment style. Updating this value
9237      * immediately updates the control in the touch bar.
9238      */
9239     segmentStyle: string;
9240     /**
9241      * An `Integer` representing the currently selected segment. Changing this value
9242      * immediately updates the control in the touch bar. User interaction with the
9243      * touch bar will update this value automatically.
9244      */
9245     selectedIndex: number;
9246   }
9247
9248   class TouchBarSlider extends NodeEventEmitter {
9249
9250     // Docs: https://electronjs.org/docs/api/touch-bar-slider
9251
9252     /**
9253      * TouchBarSlider
9254      */
9255     constructor(options: TouchBarSliderConstructorOptions);
9256     /**
9257      * A `string` representing the slider's current text. Changing this value
9258      * immediately updates the slider in the touch bar.
9259      */
9260     label: string;
9261     /**
9262      * A `number` representing the slider's current maximum value. Changing this value
9263      * immediately updates the slider in the touch bar.
9264      */
9265     maxValue: number;
9266     /**
9267      * A `number` representing the slider's current minimum value. Changing this value
9268      * immediately updates the slider in the touch bar.
9269      */
9270     minValue: number;
9271     /**
9272      * A `number` representing the slider's current value. Changing this value
9273      * immediately updates the slider in the touch bar.
9274      */
9275     value: number;
9276   }
9277
9278   class TouchBarSpacer extends NodeEventEmitter {
9279
9280     // Docs: https://electronjs.org/docs/api/touch-bar-spacer
9281
9282     /**
9283      * TouchBarSpacer
9284      */
9285     constructor(options: TouchBarSpacerConstructorOptions);
9286     /**
9287      * A `string` representing the size of the spacer.  Can be `small`, `large` or
9288      * `flexible`.
9289      */
9290     size: ('small' | 'large' | 'flexible');
9291   }
9292
9293   interface TraceCategoriesAndOptions {
9294
9295     // Docs: https://electronjs.org/docs/api/structures/trace-categories-and-options
9296
9297     /**
9298      * A filter to control what category groups should be traced. A filter can have an
9299      * optional '-' prefix to exclude category groups that contain a matching category.
9300      * Having both included and excluded category patterns in the same list is not
9301      * supported. Examples: `test_MyTest*`, `test_MyTest*,test_OtherStuff`,
9302      * `-excluded_category1,-excluded_category2`.
9303      */
9304     categoryFilter: string;
9305     /**
9306      * Controls what kind of tracing is enabled, it is a comma-delimited sequence of
9307      * the following strings: `record-until-full`, `record-continuously`,
9308      * `trace-to-console`, `enable-sampling`, `enable-systrace`, e.g.
9309      * `'record-until-full,enable-sampling'`. The first 3 options are trace recording
9310      * modes and hence mutually exclusive. If more than one trace recording modes
9311      * appear in the `traceOptions` string, the last one takes precedence. If none of
9312      * the trace recording modes are specified, recording mode is `record-until-full`.
9313      * The trace option will first be reset to the default option (`record_mode` set to
9314      * `record-until-full`, `enable_sampling` and `enable_systrace` set to `false`)
9315      * before options parsed from `traceOptions` are applied on it.
9316      */
9317     traceOptions: string;
9318   }
9319
9320   interface TraceConfig {
9321
9322     // Docs: https://electronjs.org/docs/api/structures/trace-config
9323
9324     /**
9325      * if true, filter event data according to a specific list of events that have been
9326      * manually vetted to not include any PII. See the implementation in Chromium for
9327      * specifics.
9328      */
9329     enable_argument_filter?: boolean;
9330     /**
9331      * a list of tracing categories to exclude. Can include glob-like patterns using
9332      * `*` at the end of the category name. See tracing categories for the list of
9333      * categories.
9334      */
9335     excluded_categories?: string[];
9336     /**
9337      * a list of histogram names to report with the trace.
9338      */
9339     histogram_names?: string[];
9340     /**
9341      * a list of tracing categories to include. Can include glob-like patterns using
9342      * `*` at the end of the category name. See tracing categories for the list of
9343      * categories.
9344      */
9345     included_categories?: string[];
9346     /**
9347      * a list of process IDs to include in the trace. If not specified, trace all
9348      * processes.
9349      */
9350     included_process_ids?: number[];
9351     /**
9352      * if the `disabled-by-default-memory-infra` category is enabled, this contains
9353      * optional additional configuration for data collection. See the Chromium
9354      * memory-infra docs for more information.
9355      */
9356     memory_dump_config?: Record<string, any>;
9357     /**
9358      * Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible`
9359      * or `trace-to-console`. Defaults to `record-until-full`.
9360      */
9361     recording_mode?: ('record-until-full' | 'record-continuously' | 'record-as-much-as-possible' | 'trace-to-console');
9362     /**
9363      * maximum size of the trace recording buffer in events.
9364      */
9365     trace_buffer_size_in_events?: number;
9366     /**
9367      * maximum size of the trace recording buffer in kilobytes. Defaults to 100MB.
9368      */
9369     trace_buffer_size_in_kb?: number;
9370   }
9371
9372   interface Transaction {
9373
9374     // Docs: https://electronjs.org/docs/api/structures/transaction
9375
9376     /**
9377      * The error code if an error occurred while processing the transaction.
9378      */
9379     errorCode: number;
9380     /**
9381      * The error message if an error occurred while processing the transaction.
9382      */
9383     errorMessage: string;
9384     /**
9385      * The identifier of the restored transaction by the App Store.
9386      */
9387     originalTransactionIdentifier: string;
9388     payment: Payment;
9389     /**
9390      * The date the transaction was added to the App Store’s payment queue.
9391      */
9392     transactionDate: string;
9393     /**
9394      * A string that uniquely identifies a successful payment transaction.
9395      */
9396     transactionIdentifier: string;
9397     /**
9398      * The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or
9399      * `deferred`.
9400      */
9401     transactionState: ('purchasing' | 'purchased' | 'failed' | 'restored' | 'deferred');
9402   }
9403
9404   class Tray extends NodeEventEmitter {
9405
9406     // Docs: https://electronjs.org/docs/api/tray
9407
9408     /**
9409      * Emitted when the tray balloon is clicked.
9410      *
9411      * @platform win32
9412      */
9413     on(event: 'balloon-click', listener: Function): this;
9414     once(event: 'balloon-click', listener: Function): this;
9415     addListener(event: 'balloon-click', listener: Function): this;
9416     removeListener(event: 'balloon-click', listener: Function): this;
9417     /**
9418      * Emitted when the tray balloon is closed because of timeout or user manually
9419      * closes it.
9420      *
9421      * @platform win32
9422      */
9423     on(event: 'balloon-closed', listener: Function): this;
9424     once(event: 'balloon-closed', listener: Function): this;
9425     addListener(event: 'balloon-closed', listener: Function): this;
9426     removeListener(event: 'balloon-closed', listener: Function): this;
9427     /**
9428      * Emitted when the tray balloon shows.
9429      *
9430      * @platform win32
9431      */
9432     on(event: 'balloon-show', listener: Function): this;
9433     once(event: 'balloon-show', listener: Function): this;
9434     addListener(event: 'balloon-show', listener: Function): this;
9435     removeListener(event: 'balloon-show', listener: Function): this;
9436     /**
9437      * Emitted when the tray icon is clicked.
9438      *
9439      * Note that on Linux this event is emitted when the tray icon receives an
9440      * activation, which might not necessarily be left mouse click.
9441      */
9442     on(event: 'click', listener: (event: KeyboardEvent,
9443                                   /**
9444                                    * The bounds of tray icon.
9445                                    */
9446                                   bounds: Rectangle,
9447                                   /**
9448                                    * The position of the event.
9449                                    */
9450                                   position: Point) => void): this;
9451     once(event: 'click', listener: (event: KeyboardEvent,
9452                                   /**
9453                                    * The bounds of tray icon.
9454                                    */
9455                                   bounds: Rectangle,
9456                                   /**
9457                                    * The position of the event.
9458                                    */
9459                                   position: Point) => void): this;
9460     addListener(event: 'click', listener: (event: KeyboardEvent,
9461                                   /**
9462                                    * The bounds of tray icon.
9463                                    */
9464                                   bounds: Rectangle,
9465                                   /**
9466                                    * The position of the event.
9467                                    */
9468                                   position: Point) => void): this;
9469     removeListener(event: 'click', listener: (event: KeyboardEvent,
9470                                   /**
9471                                    * The bounds of tray icon.
9472                                    */
9473                                   bounds: Rectangle,
9474                                   /**
9475                                    * The position of the event.
9476                                    */
9477                                   position: Point) => void): this;
9478     /**
9479      * Emitted when the tray icon is double clicked.
9480      *
9481      * @platform darwin,win32
9482      */
9483     on(event: 'double-click', listener: (event: KeyboardEvent,
9484                                          /**
9485                                           * The bounds of tray icon.
9486                                           */
9487                                          bounds: Rectangle) => void): this;
9488     once(event: 'double-click', listener: (event: KeyboardEvent,
9489                                          /**
9490                                           * The bounds of tray icon.
9491                                           */
9492                                          bounds: Rectangle) => void): this;
9493     addListener(event: 'double-click', listener: (event: KeyboardEvent,
9494                                          /**
9495                                           * The bounds of tray icon.
9496                                           */
9497                                          bounds: Rectangle) => void): this;
9498     removeListener(event: 'double-click', listener: (event: KeyboardEvent,
9499                                          /**
9500                                           * The bounds of tray icon.
9501                                           */
9502                                          bounds: Rectangle) => void): this;
9503     /**
9504      * Emitted when a drag operation ends on the tray or ends at another location.
9505      *
9506      * @platform darwin
9507      */
9508     on(event: 'drag-end', listener: Function): this;
9509     once(event: 'drag-end', listener: Function): this;
9510     addListener(event: 'drag-end', listener: Function): this;
9511     removeListener(event: 'drag-end', listener: Function): this;
9512     /**
9513      * Emitted when a drag operation enters the tray icon.
9514      *
9515      * @platform darwin
9516      */
9517     on(event: 'drag-enter', listener: Function): this;
9518     once(event: 'drag-enter', listener: Function): this;
9519     addListener(event: 'drag-enter', listener: Function): this;
9520     removeListener(event: 'drag-enter', listener: Function): this;
9521     /**
9522      * Emitted when a drag operation exits the tray icon.
9523      *
9524      * @platform darwin
9525      */
9526     on(event: 'drag-leave', listener: Function): this;
9527     once(event: 'drag-leave', listener: Function): this;
9528     addListener(event: 'drag-leave', listener: Function): this;
9529     removeListener(event: 'drag-leave', listener: Function): this;
9530     /**
9531      * Emitted when any dragged items are dropped on the tray icon.
9532      *
9533      * @platform darwin
9534      */
9535     on(event: 'drop', listener: Function): this;
9536     once(event: 'drop', listener: Function): this;
9537     addListener(event: 'drop', listener: Function): this;
9538     removeListener(event: 'drop', listener: Function): this;
9539     /**
9540      * Emitted when dragged files are dropped in the tray icon.
9541      *
9542      * @platform darwin
9543      */
9544     on(event: 'drop-files', listener: (event: Event,
9545                                        /**
9546                                         * The paths of the dropped files.
9547                                         */
9548                                        files: string[]) => void): this;
9549     once(event: 'drop-files', listener: (event: Event,
9550                                        /**
9551                                         * The paths of the dropped files.
9552                                         */
9553                                        files: string[]) => void): this;
9554     addListener(event: 'drop-files', listener: (event: Event,
9555                                        /**
9556                                         * The paths of the dropped files.
9557                                         */
9558                                        files: string[]) => void): this;
9559     removeListener(event: 'drop-files', listener: (event: Event,
9560                                        /**
9561                                         * The paths of the dropped files.
9562                                         */
9563                                        files: string[]) => void): this;
9564     /**
9565      * Emitted when dragged text is dropped in the tray icon.
9566      *
9567      * @platform darwin
9568      */
9569     on(event: 'drop-text', listener: (event: Event,
9570                                       /**
9571                                        * the dropped text string.
9572                                        */
9573                                       text: string) => void): this;
9574     once(event: 'drop-text', listener: (event: Event,
9575                                       /**
9576                                        * the dropped text string.
9577                                        */
9578                                       text: string) => void): this;
9579     addListener(event: 'drop-text', listener: (event: Event,
9580                                       /**
9581                                        * the dropped text string.
9582                                        */
9583                                       text: string) => void): this;
9584     removeListener(event: 'drop-text', listener: (event: Event,
9585                                       /**
9586                                        * the dropped text string.
9587                                        */
9588                                       text: string) => void): this;
9589     /**
9590      * Emitted when the mouse clicks the tray icon.
9591      *
9592      * @platform darwin
9593      */
9594     on(event: 'mouse-down', listener: (event: KeyboardEvent,
9595                                        /**
9596                                         * The position of the event.
9597                                         */
9598                                        position: Point) => void): this;
9599     once(event: 'mouse-down', listener: (event: KeyboardEvent,
9600                                        /**
9601                                         * The position of the event.
9602                                         */
9603                                        position: Point) => void): this;
9604     addListener(event: 'mouse-down', listener: (event: KeyboardEvent,
9605                                        /**
9606                                         * The position of the event.
9607                                         */
9608                                        position: Point) => void): this;
9609     removeListener(event: 'mouse-down', listener: (event: KeyboardEvent,
9610                                        /**
9611                                         * The position of the event.
9612                                         */
9613                                        position: Point) => void): this;
9614     /**
9615      * Emitted when the mouse enters the tray icon.
9616      *
9617      * @platform darwin
9618      */
9619     on(event: 'mouse-enter', listener: (event: KeyboardEvent,
9620                                         /**
9621                                          * The position of the event.
9622                                          */
9623                                         position: Point) => void): this;
9624     once(event: 'mouse-enter', listener: (event: KeyboardEvent,
9625                                         /**
9626                                          * The position of the event.
9627                                          */
9628                                         position: Point) => void): this;
9629     addListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
9630                                         /**
9631                                          * The position of the event.
9632                                          */
9633                                         position: Point) => void): this;
9634     removeListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
9635                                         /**
9636                                          * The position of the event.
9637                                          */
9638                                         position: Point) => void): this;
9639     /**
9640      * Emitted when the mouse exits the tray icon.
9641      *
9642      * @platform darwin
9643      */
9644     on(event: 'mouse-leave', listener: (event: KeyboardEvent,
9645                                         /**
9646                                          * The position of the event.
9647                                          */
9648                                         position: Point) => void): this;
9649     once(event: 'mouse-leave', listener: (event: KeyboardEvent,
9650                                         /**
9651                                          * The position of the event.
9652                                          */
9653                                         position: Point) => void): this;
9654     addListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
9655                                         /**
9656                                          * The position of the event.
9657                                          */
9658                                         position: Point) => void): this;
9659     removeListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
9660                                         /**
9661                                          * The position of the event.
9662                                          */
9663                                         position: Point) => void): this;
9664     /**
9665      * Emitted when the mouse moves in the tray icon.
9666      *
9667      * @platform darwin,win32
9668      */
9669     on(event: 'mouse-move', listener: (event: KeyboardEvent,
9670                                        /**
9671                                         * The position of the event.
9672                                         */
9673                                        position: Point) => void): this;
9674     once(event: 'mouse-move', listener: (event: KeyboardEvent,
9675                                        /**
9676                                         * The position of the event.
9677                                         */
9678                                        position: Point) => void): this;
9679     addListener(event: 'mouse-move', listener: (event: KeyboardEvent,
9680                                        /**
9681                                         * The position of the event.
9682                                         */
9683                                        position: Point) => void): this;
9684     removeListener(event: 'mouse-move', listener: (event: KeyboardEvent,
9685                                        /**
9686                                         * The position of the event.
9687                                         */
9688                                        position: Point) => void): this;
9689     /**
9690      * Emitted when the mouse is released from clicking the tray icon.
9691      *
9692      * Note: This will not be emitted if you have set a context menu for your Tray
9693      * using `tray.setContextMenu`, as a result of macOS-level constraints.
9694      *
9695      * @platform darwin
9696      */
9697     on(event: 'mouse-up', listener: (event: KeyboardEvent,
9698                                      /**
9699                                       * The position of the event.
9700                                       */
9701                                      position: Point) => void): this;
9702     once(event: 'mouse-up', listener: (event: KeyboardEvent,
9703                                      /**
9704                                       * The position of the event.
9705                                       */
9706                                      position: Point) => void): this;
9707     addListener(event: 'mouse-up', listener: (event: KeyboardEvent,
9708                                      /**
9709                                       * The position of the event.
9710                                       */
9711                                      position: Point) => void): this;
9712     removeListener(event: 'mouse-up', listener: (event: KeyboardEvent,
9713                                      /**
9714                                       * The position of the event.
9715                                       */
9716                                      position: Point) => void): this;
9717     /**
9718      * Emitted when the tray icon is right clicked.
9719      *
9720      * @platform darwin,win32
9721      */
9722     on(event: 'right-click', listener: (event: KeyboardEvent,
9723                                         /**
9724                                          * The bounds of tray icon.
9725                                          */
9726                                         bounds: Rectangle) => void): this;
9727     once(event: 'right-click', listener: (event: KeyboardEvent,
9728                                         /**
9729                                          * The bounds of tray icon.
9730                                          */
9731                                         bounds: Rectangle) => void): this;
9732     addListener(event: 'right-click', listener: (event: KeyboardEvent,
9733                                         /**
9734                                          * The bounds of tray icon.
9735                                          */
9736                                         bounds: Rectangle) => void): this;
9737     removeListener(event: 'right-click', listener: (event: KeyboardEvent,
9738                                         /**
9739                                          * The bounds of tray icon.
9740                                          */
9741                                         bounds: Rectangle) => void): this;
9742     /**
9743      * Tray
9744      */
9745     constructor(image: (NativeImage) | (string), guid?: string);
9746     /**
9747      * Closes an open context menu, as set by `tray.setContextMenu()`.
9748      *
9749      * @platform darwin,win32
9750      */
9751     closeContextMenu(): void;
9752     /**
9753      * Destroys the tray icon immediately.
9754      */
9755     destroy(): void;
9756     /**
9757      * Displays a tray balloon.
9758      *
9759      * @platform win32
9760      */
9761     displayBalloon(options: DisplayBalloonOptions): void;
9762     /**
9763      * Returns focus to the taskbar notification area. Notification area icons should
9764      * use this message when they have completed their UI operation. For example, if
9765      * the icon displays a shortcut menu, but the user presses ESC to cancel it, use
9766      * `tray.focus()` to return focus to the notification area.
9767      *
9768      * @platform win32
9769      */
9770     focus(): void;
9771     /**
9772      * The `bounds` of this tray icon as `Object`.
9773      *
9774      * @platform darwin,win32
9775      */
9776     getBounds(): Rectangle;
9777     /**
9778      * Whether double click events will be ignored.
9779      *
9780      * @platform darwin
9781      */
9782     getIgnoreDoubleClickEvents(): boolean;
9783     /**
9784      * the title displayed next to the tray icon in the status bar
9785      *
9786      * @platform darwin
9787      */
9788     getTitle(): string;
9789     /**
9790      * Whether the tray icon is destroyed.
9791      */
9792     isDestroyed(): boolean;
9793     /**
9794      * Pops up the context menu of the tray icon. When `menu` is passed, the `menu`
9795      * will be shown instead of the tray icon's context menu.
9796      *
9797      * The `position` is only available on Windows, and it is (0, 0) by default.
9798      *
9799      * @platform darwin,win32
9800      */
9801     popUpContextMenu(menu?: Menu, position?: Point): void;
9802     /**
9803      * Removes a tray balloon.
9804      *
9805      * @platform win32
9806      */
9807     removeBalloon(): void;
9808     /**
9809      * Sets the context menu for this icon.
9810      */
9811     setContextMenu(menu: (Menu) | (null)): void;
9812     /**
9813      * Sets the option to ignore double click events. Ignoring these events allows you
9814      * to detect every individual click of the tray icon.
9815      *
9816      * This value is set to false by default.
9817      *
9818      * @platform darwin
9819      */
9820     setIgnoreDoubleClickEvents(ignore: boolean): void;
9821     /**
9822      * Sets the `image` associated with this tray icon.
9823      */
9824     setImage(image: (NativeImage) | (string)): void;
9825     /**
9826      * Sets the `image` associated with this tray icon when pressed on macOS.
9827      *
9828      * @platform darwin
9829      */
9830     setPressedImage(image: (NativeImage) | (string)): void;
9831     /**
9832      * Sets the title displayed next to the tray icon in the status bar (Support ANSI
9833      * colors).
9834      *
9835      * @platform darwin
9836      */
9837     setTitle(title: string, options?: TitleOptions): void;
9838     /**
9839      * Sets the hover text for this tray icon.
9840      */
9841     setToolTip(toolTip: string): void;
9842   }
9843
9844   interface UploadData {
9845
9846     // Docs: https://electronjs.org/docs/api/structures/upload-data
9847
9848     /**
9849      * UUID of blob data. Use ses.getBlobData method to retrieve the data.
9850      */
9851     blobUUID?: string;
9852     /**
9853      * Content being sent.
9854      */
9855     bytes: Buffer;
9856     /**
9857      * Path of file being uploaded.
9858      */
9859     file?: string;
9860   }
9861
9862   interface UploadFile {
9863
9864     // Docs: https://electronjs.org/docs/api/structures/upload-file
9865
9866     /**
9867      * Path of file to be uploaded.
9868      */
9869     filePath: string;
9870     /**
9871      * Number of bytes to read from `offset`. Defaults to `0`.
9872      */
9873     length: number;
9874     /**
9875      * Last Modification time in number of seconds since the UNIX epoch.
9876      */
9877     modificationTime: number;
9878     /**
9879      * Defaults to `0`.
9880      */
9881     offset: number;
9882     /**
9883      * `file`.
9884      */
9885     type: 'file';
9886   }
9887
9888   interface UploadRawData {
9889
9890     // Docs: https://electronjs.org/docs/api/structures/upload-raw-data
9891
9892     /**
9893      * Data to be uploaded.
9894      */
9895     bytes: Buffer;
9896     /**
9897      * `rawData`.
9898      */
9899     type: 'rawData';
9900   }
9901
9902   interface UserDefaultTypes {
9903
9904     // Docs: https://electronjs.org/docs/api/structures/user-default-types
9905
9906     array: Array<unknown>;
9907     boolean: boolean;
9908     dictionary: Record<string, unknown>;
9909     double: number;
9910     float: number;
9911     integer: number;
9912     string: string;
9913     url: string;
9914   }
9915
9916   class UtilityProcess extends NodeEventEmitter {
9917
9918     // Docs: https://electronjs.org/docs/api/utility-process
9919
9920     static fork(modulePath: string, args?: string[], options?: ForkOptions): UtilityProcess;
9921     /**
9922      * Emitted after the child process ends.
9923      */
9924     on(event: 'exit', listener: (
9925                                  /**
9926                                   * Contains the exit code for the process obtained from waitpid on posix, or
9927                                   * GetExitCodeProcess on windows.
9928                                   */
9929                                  code: number) => void): this;
9930     once(event: 'exit', listener: (
9931                                  /**
9932                                   * Contains the exit code for the process obtained from waitpid on posix, or
9933                                   * GetExitCodeProcess on windows.
9934                                   */
9935                                  code: number) => void): this;
9936     addListener(event: 'exit', listener: (
9937                                  /**
9938                                   * Contains the exit code for the process obtained from waitpid on posix, or
9939                                   * GetExitCodeProcess on windows.
9940                                   */
9941                                  code: number) => void): this;
9942     removeListener(event: 'exit', listener: (
9943                                  /**
9944                                   * Contains the exit code for the process obtained from waitpid on posix, or
9945                                   * GetExitCodeProcess on windows.
9946                                   */
9947                                  code: number) => void): this;
9948     /**
9949      * Emitted when the child process sends a message using
9950      * `process.parentPort.postMessage()`.
9951      */
9952     on(event: 'message', listener: (message: any) => void): this;
9953     once(event: 'message', listener: (message: any) => void): this;
9954     addListener(event: 'message', listener: (message: any) => void): this;
9955     removeListener(event: 'message', listener: (message: any) => void): this;
9956     /**
9957      * Emitted once the child process has spawned successfully.
9958      */
9959     on(event: 'spawn', listener: Function): this;
9960     once(event: 'spawn', listener: Function): this;
9961     addListener(event: 'spawn', listener: Function): this;
9962     removeListener(event: 'spawn', listener: Function): this;
9963     /**
9964      * Terminates the process gracefully. On POSIX, it uses SIGTERM but will ensure the
9965      * process is reaped on exit. This function returns true if the kill is successful,
9966      * and false otherwise.
9967      */
9968     kill(): boolean;
9969     /**
9970      * Send a message to the child process, optionally transferring ownership of zero
9971      * or more `MessagePortMain` objects.
9972      *
9973      * For example:
9974      */
9975     postMessage(message: any, transfer?: MessagePortMain[]): void;
9976     /**
9977      * A `Integer | undefined` representing the process identifier (PID) of the child
9978      * process. If the child process fails to spawn due to errors, then the value is
9979      * `undefined`. When the child process exits, then the value is `undefined` after
9980      * the `exit` event is emitted.
9981      */
9982     pid: (number) | (undefined);
9983     /**
9984      * A `NodeJS.ReadableStream | null` that represents the child process's stderr. If
9985      * the child was spawned with options.stdio[2] set to anything other than 'pipe',
9986      * then this will be `null`. When the child process exits, then the value is `null`
9987      * after the `exit` event is emitted.
9988      */
9989     stderr: (NodeJS.ReadableStream) | (null);
9990     /**
9991      * A `NodeJS.ReadableStream | null` that represents the child process's stdout. If
9992      * the child was spawned with options.stdio[1] set to anything other than 'pipe',
9993      * then this will be `null`. When the child process exits, then the value is `null`
9994      * after the `exit` event is emitted.
9995      */
9996     stdout: (NodeJS.ReadableStream) | (null);
9997   }
9998
9999   class WebContents extends NodeEventEmitter {
10000
10001     // Docs: https://electronjs.org/docs/api/web-contents
10002
10003     /**
10004      * | undefined - A WebContents instance with the given TargetID, or `undefined` if
10005      * there is no WebContents associated with the given TargetID.
10006      *
10007      * When communicating with the Chrome DevTools Protocol, it can be useful to lookup
10008      * a WebContents instance based on its assigned TargetID.
10009      */
10010     static fromDevToolsTargetId(targetId: string): WebContents;
10011     /**
10012      * | undefined - A WebContents instance with the given WebFrameMain, or `undefined`
10013      * if there is no WebContents associated with the given WebFrameMain.
10014      */
10015     static fromFrame(frame: WebFrameMain): WebContents;
10016     /**
10017      * | undefined - A WebContents instance with the given ID, or `undefined` if there
10018      * is no WebContents associated with the given ID.
10019      */
10020     static fromId(id: number): WebContents;
10021     /**
10022      * An array of all `WebContents` instances. This will contain web contents for all
10023      * windows, webviews, opened devtools, and devtools extension background pages.
10024      */
10025     static getAllWebContents(): WebContents[];
10026     /**
10027      * | null - The web contents that is focused in this application, otherwise returns
10028      * `null`.
10029      */
10030     static getFocusedWebContents(): WebContents;
10031     /**
10032      * Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
10033      * `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
10034      * menu shortcuts.
10035      *
10036      * To only prevent the menu shortcuts, use `setIgnoreMenuShortcuts`:
10037      */
10038     on(event: 'before-input-event', listener: (event: Event,
10039                                                /**
10040                                                 * Input properties.
10041                                                 */
10042                                                input: Input) => void): this;
10043     once(event: 'before-input-event', listener: (event: Event,
10044                                                /**
10045                                                 * Input properties.
10046                                                 */
10047                                                input: Input) => void): this;
10048     addListener(event: 'before-input-event', listener: (event: Event,
10049                                                /**
10050                                                 * Input properties.
10051                                                 */
10052                                                input: Input) => void): this;
10053     removeListener(event: 'before-input-event', listener: (event: Event,
10054                                                /**
10055                                                 * Input properties.
10056                                                 */
10057                                                input: Input) => void): this;
10058     /**
10059      * Emitted when the `WebContents` loses focus.
10060      */
10061     on(event: 'blur', listener: Function): this;
10062     once(event: 'blur', listener: Function): this;
10063     addListener(event: 'blur', listener: Function): this;
10064     removeListener(event: 'blur', listener: Function): this;
10065     /**
10066      * Emitted when failed to verify the `certificate` for `url`.
10067      *
10068      * The usage is the same with the `certificate-error` event of `app`.
10069      */
10070     on(event: 'certificate-error', listener: (event: Event,
10071                                               url: string,
10072                                               /**
10073                                                * The error code.
10074                                                */
10075                                               error: string,
10076                                               certificate: Certificate,
10077                                               callback: (isTrusted: boolean) => void,
10078                                               isMainFrame: boolean) => void): this;
10079     once(event: 'certificate-error', listener: (event: Event,
10080                                               url: string,
10081                                               /**
10082                                                * The error code.
10083                                                */
10084                                               error: string,
10085                                               certificate: Certificate,
10086                                               callback: (isTrusted: boolean) => void,
10087                                               isMainFrame: boolean) => void): this;
10088     addListener(event: 'certificate-error', listener: (event: Event,
10089                                               url: string,
10090                                               /**
10091                                                * The error code.
10092                                                */
10093                                               error: string,
10094                                               certificate: Certificate,
10095                                               callback: (isTrusted: boolean) => void,
10096                                               isMainFrame: boolean) => void): this;
10097     removeListener(event: 'certificate-error', listener: (event: Event,
10098                                               url: string,
10099                                               /**
10100                                                * The error code.
10101                                                */
10102                                               error: string,
10103                                               certificate: Certificate,
10104                                               callback: (isTrusted: boolean) => void,
10105                                               isMainFrame: boolean) => void): this;
10106     /**
10107      * Emitted when the associated window logs a console message.
10108      */
10109     on(event: 'console-message', listener: (event: Event,
10110                                             /**
10111                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
10112                                              * `error`.
10113                                              */
10114                                             level: number,
10115                                             /**
10116                                              * The actual console message
10117                                              */
10118                                             message: string,
10119                                             /**
10120                                              * The line number of the source that triggered this console message
10121                                              */
10122                                             line: number,
10123                                             sourceId: string) => void): this;
10124     once(event: 'console-message', listener: (event: Event,
10125                                             /**
10126                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
10127                                              * `error`.
10128                                              */
10129                                             level: number,
10130                                             /**
10131                                              * The actual console message
10132                                              */
10133                                             message: string,
10134                                             /**
10135                                              * The line number of the source that triggered this console message
10136                                              */
10137                                             line: number,
10138                                             sourceId: string) => void): this;
10139     addListener(event: 'console-message', listener: (event: Event,
10140                                             /**
10141                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
10142                                              * `error`.
10143                                              */
10144                                             level: number,
10145                                             /**
10146                                              * The actual console message
10147                                              */
10148                                             message: string,
10149                                             /**
10150                                              * The line number of the source that triggered this console message
10151                                              */
10152                                             line: number,
10153                                             sourceId: string) => void): this;
10154     removeListener(event: 'console-message', listener: (event: Event,
10155                                             /**
10156                                              * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
10157                                              * `error`.
10158                                              */
10159                                             level: number,
10160                                             /**
10161                                              * The actual console message
10162                                              */
10163                                             message: string,
10164                                             /**
10165                                              * The line number of the source that triggered this console message
10166                                              */
10167                                             line: number,
10168                                             sourceId: string) => void): this;
10169     /**
10170      * Emitted when the page calls `window.moveTo`, `window.resizeTo` or related APIs.
10171      *
10172      * By default, this will move the window. To prevent that behavior, call
10173      * `event.preventDefault()`.
10174      */
10175     on(event: 'content-bounds-updated', listener: (event: Event,
10176                                                    /**
10177                                                     * requested new content bounds
10178                                                     */
10179                                                    bounds: Rectangle) => void): this;
10180     once(event: 'content-bounds-updated', listener: (event: Event,
10181                                                    /**
10182                                                     * requested new content bounds
10183                                                     */
10184                                                    bounds: Rectangle) => void): this;
10185     addListener(event: 'content-bounds-updated', listener: (event: Event,
10186                                                    /**
10187                                                     * requested new content bounds
10188                                                     */
10189                                                    bounds: Rectangle) => void): this;
10190     removeListener(event: 'content-bounds-updated', listener: (event: Event,
10191                                                    /**
10192                                                     * requested new content bounds
10193                                                     */
10194                                                    bounds: Rectangle) => void): this;
10195     /**
10196      * Emitted when there is a new context menu that needs to be handled.
10197      */
10198     on(event: 'context-menu', listener: (event: Event,
10199                                          params: ContextMenuParams) => void): this;
10200     once(event: 'context-menu', listener: (event: Event,
10201                                          params: ContextMenuParams) => void): this;
10202     addListener(event: 'context-menu', listener: (event: Event,
10203                                          params: ContextMenuParams) => void): this;
10204     removeListener(event: 'context-menu', listener: (event: Event,
10205                                          params: ContextMenuParams) => void): this;
10206     /**
10207      * Emitted when the renderer process crashes or is killed.
10208      *
10209      * **Deprecated:** This event is superceded by the `render-process-gone` event
10210      * which contains more information about why the render process disappeared. It
10211      * isn't always because it crashed.  The `killed` boolean can be replaced by
10212      * checking `reason === 'killed'` when you switch to that event.
10213      *
10214      * @deprecated
10215      */
10216     on(event: 'crashed', listener: (event: Event,
10217                                     killed: boolean) => void): this;
10218     once(event: 'crashed', listener: (event: Event,
10219                                     killed: boolean) => void): this;
10220     addListener(event: 'crashed', listener: (event: Event,
10221                                     killed: boolean) => void): this;
10222     removeListener(event: 'crashed', listener: (event: Event,
10223                                     killed: boolean) => void): this;
10224     /**
10225      * Emitted when the cursor's type changes. The `type` parameter can be `default`,
10226      * `crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
10227      * `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`,
10228      * `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`,
10229      * `row-resize`, `m-panning`, `e-panning`, `n-panning`, `ne-panning`, `nw-panning`,
10230      * `s-panning`, `se-panning`, `sw-panning`, `w-panning`, `move`, `vertical-text`,
10231      * `cell`, `context-menu`, `alias`, `progress`, `nodrop`, `copy`, `none`,
10232      * `not-allowed`, `zoom-in`, `zoom-out`, `grab`, `grabbing` or `custom`.
10233      *
10234      * If the `type` parameter is `custom`, the `image` parameter will hold the custom
10235      * cursor image in a `NativeImage`, and `scale`, `size` and `hotspot` will hold
10236      * additional information about the custom cursor.
10237      */
10238     on(event: 'cursor-changed', listener: (event: Event,
10239                                            type: string,
10240                                            image: NativeImage,
10241                                            /**
10242                                             * scaling factor for the custom cursor.
10243                                             */
10244                                            scale: number,
10245                                            /**
10246                                             * the size of the `image`.
10247                                             */
10248                                            size: Size,
10249                                            /**
10250                                             * coordinates of the custom cursor's hotspot.
10251                                             */
10252                                            hotspot: Point) => void): this;
10253     once(event: 'cursor-changed', listener: (event: Event,
10254                                            type: string,
10255                                            image: NativeImage,
10256                                            /**
10257                                             * scaling factor for the custom cursor.
10258                                             */
10259                                            scale: number,
10260                                            /**
10261                                             * the size of the `image`.
10262                                             */
10263                                            size: Size,
10264                                            /**
10265                                             * coordinates of the custom cursor's hotspot.
10266                                             */
10267                                            hotspot: Point) => void): this;
10268     addListener(event: 'cursor-changed', listener: (event: Event,
10269                                            type: string,
10270                                            image: NativeImage,
10271                                            /**
10272                                             * scaling factor for the custom cursor.
10273                                             */
10274                                            scale: number,
10275                                            /**
10276                                             * the size of the `image`.
10277                                             */
10278                                            size: Size,
10279                                            /**
10280                                             * coordinates of the custom cursor's hotspot.
10281                                             */
10282                                            hotspot: Point) => void): this;
10283     removeListener(event: 'cursor-changed', listener: (event: Event,
10284                                            type: string,
10285                                            image: NativeImage,
10286                                            /**
10287                                             * scaling factor for the custom cursor.
10288                                             */
10289                                            scale: number,
10290                                            /**
10291                                             * the size of the `image`.
10292                                             */
10293                                            size: Size,
10294                                            /**
10295                                             * coordinates of the custom cursor's hotspot.
10296                                             */
10297                                            hotspot: Point) => void): this;
10298     /**
10299      * Emitted when `webContents` is destroyed.
10300      */
10301     on(event: 'destroyed', listener: Function): this;
10302     once(event: 'destroyed', listener: Function): this;
10303     addListener(event: 'destroyed', listener: Function): this;
10304     removeListener(event: 'destroyed', listener: Function): this;
10305     /**
10306      * Emitted when DevTools is closed.
10307      */
10308     on(event: 'devtools-closed', listener: Function): this;
10309     once(event: 'devtools-closed', listener: Function): this;
10310     addListener(event: 'devtools-closed', listener: Function): this;
10311     removeListener(event: 'devtools-closed', listener: Function): this;
10312     /**
10313      * Emitted when DevTools is focused / opened.
10314      */
10315     on(event: 'devtools-focused', listener: Function): this;
10316     once(event: 'devtools-focused', listener: Function): this;
10317     addListener(event: 'devtools-focused', listener: Function): this;
10318     removeListener(event: 'devtools-focused', listener: Function): this;
10319     /**
10320      * Emitted when DevTools is opened.
10321      */
10322     on(event: 'devtools-opened', listener: Function): this;
10323     once(event: 'devtools-opened', listener: Function): this;
10324     addListener(event: 'devtools-opened', listener: Function): this;
10325     removeListener(event: 'devtools-opened', listener: Function): this;
10326     /**
10327      * Emitted when the devtools window instructs the webContents to reload
10328      */
10329     on(event: 'devtools-reload-page', listener: Function): this;
10330     once(event: 'devtools-reload-page', listener: Function): this;
10331     addListener(event: 'devtools-reload-page', listener: Function): this;
10332     removeListener(event: 'devtools-reload-page', listener: Function): this;
10333     /**
10334      * Emitted when a `<webview>` has been attached to this web contents.
10335      */
10336     on(event: 'did-attach-webview', listener: (event: Event,
10337                                                /**
10338                                                 * The guest web contents that is used by the `<webview>`.
10339                                                 */
10340                                                webContents: WebContents) => void): this;
10341     once(event: 'did-attach-webview', listener: (event: Event,
10342                                                /**
10343                                                 * The guest web contents that is used by the `<webview>`.
10344                                                 */
10345                                                webContents: WebContents) => void): this;
10346     addListener(event: 'did-attach-webview', listener: (event: Event,
10347                                                /**
10348                                                 * The guest web contents that is used by the `<webview>`.
10349                                                 */
10350                                                webContents: WebContents) => void): this;
10351     removeListener(event: 'did-attach-webview', listener: (event: Event,
10352                                                /**
10353                                                 * The guest web contents that is used by the `<webview>`.
10354                                                 */
10355                                                webContents: WebContents) => void): this;
10356     /**
10357      * Emitted when a page's theme color changes. This is usually due to encountering a
10358      * meta tag:
10359      */
10360     on(event: 'did-change-theme-color', listener: (event: Event,
10361                                                    /**
10362                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
10363                                                     */
10364                                                    color: (string) | (null)) => void): this;
10365     once(event: 'did-change-theme-color', listener: (event: Event,
10366                                                    /**
10367                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
10368                                                     */
10369                                                    color: (string) | (null)) => void): this;
10370     addListener(event: 'did-change-theme-color', listener: (event: Event,
10371                                                    /**
10372                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
10373                                                     */
10374                                                    color: (string) | (null)) => void): this;
10375     removeListener(event: 'did-change-theme-color', listener: (event: Event,
10376                                                    /**
10377                                                     * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
10378                                                     */
10379                                                    color: (string) | (null)) => void): this;
10380     /**
10381      * Emitted _after_ successful creation of a window via `window.open` in the
10382      * renderer. Not emitted if the creation of the window is canceled from
10383      * `webContents.setWindowOpenHandler`.
10384      *
10385      * See `window.open()` for more details and how to use this in conjunction with
10386      * `webContents.setWindowOpenHandler`.
10387      */
10388     on(event: 'did-create-window', listener: (window: BrowserWindow,
10389                                               details: DidCreateWindowDetails) => void): this;
10390     once(event: 'did-create-window', listener: (window: BrowserWindow,
10391                                               details: DidCreateWindowDetails) => void): this;
10392     addListener(event: 'did-create-window', listener: (window: BrowserWindow,
10393                                               details: DidCreateWindowDetails) => void): this;
10394     removeListener(event: 'did-create-window', listener: (window: BrowserWindow,
10395                                               details: DidCreateWindowDetails) => void): this;
10396     /**
10397      * This event is like `did-finish-load` but emitted when the load failed. The full
10398      * list of error codes and their meaning is available here.
10399      */
10400     on(event: 'did-fail-load', listener: (event: Event,
10401                                           errorCode: number,
10402                                           errorDescription: string,
10403                                           validatedURL: string,
10404                                           isMainFrame: boolean,
10405                                           frameProcessId: number,
10406                                           frameRoutingId: number) => void): this;
10407     once(event: 'did-fail-load', listener: (event: Event,
10408                                           errorCode: number,
10409                                           errorDescription: string,
10410                                           validatedURL: string,
10411                                           isMainFrame: boolean,
10412                                           frameProcessId: number,
10413                                           frameRoutingId: number) => void): this;
10414     addListener(event: 'did-fail-load', listener: (event: Event,
10415                                           errorCode: number,
10416                                           errorDescription: string,
10417                                           validatedURL: string,
10418                                           isMainFrame: boolean,
10419                                           frameProcessId: number,
10420                                           frameRoutingId: number) => void): this;
10421     removeListener(event: 'did-fail-load', listener: (event: Event,
10422                                           errorCode: number,
10423                                           errorDescription: string,
10424                                           validatedURL: string,
10425                                           isMainFrame: boolean,
10426                                           frameProcessId: number,
10427                                           frameRoutingId: number) => void): this;
10428     /**
10429      * This event is like `did-fail-load` but emitted when the load was cancelled (e.g.
10430      * `window.stop()` was invoked).
10431      */
10432     on(event: 'did-fail-provisional-load', listener: (event: Event,
10433                                                       errorCode: number,
10434                                                       errorDescription: string,
10435                                                       validatedURL: string,
10436                                                       isMainFrame: boolean,
10437                                                       frameProcessId: number,
10438                                                       frameRoutingId: number) => void): this;
10439     once(event: 'did-fail-provisional-load', listener: (event: Event,
10440                                                       errorCode: number,
10441                                                       errorDescription: string,
10442                                                       validatedURL: string,
10443                                                       isMainFrame: boolean,
10444                                                       frameProcessId: number,
10445                                                       frameRoutingId: number) => void): this;
10446     addListener(event: 'did-fail-provisional-load', listener: (event: Event,
10447                                                       errorCode: number,
10448                                                       errorDescription: string,
10449                                                       validatedURL: string,
10450                                                       isMainFrame: boolean,
10451                                                       frameProcessId: number,
10452                                                       frameRoutingId: number) => void): this;
10453     removeListener(event: 'did-fail-provisional-load', listener: (event: Event,
10454                                                       errorCode: number,
10455                                                       errorDescription: string,
10456                                                       validatedURL: string,
10457                                                       isMainFrame: boolean,
10458                                                       frameProcessId: number,
10459                                                       frameRoutingId: number) => void): this;
10460     /**
10461      * Emitted when the navigation is done, i.e. the spinner of the tab has stopped
10462      * spinning, and the `onload` event was dispatched.
10463      */
10464     on(event: 'did-finish-load', listener: Function): this;
10465     once(event: 'did-finish-load', listener: Function): this;
10466     addListener(event: 'did-finish-load', listener: Function): this;
10467     removeListener(event: 'did-finish-load', listener: Function): this;
10468     /**
10469      * Emitted when a frame has done navigation.
10470      */
10471     on(event: 'did-frame-finish-load', listener: (event: Event,
10472                                                   isMainFrame: boolean,
10473                                                   frameProcessId: number,
10474                                                   frameRoutingId: number) => void): this;
10475     once(event: 'did-frame-finish-load', listener: (event: Event,
10476                                                   isMainFrame: boolean,
10477                                                   frameProcessId: number,
10478                                                   frameRoutingId: number) => void): this;
10479     addListener(event: 'did-frame-finish-load', listener: (event: Event,
10480                                                   isMainFrame: boolean,
10481                                                   frameProcessId: number,
10482                                                   frameRoutingId: number) => void): this;
10483     removeListener(event: 'did-frame-finish-load', listener: (event: Event,
10484                                                   isMainFrame: boolean,
10485                                                   frameProcessId: number,
10486                                                   frameRoutingId: number) => void): this;
10487     /**
10488      * Emitted when any frame navigation is done.
10489      *
10490      * This event is not emitted for in-page navigations, such as clicking anchor links
10491      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
10492      * this purpose.
10493      */
10494     on(event: 'did-frame-navigate', listener: (event: Event,
10495                                                url: string,
10496                                                /**
10497                                                 * -1 for non HTTP navigations
10498                                                 */
10499                                                httpResponseCode: number,
10500                                                /**
10501                                                 * empty for non HTTP navigations,
10502                                                 */
10503                                                httpStatusText: string,
10504                                                isMainFrame: boolean,
10505                                                frameProcessId: number,
10506                                                frameRoutingId: number) => void): this;
10507     once(event: 'did-frame-navigate', listener: (event: Event,
10508                                                url: string,
10509                                                /**
10510                                                 * -1 for non HTTP navigations
10511                                                 */
10512                                                httpResponseCode: number,
10513                                                /**
10514                                                 * empty for non HTTP navigations,
10515                                                 */
10516                                                httpStatusText: string,
10517                                                isMainFrame: boolean,
10518                                                frameProcessId: number,
10519                                                frameRoutingId: number) => void): this;
10520     addListener(event: 'did-frame-navigate', listener: (event: Event,
10521                                                url: string,
10522                                                /**
10523                                                 * -1 for non HTTP navigations
10524                                                 */
10525                                                httpResponseCode: number,
10526                                                /**
10527                                                 * empty for non HTTP navigations,
10528                                                 */
10529                                                httpStatusText: string,
10530                                                isMainFrame: boolean,
10531                                                frameProcessId: number,
10532                                                frameRoutingId: number) => void): this;
10533     removeListener(event: 'did-frame-navigate', listener: (event: Event,
10534                                                url: string,
10535                                                /**
10536                                                 * -1 for non HTTP navigations
10537                                                 */
10538                                                httpResponseCode: number,
10539                                                /**
10540                                                 * empty for non HTTP navigations,
10541                                                 */
10542                                                httpStatusText: string,
10543                                                isMainFrame: boolean,
10544                                                frameProcessId: number,
10545                                                frameRoutingId: number) => void): this;
10546     /**
10547      * Emitted when a main frame navigation is done.
10548      *
10549      * This event is not emitted for in-page navigations, such as clicking anchor links
10550      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
10551      * this purpose.
10552      */
10553     on(event: 'did-navigate', listener: (event: Event,
10554                                          url: string,
10555                                          /**
10556                                           * -1 for non HTTP navigations
10557                                           */
10558                                          httpResponseCode: number,
10559                                          /**
10560                                           * empty for non HTTP navigations
10561                                           */
10562                                          httpStatusText: string) => void): this;
10563     once(event: 'did-navigate', listener: (event: Event,
10564                                          url: string,
10565                                          /**
10566                                           * -1 for non HTTP navigations
10567                                           */
10568                                          httpResponseCode: number,
10569                                          /**
10570                                           * empty for non HTTP navigations
10571                                           */
10572                                          httpStatusText: string) => void): this;
10573     addListener(event: 'did-navigate', listener: (event: Event,
10574                                          url: string,
10575                                          /**
10576                                           * -1 for non HTTP navigations
10577                                           */
10578                                          httpResponseCode: number,
10579                                          /**
10580                                           * empty for non HTTP navigations
10581                                           */
10582                                          httpStatusText: string) => void): this;
10583     removeListener(event: 'did-navigate', listener: (event: Event,
10584                                          url: string,
10585                                          /**
10586                                           * -1 for non HTTP navigations
10587                                           */
10588                                          httpResponseCode: number,
10589                                          /**
10590                                           * empty for non HTTP navigations
10591                                           */
10592                                          httpStatusText: string) => void): this;
10593     /**
10594      * Emitted when an in-page navigation happened in any frame.
10595      *
10596      * When in-page navigation happens, the page URL changes but does not cause
10597      * navigation outside of the page. Examples of this occurring are when anchor links
10598      * are clicked or when the DOM `hashchange` event is triggered.
10599      */
10600     on(event: 'did-navigate-in-page', listener: (event: Event,
10601                                                  url: string,
10602                                                  isMainFrame: boolean,
10603                                                  frameProcessId: number,
10604                                                  frameRoutingId: number) => void): this;
10605     once(event: 'did-navigate-in-page', listener: (event: Event,
10606                                                  url: string,
10607                                                  isMainFrame: boolean,
10608                                                  frameProcessId: number,
10609                                                  frameRoutingId: number) => void): this;
10610     addListener(event: 'did-navigate-in-page', listener: (event: Event,
10611                                                  url: string,
10612                                                  isMainFrame: boolean,
10613                                                  frameProcessId: number,
10614                                                  frameRoutingId: number) => void): this;
10615     removeListener(event: 'did-navigate-in-page', listener: (event: Event,
10616                                                  url: string,
10617                                                  isMainFrame: boolean,
10618                                                  frameProcessId: number,
10619                                                  frameRoutingId: number) => void): this;
10620     /**
10621      * Emitted after a server side redirect occurs during navigation.  For example a
10622      * 302 redirect.
10623      *
10624      * This event cannot be prevented, if you want to prevent redirects you should
10625      * checkout out the `will-redirect` event above.
10626      */
10627     on(event: 'did-redirect-navigation', listener: (event: Event,
10628                                                     url: string,
10629                                                     isInPlace: boolean,
10630                                                     isMainFrame: boolean,
10631                                                     frameProcessId: number,
10632                                                     frameRoutingId: number) => void): this;
10633     once(event: 'did-redirect-navigation', listener: (event: Event,
10634                                                     url: string,
10635                                                     isInPlace: boolean,
10636                                                     isMainFrame: boolean,
10637                                                     frameProcessId: number,
10638                                                     frameRoutingId: number) => void): this;
10639     addListener(event: 'did-redirect-navigation', listener: (event: Event,
10640                                                     url: string,
10641                                                     isInPlace: boolean,
10642                                                     isMainFrame: boolean,
10643                                                     frameProcessId: number,
10644                                                     frameRoutingId: number) => void): this;
10645     removeListener(event: 'did-redirect-navigation', listener: (event: Event,
10646                                                     url: string,
10647                                                     isInPlace: boolean,
10648                                                     isMainFrame: boolean,
10649                                                     frameProcessId: number,
10650                                                     frameRoutingId: number) => void): this;
10651     /**
10652      * Corresponds to the points in time when the spinner of the tab started spinning.
10653      */
10654     on(event: 'did-start-loading', listener: Function): this;
10655     once(event: 'did-start-loading', listener: Function): this;
10656     addListener(event: 'did-start-loading', listener: Function): this;
10657     removeListener(event: 'did-start-loading', listener: Function): this;
10658     /**
10659      * Emitted when any frame (including main) starts navigating. `isInPlace` will be
10660      * `true` for in-page navigations.
10661      */
10662     on(event: 'did-start-navigation', listener: (event: Event,
10663                                                  url: string,
10664                                                  isInPlace: boolean,
10665                                                  isMainFrame: boolean,
10666                                                  frameProcessId: number,
10667                                                  frameRoutingId: number) => void): this;
10668     once(event: 'did-start-navigation', listener: (event: Event,
10669                                                  url: string,
10670                                                  isInPlace: boolean,
10671                                                  isMainFrame: boolean,
10672                                                  frameProcessId: number,
10673                                                  frameRoutingId: number) => void): this;
10674     addListener(event: 'did-start-navigation', listener: (event: Event,
10675                                                  url: string,
10676                                                  isInPlace: boolean,
10677                                                  isMainFrame: boolean,
10678                                                  frameProcessId: number,
10679                                                  frameRoutingId: number) => void): this;
10680     removeListener(event: 'did-start-navigation', listener: (event: Event,
10681                                                  url: string,
10682                                                  isInPlace: boolean,
10683                                                  isMainFrame: boolean,
10684                                                  frameProcessId: number,
10685                                                  frameRoutingId: number) => void): this;
10686     /**
10687      * Corresponds to the points in time when the spinner of the tab stopped spinning.
10688      */
10689     on(event: 'did-stop-loading', listener: Function): this;
10690     once(event: 'did-stop-loading', listener: Function): this;
10691     addListener(event: 'did-stop-loading', listener: Function): this;
10692     removeListener(event: 'did-stop-loading', listener: Function): this;
10693     /**
10694      * Emitted when the document in the top-level frame is loaded.
10695      */
10696     on(event: 'dom-ready', listener: Function): this;
10697     once(event: 'dom-ready', listener: Function): this;
10698     addListener(event: 'dom-ready', listener: Function): this;
10699     removeListener(event: 'dom-ready', listener: Function): this;
10700     /**
10701      * Emitted when the window enters a full-screen state triggered by HTML API.
10702      */
10703     on(event: 'enter-html-full-screen', listener: Function): this;
10704     once(event: 'enter-html-full-screen', listener: Function): this;
10705     addListener(event: 'enter-html-full-screen', listener: Function): this;
10706     removeListener(event: 'enter-html-full-screen', listener: Function): this;
10707     /**
10708      * Emitted when the `WebContents` gains focus.
10709      *
10710      * Note that on macOS, having focus means the `WebContents` is the first responder
10711      * of window, so switching focus between windows would not trigger the `focus` and
10712      * `blur` events of `WebContents`, as the first responder of each window is not
10713      * changed.
10714      *
10715      * The `focus` and `blur` events of `WebContents` should only be used to detect
10716      * focus change between different `WebContents` and `BrowserView` in the same
10717      * window.
10718      */
10719     on(event: 'focus', listener: Function): this;
10720     once(event: 'focus', listener: Function): this;
10721     addListener(event: 'focus', listener: Function): this;
10722     removeListener(event: 'focus', listener: Function): this;
10723     /**
10724      * Emitted when a result is available for [`webContents.findInPage`] request.
10725      */
10726     on(event: 'found-in-page', listener: (event: Event,
10727                                           result: Result) => void): this;
10728     once(event: 'found-in-page', listener: (event: Event,
10729                                           result: Result) => void): this;
10730     addListener(event: 'found-in-page', listener: (event: Event,
10731                                           result: Result) => void): this;
10732     removeListener(event: 'found-in-page', listener: (event: Event,
10733                                           result: Result) => void): this;
10734     /**
10735      * Emitted when the mainFrame, an `<iframe>`, or a nested `<iframe>` is loaded
10736      * within the page.
10737      */
10738     on(event: 'frame-created', listener: (event: Event,
10739                                           details: FrameCreatedDetails) => void): this;
10740     once(event: 'frame-created', listener: (event: Event,
10741                                           details: FrameCreatedDetails) => void): this;
10742     addListener(event: 'frame-created', listener: (event: Event,
10743                                           details: FrameCreatedDetails) => void): this;
10744     removeListener(event: 'frame-created', listener: (event: Event,
10745                                           details: FrameCreatedDetails) => void): this;
10746     /**
10747      * Emitted when an input event is sent to the WebContents. See InputEvent for
10748      * details.
10749      */
10750     on(event: 'input-event', listener: (event: Event,
10751                                         inputEvent: InputEvent) => void): this;
10752     once(event: 'input-event', listener: (event: Event,
10753                                         inputEvent: InputEvent) => void): this;
10754     addListener(event: 'input-event', listener: (event: Event,
10755                                         inputEvent: InputEvent) => void): this;
10756     removeListener(event: 'input-event', listener: (event: Event,
10757                                         inputEvent: InputEvent) => void): this;
10758     /**
10759      * Emitted when the renderer process sends an asynchronous message via
10760      * `ipcRenderer.send()`.
10761      *
10762      * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
10763      * responding to IPC messages specifically from this WebContents.
10764      */
10765     on(event: 'ipc-message', listener: (event: Event,
10766                                         channel: string,
10767                                         ...args: any[]) => void): this;
10768     once(event: 'ipc-message', listener: (event: Event,
10769                                         channel: string,
10770                                         ...args: any[]) => void): this;
10771     addListener(event: 'ipc-message', listener: (event: Event,
10772                                         channel: string,
10773                                         ...args: any[]) => void): this;
10774     removeListener(event: 'ipc-message', listener: (event: Event,
10775                                         channel: string,
10776                                         ...args: any[]) => void): this;
10777     /**
10778      * Emitted when the renderer process sends a synchronous message via
10779      * `ipcRenderer.sendSync()`.
10780      *
10781      * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
10782      * responding to IPC messages specifically from this WebContents.
10783      */
10784     on(event: 'ipc-message-sync', listener: (event: Event,
10785                                              channel: string,
10786                                              ...args: any[]) => void): this;
10787     once(event: 'ipc-message-sync', listener: (event: Event,
10788                                              channel: string,
10789                                              ...args: any[]) => void): this;
10790     addListener(event: 'ipc-message-sync', listener: (event: Event,
10791                                              channel: string,
10792                                              ...args: any[]) => void): this;
10793     removeListener(event: 'ipc-message-sync', listener: (event: Event,
10794                                              channel: string,
10795                                              ...args: any[]) => void): this;
10796     /**
10797      * Emitted when the window leaves a full-screen state triggered by HTML API.
10798      */
10799     on(event: 'leave-html-full-screen', listener: Function): this;
10800     once(event: 'leave-html-full-screen', listener: Function): this;
10801     addListener(event: 'leave-html-full-screen', listener: Function): this;
10802     removeListener(event: 'leave-html-full-screen', listener: Function): this;
10803     /**
10804      * Emitted when `webContents` wants to do basic auth.
10805      *
10806      * The usage is the same with the `login` event of `app`.
10807      */
10808     on(event: 'login', listener: (event: Event,
10809                                   authenticationResponseDetails: AuthenticationResponseDetails,
10810                                   authInfo: AuthInfo,
10811                                   callback: (username?: string, password?: string) => void) => void): this;
10812     once(event: 'login', listener: (event: Event,
10813                                   authenticationResponseDetails: AuthenticationResponseDetails,
10814                                   authInfo: AuthInfo,
10815                                   callback: (username?: string, password?: string) => void) => void): this;
10816     addListener(event: 'login', listener: (event: Event,
10817                                   authenticationResponseDetails: AuthenticationResponseDetails,
10818                                   authInfo: AuthInfo,
10819                                   callback: (username?: string, password?: string) => void) => void): this;
10820     removeListener(event: 'login', listener: (event: Event,
10821                                   authenticationResponseDetails: AuthenticationResponseDetails,
10822                                   authInfo: AuthInfo,
10823                                   callback: (username?: string, password?: string) => void) => void): this;
10824     /**
10825      * Emitted when media is paused or done playing.
10826      */
10827     on(event: 'media-paused', listener: Function): this;
10828     once(event: 'media-paused', listener: Function): this;
10829     addListener(event: 'media-paused', listener: Function): this;
10830     removeListener(event: 'media-paused', listener: Function): this;
10831     /**
10832      * Emitted when media starts playing.
10833      */
10834     on(event: 'media-started-playing', listener: Function): this;
10835     once(event: 'media-started-playing', listener: Function): this;
10836     addListener(event: 'media-started-playing', listener: Function): this;
10837     removeListener(event: 'media-started-playing', listener: Function): this;
10838     /**
10839      * Emitted when page receives favicon urls.
10840      */
10841     on(event: 'page-favicon-updated', listener: (event: Event,
10842                                                  /**
10843                                                   * Array of URLs.
10844                                                   */
10845                                                  favicons: string[]) => void): this;
10846     once(event: 'page-favicon-updated', listener: (event: Event,
10847                                                  /**
10848                                                   * Array of URLs.
10849                                                   */
10850                                                  favicons: string[]) => void): this;
10851     addListener(event: 'page-favicon-updated', listener: (event: Event,
10852                                                  /**
10853                                                   * Array of URLs.
10854                                                   */
10855                                                  favicons: string[]) => void): this;
10856     removeListener(event: 'page-favicon-updated', listener: (event: Event,
10857                                                  /**
10858                                                   * Array of URLs.
10859                                                   */
10860                                                  favicons: string[]) => void): this;
10861     /**
10862      * Fired when page title is set during navigation. `explicitSet` is false when
10863      * title is synthesized from file url.
10864      */
10865     on(event: 'page-title-updated', listener: (event: Event,
10866                                                title: string,
10867                                                explicitSet: boolean) => void): this;
10868     once(event: 'page-title-updated', listener: (event: Event,
10869                                                title: string,
10870                                                explicitSet: boolean) => void): this;
10871     addListener(event: 'page-title-updated', listener: (event: Event,
10872                                                title: string,
10873                                                explicitSet: boolean) => void): this;
10874     removeListener(event: 'page-title-updated', listener: (event: Event,
10875                                                title: string,
10876                                                explicitSet: boolean) => void): this;
10877     /**
10878      * Emitted when a new frame is generated. Only the dirty area is passed in the
10879      * buffer.
10880      */
10881     on(event: 'paint', listener: (event: Event,
10882                                   dirtyRect: Rectangle,
10883                                   /**
10884                                    * The image data of the whole frame.
10885                                    */
10886                                   image: NativeImage) => void): this;
10887     once(event: 'paint', listener: (event: Event,
10888                                   dirtyRect: Rectangle,
10889                                   /**
10890                                    * The image data of the whole frame.
10891                                    */
10892                                   image: NativeImage) => void): this;
10893     addListener(event: 'paint', listener: (event: Event,
10894                                   dirtyRect: Rectangle,
10895                                   /**
10896                                    * The image data of the whole frame.
10897                                    */
10898                                   image: NativeImage) => void): this;
10899     removeListener(event: 'paint', listener: (event: Event,
10900                                   dirtyRect: Rectangle,
10901                                   /**
10902                                    * The image data of the whole frame.
10903                                    */
10904                                   image: NativeImage) => void): this;
10905     /**
10906      * Emitted when a plugin process has crashed.
10907      */
10908     on(event: 'plugin-crashed', listener: (event: Event,
10909                                            name: string,
10910                                            version: string) => void): this;
10911     once(event: 'plugin-crashed', listener: (event: Event,
10912                                            name: string,
10913                                            version: string) => void): this;
10914     addListener(event: 'plugin-crashed', listener: (event: Event,
10915                                            name: string,
10916                                            version: string) => void): this;
10917     removeListener(event: 'plugin-crashed', listener: (event: Event,
10918                                            name: string,
10919                                            version: string) => void): this;
10920     /**
10921      * Emitted when the `WebContents` preferred size has changed.
10922      *
10923      * This event will only be emitted when `enablePreferredSizeMode` is set to `true`
10924      * in `webPreferences`.
10925      */
10926     on(event: 'preferred-size-changed', listener: (event: Event,
10927                                                    /**
10928                                                     * The minimum size needed to contain the layout of the document—without requiring
10929                                                     * scrolling.
10930                                                     */
10931                                                    preferredSize: Size) => void): this;
10932     once(event: 'preferred-size-changed', listener: (event: Event,
10933                                                    /**
10934                                                     * The minimum size needed to contain the layout of the document—without requiring
10935                                                     * scrolling.
10936                                                     */
10937                                                    preferredSize: Size) => void): this;
10938     addListener(event: 'preferred-size-changed', listener: (event: Event,
10939                                                    /**
10940                                                     * The minimum size needed to contain the layout of the document—without requiring
10941                                                     * scrolling.
10942                                                     */
10943                                                    preferredSize: Size) => void): this;
10944     removeListener(event: 'preferred-size-changed', listener: (event: Event,
10945                                                    /**
10946                                                     * The minimum size needed to contain the layout of the document—without requiring
10947                                                     * scrolling.
10948                                                     */
10949                                                    preferredSize: Size) => void): this;
10950     /**
10951      * Emitted when the preload script `preloadPath` throws an unhandled exception
10952      * `error`.
10953      */
10954     on(event: 'preload-error', listener: (event: Event,
10955                                           preloadPath: string,
10956                                           error: Error) => void): this;
10957     once(event: 'preload-error', listener: (event: Event,
10958                                           preloadPath: string,
10959                                           error: Error) => void): this;
10960     addListener(event: 'preload-error', listener: (event: Event,
10961                                           preloadPath: string,
10962                                           error: Error) => void): this;
10963     removeListener(event: 'preload-error', listener: (event: Event,
10964                                           preloadPath: string,
10965                                           error: Error) => void): this;
10966     /**
10967      * Emitted when the renderer process unexpectedly disappears.  This is normally
10968      * because it was crashed or killed.
10969      */
10970     on(event: 'render-process-gone', listener: (event: Event,
10971                                                 details: RenderProcessGoneDetails) => void): this;
10972     once(event: 'render-process-gone', listener: (event: Event,
10973                                                 details: RenderProcessGoneDetails) => void): this;
10974     addListener(event: 'render-process-gone', listener: (event: Event,
10975                                                 details: RenderProcessGoneDetails) => void): this;
10976     removeListener(event: 'render-process-gone', listener: (event: Event,
10977                                                 details: RenderProcessGoneDetails) => void): this;
10978     /**
10979      * Emitted when the unresponsive web page becomes responsive again.
10980      */
10981     on(event: 'responsive', listener: Function): this;
10982     once(event: 'responsive', listener: Function): this;
10983     addListener(event: 'responsive', listener: Function): this;
10984     removeListener(event: 'responsive', listener: Function): this;
10985     /**
10986      * Emitted when bluetooth device needs to be selected on call to
10987      * `navigator.bluetooth.requestDevice`. To use `navigator.bluetooth` api
10988      * `webBluetooth` should be enabled. If `event.preventDefault` is not called, first
10989      * available device will be selected. `callback` should be called with `deviceId`
10990      * to be selected, passing empty string to `callback` will cancel the request.
10991      *
10992      * If no event listener is added for this event, all bluetooth requests will be
10993      * cancelled.
10994      */
10995     on(event: 'select-bluetooth-device', listener: (event: Event,
10996                                                     devices: BluetoothDevice[],
10997                                                     callback: (deviceId: string) => void) => void): this;
10998     once(event: 'select-bluetooth-device', listener: (event: Event,
10999                                                     devices: BluetoothDevice[],
11000                                                     callback: (deviceId: string) => void) => void): this;
11001     addListener(event: 'select-bluetooth-device', listener: (event: Event,
11002                                                     devices: BluetoothDevice[],
11003                                                     callback: (deviceId: string) => void) => void): this;
11004     removeListener(event: 'select-bluetooth-device', listener: (event: Event,
11005                                                     devices: BluetoothDevice[],
11006                                                     callback: (deviceId: string) => void) => void): this;
11007     /**
11008      * Emitted when a client certificate is requested.
11009      *
11010      * The usage is the same with the `select-client-certificate` event of `app`.
11011      */
11012     on(event: 'select-client-certificate', listener: (event: Event,
11013                                                       url: string,
11014                                                       certificateList: Certificate[],
11015                                                       callback: (certificate: Certificate) => void) => void): this;
11016     once(event: 'select-client-certificate', listener: (event: Event,
11017                                                       url: string,
11018                                                       certificateList: Certificate[],
11019                                                       callback: (certificate: Certificate) => void) => void): this;
11020     addListener(event: 'select-client-certificate', listener: (event: Event,
11021                                                       url: string,
11022                                                       certificateList: Certificate[],
11023                                                       callback: (certificate: Certificate) => void) => void): this;
11024     removeListener(event: 'select-client-certificate', listener: (event: Event,
11025                                                       url: string,
11026                                                       certificateList: Certificate[],
11027                                                       callback: (certificate: Certificate) => void) => void): this;
11028     /**
11029      * Emitted when the web page becomes unresponsive.
11030      */
11031     on(event: 'unresponsive', listener: Function): this;
11032     once(event: 'unresponsive', listener: Function): this;
11033     addListener(event: 'unresponsive', listener: Function): this;
11034     removeListener(event: 'unresponsive', listener: Function): this;
11035     /**
11036      * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
11037      */
11038     on(event: 'update-target-url', listener: (event: Event,
11039                                               url: string) => void): this;
11040     once(event: 'update-target-url', listener: (event: Event,
11041                                               url: string) => void): this;
11042     addListener(event: 'update-target-url', listener: (event: Event,
11043                                               url: string) => void): this;
11044     removeListener(event: 'update-target-url', listener: (event: Event,
11045                                               url: string) => void): this;
11046     /**
11047      * Emitted when a `<webview>`'s web contents is being attached to this web
11048      * contents. Calling `event.preventDefault()` will destroy the guest page.
11049      *
11050      * This event can be used to configure `webPreferences` for the `webContents` of a
11051      * `<webview>` before it's loaded, and provides the ability to set settings that
11052      * can't be set via `<webview>` attributes.
11053      */
11054     on(event: 'will-attach-webview', listener: (event: Event,
11055                                                 /**
11056                                                  * The web preferences that will be used by the guest page. This object can be
11057                                                  * modified to adjust the preferences for the guest page.
11058                                                  */
11059                                                 webPreferences: WebPreferences,
11060                                                 /**
11061                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
11062                                                  * modified to adjust the parameters of the guest page.
11063                                                  */
11064                                                 params: Record<string, string>) => void): this;
11065     once(event: 'will-attach-webview', listener: (event: Event,
11066                                                 /**
11067                                                  * The web preferences that will be used by the guest page. This object can be
11068                                                  * modified to adjust the preferences for the guest page.
11069                                                  */
11070                                                 webPreferences: WebPreferences,
11071                                                 /**
11072                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
11073                                                  * modified to adjust the parameters of the guest page.
11074                                                  */
11075                                                 params: Record<string, string>) => void): this;
11076     addListener(event: 'will-attach-webview', listener: (event: Event,
11077                                                 /**
11078                                                  * The web preferences that will be used by the guest page. This object can be
11079                                                  * modified to adjust the preferences for the guest page.
11080                                                  */
11081                                                 webPreferences: WebPreferences,
11082                                                 /**
11083                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
11084                                                  * modified to adjust the parameters of the guest page.
11085                                                  */
11086                                                 params: Record<string, string>) => void): this;
11087     removeListener(event: 'will-attach-webview', listener: (event: Event,
11088                                                 /**
11089                                                  * The web preferences that will be used by the guest page. This object can be
11090                                                  * modified to adjust the preferences for the guest page.
11091                                                  */
11092                                                 webPreferences: WebPreferences,
11093                                                 /**
11094                                                  * The other `<webview>` parameters such as the `src` URL. This object can be
11095                                                  * modified to adjust the parameters of the guest page.
11096                                                  */
11097                                                 params: Record<string, string>) => void): this;
11098     /**
11099      * Emitted when a user or the page wants to start navigation. It can happen when
11100      * the `window.location` object is changed or a user clicks a link in the page.
11101      *
11102      * This event will not emit when the navigation is started programmatically with
11103      * APIs like `webContents.loadURL` and `webContents.back`.
11104      *
11105      * It is also not emitted for in-page navigations, such as clicking anchor links or
11106      * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
11107      * purpose.
11108      *
11109      * Calling `event.preventDefault()` will prevent the navigation.
11110      */
11111     on(event: 'will-navigate', listener: (event: Event,
11112                                           url: string) => void): this;
11113     once(event: 'will-navigate', listener: (event: Event,
11114                                           url: string) => void): this;
11115     addListener(event: 'will-navigate', listener: (event: Event,
11116                                           url: string) => void): this;
11117     removeListener(event: 'will-navigate', listener: (event: Event,
11118                                           url: string) => void): this;
11119     /**
11120      * Emitted when a `beforeunload` event handler is attempting to cancel a page
11121      * unload.
11122      *
11123      * Calling `event.preventDefault()` will ignore the `beforeunload` event handler
11124      * and allow the page to be unloaded.
11125      *
11126      * **Note:** This will be emitted for `BrowserViews` but will _not_ be respected -
11127      * this is because we have chosen not to tie the `BrowserView` lifecycle to its
11128      * owning BrowserWindow should one exist per the specification.
11129      */
11130     on(event: 'will-prevent-unload', listener: (event: Event) => void): this;
11131     once(event: 'will-prevent-unload', listener: (event: Event) => void): this;
11132     addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
11133     removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
11134     /**
11135      * Emitted when a server side redirect occurs during navigation.  For example a 302
11136      * redirect.
11137      *
11138      * This event will be emitted after `did-start-navigation` and always before the
11139      * `did-redirect-navigation` event for the same navigation.
11140      *
11141      * Calling `event.preventDefault()` will prevent the navigation (not just the
11142      * redirect).
11143      */
11144     on(event: 'will-redirect', listener: (event: Event,
11145                                           url: string,
11146                                           isInPlace: boolean,
11147                                           isMainFrame: boolean,
11148                                           frameProcessId: number,
11149                                           frameRoutingId: number) => void): this;
11150     once(event: 'will-redirect', listener: (event: Event,
11151                                           url: string,
11152                                           isInPlace: boolean,
11153                                           isMainFrame: boolean,
11154                                           frameProcessId: number,
11155                                           frameRoutingId: number) => void): this;
11156     addListener(event: 'will-redirect', listener: (event: Event,
11157                                           url: string,
11158                                           isInPlace: boolean,
11159                                           isMainFrame: boolean,
11160                                           frameProcessId: number,
11161                                           frameRoutingId: number) => void): this;
11162     removeListener(event: 'will-redirect', listener: (event: Event,
11163                                           url: string,
11164                                           isInPlace: boolean,
11165                                           isMainFrame: boolean,
11166                                           frameProcessId: number,
11167                                           frameRoutingId: number) => void): this;
11168     /**
11169      * Emitted when the user is requesting to change the zoom level using the mouse
11170      * wheel.
11171      */
11172     on(event: 'zoom-changed', listener: (event: Event,
11173                                          /**
11174                                           * Can be `in` or `out`.
11175                                           */
11176                                          zoomDirection: ('in' | 'out')) => void): this;
11177     once(event: 'zoom-changed', listener: (event: Event,
11178                                          /**
11179                                           * Can be `in` or `out`.
11180                                           */
11181                                          zoomDirection: ('in' | 'out')) => void): this;
11182     addListener(event: 'zoom-changed', listener: (event: Event,
11183                                          /**
11184                                           * Can be `in` or `out`.
11185                                           */
11186                                          zoomDirection: ('in' | 'out')) => void): this;
11187     removeListener(event: 'zoom-changed', listener: (event: Event,
11188                                          /**
11189                                           * Can be `in` or `out`.
11190                                           */
11191                                          zoomDirection: ('in' | 'out')) => void): this;
11192     /**
11193      * Adds the specified path to DevTools workspace. Must be used after DevTools
11194      * creation:
11195      */
11196     addWorkSpace(path: string): void;
11197     /**
11198      * Begin subscribing for presentation events and captured frames, the `callback`
11199      * will be called with `callback(image, dirtyRect)` when there is a presentation
11200      * event.
11201      *
11202      * The `image` is an instance of NativeImage that stores the captured frame.
11203      *
11204      * The `dirtyRect` is an object with `x, y, width, height` properties that
11205      * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
11206      * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
11207      */
11208     beginFrameSubscription(onlyDirty: boolean, callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
11209     /**
11210      * Begin subscribing for presentation events and captured frames, the `callback`
11211      * will be called with `callback(image, dirtyRect)` when there is a presentation
11212      * event.
11213      *
11214      * The `image` is an instance of NativeImage that stores the captured frame.
11215      *
11216      * The `dirtyRect` is an object with `x, y, width, height` properties that
11217      * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
11218      * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
11219      */
11220     beginFrameSubscription(callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
11221     /**
11222      * Whether the browser can go back to previous web page.
11223      */
11224     canGoBack(): boolean;
11225     /**
11226      * Whether the browser can go forward to next web page.
11227      */
11228     canGoForward(): boolean;
11229     /**
11230      * Whether the web page can go to `offset`.
11231      */
11232     canGoToOffset(offset: number): boolean;
11233     /**
11234      * Resolves with a NativeImage
11235      *
11236      * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
11237      * whole visible page.
11238      */
11239     capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
11240     /**
11241      * Clears the navigation history.
11242      */
11243     clearHistory(): void;
11244     /**
11245      * Closes the page, as if the web content had called `window.close()`.
11246      *
11247      * If the page is successfully closed (i.e. the unload is not prevented by the
11248      * page, or `waitForBeforeUnload` is false or unspecified), the WebContents will be
11249      * destroyed and no longer usable. The `destroyed` event will be emitted.
11250      */
11251     close(opts?: Opts): void;
11252     /**
11253      * Closes the devtools.
11254      */
11255     closeDevTools(): void;
11256     /**
11257      * Executes the editing command `copy` in web page.
11258      */
11259     copy(): void;
11260     /**
11261      * Copy the image at the given position to the clipboard.
11262      */
11263     copyImageAt(x: number, y: number): void;
11264     /**
11265      * Executes the editing command `cut` in web page.
11266      */
11267     cut(): void;
11268     /**
11269      * Decrease the capturer count by one. The page will be set to hidden or occluded
11270      * state when its browser window is hidden or occluded and the capturer count
11271      * reaches zero. If you want to decrease the hidden capturer count instead you
11272      * should set `stayHidden` to true.
11273      */
11274     decrementCapturerCount(stayHidden?: boolean, stayAwake?: boolean): void;
11275     /**
11276      * Executes the editing command `delete` in web page.
11277      */
11278     delete(): void;
11279     /**
11280      * Disable device emulation enabled by `webContents.enableDeviceEmulation`.
11281      */
11282     disableDeviceEmulation(): void;
11283     /**
11284      * Initiates a download of the resource at `url` without navigating. The
11285      * `will-download` event of `session` will be triggered.
11286      */
11287     downloadURL(url: string): void;
11288     /**
11289      * Enable device emulation with the given parameters.
11290      */
11291     enableDeviceEmulation(parameters: Parameters): void;
11292     /**
11293      * End subscribing for frame presentation events.
11294      */
11295     endFrameSubscription(): void;
11296     /**
11297      * A promise that resolves with the result of the executed code or is rejected if
11298      * the result of the code is a rejected promise.
11299      *
11300      * Evaluates `code` in page.
11301      *
11302      * In the browser window some HTML APIs like `requestFullScreen` can only be
11303      * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
11304      * this limitation.
11305      *
11306      * Code execution will be suspended until web page stop loading.
11307      */
11308     executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
11309     /**
11310      * A promise that resolves with the result of the executed code or is rejected if
11311      * the result of the code is a rejected promise.
11312      *
11313      * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
11314      */
11315     executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean): Promise<any>;
11316     /**
11317      * The request id used for the request.
11318      *
11319      * Starts a request to find all matches for the `text` in the web page. The result
11320      * of the request can be obtained by subscribing to `found-in-page` event.
11321      */
11322     findInPage(text: string, options?: FindInPageOptions): number;
11323     /**
11324      * Focuses the web page.
11325      */
11326     focus(): void;
11327     /**
11328      * Forcefully terminates the renderer process that is currently hosting this
11329      * `webContents`. This will cause the `render-process-gone` event to be emitted
11330      * with the `reason=killed || reason=crashed`. Please note that some webContents
11331      * share renderer processes and therefore calling this method may also crash the
11332      * host process for other webContents as well.
11333      *
11334      * Calling `reload()` immediately after calling this method will force the reload
11335      * to occur in a new process. This should be used when this process is unstable or
11336      * unusable, for instance in order to recover from the `unresponsive` event.
11337      */
11338     forcefullyCrashRenderer(): void;
11339     /**
11340      * Information about all Shared Workers.
11341      */
11342     getAllSharedWorkers(): SharedWorkerInfo[];
11343     /**
11344      * whether or not this WebContents will throttle animations and timers when the
11345      * page becomes backgrounded. This also affects the Page Visibility API.
11346      */
11347     getBackgroundThrottling(): boolean;
11348     /**
11349      * If *offscreen rendering* is enabled returns the current frame rate.
11350      */
11351     getFrameRate(): number;
11352     /**
11353      * The identifier of a WebContents stream. This identifier can be used with
11354      * `navigator.mediaDevices.getUserMedia` using a `chromeMediaSource` of `tab`. The
11355      * identifier is restricted to the web contents that it is registered to and is
11356      * only valid for 10 seconds.
11357      */
11358     getMediaSourceId(requestWebContents: WebContents): string;
11359     /**
11360      * The operating system `pid` of the associated renderer process.
11361      */
11362     getOSProcessId(): number;
11363     /**
11364      * Get the system printer list.
11365      *
11366      *
11367      * **Deprecated:** Should use the new `contents.getPrintersAsync` API.
11368      *
11369      * @deprecated
11370      */
11371     getPrinters(): PrinterInfo[];
11372     /**
11373      * Get the system printer list.
11374      *
11375      * Resolves with a `PrinterInfo[]`
11376      */
11377     getPrintersAsync(): Promise<Electron.PrinterInfo[]>;
11378     /**
11379      * The Chromium internal `pid` of the associated renderer. Can be compared to the
11380      * `frameProcessId` passed by frame specific navigation events (e.g.
11381      * `did-frame-navigate`)
11382      */
11383     getProcessId(): number;
11384     /**
11385      * The title of the current web page.
11386      */
11387     getTitle(): string;
11388     /**
11389      * the type of the webContent. Can be `backgroundPage`, `window`, `browserView`,
11390      * `remote`, `webview` or `offscreen`.
11391      */
11392     getType(): ('backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen');
11393     /**
11394      * The URL of the current web page.
11395      */
11396     getURL(): string;
11397     /**
11398      * The user agent for this web page.
11399      */
11400     getUserAgent(): string;
11401     /**
11402      * Returns the WebRTC IP Handling Policy.
11403      */
11404     getWebRTCIPHandlingPolicy(): string;
11405     /**
11406      * the current zoom factor.
11407      */
11408     getZoomFactor(): number;
11409     /**
11410      * the current zoom level.
11411      */
11412     getZoomLevel(): number;
11413     /**
11414      * Makes the browser go back a web page.
11415      */
11416     goBack(): void;
11417     /**
11418      * Makes the browser go forward a web page.
11419      */
11420     goForward(): void;
11421     /**
11422      * Navigates browser to the specified absolute web page index.
11423      */
11424     goToIndex(index: number): void;
11425     /**
11426      * Navigates to the specified offset from the "current entry".
11427      */
11428     goToOffset(offset: number): void;
11429     /**
11430      * Increase the capturer count by one. The page is considered visible when its
11431      * browser window is hidden and the capturer count is non-zero. If you would like
11432      * the page to stay hidden, you should ensure that `stayHidden` is set to true.
11433      *
11434      * This also affects the Page Visibility API.
11435      */
11436     incrementCapturerCount(size?: Size, stayHidden?: boolean, stayAwake?: boolean): void;
11437     /**
11438      * A promise that resolves with a key for the inserted CSS that can later be used
11439      * to remove the CSS via `contents.removeInsertedCSS(key)`.
11440      *
11441      * Injects CSS into the current web page and returns a unique key for the inserted
11442      * stylesheet.
11443      */
11444     insertCSS(css: string, options?: InsertCSSOptions): Promise<string>;
11445     /**
11446      * Inserts `text` to the focused element.
11447      */
11448     insertText(text: string): Promise<void>;
11449     /**
11450      * Starts inspecting element at position (`x`, `y`).
11451      */
11452     inspectElement(x: number, y: number): void;
11453     /**
11454      * Opens the developer tools for the service worker context.
11455      */
11456     inspectServiceWorker(): void;
11457     /**
11458      * Opens the developer tools for the shared worker context.
11459      */
11460     inspectSharedWorker(): void;
11461     /**
11462      * Inspects the shared worker based on its ID.
11463      */
11464     inspectSharedWorkerById(workerId: string): void;
11465     /**
11466      * Schedules a full repaint of the window this web contents is in.
11467      *
11468      * If *offscreen rendering* is enabled invalidates the frame and generates a new
11469      * one through the `'paint'` event.
11470      */
11471     invalidate(): void;
11472     /**
11473      * Whether this page has been muted.
11474      */
11475     isAudioMuted(): boolean;
11476     /**
11477      * Whether this page is being captured. It returns true when the capturer count is
11478      * large then 0.
11479      */
11480     isBeingCaptured(): boolean;
11481     /**
11482      * Whether the renderer process has crashed.
11483      */
11484     isCrashed(): boolean;
11485     /**
11486      * Whether audio is currently playing.
11487      */
11488     isCurrentlyAudible(): boolean;
11489     /**
11490      * Whether the web page is destroyed.
11491      */
11492     isDestroyed(): boolean;
11493     /**
11494      * Whether the devtools view is focused .
11495      */
11496     isDevToolsFocused(): boolean;
11497     /**
11498      * Whether the devtools is opened.
11499      */
11500     isDevToolsOpened(): boolean;
11501     /**
11502      * Whether the web page is focused.
11503      */
11504     isFocused(): boolean;
11505     /**
11506      * Whether web page is still loading resources.
11507      */
11508     isLoading(): boolean;
11509     /**
11510      * Whether the main frame (and not just iframes or frames within it) is still
11511      * loading.
11512      */
11513     isLoadingMainFrame(): boolean;
11514     /**
11515      * Indicates whether *offscreen rendering* is enabled.
11516      */
11517     isOffscreen(): boolean;
11518     /**
11519      * If *offscreen rendering* is enabled returns whether it is currently painting.
11520      */
11521     isPainting(): boolean;
11522     /**
11523      * Whether the web page is waiting for a first-response from the main resource of
11524      * the page.
11525      */
11526     isWaitingForResponse(): boolean;
11527     /**
11528      * the promise will resolve when the page has finished loading (see
11529      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
11530      *
11531      * Loads the given file in the window, `filePath` should be a path to an HTML file
11532      * relative to the root of your application.  For instance an app structure like
11533      * this:
11534      *
11535      * Would require code like this
11536      */
11537     loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
11538     /**
11539      * the promise will resolve when the page has finished loading (see
11540      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
11541      * A noop rejection handler is already attached, which avoids unhandled rejection
11542      * errors.
11543      *
11544      * Loads the `url` in the window. The `url` must contain the protocol prefix, e.g.
11545      * the `http://` or `file://`. If the load should bypass http cache then use the
11546      * `pragma` header to achieve it.
11547      */
11548     loadURL(url: string, options?: LoadURLOptions): Promise<void>;
11549     /**
11550      * Opens the devtools.
11551      *
11552      * When `contents` is a `<webview>` tag, the `mode` would be `detach` by default,
11553      * explicitly passing an empty `mode` can force using last used dock state.
11554      *
11555      * On Windows, if Windows Control Overlay is enabled, Devtools will be opened with
11556      * `mode: 'detach'`.
11557      */
11558     openDevTools(options?: OpenDevToolsOptions): void;
11559     /**
11560      * Executes the editing command `paste` in web page.
11561      */
11562     paste(): void;
11563     /**
11564      * Executes the editing command `pasteAndMatchStyle` in web page.
11565      */
11566     pasteAndMatchStyle(): void;
11567     /**
11568      * Send a message to the renderer process, optionally transferring ownership of
11569      * zero or more `MessagePortMain` objects.
11570      *
11571      * The transferred `MessagePortMain` objects will be available in the renderer
11572      * process by accessing the `ports` property of the emitted event. When they arrive
11573      * in the renderer, they will be native DOM `MessagePort` objects.
11574      *
11575      * For example:
11576      */
11577     postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
11578     /**
11579      * When a custom `pageSize` is passed, Chromium attempts to validate platform
11580      * specific minimum values for `width_microns` and `height_microns`. Width and
11581      * height must both be minimum 353 microns but may be higher on some operating
11582      * systems.
11583      *
11584      * Prints window's web page. When `silent` is set to `true`, Electron will pick the
11585      * system's default printer if `deviceName` is empty and the default settings for
11586      * printing.
11587      *
11588      * Use `page-break-before: always;` CSS style to force to print to a new page.
11589      *
11590      * Example usage:
11591      */
11592     print(options?: WebContentsPrintOptions, callback?: (success: boolean, failureReason: string) => void): void;
11593     /**
11594      * Resolves with the generated PDF data.
11595      *
11596      * Prints the window's web page as PDF.
11597      *
11598      * The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
11599      *
11600      * An example of `webContents.printToPDF`:
11601      *
11602      * See Page.printToPdf for more information.
11603      */
11604     printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
11605     /**
11606      * Executes the editing command `redo` in web page.
11607      */
11608     redo(): void;
11609     /**
11610      * Reloads the current web page.
11611      */
11612     reload(): void;
11613     /**
11614      * Reloads current page and ignores cache.
11615      */
11616     reloadIgnoringCache(): void;
11617     /**
11618      * Resolves if the removal was successful.
11619      *
11620      * Removes the inserted CSS from the current web page. The stylesheet is identified
11621      * by its key, which is returned from `contents.insertCSS(css)`.
11622      */
11623     removeInsertedCSS(key: string): Promise<void>;
11624     /**
11625      * Removes the specified path from DevTools workspace.
11626      */
11627     removeWorkSpace(path: string): void;
11628     /**
11629      * Executes the editing command `replace` in web page.
11630      */
11631     replace(text: string): void;
11632     /**
11633      * Executes the editing command `replaceMisspelling` in web page.
11634      */
11635     replaceMisspelling(text: string): void;
11636     /**
11637      * resolves if the page is saved.
11638      */
11639     savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
11640     /**
11641      * Executes the editing command `selectAll` in web page.
11642      */
11643     selectAll(): void;
11644     /**
11645      * Send an asynchronous message to the renderer process via `channel`, along with
11646      * arguments. Arguments will be serialized with the Structured Clone Algorithm,
11647      * just like `postMessage`, so prototype chains will not be included. Sending
11648      * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
11649      *
11650      * > **NOTE**: Sending non-standard JavaScript types such as DOM objects or special
11651      * Electron objects will throw an exception.
11652      *
11653      * The renderer process can handle the message by listening to `channel` with the
11654      * `ipcRenderer` module.
11655      *
11656      * An example of sending messages from the main process to the renderer process:
11657      */
11658     send(channel: string, ...args: any[]): void;
11659     /**
11660      * Sends an input `event` to the page. **Note:** The `BrowserWindow` containing the
11661      * contents needs to be focused for `sendInputEvent()` to work.
11662      */
11663     sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
11664     /**
11665      * Send an asynchronous message to a specific frame in a renderer process via
11666      * `channel`, along with arguments. Arguments will be serialized with the
11667      * Structured Clone Algorithm, just like `postMessage`, so prototype chains will
11668      * not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets
11669      * will throw an exception.
11670      *
11671      * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
11672      * Electron objects will throw an exception.
11673      *
11674      * The renderer process can handle the message by listening to `channel` with the
11675      * `ipcRenderer` module.
11676      *
11677      * If you want to get the `frameId` of a given renderer context you should use the
11678      * `webFrame.routingId` value.  E.g.
11679      *
11680      * You can also read `frameId` from all incoming IPC messages in the main process.
11681      */
11682     sendToFrame(frameId: (number) | ([number, number]), channel: string, ...args: any[]): void;
11683     /**
11684      * Mute the audio on the current web page.
11685      */
11686     setAudioMuted(muted: boolean): void;
11687     /**
11688      * Controls whether or not this WebContents will throttle animations and timers
11689      * when the page becomes backgrounded. This also affects the Page Visibility API.
11690      */
11691     setBackgroundThrottling(allowed: boolean): void;
11692     /**
11693      * Uses the `devToolsWebContents` as the target `WebContents` to show devtools.
11694      *
11695      * The `devToolsWebContents` must not have done any navigation, and it should not
11696      * be used for other purposes after the call.
11697      *
11698      * By default Electron manages the devtools by creating an internal `WebContents`
11699      * with native view, which developers have very limited control of. With the
11700      * `setDevToolsWebContents` method, developers can use any `WebContents` to show
11701      * the devtools in it, including `BrowserWindow`, `BrowserView` and `<webview>`
11702      * tag.
11703      *
11704      * Note that closing the devtools does not destroy the `devToolsWebContents`, it is
11705      * caller's responsibility to destroy `devToolsWebContents`.
11706      *
11707      * An example of showing devtools in a `<webview>` tag:
11708      *
11709      * An example of showing devtools in a `BrowserWindow`:
11710      */
11711     setDevToolsWebContents(devToolsWebContents: WebContents): void;
11712     /**
11713      * If *offscreen rendering* is enabled sets the frame rate to the specified number.
11714      * Only values between 1 and 240 are accepted.
11715      */
11716     setFrameRate(fps: number): void;
11717     /**
11718      * Ignore application menu shortcuts while this web contents is focused.
11719      */
11720     setIgnoreMenuShortcuts(ignore: boolean): void;
11721     /**
11722      * Sets the image animation policy for this webContents.  The policy only affects
11723      * _new_ images, existing images that are currently being animated are unaffected.
11724      * This is a known limitation in Chromium, you can force image animation to be
11725      * recalculated with `img.src = img.src` which will result in no network traffic
11726      * but will update the animation policy.
11727      *
11728      * This corresponds to the animationPolicy accessibility feature in Chromium.
11729      */
11730     setImageAnimationPolicy(policy: 'animate' | 'animateOnce' | 'noAnimation'): void;
11731     /**
11732      * Overrides the user agent for this web page.
11733      */
11734     setUserAgent(userAgent: string): void;
11735     /**
11736      * Sets the maximum and minimum pinch-to-zoom level.
11737      *
11738      * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
11739      * call:
11740      */
11741     setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
11742     /**
11743      * Setting the WebRTC IP handling policy allows you to control which IPs are
11744      * exposed via WebRTC. See BrowserLeaks for more details.
11745      */
11746     setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
11747     /**
11748      * Called before creating a window a new window is requested by the renderer, e.g.
11749      * by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or
11750      * submitting a form with `<form target="_blank">`. See `window.open()` for more
11751      * details and how to use this in conjunction with `did-create-window`.
11752      */
11753     setWindowOpenHandler(handler: (details: HandlerDetails) => ({action: 'deny'}) | ({action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions})): void;
11754     /**
11755      * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
11756      * divided by 100, so 300% = 3.0.
11757      *
11758      * The factor must be greater than 0.0.
11759      */
11760     setZoomFactor(factor: number): void;
11761     /**
11762      * Changes the zoom level to the specified level. The original size is 0 and each
11763      * increment above or below represents zooming 20% larger or smaller to default
11764      * limits of 300% and 50% of original size, respectively. The formula for this is
11765      * `scale := 1.2 ^ level`.
11766      *
11767      * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
11768      * the zoom level for a specific domain propagates across all instances of windows
11769      * with the same domain. Differentiating the window URLs will make zoom work
11770      * per-window.
11771      */
11772     setZoomLevel(level: number): void;
11773     /**
11774      * Shows pop-up dictionary that searches the selected word on the page.
11775      *
11776      * @platform darwin
11777      */
11778     showDefinitionForSelection(): void;
11779     /**
11780      * Sets the `item` as dragging item for current drag-drop operation, `file` is the
11781      * absolute path of the file to be dragged, and `icon` is the image showing under
11782      * the cursor when dragging.
11783      */
11784     startDrag(item: Item): void;
11785     /**
11786      * If *offscreen rendering* is enabled and not painting, start painting.
11787      */
11788     startPainting(): void;
11789     /**
11790      * Stops any pending navigation.
11791      */
11792     stop(): void;
11793     /**
11794      * Stops any `findInPage` request for the `webContents` with the provided `action`.
11795      */
11796     stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
11797     /**
11798      * If *offscreen rendering* is enabled and painting, stop painting.
11799      */
11800     stopPainting(): void;
11801     /**
11802      * Indicates whether the snapshot has been created successfully.
11803      *
11804      * Takes a V8 heap snapshot and saves it to `filePath`.
11805      */
11806     takeHeapSnapshot(filePath: string): Promise<void>;
11807     /**
11808      * Toggles the developer tools.
11809      */
11810     toggleDevTools(): void;
11811     /**
11812      * Executes the editing command `undo` in web page.
11813      */
11814     undo(): void;
11815     /**
11816      * Executes the editing command `unselect` in web page.
11817      */
11818     unselect(): void;
11819     /**
11820      * A `boolean` property that determines whether this page is muted.
11821      */
11822     audioMuted: boolean;
11823     /**
11824      * A `boolean` property that determines whether or not this WebContents will
11825      * throttle animations and timers when the page becomes backgrounded. This also
11826      * affects the Page Visibility API.
11827      */
11828     backgroundThrottling: boolean;
11829     /**
11830      * A `Debugger` instance for this webContents.
11831      *
11832      */
11833     readonly debugger: Debugger;
11834     /**
11835      * A `WebContents | null` property that represents the of DevTools `WebContents`
11836      * associated with a given `WebContents`.
11837      *
11838      * **Note:** Users should never store this object because it may become `null` when
11839      * the DevTools has been closed.
11840      *
11841      */
11842     readonly devToolsWebContents: (WebContents) | (null);
11843     /**
11844      * An `Integer` property that sets the frame rate of the web contents to the
11845      * specified number. Only values between 1 and 240 are accepted.
11846      *
11847      * Only applicable if *offscreen rendering* is enabled.
11848      */
11849     frameRate: number;
11850     /**
11851      * A `WebContents` instance that might own this `WebContents`.
11852      *
11853      */
11854     readonly hostWebContents: WebContents;
11855     /**
11856      * A `Integer` representing the unique ID of this WebContents. Each ID is unique
11857      * among all `WebContents` instances of the entire Electron application.
11858      *
11859      */
11860     readonly id: number;
11861     /**
11862      * An `IpcMain` scoped to just IPC messages sent from this WebContents.
11863      *
11864      * IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
11865      * `ipcRenderer.postMessage` will be delivered in the following order:
11866      *
11867      * * `contents.on('ipc-message')`
11868      * * `contents.mainFrame.on(channel)`
11869      * * `contents.ipc.on(channel)`
11870      * * `ipcMain.on(channel)`
11871      *
11872      * Handlers registered with `invoke` will be checked in the following order. The
11873      * first one that is defined will be called, the rest will be ignored.
11874      *
11875      * * `contents.mainFrame.handle(channel)`
11876      * * `contents.handle(channel)`
11877      * * `ipcMain.handle(channel)`
11878      *
11879      * A handler or event listener registered on the WebContents will receive IPC
11880      * messages sent from any frame, including child frames. In most cases, only the
11881      * main frame can send IPC messages. However, if the `nodeIntegrationInSubFrames`
11882      * option is enabled, it is possible for child frames to send IPC messages also. In
11883      * that case, handlers should check the `senderFrame` property of the IPC event to
11884      * ensure that the message is coming from the expected frame. Alternatively,
11885      * register handlers on the appropriate frame directly using the `WebFrameMain.ipc`
11886      * interface.
11887      *
11888      */
11889     readonly ipc: IpcMain;
11890     /**
11891      * A `WebFrameMain` property that represents the top frame of the page's frame
11892      * hierarchy.
11893      *
11894      */
11895     readonly mainFrame: WebFrameMain;
11896     /**
11897      * A `WebFrameMain` property that represents the frame that opened this
11898      * WebContents, either with open(), or by navigating a link with a target
11899      * attribute.
11900      *
11901      */
11902     readonly opener: WebFrameMain;
11903     /**
11904      * A `Session` used by this webContents.
11905      *
11906      */
11907     readonly session: Session;
11908     /**
11909      * A `string` property that determines the user agent for this web page.
11910      */
11911     userAgent: string;
11912     /**
11913      * A `number` property that determines the zoom factor for this web contents.
11914      *
11915      * The zoom factor is the zoom percent divided by 100, so 300% = 3.0.
11916      */
11917     zoomFactor: number;
11918     /**
11919      * A `number` property that determines the zoom level for this web contents.
11920      *
11921      * The original size is 0 and each increment above or below represents zooming 20%
11922      * larger or smaller to default limits of 300% and 50% of original size,
11923      * respectively. The formula for this is `scale := 1.2 ^ level`.
11924      */
11925     zoomLevel: number;
11926   }
11927
11928   interface WebFrame extends NodeJS.EventEmitter {
11929
11930     // Docs: https://electronjs.org/docs/api/web-frame
11931
11932     /**
11933      * Attempts to free memory that is no longer being used (like images from a
11934      * previous navigation).
11935      *
11936      * Note that blindly calling this method probably makes Electron slower since it
11937      * will have to refill these emptied caches, you should only call it if an event in
11938      * your app has occurred that makes you think your page is actually using less
11939      * memory (i.e. you have navigated from a super heavy page to a mostly empty one,
11940      * and intend to stay there).
11941      */
11942     clearCache(): void;
11943     /**
11944      * A promise that resolves with the result of the executed code or is rejected if
11945      * execution throws or results in a rejected promise.
11946      *
11947      * Evaluates `code` in page.
11948      *
11949      * In the browser window some HTML APIs like `requestFullScreen` can only be
11950      * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
11951      * this limitation.
11952      */
11953     executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
11954     /**
11955      * A promise that resolves with the result of the executed code or is rejected if
11956      * execution could not start.
11957      *
11958      * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
11959      *
11960      * Note that when the execution of script fails, the returned promise will not
11961      * reject and the `result` would be `undefined`. This is because Chromium does not
11962      * dispatch errors of isolated worlds to foreign worlds.
11963      */
11964     executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
11965     /**
11966      * A child of `webFrame` with the supplied `name`, `null` would be returned if
11967      * there's no such frame or if the frame is not in the current renderer process.
11968      */
11969     findFrameByName(name: string): WebFrame;
11970     /**
11971      * that has the supplied `routingId`, `null` if not found.
11972      */
11973     findFrameByRoutingId(routingId: number): WebFrame;
11974     /**
11975      * The frame element in `webFrame's` document selected by `selector`, `null` would
11976      * be returned if `selector` does not select a frame or if the frame is not in the
11977      * current renderer process.
11978      */
11979     getFrameForSelector(selector: string): WebFrame;
11980     /**
11981      * * `images` MemoryUsageDetails
11982      * * `scripts` MemoryUsageDetails
11983      * * `cssStyleSheets` MemoryUsageDetails
11984      * * `xslStyleSheets` MemoryUsageDetails
11985      * * `fonts` MemoryUsageDetails
11986      * * `other` MemoryUsageDetails
11987      *
11988      * Returns an object describing usage information of Blink's internal memory
11989      * caches.
11990      *
11991      * This will generate:
11992      */
11993     getResourceUsage(): ResourceUsage;
11994     /**
11995      * A list of suggested words for a given word. If the word is spelled correctly,
11996      * the result will be empty.
11997      */
11998     getWordSuggestions(word: string): string[];
11999     /**
12000      * The current zoom factor.
12001      */
12002     getZoomFactor(): number;
12003     /**
12004      * The current zoom level.
12005      */
12006     getZoomLevel(): number;
12007     /**
12008      * A key for the inserted CSS that can later be used to remove the CSS via
12009      * `webFrame.removeInsertedCSS(key)`.
12010      *
12011      * Injects CSS into the current web page and returns a unique key for the inserted
12012      * stylesheet.
12013      */
12014     insertCSS(css: string, options?: InsertCSSOptions): string;
12015     /**
12016      * Inserts `text` to the focused element.
12017      */
12018     insertText(text: string): void;
12019     /**
12020      * True if the word is misspelled according to the built in spellchecker, false
12021      * otherwise. If no dictionary is loaded, always return false.
12022      */
12023     isWordMisspelled(word: string): boolean;
12024     /**
12025      * Removes the inserted CSS from the current web page. The stylesheet is identified
12026      * by its key, which is returned from `webFrame.insertCSS(css)`.
12027      */
12028     removeInsertedCSS(key: string): void;
12029     /**
12030      * Set the security origin, content security policy and name of the isolated world.
12031      * Note: If the `csp` is specified, then the `securityOrigin` also has to be
12032      * specified.
12033      */
12034     setIsolatedWorldInfo(worldId: number, info: Info): void;
12035     /**
12036      * Sets a provider for spell checking in input fields and text areas.
12037      *
12038      * If you want to use this method you must disable the builtin spellchecker when
12039      * you construct the window.
12040      *
12041      * The `provider` must be an object that has a `spellCheck` method that accepts an
12042      * array of individual words for spellchecking. The `spellCheck` function runs
12043      * asynchronously and calls the `callback` function with an array of misspelt words
12044      * when complete.
12045      *
12046      * An example of using node-spellchecker as provider:
12047      */
12048     setSpellCheckProvider(language: string, provider: Provider): void;
12049     /**
12050      * Sets the maximum and minimum pinch-to-zoom level.
12051      *
12052      * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
12053      * call:
12054      *
12055      * > **NOTE**: Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
12056      * shortcuts are controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem
12057      * roles in the application Menu. To disable shortcuts, manually define the Menu
12058      * and omit zoom roles from the definition.
12059      */
12060     setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
12061     /**
12062      * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
12063      * divided by 100, so 300% = 3.0.
12064      *
12065      * The factor must be greater than 0.0.
12066      */
12067     setZoomFactor(factor: number): void;
12068     /**
12069      * Changes the zoom level to the specified level. The original size is 0 and each
12070      * increment above or below represents zooming 20% larger or smaller to default
12071      * limits of 300% and 50% of original size, respectively.
12072      *
12073      * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
12074      * the zoom level for a specific domain propagates across all instances of windows
12075      * with the same domain. Differentiating the window URLs will make zoom work
12076      * per-window.
12077      */
12078     setZoomLevel(level: number): void;
12079     /**
12080      * A `WebFrame | null` representing the first child frame of `webFrame`, the
12081      * property would be `null` if `webFrame` has no children or if first child is not
12082      * in the current renderer process.
12083      *
12084      */
12085     readonly firstChild: (WebFrame) | (null);
12086     /**
12087      * A `WebFrame | null` representing next sibling frame, the property would be
12088      * `null` if `webFrame` is the last frame in its parent or if the next sibling is
12089      * not in the current renderer process.
12090      *
12091      */
12092     readonly nextSibling: (WebFrame) | (null);
12093     /**
12094      * A `WebFrame | null` representing the frame which opened `webFrame`, the property
12095      * would be `null` if there's no opener or opener is not in the current renderer
12096      * process.
12097      *
12098      */
12099     readonly opener: (WebFrame) | (null);
12100     /**
12101      * A `WebFrame | null` representing parent frame of `webFrame`, the property would
12102      * be `null` if `webFrame` is top or parent is not in the current renderer process.
12103      *
12104      */
12105     readonly parent: (WebFrame) | (null);
12106     /**
12107      * An `Integer` representing the unique frame id in the current renderer process.
12108      * Distinct WebFrame instances that refer to the same underlying frame will have
12109      * the same `routingId`.
12110      *
12111      */
12112     readonly routingId: number;
12113     /**
12114      * A `WebFrame | null` representing top frame in frame hierarchy to which
12115      * `webFrame` belongs, the property would be `null` if top frame is not in the
12116      * current renderer process.
12117      *
12118      */
12119     readonly top: (WebFrame) | (null);
12120   }
12121
12122   class WebFrameMain extends NodeEventEmitter {
12123
12124     // Docs: https://electronjs.org/docs/api/web-frame-main
12125
12126     /**
12127      * A frame with the given process and routing IDs, or `undefined` if there is no
12128      * WebFrameMain associated with the given IDs.
12129      */
12130     static fromId(processId: number, routingId: number): (WebFrameMain) | (undefined);
12131     /**
12132      * Emitted when the document is loaded.
12133      */
12134     on(event: 'dom-ready', listener: Function): this;
12135     once(event: 'dom-ready', listener: Function): this;
12136     addListener(event: 'dom-ready', listener: Function): this;
12137     removeListener(event: 'dom-ready', listener: Function): this;
12138     /**
12139      * A promise that resolves with the result of the executed code or is rejected if
12140      * execution throws or results in a rejected promise.
12141      *
12142      * Evaluates `code` in page.
12143      *
12144      * In the browser window some HTML APIs like `requestFullScreen` can only be
12145      * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
12146      * this limitation.
12147      */
12148     executeJavaScript(code: string, userGesture?: boolean): Promise<unknown>;
12149     /**
12150      * Send a message to the renderer process, optionally transferring ownership of
12151      * zero or more `MessagePortMain` objects.
12152      *
12153      * The transferred `MessagePortMain` objects will be available in the renderer
12154      * process by accessing the `ports` property of the emitted event. When they arrive
12155      * in the renderer, they will be native DOM `MessagePort` objects.
12156      *
12157      * For example:
12158      */
12159     postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
12160     /**
12161      * Whether the reload was initiated successfully. Only results in `false` when the
12162      * frame has no history.
12163      */
12164     reload(): boolean;
12165     /**
12166      * Send an asynchronous message to the renderer process via `channel`, along with
12167      * arguments. Arguments will be serialized with the Structured Clone Algorithm,
12168      * just like `postMessage`, so prototype chains will not be included. Sending
12169      * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
12170      *
12171      * The renderer process can handle the message by listening to `channel` with the
12172      * `ipcRenderer` module.
12173      */
12174     send(channel: string, ...args: any[]): void;
12175     /**
12176      * A `WebFrameMain[]` collection containing the direct descendents of `frame`.
12177      *
12178      */
12179     readonly frames: WebFrameMain[];
12180     /**
12181      * A `WebFrameMain[]` collection containing every frame in the subtree of `frame`,
12182      * including itself. This can be useful when traversing through all frames.
12183      *
12184      */
12185     readonly framesInSubtree: WebFrameMain[];
12186     /**
12187      * An `Integer` representing the id of the frame's internal FrameTreeNode instance.
12188      * This id is browser-global and uniquely identifies a frame that hosts content.
12189      * The identifier is fixed at the creation of the frame and stays constant for the
12190      * lifetime of the frame. When the frame is removed, the id is not used again.
12191      *
12192      */
12193     readonly frameTreeNodeId: number;
12194     /**
12195      * An `IpcMain` instance scoped to the frame.
12196      *
12197      * IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
12198      * `ipcRenderer.postMessage` will be delivered in the following order:
12199      *
12200      * * `contents.on('ipc-message')`
12201      * * `contents.mainFrame.on(channel)`
12202      * * `contents.ipc.on(channel)`
12203      * * `ipcMain.on(channel)`
12204      *
12205      * Handlers registered with `invoke` will be checked in the following order. The
12206      * first one that is defined will be called, the rest will be ignored.
12207      *
12208      * * `contents.mainFrame.handle(channel)`
12209      * * `contents.handle(channel)`
12210      * * `ipcMain.handle(channel)`
12211      *
12212      * In most cases, only the main frame of a WebContents can send or receive IPC
12213      * messages. However, if the `nodeIntegrationInSubFrames` option is enabled, it is
12214      * possible for child frames to send and receive IPC messages also. The
12215      * `WebContents.ipc` interface may be more convenient when
12216      * `nodeIntegrationInSubFrames` is not enabled.
12217      *
12218      */
12219     readonly ipc: IpcMain;
12220     /**
12221      * A `string` representing the frame name.
12222      *
12223      */
12224     readonly name: string;
12225     /**
12226      * A `string` representing the current origin of the frame, serialized according to
12227      * RFC 6454. This may be different from the URL. For instance, if the frame is a
12228      * child window opened to `about:blank`, then `frame.origin` will return the parent
12229      * frame's origin, while `frame.url` will return the empty string. Pages without a
12230      * scheme/host/port triple origin will have the serialized origin of `"null"` (that
12231      * is, the string containing the letters n, u, l, l).
12232      *
12233      */
12234     readonly origin: string;
12235     /**
12236      * An `Integer` representing the operating system `pid` of the process which owns
12237      * this frame.
12238      *
12239      */
12240     readonly osProcessId: number;
12241     /**
12242      * A `WebFrameMain | null` representing parent frame of `frame`, the property would
12243      * be `null` if `frame` is the top frame in the frame hierarchy.
12244      *
12245      */
12246     readonly parent: (WebFrameMain) | (null);
12247     /**
12248      * An `Integer` representing the Chromium internal `pid` of the process which owns
12249      * this frame. This is not the same as the OS process ID; to read that use
12250      * `frame.osProcessId`.
12251      *
12252      */
12253     readonly processId: number;
12254     /**
12255      * An `Integer` representing the unique frame id in the current renderer process.
12256      * Distinct `WebFrameMain` instances that refer to the same underlying frame will
12257      * have the same `routingId`.
12258      *
12259      */
12260     readonly routingId: number;
12261     /**
12262      * A `WebFrameMain | null` representing top frame in the frame hierarchy to which
12263      * `frame` belongs.
12264      *
12265      */
12266     readonly top: (WebFrameMain) | (null);
12267     /**
12268      * A `string` representing the current URL of the frame.
12269      *
12270      */
12271     readonly url: string;
12272     /**
12273      * A `string` representing the visibility state of the frame.
12274      *
12275      * See also how the Page Visibility API is affected by other Electron APIs.
12276      *
12277      */
12278     readonly visibilityState: string;
12279   }
12280
12281   class WebRequest {
12282
12283     // Docs: https://electronjs.org/docs/api/web-request
12284
12285     /**
12286      * The `listener` will be called with `listener(details)` when a server initiated
12287      * redirect is about to occur.
12288      */
12289     onBeforeRedirect(filter: WebRequestFilter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
12290     /**
12291      * The `listener` will be called with `listener(details)` when a server initiated
12292      * redirect is about to occur.
12293      */
12294     onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
12295     /**
12296      * The `listener` will be called with `listener(details, callback)` when a request
12297      * is about to occur.
12298      *
12299      * The `uploadData` is an array of `UploadData` objects.
12300      *
12301      * The `callback` has to be called with an `response` object.
12302      *
12303      * Some examples of valid `urls`:
12304      */
12305     onBeforeRequest(filter: WebRequestFilter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
12306     /**
12307      * The `listener` will be called with `listener(details, callback)` when a request
12308      * is about to occur.
12309      *
12310      * The `uploadData` is an array of `UploadData` objects.
12311      *
12312      * The `callback` has to be called with an `response` object.
12313      *
12314      * Some examples of valid `urls`:
12315      */
12316     onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
12317     /**
12318      * The `listener` will be called with `listener(details, callback)` before sending
12319      * an HTTP request, once the request headers are available. This may occur after a
12320      * TCP connection is made to the server, but before any http data is sent.
12321      *
12322      * The `callback` has to be called with a `response` object.
12323      */
12324     onBeforeSendHeaders(filter: WebRequestFilter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
12325     /**
12326      * The `listener` will be called with `listener(details, callback)` before sending
12327      * an HTTP request, once the request headers are available. This may occur after a
12328      * TCP connection is made to the server, but before any http data is sent.
12329      *
12330      * The `callback` has to be called with a `response` object.
12331      */
12332     onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
12333     /**
12334      * The `listener` will be called with `listener(details)` when a request is
12335      * completed.
12336      */
12337     onCompleted(filter: WebRequestFilter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
12338     /**
12339      * The `listener` will be called with `listener(details)` when a request is
12340      * completed.
12341      */
12342     onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
12343     /**
12344      * The `listener` will be called with `listener(details)` when an error occurs.
12345      */
12346     onErrorOccurred(filter: WebRequestFilter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
12347     /**
12348      * The `listener` will be called with `listener(details)` when an error occurs.
12349      */
12350     onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
12351     /**
12352      * The `listener` will be called with `listener(details, callback)` when HTTP
12353      * response headers of a request have been received.
12354      *
12355      * The `callback` has to be called with a `response` object.
12356      */
12357     onHeadersReceived(filter: WebRequestFilter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
12358     /**
12359      * The `listener` will be called with `listener(details, callback)` when HTTP
12360      * response headers of a request have been received.
12361      *
12362      * The `callback` has to be called with a `response` object.
12363      */
12364     onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
12365     /**
12366      * The `listener` will be called with `listener(details)` when first byte of the
12367      * response body is received. For HTTP requests, this means that the status line
12368      * and response headers are available.
12369      */
12370     onResponseStarted(filter: WebRequestFilter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
12371     /**
12372      * The `listener` will be called with `listener(details)` when first byte of the
12373      * response body is received. For HTTP requests, this means that the status line
12374      * and response headers are available.
12375      */
12376     onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
12377     /**
12378      * The `listener` will be called with `listener(details)` just before a request is
12379      * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
12380      * response are visible by the time this listener is fired.
12381      */
12382     onSendHeaders(filter: WebRequestFilter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
12383     /**
12384      * The `listener` will be called with `listener(details)` just before a request is
12385      * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
12386      * response are visible by the time this listener is fired.
12387      */
12388     onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
12389   }
12390
12391   interface WebRequestFilter {
12392
12393     // Docs: https://electronjs.org/docs/api/structures/web-request-filter
12394
12395     /**
12396      * Array of URL patterns that will be used to filter out the requests that do not
12397      * match the URL patterns.
12398      */
12399     urls: string[];
12400   }
12401
12402   interface WebSource {
12403
12404     // Docs: https://electronjs.org/docs/api/structures/web-source
12405
12406     code: string;
12407     url?: string;
12408   }
12409
12410   interface WebviewTag extends HTMLElement {
12411
12412     // Docs: https://electronjs.org/docs/api/webview-tag
12413
12414     /**
12415      * Fired when a load has committed. This includes navigation within the current
12416      * document as well as subframe document-level loads, but does not include
12417      * asynchronous resource loads.
12418      */
12419     addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
12420     removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
12421     /**
12422      * Fired when the navigation is done, i.e. the spinner of the tab will stop
12423      * spinning, and the `onload` event is dispatched.
12424      */
12425     addEventListener(event: 'did-finish-load', listener: (event: Event) => void, useCapture?: boolean): this;
12426     removeEventListener(event: 'did-finish-load', listener: (event: Event) => void): this;
12427     /**
12428      * This event is like `did-finish-load`, but fired when the load failed or was
12429      * cancelled, e.g. `window.stop()` is invoked.
12430      */
12431     addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
12432     removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
12433     /**
12434      * Fired when a frame has done navigation.
12435      */
12436     addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
12437     removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
12438     /**
12439      * Corresponds to the points in time when the spinner of the tab starts spinning.
12440      */
12441     addEventListener(event: 'did-start-loading', listener: (event: Event) => void, useCapture?: boolean): this;
12442     removeEventListener(event: 'did-start-loading', listener: (event: Event) => void): this;
12443     /**
12444      * Corresponds to the points in time when the spinner of the tab stops spinning.
12445      */
12446     addEventListener(event: 'did-stop-loading', listener: (event: Event) => void, useCapture?: boolean): this;
12447     removeEventListener(event: 'did-stop-loading', listener: (event: Event) => void): this;
12448     /**
12449      * Fired when attached to the embedder web contents.
12450      */
12451     addEventListener(event: 'did-attach', listener: (event: Event) => void, useCapture?: boolean): this;
12452     removeEventListener(event: 'did-attach', listener: (event: Event) => void): this;
12453     /**
12454      * Fired when document in the given frame is loaded.
12455      */
12456     addEventListener(event: 'dom-ready', listener: (event: Event) => void, useCapture?: boolean): this;
12457     removeEventListener(event: 'dom-ready', listener: (event: Event) => void): this;
12458     /**
12459      * Fired when page title is set during navigation. `explicitSet` is false when
12460      * title is synthesized from file url.
12461      */
12462     addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
12463     removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
12464     /**
12465      * Fired when page receives favicon urls.
12466      */
12467     addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
12468     removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
12469     /**
12470      * Fired when page enters fullscreen triggered by HTML API.
12471      */
12472     addEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
12473     removeEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void): this;
12474     /**
12475      * Fired when page leaves fullscreen triggered by HTML API.
12476      */
12477     addEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
12478     removeEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void): this;
12479     /**
12480      * Fired when the guest window logs a console message.
12481      *
12482      * The following example code forwards all log messages to the embedder's console
12483      * without regard for log level or other properties.
12484      */
12485     addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
12486     removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
12487     /**
12488      * Fired when a result is available for `webview.findInPage` request.
12489      */
12490     addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
12491     removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
12492     /**
12493      * Emitted when a user or the page wants to start navigation. It can happen when
12494      * the `window.location` object is changed or a user clicks a link in the page.
12495      *
12496      * This event will not emit when the navigation is started programmatically with
12497      * APIs like `<webview>.loadURL` and `<webview>.back`.
12498      *
12499      * It is also not emitted during in-page navigation, such as clicking anchor links
12500      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
12501      * this purpose.
12502      *
12503      * Calling `event.preventDefault()` does __NOT__ have any effect.
12504      */
12505     addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
12506     removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
12507     /**
12508      * Emitted when any frame (including main) starts navigating. `isInPlace` will be
12509      * `true` for in-page navigations.
12510      */
12511     addEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void, useCapture?: boolean): this;
12512     removeEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void): this;
12513     /**
12514      * Emitted after a server side redirect occurs during navigation. For example a 302
12515      * redirect.
12516      */
12517     addEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void, useCapture?: boolean): this;
12518     removeEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void): this;
12519     /**
12520      * Emitted when a navigation is done.
12521      *
12522      * This event is not emitted for in-page navigations, such as clicking anchor links
12523      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
12524      * this purpose.
12525      */
12526     addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
12527     removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
12528     /**
12529      * Emitted when any frame navigation is done.
12530      *
12531      * This event is not emitted for in-page navigations, such as clicking anchor links
12532      * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
12533      * this purpose.
12534      */
12535     addEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void, useCapture?: boolean): this;
12536     removeEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void): this;
12537     /**
12538      * Emitted when an in-page navigation happened.
12539      *
12540      * When in-page navigation happens, the page URL changes but does not cause
12541      * navigation outside of the page. Examples of this occurring are when anchor links
12542      * are clicked or when the DOM `hashchange` event is triggered.
12543      */
12544     addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
12545     removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
12546     /**
12547      * Fired when the guest page attempts to close itself.
12548      *
12549      * The following example code navigates the `webview` to `about:blank` when the
12550      * guest attempts to close itself.
12551      */
12552     addEventListener(event: 'close', listener: (event: Event) => void, useCapture?: boolean): this;
12553     removeEventListener(event: 'close', listener: (event: Event) => void): this;
12554     /**
12555      * Fired when the guest page has sent an asynchronous message to embedder page.
12556      *
12557      * With `sendToHost` method and `ipc-message` event you can communicate between
12558      * guest page and embedder page:
12559      */
12560     addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
12561     removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
12562     /**
12563      * Fired when the renderer process is crashed.
12564      */
12565     addEventListener(event: 'crashed', listener: (event: Event) => void, useCapture?: boolean): this;
12566     removeEventListener(event: 'crashed', listener: (event: Event) => void): this;
12567     /**
12568      * Fired when a plugin process is crashed.
12569      */
12570     addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
12571     removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
12572     /**
12573      * Fired when the WebContents is destroyed.
12574      */
12575     addEventListener(event: 'destroyed', listener: (event: Event) => void, useCapture?: boolean): this;
12576     removeEventListener(event: 'destroyed', listener: (event: Event) => void): this;
12577     /**
12578      * Emitted when media starts playing.
12579      */
12580     addEventListener(event: 'media-started-playing', listener: (event: Event) => void, useCapture?: boolean): this;
12581     removeEventListener(event: 'media-started-playing', listener: (event: Event) => void): this;
12582     /**
12583      * Emitted when media is paused or done playing.
12584      */
12585     addEventListener(event: 'media-paused', listener: (event: Event) => void, useCapture?: boolean): this;
12586     removeEventListener(event: 'media-paused', listener: (event: Event) => void): this;
12587     /**
12588      * Emitted when a page's theme color changes. This is usually due to encountering a
12589      * meta tag:
12590      */
12591     addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
12592     removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
12593     /**
12594      * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
12595      */
12596     addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
12597     removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
12598     /**
12599      * Emitted when DevTools is opened.
12600      */
12601     addEventListener(event: 'devtools-opened', listener: (event: Event) => void, useCapture?: boolean): this;
12602     removeEventListener(event: 'devtools-opened', listener: (event: Event) => void): this;
12603     /**
12604      * Emitted when DevTools is closed.
12605      */
12606     addEventListener(event: 'devtools-closed', listener: (event: Event) => void, useCapture?: boolean): this;
12607     removeEventListener(event: 'devtools-closed', listener: (event: Event) => void): this;
12608     /**
12609      * Emitted when DevTools is focused / opened.
12610      */
12611     addEventListener(event: 'devtools-focused', listener: (event: Event) => void, useCapture?: boolean): this;
12612     removeEventListener(event: 'devtools-focused', listener: (event: Event) => void): this;
12613     /**
12614      * Emitted when there is a new context menu that needs to be handled.
12615      */
12616     addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
12617     removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
12618     addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
12619     addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
12620     removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
12621     removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
12622     /**
12623      * Whether the guest page can go back.
12624      */
12625     canGoBack(): boolean;
12626     /**
12627      * Whether the guest page can go forward.
12628      */
12629     canGoForward(): boolean;
12630     /**
12631      * Whether the guest page can go to `offset`.
12632      */
12633     canGoToOffset(offset: number): boolean;
12634     /**
12635      * Resolves with a NativeImage
12636      *
12637      * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
12638      * whole visible page.
12639      */
12640     capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
12641     /**
12642      * Clears the navigation history.
12643      */
12644     clearHistory(): void;
12645     /**
12646      * Closes the DevTools window of guest page.
12647      */
12648     closeDevTools(): void;
12649     /**
12650      * Executes editing command `copy` in page.
12651      */
12652     copy(): void;
12653     /**
12654      * Executes editing command `cut` in page.
12655      */
12656     cut(): void;
12657     /**
12658      * Executes editing command `delete` in page.
12659      */
12660     delete(): void;
12661     /**
12662      * Initiates a download of the resource at `url` without navigating.
12663      */
12664     downloadURL(url: string): void;
12665     /**
12666      * A promise that resolves with the result of the executed code or is rejected if
12667      * the result of the code is a rejected promise.
12668      *
12669      * Evaluates `code` in page. If `userGesture` is set, it will create the user
12670      * gesture context in the page. HTML APIs like `requestFullScreen`, which require
12671      * user action, can take advantage of this option for automation.
12672      */
12673     executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
12674     /**
12675      * The request id used for the request.
12676      *
12677      * Starts a request to find all matches for the `text` in the web page. The result
12678      * of the request can be obtained by subscribing to `found-in-page` event.
12679      */
12680     findInPage(text: string, options?: FindInPageOptions): number;
12681     /**
12682      * The title of guest page.
12683      */
12684     getTitle(): string;
12685     /**
12686      * The URL of guest page.
12687      */
12688     getURL(): string;
12689     /**
12690      * The user agent for guest page.
12691      */
12692     getUserAgent(): string;
12693     /**
12694      * The WebContents ID of this `webview`.
12695      */
12696     getWebContentsId(): number;
12697     /**
12698      * the current zoom factor.
12699      */
12700     getZoomFactor(): number;
12701     /**
12702      * the current zoom level.
12703      */
12704     getZoomLevel(): number;
12705     /**
12706      * Makes the guest page go back.
12707      */
12708     goBack(): void;
12709     /**
12710      * Makes the guest page go forward.
12711      */
12712     goForward(): void;
12713     /**
12714      * Navigates to the specified absolute index.
12715      */
12716     goToIndex(index: number): void;
12717     /**
12718      * Navigates to the specified offset from the "current entry".
12719      */
12720     goToOffset(offset: number): void;
12721     /**
12722      * A promise that resolves with a key for the inserted CSS that can later be used
12723      * to remove the CSS via `<webview>.removeInsertedCSS(key)`.
12724      *
12725      * Injects CSS into the current web page and returns a unique key for the inserted
12726      * stylesheet.
12727      */
12728     insertCSS(css: string): Promise<string>;
12729     /**
12730      * Inserts `text` to the focused element.
12731      */
12732     insertText(text: string): Promise<void>;
12733     /**
12734      * Starts inspecting element at position (`x`, `y`) of guest page.
12735      */
12736     inspectElement(x: number, y: number): void;
12737     /**
12738      * Opens the DevTools for the service worker context present in the guest page.
12739      */
12740     inspectServiceWorker(): void;
12741     /**
12742      * Opens the DevTools for the shared worker context present in the guest page.
12743      */
12744     inspectSharedWorker(): void;
12745     /**
12746      * Whether guest page has been muted.
12747      */
12748     isAudioMuted(): boolean;
12749     /**
12750      * Whether the renderer process has crashed.
12751      */
12752     isCrashed(): boolean;
12753     /**
12754      * Whether audio is currently playing.
12755      */
12756     isCurrentlyAudible(): boolean;
12757     /**
12758      * Whether DevTools window of guest page is focused.
12759      */
12760     isDevToolsFocused(): boolean;
12761     /**
12762      * Whether guest page has a DevTools window attached.
12763      */
12764     isDevToolsOpened(): boolean;
12765     /**
12766      * Whether guest page is still loading resources.
12767      */
12768     isLoading(): boolean;
12769     /**
12770      * Whether the main frame (and not just iframes or frames within it) is still
12771      * loading.
12772      */
12773     isLoadingMainFrame(): boolean;
12774     /**
12775      * Whether the guest page is waiting for a first-response for the main resource of
12776      * the page.
12777      */
12778     isWaitingForResponse(): boolean;
12779     /**
12780      * The promise will resolve when the page has finished loading (see
12781      * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
12782      *
12783      * Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
12784      * the `http://` or `file://`.
12785      */
12786     loadURL(url: string, options?: LoadURLOptions): Promise<void>;
12787     /**
12788      * Opens a DevTools window for guest page.
12789      */
12790     openDevTools(): void;
12791     /**
12792      * Executes editing command `paste` in page.
12793      */
12794     paste(): void;
12795     /**
12796      * Executes editing command `pasteAndMatchStyle` in page.
12797      */
12798     pasteAndMatchStyle(): void;
12799     /**
12800      * Prints `webview`'s web page. Same as `webContents.print([options])`.
12801      */
12802     print(options?: WebviewTagPrintOptions): Promise<void>;
12803     /**
12804      * Resolves with the generated PDF data.
12805      *
12806      * Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
12807      */
12808     printToPDF(options: PrintToPDFOptions): Promise<Uint8Array>;
12809     /**
12810      * Executes editing command `redo` in page.
12811      */
12812     redo(): void;
12813     /**
12814      * Reloads the guest page.
12815      */
12816     reload(): void;
12817     /**
12818      * Reloads the guest page and ignores cache.
12819      */
12820     reloadIgnoringCache(): void;
12821     /**
12822      * Resolves if the removal was successful.
12823      *
12824      * Removes the inserted CSS from the current web page. The stylesheet is identified
12825      * by its key, which is returned from `<webview>.insertCSS(css)`.
12826      */
12827     removeInsertedCSS(key: string): Promise<void>;
12828     /**
12829      * Executes editing command `replace` in page.
12830      */
12831     replace(text: string): void;
12832     /**
12833      * Executes editing command `replaceMisspelling` in page.
12834      */
12835     replaceMisspelling(text: string): void;
12836     /**
12837      * Executes editing command `selectAll` in page.
12838      */
12839     selectAll(): void;
12840     /**
12841      * Send an asynchronous message to renderer process via `channel`, you can also
12842      * send arbitrary arguments. The renderer process can handle the message by
12843      * listening to the `channel` event with the `ipcRenderer` module.
12844      *
12845      * See webContents.send for examples.
12846      */
12847     send(channel: string, ...args: any[]): Promise<void>;
12848     /**
12849      * Sends an input `event` to the page.
12850      *
12851      * See webContents.sendInputEvent for detailed description of `event` object.
12852      */
12853     sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
12854     /**
12855      * Send an asynchronous message to renderer process via `channel`, you can also
12856      * send arbitrary arguments. The renderer process can handle the message by
12857      * listening to the `channel` event with the `ipcRenderer` module.
12858      *
12859      * See webContents.sendToFrame for examples.
12860      */
12861     sendToFrame(frameId: [number, number], channel: string, ...args: any[]): Promise<void>;
12862     /**
12863      * Set guest page muted.
12864      */
12865     setAudioMuted(muted: boolean): void;
12866     /**
12867      * Overrides the user agent for the guest page.
12868      */
12869     setUserAgent(userAgent: string): void;
12870     /**
12871      * Sets the maximum and minimum pinch-to-zoom level.
12872      */
12873     setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
12874     /**
12875      * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
12876      * divided by 100, so 300% = 3.0.
12877      */
12878     setZoomFactor(factor: number): void;
12879     /**
12880      * Changes the zoom level to the specified level. The original size is 0 and each
12881      * increment above or below represents zooming 20% larger or smaller to default
12882      * limits of 300% and 50% of original size, respectively. The formula for this is
12883      * `scale := 1.2 ^ level`.
12884      *
12885      * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
12886      * the zoom level for a specific domain propagates across all instances of windows
12887      * with the same domain. Differentiating the window URLs will make zoom work
12888      * per-window.
12889      */
12890     setZoomLevel(level: number): void;
12891     /**
12892      * Shows pop-up dictionary that searches the selected word on the page.
12893      *
12894      * @platform darwin
12895      */
12896     showDefinitionForSelection(): void;
12897     /**
12898      * Stops any pending navigation.
12899      */
12900     stop(): void;
12901     /**
12902      * Stops any `findInPage` request for the `webview` with the provided `action`.
12903      */
12904     stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
12905     /**
12906      * Executes editing command `undo` in page.
12907      */
12908     undo(): void;
12909     /**
12910      * Executes editing command `unselect` in page.
12911      */
12912     unselect(): void;
12913     /**
12914      * A `boolean`. When this attribute is present the guest page will be allowed to
12915      * open new windows. Popups are disabled by default.
12916      */
12917     allowpopups: boolean;
12918     /**
12919      * A `string` which is a list of strings which specifies the blink features to be
12920      * disabled separated by `,`. The full list of supported feature strings can be
12921      * found in the RuntimeEnabledFeatures.json5 file.
12922      */
12923     disableblinkfeatures: string;
12924     /**
12925      * A `boolean`. When this attribute is present the guest page will have web
12926      * security disabled. Web security is enabled by default.
12927      */
12928     disablewebsecurity: boolean;
12929     /**
12930      * A `string` which is a list of strings which specifies the blink features to be
12931      * enabled separated by `,`. The full list of supported feature strings can be
12932      * found in the RuntimeEnabledFeatures.json5 file.
12933      */
12934     enableblinkfeatures: string;
12935     /**
12936      * A `string` that sets the referrer URL for the guest page.
12937      */
12938     httpreferrer: string;
12939     /**
12940      * A `boolean`. When this attribute is present the guest page in `webview` will
12941      * have node integration and can use node APIs like `require` and `process` to
12942      * access low level system resources. Node integration is disabled by default in
12943      * the guest page.
12944      */
12945     nodeintegration: boolean;
12946     /**
12947      * A `boolean` for the experimental option for enabling NodeJS support in
12948      * sub-frames such as iframes inside the `webview`. All your preloads will load for
12949      * every iframe, you can use `process.isMainFrame` to determine if you are in the
12950      * main frame or not. This option is disabled by default in the guest page.
12951      */
12952     nodeintegrationinsubframes: boolean;
12953     /**
12954      * A `string` that sets the session used by the page. If `partition` starts with
12955      * `persist:`, the page will use a persistent session available to all pages in the
12956      * app with the same `partition`. if there is no `persist:` prefix, the page will
12957      * use an in-memory session. By assigning the same `partition`, multiple pages can
12958      * share the same session. If the `partition` is unset then default session of the
12959      * app will be used.
12960      *
12961      * This value can only be modified before the first navigation, since the session
12962      * of an active renderer process cannot change. Subsequent attempts to modify the
12963      * value will fail with a DOM exception.
12964      */
12965     partition: string;
12966     /**
12967      * A `boolean`. When this attribute is present the guest page in `webview` will be
12968      * able to use browser plugins. Plugins are disabled by default.
12969      */
12970     plugins: boolean;
12971     /**
12972      * A `string` that specifies a script that will be loaded before other scripts run
12973      * in the guest page. The protocol of script's URL must be `file:` (even when using
12974      * `asar:` archives) because it will be loaded by Node's `require` under the hood,
12975      * which treats `asar:` archives as virtual directories.
12976      *
12977      * When the guest page doesn't have node integration this script will still have
12978      * access to all Node APIs, but global objects injected by Node will be deleted
12979      * after this script has finished executing.
12980      */
12981     preload: string;
12982     /**
12983      * A `string` representing the visible URL. Writing to this attribute initiates
12984      * top-level navigation.
12985      *
12986      * Assigning `src` its own value will reload the current page.
12987      *
12988      * The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
12989      * world!`.
12990      */
12991     src: string;
12992     /**
12993      * A `string` that sets the user agent for the guest page before the page is
12994      * navigated to. Once the page is loaded, use the `setUserAgent` method to change
12995      * the user agent.
12996      */
12997     useragent: string;
12998     /**
12999      * A `string` which is a comma separated list of strings which specifies the web
13000      * preferences to be set on the webview. The full list of supported preference
13001      * strings can be found in BrowserWindow.
13002      *
13003      * The string follows the same format as the features string in `window.open`. A
13004      * name by itself is given a `true` boolean value. A preference can be set to
13005      * another value by including an `=`, followed by the value. Special values `yes`
13006      * and `1` are interpreted as `true`, while `no` and `0` are interpreted as
13007      * `false`.
13008      */
13009     webpreferences: string;
13010   }
13011
13012   interface AboutPanelOptionsOptions {
13013     /**
13014      * The app's name.
13015      */
13016     applicationName?: string;
13017     /**
13018      * The app's version.
13019      */
13020     applicationVersion?: string;
13021     /**
13022      * Copyright information.
13023      */
13024     copyright?: string;
13025     /**
13026      * The app's build version number.
13027      *
13028      * @platform darwin
13029      */
13030     version?: string;
13031     /**
13032      * Credit information.
13033      *
13034      * @platform darwin,win32
13035      */
13036     credits?: string;
13037     /**
13038      * List of app authors.
13039      *
13040      * @platform linux
13041      */
13042     authors?: string[];
13043     /**
13044      * The app's website.
13045      *
13046      * @platform linux
13047      */
13048     website?: string;
13049     /**
13050      * Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as
13051      * 64x64 pixels while retaining aspect ratio.
13052      *
13053      * @platform linux,win32
13054      */
13055     iconPath?: string;
13056   }
13057
13058   interface AddRepresentationOptions {
13059     /**
13060      * The scale factor to add the image representation for.
13061      */
13062     scaleFactor?: number;
13063     /**
13064      * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
13065      */
13066     width?: number;
13067     /**
13068      * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
13069      */
13070     height?: number;
13071     /**
13072      * The buffer containing the raw image data.
13073      */
13074     buffer?: Buffer;
13075     /**
13076      * The data URL containing either a base 64 encoded PNG or JPEG image.
13077      */
13078     dataURL?: string;
13079   }
13080
13081   interface AnimationSettings {
13082     /**
13083      * Returns true if rich animations should be rendered. Looks at session type (e.g.
13084      * remote desktop) and accessibility settings to give guidance for heavy
13085      * animations.
13086      */
13087     shouldRenderRichAnimation: boolean;
13088     /**
13089      * Determines on a per-platform basis whether scroll animations (e.g. produced by
13090      * home/end key) should be enabled.
13091      */
13092     scrollAnimationsEnabledBySystem: boolean;
13093     /**
13094      * Determines whether the user desires reduced motion based on platform APIs.
13095      */
13096     prefersReducedMotion: boolean;
13097   }
13098
13099   interface AppDetailsOptions {
13100     /**
13101      * Window's App User Model ID. It has to be set, otherwise the other options will
13102      * have no effect.
13103      */
13104     appId?: string;
13105     /**
13106      * Window's Relaunch Icon.
13107      */
13108     appIconPath?: string;
13109     /**
13110      * Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
13111      * Default is `0`.
13112      */
13113     appIconIndex?: number;
13114     /**
13115      * Window's Relaunch Command.
13116      */
13117     relaunchCommand?: string;
13118     /**
13119      * Window's Relaunch Display Name.
13120      */
13121     relaunchDisplayName?: string;
13122   }
13123
13124   interface ApplicationInfoForProtocolReturnValue {
13125     /**
13126      * the display icon of the app handling the protocol.
13127      */
13128     icon: NativeImage;
13129     /**
13130      * installation path of the app handling the protocol.
13131      */
13132     path: string;
13133     /**
13134      * display name of the app handling the protocol.
13135      */
13136     name: string;
13137   }
13138
13139   interface AuthenticationResponseDetails {
13140     url: string;
13141   }
13142
13143   interface AuthInfo {
13144     isProxy: boolean;
13145     scheme: string;
13146     host: string;
13147     port: number;
13148     realm: string;
13149   }
13150
13151   interface AutoResizeOptions {
13152     /**
13153      * If `true`, the view's width will grow and shrink together with the window.
13154      * `false` by default.
13155      */
13156     width?: boolean;
13157     /**
13158      * If `true`, the view's height will grow and shrink together with the window.
13159      * `false` by default.
13160      */
13161     height?: boolean;
13162     /**
13163      * If `true`, the view's x position and width will grow and shrink proportionally
13164      * with the window. `false` by default.
13165      */
13166     horizontal?: boolean;
13167     /**
13168      * If `true`, the view's y position and height will grow and shrink proportionally
13169      * with the window. `false` by default.
13170      */
13171     vertical?: boolean;
13172   }
13173
13174   interface BeforeSendResponse {
13175     cancel?: boolean;
13176     /**
13177      * When provided, request will be made with these headers.
13178      */
13179     requestHeaders?: Record<string, (string) | (string[])>;
13180   }
13181
13182   interface BitmapOptions {
13183     /**
13184      * Defaults to 1.0.
13185      */
13186     scaleFactor?: number;
13187   }
13188
13189   interface BlinkMemoryInfo {
13190     /**
13191      * Size of all allocated objects in Kilobytes.
13192      */
13193     allocated: number;
13194     /**
13195      * Total allocated space in Kilobytes.
13196      */
13197     total: number;
13198   }
13199
13200   interface BluetoothPairingHandlerHandlerDetails {
13201     deviceId: string;
13202     /**
13203      * The type of pairing prompt being requested. One of the following values:
13204      */
13205     pairingKind: ('confirm' | 'confirmPin' | 'providePin');
13206     frame: WebFrameMain;
13207     /**
13208      * The pin value to verify if `pairingKind` is `confirmPin`.
13209      */
13210     pin?: string;
13211   }
13212
13213   interface BrowserViewConstructorOptions {
13214     /**
13215      * See BrowserWindow.
13216      */
13217     webPreferences?: WebPreferences;
13218   }
13219
13220   interface BrowserWindowConstructorOptions {
13221     /**
13222      * Window's width in pixels. Default is `800`.
13223      */
13224     width?: number;
13225     /**
13226      * Window's height in pixels. Default is `600`.
13227      */
13228     height?: number;
13229     /**
13230      * (**required** if y is used) Window's left offset from screen. Default is to
13231      * center the window.
13232      */
13233     x?: number;
13234     /**
13235      * (**required** if x is used) Window's top offset from screen. Default is to
13236      * center the window.
13237      */
13238     y?: number;
13239     /**
13240      * The `width` and `height` would be used as web page's size, which means the
13241      * actual window's size will include window frame's size and be slightly larger.
13242      * Default is `false`.
13243      */
13244     useContentSize?: boolean;
13245     /**
13246      * Show window in the center of the screen. Default is `false`.
13247      */
13248     center?: boolean;
13249     /**
13250      * Window's minimum width. Default is `0`.
13251      */
13252     minWidth?: number;
13253     /**
13254      * Window's minimum height. Default is `0`.
13255      */
13256     minHeight?: number;
13257     /**
13258      * Window's maximum width. Default is no limit.
13259      */
13260     maxWidth?: number;
13261     /**
13262      * Window's maximum height. Default is no limit.
13263      */
13264     maxHeight?: number;
13265     /**
13266      * Whether window is resizable. Default is `true`.
13267      */
13268     resizable?: boolean;
13269     /**
13270      * Whether window is movable. This is not implemented on Linux. Default is `true`.
13271      *
13272      * @platform darwin,win32
13273      */
13274     movable?: boolean;
13275     /**
13276      * Whether window is minimizable. This is not implemented on Linux. Default is
13277      * `true`.
13278      *
13279      * @platform darwin,win32
13280      */
13281     minimizable?: boolean;
13282     /**
13283      * Whether window is maximizable. This is not implemented on Linux. Default is
13284      * `true`.
13285      *
13286      * @platform darwin,win32
13287      */
13288     maximizable?: boolean;
13289     /**
13290      * Whether window is closable. This is not implemented on Linux. Default is `true`.
13291      *
13292      * @platform darwin,win32
13293      */
13294     closable?: boolean;
13295     /**
13296      * Whether the window can be focused. Default is `true`. On Windows setting
13297      * `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
13298      * `focusable: false` makes the window stop interacting with wm, so the window will
13299      * always stay on top in all workspaces.
13300      */
13301     focusable?: boolean;
13302     /**
13303      * Whether the window should always stay on top of other windows. Default is
13304      * `false`.
13305      */
13306     alwaysOnTop?: boolean;
13307     /**
13308      * Whether the window should show in fullscreen. When explicitly set to `false` the
13309      * fullscreen button will be hidden or disabled on macOS. Default is `false`.
13310      */
13311     fullscreen?: boolean;
13312     /**
13313      * Whether the window can be put into fullscreen mode. On macOS, also whether the
13314      * maximize/zoom button should toggle full screen mode or maximize window. Default
13315      * is `true`.
13316      */
13317     fullscreenable?: boolean;
13318     /**
13319      * Use pre-Lion fullscreen on macOS. Default is `false`.
13320      *
13321      * @platform darwin
13322      */
13323     simpleFullscreen?: boolean;
13324     /**
13325      * Whether to show the window in taskbar. Default is `false`.
13326      *
13327      * @platform darwin,win32
13328      */
13329     skipTaskbar?: boolean;
13330     /**
13331      * Whether the window is in kiosk mode. Default is `false`.
13332      */
13333     kiosk?: boolean;
13334     /**
13335      * Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
13336      * defined in the HTML file loaded by `loadURL()`, this property will be ignored.
13337      */
13338     title?: string;
13339     /**
13340      * The window icon. On Windows it is recommended to use `ICO` icons to get best
13341      * visual effects, you can also leave it undefined so the executable's icon will be
13342      * used.
13343      */
13344     icon?: (NativeImage) | (string);
13345     /**
13346      * Whether window should be shown when created. Default is `true`.
13347      */
13348     show?: boolean;
13349     /**
13350      * Whether the renderer should be active when `show` is `false` and it has just
13351      * been created.  In order for `document.visibilityState` to work correctly on
13352      * first load with `show: false` you should set this to `false`.  Setting this to
13353      * `false` will cause the `ready-to-show` event to not fire.  Default is `true`.
13354      */
13355     paintWhenInitiallyHidden?: boolean;
13356     /**
13357      * Specify `false` to create a frameless window. Default is `true`.
13358      */
13359     frame?: boolean;
13360     /**
13361      * Specify parent window. Default is `null`.
13362      */
13363     parent?: BrowserWindow;
13364     /**
13365      * Whether this is a modal window. This only works when the window is a child
13366      * window. Default is `false`.
13367      */
13368     modal?: boolean;
13369     /**
13370      * Whether clicking an inactive window will also click through to the web contents.
13371      * Default is `false` on macOS. This option is not configurable on other platforms.
13372      *
13373      * @platform darwin
13374      */
13375     acceptFirstMouse?: boolean;
13376     /**
13377      * Whether to hide cursor when typing. Default is `false`.
13378      */
13379     disableAutoHideCursor?: boolean;
13380     /**
13381      * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
13382      */
13383     autoHideMenuBar?: boolean;
13384     /**
13385      * Enable the window to be resized larger than screen. Only relevant for macOS, as
13386      * other OSes allow larger-than-screen windows by default. Default is `false`.
13387      *
13388      * @platform darwin
13389      */
13390     enableLargerThanScreen?: boolean;
13391     /**
13392      * The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color
13393      * format. Alpha in #AARRGGBB format is supported if `transparent` is set to
13394      * `true`. Default is `#FFF` (white). See win.setBackgroundColor for more
13395      * information.
13396      */
13397     backgroundColor?: string;
13398     /**
13399      * Whether window should have a shadow. Default is `true`.
13400      */
13401     hasShadow?: boolean;
13402     /**
13403      * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
13404      * (fully opaque). This is only implemented on Windows and macOS.
13405      *
13406      * @platform darwin,win32
13407      */
13408     opacity?: number;
13409     /**
13410      * Forces using dark theme for the window, only works on some GTK+3 desktop
13411      * environments. Default is `false`.
13412      */
13413     darkTheme?: boolean;
13414     /**
13415      * Makes the window transparent. Default is `false`. On Windows, does not work
13416      * unless the window is frameless.
13417      */
13418     transparent?: boolean;
13419     /**
13420      * The type of window, default is normal window. See more about this below.
13421      */
13422     type?: string;
13423     /**
13424      * Specify how the material appearance should reflect window activity state on
13425      * macOS. Must be used with the `vibrancy` property. Possible values are:
13426      *
13427      * @platform darwin
13428      */
13429     visualEffectState?: ('followWindow' | 'active' | 'inactive');
13430     /**
13431      * The style of window title bar. Default is `default`. Possible values are:
13432      *
13433      * @platform darwin,win32
13434      */
13435     titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
13436     /**
13437      * Set a custom position for the traffic light buttons in frameless windows.
13438      *
13439      * @platform darwin
13440      */
13441     trafficLightPosition?: Point;
13442     /**
13443      * Whether frameless window should have rounded corners on macOS. Default is
13444      * `true`. Setting this property to `false` will prevent the window from being
13445      * fullscreenable.
13446      *
13447      * @platform darwin
13448      */
13449     roundedCorners?: boolean;
13450     /**
13451      * Shows the title in the title bar in full screen mode on macOS for `hiddenInset`
13452      * titleBarStyle. Default is `false`.
13453      *
13454      * @deprecated
13455      * @platform darwin
13456      */
13457     fullscreenWindowTitle?: boolean;
13458     /**
13459      * Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
13460      * window frame. Setting it to `false` will remove window shadow and window
13461      * animations. Default is `true`.
13462      */
13463     thickFrame?: boolean;
13464     /**
13465      * Add a type of vibrancy effect to the window, only on macOS. Can be
13466      * `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`,
13467      * `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`,
13468      * `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please
13469      * note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark`
13470      * are deprecated and have been removed in macOS Catalina (10.15).
13471      *
13472      * @platform darwin
13473      */
13474     vibrancy?: ('appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
13475     /**
13476      * Controls the behavior on macOS when option-clicking the green stoplight button
13477      * on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
13478      * will grow to the preferred width of the web page when zoomed, `false` will cause
13479      * it to zoom to the width of the screen. This will also affect the behavior when
13480      * calling `maximize()` directly. Default is `false`.
13481      *
13482      * @platform darwin
13483      */
13484     zoomToPageWidth?: boolean;
13485     /**
13486      * Tab group name, allows opening the window as a native tab on macOS 10.12+.
13487      * Windows with the same tabbing identifier will be grouped together. This also
13488      * adds a native new tab button to your window's tab bar and allows your `app` and
13489      * window to receive the `new-window-for-tab` event.
13490      *
13491      * @platform darwin
13492      */
13493     tabbingIdentifier?: string;
13494     /**
13495      * Settings of web page's features.
13496      */
13497     webPreferences?: WebPreferences;
13498     /**
13499      *  When using a frameless window in conjunction with
13500      * `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so
13501      * that the standard window controls ("traffic lights" on macOS) are visible, this
13502      * property enables the Window Controls Overlay JavaScript APIs and CSS Environment
13503      * Variables. Specifying `true` will result in an overlay with default system
13504      * colors. Default is `false`.
13505      */
13506     titleBarOverlay?: (TitleBarOverlay) | (boolean);
13507   }
13508
13509   interface CallbackResponse {
13510     cancel?: boolean;
13511     /**
13512      * The original request is prevented from being sent or completed and is instead
13513      * redirected to the given URL.
13514      */
13515     redirectURL?: string;
13516   }
13517
13518   interface CertificateTrustDialogOptions {
13519     /**
13520      * The certificate to trust/import.
13521      */
13522     certificate: Certificate;
13523     /**
13524      * The message to display to the user.
13525      */
13526     message: string;
13527   }
13528
13529   interface ClearCodeCachesOptions {
13530     /**
13531      * An array of url corresponding to the resource whose generated code cache needs
13532      * to be removed. If the list is empty then all entries in the cache directory will
13533      * be removed.
13534      */
13535     urls?: string[];
13536   }
13537
13538   interface ClearStorageDataOptions {
13539     /**
13540      * Should follow `window.location.origin`’s representation `scheme://host:port`.
13541      */
13542     origin?: string;
13543     /**
13544      * The types of storages to clear, can contain: `appcache`, `cookies`,
13545      * `filesystem`, `indexdb`, `localstorage`, `shadercache`, `websql`,
13546      * `serviceworkers`, `cachestorage`. If not specified, clear all storage types.
13547      */
13548     storages?: string[];
13549     /**
13550      * The types of quotas to clear, can contain: `temporary`, `persistent`,
13551      * `syncable`. If not specified, clear all quotas.
13552      */
13553     quotas?: string[];
13554   }
13555
13556   interface ClientRequestConstructorOptions {
13557     /**
13558      * The HTTP request method. Defaults to the GET method.
13559      */
13560     method?: string;
13561     /**
13562      * The request URL. Must be provided in the absolute form with the protocol scheme
13563      * specified as http or https.
13564      */
13565     url?: string;
13566     /**
13567      * The `Session` instance with which the request is associated.
13568      */
13569     session?: Session;
13570     /**
13571      * The name of the `partition` with which the request is associated. Defaults to
13572      * the empty string. The `session` option supersedes `partition`. Thus if a
13573      * `session` is explicitly specified, `partition` is ignored.
13574      */
13575     partition?: string;
13576     /**
13577      * Can be `include` or `omit`. Whether to send credentials with this request. If
13578      * set to `include`, credentials from the session associated with the request will
13579      * be used. If set to `omit`, credentials will not be sent with the request (and
13580      * the `'login'` event will not be triggered in the event of a 401). This matches
13581      * the behavior of the fetch option of the same name. If this option is not
13582      * specified, authentication data from the session will be sent, and cookies will
13583      * not be sent (unless `useSessionCookies` is set).
13584      */
13585     credentials?: ('include' | 'omit');
13586     /**
13587      * Whether to send cookies with this request from the provided session. If
13588      * `credentials` is specified, this option has no effect. Default is `false`.
13589      */
13590     useSessionCookies?: boolean;
13591     /**
13592      * Can be `http:` or `https:`. The protocol scheme in the form 'scheme:'. Defaults
13593      * to 'http:'.
13594      */
13595     protocol?: string;
13596     /**
13597      * The server host provided as a concatenation of the hostname and the port number
13598      * 'hostname:port'.
13599      */
13600     host?: string;
13601     /**
13602      * The server host name.
13603      */
13604     hostname?: string;
13605     /**
13606      * The server's listening port number.
13607      */
13608     port?: number;
13609     /**
13610      * The path part of the request URL.
13611      */
13612     path?: string;
13613     /**
13614      * Can be `follow`, `error` or `manual`. The redirect mode for this request. When
13615      * mode is `error`, any redirection will be aborted. When mode is `manual` the
13616      * redirection will be cancelled unless `request.followRedirect` is invoked
13617      * synchronously during the `redirect` event.  Defaults to `follow`.
13618      */
13619     redirect?: ('follow' | 'error' | 'manual');
13620     /**
13621      * The origin URL of the request.
13622      */
13623     origin?: string;
13624   }
13625
13626   interface Config {
13627     /**
13628      * The proxy mode. Should be one of `direct`, `auto_detect`, `pac_script`,
13629      * `fixed_servers` or `system`. If it's unspecified, it will be automatically
13630      * determined based on other specified options.
13631      */
13632     mode?: ('direct' | 'auto_detect' | 'pac_script' | 'fixed_servers' | 'system');
13633     /**
13634      * The URL associated with the PAC file.
13635      */
13636     pacScript?: string;
13637     /**
13638      * Rules indicating which proxies to use.
13639      */
13640     proxyRules?: string;
13641     /**
13642      * Rules indicating which URLs should bypass the proxy settings.
13643      */
13644     proxyBypassRules?: string;
13645   }
13646
13647   interface ConfigureHostResolverOptions {
13648     /**
13649      * Whether the built-in host resolver is used in preference to getaddrinfo. When
13650      * enabled, the built-in resolver will attempt to use the system's DNS settings to
13651      * do DNS lookups itself. Enabled by default on macOS, disabled by default on
13652      * Windows and Linux.
13653      */
13654     enableBuiltInResolver?: boolean;
13655     /**
13656      * Can be "off", "automatic" or "secure". Configures the DNS-over-HTTP mode. When
13657      * "off", no DoH lookups will be performed. When "automatic", DoH lookups will be
13658      * performed first if DoH is available, and insecure DNS lookups will be performed
13659      * as a fallback. When "secure", only DoH lookups will be performed. Defaults to
13660      * "automatic".
13661      */
13662     secureDnsMode?: string;
13663     /**
13664      * A list of DNS-over-HTTP server templates. See RFC8484 § 3 for details on the
13665      * template format. Most servers support the POST method; the template for such
13666      * servers is simply a URI. Note that for some DNS providers, the resolver will
13667      * automatically upgrade to DoH unless DoH is explicitly disabled, even if there
13668      * are no DoH servers provided in this list.
13669      */
13670     secureDnsServers?: string[];
13671     /**
13672      * Controls whether additional DNS query types, e.g. HTTPS (DNS type 65) will be
13673      * allowed besides the traditional A and AAAA queries when a request is being made
13674      * via insecure DNS. Has no effect on Secure DNS which always allows additional
13675      * types. Defaults to true.
13676      */
13677     enableAdditionalDnsQueryTypes?: boolean;
13678   }
13679
13680   interface ConsoleMessageEvent extends Event {
13681     /**
13682      * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
13683      * `error`.
13684      */
13685     level: number;
13686     /**
13687      * The actual console message
13688      */
13689     message: string;
13690     /**
13691      * The line number of the source that triggered this console message
13692      */
13693     line: number;
13694     sourceId: string;
13695   }
13696
13697   interface ContextMenuEvent extends Event {
13698     params: Params;
13699   }
13700
13701   interface ContextMenuParams {
13702     /**
13703      * x coordinate.
13704      */
13705     x: number;
13706     /**
13707      * y coordinate.
13708      */
13709     y: number;
13710     /**
13711      * Frame from which the context menu was invoked.
13712      */
13713     frame: WebFrameMain;
13714     /**
13715      * URL of the link that encloses the node the context menu was invoked on.
13716      */
13717     linkURL: string;
13718     /**
13719      * Text associated with the link. May be an empty string if the contents of the
13720      * link are an image.
13721      */
13722     linkText: string;
13723     /**
13724      * URL of the top level page that the context menu was invoked on.
13725      */
13726     pageURL: string;
13727     /**
13728      * URL of the subframe that the context menu was invoked on.
13729      */
13730     frameURL: string;
13731     /**
13732      * Source URL for the element that the context menu was invoked on. Elements with
13733      * source URLs are images, audio and video.
13734      */
13735     srcURL: string;
13736     /**
13737      * Type of the node the context menu was invoked on. Can be `none`, `image`,
13738      * `audio`, `video`, `canvas`, `file` or `plugin`.
13739      */
13740     mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
13741     /**
13742      * Whether the context menu was invoked on an image which has non-empty contents.
13743      */
13744     hasImageContents: boolean;
13745     /**
13746      * Whether the context is editable.
13747      */
13748     isEditable: boolean;
13749     /**
13750      * Text of the selection that the context menu was invoked on.
13751      */
13752     selectionText: string;
13753     /**
13754      * Title text of the selection that the context menu was invoked on.
13755      */
13756     titleText: string;
13757     /**
13758      * Alt text of the selection that the context menu was invoked on.
13759      */
13760     altText: string;
13761     /**
13762      * Suggested filename to be used when saving file through 'Save Link As' option of
13763      * context menu.
13764      */
13765     suggestedFilename: string;
13766     /**
13767      * Rect representing the coordinates in the document space of the selection.
13768      */
13769     selectionRect: Rectangle;
13770     /**
13771      * Start position of the selection text.
13772      */
13773     selectionStartOffset: number;
13774     /**
13775      * The referrer policy of the frame on which the menu is invoked.
13776      */
13777     referrerPolicy: Referrer;
13778     /**
13779      * The misspelled word under the cursor, if any.
13780      */
13781     misspelledWord: string;
13782     /**
13783      * An array of suggested words to show the user to replace the `misspelledWord`.
13784      * Only available if there is a misspelled word and spellchecker is enabled.
13785      */
13786     dictionarySuggestions: string[];
13787     /**
13788      * The character encoding of the frame on which the menu was invoked.
13789      */
13790     frameCharset: string;
13791     /**
13792      * If the context menu was invoked on an input field, the type of that field.
13793      * Possible values are `none`, `plainText`, `password`, `other`.
13794      */
13795     inputFieldType: string;
13796     /**
13797      * If the context is editable, whether or not spellchecking is enabled.
13798      */
13799     spellcheckEnabled: boolean;
13800     /**
13801      * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
13802      * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
13803      * `adjustSelection`, or `adjustSelectionReset`.
13804      */
13805     menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
13806     /**
13807      * The flags for the media element the context menu was invoked on.
13808      */
13809     mediaFlags: MediaFlags;
13810     /**
13811      * These flags indicate whether the renderer believes it is able to perform the
13812      * corresponding action.
13813      */
13814     editFlags: EditFlags;
13815   }
13816
13817   interface ContinueActivityDetails {
13818     /**
13819      * A string identifying the URL of the webpage accessed by the activity on another
13820      * device, if available.
13821      */
13822     webpageURL?: string;
13823   }
13824
13825   interface CookiesGetFilter {
13826     /**
13827      * Retrieves cookies which are associated with `url`. Empty implies retrieving
13828      * cookies of all URLs.
13829      */
13830     url?: string;
13831     /**
13832      * Filters cookies by name.
13833      */
13834     name?: string;
13835     /**
13836      * Retrieves cookies whose domains match or are subdomains of `domains`.
13837      */
13838     domain?: string;
13839     /**
13840      * Retrieves cookies whose path matches `path`.
13841      */
13842     path?: string;
13843     /**
13844      * Filters cookies by their Secure property.
13845      */
13846     secure?: boolean;
13847     /**
13848      * Filters out session or persistent cookies.
13849      */
13850     session?: boolean;
13851   }
13852
13853   interface CookiesSetDetails {
13854     /**
13855      * The URL to associate the cookie with. The promise will be rejected if the URL is
13856      * invalid.
13857      */
13858     url: string;
13859     /**
13860      * The name of the cookie. Empty by default if omitted.
13861      */
13862     name?: string;
13863     /**
13864      * The value of the cookie. Empty by default if omitted.
13865      */
13866     value?: string;
13867     /**
13868      * The domain of the cookie; this will be normalized with a preceding dot so that
13869      * it's also valid for subdomains. Empty by default if omitted.
13870      */
13871     domain?: string;
13872     /**
13873      * The path of the cookie. Empty by default if omitted.
13874      */
13875     path?: string;
13876     /**
13877      * Whether the cookie should be marked as Secure. Defaults to false unless Same
13878      * Site=None attribute is used.
13879      */
13880     secure?: boolean;
13881     /**
13882      * Whether the cookie should be marked as HTTP only. Defaults to false.
13883      */
13884     httpOnly?: boolean;
13885     /**
13886      * The expiration date of the cookie as the number of seconds since the UNIX epoch.
13887      * If omitted then the cookie becomes a session cookie and will not be retained
13888      * between sessions.
13889      */
13890     expirationDate?: number;
13891     /**
13892      * The Same Site policy to apply to this cookie.  Can be `unspecified`,
13893      * `no_restriction`, `lax` or `strict`.  Default is `lax`.
13894      */
13895     sameSite?: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
13896   }
13897
13898   interface CrashReporterStartOptions {
13899     /**
13900      * URL that crash reports will be sent to as POST. Required unless `uploadToServer`
13901      * is `false`.
13902      */
13903     submitURL?: string;
13904     /**
13905      * Defaults to `app.name`.
13906      */
13907     productName?: string;
13908     /**
13909      * Deprecated alias for `{ globalExtra: { _companyName: ... } }`.
13910      *
13911      * @deprecated
13912      */
13913     companyName?: string;
13914     /**
13915      * Whether crash reports should be sent to the server. If false, crash reports will
13916      * be collected and stored in the crashes directory, but not uploaded. Default is
13917      * `true`.
13918      */
13919     uploadToServer?: boolean;
13920     /**
13921      * If true, crashes generated in the main process will not be forwarded to the
13922      * system crash handler. Default is `false`.
13923      */
13924     ignoreSystemCrashHandler?: boolean;
13925     /**
13926      * If true, limit the number of crashes uploaded to 1/hour. Default is `false`.
13927      *
13928      * @platform darwin,win32
13929      */
13930     rateLimit?: boolean;
13931     /**
13932      * If true, crash reports will be compressed and uploaded with `Content-Encoding:
13933      * gzip`. Default is `true`.
13934      */
13935     compress?: boolean;
13936     /**
13937      * Extra string key/value annotations that will be sent along with crash reports
13938      * that are generated in the main process. Only string values are supported.
13939      * Crashes generated in child processes will not contain these extra parameters to
13940      * crash reports generated from child processes, call `addExtraParameter` from the
13941      * child process.
13942      */
13943     extra?: Record<string, string>;
13944     /**
13945      * Extra string key/value annotations that will be sent along with any crash
13946      * reports generated in any process. These annotations cannot be changed once the
13947      * crash reporter has been started. If a key is present in both the global extra
13948      * parameters and the process-specific extra parameters, then the global one will
13949      * take precedence. By default, `productName` and the app version are included, as
13950      * well as the Electron version.
13951      */
13952     globalExtra?: Record<string, string>;
13953   }
13954
13955   interface CreateFromBitmapOptions {
13956     width: number;
13957     height: number;
13958     /**
13959      * Defaults to 1.0.
13960      */
13961     scaleFactor?: number;
13962   }
13963
13964   interface CreateFromBufferOptions {
13965     /**
13966      * Required for bitmap buffers.
13967      */
13968     width?: number;
13969     /**
13970      * Required for bitmap buffers.
13971      */
13972     height?: number;
13973     /**
13974      * Defaults to 1.0.
13975      */
13976     scaleFactor?: number;
13977   }
13978
13979   interface CreateInterruptedDownloadOptions {
13980     /**
13981      * Absolute path of the download.
13982      */
13983     path: string;
13984     /**
13985      * Complete URL chain for the download.
13986      */
13987     urlChain: string[];
13988     mimeType?: string;
13989     /**
13990      * Start range for the download.
13991      */
13992     offset: number;
13993     /**
13994      * Total length of the download.
13995      */
13996     length: number;
13997     /**
13998      * Last-Modified header value.
13999      */
14000     lastModified?: string;
14001     /**
14002      * ETag header value.
14003      */
14004     eTag?: string;
14005     /**
14006      * Time when download was started in number of seconds since UNIX epoch.
14007      */
14008     startTime?: number;
14009   }
14010
14011   interface Data {
14012     text?: string;
14013     html?: string;
14014     image?: NativeImage;
14015     rtf?: string;
14016     /**
14017      * The title of the URL at `text`.
14018      */
14019     bookmark?: string;
14020   }
14021
14022   interface Details {
14023     /**
14024      * Process type. One of the following values:
14025      */
14026     type: ('Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
14027     /**
14028      * The reason the child process is gone. Possible values:
14029      */
14030     reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
14031     /**
14032      * The exit code for the process (e.g. status from waitpid if on posix, from
14033      * GetExitCodeProcess on Windows).
14034      */
14035     exitCode: number;
14036     /**
14037      * The non-localized name of the process.
14038      */
14039     serviceName?: string;
14040     /**
14041      * The name of the process. Examples for utility: `Audio Service`, `Content
14042      * Decryption Module Service`, `Network Service`, `Video Capture`, etc.
14043      */
14044     name?: string;
14045   }
14046
14047   interface DevicePermissionHandlerHandlerDetails {
14048     /**
14049      * The type of device that permission is being requested on, can be `hid` or
14050      * `serial`.
14051      */
14052     deviceType: ('hid' | 'serial');
14053     /**
14054      * The origin URL of the device permission check.
14055      */
14056     origin: string;
14057     /**
14058      * the device that permission is being requested for.
14059      */
14060     device: (HIDDevice) | (SerialPort);
14061   }
14062
14063   interface DidChangeThemeColorEvent extends Event {
14064     themeColor: string;
14065   }
14066
14067   interface DidCreateWindowDetails {
14068     /**
14069      * URL for the created window.
14070      */
14071     url: string;
14072     /**
14073      * Name given to the created window in the `window.open()` call.
14074      */
14075     frameName: string;
14076     /**
14077      * The options used to create the BrowserWindow. They are merged in increasing
14078      * precedence: parsed options from the `features` string from `window.open()`,
14079      * security-related webPreferences inherited from the parent, and options given by
14080      * `webContents.setWindowOpenHandler`. Unrecognized options are not filtered out.
14081      */
14082     options: BrowserWindowConstructorOptions;
14083     /**
14084      * The referrer that will be passed to the new window. May or may not result in the
14085      * `Referer` header being sent, depending on the referrer policy.
14086      */
14087     referrer: Referrer;
14088     /**
14089      * The post data that will be sent to the new window, along with the appropriate
14090      * headers that will be set. If no post data is to be sent, the value will be
14091      * `null`. Only defined when the window is being created by a form that set
14092      * `target=_blank`.
14093      */
14094     postBody?: PostBody;
14095     /**
14096      * Can be `default`, `foreground-tab`, `background-tab`, `new-window`,
14097      * `save-to-disk` and `other`.
14098      */
14099     disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other');
14100   }
14101
14102   interface DidFailLoadEvent extends Event {
14103     errorCode: number;
14104     errorDescription: string;
14105     validatedURL: string;
14106     isMainFrame: boolean;
14107   }
14108
14109   interface DidFrameFinishLoadEvent extends Event {
14110     isMainFrame: boolean;
14111   }
14112
14113   interface DidFrameNavigateEvent extends Event {
14114     url: string;
14115     /**
14116      * -1 for non HTTP navigations
14117      */
14118     httpResponseCode: number;
14119     /**
14120      * empty for non HTTP navigations,
14121      */
14122     httpStatusText: string;
14123     isMainFrame: boolean;
14124     frameProcessId: number;
14125     frameRoutingId: number;
14126   }
14127
14128   interface DidNavigateEvent extends Event {
14129     url: string;
14130   }
14131
14132   interface DidNavigateInPageEvent extends Event {
14133     isMainFrame: boolean;
14134     url: string;
14135   }
14136
14137   interface DidRedirectNavigationEvent extends Event {
14138     url: string;
14139     isInPlace: boolean;
14140     isMainFrame: boolean;
14141     frameProcessId: number;
14142     frameRoutingId: number;
14143   }
14144
14145   interface DidStartNavigationEvent extends Event {
14146     url: string;
14147     isInPlace: boolean;
14148     isMainFrame: boolean;
14149     frameProcessId: number;
14150     frameRoutingId: number;
14151   }
14152
14153   interface DisplayBalloonOptions {
14154     /**
14155      * Icon to use when `iconType` is `custom`.
14156      */
14157     icon?: (NativeImage) | (string);
14158     /**
14159      * Can be `none`, `info`, `warning`, `error` or `custom`. Default is `custom`.
14160      */
14161     iconType?: ('none' | 'info' | 'warning' | 'error' | 'custom');
14162     title: string;
14163     content: string;
14164     /**
14165      * The large version of the icon should be used. Default is `true`. Maps to
14166      * `NIIF_LARGE_ICON`.
14167      */
14168     largeIcon?: boolean;
14169     /**
14170      * Do not play the associated sound. Default is `false`. Maps to `NIIF_NOSOUND`.
14171      */
14172     noSound?: boolean;
14173     /**
14174      * Do not display the balloon notification if the current user is in "quiet time".
14175      * Default is `false`. Maps to `NIIF_RESPECT_QUIET_TIME`.
14176      */
14177     respectQuietTime?: boolean;
14178   }
14179
14180   interface DisplayMediaRequestHandlerHandlerRequest {
14181     /**
14182      * Frame that is requesting access to media.
14183      */
14184     frame: WebFrameMain;
14185     /**
14186      * Origin of the page making the request.
14187      */
14188     securityOrigin: string;
14189     /**
14190      * true if the web content requested a video stream.
14191      */
14192     videoRequested: boolean;
14193     /**
14194      * true if the web content requested an audio stream.
14195      */
14196     audioRequested: boolean;
14197     /**
14198      * Whether a user gesture was active when this request was triggered.
14199      */
14200     userGesture: boolean;
14201   }
14202
14203   interface EnableNetworkEmulationOptions {
14204     /**
14205      * Whether to emulate network outage. Defaults to false.
14206      */
14207     offline?: boolean;
14208     /**
14209      * RTT in ms. Defaults to 0 which will disable latency throttling.
14210      */
14211     latency?: number;
14212     /**
14213      * Download rate in Bps. Defaults to 0 which will disable download throttling.
14214      */
14215     downloadThroughput?: number;
14216     /**
14217      * Upload rate in Bps. Defaults to 0 which will disable upload throttling.
14218      */
14219     uploadThroughput?: number;
14220   }
14221
14222   interface FeedURLOptions {
14223     url: string;
14224     /**
14225      * HTTP request headers.
14226      *
14227      * @platform darwin
14228      */
14229     headers?: Record<string, string>;
14230     /**
14231      * Can be `json` or `default`, see the Squirrel.Mac README for more information.
14232      *
14233      * @platform darwin
14234      */
14235     serverType?: ('json' | 'default');
14236   }
14237
14238   interface FileIconOptions {
14239     size: ('small' | 'normal' | 'large');
14240   }
14241
14242   interface FindInPageOptions {
14243     /**
14244      * Whether to search forward or backward, defaults to `true`.
14245      */
14246     forward?: boolean;
14247     /**
14248      * Whether to begin a new text finding session with this request. Should be `true`
14249      * for initial requests, and `false` for follow-up requests. Defaults to `false`.
14250      */
14251     findNext?: boolean;
14252     /**
14253      * Whether search should be case-sensitive, defaults to `false`.
14254      */
14255     matchCase?: boolean;
14256   }
14257
14258   interface FocusOptions {
14259     /**
14260      * Make the receiver the active app even if another app is currently active.
14261      *
14262      * @platform darwin
14263      */
14264     steal: boolean;
14265   }
14266
14267   interface ForkOptions {
14268     /**
14269      * Environment key-value pairs. Default is `process.env`.
14270      */
14271     env?: Env;
14272     /**
14273      * List of string arguments passed to the executable.
14274      */
14275     execArgv?: string[];
14276     /**
14277      * Current working directory of the child process.
14278      */
14279     cwd?: string;
14280     /**
14281      * Allows configuring the mode for `stdout` and `stderr` of the child process.
14282      * Default is `inherit`. String value can be one of `pipe`, `ignore`, `inherit`,
14283      * for more details on these values you can refer to stdio documentation from
14284      * Node.js. Currently this option only supports configuring `stdout` and `stderr`
14285      * to either `pipe`, `inherit` or `ignore`. Configuring `stdin` is not supported;
14286      * `stdin` will always be ignored. For example, the supported values will be
14287      * processed as following:
14288      */
14289     stdio?: (Array<'pipe' | 'ignore' | 'inherit'>) | (string);
14290     /**
14291      * Name of the process that will appear in `name` property of `child-process-gone`
14292      * event of `app`. Default is `node.mojom.NodeService`.
14293      */
14294     serviceName?: string;
14295     /**
14296      * With this flag, the utility process will be launched via the `Electron Helper
14297      * (Plugin).app` helper executable on macOS, which can be codesigned with
14298      * `com.apple.security.cs.disable-library-validation` and
14299      * `com.apple.security.cs.allow-unsigned-executable-memory` entitlements. This will
14300      * allow the utility process to load unsigned libraries. Unless you specifically
14301      * need this capability, it is best to leave this disabled. Default is `false`.
14302      *
14303      * @platform darwin
14304      */
14305     allowLoadingUnsignedLibraries?: boolean;
14306   }
14307
14308   interface FoundInPageEvent extends Event {
14309     result: FoundInPageResult;
14310   }
14311
14312   interface FrameCreatedDetails {
14313     frame: WebFrameMain;
14314   }
14315
14316   interface FromPartitionOptions {
14317     /**
14318      * Whether to enable cache.
14319      */
14320     cache: boolean;
14321   }
14322
14323   interface HandlerDetails {
14324     /**
14325      * The _resolved_ version of the URL passed to `window.open()`. e.g. opening a
14326      * window with `window.open('foo')` will yield something like
14327      * `https://the-origin/the/current/path/foo`.
14328      */
14329     url: string;
14330     /**
14331      * Name of the window provided in `window.open()`
14332      */
14333     frameName: string;
14334     /**
14335      * Comma separated list of window features provided to `window.open()`.
14336      */
14337     features: string;
14338     /**
14339      * Can be `default`, `foreground-tab`, `background-tab`, `new-window`,
14340      * `save-to-disk` or `other`.
14341      */
14342     disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other');
14343     /**
14344      * The referrer that will be passed to the new window. May or may not result in the
14345      * `Referer` header being sent, depending on the referrer policy.
14346      */
14347     referrer: Referrer;
14348     /**
14349      * The post data that will be sent to the new window, along with the appropriate
14350      * headers that will be set. If no post data is to be sent, the value will be
14351      * `null`. Only defined when the window is being created by a form that set
14352      * `target=_blank`.
14353      */
14354     postBody?: PostBody;
14355   }
14356
14357   interface HeadersReceivedResponse {
14358     cancel?: boolean;
14359     /**
14360      * When provided, the server is assumed to have responded with these headers.
14361      */
14362     responseHeaders?: Record<string, (string) | (string[])>;
14363     /**
14364      * Should be provided when overriding `responseHeaders` to change header status
14365      * otherwise original response header's status will be used.
14366      */
14367     statusLine?: string;
14368   }
14369
14370   interface HeapStatistics {
14371     totalHeapSize: number;
14372     totalHeapSizeExecutable: number;
14373     totalPhysicalSize: number;
14374     totalAvailableSize: number;
14375     usedHeapSize: number;
14376     heapSizeLimit: number;
14377     mallocedMemory: number;
14378     peakMallocedMemory: number;
14379     doesZapGarbage: boolean;
14380   }
14381
14382   interface HidDeviceAddedDetails {
14383     device: HIDDevice[];
14384     frame: WebFrameMain;
14385   }
14386
14387   interface HidDeviceRemovedDetails {
14388     device: HIDDevice[];
14389     frame: WebFrameMain;
14390   }
14391
14392   interface HidDeviceRevokedDetails {
14393     device: HIDDevice[];
14394     /**
14395      * The origin that the device has been revoked from.
14396      */
14397     origin?: string;
14398   }
14399
14400   interface IgnoreMouseEventsOptions {
14401     /**
14402      * If true, forwards mouse move messages to Chromium, enabling mouse related events
14403      * such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false,
14404      * forwarding is always disabled regardless of this value.
14405      *
14406      * @platform darwin,win32
14407      */
14408     forward?: boolean;
14409   }
14410
14411   interface ImportCertificateOptions {
14412     /**
14413      * Path for the pkcs12 file.
14414      */
14415     certificate: string;
14416     /**
14417      * Passphrase for the certificate.
14418      */
14419     password: string;
14420   }
14421
14422   interface Info {
14423     /**
14424      * Security origin for the isolated world.
14425      */
14426     securityOrigin?: string;
14427     /**
14428      * Content Security Policy for the isolated world.
14429      */
14430     csp?: string;
14431     /**
14432      * Name for isolated world. Useful in devtools.
14433      */
14434     name?: string;
14435   }
14436
14437   interface Input {
14438     /**
14439      * Either `keyUp` or `keyDown`.
14440      */
14441     type: string;
14442     /**
14443      * Equivalent to KeyboardEvent.key.
14444      */
14445     key: string;
14446     /**
14447      * Equivalent to KeyboardEvent.code.
14448      */
14449     code: string;
14450     /**
14451      * Equivalent to KeyboardEvent.repeat.
14452      */
14453     isAutoRepeat: boolean;
14454     /**
14455      * Equivalent to KeyboardEvent.isComposing.
14456      */
14457     isComposing: boolean;
14458     /**
14459      * Equivalent to KeyboardEvent.shiftKey.
14460      */
14461     shift: boolean;
14462     /**
14463      * Equivalent to KeyboardEvent.controlKey.
14464      */
14465     control: boolean;
14466     /**
14467      * Equivalent to KeyboardEvent.altKey.
14468      */
14469     alt: boolean;
14470     /**
14471      * Equivalent to KeyboardEvent.metaKey.
14472      */
14473     meta: boolean;
14474     /**
14475      * Equivalent to KeyboardEvent.location.
14476      */
14477     location: number;
14478     /**
14479      * See InputEvent.modifiers.
14480      */
14481     modifiers: string[];
14482   }
14483
14484   interface InsertCSSOptions {
14485     /**
14486      * Can be either 'user' or 'author'. Sets the cascade origin of the inserted
14487      * stylesheet. Default is 'author'.
14488      */
14489     cssOrigin?: string;
14490   }
14491
14492   interface IpcMessageEvent extends Event {
14493     /**
14494      * pair of `[processId, frameId]`.
14495      */
14496     frameId: [number, number];
14497     channel: string;
14498     args: any[];
14499   }
14500
14501   interface Item {
14502     /**
14503      * The path to the file being dragged.
14504      */
14505     file: string;
14506     /**
14507      * The paths to the files being dragged. (`files` will override `file` field)
14508      */
14509     files?: string[];
14510     /**
14511      * The image must be non-empty on macOS.
14512      */
14513     icon: (NativeImage) | (string);
14514   }
14515
14516   interface JumpListSettings {
14517     /**
14518      * The minimum number of items that will be shown in the Jump List (for a more
14519      * detailed description of this value see the MSDN docs).
14520      */
14521     minItems: number;
14522     /**
14523      * Array of `JumpListItem` objects that correspond to items that the user has
14524      * explicitly removed from custom categories in the Jump List. These items must not
14525      * be re-added to the Jump List in the **next** call to `app.setJumpList()`,
14526      * Windows will not display any custom category that contains any of the removed
14527      * items.
14528      */
14529     removedItems: JumpListItem[];
14530   }
14531
14532   interface LoadCommitEvent extends Event {
14533     url: string;
14534     isMainFrame: boolean;
14535   }
14536
14537   interface LoadExtensionOptions {
14538     /**
14539      * Whether to allow the extension to read local files over `file://` protocol and
14540      * inject content scripts into `file://` pages. This is required e.g. for loading
14541      * devtools extensions on `file://` URLs. Defaults to false.
14542      */
14543     allowFileAccess: boolean;
14544   }
14545
14546   interface LoadFileOptions {
14547     /**
14548      * Passed to `url.format()`.
14549      */
14550     query?: Record<string, string>;
14551     /**
14552      * Passed to `url.format()`.
14553      */
14554     search?: string;
14555     /**
14556      * Passed to `url.format()`.
14557      */
14558     hash?: string;
14559   }
14560
14561   interface LoadURLOptions {
14562     /**
14563      * An HTTP Referrer url.
14564      */
14565     httpReferrer?: (string) | (Referrer);
14566     /**
14567      * A user agent originating the request.
14568      */
14569     userAgent?: string;
14570     /**
14571      * Extra headers separated by "\n"
14572      */
14573     extraHeaders?: string;
14574     postData?: Array<(UploadRawData) | (UploadFile)>;
14575     /**
14576      * Base url (with trailing path separator) for files to be loaded by the data url.
14577      * This is needed only if the specified `url` is a data url and needs to load other
14578      * files.
14579      */
14580     baseURLForDataURL?: string;
14581   }
14582
14583   interface LoginItemSettings {
14584     /**
14585      * `true` if the app is set to open at login.
14586      */
14587     openAtLogin: boolean;
14588     /**
14589      * `true` if the app is set to open as hidden at login. This setting is not
14590      * available on MAS builds.
14591      *
14592      * @platform darwin
14593      */
14594     openAsHidden: boolean;
14595     /**
14596      * `true` if the app was opened at login automatically. This setting is not
14597      * available on MAS builds.
14598      *
14599      * @platform darwin
14600      */
14601     wasOpenedAtLogin: boolean;
14602     /**
14603      * `true` if the app was opened as a hidden login item. This indicates that the app
14604      * should not open any windows at startup. This setting is not available on MAS
14605      * builds.
14606      *
14607      * @platform darwin
14608      */
14609     wasOpenedAsHidden: boolean;
14610     /**
14611      * `true` if the app was opened as a login item that should restore the state from
14612      * the previous session. This indicates that the app should restore the windows
14613      * that were open the last time the app was closed. This setting is not available
14614      * on MAS builds.
14615      *
14616      * @platform darwin
14617      */
14618     restoreState: boolean;
14619     /**
14620      * `true` if app is set to open at login and its run key is not deactivated. This
14621      * differs from `openAtLogin` as it ignores the `args` option, this property will
14622      * be true if the given executable would be launched at login with **any**
14623      * arguments.
14624      *
14625      * @platform win32
14626      */
14627     executableWillLaunchAtLogin: boolean;
14628     launchItems: LaunchItems[];
14629   }
14630
14631   interface LoginItemSettingsOptions {
14632     /**
14633      * The executable path to compare against. Defaults to `process.execPath`.
14634      *
14635      * @platform win32
14636      */
14637     path?: string;
14638     /**
14639      * The command-line arguments to compare against. Defaults to an empty array.
14640      *
14641      * @platform win32
14642      */
14643     args?: string[];
14644   }
14645
14646   interface MenuItemConstructorOptions {
14647     /**
14648      * Will be called with `click(menuItem, browserWindow, event)` when the menu item
14649      * is clicked.
14650      */
14651     click?: (menuItem: MenuItem, browserWindow: (BrowserWindow) | (undefined), event: KeyboardEvent) => void;
14652     /**
14653      * Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`,
14654      * `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`,
14655      * `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`,
14656      * `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`,
14657      * `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`,
14658      * `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`,
14659      * `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`,
14660      * `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`,
14661      * `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action
14662      * of the menu item, when specified the `click` property will be ignored. See
14663      * roles.
14664      */
14665     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' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
14666     /**
14667      * Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
14668      */
14669     type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
14670     label?: string;
14671     sublabel?: string;
14672     /**
14673      * Hover text for this menu item.
14674      *
14675      * @platform darwin
14676      */
14677     toolTip?: string;
14678     accelerator?: Accelerator;
14679     icon?: (NativeImage) | (string);
14680     /**
14681      * If false, the menu item will be greyed out and unclickable.
14682      */
14683     enabled?: boolean;
14684     /**
14685      * default is `true`, and when `false` will prevent the accelerator from triggering
14686      * the item if the item is not visible`.
14687      *
14688      * @platform darwin
14689      */
14690     acceleratorWorksWhenHidden?: boolean;
14691     /**
14692      * If false, the menu item will be entirely hidden.
14693      */
14694     visible?: boolean;
14695     /**
14696      * Should only be specified for `checkbox` or `radio` type menu items.
14697      */
14698     checked?: boolean;
14699     /**
14700      * If false, the accelerator won't be registered with the system, but it will still
14701      * be displayed. Defaults to true.
14702      *
14703      * @platform linux,win32
14704      */
14705     registerAccelerator?: boolean;
14706     /**
14707      * The item to share when the `role` is `shareMenu`.
14708      *
14709      * @platform darwin
14710      */
14711     sharingItem?: SharingItem;
14712     /**
14713      * Should be specified for `submenu` type menu items. If `submenu` is specified,
14714      * the `type: 'submenu'` can be omitted. If the value is not a `Menu` then it will
14715      * be automatically converted to one using `Menu.buildFromTemplate`.
14716      */
14717     submenu?: (MenuItemConstructorOptions[]) | (Menu);
14718     /**
14719      * Unique within a single menu. If defined then it can be used as a reference to
14720      * this item by the position attribute.
14721      */
14722     id?: string;
14723     /**
14724      * Inserts this item before the item with the specified label. If the referenced
14725      * item doesn't exist the item will be inserted at the end of  the menu. Also
14726      * implies that the menu item in question should be placed in the same “group” as
14727      * the item.
14728      */
14729     before?: string[];
14730     /**
14731      * Inserts this item after the item with the specified label. If the referenced
14732      * item doesn't exist the item will be inserted at the end of the menu.
14733      */
14734     after?: string[];
14735     /**
14736      * Provides a means for a single context menu to declare the placement of their
14737      * containing group before the containing group of the item with the specified
14738      * label.
14739      */
14740     beforeGroupContaining?: string[];
14741     /**
14742      * Provides a means for a single context menu to declare the placement of their
14743      * containing group after the containing group of the item with the specified
14744      * label.
14745      */
14746     afterGroupContaining?: string[];
14747   }
14748
14749   interface MessageBoxOptions {
14750     /**
14751      * Content of the message box.
14752      */
14753     message: string;
14754     /**
14755      * Can be `"none"`, `"info"`, `"error"`, `"question"` or `"warning"`. On Windows,
14756      * `"question"` displays the same icon as `"info"`, unless you set an icon using
14757      * the `"icon"` option. On macOS, both `"warning"` and `"error"` display the same
14758      * warning icon.
14759      */
14760     type?: string;
14761     /**
14762      * Array of texts for buttons. On Windows, an empty array will result in one button
14763      * labeled "OK".
14764      */
14765     buttons?: string[];
14766     /**
14767      * Index of the button in the buttons array which will be selected by default when
14768      * the message box opens.
14769      */
14770     defaultId?: number;
14771     /**
14772      * Pass an instance of AbortSignal to optionally close the message box, the message
14773      * box will behave as if it was cancelled by the user. On macOS, `signal` does not
14774      * work with message boxes that do not have a parent window, since those message
14775      * boxes run synchronously due to platform limitations.
14776      */
14777     signal?: AbortSignal;
14778     /**
14779      * Title of the message box, some platforms will not show it.
14780      */
14781     title?: string;
14782     /**
14783      * Extra information of the message.
14784      */
14785     detail?: string;
14786     /**
14787      * If provided, the message box will include a checkbox with the given label.
14788      */
14789     checkboxLabel?: string;
14790     /**
14791      * Initial checked state of the checkbox. `false` by default.
14792      */
14793     checkboxChecked?: boolean;
14794     icon?: (NativeImage) | (string);
14795     /**
14796      * Custom width of the text in the message box.
14797      *
14798      * @platform darwin
14799      */
14800     textWidth?: number;
14801     /**
14802      * The index of the button to be used to cancel the dialog, via the `Esc` key. By
14803      * default this is assigned to the first button with "cancel" or "no" as the label.
14804      * If no such labeled buttons exist and this option is not set, `0` will be used as
14805      * the return value.
14806      */
14807     cancelId?: number;
14808     /**
14809      * On Windows Electron will try to figure out which one of the `buttons` are common
14810      * buttons (like "Cancel" or "Yes"), and show the others as command links in the
14811      * dialog. This can make the dialog appear in the style of modern Windows apps. If
14812      * you don't like this behavior, you can set `noLink` to `true`.
14813      */
14814     noLink?: boolean;
14815     /**
14816      * Normalize the keyboard access keys across platforms. Default is `false`.
14817      * Enabling this assumes `&` is used in the button labels for the placement of the
14818      * keyboard shortcut access key and labels will be converted so they work correctly
14819      * on each platform, `&` characters are removed on macOS, converted to `_` on
14820      * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
14821      * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
14822      * via `Alt-W` on Windows and Linux.
14823      */
14824     normalizeAccessKeys?: boolean;
14825   }
14826
14827   interface MessageBoxReturnValue {
14828     /**
14829      * The index of the clicked button.
14830      */
14831     response: number;
14832     /**
14833      * The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.
14834      */
14835     checkboxChecked: boolean;
14836   }
14837
14838   interface MessageBoxSyncOptions {
14839     /**
14840      * Content of the message box.
14841      */
14842     message: string;
14843     /**
14844      * Can be `"none"`, `"info"`, `"error"`, `"question"` or `"warning"`. On Windows,
14845      * `"question"` displays the same icon as `"info"`, unless you set an icon using
14846      * the `"icon"` option. On macOS, both `"warning"` and `"error"` display the same
14847      * warning icon.
14848      */
14849     type?: string;
14850     /**
14851      * Array of texts for buttons. On Windows, an empty array will result in one button
14852      * labeled "OK".
14853      */
14854     buttons?: string[];
14855     /**
14856      * Index of the button in the buttons array which will be selected by default when
14857      * the message box opens.
14858      */
14859     defaultId?: number;
14860     /**
14861      * Title of the message box, some platforms will not show it.
14862      */
14863     title?: string;
14864     /**
14865      * Extra information of the message.
14866      */
14867     detail?: string;
14868     icon?: (NativeImage) | (string);
14869     /**
14870      * Custom width of the text in the message box.
14871      *
14872      * @platform darwin
14873      */
14874     textWidth?: number;
14875     /**
14876      * The index of the button to be used to cancel the dialog, via the `Esc` key. By
14877      * default this is assigned to the first button with "cancel" or "no" as the label.
14878      * If no such labeled buttons exist and this option is not set, `0` will be used as
14879      * the return value.
14880      */
14881     cancelId?: number;
14882     /**
14883      * On Windows Electron will try to figure out which one of the `buttons` are common
14884      * buttons (like "Cancel" or "Yes"), and show the others as command links in the
14885      * dialog. This can make the dialog appear in the style of modern Windows apps. If
14886      * you don't like this behavior, you can set `noLink` to `true`.
14887      */
14888     noLink?: boolean;
14889     /**
14890      * Normalize the keyboard access keys across platforms. Default is `false`.
14891      * Enabling this assumes `&` is used in the button labels for the placement of the
14892      * keyboard shortcut access key and labels will be converted so they work correctly
14893      * on each platform, `&` characters are removed on macOS, converted to `_` on
14894      * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
14895      * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
14896      * via `Alt-W` on Windows and Linux.
14897      */
14898     normalizeAccessKeys?: boolean;
14899   }
14900
14901   interface MessageDetails {
14902     /**
14903      * The actual console message
14904      */
14905     message: string;
14906     /**
14907      * The version ID of the service worker that sent the log message
14908      */
14909     versionId: number;
14910     /**
14911      * The type of source for this message.  Can be `javascript`, `xml`, `network`,
14912      * `console-api`, `storage`, `rendering`, `security`, `deprecation`, `worker`,
14913      * `violation`, `intervention`, `recommendation` or `other`.
14914      */
14915     source: ('javascript' | 'xml' | 'network' | 'console-api' | 'storage' | 'rendering' | 'security' | 'deprecation' | 'worker' | 'violation' | 'intervention' | 'recommendation' | 'other');
14916     /**
14917      * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14918      * `error`.
14919      */
14920     level: number;
14921     /**
14922      * The URL the message came from
14923      */
14924     sourceUrl: string;
14925     /**
14926      * The line number of the source that triggered this console message
14927      */
14928     lineNumber: number;
14929   }
14930
14931   interface MessageEvent {
14932     data: any;
14933     ports: MessagePortMain[];
14934   }
14935
14936   interface MoveToApplicationsFolderOptions {
14937     /**
14938      * A handler for potential conflict in move failure.
14939      */
14940     conflictHandler?: (conflictType: 'exists' | 'existsAndRunning') => boolean;
14941   }
14942
14943   interface NotificationConstructorOptions {
14944     /**
14945      * A title for the notification, which will be shown at the top of the notification
14946      * window when it is shown.
14947      */
14948     title?: string;
14949     /**
14950      * A subtitle for the notification, which will be displayed below the title.
14951      *
14952      * @platform darwin
14953      */
14954     subtitle?: string;
14955     /**
14956      * The body text of the notification, which will be displayed below the title or
14957      * subtitle.
14958      */
14959     body?: string;
14960     /**
14961      * Whether or not to emit an OS notification noise when showing the notification.
14962      */
14963     silent?: boolean;
14964     /**
14965      * An icon to use in the notification.
14966      */
14967     icon?: (string) | (NativeImage);
14968     /**
14969      * Whether or not to add an inline reply option to the notification.
14970      *
14971      * @platform darwin
14972      */
14973     hasReply?: boolean;
14974     /**
14975      * The timeout duration of the notification. Can be 'default' or 'never'.
14976      *
14977      * @platform linux,win32
14978      */
14979     timeoutType?: ('default' | 'never');
14980     /**
14981      * The placeholder to write in the inline reply input field.
14982      *
14983      * @platform darwin
14984      */
14985     replyPlaceholder?: string;
14986     /**
14987      * The name of the sound file to play when the notification is shown.
14988      *
14989      * @platform darwin
14990      */
14991     sound?: string;
14992     /**
14993      * The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
14994      *
14995      * @platform linux
14996      */
14997     urgency?: ('normal' | 'critical' | 'low');
14998     /**
14999      * Actions to add to the notification. Please read the available actions and
15000      * limitations in the `NotificationAction` documentation.
15001      *
15002      * @platform darwin
15003      */
15004     actions?: NotificationAction[];
15005     /**
15006      * A custom title for the close button of an alert. An empty string will cause the
15007      * default localized text to be used.
15008      *
15009      * @platform darwin
15010      */
15011     closeButtonText?: string;
15012     /**
15013      * A custom description of the Notification on Windows superseding all properties
15014      * above. Provides full customization of design and behavior of the notification.
15015      *
15016      * @platform win32
15017      */
15018     toastXml?: string;
15019   }
15020
15021   interface OnBeforeRedirectListenerDetails {
15022     id: number;
15023     url: string;
15024     method: string;
15025     webContentsId?: number;
15026     webContents?: WebContents;
15027     frame?: WebFrameMain;
15028     /**
15029      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
15030      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
15031      */
15032     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
15033     referrer: string;
15034     timestamp: number;
15035     redirectURL: string;
15036     statusCode: number;
15037     statusLine: string;
15038     /**
15039      * The server IP address that the request was actually sent to.
15040      */
15041     ip?: string;
15042     fromCache: boolean;
15043     responseHeaders?: Record<string, string[]>;
15044   }
15045
15046   interface OnBeforeRequestListenerDetails {
15047     id: number;
15048     url: string;
15049     method: string;
15050     webContentsId?: number;
15051     webContents?: WebContents;
15052     frame?: WebFrameMain;
15053     /**
15054      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
15055      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
15056      */
15057     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
15058     referrer: string;
15059     timestamp: number;
15060     uploadData: UploadData[];
15061   }
15062
15063   interface OnBeforeSendHeadersListenerDetails {
15064     id: number;
15065     url: string;
15066     method: string;
15067     webContentsId?: number;
15068     webContents?: WebContents;
15069     frame?: WebFrameMain;
15070     /**
15071      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
15072      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
15073      */
15074     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
15075     referrer: string;
15076     timestamp: number;
15077     uploadData?: UploadData[];
15078     requestHeaders: Record<string, string>;
15079   }
15080
15081   interface OnCompletedListenerDetails {
15082     id: number;
15083     url: string;
15084     method: string;
15085     webContentsId?: number;
15086     webContents?: WebContents;
15087     frame?: WebFrameMain;
15088     /**
15089      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
15090      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
15091      */
15092     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
15093     referrer: string;
15094     timestamp: number;
15095     responseHeaders?: Record<string, string[]>;
15096     fromCache: boolean;
15097     statusCode: number;
15098     statusLine: string;
15099     error: string;
15100   }
15101
15102   interface OnErrorOccurredListenerDetails {
15103     id: number;
15104     url: string;
15105     method: string;
15106     webContentsId?: number;
15107     webContents?: WebContents;
15108     frame?: WebFrameMain;
15109     /**
15110      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
15111      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
15112      */
15113     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
15114     referrer: string;
15115     timestamp: number;
15116     fromCache: boolean;
15117     /**
15118      * The error description.
15119      */
15120     error: string;
15121   }
15122
15123   interface OnHeadersReceivedListenerDetails {
15124     id: number;
15125     url: string;
15126     method: string;
15127     webContentsId?: number;
15128     webContents?: WebContents;
15129     frame?: WebFrameMain;
15130     /**
15131      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
15132      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
15133      */
15134     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
15135     referrer: string;
15136     timestamp: number;
15137     statusLine: string;
15138     statusCode: number;
15139     responseHeaders?: Record<string, string[]>;
15140   }
15141
15142   interface OnResponseStartedListenerDetails {
15143     id: number;
15144     url: string;
15145     method: string;
15146     webContentsId?: number;
15147     webContents?: WebContents;
15148     frame?: WebFrameMain;
15149     /**
15150      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
15151      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
15152      */
15153     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
15154     referrer: string;
15155     timestamp: number;
15156     responseHeaders?: Record<string, string[]>;
15157     /**
15158      * Indicates whether the response was fetched from disk cache.
15159      */
15160     fromCache: boolean;
15161     statusCode: number;
15162     statusLine: string;
15163   }
15164
15165   interface OnSendHeadersListenerDetails {
15166     id: number;
15167     url: string;
15168     method: string;
15169     webContentsId?: number;
15170     webContents?: WebContents;
15171     frame?: WebFrameMain;
15172     /**
15173      * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
15174      * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
15175      */
15176     resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
15177     referrer: string;
15178     timestamp: number;
15179     requestHeaders: Record<string, string>;
15180   }
15181
15182   interface OpenDevToolsOptions {
15183     /**
15184      * Opens the devtools with specified dock state, can be `left`, `right`, `bottom`,
15185      * `undocked`, `detach`. Defaults to last used dock state. In `undocked` mode it's
15186      * possible to dock back. In `detach` mode it's not.
15187      */
15188     mode: ('left' | 'right' | 'bottom' | 'undocked' | 'detach');
15189     /**
15190      * Whether to bring the opened devtools window to the foreground. The default is
15191      * `true`.
15192      */
15193     activate?: boolean;
15194   }
15195
15196   interface OpenDialogOptions {
15197     title?: string;
15198     defaultPath?: string;
15199     /**
15200      * Custom label for the confirmation button, when left empty the default label will
15201      * be used.
15202      */
15203     buttonLabel?: string;
15204     filters?: FileFilter[];
15205     /**
15206      * Contains which features the dialog should use. The following values are
15207      * supported:
15208      */
15209     properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
15210     /**
15211      * Message to display above input boxes.
15212      *
15213      * @platform darwin
15214      */
15215     message?: string;
15216     /**
15217      * Create security scoped bookmarks when packaged for the Mac App Store.
15218      *
15219      * @platform darwin,mas
15220      */
15221     securityScopedBookmarks?: boolean;
15222   }
15223
15224   interface OpenDialogReturnValue {
15225     /**
15226      * whether or not the dialog was canceled.
15227      */
15228     canceled: boolean;
15229     /**
15230      * An array of file paths chosen by the user. If the dialog is cancelled this will
15231      * be an empty array.
15232      */
15233     filePaths: string[];
15234     /**
15235      * An array matching the `filePaths` array of base64 encoded strings which contains
15236      * security scoped bookmark data. `securityScopedBookmarks` must be enabled for
15237      * this to be populated. (For return values, see table here.)
15238      *
15239      * @platform darwin,mas
15240      */
15241     bookmarks?: string[];
15242   }
15243
15244   interface OpenDialogSyncOptions {
15245     title?: string;
15246     defaultPath?: string;
15247     /**
15248      * Custom label for the confirmation button, when left empty the default label will
15249      * be used.
15250      */
15251     buttonLabel?: string;
15252     filters?: FileFilter[];
15253     /**
15254      * Contains which features the dialog should use. The following values are
15255      * supported:
15256      */
15257     properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
15258     /**
15259      * Message to display above input boxes.
15260      *
15261      * @platform darwin
15262      */
15263     message?: string;
15264     /**
15265      * Create security scoped bookmarks when packaged for the Mac App Store.
15266      *
15267      * @platform darwin,mas
15268      */
15269     securityScopedBookmarks?: boolean;
15270   }
15271
15272   interface OpenExternalOptions {
15273     /**
15274      * `true` to bring the opened application to the foreground. The default is `true`.
15275      *
15276      * @platform darwin
15277      */
15278     activate?: boolean;
15279     /**
15280      * The working directory.
15281      *
15282      * @platform win32
15283      */
15284     workingDirectory?: string;
15285   }
15286
15287   interface Options {
15288   }
15289
15290   interface Opts {
15291     /**
15292      * if true, fire the `beforeunload` event before closing the page. If the page
15293      * prevents the unload, the WebContents will not be closed. The
15294      * `will-prevent-unload` will be fired if the page requests prevention of unload.
15295      */
15296     waitForBeforeUnload: boolean;
15297   }
15298
15299   interface PageFaviconUpdatedEvent extends Event {
15300     /**
15301      * Array of URLs.
15302      */
15303     favicons: string[];
15304   }
15305
15306   interface PageTitleUpdatedEvent extends Event {
15307     title: string;
15308     explicitSet: boolean;
15309   }
15310
15311   interface Parameters {
15312     /**
15313      * Specify the screen type to emulate (default: `desktop`):
15314      */
15315     screenPosition: ('desktop' | 'mobile');
15316     /**
15317      * Set the emulated screen size (screenPosition == mobile).
15318      */
15319     screenSize: Size;
15320     /**
15321      * Position the view on the screen (screenPosition == mobile) (default: `{ x: 0, y:
15322      * 0 }`).
15323      */
15324     viewPosition: Point;
15325     /**
15326      * Set the device scale factor (if zero defaults to original device scale factor)
15327      * (default: `0`).
15328      */
15329     deviceScaleFactor: number;
15330     /**
15331      * Set the emulated view size (empty means no override)
15332      */
15333     viewSize: Size;
15334     /**
15335      * Scale of emulated view inside available space (not in fit to view mode)
15336      * (default: `1`).
15337      */
15338     scale: number;
15339   }
15340
15341   interface Payment {
15342     /**
15343      * The identifier of the purchased product.
15344      */
15345     productIdentifier: string;
15346     /**
15347      * The quantity purchased.
15348      */
15349     quantity: number;
15350     /**
15351      * An opaque identifier for the user’s account on your system.
15352      */
15353     applicationUsername: string;
15354     /**
15355      * The details of the discount offer to apply to the payment.
15356      */
15357     paymentDiscount?: PaymentDiscount;
15358   }
15359
15360   interface PermissionCheckHandlerHandlerDetails {
15361     /**
15362      * The origin of the frame embedding the frame that made the permission check.
15363      * Only set for cross-origin sub frames making permission checks.
15364      */
15365     embeddingOrigin?: string;
15366     /**
15367      * The security origin of the `media` check.
15368      */
15369     securityOrigin?: string;
15370     /**
15371      * The type of media access being requested, can be `video`, `audio` or `unknown`
15372      */
15373     mediaType?: ('video' | 'audio' | 'unknown');
15374     /**
15375      * The last URL the requesting frame loaded.  This is not provided for cross-origin
15376      * sub frames making permission checks.
15377      */
15378     requestingUrl?: string;
15379     /**
15380      * Whether the frame making the request is the main frame
15381      */
15382     isMainFrame: boolean;
15383   }
15384
15385   interface PermissionRequestHandlerHandlerDetails {
15386     /**
15387      * The url of the `openExternal` request.
15388      */
15389     externalURL?: string;
15390     /**
15391      * The security origin of the `media` request.
15392      */
15393     securityOrigin?: string;
15394     /**
15395      * The types of media access being requested, elements can be `video` or `audio`
15396      */
15397     mediaTypes?: Array<'video' | 'audio'>;
15398     /**
15399      * The last URL the requesting frame loaded
15400      */
15401     requestingUrl: string;
15402     /**
15403      * Whether the frame making the request is the main frame
15404      */
15405     isMainFrame: boolean;
15406   }
15407
15408   interface PluginCrashedEvent extends Event {
15409     name: string;
15410     version: string;
15411   }
15412
15413   interface PopupOptions {
15414     /**
15415      * Default is the focused window.
15416      */
15417     window?: BrowserWindow;
15418     /**
15419      * Default is the current mouse cursor position. Must be declared if `y` is
15420      * declared.
15421      */
15422     x?: number;
15423     /**
15424      * Default is the current mouse cursor position. Must be declared if `x` is
15425      * declared.
15426      */
15427     y?: number;
15428     /**
15429      * The index of the menu item to be positioned under the mouse cursor at the
15430      * specified coordinates. Default is -1.
15431      *
15432      * @platform darwin
15433      */
15434     positioningItem?: number;
15435     /**
15436      * Called when menu is closed.
15437      */
15438     callback?: () => void;
15439   }
15440
15441   interface PreconnectOptions {
15442     /**
15443      * URL for preconnect. Only the origin is relevant for opening the socket.
15444      */
15445     url: string;
15446     /**
15447      * number of sockets to preconnect. Must be between 1 and 6. Defaults to 1.
15448      */
15449     numSockets?: number;
15450   }
15451
15452   interface PrintToPDFOptions {
15453     /**
15454      * Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
15455      */
15456     landscape?: boolean;
15457     /**
15458      * Whether to display header and footer. Defaults to false.
15459      */
15460     displayHeaderFooter?: boolean;
15461     /**
15462      * Whether to print background graphics. Defaults to false.
15463      */
15464     printBackground?: boolean;
15465     /**
15466      * Scale of the webpage rendering. Defaults to 1.
15467      */
15468     scale?: number;
15469     /**
15470      * Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
15471      * `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
15472      * `height` and `width` in inches. Defaults to `Letter`.
15473      */
15474     pageSize?: (string) | (Size);
15475     margins?: Margins;
15476     /**
15477      * Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string,
15478      * which means print all pages.
15479      */
15480     pageRanges?: string;
15481     /**
15482      * HTML template for the print header. Should be valid HTML markup with following
15483      * classes used to inject printing values into them: `date` (formatted print date),
15484      * `title` (document title), `url` (document location), `pageNumber` (current page
15485      * number) and `totalPages` (total pages in the document). For example, `<span
15486      * class=title></span>` would generate span containing the title.
15487      */
15488     headerTemplate?: string;
15489     /**
15490      * HTML template for the print footer. Should use the same format as the
15491      * `headerTemplate`.
15492      */
15493     footerTemplate?: string;
15494     /**
15495      * Whether or not to prefer page size as defined by css. Defaults to false, in
15496      * which case the content will be scaled to fit the paper size.
15497      */
15498     preferCSSPageSize?: boolean;
15499   }
15500
15501   interface Privileges {
15502     /**
15503      * Default false.
15504      */
15505     standard?: boolean;
15506     /**
15507      * Default false.
15508      */
15509     secure?: boolean;
15510     /**
15511      * Default false.
15512      */
15513     bypassCSP?: boolean;
15514     /**
15515      * Default false.
15516      */
15517     allowServiceWorkers?: boolean;
15518     /**
15519      * Default false.
15520      */
15521     supportFetchAPI?: boolean;
15522     /**
15523      * Default false.
15524      */
15525     corsEnabled?: boolean;
15526     /**
15527      * Default false.
15528      */
15529     stream?: boolean;
15530   }
15531
15532   interface ProgressBarOptions {
15533     /**
15534      * Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or
15535      * `paused`.
15536      *
15537      * @platform win32
15538      */
15539     mode: ('none' | 'normal' | 'indeterminate' | 'error' | 'paused');
15540   }
15541
15542   interface Provider {
15543     spellCheck: (words: string[], callback: (misspeltWords: string[]) => void) => void;
15544   }
15545
15546   interface ReadBookmark {
15547     title: string;
15548     url: string;
15549   }
15550
15551   interface RegistrationCompletedDetails {
15552     /**
15553      * The base URL that a service worker is registered for
15554      */
15555     scope: string;
15556   }
15557
15558   interface RelaunchOptions {
15559     args?: string[];
15560     execPath?: string;
15561   }
15562
15563   interface RenderProcessGoneDetails {
15564     /**
15565      * The reason the render process is gone.  Possible values:
15566      */
15567     reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
15568     /**
15569      * The exit code of the process, unless `reason` is `launch-failed`, in which case
15570      * `exitCode` will be a platform-specific launch failure error code.
15571      */
15572     exitCode: number;
15573   }
15574
15575   interface Request {
15576     hostname: string;
15577     certificate: Certificate;
15578     validatedCertificate: Certificate;
15579     /**
15580      * `true` if Chromium recognises the root CA as a standard root. If it isn't then
15581      * it's probably the case that this certificate was generated by a MITM proxy whose
15582      * root has been installed locally (for example, by a corporate proxy). This should
15583      * not be trusted if the `verificationResult` is not `OK`.
15584      */
15585     isIssuedByKnownRoot: boolean;
15586     /**
15587      * `OK` if the certificate is trusted, otherwise an error like `CERT_REVOKED`.
15588      */
15589     verificationResult: string;
15590     /**
15591      * Error code.
15592      */
15593     errorCode: number;
15594   }
15595
15596   interface ResizeOptions {
15597     /**
15598      * Defaults to the image's width.
15599      */
15600     width?: number;
15601     /**
15602      * Defaults to the image's height.
15603      */
15604     height?: number;
15605     /**
15606      * The desired quality of the resize image. Possible values are `good`, `better`,
15607      * or `best`. The default is `best`. These values express a desired quality/speed
15608      * tradeoff. They are translated into an algorithm-specific method that depends on
15609      * the capabilities (CPU, GPU) of the underlying platform. It is possible for all
15610      * three methods to be mapped to the same algorithm on a given platform.
15611      */
15612     quality?: string;
15613   }
15614
15615   interface ResourceUsage {
15616     images: MemoryUsageDetails;
15617     scripts: MemoryUsageDetails;
15618     cssStyleSheets: MemoryUsageDetails;
15619     xslStyleSheets: MemoryUsageDetails;
15620     fonts: MemoryUsageDetails;
15621     other: MemoryUsageDetails;
15622   }
15623
15624   interface Response {
15625     /**
15626      * `false` should be passed in if the dialog is canceled. If the `pairingKind` is
15627      * `confirm` or `confirmPin`, this value should indicate if the pairing is
15628      * confirmed.  If the `pairingKind` is `providePin` the value should be `true` when
15629      * a value is provided.
15630      */
15631     confirmed: boolean;
15632     /**
15633      * When the `pairingKind` is `providePin` this value should be the required pin for
15634      * the Bluetooth device.
15635      */
15636     pin?: (string) | (null);
15637   }
15638
15639   interface Result {
15640     requestId: number;
15641     /**
15642      * Position of the active match.
15643      */
15644     activeMatchOrdinal: number;
15645     /**
15646      * Number of Matches.
15647      */
15648     matches: number;
15649     /**
15650      * Coordinates of first match region.
15651      */
15652     selectionArea: Rectangle;
15653     finalUpdate: boolean;
15654   }
15655
15656   interface SaveDialogOptions {
15657     /**
15658      * The dialog title. Cannot be displayed on some _Linux_ desktop environments.
15659      */
15660     title?: string;
15661     /**
15662      * Absolute directory path, absolute file path, or file name to use by default.
15663      */
15664     defaultPath?: string;
15665     /**
15666      * Custom label for the confirmation button, when left empty the default label will
15667      * be used.
15668      */
15669     buttonLabel?: string;
15670     filters?: FileFilter[];
15671     /**
15672      * Message to display above text fields.
15673      *
15674      * @platform darwin
15675      */
15676     message?: string;
15677     /**
15678      * Custom label for the text displayed in front of the filename text field.
15679      *
15680      * @platform darwin
15681      */
15682     nameFieldLabel?: string;
15683     /**
15684      * Show the tags input box, defaults to `true`.
15685      *
15686      * @platform darwin
15687      */
15688     showsTagField?: boolean;
15689     properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
15690     /**
15691      * Create a security scoped bookmark when packaged for the Mac App Store. If this
15692      * option is enabled and the file doesn't already exist a blank file will be
15693      * created at the chosen path.
15694      *
15695      * @platform darwin,mas
15696      */
15697     securityScopedBookmarks?: boolean;
15698   }
15699
15700   interface SaveDialogReturnValue {
15701     /**
15702      * whether or not the dialog was canceled.
15703      */
15704     canceled: boolean;
15705     /**
15706      * If the dialog is canceled, this will be `undefined`.
15707      */
15708     filePath?: string;
15709     /**
15710      * Base64 encoded string which contains the security scoped bookmark data for the
15711      * saved file. `securityScopedBookmarks` must be enabled for this to be present.
15712      * (For return values, see table here.)
15713      *
15714      * @platform darwin,mas
15715      */
15716     bookmark?: string;
15717   }
15718
15719   interface SaveDialogSyncOptions {
15720     /**
15721      * The dialog title. Cannot be displayed on some _Linux_ desktop environments.
15722      */
15723     title?: string;
15724     /**
15725      * Absolute directory path, absolute file path, or file name to use by default.
15726      */
15727     defaultPath?: string;
15728     /**
15729      * Custom label for the confirmation button, when left empty the default label will
15730      * be used.
15731      */
15732     buttonLabel?: string;
15733     filters?: FileFilter[];
15734     /**
15735      * Message to display above text fields.
15736      *
15737      * @platform darwin
15738      */
15739     message?: string;
15740     /**
15741      * Custom label for the text displayed in front of the filename text field.
15742      *
15743      * @platform darwin
15744      */
15745     nameFieldLabel?: string;
15746     /**
15747      * Show the tags input box, defaults to `true`.
15748      *
15749      * @platform darwin
15750      */
15751     showsTagField?: boolean;
15752     properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
15753     /**
15754      * Create a security scoped bookmark when packaged for the Mac App Store. If this
15755      * option is enabled and the file doesn't already exist a blank file will be
15756      * created at the chosen path.
15757      *
15758      * @platform darwin,mas
15759      */
15760     securityScopedBookmarks?: boolean;
15761   }
15762
15763   interface SelectHidDeviceDetails {
15764     deviceList: HIDDevice[];
15765     frame: WebFrameMain;
15766   }
15767
15768   interface SerialPortRevokedDetails {
15769     port: SerialPort;
15770     frame: WebFrameMain;
15771     /**
15772      * The origin that the device has been revoked from.
15773      */
15774     origin: string;
15775   }
15776
15777   interface Settings {
15778     /**
15779      * `true` to open the app at login, `false` to remove the app as a login item.
15780      * Defaults to `false`.
15781      */
15782     openAtLogin?: boolean;
15783     /**
15784      * `true` to open the app as hidden. Defaults to `false`. The user can edit this
15785      * setting from the System Preferences so
15786      * `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is
15787      * opened to know the current value. This setting is not available on MAS builds.
15788      *
15789      * @platform darwin
15790      */
15791     openAsHidden?: boolean;
15792     /**
15793      * The executable to launch at login. Defaults to `process.execPath`.
15794      *
15795      * @platform win32
15796      */
15797     path?: string;
15798     /**
15799      * The command-line arguments to pass to the executable. Defaults to an empty
15800      * array. Take care to wrap paths in quotes.
15801      *
15802      * @platform win32
15803      */
15804     args?: string[];
15805     /**
15806      * `true` will change the startup approved registry key and `enable / disable` the
15807      * App in Task Manager and Windows Settings. Defaults to `true`.
15808      *
15809      * @platform win32
15810      */
15811     enabled?: boolean;
15812     /**
15813      * value name to write into registry. Defaults to the app's AppUserModelId(). Set
15814      * the app's login item settings.
15815      *
15816      * @platform win32
15817      */
15818     name?: string;
15819   }
15820
15821   interface SourcesOptions {
15822     /**
15823      * An array of strings that lists the types of desktop sources to be captured,
15824      * available types are `screen` and `window`.
15825      */
15826     types: string[];
15827     /**
15828      * The size that the media source thumbnail should be scaled to. Default is `150` x
15829      * `150`. Set width or height to 0 when you do not need the thumbnails. This will
15830      * save the processing time required for capturing the content of each window and
15831      * screen.
15832      */
15833     thumbnailSize?: Size;
15834     /**
15835      * Set to true to enable fetching window icons. The default value is false. When
15836      * false the appIcon property of the sources return null. Same if a source has the
15837      * type screen.
15838      */
15839     fetchWindowIcons?: boolean;
15840   }
15841
15842   interface SSLConfigConfig {
15843     /**
15844      * Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The minimum SSL version to allow
15845      * when connecting to remote servers. Defaults to `tls1`.
15846      */
15847     minVersion?: string;
15848     /**
15849      * Can be `tls1.2` or `tls1.3`. The maximum SSL version to allow when connecting to
15850      * remote servers. Defaults to `tls1.3`.
15851      */
15852     maxVersion?: string;
15853     /**
15854      * List of cipher suites which should be explicitly prevented from being used in
15855      * addition to those disabled by the net built-in policy. Supported literal forms:
15856      * 0xAABB, where AA is `cipher_suite[0]` and BB is `cipher_suite[1]`, as defined in
15857      * RFC 2246, Section 7.4.1.2. Unrecognized but parsable cipher suites in this form
15858      * will not return an error. Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify
15859      * 0x0004, while to disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002. Note
15860      * that TLSv1.3 ciphers cannot be disabled using this mechanism.
15861      */
15862     disabledCipherSuites?: number[];
15863   }
15864
15865   interface StartLoggingOptions {
15866     /**
15867      * What kinds of data should be captured. By default, only metadata about requests
15868      * will be captured. Setting this to `includeSensitive` will include cookies and
15869      * authentication data. Setting it to `everything` will include all bytes
15870      * transferred on sockets. Can be `default`, `includeSensitive` or `everything`.
15871      */
15872     captureMode?: ('default' | 'includeSensitive' | 'everything');
15873     /**
15874      * When the log grows beyond this size, logging will automatically stop. Defaults
15875      * to unlimited.
15876      */
15877     maxFileSize?: number;
15878   }
15879
15880   interface Streams {
15881     video?: (Video) | (WebFrameMain);
15882     /**
15883      * If a string is specified, can be `loopback` or `loopbackWithMute`. Specifying a
15884      * loopback device will capture system audio, and is currently only supported on
15885      * Windows. If a WebFrameMain is specified, will capture audio from that frame.
15886      */
15887     audio?: (('loopback' | 'loopbackWithMute')) | (WebFrameMain);
15888   }
15889
15890   interface SystemMemoryInfo {
15891     /**
15892      * The total amount of physical memory in Kilobytes available to the system.
15893      */
15894     total: number;
15895     /**
15896      * The total amount of memory not being used by applications or disk cache.
15897      */
15898     free: number;
15899     /**
15900      * The total amount of swap memory in Kilobytes available to the system.
15901      *
15902      * @platform win32,linux
15903      */
15904     swapTotal: number;
15905     /**
15906      * The free amount of swap memory in Kilobytes available to the system.
15907      *
15908      * @platform win32,linux
15909      */
15910     swapFree: number;
15911   }
15912
15913   interface TitleBarOverlayOptions {
15914     /**
15915      * The CSS color of the Window Controls Overlay when enabled.
15916      *
15917      * @platform win32
15918      */
15919     color?: string;
15920     /**
15921      * The CSS color of the symbols on the Window Controls Overlay when enabled.
15922      *
15923      * @platform win32
15924      */
15925     symbolColor?: string;
15926     /**
15927      * The height of the title bar and Window Controls Overlay in pixels.
15928      *
15929      * @platform win32
15930      */
15931     height?: number;
15932   }
15933
15934   interface TitleOptions {
15935     /**
15936      * The font family variant to display, can be `monospaced` or `monospacedDigit`.
15937      * `monospaced` is available in macOS 10.15+ and `monospacedDigit` is available in
15938      * macOS 10.11+.  When left blank, the title uses the default system font.
15939      */
15940     fontType?: ('monospaced' | 'monospacedDigit');
15941   }
15942
15943   interface ToBitmapOptions {
15944     /**
15945      * Defaults to 1.0.
15946      */
15947     scaleFactor?: number;
15948   }
15949
15950   interface ToDataURLOptions {
15951     /**
15952      * Defaults to 1.0.
15953      */
15954     scaleFactor?: number;
15955   }
15956
15957   interface ToPNGOptions {
15958     /**
15959      * Defaults to 1.0.
15960      */
15961     scaleFactor?: number;
15962   }
15963
15964   interface TouchBarButtonConstructorOptions {
15965     /**
15966      * Button text.
15967      */
15968     label?: string;
15969     /**
15970      * A short description of the button for use by screenreaders like VoiceOver.
15971      */
15972     accessibilityLabel?: string;
15973     /**
15974      * Button background color in hex format, i.e `#ABCDEF`.
15975      */
15976     backgroundColor?: string;
15977     /**
15978      * Button icon.
15979      */
15980     icon?: (NativeImage) | (string);
15981     /**
15982      * Can be `left`, `right` or `overlay`. Defaults to `overlay`.
15983      */
15984     iconPosition?: ('left' | 'right' | 'overlay');
15985     /**
15986      * Function to call when the button is clicked.
15987      */
15988     click?: () => void;
15989     /**
15990      * Whether the button is in an enabled state.  Default is `true`.
15991      */
15992     enabled?: boolean;
15993   }
15994
15995   interface TouchBarColorPickerConstructorOptions {
15996     /**
15997      * Array of hex color strings to appear as possible colors to select.
15998      */
15999     availableColors?: string[];
16000     /**
16001      * The selected hex color in the picker, i.e `#ABCDEF`.
16002      */
16003     selectedColor?: string;
16004     /**
16005      * Function to call when a color is selected.
16006      */
16007     change?: (color: string) => void;
16008   }
16009
16010   interface TouchBarConstructorOptions {
16011     items?: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>;
16012     escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null);
16013   }
16014
16015   interface TouchBarGroupConstructorOptions {
16016     /**
16017      * Items to display as a group.
16018      */
16019     items: TouchBar;
16020   }
16021
16022   interface TouchBarLabelConstructorOptions {
16023     /**
16024      * Text to display.
16025      */
16026     label?: string;
16027     /**
16028      * A short description of the button for use by screenreaders like VoiceOver.
16029      */
16030     accessibilityLabel?: string;
16031     /**
16032      * Hex color of text, i.e `#ABCDEF`.
16033      */
16034     textColor?: string;
16035   }
16036
16037   interface TouchBarPopoverConstructorOptions {
16038     /**
16039      * Popover button text.
16040      */
16041     label?: string;
16042     /**
16043      * Popover button icon.
16044      */
16045     icon?: NativeImage;
16046     /**
16047      * Items to display in the popover.
16048      */
16049     items: TouchBar;
16050     /**
16051      * `true` to display a close button on the left of the popover, `false` to not show
16052      * it. Default is `true`.
16053      */
16054     showCloseButton?: boolean;
16055   }
16056
16057   interface TouchBarScrubberConstructorOptions {
16058     /**
16059      * An array of items to place in this scrubber.
16060      */
16061     items: ScrubberItem[];
16062     /**
16063      * Called when the user taps an item that was not the last tapped item.
16064      */
16065     select?: (selectedIndex: number) => void;
16066     /**
16067      * Called when the user taps any item.
16068      */
16069     highlight?: (highlightedIndex: number) => void;
16070     /**
16071      * Selected item style. Can be `background`, `outline` or `none`. Defaults to
16072      * `none`.
16073      */
16074     selectedStyle?: ('background' | 'outline' | 'none');
16075     /**
16076      * Selected overlay item style. Can be `background`, `outline` or `none`. Defaults
16077      * to `none`.
16078      */
16079     overlayStyle?: ('background' | 'outline' | 'none');
16080     /**
16081      * Whether to show arrow buttons. Defaults to `false` and is only shown if `items`
16082      * is non-empty.
16083      */
16084     showArrowButtons?: boolean;
16085     /**
16086      * Can be `fixed` or `free`. The default is `free`.
16087      */
16088     mode?: ('fixed' | 'free');
16089     /**
16090      * Defaults to `true`.
16091      */
16092     continuous?: boolean;
16093   }
16094
16095   interface TouchBarSegmentedControlConstructorOptions {
16096     /**
16097      * Style of the segments:
16098      */
16099     segmentStyle?: ('automatic' | 'rounded' | 'textured-rounded' | 'round-rect' | 'textured-square' | 'capsule' | 'small-square' | 'separated');
16100     /**
16101      * The selection mode of the control:
16102      */
16103     mode?: ('single' | 'multiple' | 'buttons');
16104     /**
16105      * An array of segments to place in this control.
16106      */
16107     segments: SegmentedControlSegment[];
16108     /**
16109      * The index of the currently selected segment, will update automatically with user
16110      * interaction. When the mode is `multiple` it will be the last selected item.
16111      */
16112     selectedIndex?: number;
16113     /**
16114      * Called when the user selects a new segment.
16115      */
16116     change?: (selectedIndex: number, isSelected: boolean) => void;
16117   }
16118
16119   interface TouchBarSliderConstructorOptions {
16120     /**
16121      * Label text.
16122      */
16123     label?: string;
16124     /**
16125      * Selected value.
16126      */
16127     value?: number;
16128     /**
16129      * Minimum value.
16130      */
16131     minValue?: number;
16132     /**
16133      * Maximum value.
16134      */
16135     maxValue?: number;
16136     /**
16137      * Function to call when the slider is changed.
16138      */
16139     change?: (newValue: number) => void;
16140   }
16141
16142   interface TouchBarSpacerConstructorOptions {
16143     /**
16144      * Size of spacer, possible values are:
16145      */
16146     size?: ('small' | 'large' | 'flexible');
16147   }
16148
16149   interface TraceBufferUsageReturnValue {
16150     value: number;
16151     percentage: number;
16152   }
16153
16154   interface UpdateTargetUrlEvent extends Event {
16155     url: string;
16156   }
16157
16158   interface UploadProgress {
16159     /**
16160      * Whether the request is currently active. If this is false no other properties
16161      * will be set
16162      */
16163     active: boolean;
16164     /**
16165      * Whether the upload has started. If this is false both `current` and `total` will
16166      * be set to 0.
16167      */
16168     started: boolean;
16169     /**
16170      * The number of bytes that have been uploaded so far
16171      */
16172     current: number;
16173     /**
16174      * The number of bytes that will be uploaded this request
16175      */
16176     total: number;
16177   }
16178
16179   interface VisibleOnAllWorkspacesOptions {
16180     /**
16181      * Sets whether the window should be visible above fullscreen windows.
16182      *
16183      * @platform darwin
16184      */
16185     visibleOnFullScreen?: boolean;
16186     /**
16187      * Calling setVisibleOnAllWorkspaces will by default transform the process type
16188      * between UIElementApplication and ForegroundApplication to ensure the correct
16189      * behavior. However, this will hide the window and dock for a short time every
16190      * time it is called. If your window is already of type UIElementApplication, you
16191      * can bypass this transformation by passing true to skipTransformProcessType.
16192      *
16193      * @platform darwin
16194      */
16195     skipTransformProcessType?: boolean;
16196   }
16197
16198   interface WebContentsPrintOptions {
16199     /**
16200      * Don't ask user for print settings. Default is `false`.
16201      */
16202     silent?: boolean;
16203     /**
16204      * Prints the background color and image of the web page. Default is `false`.
16205      */
16206     printBackground?: boolean;
16207     /**
16208      * Set the printer device name to use. Must be the system-defined name and not the
16209      * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
16210      */
16211     deviceName?: string;
16212     /**
16213      * Set whether the printed web page will be in color or grayscale. Default is
16214      * `true`.
16215      */
16216     color?: boolean;
16217     margins?: Margins;
16218     /**
16219      * Whether the web page should be printed in landscape mode. Default is `false`.
16220      */
16221     landscape?: boolean;
16222     /**
16223      * The scale factor of the web page.
16224      */
16225     scaleFactor?: number;
16226     /**
16227      * The number of pages to print per page sheet.
16228      */
16229     pagesPerSheet?: number;
16230     /**
16231      * Whether the web page should be collated.
16232      */
16233     collate?: boolean;
16234     /**
16235      * The number of copies of the web page to print.
16236      */
16237     copies?: number;
16238     /**
16239      * The page range to print. On macOS, only one range is honored.
16240      */
16241     pageRanges?: PageRanges[];
16242     /**
16243      * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
16244      * `longEdge`.
16245      */
16246     duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
16247     dpi?: Record<string, number>;
16248     /**
16249      * string to be printed as page header.
16250      */
16251     header?: string;
16252     /**
16253      * string to be printed as page footer.
16254      */
16255     footer?: string;
16256     /**
16257      * Specify page size of the printed document. Can be `A3`, `A4`, `A5`, `Legal`,
16258      * `Letter`, `Tabloid` or an Object containing `height` and `width`.
16259      */
16260     pageSize?: (string) | (Size);
16261   }
16262
16263   interface WebviewTagPrintOptions {
16264     /**
16265      * Don't ask user for print settings. Default is `false`.
16266      */
16267     silent?: boolean;
16268     /**
16269      * Prints the background color and image of the web page. Default is `false`.
16270      */
16271     printBackground?: boolean;
16272     /**
16273      * Set the printer device name to use. Must be the system-defined name and not the
16274      * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
16275      */
16276     deviceName?: string;
16277     /**
16278      * Set whether the printed web page will be in color or grayscale. Default is
16279      * `true`.
16280      */
16281     color?: boolean;
16282     margins?: Margins;
16283     /**
16284      * Whether the web page should be printed in landscape mode. Default is `false`.
16285      */
16286     landscape?: boolean;
16287     /**
16288      * The scale factor of the web page.
16289      */
16290     scaleFactor?: number;
16291     /**
16292      * The number of pages to print per page sheet.
16293      */
16294     pagesPerSheet?: number;
16295     /**
16296      * Whether the web page should be collated.
16297      */
16298     collate?: boolean;
16299     /**
16300      * The number of copies of the web page to print.
16301      */
16302     copies?: number;
16303     /**
16304      * The page range to print.
16305      */
16306     pageRanges?: PageRanges[];
16307     /**
16308      * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
16309      * `longEdge`.
16310      */
16311     duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
16312     dpi?: Record<string, number>;
16313     /**
16314      * string to be printed as page header.
16315      */
16316     header?: string;
16317     /**
16318      * string to be printed as page footer.
16319      */
16320     footer?: string;
16321     /**
16322      * Specify page size of the printed document. Can be `A3`, `A4`, `A5`, `Legal`,
16323      * `Letter`, `Tabloid` or an Object containing `height` in microns.
16324      */
16325     pageSize?: (string) | (Size);
16326   }
16327
16328   interface WillNavigateEvent extends Event {
16329     url: string;
16330   }
16331
16332   interface WillResizeDetails {
16333     /**
16334      * The edge of the window being dragged for resizing. Can be `bottom`, `left`,
16335      * `right`, `top-left`, `top-right`, `bottom-left` or `bottom-right`.
16336      */
16337     edge: ('bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right');
16338   }
16339
16340   interface EditFlags {
16341     /**
16342      * Whether the renderer believes it can undo.
16343      */
16344     canUndo: boolean;
16345     /**
16346      * Whether the renderer believes it can redo.
16347      */
16348     canRedo: boolean;
16349     /**
16350      * Whether the renderer believes it can cut.
16351      */
16352     canCut: boolean;
16353     /**
16354      * Whether the renderer believes it can copy.
16355      */
16356     canCopy: boolean;
16357     /**
16358      * Whether the renderer believes it can paste.
16359      */
16360     canPaste: boolean;
16361     /**
16362      * Whether the renderer believes it can delete.
16363      */
16364     canDelete: boolean;
16365     /**
16366      * Whether the renderer believes it can select all.
16367      */
16368     canSelectAll: boolean;
16369     /**
16370      * Whether the renderer believes it can edit text richly.
16371      */
16372     canEditRichly: boolean;
16373   }
16374
16375   interface Env {
16376   }
16377
16378   interface FoundInPageResult {
16379     requestId: number;
16380     /**
16381      * Position of the active match.
16382      */
16383     activeMatchOrdinal: number;
16384     /**
16385      * Number of Matches.
16386      */
16387     matches: number;
16388     /**
16389      * Coordinates of first match region.
16390      */
16391     selectionArea: Rectangle;
16392     finalUpdate: boolean;
16393   }
16394
16395   interface LaunchItems {
16396     /**
16397      * name value of a registry entry.
16398      *
16399      * @platform win32
16400      */
16401     name: string;
16402     /**
16403      * The executable to an app that corresponds to a registry entry.
16404      *
16405      * @platform win32
16406      */
16407     path: string;
16408     /**
16409      * the command-line arguments to pass to the executable.
16410      *
16411      * @platform win32
16412      */
16413     args: string[];
16414     /**
16415      * one of `user` or `machine`. Indicates whether the registry entry is under
16416      * `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
16417      *
16418      * @platform win32
16419      */
16420     scope: string;
16421     /**
16422      * `true` if the app registry key is startup approved and therefore shows as
16423      * `enabled` in Task Manager and Windows settings.
16424      *
16425      * @platform win32
16426      */
16427     enabled: boolean;
16428   }
16429
16430   interface Margins {
16431     /**
16432      * Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
16433      * you will also need to specify `top`, `bottom`, `left`, and `right`.
16434      */
16435     marginType?: ('default' | 'none' | 'printableArea' | 'custom');
16436     /**
16437      * The top margin of the printed web page, in pixels.
16438      */
16439     top?: number;
16440     /**
16441      * The bottom margin of the printed web page, in pixels.
16442      */
16443     bottom?: number;
16444     /**
16445      * The left margin of the printed web page, in pixels.
16446      */
16447     left?: number;
16448     /**
16449      * The right margin of the printed web page, in pixels.
16450      */
16451     right?: number;
16452   }
16453
16454   interface MediaFlags {
16455     /**
16456      * Whether the media element has crashed.
16457      */
16458     inError: boolean;
16459     /**
16460      * Whether the media element is paused.
16461      */
16462     isPaused: boolean;
16463     /**
16464      * Whether the media element is muted.
16465      */
16466     isMuted: boolean;
16467     /**
16468      * Whether the media element has audio.
16469      */
16470     hasAudio: boolean;
16471     /**
16472      * Whether the media element is looping.
16473      */
16474     isLooping: boolean;
16475     /**
16476      * Whether the media element's controls are visible.
16477      */
16478     isControlsVisible: boolean;
16479     /**
16480      * Whether the media element's controls are toggleable.
16481      */
16482     canToggleControls: boolean;
16483     /**
16484      * Whether the media element can be printed.
16485      */
16486     canPrint: boolean;
16487     /**
16488      * Whether or not the media element can be downloaded.
16489      */
16490     canSave: boolean;
16491     /**
16492      * Whether the media element can show picture-in-picture.
16493      */
16494     canShowPictureInPicture: boolean;
16495     /**
16496      * Whether the media element is currently showing picture-in-picture.
16497      */
16498     isShowingPictureInPicture: boolean;
16499     /**
16500      * Whether the media element can be rotated.
16501      */
16502     canRotate: boolean;
16503     /**
16504      * Whether the media element can be looped.
16505      */
16506     canLoop: boolean;
16507   }
16508
16509   interface PageRanges {
16510     /**
16511      * Index of the first page to print (0-based).
16512      */
16513     from: number;
16514     /**
16515      * Index of the last page to print (inclusive) (0-based).
16516      */
16517     to: number;
16518   }
16519
16520   interface Params {
16521     /**
16522      * x coordinate.
16523      */
16524     x: number;
16525     /**
16526      * y coordinate.
16527      */
16528     y: number;
16529     /**
16530      * URL of the link that encloses the node the context menu was invoked on.
16531      */
16532     linkURL: string;
16533     /**
16534      * Text associated with the link. May be an empty string if the contents of the
16535      * link are an image.
16536      */
16537     linkText: string;
16538     /**
16539      * URL of the top level page that the context menu was invoked on.
16540      */
16541     pageURL: string;
16542     /**
16543      * URL of the subframe that the context menu was invoked on.
16544      */
16545     frameURL: string;
16546     /**
16547      * Source URL for the element that the context menu was invoked on. Elements with
16548      * source URLs are images, audio and video.
16549      */
16550     srcURL: string;
16551     /**
16552      * Type of the node the context menu was invoked on. Can be `none`, `image`,
16553      * `audio`, `video`, `canvas`, `file` or `plugin`.
16554      */
16555     mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
16556     /**
16557      * Whether the context menu was invoked on an image which has non-empty contents.
16558      */
16559     hasImageContents: boolean;
16560     /**
16561      * Whether the context is editable.
16562      */
16563     isEditable: boolean;
16564     /**
16565      * Text of the selection that the context menu was invoked on.
16566      */
16567     selectionText: string;
16568     /**
16569      * Title text of the selection that the context menu was invoked on.
16570      */
16571     titleText: string;
16572     /**
16573      * Alt text of the selection that the context menu was invoked on.
16574      */
16575     altText: string;
16576     /**
16577      * Suggested filename to be used when saving file through 'Save Link As' option of
16578      * context menu.
16579      */
16580     suggestedFilename: string;
16581     /**
16582      * Rect representing the coordinates in the document space of the selection.
16583      */
16584     selectionRect: Rectangle;
16585     /**
16586      * Start position of the selection text.
16587      */
16588     selectionStartOffset: number;
16589     /**
16590      * The referrer policy of the frame on which the menu is invoked.
16591      */
16592     referrerPolicy: Referrer;
16593     /**
16594      * The misspelled word under the cursor, if any.
16595      */
16596     misspelledWord: string;
16597     /**
16598      * An array of suggested words to show the user to replace the `misspelledWord`.
16599      * Only available if there is a misspelled word and spellchecker is enabled.
16600      */
16601     dictionarySuggestions: string[];
16602     /**
16603      * The character encoding of the frame on which the menu was invoked.
16604      */
16605     frameCharset: string;
16606     /**
16607      * If the context menu was invoked on an input field, the type of that field.
16608      * Possible values are `none`, `plainText`, `password`, `other`.
16609      */
16610     inputFieldType: string;
16611     /**
16612      * If the context is editable, whether or not spellchecking is enabled.
16613      */
16614     spellcheckEnabled: boolean;
16615     /**
16616      * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
16617      * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
16618      * `adjustSelection`, or `adjustSelectionReset`.
16619      */
16620     menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
16621     /**
16622      * The flags for the media element the context menu was invoked on.
16623      */
16624     mediaFlags: MediaFlags;
16625     /**
16626      * These flags indicate whether the renderer believes it is able to perform the
16627      * corresponding action.
16628      */
16629     editFlags: EditFlags;
16630   }
16631
16632   interface TitleBarOverlay {
16633     /**
16634      * The CSS color of the Window Controls Overlay when enabled. Default is the system
16635      * color.
16636      *
16637      * @platform win32
16638      */
16639     color?: string;
16640     /**
16641      * The CSS color of the symbols on the Window Controls Overlay when enabled.
16642      * Default is the system color.
16643      *
16644      * @platform win32
16645      */
16646     symbolColor?: string;
16647     /**
16648      * The height of the title bar and Window Controls Overlay in pixels. Default is
16649      * system height.
16650      *
16651      * @platform darwin,win32
16652      */
16653     height?: number;
16654   }
16655
16656   interface Video {
16657     /**
16658      * The id of the stream being granted. This will usually come from a
16659      * DesktopCapturerSource object.
16660      */
16661     id: string;
16662     /**
16663      * The name of the stream being granted. This will usually come from a
16664      * DesktopCapturerSource object.
16665      */
16666     name: string;
16667   }
16668
16669   interface WebPreferences {
16670     /**
16671      * Whether to enable DevTools. If it is set to `false`, can not use
16672      * `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
16673      */
16674     devTools?: boolean;
16675     /**
16676      * Whether node integration is enabled. Default is `false`.
16677      */
16678     nodeIntegration?: boolean;
16679     /**
16680      * Whether node integration is enabled in web workers. Default is `false`. More
16681      * about this can be found in Multithreading.
16682      */
16683     nodeIntegrationInWorker?: boolean;
16684     /**
16685      * Experimental option for enabling Node.js support in sub-frames such as iframes
16686      * and child windows. All your preloads will load for every iframe, you can use
16687      * `process.isMainFrame` to determine if you are in the main frame or not.
16688      */
16689     nodeIntegrationInSubFrames?: boolean;
16690     /**
16691      * Specifies a script that will be loaded before other scripts run in the page.
16692      * This script will always have access to node APIs no matter whether node
16693      * integration is turned on or off. The value should be the absolute file path to
16694      * the script. When node integration is turned off, the preload script can
16695      * reintroduce Node global symbols back to the global scope. See example here.
16696      */
16697     preload?: string;
16698     /**
16699      * If set, this will sandbox the renderer associated with the window, making it
16700      * compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
16701      * This is not the same as the `nodeIntegration` option and the APIs available to
16702      * the preload script are more limited. Read more about the option here.
16703      */
16704     sandbox?: boolean;
16705     /**
16706      * Sets the session used by the page. Instead of passing the Session object
16707      * directly, you can also choose to use the `partition` option instead, which
16708      * accepts a partition string. When both `session` and `partition` are provided,
16709      * `session` will be preferred. Default is the default session.
16710      */
16711     session?: Session;
16712     /**
16713      * Sets the session used by the page according to the session's partition string.
16714      * If `partition` starts with `persist:`, the page will use a persistent session
16715      * available to all pages in the app with the same `partition`. If there is no
16716      * `persist:` prefix, the page will use an in-memory session. By assigning the same
16717      * `partition`, multiple pages can share the same session. Default is the default
16718      * session.
16719      */
16720     partition?: string;
16721     /**
16722      * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
16723      */
16724     zoomFactor?: number;
16725     /**
16726      * Enables JavaScript support. Default is `true`.
16727      */
16728     javascript?: boolean;
16729     /**
16730      * When `false`, it will disable the same-origin policy (usually using testing
16731      * websites by people), and set `allowRunningInsecureContent` to `true` if this
16732      * options has not been set by user. Default is `true`.
16733      */
16734     webSecurity?: boolean;
16735     /**
16736      * Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is
16737      * `false`.
16738      */
16739     allowRunningInsecureContent?: boolean;
16740     /**
16741      * Enables image support. Default is `true`.
16742      */
16743     images?: boolean;
16744     /**
16745      * Specifies how to run image animations (E.g. GIFs).  Can be `animate`,
16746      * `animateOnce` or `noAnimation`.  Default is `animate`.
16747      */
16748     imageAnimationPolicy?: ('animate' | 'animateOnce' | 'noAnimation');
16749     /**
16750      * Make TextArea elements resizable. Default is `true`.
16751      */
16752     textAreasAreResizable?: boolean;
16753     /**
16754      * Enables WebGL support. Default is `true`.
16755      */
16756     webgl?: boolean;
16757     /**
16758      * Whether plugins should be enabled. Default is `false`.
16759      */
16760     plugins?: boolean;
16761     /**
16762      * Enables Chromium's experimental features. Default is `false`.
16763      */
16764     experimentalFeatures?: boolean;
16765     /**
16766      * Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.
16767      *
16768      * @platform darwin
16769      */
16770     scrollBounce?: boolean;
16771     /**
16772      * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
16773      * to enable. The full list of supported feature strings can be found in the
16774      * RuntimeEnabledFeatures.json5 file.
16775      */
16776     enableBlinkFeatures?: string;
16777     /**
16778      * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
16779      * to disable. The full list of supported feature strings can be found in the
16780      * RuntimeEnabledFeatures.json5 file.
16781      */
16782     disableBlinkFeatures?: string;
16783     /**
16784      * Sets the default font for the font-family.
16785      */
16786     defaultFontFamily?: DefaultFontFamily;
16787     /**
16788      * Defaults to `16`.
16789      */
16790     defaultFontSize?: number;
16791     /**
16792      * Defaults to `13`.
16793      */
16794     defaultMonospaceFontSize?: number;
16795     /**
16796      * Defaults to `0`.
16797      */
16798     minimumFontSize?: number;
16799     /**
16800      * Defaults to `ISO-8859-1`.
16801      */
16802     defaultEncoding?: string;
16803     /**
16804      * Whether to throttle animations and timers when the page becomes background. This
16805      * also affects the Page Visibility API. Defaults to `true`.
16806      */
16807     backgroundThrottling?: boolean;
16808     /**
16809      * Whether to enable offscreen rendering for the browser window. Defaults to
16810      * `false`. See the offscreen rendering tutorial for more details.
16811      */
16812     offscreen?: boolean;
16813     /**
16814      * Whether to run Electron APIs and the specified `preload` script in a separate
16815      * JavaScript context. Defaults to `true`. The context that the `preload` script
16816      * runs in will only have access to its own dedicated `document` and `window`
16817      * globals, as well as its own set of JavaScript builtins (`Array`, `Object`,
16818      * `JSON`, etc.), which are all invisible to the loaded content. The Electron API
16819      * will only be available in the `preload` script and not the loaded page. This
16820      * option should be used when loading potentially untrusted remote content to
16821      * ensure the loaded content cannot tamper with the `preload` script and any
16822      * Electron APIs being used.  This option uses the same technique used by Chrome
16823      * Content Scripts.  You can access this context in the dev tools by selecting the
16824      * 'Electron Isolated Context' entry in the combo box at the top of the Console
16825      * tab.
16826      */
16827     contextIsolation?: boolean;
16828     /**
16829      * Whether to enable the `<webview>` tag. Defaults to `false`. **Note:** The
16830      * `preload` script configured for the `<webview>` will have node integration
16831      * enabled when it is executed so you should ensure remote/untrusted content is not
16832      * able to create a `<webview>` tag with a possibly malicious `preload` script. You
16833      * can use the `will-attach-webview` event on webContents to strip away the
16834      * `preload` script and to validate or alter the `<webview>`'s initial settings.
16835      */
16836     webviewTag?: boolean;
16837     /**
16838      * A list of strings that will be appended to `process.argv` in the renderer
16839      * process of this app.  Useful for passing small bits of data down to renderer
16840      * process preload scripts.
16841      */
16842     additionalArguments?: string[];
16843     /**
16844      * Whether to enable browser style consecutive dialog protection. Default is
16845      * `false`.
16846      */
16847     safeDialogs?: boolean;
16848     /**
16849      * The message to display when consecutive dialog protection is triggered. If not
16850      * defined the default message would be used, note that currently the default
16851      * message is in English and not localized.
16852      */
16853     safeDialogsMessage?: string;
16854     /**
16855      * Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
16856      * `false`.
16857      */
16858     disableDialogs?: boolean;
16859     /**
16860      * Whether dragging and dropping a file or link onto the page causes a navigation.
16861      * Default is `false`.
16862      */
16863     navigateOnDragDrop?: boolean;
16864     /**
16865      * Autoplay policy to apply to content in the window, can be
16866      * `no-user-gesture-required`, `user-gesture-required`,
16867      * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
16868      */
16869     autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
16870     /**
16871      * Whether to prevent the window from resizing when entering HTML Fullscreen.
16872      * Default is `false`.
16873      */
16874     disableHtmlFullscreenWindowResize?: boolean;
16875     /**
16876      * An alternative title string provided only to accessibility tools such as screen
16877      * readers. This string is not directly visible to users.
16878      */
16879     accessibleTitle?: string;
16880     /**
16881      * Whether to enable the builtin spellchecker. Default is `true`.
16882      */
16883     spellcheck?: boolean;
16884     /**
16885      * Whether to enable the WebSQL api. Default is `true`.
16886      */
16887     enableWebSQL?: boolean;
16888     /**
16889      * Enforces the v8 code caching policy used by blink. Accepted values are
16890      */
16891     v8CacheOptions?: ('none' | 'code' | 'bypassHeatCheck' | 'bypassHeatCheckAndEagerCompile');
16892     /**
16893      * Whether to enable preferred size mode. The preferred size is the minimum size
16894      * needed to contain the layout of the document—without requiring scrolling.
16895      * Enabling this will cause the `preferred-size-changed` event to be emitted on the
16896      * `WebContents` when the preferred size changes. Default is `false`.
16897      */
16898     enablePreferredSizeMode?: boolean;
16899   }
16900
16901   interface DefaultFontFamily {
16902     /**
16903      * Defaults to `Times New Roman`.
16904      */
16905     standard?: string;
16906     /**
16907      * Defaults to `Times New Roman`.
16908      */
16909     serif?: string;
16910     /**
16911      * Defaults to `Arial`.
16912      */
16913     sansSerif?: string;
16914     /**
16915      * Defaults to `Courier New`.
16916      */
16917     monospace?: string;
16918     /**
16919      * Defaults to `Script`.
16920      */
16921     cursive?: string;
16922     /**
16923      * Defaults to `Impact`.
16924      */
16925     fantasy?: string;
16926   }
16927
16928   interface RemoteMainInterface {
16929     app: App;
16930     autoUpdater: AutoUpdater;
16931     BrowserView: typeof BrowserView;
16932     BrowserWindow: typeof BrowserWindow;
16933     clipboard: Clipboard;
16934     contentTracing: ContentTracing;
16935     crashReporter: CrashReporter;
16936     desktopCapturer: DesktopCapturer;
16937     dialog: Dialog;
16938     globalShortcut: GlobalShortcut;
16939     inAppPurchase: InAppPurchase;
16940     ipcMain: IpcMain;
16941     Menu: typeof Menu;
16942     MenuItem: typeof MenuItem;
16943     MessageChannelMain: typeof MessageChannelMain;
16944     nativeImage: typeof NativeImage;
16945     nativeTheme: NativeTheme;
16946     net: Net;
16947     netLog: NetLog;
16948     Notification: typeof Notification;
16949     powerMonitor: PowerMonitor;
16950     powerSaveBlocker: PowerSaveBlocker;
16951     protocol: Protocol;
16952     pushNotifications: PushNotifications;
16953     safeStorage: SafeStorage;
16954     screen: Screen;
16955     session: typeof Session;
16956     ShareMenu: typeof ShareMenu;
16957     shell: Shell;
16958     systemPreferences: SystemPreferences;
16959     TouchBar: typeof TouchBar;
16960     Tray: typeof Tray;
16961     utilityProcess: typeof UtilityProcess;
16962     webContents: typeof WebContents;
16963     webFrameMain: typeof WebFrameMain;
16964   }
16965
16966
16967
16968   namespace Common {
16969     const clipboard: Clipboard;
16970     type Clipboard = Electron.Clipboard;
16971     const crashReporter: CrashReporter;
16972     type CrashReporter = Electron.CrashReporter;
16973     const nativeImage: typeof NativeImage;
16974     type NativeImage = Electron.NativeImage;
16975     const shell: Shell;
16976     type Shell = Electron.Shell;
16977     type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
16978     type AddRepresentationOptions = Electron.AddRepresentationOptions;
16979     type AnimationSettings = Electron.AnimationSettings;
16980     type AppDetailsOptions = Electron.AppDetailsOptions;
16981     type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
16982     type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
16983     type AuthInfo = Electron.AuthInfo;
16984     type AutoResizeOptions = Electron.AutoResizeOptions;
16985     type BeforeSendResponse = Electron.BeforeSendResponse;
16986     type BitmapOptions = Electron.BitmapOptions;
16987     type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
16988     type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
16989     type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
16990     type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
16991     type CallbackResponse = Electron.CallbackResponse;
16992     type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
16993     type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
16994     type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
16995     type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
16996     type Config = Electron.Config;
16997     type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
16998     type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
16999     type ContextMenuEvent = Electron.ContextMenuEvent;
17000     type ContextMenuParams = Electron.ContextMenuParams;
17001     type ContinueActivityDetails = Electron.ContinueActivityDetails;
17002     type CookiesGetFilter = Electron.CookiesGetFilter;
17003     type CookiesSetDetails = Electron.CookiesSetDetails;
17004     type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
17005     type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
17006     type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
17007     type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
17008     type Data = Electron.Data;
17009     type Details = Electron.Details;
17010     type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
17011     type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
17012     type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
17013     type DidFailLoadEvent = Electron.DidFailLoadEvent;
17014     type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
17015     type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
17016     type DidNavigateEvent = Electron.DidNavigateEvent;
17017     type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
17018     type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
17019     type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
17020     type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
17021     type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
17022     type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
17023     type FeedURLOptions = Electron.FeedURLOptions;
17024     type FileIconOptions = Electron.FileIconOptions;
17025     type FindInPageOptions = Electron.FindInPageOptions;
17026     type FocusOptions = Electron.FocusOptions;
17027     type ForkOptions = Electron.ForkOptions;
17028     type FoundInPageEvent = Electron.FoundInPageEvent;
17029     type FrameCreatedDetails = Electron.FrameCreatedDetails;
17030     type FromPartitionOptions = Electron.FromPartitionOptions;
17031     type HandlerDetails = Electron.HandlerDetails;
17032     type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17033     type HeapStatistics = Electron.HeapStatistics;
17034     type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
17035     type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
17036     type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
17037     type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
17038     type ImportCertificateOptions = Electron.ImportCertificateOptions;
17039     type Info = Electron.Info;
17040     type Input = Electron.Input;
17041     type InsertCSSOptions = Electron.InsertCSSOptions;
17042     type IpcMessageEvent = Electron.IpcMessageEvent;
17043     type Item = Electron.Item;
17044     type JumpListSettings = Electron.JumpListSettings;
17045     type LoadCommitEvent = Electron.LoadCommitEvent;
17046     type LoadExtensionOptions = Electron.LoadExtensionOptions;
17047     type LoadFileOptions = Electron.LoadFileOptions;
17048     type LoadURLOptions = Electron.LoadURLOptions;
17049     type LoginItemSettings = Electron.LoginItemSettings;
17050     type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
17051     type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
17052     type MessageBoxOptions = Electron.MessageBoxOptions;
17053     type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
17054     type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
17055     type MessageDetails = Electron.MessageDetails;
17056     type MessageEvent = Electron.MessageEvent;
17057     type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
17058     type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
17059     type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
17060     type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
17061     type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
17062     type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
17063     type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
17064     type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
17065     type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
17066     type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
17067     type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
17068     type OpenDialogOptions = Electron.OpenDialogOptions;
17069     type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
17070     type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
17071     type OpenExternalOptions = Electron.OpenExternalOptions;
17072     type Options = Electron.Options;
17073     type Opts = Electron.Opts;
17074     type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
17075     type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
17076     type Parameters = Electron.Parameters;
17077     type Payment = Electron.Payment;
17078     type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
17079     type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
17080     type PluginCrashedEvent = Electron.PluginCrashedEvent;
17081     type PopupOptions = Electron.PopupOptions;
17082     type PreconnectOptions = Electron.PreconnectOptions;
17083     type PrintToPDFOptions = Electron.PrintToPDFOptions;
17084     type Privileges = Electron.Privileges;
17085     type ProgressBarOptions = Electron.ProgressBarOptions;
17086     type Provider = Electron.Provider;
17087     type ReadBookmark = Electron.ReadBookmark;
17088     type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
17089     type RelaunchOptions = Electron.RelaunchOptions;
17090     type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
17091     type Request = Electron.Request;
17092     type ResizeOptions = Electron.ResizeOptions;
17093     type ResourceUsage = Electron.ResourceUsage;
17094     type Response = Electron.Response;
17095     type Result = Electron.Result;
17096     type SaveDialogOptions = Electron.SaveDialogOptions;
17097     type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
17098     type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
17099     type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
17100     type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
17101     type Settings = Electron.Settings;
17102     type SourcesOptions = Electron.SourcesOptions;
17103     type SSLConfigConfig = Electron.SSLConfigConfig;
17104     type StartLoggingOptions = Electron.StartLoggingOptions;
17105     type Streams = Electron.Streams;
17106     type SystemMemoryInfo = Electron.SystemMemoryInfo;
17107     type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
17108     type TitleOptions = Electron.TitleOptions;
17109     type ToBitmapOptions = Electron.ToBitmapOptions;
17110     type ToDataURLOptions = Electron.ToDataURLOptions;
17111     type ToPNGOptions = Electron.ToPNGOptions;
17112     type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
17113     type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
17114     type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
17115     type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
17116     type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
17117     type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
17118     type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
17119     type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
17120     type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
17121     type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
17122     type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
17123     type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
17124     type UploadProgress = Electron.UploadProgress;
17125     type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
17126     type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
17127     type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
17128     type WillNavigateEvent = Electron.WillNavigateEvent;
17129     type WillResizeDetails = Electron.WillResizeDetails;
17130     type EditFlags = Electron.EditFlags;
17131     type Env = Electron.Env;
17132     type FoundInPageResult = Electron.FoundInPageResult;
17133     type LaunchItems = Electron.LaunchItems;
17134     type Margins = Electron.Margins;
17135     type MediaFlags = Electron.MediaFlags;
17136     type PageRanges = Electron.PageRanges;
17137     type Params = Electron.Params;
17138     type TitleBarOverlay = Electron.TitleBarOverlay;
17139     type Video = Electron.Video;
17140     type WebPreferences = Electron.WebPreferences;
17141     type DefaultFontFamily = Electron.DefaultFontFamily;
17142     type BluetoothDevice = Electron.BluetoothDevice;
17143     type Certificate = Electron.Certificate;
17144     type CertificatePrincipal = Electron.CertificatePrincipal;
17145     type Cookie = Electron.Cookie;
17146     type CPUUsage = Electron.CPUUsage;
17147     type CrashReport = Electron.CrashReport;
17148     type CustomScheme = Electron.CustomScheme;
17149     type DesktopCapturerSource = Electron.DesktopCapturerSource;
17150     type Display = Electron.Display;
17151     type Event = Electron.Event;
17152     type Extension = Electron.Extension;
17153     type ExtensionInfo = Electron.ExtensionInfo;
17154     type FileFilter = Electron.FileFilter;
17155     type FilePathWithHeaders = Electron.FilePathWithHeaders;
17156     type GPUFeatureStatus = Electron.GPUFeatureStatus;
17157     type HIDDevice = Electron.HIDDevice;
17158     type InputEvent = Electron.InputEvent;
17159     type IOCounters = Electron.IOCounters;
17160     type IpcMainEvent = Electron.IpcMainEvent;
17161     type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
17162     type IpcRendererEvent = Electron.IpcRendererEvent;
17163     type JumpListCategory = Electron.JumpListCategory;
17164     type JumpListItem = Electron.JumpListItem;
17165     type KeyboardEvent = Electron.KeyboardEvent;
17166     type KeyboardInputEvent = Electron.KeyboardInputEvent;
17167     type MemoryInfo = Electron.MemoryInfo;
17168     type MemoryUsageDetails = Electron.MemoryUsageDetails;
17169     type MimeTypedBuffer = Electron.MimeTypedBuffer;
17170     type MouseInputEvent = Electron.MouseInputEvent;
17171     type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
17172     type NotificationAction = Electron.NotificationAction;
17173     type NotificationResponse = Electron.NotificationResponse;
17174     type PaymentDiscount = Electron.PaymentDiscount;
17175     type Point = Electron.Point;
17176     type PostBody = Electron.PostBody;
17177     type PrinterInfo = Electron.PrinterInfo;
17178     type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
17179     type ProcessMetric = Electron.ProcessMetric;
17180     type Product = Electron.Product;
17181     type ProductDiscount = Electron.ProductDiscount;
17182     type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
17183     type ProtocolRequest = Electron.ProtocolRequest;
17184     type ProtocolResponse = Electron.ProtocolResponse;
17185     type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
17186     type Rectangle = Electron.Rectangle;
17187     type Referrer = Electron.Referrer;
17188     type ScrubberItem = Electron.ScrubberItem;
17189     type SegmentedControlSegment = Electron.SegmentedControlSegment;
17190     type SerialPort = Electron.SerialPort;
17191     type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
17192     type SharedWorkerInfo = Electron.SharedWorkerInfo;
17193     type SharingItem = Electron.SharingItem;
17194     type ShortcutDetails = Electron.ShortcutDetails;
17195     type Size = Electron.Size;
17196     type Task = Electron.Task;
17197     type ThumbarButton = Electron.ThumbarButton;
17198     type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
17199     type TraceConfig = Electron.TraceConfig;
17200     type Transaction = Electron.Transaction;
17201     type UploadData = Electron.UploadData;
17202     type UploadFile = Electron.UploadFile;
17203     type UploadRawData = Electron.UploadRawData;
17204     type UserDefaultTypes = Electron.UserDefaultTypes;
17205     type WebRequestFilter = Electron.WebRequestFilter;
17206     type WebSource = Electron.WebSource;
17207   }
17208
17209   namespace Main {
17210     const app: App;
17211     type App = Electron.App;
17212     const autoUpdater: AutoUpdater;
17213     type AutoUpdater = Electron.AutoUpdater;
17214     class BrowserView extends Electron.BrowserView {}
17215     class BrowserWindow extends Electron.BrowserWindow {}
17216     type ClientRequest = Electron.ClientRequest;
17217     type CommandLine = Electron.CommandLine;
17218     const contentTracing: ContentTracing;
17219     type ContentTracing = Electron.ContentTracing;
17220     type Cookies = Electron.Cookies;
17221     type Debugger = Electron.Debugger;
17222     const desktopCapturer: DesktopCapturer;
17223     type DesktopCapturer = Electron.DesktopCapturer;
17224     const dialog: Dialog;
17225     type Dialog = Electron.Dialog;
17226     type Dock = Electron.Dock;
17227     type DownloadItem = Electron.DownloadItem;
17228     const globalShortcut: GlobalShortcut;
17229     type GlobalShortcut = Electron.GlobalShortcut;
17230     const inAppPurchase: InAppPurchase;
17231     type InAppPurchase = Electron.InAppPurchase;
17232     type IncomingMessage = Electron.IncomingMessage;
17233     const ipcMain: IpcMain;
17234     type IpcMain = Electron.IpcMain;
17235     class Menu extends Electron.Menu {}
17236     class MenuItem extends Electron.MenuItem {}
17237     class MessageChannelMain extends Electron.MessageChannelMain {}
17238     type MessagePortMain = Electron.MessagePortMain;
17239     const nativeTheme: NativeTheme;
17240     type NativeTheme = Electron.NativeTheme;
17241     const net: Net;
17242     type Net = Electron.Net;
17243     const netLog: NetLog;
17244     type NetLog = Electron.NetLog;
17245     class Notification extends Electron.Notification {}
17246     const powerMonitor: PowerMonitor;
17247     type PowerMonitor = Electron.PowerMonitor;
17248     const powerSaveBlocker: PowerSaveBlocker;
17249     type PowerSaveBlocker = Electron.PowerSaveBlocker;
17250     const protocol: Protocol;
17251     type Protocol = Electron.Protocol;
17252     const pushNotifications: PushNotifications;
17253     type PushNotifications = Electron.PushNotifications;
17254     const safeStorage: SafeStorage;
17255     type SafeStorage = Electron.SafeStorage;
17256     const screen: Screen;
17257     type Screen = Electron.Screen;
17258     type ServiceWorkers = Electron.ServiceWorkers;
17259     const session: typeof Session;
17260     type Session = Electron.Session;
17261     class ShareMenu extends Electron.ShareMenu {}
17262     const systemPreferences: SystemPreferences;
17263     type SystemPreferences = Electron.SystemPreferences;
17264     class TouchBar extends Electron.TouchBar {}
17265     type TouchBarButton = Electron.TouchBarButton;
17266     type TouchBarColorPicker = Electron.TouchBarColorPicker;
17267     type TouchBarGroup = Electron.TouchBarGroup;
17268     type TouchBarLabel = Electron.TouchBarLabel;
17269     type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
17270     type TouchBarPopover = Electron.TouchBarPopover;
17271     type TouchBarScrubber = Electron.TouchBarScrubber;
17272     type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
17273     type TouchBarSlider = Electron.TouchBarSlider;
17274     type TouchBarSpacer = Electron.TouchBarSpacer;
17275     class Tray extends Electron.Tray {}
17276     const utilityProcess: typeof UtilityProcess;
17277     type UtilityProcess = Electron.UtilityProcess;
17278     const webContents: typeof WebContents;
17279     type WebContents = Electron.WebContents;
17280     const webFrameMain: typeof WebFrameMain;
17281     type WebFrameMain = Electron.WebFrameMain;
17282     type WebRequest = Electron.WebRequest;
17283     type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
17284     type AddRepresentationOptions = Electron.AddRepresentationOptions;
17285     type AnimationSettings = Electron.AnimationSettings;
17286     type AppDetailsOptions = Electron.AppDetailsOptions;
17287     type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
17288     type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
17289     type AuthInfo = Electron.AuthInfo;
17290     type AutoResizeOptions = Electron.AutoResizeOptions;
17291     type BeforeSendResponse = Electron.BeforeSendResponse;
17292     type BitmapOptions = Electron.BitmapOptions;
17293     type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
17294     type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
17295     type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
17296     type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
17297     type CallbackResponse = Electron.CallbackResponse;
17298     type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
17299     type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
17300     type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
17301     type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
17302     type Config = Electron.Config;
17303     type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
17304     type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
17305     type ContextMenuEvent = Electron.ContextMenuEvent;
17306     type ContextMenuParams = Electron.ContextMenuParams;
17307     type ContinueActivityDetails = Electron.ContinueActivityDetails;
17308     type CookiesGetFilter = Electron.CookiesGetFilter;
17309     type CookiesSetDetails = Electron.CookiesSetDetails;
17310     type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
17311     type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
17312     type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
17313     type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
17314     type Data = Electron.Data;
17315     type Details = Electron.Details;
17316     type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
17317     type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
17318     type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
17319     type DidFailLoadEvent = Electron.DidFailLoadEvent;
17320     type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
17321     type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
17322     type DidNavigateEvent = Electron.DidNavigateEvent;
17323     type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
17324     type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
17325     type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
17326     type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
17327     type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
17328     type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
17329     type FeedURLOptions = Electron.FeedURLOptions;
17330     type FileIconOptions = Electron.FileIconOptions;
17331     type FindInPageOptions = Electron.FindInPageOptions;
17332     type FocusOptions = Electron.FocusOptions;
17333     type ForkOptions = Electron.ForkOptions;
17334     type FoundInPageEvent = Electron.FoundInPageEvent;
17335     type FrameCreatedDetails = Electron.FrameCreatedDetails;
17336     type FromPartitionOptions = Electron.FromPartitionOptions;
17337     type HandlerDetails = Electron.HandlerDetails;
17338     type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17339     type HeapStatistics = Electron.HeapStatistics;
17340     type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
17341     type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
17342     type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
17343     type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
17344     type ImportCertificateOptions = Electron.ImportCertificateOptions;
17345     type Info = Electron.Info;
17346     type Input = Electron.Input;
17347     type InsertCSSOptions = Electron.InsertCSSOptions;
17348     type IpcMessageEvent = Electron.IpcMessageEvent;
17349     type Item = Electron.Item;
17350     type JumpListSettings = Electron.JumpListSettings;
17351     type LoadCommitEvent = Electron.LoadCommitEvent;
17352     type LoadExtensionOptions = Electron.LoadExtensionOptions;
17353     type LoadFileOptions = Electron.LoadFileOptions;
17354     type LoadURLOptions = Electron.LoadURLOptions;
17355     type LoginItemSettings = Electron.LoginItemSettings;
17356     type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
17357     type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
17358     type MessageBoxOptions = Electron.MessageBoxOptions;
17359     type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
17360     type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
17361     type MessageDetails = Electron.MessageDetails;
17362     type MessageEvent = Electron.MessageEvent;
17363     type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
17364     type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
17365     type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
17366     type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
17367     type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
17368     type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
17369     type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
17370     type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
17371     type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
17372     type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
17373     type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
17374     type OpenDialogOptions = Electron.OpenDialogOptions;
17375     type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
17376     type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
17377     type OpenExternalOptions = Electron.OpenExternalOptions;
17378     type Options = Electron.Options;
17379     type Opts = Electron.Opts;
17380     type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
17381     type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
17382     type Parameters = Electron.Parameters;
17383     type Payment = Electron.Payment;
17384     type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
17385     type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
17386     type PluginCrashedEvent = Electron.PluginCrashedEvent;
17387     type PopupOptions = Electron.PopupOptions;
17388     type PreconnectOptions = Electron.PreconnectOptions;
17389     type PrintToPDFOptions = Electron.PrintToPDFOptions;
17390     type Privileges = Electron.Privileges;
17391     type ProgressBarOptions = Electron.ProgressBarOptions;
17392     type Provider = Electron.Provider;
17393     type ReadBookmark = Electron.ReadBookmark;
17394     type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
17395     type RelaunchOptions = Electron.RelaunchOptions;
17396     type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
17397     type Request = Electron.Request;
17398     type ResizeOptions = Electron.ResizeOptions;
17399     type ResourceUsage = Electron.ResourceUsage;
17400     type Response = Electron.Response;
17401     type Result = Electron.Result;
17402     type SaveDialogOptions = Electron.SaveDialogOptions;
17403     type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
17404     type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
17405     type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
17406     type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
17407     type Settings = Electron.Settings;
17408     type SourcesOptions = Electron.SourcesOptions;
17409     type SSLConfigConfig = Electron.SSLConfigConfig;
17410     type StartLoggingOptions = Electron.StartLoggingOptions;
17411     type Streams = Electron.Streams;
17412     type SystemMemoryInfo = Electron.SystemMemoryInfo;
17413     type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
17414     type TitleOptions = Electron.TitleOptions;
17415     type ToBitmapOptions = Electron.ToBitmapOptions;
17416     type ToDataURLOptions = Electron.ToDataURLOptions;
17417     type ToPNGOptions = Electron.ToPNGOptions;
17418     type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
17419     type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
17420     type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
17421     type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
17422     type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
17423     type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
17424     type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
17425     type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
17426     type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
17427     type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
17428     type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
17429     type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
17430     type UploadProgress = Electron.UploadProgress;
17431     type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
17432     type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
17433     type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
17434     type WillNavigateEvent = Electron.WillNavigateEvent;
17435     type WillResizeDetails = Electron.WillResizeDetails;
17436     type EditFlags = Electron.EditFlags;
17437     type Env = Electron.Env;
17438     type FoundInPageResult = Electron.FoundInPageResult;
17439     type LaunchItems = Electron.LaunchItems;
17440     type Margins = Electron.Margins;
17441     type MediaFlags = Electron.MediaFlags;
17442     type PageRanges = Electron.PageRanges;
17443     type Params = Electron.Params;
17444     type TitleBarOverlay = Electron.TitleBarOverlay;
17445     type Video = Electron.Video;
17446     type WebPreferences = Electron.WebPreferences;
17447     type DefaultFontFamily = Electron.DefaultFontFamily;
17448     type BluetoothDevice = Electron.BluetoothDevice;
17449     type Certificate = Electron.Certificate;
17450     type CertificatePrincipal = Electron.CertificatePrincipal;
17451     type Cookie = Electron.Cookie;
17452     type CPUUsage = Electron.CPUUsage;
17453     type CrashReport = Electron.CrashReport;
17454     type CustomScheme = Electron.CustomScheme;
17455     type DesktopCapturerSource = Electron.DesktopCapturerSource;
17456     type Display = Electron.Display;
17457     type Event = Electron.Event;
17458     type Extension = Electron.Extension;
17459     type ExtensionInfo = Electron.ExtensionInfo;
17460     type FileFilter = Electron.FileFilter;
17461     type FilePathWithHeaders = Electron.FilePathWithHeaders;
17462     type GPUFeatureStatus = Electron.GPUFeatureStatus;
17463     type HIDDevice = Electron.HIDDevice;
17464     type InputEvent = Electron.InputEvent;
17465     type IOCounters = Electron.IOCounters;
17466     type IpcMainEvent = Electron.IpcMainEvent;
17467     type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
17468     type IpcRendererEvent = Electron.IpcRendererEvent;
17469     type JumpListCategory = Electron.JumpListCategory;
17470     type JumpListItem = Electron.JumpListItem;
17471     type KeyboardEvent = Electron.KeyboardEvent;
17472     type KeyboardInputEvent = Electron.KeyboardInputEvent;
17473     type MemoryInfo = Electron.MemoryInfo;
17474     type MemoryUsageDetails = Electron.MemoryUsageDetails;
17475     type MimeTypedBuffer = Electron.MimeTypedBuffer;
17476     type MouseInputEvent = Electron.MouseInputEvent;
17477     type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
17478     type NotificationAction = Electron.NotificationAction;
17479     type NotificationResponse = Electron.NotificationResponse;
17480     type PaymentDiscount = Electron.PaymentDiscount;
17481     type Point = Electron.Point;
17482     type PostBody = Electron.PostBody;
17483     type PrinterInfo = Electron.PrinterInfo;
17484     type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
17485     type ProcessMetric = Electron.ProcessMetric;
17486     type Product = Electron.Product;
17487     type ProductDiscount = Electron.ProductDiscount;
17488     type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
17489     type ProtocolRequest = Electron.ProtocolRequest;
17490     type ProtocolResponse = Electron.ProtocolResponse;
17491     type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
17492     type Rectangle = Electron.Rectangle;
17493     type Referrer = Electron.Referrer;
17494     type ScrubberItem = Electron.ScrubberItem;
17495     type SegmentedControlSegment = Electron.SegmentedControlSegment;
17496     type SerialPort = Electron.SerialPort;
17497     type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
17498     type SharedWorkerInfo = Electron.SharedWorkerInfo;
17499     type SharingItem = Electron.SharingItem;
17500     type ShortcutDetails = Electron.ShortcutDetails;
17501     type Size = Electron.Size;
17502     type Task = Electron.Task;
17503     type ThumbarButton = Electron.ThumbarButton;
17504     type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
17505     type TraceConfig = Electron.TraceConfig;
17506     type Transaction = Electron.Transaction;
17507     type UploadData = Electron.UploadData;
17508     type UploadFile = Electron.UploadFile;
17509     type UploadRawData = Electron.UploadRawData;
17510     type UserDefaultTypes = Electron.UserDefaultTypes;
17511     type WebRequestFilter = Electron.WebRequestFilter;
17512     type WebSource = Electron.WebSource;
17513   }
17514
17515   namespace Renderer {
17516     const contextBridge: ContextBridge;
17517     type ContextBridge = Electron.ContextBridge;
17518     const ipcRenderer: IpcRenderer;
17519     type IpcRenderer = Electron.IpcRenderer;
17520     const webFrame: WebFrame;
17521     type WebFrame = Electron.WebFrame;
17522     type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
17523     type AddRepresentationOptions = Electron.AddRepresentationOptions;
17524     type AnimationSettings = Electron.AnimationSettings;
17525     type AppDetailsOptions = Electron.AppDetailsOptions;
17526     type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
17527     type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
17528     type AuthInfo = Electron.AuthInfo;
17529     type AutoResizeOptions = Electron.AutoResizeOptions;
17530     type BeforeSendResponse = Electron.BeforeSendResponse;
17531     type BitmapOptions = Electron.BitmapOptions;
17532     type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
17533     type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
17534     type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
17535     type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
17536     type CallbackResponse = Electron.CallbackResponse;
17537     type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
17538     type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
17539     type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
17540     type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
17541     type Config = Electron.Config;
17542     type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
17543     type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
17544     type ContextMenuEvent = Electron.ContextMenuEvent;
17545     type ContextMenuParams = Electron.ContextMenuParams;
17546     type ContinueActivityDetails = Electron.ContinueActivityDetails;
17547     type CookiesGetFilter = Electron.CookiesGetFilter;
17548     type CookiesSetDetails = Electron.CookiesSetDetails;
17549     type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
17550     type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
17551     type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
17552     type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
17553     type Data = Electron.Data;
17554     type Details = Electron.Details;
17555     type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
17556     type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
17557     type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
17558     type DidFailLoadEvent = Electron.DidFailLoadEvent;
17559     type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
17560     type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
17561     type DidNavigateEvent = Electron.DidNavigateEvent;
17562     type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
17563     type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
17564     type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
17565     type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
17566     type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
17567     type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
17568     type FeedURLOptions = Electron.FeedURLOptions;
17569     type FileIconOptions = Electron.FileIconOptions;
17570     type FindInPageOptions = Electron.FindInPageOptions;
17571     type FocusOptions = Electron.FocusOptions;
17572     type ForkOptions = Electron.ForkOptions;
17573     type FoundInPageEvent = Electron.FoundInPageEvent;
17574     type FrameCreatedDetails = Electron.FrameCreatedDetails;
17575     type FromPartitionOptions = Electron.FromPartitionOptions;
17576     type HandlerDetails = Electron.HandlerDetails;
17577     type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17578     type HeapStatistics = Electron.HeapStatistics;
17579     type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
17580     type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
17581     type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
17582     type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
17583     type ImportCertificateOptions = Electron.ImportCertificateOptions;
17584     type Info = Electron.Info;
17585     type Input = Electron.Input;
17586     type InsertCSSOptions = Electron.InsertCSSOptions;
17587     type IpcMessageEvent = Electron.IpcMessageEvent;
17588     type Item = Electron.Item;
17589     type JumpListSettings = Electron.JumpListSettings;
17590     type LoadCommitEvent = Electron.LoadCommitEvent;
17591     type LoadExtensionOptions = Electron.LoadExtensionOptions;
17592     type LoadFileOptions = Electron.LoadFileOptions;
17593     type LoadURLOptions = Electron.LoadURLOptions;
17594     type LoginItemSettings = Electron.LoginItemSettings;
17595     type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
17596     type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
17597     type MessageBoxOptions = Electron.MessageBoxOptions;
17598     type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
17599     type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
17600     type MessageDetails = Electron.MessageDetails;
17601     type MessageEvent = Electron.MessageEvent;
17602     type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
17603     type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
17604     type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
17605     type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
17606     type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
17607     type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
17608     type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
17609     type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
17610     type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
17611     type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
17612     type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
17613     type OpenDialogOptions = Electron.OpenDialogOptions;
17614     type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
17615     type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
17616     type OpenExternalOptions = Electron.OpenExternalOptions;
17617     type Options = Electron.Options;
17618     type Opts = Electron.Opts;
17619     type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
17620     type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
17621     type Parameters = Electron.Parameters;
17622     type Payment = Electron.Payment;
17623     type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
17624     type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
17625     type PluginCrashedEvent = Electron.PluginCrashedEvent;
17626     type PopupOptions = Electron.PopupOptions;
17627     type PreconnectOptions = Electron.PreconnectOptions;
17628     type PrintToPDFOptions = Electron.PrintToPDFOptions;
17629     type Privileges = Electron.Privileges;
17630     type ProgressBarOptions = Electron.ProgressBarOptions;
17631     type Provider = Electron.Provider;
17632     type ReadBookmark = Electron.ReadBookmark;
17633     type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
17634     type RelaunchOptions = Electron.RelaunchOptions;
17635     type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
17636     type Request = Electron.Request;
17637     type ResizeOptions = Electron.ResizeOptions;
17638     type ResourceUsage = Electron.ResourceUsage;
17639     type Response = Electron.Response;
17640     type Result = Electron.Result;
17641     type SaveDialogOptions = Electron.SaveDialogOptions;
17642     type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
17643     type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
17644     type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
17645     type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
17646     type Settings = Electron.Settings;
17647     type SourcesOptions = Electron.SourcesOptions;
17648     type SSLConfigConfig = Electron.SSLConfigConfig;
17649     type StartLoggingOptions = Electron.StartLoggingOptions;
17650     type Streams = Electron.Streams;
17651     type SystemMemoryInfo = Electron.SystemMemoryInfo;
17652     type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
17653     type TitleOptions = Electron.TitleOptions;
17654     type ToBitmapOptions = Electron.ToBitmapOptions;
17655     type ToDataURLOptions = Electron.ToDataURLOptions;
17656     type ToPNGOptions = Electron.ToPNGOptions;
17657     type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
17658     type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
17659     type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
17660     type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
17661     type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
17662     type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
17663     type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
17664     type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
17665     type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
17666     type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
17667     type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
17668     type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
17669     type UploadProgress = Electron.UploadProgress;
17670     type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
17671     type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
17672     type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
17673     type WillNavigateEvent = Electron.WillNavigateEvent;
17674     type WillResizeDetails = Electron.WillResizeDetails;
17675     type EditFlags = Electron.EditFlags;
17676     type Env = Electron.Env;
17677     type FoundInPageResult = Electron.FoundInPageResult;
17678     type LaunchItems = Electron.LaunchItems;
17679     type Margins = Electron.Margins;
17680     type MediaFlags = Electron.MediaFlags;
17681     type PageRanges = Electron.PageRanges;
17682     type Params = Electron.Params;
17683     type TitleBarOverlay = Electron.TitleBarOverlay;
17684     type Video = Electron.Video;
17685     type WebPreferences = Electron.WebPreferences;
17686     type DefaultFontFamily = Electron.DefaultFontFamily;
17687     type BluetoothDevice = Electron.BluetoothDevice;
17688     type Certificate = Electron.Certificate;
17689     type CertificatePrincipal = Electron.CertificatePrincipal;
17690     type Cookie = Electron.Cookie;
17691     type CPUUsage = Electron.CPUUsage;
17692     type CrashReport = Electron.CrashReport;
17693     type CustomScheme = Electron.CustomScheme;
17694     type DesktopCapturerSource = Electron.DesktopCapturerSource;
17695     type Display = Electron.Display;
17696     type Event = Electron.Event;
17697     type Extension = Electron.Extension;
17698     type ExtensionInfo = Electron.ExtensionInfo;
17699     type FileFilter = Electron.FileFilter;
17700     type FilePathWithHeaders = Electron.FilePathWithHeaders;
17701     type GPUFeatureStatus = Electron.GPUFeatureStatus;
17702     type HIDDevice = Electron.HIDDevice;
17703     type InputEvent = Electron.InputEvent;
17704     type IOCounters = Electron.IOCounters;
17705     type IpcMainEvent = Electron.IpcMainEvent;
17706     type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
17707     type IpcRendererEvent = Electron.IpcRendererEvent;
17708     type JumpListCategory = Electron.JumpListCategory;
17709     type JumpListItem = Electron.JumpListItem;
17710     type KeyboardEvent = Electron.KeyboardEvent;
17711     type KeyboardInputEvent = Electron.KeyboardInputEvent;
17712     type MemoryInfo = Electron.MemoryInfo;
17713     type MemoryUsageDetails = Electron.MemoryUsageDetails;
17714     type MimeTypedBuffer = Electron.MimeTypedBuffer;
17715     type MouseInputEvent = Electron.MouseInputEvent;
17716     type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
17717     type NotificationAction = Electron.NotificationAction;
17718     type NotificationResponse = Electron.NotificationResponse;
17719     type PaymentDiscount = Electron.PaymentDiscount;
17720     type Point = Electron.Point;
17721     type PostBody = Electron.PostBody;
17722     type PrinterInfo = Electron.PrinterInfo;
17723     type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
17724     type ProcessMetric = Electron.ProcessMetric;
17725     type Product = Electron.Product;
17726     type ProductDiscount = Electron.ProductDiscount;
17727     type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
17728     type ProtocolRequest = Electron.ProtocolRequest;
17729     type ProtocolResponse = Electron.ProtocolResponse;
17730     type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
17731     type Rectangle = Electron.Rectangle;
17732     type Referrer = Electron.Referrer;
17733     type ScrubberItem = Electron.ScrubberItem;
17734     type SegmentedControlSegment = Electron.SegmentedControlSegment;
17735     type SerialPort = Electron.SerialPort;
17736     type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
17737     type SharedWorkerInfo = Electron.SharedWorkerInfo;
17738     type SharingItem = Electron.SharingItem;
17739     type ShortcutDetails = Electron.ShortcutDetails;
17740     type Size = Electron.Size;
17741     type Task = Electron.Task;
17742     type ThumbarButton = Electron.ThumbarButton;
17743     type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
17744     type TraceConfig = Electron.TraceConfig;
17745     type Transaction = Electron.Transaction;
17746     type UploadData = Electron.UploadData;
17747     type UploadFile = Electron.UploadFile;
17748     type UploadRawData = Electron.UploadRawData;
17749     type UserDefaultTypes = Electron.UserDefaultTypes;
17750     type WebRequestFilter = Electron.WebRequestFilter;
17751     type WebSource = Electron.WebSource;
17752   }
17753
17754   namespace CrossProcessExports {
17755     const app: App;
17756     type App = Electron.App;
17757     const autoUpdater: AutoUpdater;
17758     type AutoUpdater = Electron.AutoUpdater;
17759     class BrowserView extends Electron.BrowserView {}
17760     class BrowserWindow extends Electron.BrowserWindow {}
17761     type ClientRequest = Electron.ClientRequest;
17762     const clipboard: Clipboard;
17763     type Clipboard = Electron.Clipboard;
17764     type CommandLine = Electron.CommandLine;
17765     const contentTracing: ContentTracing;
17766     type ContentTracing = Electron.ContentTracing;
17767     const contextBridge: ContextBridge;
17768     type ContextBridge = Electron.ContextBridge;
17769     type Cookies = Electron.Cookies;
17770     const crashReporter: CrashReporter;
17771     type CrashReporter = Electron.CrashReporter;
17772     type Debugger = Electron.Debugger;
17773     const desktopCapturer: DesktopCapturer;
17774     type DesktopCapturer = Electron.DesktopCapturer;
17775     const dialog: Dialog;
17776     type Dialog = Electron.Dialog;
17777     type Dock = Electron.Dock;
17778     type DownloadItem = Electron.DownloadItem;
17779     const globalShortcut: GlobalShortcut;
17780     type GlobalShortcut = Electron.GlobalShortcut;
17781     const inAppPurchase: InAppPurchase;
17782     type InAppPurchase = Electron.InAppPurchase;
17783     type IncomingMessage = Electron.IncomingMessage;
17784     const ipcMain: IpcMain;
17785     type IpcMain = Electron.IpcMain;
17786     const ipcRenderer: IpcRenderer;
17787     type IpcRenderer = Electron.IpcRenderer;
17788     class Menu extends Electron.Menu {}
17789     class MenuItem extends Electron.MenuItem {}
17790     class MessageChannelMain extends Electron.MessageChannelMain {}
17791     type MessagePortMain = Electron.MessagePortMain;
17792     const nativeImage: typeof NativeImage;
17793     type NativeImage = Electron.NativeImage;
17794     const nativeTheme: NativeTheme;
17795     type NativeTheme = Electron.NativeTheme;
17796     const net: Net;
17797     type Net = Electron.Net;
17798     const netLog: NetLog;
17799     type NetLog = Electron.NetLog;
17800     class Notification extends Electron.Notification {}
17801     const powerMonitor: PowerMonitor;
17802     type PowerMonitor = Electron.PowerMonitor;
17803     const powerSaveBlocker: PowerSaveBlocker;
17804     type PowerSaveBlocker = Electron.PowerSaveBlocker;
17805     const protocol: Protocol;
17806     type Protocol = Electron.Protocol;
17807     const pushNotifications: PushNotifications;
17808     type PushNotifications = Electron.PushNotifications;
17809     const safeStorage: SafeStorage;
17810     type SafeStorage = Electron.SafeStorage;
17811     const screen: Screen;
17812     type Screen = Electron.Screen;
17813     type ServiceWorkers = Electron.ServiceWorkers;
17814     const session: typeof Session;
17815     type Session = Electron.Session;
17816     class ShareMenu extends Electron.ShareMenu {}
17817     const shell: Shell;
17818     type Shell = Electron.Shell;
17819     const systemPreferences: SystemPreferences;
17820     type SystemPreferences = Electron.SystemPreferences;
17821     class TouchBar extends Electron.TouchBar {}
17822     type TouchBarButton = Electron.TouchBarButton;
17823     type TouchBarColorPicker = Electron.TouchBarColorPicker;
17824     type TouchBarGroup = Electron.TouchBarGroup;
17825     type TouchBarLabel = Electron.TouchBarLabel;
17826     type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
17827     type TouchBarPopover = Electron.TouchBarPopover;
17828     type TouchBarScrubber = Electron.TouchBarScrubber;
17829     type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
17830     type TouchBarSlider = Electron.TouchBarSlider;
17831     type TouchBarSpacer = Electron.TouchBarSpacer;
17832     class Tray extends Electron.Tray {}
17833     const utilityProcess: typeof UtilityProcess;
17834     type UtilityProcess = Electron.UtilityProcess;
17835     const webContents: typeof WebContents;
17836     type WebContents = Electron.WebContents;
17837     const webFrame: WebFrame;
17838     type WebFrame = Electron.WebFrame;
17839     const webFrameMain: typeof WebFrameMain;
17840     type WebFrameMain = Electron.WebFrameMain;
17841     type WebRequest = Electron.WebRequest;
17842     type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
17843     type AddRepresentationOptions = Electron.AddRepresentationOptions;
17844     type AnimationSettings = Electron.AnimationSettings;
17845     type AppDetailsOptions = Electron.AppDetailsOptions;
17846     type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
17847     type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
17848     type AuthInfo = Electron.AuthInfo;
17849     type AutoResizeOptions = Electron.AutoResizeOptions;
17850     type BeforeSendResponse = Electron.BeforeSendResponse;
17851     type BitmapOptions = Electron.BitmapOptions;
17852     type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
17853     type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
17854     type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
17855     type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
17856     type CallbackResponse = Electron.CallbackResponse;
17857     type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
17858     type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
17859     type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
17860     type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
17861     type Config = Electron.Config;
17862     type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
17863     type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
17864     type ContextMenuEvent = Electron.ContextMenuEvent;
17865     type ContextMenuParams = Electron.ContextMenuParams;
17866     type ContinueActivityDetails = Electron.ContinueActivityDetails;
17867     type CookiesGetFilter = Electron.CookiesGetFilter;
17868     type CookiesSetDetails = Electron.CookiesSetDetails;
17869     type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
17870     type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
17871     type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
17872     type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
17873     type Data = Electron.Data;
17874     type Details = Electron.Details;
17875     type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
17876     type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
17877     type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
17878     type DidFailLoadEvent = Electron.DidFailLoadEvent;
17879     type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
17880     type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
17881     type DidNavigateEvent = Electron.DidNavigateEvent;
17882     type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
17883     type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
17884     type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
17885     type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
17886     type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
17887     type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
17888     type FeedURLOptions = Electron.FeedURLOptions;
17889     type FileIconOptions = Electron.FileIconOptions;
17890     type FindInPageOptions = Electron.FindInPageOptions;
17891     type FocusOptions = Electron.FocusOptions;
17892     type ForkOptions = Electron.ForkOptions;
17893     type FoundInPageEvent = Electron.FoundInPageEvent;
17894     type FrameCreatedDetails = Electron.FrameCreatedDetails;
17895     type FromPartitionOptions = Electron.FromPartitionOptions;
17896     type HandlerDetails = Electron.HandlerDetails;
17897     type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17898     type HeapStatistics = Electron.HeapStatistics;
17899     type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
17900     type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
17901     type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
17902     type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
17903     type ImportCertificateOptions = Electron.ImportCertificateOptions;
17904     type Info = Electron.Info;
17905     type Input = Electron.Input;
17906     type InsertCSSOptions = Electron.InsertCSSOptions;
17907     type IpcMessageEvent = Electron.IpcMessageEvent;
17908     type Item = Electron.Item;
17909     type JumpListSettings = Electron.JumpListSettings;
17910     type LoadCommitEvent = Electron.LoadCommitEvent;
17911     type LoadExtensionOptions = Electron.LoadExtensionOptions;
17912     type LoadFileOptions = Electron.LoadFileOptions;
17913     type LoadURLOptions = Electron.LoadURLOptions;
17914     type LoginItemSettings = Electron.LoginItemSettings;
17915     type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
17916     type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
17917     type MessageBoxOptions = Electron.MessageBoxOptions;
17918     type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
17919     type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
17920     type MessageDetails = Electron.MessageDetails;
17921     type MessageEvent = Electron.MessageEvent;
17922     type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
17923     type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
17924     type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
17925     type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
17926     type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
17927     type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
17928     type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
17929     type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
17930     type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
17931     type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
17932     type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
17933     type OpenDialogOptions = Electron.OpenDialogOptions;
17934     type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
17935     type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
17936     type OpenExternalOptions = Electron.OpenExternalOptions;
17937     type Options = Electron.Options;
17938     type Opts = Electron.Opts;
17939     type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
17940     type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
17941     type Parameters = Electron.Parameters;
17942     type Payment = Electron.Payment;
17943     type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
17944     type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
17945     type PluginCrashedEvent = Electron.PluginCrashedEvent;
17946     type PopupOptions = Electron.PopupOptions;
17947     type PreconnectOptions = Electron.PreconnectOptions;
17948     type PrintToPDFOptions = Electron.PrintToPDFOptions;
17949     type Privileges = Electron.Privileges;
17950     type ProgressBarOptions = Electron.ProgressBarOptions;
17951     type Provider = Electron.Provider;
17952     type ReadBookmark = Electron.ReadBookmark;
17953     type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
17954     type RelaunchOptions = Electron.RelaunchOptions;
17955     type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
17956     type Request = Electron.Request;
17957     type ResizeOptions = Electron.ResizeOptions;
17958     type ResourceUsage = Electron.ResourceUsage;
17959     type Response = Electron.Response;
17960     type Result = Electron.Result;
17961     type SaveDialogOptions = Electron.SaveDialogOptions;
17962     type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
17963     type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
17964     type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
17965     type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
17966     type Settings = Electron.Settings;
17967     type SourcesOptions = Electron.SourcesOptions;
17968     type SSLConfigConfig = Electron.SSLConfigConfig;
17969     type StartLoggingOptions = Electron.StartLoggingOptions;
17970     type Streams = Electron.Streams;
17971     type SystemMemoryInfo = Electron.SystemMemoryInfo;
17972     type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
17973     type TitleOptions = Electron.TitleOptions;
17974     type ToBitmapOptions = Electron.ToBitmapOptions;
17975     type ToDataURLOptions = Electron.ToDataURLOptions;
17976     type ToPNGOptions = Electron.ToPNGOptions;
17977     type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
17978     type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
17979     type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
17980     type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
17981     type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
17982     type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
17983     type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
17984     type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
17985     type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
17986     type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
17987     type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
17988     type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
17989     type UploadProgress = Electron.UploadProgress;
17990     type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
17991     type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
17992     type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
17993     type WillNavigateEvent = Electron.WillNavigateEvent;
17994     type WillResizeDetails = Electron.WillResizeDetails;
17995     type EditFlags = Electron.EditFlags;
17996     type Env = Electron.Env;
17997     type FoundInPageResult = Electron.FoundInPageResult;
17998     type LaunchItems = Electron.LaunchItems;
17999     type Margins = Electron.Margins;
18000     type MediaFlags = Electron.MediaFlags;
18001     type PageRanges = Electron.PageRanges;
18002     type Params = Electron.Params;
18003     type TitleBarOverlay = Electron.TitleBarOverlay;
18004     type Video = Electron.Video;
18005     type WebPreferences = Electron.WebPreferences;
18006     type DefaultFontFamily = Electron.DefaultFontFamily;
18007     type BluetoothDevice = Electron.BluetoothDevice;
18008     type Certificate = Electron.Certificate;
18009     type CertificatePrincipal = Electron.CertificatePrincipal;
18010     type Cookie = Electron.Cookie;
18011     type CPUUsage = Electron.CPUUsage;
18012     type CrashReport = Electron.CrashReport;
18013     type CustomScheme = Electron.CustomScheme;
18014     type DesktopCapturerSource = Electron.DesktopCapturerSource;
18015     type Display = Electron.Display;
18016     type Event = Electron.Event;
18017     type Extension = Electron.Extension;
18018     type ExtensionInfo = Electron.ExtensionInfo;
18019     type FileFilter = Electron.FileFilter;
18020     type FilePathWithHeaders = Electron.FilePathWithHeaders;
18021     type GPUFeatureStatus = Electron.GPUFeatureStatus;
18022     type HIDDevice = Electron.HIDDevice;
18023     type InputEvent = Electron.InputEvent;
18024     type IOCounters = Electron.IOCounters;
18025     type IpcMainEvent = Electron.IpcMainEvent;
18026     type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
18027     type IpcRendererEvent = Electron.IpcRendererEvent;
18028     type JumpListCategory = Electron.JumpListCategory;
18029     type JumpListItem = Electron.JumpListItem;
18030     type KeyboardEvent = Electron.KeyboardEvent;
18031     type KeyboardInputEvent = Electron.KeyboardInputEvent;
18032     type MemoryInfo = Electron.MemoryInfo;
18033     type MemoryUsageDetails = Electron.MemoryUsageDetails;
18034     type MimeTypedBuffer = Electron.MimeTypedBuffer;
18035     type MouseInputEvent = Electron.MouseInputEvent;
18036     type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
18037     type NotificationAction = Electron.NotificationAction;
18038     type NotificationResponse = Electron.NotificationResponse;
18039     type PaymentDiscount = Electron.PaymentDiscount;
18040     type Point = Electron.Point;
18041     type PostBody = Electron.PostBody;
18042     type PrinterInfo = Electron.PrinterInfo;
18043     type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
18044     type ProcessMetric = Electron.ProcessMetric;
18045     type Product = Electron.Product;
18046     type ProductDiscount = Electron.ProductDiscount;
18047     type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
18048     type ProtocolRequest = Electron.ProtocolRequest;
18049     type ProtocolResponse = Electron.ProtocolResponse;
18050     type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
18051     type Rectangle = Electron.Rectangle;
18052     type Referrer = Electron.Referrer;
18053     type ScrubberItem = Electron.ScrubberItem;
18054     type SegmentedControlSegment = Electron.SegmentedControlSegment;
18055     type SerialPort = Electron.SerialPort;
18056     type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
18057     type SharedWorkerInfo = Electron.SharedWorkerInfo;
18058     type SharingItem = Electron.SharingItem;
18059     type ShortcutDetails = Electron.ShortcutDetails;
18060     type Size = Electron.Size;
18061     type Task = Electron.Task;
18062     type ThumbarButton = Electron.ThumbarButton;
18063     type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
18064     type TraceConfig = Electron.TraceConfig;
18065     type Transaction = Electron.Transaction;
18066     type UploadData = Electron.UploadData;
18067     type UploadFile = Electron.UploadFile;
18068     type UploadRawData = Electron.UploadRawData;
18069     type UserDefaultTypes = Electron.UserDefaultTypes;
18070     type WebRequestFilter = Electron.WebRequestFilter;
18071     type WebSource = Electron.WebSource;
18072   }
18073
18074   const app: App;
18075   const autoUpdater: AutoUpdater;
18076   const clipboard: Clipboard;
18077   const contentTracing: ContentTracing;
18078   const contextBridge: ContextBridge;
18079   const crashReporter: CrashReporter;
18080   const desktopCapturer: DesktopCapturer;
18081   const dialog: Dialog;
18082   const globalShortcut: GlobalShortcut;
18083   const inAppPurchase: InAppPurchase;
18084   const ipcMain: IpcMain;
18085   const ipcRenderer: IpcRenderer;
18086   const nativeImage: typeof NativeImage;
18087   const nativeTheme: NativeTheme;
18088   const net: Net;
18089   const netLog: NetLog;
18090   const parentPort: ParentPort;
18091   const powerMonitor: PowerMonitor;
18092   const powerSaveBlocker: PowerSaveBlocker;
18093   const protocol: Protocol;
18094   const pushNotifications: PushNotifications;
18095   const safeStorage: SafeStorage;
18096   const screen: Screen;
18097   const session: typeof Session;
18098   const shell: Shell;
18099   const systemPreferences: SystemPreferences;
18100   const utilityProcess: typeof UtilityProcess;
18101   const webContents: typeof WebContents;
18102   const webFrame: WebFrame;
18103   const webFrameMain: typeof WebFrameMain;
18104
18105 }
18106
18107 declare module 'electron' {
18108   export = Electron.CrossProcessExports;
18109 }
18110
18111 declare module 'electron/main' {
18112   export = Electron.Main
18113 }
18114
18115 declare module 'electron/common' {
18116   export = Electron.Common
18117 }
18118
18119 declare module 'electron/renderer' {
18120   export = Electron.Renderer
18121 }
18122
18123 interface NodeRequireFunction {
18124   (moduleName: 'electron'): typeof Electron.CrossProcessExports;
18125   (moduleName: 'electron/main'): typeof Electron.Main;
18126   (moduleName: 'electron/common'): typeof Electron.Common;
18127   (moduleName: 'electron/renderer'): typeof Electron.Renderer;
18128 }
18129
18130 interface NodeRequire {
18131   (moduleName: 'electron'): typeof Electron.CrossProcessExports;
18132   (moduleName: 'electron/main'): typeof Electron.Main;
18133   (moduleName: 'electron/common'): typeof Electron.Common;
18134   (moduleName: 'electron/renderer'): typeof Electron.Renderer;
18135 }
18136
18137 interface File {
18138  /**
18139   * The real path to the file on the users filesystem
18140   */
18141   path: string;
18142 }
18143
18144 declare module 'original-fs' {
18145   import * as fs from 'fs';
18146   export = fs;
18147 }
18148
18149 interface Document {
18150   createElement(tagName: 'webview'): Electron.WebviewTag;
18151 }
18152
18153 declare namespace NodeJS {
18154   interface Process extends NodeJS.EventEmitter {
18155
18156     // Docs: https://electronjs.org/docs/api/process
18157
18158     /**
18159      * Emitted when Electron has loaded its internal initialization script and is
18160      * beginning to load the web page or the main script.
18161      */
18162     on(event: 'loaded', listener: Function): this;
18163     once(event: 'loaded', listener: Function): this;
18164     addListener(event: 'loaded', listener: Function): this;
18165     removeListener(event: 'loaded', listener: Function): this;
18166     /**
18167      * Causes the main thread of the current process crash.
18168      */
18169     crash(): void;
18170     /**
18171      * * `allocated` Integer - Size of all allocated objects in Kilobytes.
18172      * * `total` Integer - Total allocated space in Kilobytes.
18173      * 
18174      * Returns an object with Blink memory information. It can be useful for debugging
18175      * rendering / DOM related memory issues. Note that all values are reported in
18176      * Kilobytes.
18177      */
18178     getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
18179     getCPUUsage(): Electron.CPUUsage;
18180     /**
18181      * The number of milliseconds since epoch, or `null` if the information is
18182      * unavailable
18183      * 
18184      * Indicates the creation time of the application. The time is represented as
18185      * number of milliseconds since epoch. It returns null if it is unable to get the
18186      * process creation time.
18187      */
18188     getCreationTime(): (number) | (null);
18189     /**
18190      * * `totalHeapSize` Integer
18191      * * `totalHeapSizeExecutable` Integer
18192      * * `totalPhysicalSize` Integer
18193      * * `totalAvailableSize` Integer
18194      * * `usedHeapSize` Integer
18195      * * `heapSizeLimit` Integer
18196      * * `mallocedMemory` Integer
18197      * * `peakMallocedMemory` Integer
18198      * * `doesZapGarbage` boolean
18199      * 
18200      * Returns an object with V8 heap statistics. Note that all statistics are reported
18201      * in Kilobytes.
18202      */
18203     getHeapStatistics(): Electron.HeapStatistics;
18204     getIOCounters(): Electron.IOCounters;
18205     /**
18206      * Resolves with a ProcessMemoryInfo
18207      * 
18208      * Returns an object giving memory usage statistics about the current process. Note
18209      * that all statistics are reported in Kilobytes. This api should be called after
18210      * app ready.
18211      * 
18212      * Chromium does not provide `residentSet` value for macOS. This is because macOS
18213      * performs in-memory compression of pages that haven't been recently used. As a
18214      * result the resident set size value is not what one would expect. `private`
18215      * memory is more representative of the actual pre-compression memory usage of the
18216      * process on macOS.
18217      */
18218     getProcessMemoryInfo(): Promise<Electron.ProcessMemoryInfo>;
18219     /**
18220      * * `total` Integer - The total amount of physical memory in Kilobytes available
18221      * to the system.
18222      * * `free` Integer - The total amount of memory not being used by applications or
18223      * disk cache.
18224      * * `swapTotal` Integer _Windows_ _Linux_ - The total amount of swap memory in
18225      * Kilobytes available to the system.
18226      * * `swapFree` Integer _Windows_ _Linux_ - The free amount of swap memory in
18227      * Kilobytes available to the system.
18228      * 
18229      * Returns an object giving memory usage statistics about the entire system. Note
18230      * that all statistics are reported in Kilobytes.
18231      */
18232     getSystemMemoryInfo(): Electron.SystemMemoryInfo;
18233     /**
18234      * The version of the host operating system.
18235      * 
18236      * Example:
18237      * 
18238      * **Note:** It returns the actual operating system version instead of kernel
18239      * version on macOS unlike `os.release()`.
18240      */
18241     getSystemVersion(): string;
18242     /**
18243      * Causes the main thread of the current process hang.
18244      */
18245     hang(): void;
18246     /**
18247      * Sets the file descriptor soft limit to `maxDescriptors` or the OS hard limit,
18248      * whichever is lower for the current process.
18249      *
18250      * @platform darwin,linux
18251      */
18252     setFdLimit(maxDescriptors: number): void;
18253     /**
18254      * Indicates whether the snapshot has been created successfully.
18255      * 
18256      * Takes a V8 heap snapshot and saves it to `filePath`.
18257      */
18258     takeHeapSnapshot(filePath: string): boolean;
18259     /**
18260      * A `string` representing Chrome's version string.
18261      *
18262      */
18263     readonly chrome: string;
18264     /**
18265      * A `string` (optional) representing a globally unique ID of the current
18266      * JavaScript context. Each frame has its own JavaScript context. When
18267      * contextIsolation is enabled, the isolated world also has a separate JavaScript
18268      * context. This property is only available in the renderer process.
18269      *
18270      */
18271     readonly contextId?: string;
18272     /**
18273      * A `boolean` that indicates whether the current renderer context has
18274      * `contextIsolation` enabled. It is `undefined` in the main process.
18275      *
18276      */
18277     readonly contextIsolated: boolean;
18278     /**
18279      * A `boolean`. When app is started by being passed as parameter to the default
18280      * app, this property is `true` in the main process, otherwise it is `undefined`.
18281      *
18282      */
18283     readonly defaultApp: boolean;
18284     /**
18285      * A `string` representing Electron's version string.
18286      *
18287      */
18288     readonly electron: string;
18289     /**
18290      * A `boolean`, `true` when the current renderer context is the "main" renderer
18291      * frame. If you want the ID of the current frame you should use
18292      * `webFrame.routingId`.
18293      *
18294      */
18295     readonly isMainFrame: boolean;
18296     /**
18297      * A `boolean`. For Mac App Store build, this property is `true`, for other builds
18298      * it is `undefined`.
18299      *
18300      */
18301     readonly mas: boolean;
18302     /**
18303      * A `boolean` that controls ASAR support inside your application. Setting this to
18304      * `true` will disable the support for `asar` archives in Node's built-in modules.
18305      */
18306     noAsar: boolean;
18307     /**
18308      * A `boolean` that controls whether or not deprecation warnings are printed to
18309      * `stderr`. Setting this to `true` will silence deprecation warnings. This
18310      * property is used instead of the `--no-deprecation` command line flag.
18311      */
18312     noDeprecation: boolean;
18313     /**
18314      * A `Electron.ParentPort` property if this is a `UtilityProcess` (or `null`
18315      * otherwise) allowing communication with the parent process.
18316      */
18317     parentPort: Electron.ParentPort;
18318     /**
18319      * A `string` representing the path to the resources directory.
18320      *
18321      */
18322     readonly resourcesPath: string;
18323     /**
18324      * A `boolean`. When the renderer process is sandboxed, this property is `true`,
18325      * otherwise it is `undefined`.
18326      *
18327      */
18328     readonly sandboxed: boolean;
18329     /**
18330      * A `boolean` that controls whether or not deprecation warnings will be thrown as
18331      * exceptions. Setting this to `true` will throw errors for deprecations. This
18332      * property is used instead of the `--throw-deprecation` command line flag.
18333      */
18334     throwDeprecation: boolean;
18335     /**
18336      * A `boolean` that controls whether or not deprecations printed to `stderr`
18337      * include their stack trace. Setting this to `true` will print stack traces for
18338      * deprecations. This property is instead of the `--trace-deprecation` command line
18339      * flag.
18340      */
18341     traceDeprecation: boolean;
18342     /**
18343      * A `boolean` that controls whether or not process warnings printed to `stderr`
18344      * include their stack trace. Setting this to `true` will print stack traces for
18345      * process warnings (including deprecations). This property is instead of the
18346      * `--trace-warnings` command line flag.
18347      */
18348     traceProcessWarnings: boolean;
18349     /**
18350      * A `string` representing the current process's type, can be:
18351      * 
18352      * * `browser` - The main process
18353      * * `renderer` - A renderer process
18354      * * `worker` - In a web worker
18355      * * `utility` - In a node process launched as a service
18356      *
18357      */
18358     readonly type: ('browser' | 'renderer' | 'worker' | 'utility');
18359     /**
18360      * A `boolean`. If the app is running as a Windows Store app (appx), this property
18361      * is `true`, for otherwise it is `undefined`.
18362      *
18363      */
18364     readonly windowsStore: boolean;
18365   }
18366   interface ProcessVersions {
18367     readonly electron: string;
18368     readonly chrome: string;
18369   }
18370 }