1// Type definitions for Electron 8.3.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
8type GlobalEvent = Event;
9
10declare namespace Electron {
11  class Accelerator extends String {
12
13  }
14
15  interface CommonInterface {
16    app: App;
17    autoUpdater: AutoUpdater;
18    BrowserView: typeof BrowserView;
19    BrowserWindowProxy: typeof BrowserWindowProxy;
20    BrowserWindow: typeof BrowserWindow;
21    ClientRequest: typeof ClientRequest;
22    clipboard: Clipboard;
23    CommandLine: typeof CommandLine;
24    contentTracing: ContentTracing;
25    contextBridge: ContextBridge;
26    Cookies: typeof Cookies;
27    crashReporter: CrashReporter;
28    Debugger: typeof Debugger;
29    desktopCapturer: DesktopCapturer;
30    dialog: Dialog;
31    Dock: typeof Dock;
32    DownloadItem: typeof DownloadItem;
33    globalShortcut: GlobalShortcut;
34    inAppPurchase: InAppPurchase;
35    IncomingMessage: typeof IncomingMessage;
36    ipcMain: IpcMain;
37    ipcRenderer: IpcRenderer;
38    MenuItem: typeof MenuItem;
39    Menu: typeof Menu;
40    nativeImage: typeof NativeImage;
41    nativeTheme: NativeTheme;
42    netLog: NetLog;
43    net: Net;
44    Notification: typeof Notification;
45    powerMonitor: PowerMonitor;
46    powerSaveBlocker: PowerSaveBlocker;
47    protocol: Protocol;
48    remote: Remote;
49    screen: Screen;
50    session: typeof Session;
51    shell: Shell;
52    systemPreferences: SystemPreferences;
53    TouchBarButton: typeof TouchBarButton;
54    TouchBarColorPicker: typeof TouchBarColorPicker;
55    TouchBarGroup: typeof TouchBarGroup;
56    TouchBarLabel: typeof TouchBarLabel;
57    TouchBarPopover: typeof TouchBarPopover;
58    TouchBarScrubber: typeof TouchBarScrubber;
59    TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
60    TouchBarSlider: typeof TouchBarSlider;
61    TouchBarSpacer: typeof TouchBarSpacer;
62    TouchBar: typeof TouchBar;
63    Tray: typeof Tray;
64    webContents: typeof WebContents;
65    webFrame: WebFrame;
66    WebRequest: typeof WebRequest;
67    webviewTag: WebviewTag;
68  }
69
70  interface MainInterface extends CommonInterface {
71  }
72
73  interface RendererInterface extends CommonInterface {
74  }
75
76  interface AllElectron extends MainInterface, RendererInterface {}
77
78  const app: App;
79  const autoUpdater: AutoUpdater;
80  const clipboard: Clipboard;
81  const contentTracing: ContentTracing;
82  const contextBridge: ContextBridge;
83  const crashReporter: CrashReporter;
84  const desktopCapturer: DesktopCapturer;
85  const dialog: Dialog;
86  const globalShortcut: GlobalShortcut;
87  const inAppPurchase: InAppPurchase;
88  const ipcMain: IpcMain;
89  const ipcRenderer: IpcRenderer;
90  type nativeImage = NativeImage;
91  const nativeImage: typeof NativeImage;
92  const nativeTheme: NativeTheme;
93  const netLog: NetLog;
94  const net: Net;
95  const powerMonitor: PowerMonitor;
96  const powerSaveBlocker: PowerSaveBlocker;
97  const protocol: Protocol;
98  const remote: Remote;
99  const screen: Screen;
100  type session = Session;
101  const session: typeof Session;
102  const shell: Shell;
103  const systemPreferences: SystemPreferences;
104  type webContents = WebContents;
105  const webContents: typeof WebContents;
106  const webFrame: WebFrame;
107  const webviewTag: WebviewTag;
108
109  interface App extends NodeJS.EventEmitter {
110
111    // Docs: http://electronjs.org/docs/api/app
112
113    /**
114     * Emitted when Chrome's accessibility support changes. This event fires when
115     * assistive technologies, such as screen readers, are enabled or disabled. See
116     * https://www.chromium.org/developers/design-documents/accessibility for more
117     * details.
118     *
119     * @platform darwin,win32
120     */
121    on(event: 'accessibility-support-changed', listener: (event: Event,
122                                                          /**
123                                                           * `true` when Chrome's accessibility support is enabled, `false` otherwise.
124                                                           */
125                                                          accessibilitySupportEnabled: boolean) => void): this;
126    once(event: 'accessibility-support-changed', listener: (event: Event,
127                                                          /**
128                                                           * `true` when Chrome's accessibility support is enabled, `false` otherwise.
129                                                           */
130                                                          accessibilitySupportEnabled: boolean) => void): this;
131    addListener(event: 'accessibility-support-changed', listener: (event: Event,
132                                                          /**
133                                                           * `true` when Chrome's accessibility support is enabled, `false` otherwise.
134                                                           */
135                                                          accessibilitySupportEnabled: boolean) => void): this;
136    removeListener(event: 'accessibility-support-changed', listener: (event: Event,
137                                                          /**
138                                                           * `true` when Chrome's accessibility support is enabled, `false` otherwise.
139                                                           */
140                                                          accessibilitySupportEnabled: boolean) => void): this;
141    /**
142     * Emitted when the application is activated. Various actions can trigger this
143     * event, such as launching the application for the first time, attempting to
144     * re-launch the application when it's already running, or clicking on the
145     * application's dock or taskbar icon.
146     *
147     * @platform darwin
148     */
149    on(event: 'activate', listener: (event: Event,
150                                     hasVisibleWindows: boolean) => void): this;
151    once(event: 'activate', listener: (event: Event,
152                                     hasVisibleWindows: boolean) => void): this;
153    addListener(event: 'activate', listener: (event: Event,
154                                     hasVisibleWindows: boolean) => void): this;
155    removeListener(event: 'activate', listener: (event: Event,
156                                     hasVisibleWindows: boolean) => void): this;
157    /**
158     * Emitted during Handoff after an activity from this device was successfully
159     * resumed on another one.
160     *
161     * @platform darwin
162     */
163    on(event: 'activity-was-continued', listener: (event: Event,
164                                                   /**
165                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
166                                                    */
167                                                   type: string,
168                                                   /**
169                                                    * Contains app-specific state stored by the activity.
170                                                    */
171                                                   userInfo: unknown) => void): this;
172    once(event: 'activity-was-continued', listener: (event: Event,
173                                                   /**
174                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
175                                                    */
176                                                   type: string,
177                                                   /**
178                                                    * Contains app-specific state stored by the activity.
179                                                    */
180                                                   userInfo: unknown) => void): this;
181    addListener(event: 'activity-was-continued', listener: (event: Event,
182                                                   /**
183                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
184                                                    */
185                                                   type: string,
186                                                   /**
187                                                    * Contains app-specific state stored by the activity.
188                                                    */
189                                                   userInfo: unknown) => void): this;
190    removeListener(event: 'activity-was-continued', listener: (event: Event,
191                                                   /**
192                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
193                                                    */
194                                                   type: string,
195                                                   /**
196                                                    * Contains app-specific state stored by the activity.
197                                                    */
198                                                   userInfo: unknown) => void): this;
199    /**
200     * Emitted before the application starts closing its windows. Calling
201     * `event.preventDefault()` will prevent the default behavior, which is terminating
202     * the application.
203     *
204     * **Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
205     * then `before-quit` is emitted *after* emitting `close` event on all windows and
206     * closing them.
207     *
208     * **Note:** On Windows, this event will not be emitted if the app is closed due to
209     * a shutdown/restart of the system or a user logout.
210     */
211    on(event: 'before-quit', listener: (event: Event) => void): this;
212    once(event: 'before-quit', listener: (event: Event) => void): this;
213    addListener(event: 'before-quit', listener: (event: Event) => void): this;
214    removeListener(event: 'before-quit', listener: (event: Event) => void): this;
215    /**
216     * Emitted when a browserWindow gets blurred.
217     */
218    on(event: 'browser-window-blur', listener: (event: Event,
219                                                window: BrowserWindow) => void): this;
220    once(event: 'browser-window-blur', listener: (event: Event,
221                                                window: BrowserWindow) => void): this;
222    addListener(event: 'browser-window-blur', listener: (event: Event,
223                                                window: BrowserWindow) => void): this;
224    removeListener(event: 'browser-window-blur', listener: (event: Event,
225                                                window: BrowserWindow) => void): this;
226    /**
227     * Emitted when a new browserWindow is created.
228     */
229    on(event: 'browser-window-created', listener: (event: Event,
230                                                   window: BrowserWindow) => void): this;
231    once(event: 'browser-window-created', listener: (event: Event,
232                                                   window: BrowserWindow) => void): this;
233    addListener(event: 'browser-window-created', listener: (event: Event,
234                                                   window: BrowserWindow) => void): this;
235    removeListener(event: 'browser-window-created', listener: (event: Event,
236                                                   window: BrowserWindow) => void): this;
237    /**
238     * Emitted when a browserWindow gets focused.
239     */
240    on(event: 'browser-window-focus', listener: (event: Event,
241                                                 window: BrowserWindow) => void): this;
242    once(event: 'browser-window-focus', listener: (event: Event,
243                                                 window: BrowserWindow) => void): this;
244    addListener(event: 'browser-window-focus', listener: (event: Event,
245                                                 window: BrowserWindow) => void): this;
246    removeListener(event: 'browser-window-focus', listener: (event: Event,
247                                                 window: BrowserWindow) => void): this;
248    /**
249     * Emitted when failed to verify the `certificate` for `url`, to trust the
250     * certificate you should prevent the default behavior with
251     * `event.preventDefault()` and call `callback(true)`.
252     */
253    on(event: 'certificate-error', listener: (event: Event,
254                                              webContents: WebContents,
255                                              url: string,
256                                              /**
257                                               * The error code
258                                               */
259                                              error: string,
260                                              certificate: Certificate,
261                                              callback: (isTrusted: boolean) => void) => void): this;
262    once(event: 'certificate-error', listener: (event: Event,
263                                              webContents: WebContents,
264                                              url: string,
265                                              /**
266                                               * The error code
267                                               */
268                                              error: string,
269                                              certificate: Certificate,
270                                              callback: (isTrusted: boolean) => void) => void): this;
271    addListener(event: 'certificate-error', listener: (event: Event,
272                                              webContents: WebContents,
273                                              url: string,
274                                              /**
275                                               * The error code
276                                               */
277                                              error: string,
278                                              certificate: Certificate,
279                                              callback: (isTrusted: boolean) => void) => void): this;
280    removeListener(event: 'certificate-error', listener: (event: Event,
281                                              webContents: WebContents,
282                                              url: string,
283                                              /**
284                                               * The error code
285                                               */
286                                              error: string,
287                                              certificate: Certificate,
288                                              callback: (isTrusted: boolean) => void) => void): this;
289    /**
290     * Emitted during Handoff when an activity from a different device wants to be
291     * resumed. You should call `event.preventDefault()` if you want to handle this
292     * event.
293     *
294     * A user activity can be continued only in an app that has the same developer Team
295     * ID as the activity's source app and that supports the activity's type. Supported
296     * activity types are specified in the app's `Info.plist` under the
297     * `NSUserActivityTypes` key.
298     *
299     * @platform darwin
300     */
301    on(event: 'continue-activity', listener: (event: Event,
302                                              /**
303                                               * A string identifying the activity. Maps to `NSUserActivity.activityType`.
304                                               */
305                                              type: string,
306                                              /**
307                                               * Contains app-specific state stored by the activity on another device.
308                                               */
309                                              userInfo: unknown) => void): this;
310    once(event: 'continue-activity', listener: (event: Event,
311                                              /**
312                                               * A string identifying the activity. Maps to `NSUserActivity.activityType`.
313                                               */
314                                              type: string,
315                                              /**
316                                               * Contains app-specific state stored by the activity on another device.
317                                               */
318                                              userInfo: unknown) => void): this;
319    addListener(event: 'continue-activity', listener: (event: Event,
320                                              /**
321                                               * A string identifying the activity. Maps to `NSUserActivity.activityType`.
322                                               */
323                                              type: string,
324                                              /**
325                                               * Contains app-specific state stored by the activity on another device.
326                                               */
327                                              userInfo: unknown) => void): this;
328    removeListener(event: 'continue-activity', listener: (event: Event,
329                                              /**
330                                               * A string identifying the activity. Maps to `NSUserActivity.activityType`.
331                                               */
332                                              type: string,
333                                              /**
334                                               * Contains app-specific state stored by the activity on another device.
335                                               */
336                                              userInfo: unknown) => void): this;
337    /**
338     * Emitted during Handoff when an activity from a different device fails to be
339     * resumed.
340     *
341     * @platform darwin
342     */
343    on(event: 'continue-activity-error', listener: (event: Event,
344                                                    /**
345                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
346                                                     */
347                                                    type: string,
348                                                    /**
349                                                     * A string with the error's localized description.
350                                                     */
351                                                    error: string) => void): this;
352    once(event: 'continue-activity-error', listener: (event: Event,
353                                                    /**
354                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
355                                                     */
356                                                    type: string,
357                                                    /**
358                                                     * A string with the error's localized description.
359                                                     */
360                                                    error: string) => void): this;
361    addListener(event: 'continue-activity-error', listener: (event: Event,
362                                                    /**
363                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
364                                                     */
365                                                    type: string,
366                                                    /**
367                                                     * A string with the error's localized description.
368                                                     */
369                                                    error: string) => void): this;
370    removeListener(event: 'continue-activity-error', listener: (event: Event,
371                                                    /**
372                                                     * A string identifying the activity. Maps to `NSUserActivity.activityType`.
373                                                     */
374                                                    type: string,
375                                                    /**
376                                                     * A string with the error's localized description.
377                                                     */
378                                                    error: string) => void): this;
379    /**
380     * Emitted when `desktopCapturer.getSources()` is called in the renderer process of
381     * `webContents`. Calling `event.preventDefault()` will make it return empty
382     * sources.
383     */
384    on(event: 'desktop-capturer-get-sources', listener: (event: Event,
385                                                         webContents: WebContents) => void): this;
386    once(event: 'desktop-capturer-get-sources', listener: (event: Event,
387                                                         webContents: WebContents) => void): this;
388    addListener(event: 'desktop-capturer-get-sources', listener: (event: Event,
389                                                         webContents: WebContents) => void): this;
390    removeListener(event: 'desktop-capturer-get-sources', listener: (event: Event,
391                                                         webContents: WebContents) => void): this;
392    /**
393     * Emitted whenever there is a GPU info update.
394     */
395    on(event: 'gpu-info-update', listener: Function): this;
396    once(event: 'gpu-info-update', listener: Function): this;
397    addListener(event: 'gpu-info-update', listener: Function): this;
398    removeListener(event: 'gpu-info-update', listener: Function): this;
399    /**
400     * Emitted when the GPU process crashes or is killed.
401     */
402    on(event: 'gpu-process-crashed', listener: (event: Event,
403                                                killed: boolean) => void): this;
404    once(event: 'gpu-process-crashed', listener: (event: Event,
405                                                killed: boolean) => void): this;
406    addListener(event: 'gpu-process-crashed', listener: (event: Event,
407                                                killed: boolean) => void): this;
408    removeListener(event: 'gpu-process-crashed', listener: (event: Event,
409                                                killed: boolean) => void): this;
410    /**
411     * Emitted when `webContents` wants to do basic auth.
412     *
413     * The default behavior is to cancel all authentications. To override this you
414     * should prevent the default behavior with `event.preventDefault()` and call
415     * `callback(username, password)` with the credentials.
416     *
417     * If `callback` is called without a username or password, the authentication
418     * request will be cancelled and the authentication error will be returned to the
419     * page.
420     */
421    on(event: 'login', listener: (event: Event,
422                                  webContents: WebContents,
423                                  authenticationResponseDetails: AuthenticationResponseDetails,
424                                  authInfo: AuthInfo,
425                                  callback: (username?: string, password?: string) => void) => void): this;
426    once(event: 'login', listener: (event: Event,
427                                  webContents: WebContents,
428                                  authenticationResponseDetails: AuthenticationResponseDetails,
429                                  authInfo: AuthInfo,
430                                  callback: (username?: string, password?: string) => void) => void): this;
431    addListener(event: 'login', listener: (event: Event,
432                                  webContents: WebContents,
433                                  authenticationResponseDetails: AuthenticationResponseDetails,
434                                  authInfo: AuthInfo,
435                                  callback: (username?: string, password?: string) => void) => void): this;
436    removeListener(event: 'login', listener: (event: Event,
437                                  webContents: WebContents,
438                                  authenticationResponseDetails: AuthenticationResponseDetails,
439                                  authInfo: AuthInfo,
440                                  callback: (username?: string, password?: string) => void) => void): this;
441    /**
442     * Emitted when the user clicks the native macOS new tab button. The new tab button
443     * is only visible if the current `BrowserWindow` has a `tabbingIdentifier`
444     *
445     * @platform darwin
446     */
447    on(event: 'new-window-for-tab', listener: (event: Event) => void): this;
448    once(event: 'new-window-for-tab', listener: (event: Event) => void): this;
449    addListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
450    removeListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
451    /**
452     * Emitted when the user wants to open a file with the application. The `open-file`
453     * event is usually emitted when the application is already open and the OS wants
454     * to reuse the application to open the file. `open-file` is also emitted when a
455     * file is dropped onto the dock and the application is not yet running. Make sure
456     * to listen for the `open-file` event very early in your application startup to
457     * handle this case (even before the `ready` event is emitted).
458     *
459     * You should call `event.preventDefault()` if you want to handle this event.
460     *
461     * On Windows, you have to parse `process.argv` (in the main process) to get the
462     * filepath.
463     *
464     * @platform darwin
465     */
466    on(event: 'open-file', listener: (event: Event,
467                                      path: string) => void): this;
468    once(event: 'open-file', listener: (event: Event,
469                                      path: string) => void): this;
470    addListener(event: 'open-file', listener: (event: Event,
471                                      path: string) => void): this;
472    removeListener(event: 'open-file', listener: (event: Event,
473                                      path: string) => void): this;
474    /**
475     * Emitted when the user wants to open a URL with the application. Your
476     * application's `Info.plist` file must define the URL scheme within the
477     * `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`.
478     *
479You should call `event.preventDefault()` if you want to handle this event.
480     *
481     * @platform darwin
482     */
483    on(event: 'open-url', listener: (event: Event,
484                                     url: string) => void): this;
485    once(event: 'open-url', listener: (event: Event,
486                                     url: string) => void): this;
487    addListener(event: 'open-url', listener: (event: Event,
488                                     url: string) => void): this;
489    removeListener(event: 'open-url', listener: (event: Event,
490                                     url: string) => void): this;
491    /**
492     * Emitted when the application is quitting.
493     *
494     * **Note:** On Windows, this event will not be emitted if the app is closed due to
495     * a shutdown/restart of the system or a user logout.
496     */
497    on(event: 'quit', listener: (event: Event,
498                                 exitCode: number) => void): this;
499    once(event: 'quit', listener: (event: Event,
500                                 exitCode: number) => void): this;
501    addListener(event: 'quit', listener: (event: Event,
502                                 exitCode: number) => void): this;
503    removeListener(event: 'quit', listener: (event: Event,
504                                 exitCode: number) => void): this;
505    /**
506     * Emitted when Electron has finished initializing. On macOS, `launchInfo` holds
507     * the `userInfo` of the `NSUserNotification` that was used to open the
508     * application, if it was launched from Notification Center. You can call
509     * `app.isReady()` to check if this event has already fired.
510     */
511    on(event: 'ready', listener: (launchInfo: unknown) => void): this;
512    once(event: 'ready', listener: (launchInfo: unknown) => void): this;
513    addListener(event: 'ready', listener: (launchInfo: unknown) => void): this;
514    removeListener(event: 'ready', listener: (launchInfo: unknown) => void): this;
515    /**
516     * Emitted when `remote.getBuiltin()` is called in the renderer process of
517     * `webContents`. Calling `event.preventDefault()` will prevent the module from
518     * being returned. Custom value can be returned by setting `event.returnValue`.
519     */
520    on(event: 'remote-get-builtin', listener: (event: Event,
521                                               webContents: WebContents,
522                                               moduleName: string) => void): this;
523    once(event: 'remote-get-builtin', listener: (event: Event,
524                                               webContents: WebContents,
525                                               moduleName: string) => void): this;
526    addListener(event: 'remote-get-builtin', listener: (event: Event,
527                                               webContents: WebContents,
528                                               moduleName: string) => void): this;
529    removeListener(event: 'remote-get-builtin', listener: (event: Event,
530                                               webContents: WebContents,
531                                               moduleName: string) => void): this;
532    /**
533     * Emitted when `remote.getCurrentWebContents()` is called in the renderer process
534     * of `webContents`. Calling `event.preventDefault()` will prevent the object from
535     * being returned. Custom value can be returned by setting `event.returnValue`.
536     */
537    on(event: 'remote-get-current-web-contents', listener: (event: Event,
538                                                            webContents: WebContents) => void): this;
539    once(event: 'remote-get-current-web-contents', listener: (event: Event,
540                                                            webContents: WebContents) => void): this;
541    addListener(event: 'remote-get-current-web-contents', listener: (event: Event,
542                                                            webContents: WebContents) => void): this;
543    removeListener(event: 'remote-get-current-web-contents', listener: (event: Event,
544                                                            webContents: WebContents) => void): this;
545    /**
546     * Emitted when `remote.getCurrentWindow()` is called in the renderer process of
547     * `webContents`. Calling `event.preventDefault()` will prevent the object from
548     * being returned. Custom value can be returned by setting `event.returnValue`.
549     */
550    on(event: 'remote-get-current-window', listener: (event: Event,
551                                                      webContents: WebContents) => void): this;
552    once(event: 'remote-get-current-window', listener: (event: Event,
553                                                      webContents: WebContents) => void): this;
554    addListener(event: 'remote-get-current-window', listener: (event: Event,
555                                                      webContents: WebContents) => void): this;
556    removeListener(event: 'remote-get-current-window', listener: (event: Event,
557                                                      webContents: WebContents) => void): this;
558    /**
559     * Emitted when `remote.getGlobal()` is called in the renderer process of
560     * `webContents`. Calling `event.preventDefault()` will prevent the global from
561     * being returned. Custom value can be returned by setting `event.returnValue`.
562     */
563    on(event: 'remote-get-global', listener: (event: Event,
564                                              webContents: WebContents,
565                                              globalName: string) => void): this;
566    once(event: 'remote-get-global', listener: (event: Event,
567                                              webContents: WebContents,
568                                              globalName: string) => void): this;
569    addListener(event: 'remote-get-global', listener: (event: Event,
570                                              webContents: WebContents,
571                                              globalName: string) => void): this;
572    removeListener(event: 'remote-get-global', listener: (event: Event,
573                                              webContents: WebContents,
574                                              globalName: string) => void): this;
575    /**
576     * Emitted when `<webview>.getWebContents()` is called in the renderer process of
577     * `webContents`. Calling `event.preventDefault()` will prevent the object from
578     * being returned. Custom value can be returned by setting `event.returnValue`.
579     */
580    on(event: 'remote-get-guest-web-contents', listener: (event: Event,
581                                                          webContents: WebContents,
582                                                          guestWebContents: WebContents) => void): this;
583    once(event: 'remote-get-guest-web-contents', listener: (event: Event,
584                                                          webContents: WebContents,
585                                                          guestWebContents: WebContents) => void): this;
586    addListener(event: 'remote-get-guest-web-contents', listener: (event: Event,
587                                                          webContents: WebContents,
588                                                          guestWebContents: WebContents) => void): this;
589    removeListener(event: 'remote-get-guest-web-contents', listener: (event: Event,
590                                                          webContents: WebContents,
591                                                          guestWebContents: WebContents) => void): this;
592    /**
593     * Emitted when `remote.require()` is called in the renderer process of
594     * `webContents`. Calling `event.preventDefault()` will prevent the module from
595     * being returned. Custom value can be returned by setting `event.returnValue`.
596     */
597    on(event: 'remote-require', listener: (event: Event,
598                                           webContents: WebContents,
599                                           moduleName: string) => void): this;
600    once(event: 'remote-require', listener: (event: Event,
601                                           webContents: WebContents,
602                                           moduleName: string) => void): this;
603    addListener(event: 'remote-require', listener: (event: Event,
604                                           webContents: WebContents,
605                                           moduleName: string) => void): this;
606    removeListener(event: 'remote-require', listener: (event: Event,
607                                           webContents: WebContents,
608                                           moduleName: string) => void): this;
609    /**
610     * Emitted when the renderer process of `webContents` crashes or is killed.
611     */
612    on(event: 'renderer-process-crashed', listener: (event: Event,
613                                                     webContents: WebContents,
614                                                     killed: boolean) => void): this;
615    once(event: 'renderer-process-crashed', listener: (event: Event,
616                                                     webContents: WebContents,
617                                                     killed: boolean) => void): this;
618    addListener(event: 'renderer-process-crashed', listener: (event: Event,
619                                                     webContents: WebContents,
620                                                     killed: boolean) => void): this;
621    removeListener(event: 'renderer-process-crashed', listener: (event: Event,
622                                                     webContents: WebContents,
623                                                     killed: boolean) => void): this;
624    /**
625     * This event will be emitted inside the primary instance of your application when
626     * a second instance has been executed and calls `app.requestSingleInstanceLock()`.
627     *
628     * `argv` is an Array of the second instance's command line arguments, and
629     * `workingDirectory` is its current working directory. Usually applications
630     * respond to this by making their primary window focused and non-minimized.
631     *
632     * This event is guaranteed to be emitted after the `ready` event of `app` gets
633     * emitted.
634     *
635     * **Note:** Extra command line arguments might be added by Chromium, such as
636     * `--original-process-start-time`.
637     */
638    on(event: 'second-instance', listener: (event: Event,
639                                            /**
640                                             * An array of the second instance's command line arguments
641                                             */
642                                            argv: string[],
643                                            /**
644                                             * The second instance's working directory
645                                             */
646                                            workingDirectory: string) => void): this;
647    once(event: 'second-instance', listener: (event: Event,
648                                            /**
649                                             * An array of the second instance's command line arguments
650                                             */
651                                            argv: string[],
652                                            /**
653                                             * The second instance's working directory
654                                             */
655                                            workingDirectory: string) => void): this;
656    addListener(event: 'second-instance', listener: (event: Event,
657                                            /**
658                                             * An array of the second instance's command line arguments
659                                             */
660                                            argv: string[],
661                                            /**
662                                             * The second instance's working directory
663                                             */
664                                            workingDirectory: string) => void): this;
665    removeListener(event: 'second-instance', listener: (event: Event,
666                                            /**
667                                             * An array of the second instance's command line arguments
668                                             */
669                                            argv: string[],
670                                            /**
671                                             * The second instance's working directory
672                                             */
673                                            workingDirectory: string) => void): this;
674    /**
675     * Emitted when a client certificate is requested.
676     *
677     * The `url` corresponds to the navigation entry requesting the client certificate
678     * and `callback` can be called with an entry filtered from the list. Using
679     * `event.preventDefault()` prevents the application from using the first
680     * certificate from the store.
681     */
682    on(event: 'select-client-certificate', listener: (event: Event,
683                                                      webContents: WebContents,
684                                                      url: string,
685                                                      certificateList: Certificate[],
686                                                      callback: (certificate?: Certificate) => void) => void): this;
687    once(event: 'select-client-certificate', listener: (event: Event,
688                                                      webContents: WebContents,
689                                                      url: string,
690                                                      certificateList: Certificate[],
691                                                      callback: (certificate?: Certificate) => void) => void): this;
692    addListener(event: 'select-client-certificate', listener: (event: Event,
693                                                      webContents: WebContents,
694                                                      url: string,
695                                                      certificateList: Certificate[],
696                                                      callback: (certificate?: Certificate) => void) => void): this;
697    removeListener(event: 'select-client-certificate', listener: (event: Event,
698                                                      webContents: WebContents,
699                                                      url: string,
700                                                      certificateList: Certificate[],
701                                                      callback: (certificate?: Certificate) => void) => void): this;
702    /**
703     * Emitted when Electron has created a new `session`.
704     */
705    on(event: 'session-created', listener: (session: Session) => void): this;
706    once(event: 'session-created', listener: (session: Session) => void): this;
707    addListener(event: 'session-created', listener: (session: Session) => void): this;
708    removeListener(event: 'session-created', listener: (session: Session) => void): this;
709    /**
710     * Emitted when Handoff is about to be resumed on another device. If you need to
711     * update the state to be transferred, you should call `event.preventDefault()`
712     * immediately, construct a new `userInfo` dictionary and call
713     * `app.updateCurrentActiviy()` in a timely manner. Otherwise, the operation will
714     * fail and `continue-activity-error` will be called.
715     *
716     * @platform darwin
717     */
718    on(event: 'update-activity-state', listener: (event: Event,
719                                                  /**
720                                                   * A string identifying the activity. Maps to `NSUserActivity.activityType`.
721                                                   */
722                                                  type: string,
723                                                  /**
724                                                   * Contains app-specific state stored by the activity.
725                                                   */
726                                                  userInfo: unknown) => void): this;
727    once(event: 'update-activity-state', listener: (event: Event,
728                                                  /**
729                                                   * A string identifying the activity. Maps to `NSUserActivity.activityType`.
730                                                   */
731                                                  type: string,
732                                                  /**
733                                                   * Contains app-specific state stored by the activity.
734                                                   */
735                                                  userInfo: unknown) => void): this;
736    addListener(event: 'update-activity-state', listener: (event: Event,
737                                                  /**
738                                                   * A string identifying the activity. Maps to `NSUserActivity.activityType`.
739                                                   */
740                                                  type: string,
741                                                  /**
742                                                   * Contains app-specific state stored by the activity.
743                                                   */
744                                                  userInfo: unknown) => void): this;
745    removeListener(event: 'update-activity-state', listener: (event: Event,
746                                                  /**
747                                                   * A string identifying the activity. Maps to `NSUserActivity.activityType`.
748                                                   */
749                                                  type: string,
750                                                  /**
751                                                   * Contains app-specific state stored by the activity.
752                                                   */
753                                                  userInfo: unknown) => void): this;
754    /**
755     * Emitted when a new webContents is created.
756     */
757    on(event: 'web-contents-created', listener: (event: Event,
758                                                 webContents: WebContents) => void): this;
759    once(event: 'web-contents-created', listener: (event: Event,
760                                                 webContents: WebContents) => void): this;
761    addListener(event: 'web-contents-created', listener: (event: Event,
762                                                 webContents: WebContents) => void): this;
763    removeListener(event: 'web-contents-created', listener: (event: Event,
764                                                 webContents: WebContents) => void): this;
765    /**
766     * Emitted during Handoff before an activity from a different device wants to be
767     * resumed. You should call `event.preventDefault()` if you want to handle this
768     * event.
769     *
770     * @platform darwin
771     */
772    on(event: 'will-continue-activity', listener: (event: Event,
773                                                   /**
774                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
775                                                    */
776                                                   type: string) => void): this;
777    once(event: 'will-continue-activity', listener: (event: Event,
778                                                   /**
779                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
780                                                    */
781                                                   type: string) => void): this;
782    addListener(event: 'will-continue-activity', listener: (event: Event,
783                                                   /**
784                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
785                                                    */
786                                                   type: string) => void): this;
787    removeListener(event: 'will-continue-activity', listener: (event: Event,
788                                                   /**
789                                                    * A string identifying the activity. Maps to `NSUserActivity.activityType`.
790                                                    */
791                                                   type: string) => void): this;
792    /**
793     * Emitted when the application has finished basic startup. On Windows and Linux,
794     * the `will-finish-launching` event is the same as the `ready` event; on macOS,
795     * this event represents the `applicationWillFinishLaunching` notification of
796     * `NSApplication`. You would usually set up listeners for the `open-file` and
797     * `open-url` events here, and start the crash reporter and auto updater.
798     *
799In most cases, you should do everything in the `ready` event handler.
800     */
801    on(event: 'will-finish-launching', listener: Function): this;
802    once(event: 'will-finish-launching', listener: Function): this;
803    addListener(event: 'will-finish-launching', listener: Function): this;
804    removeListener(event: 'will-finish-launching', listener: Function): this;
805    /**
806     * Emitted when all windows have been closed and the application will quit. Calling
807     * `event.preventDefault()` will prevent the default behaviour, which is
808     * terminating the application.
809     *
810     * See the description of the `window-all-closed` event for the differences between
811     * the `will-quit` and `window-all-closed` events.
812     *
813     * **Note:** On Windows, this event will not be emitted if the app is closed due to
814     * a shutdown/restart of the system or a user logout.
815     */
816    on(event: 'will-quit', listener: (event: Event) => void): this;
817    once(event: 'will-quit', listener: (event: Event) => void): this;
818    addListener(event: 'will-quit', listener: (event: Event) => void): this;
819    removeListener(event: 'will-quit', listener: (event: Event) => void): this;
820    /**
821     * Emitted when all windows have been closed.
822     *
823     * If you do not subscribe to this event and all windows are closed, the default
824     * behavior is to quit the app; however, if you subscribe, you control whether the
825     * app quits or not. If the user pressed `Cmd + Q`, or the developer called
826     * `app.quit()`, Electron will first try to close all the windows and then emit the
827     * `will-quit` event, and in this case the `window-all-closed` event would not be
828     * emitted.
829     */
830    on(event: 'window-all-closed', listener: Function): this;
831    once(event: 'window-all-closed', listener: Function): this;
832    addListener(event: 'window-all-closed', listener: Function): this;
833    removeListener(event: 'window-all-closed', listener: Function): this;
834    /**
835     * Adds `path` to the recent documents list.
836     *
837     * This list is managed by the OS. On Windows, you can visit the list from the task
838     * bar, and on macOS, you can visit it from dock menu.
839     *
840     * @platform darwin,win32
841     */
842    addRecentDocument(path: string): void;
843    /**
844     * Clears the recent documents list.
845     *
846     * @platform darwin,win32
847     */
848    clearRecentDocuments(): void;
849    /**
850     * By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain
851     * basis if the GPU processes crashes too frequently. This function disables that
852     * behaviour.
853
854This method can only be called before app is ready.
855     */
856    disableDomainBlockingFor3DAPIs(): void;
857    /**
858     * Disables hardware acceleration for current app.
859     *
860This method can only be called before app is ready.
861     */
862    disableHardwareAcceleration(): void;
863    /**
864     * Enables full sandbox mode on the app.
865     *
866This method can only be called before app is ready.
867     *
868     * @experimental
869     */
870    enableSandbox(): void;
871    /**
872     * Exits immediately with `exitCode`. `exitCode` defaults to 0.
873     *
874     * All windows will be closed immediately without asking the user, and the
875     * `before-quit` and `will-quit` events will not be emitted.
876     */
877    exit(exitCode?: number): void;
878    /**
879     * On Linux, focuses on the first visible window. On macOS, makes the application
880     * the active app. On Windows, focuses on the application's first window.
881     *
882You should seek to use the `steal` option as sparingly as possible.
883     */
884    focus(options?: FocusOptions): void;
885    /**
886     * Name of the application handling the protocol, or an empty string if there is no
887     * handler. For instance, if Electron is the default handler of the URL, this could
888     * be `Electron` on Windows and Mac. However, don't rely on the precise format
889     * which is not guaranteed to remain unchanged. Expect a different format on Linux,
890     * possibly with a `.desktop` suffix.
891     *
892     * This method returns the application name of the default handler for the protocol
893     * (aka URI scheme) of a URL.
894     */
895    getApplicationNameForProtocol(url: string): string;
896    /**
897     * Array of `ProcessMetric` objects that correspond to memory and CPU usage
898     * statistics of all the processes associated with the app.
899     */
900    getAppMetrics(): ProcessMetric[];
901    /**
902     * The current application directory.
903     */
904    getAppPath(): string;
905    /**
906     * The current value displayed in the counter badge.
907
908**Deprecated**
909     *
910     * @platform linux,darwin
911     */
912    getBadgeCount(): number;
913    /**
914     * The type of the currently running activity.
915     *
916     * @platform darwin
917     */
918    getCurrentActivityType(): string;
919    /**
920     * fulfilled with the app's icon, which is a NativeImage.
921     *
922     * Fetches a path's associated icon.
923     *
924     * On _Windows_, there a 2 kinds of icons:
925     *
926     * * Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
927     * * Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
928     *
929     * On _Linux_ and _macOS_, icons depend on the application associated with file
930     * mime type.
931     */
932    getFileIcon(path: string, options?: FileIconOptions): Promise<Electron.NativeImage>;
933    /**
934     * The Graphics Feature Status from `chrome://gpu/`.
935     *
936     * **Note:** This information is only usable after the `gpu-info-update` event is
937     * emitted.
938     */
939    getGPUFeatureStatus(): GPUFeatureStatus;
940    /**
941     * For `infoType` equal to `complete`: Promise is fulfilled with `Object`
942     * containing all the GPU Information as in chromium's GPUInfo object. This
943     * includes the version and driver information that's shown on `chrome://gpu` page.
944     *
945     * For `infoType` equal to `basic`: Promise is fulfilled with `Object` containing
946     * fewer attributes than when requested with `complete`. Here's an example of basic
947     * response:
948     *
949     * Using `basic` should be preferred if only basic information like `vendorId` or
950     * `driverId` is needed.
951     */
952    getGPUInfo(infoType: 'basic' | 'complete'): Promise<unknown>;
953    /**
954     * * `minItems` Integer - The minimum number of items that will be shown in the
955     * Jump List (for a more detailed description of this value see the MSDN docs).
956     * * `removedItems` JumpListItem[] - Array of `JumpListItem` objects that
957     * correspond to items that the user has explicitly removed from custom categories
958     * in the Jump List. These items must not be re-added to the Jump List in the
959     * **next** call to `app.setJumpList()`, Windows will not display any custom
960     * category that contains any of the removed items.
961     *
962     * @platform win32
963     */
964    getJumpListSettings(): JumpListSettings;
965    /**
966     * The current application locale. Possible return values are documented here.
967     *
968     * To set the locale, you'll want to use a command line switch at app startup,
969     * which may be found here.
970     *
971     * **Note:** When distributing your packaged app, you have to also ship the
972     * `locales` folder.
973     *
974     * **Note:** On Windows, you have to call it after the `ready` events gets emitted.
975     */
976    getLocale(): string;
977    /**
978     * User operating system's locale two-letter ISO 3166 country code. The value is
979     * taken from native OS APIs.
980     *
981**Note:** When unable to detect locale country code, it returns empty string.
982     */
983    getLocaleCountryCode(): string;
984    /**
985     * If you provided `path` and `args` options to `app.setLoginItemSettings`, then
986     * you need to pass the same arguments here for `openAtLogin` to be set correctly.
987     *
988     *
989     * * `openAtLogin` Boolean - `true` if the app is set to open at login.
990     * * `openAsHidden` Boolean _macOS_ - `true` if the app is set to open as hidden at
991     * login. This setting is not available on MAS builds.
992     * * `wasOpenedAtLogin` Boolean _macOS_ - `true` if the app was opened at login
993     * automatically. This setting is not available on MAS builds.
994     * * `wasOpenedAsHidden` Boolean _macOS_ - `true` if the app was opened as a hidden
995     * login item. This indicates that the app should not open any windows at startup.
996     * This setting is not available on MAS builds.
997     * * `restoreState` Boolean _macOS_ - `true` if the app was opened as a login item
998     * that should restore the state from the previous session. This indicates that the
999     * app should restore the windows that were open the last time the app was closed.
1000     * This setting is not available on MAS builds.
1001     *
1002     * @platform darwin,win32
1003     */
1004    getLoginItemSettings(options?: LoginItemSettingsOptions): LoginItemSettings;
1005    /**
1006     * The current application's name, which is the name in the application's
1007     * `package.json` file.
1008     *
1009     * Usually the `name` field of `package.json` is a short lowercase name, according
1010     * to the npm modules spec. You should usually also specify a `productName` field,
1011     * which is your application's full capitalized name, and which will be preferred
1012     * over `name` by Electron.
1013
1014**Deprecated**
1015     */
1016    getName(): string;
1017    /**
1018     * A path to a special directory or file associated with `name`. On failure, an
1019     * `Error` is thrown.
1020     *
1021     * If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being
1022     * called first, a default log directory will be created equivalent to calling
1023     * `app.setAppLogsPath()` without a `path` parameter.
1024     */
1025    getPath(name: 'home' | 'appData' | 'userData' | 'cache' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'logs' | 'pepperFlashSystemPlugin'): string;
1026    /**
1027     * The version of the loaded application. If no version is found in the
1028     * application's `package.json` file, the version of the current bundle or
1029     * executable is returned.
1030     */
1031    getVersion(): string;
1032    /**
1033     * This method returns whether or not this instance of your app is currently
1034     * holding the single instance lock.  You can request the lock with
1035     * `app.requestSingleInstanceLock()` and release with
1036     * `app.releaseSingleInstanceLock()`
1037     */
1038    hasSingleInstanceLock(): boolean;
1039    /**
1040     * Hides all application windows without minimizing them.
1041     *
1042     * @platform darwin
1043     */
1044    hide(): void;
1045    /**
1046     * Imports the certificate in pkcs12 format into the platform certificate store.
1047     * `callback` is called with the `result` of import operation, a value of `0`
1048     * indicates success while any other value indicates failure according to Chromium
1049     * net_error_list.
1050     *
1051     * @platform linux
1052     */
1053    importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void;
1054    /**
1055     * Invalidates the current Handoff user activity.
1056     *
1057     * @platform darwin
1058     */
1059    invalidateCurrentActivity(): void;
1060    /**
1061     * `true` if Chrome's accessibility support is enabled, `false` otherwise. This API
1062     * will return `true` if the use of assistive technologies, such as screen readers,
1063     * has been detected. See
1064     * https://www.chromium.org/developers/design-documents/accessibility for more
1065     * details.
1066
1067**Deprecated**
1068     *
1069     * @platform darwin,win32
1070     */
1071    isAccessibilitySupportEnabled(): boolean;
1072    /**
1073     * Whether the current executable is the default handler for a protocol (aka URI
1074     * scheme).
1075     *
1076     * **Note:** On macOS, you can use this method to check if the app has been
1077     * registered as the default protocol handler for a protocol. You can also verify
1078     * this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
1079     * macOS machine. Please refer to Apple's documentation for details.
1080     *
1081     * The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme`
1082     * internally.
1083     */
1084    isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1085    /**
1086     * whether or not the current OS version allows for native emoji pickers.
1087     */
1088    isEmojiPanelSupported(): boolean;
1089    /**
1090     * Whether the application is currently running from the systems Application
1091     * folder. Use in combination with `app.moveToApplicationsFolder()`
1092     *
1093     * @platform darwin
1094     */
1095    isInApplicationsFolder(): boolean;
1096    /**
1097     * `true` if Electron has finished initializing, `false` otherwise.
1098     */
1099    isReady(): boolean;
1100    /**
1101     * Whether the current desktop environment is Unity launcher.
1102     *
1103     * @platform linux
1104     */
1105    isUnityRunning(): boolean;
1106    /**
1107     * Whether the move was successful. Please note that if the move is successful,
1108     * your application will quit and relaunch.
1109     *
1110     * No confirmation dialog will be presented by default. If you wish to allow the
1111     * user to confirm the operation, you may do so using the `dialog` API.
1112     *
1113     * **NOTE:** This method throws errors if anything other than the user causes the
1114     * move to fail. For instance if the user cancels the authorization dialog, this
1115     * method returns false. If we fail to perform the copy, then this method will
1116     * throw an error. The message in the error should be informative and tell you
1117     * exactly what went wrong.
1118     *
1119     * By default, if an app of the same name as the one being moved exists in the
1120     * Applications directory and is _not_ running, the existing app will be trashed
1121     * and the active app moved into its place. If it _is_ running, the pre-existing
1122     * running app will assume focus and the the previously active app will quit
1123     * itself. This behavior can be changed by providing the optional conflict handler,
1124     * where the boolean returned by the handler determines whether or not the move
1125     * conflict is resolved with default behavior.  i.e. returning `false` will ensure
1126     * no further action is taken, returning `true` will result in the default behavior
1127     * and the method continuing.
1128     *
1129     * For example:
1130     *
1131     * Would mean that if an app already exists in the user directory, if the user
1132     * chooses to 'Continue Move' then the function would continue with its default
1133     * behavior and the existing app will be trashed and the active app moved into its
1134     * place.
1135     *
1136     * @platform darwin
1137     */
1138    moveToApplicationsFolder(options?: MoveToApplicationsFolderOptions): boolean;
1139    /**
1140     * Try to close all windows. The `before-quit` event will be emitted first. If all
1141     * windows are successfully closed, the `will-quit` event will be emitted and by
1142     * default the application will terminate.
1143     *
1144     * This method guarantees that all `beforeunload` and `unload` event handlers are
1145     * correctly executed. It is possible that a window cancels the quitting by
1146     * returning `false` in the `beforeunload` event handler.
1147     */
1148    quit(): void;
1149    /**
1150     * Relaunches the app when current instance exits.
1151     *
1152     * By default, the new instance will use the same working directory and command
1153     * line arguments with current instance. When `args` is specified, the `args` will
1154     * be passed as command line arguments instead. When `execPath` is specified, the
1155     * `execPath` will be executed for relaunch instead of current app.
1156     *
1157     * Note that this method does not quit the app when executed, you have to call
1158     * `app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.
1159     *
1160     * When `app.relaunch` is called for multiple times, multiple instances will be
1161     * started after current instance exited.
1162     *
1163     * An example of restarting current instance immediately and adding a new command
1164     * line argument to the new instance:
1165     */
1166    relaunch(options?: RelaunchOptions): void;
1167    /**
1168     * Releases all locks that were created by `requestSingleInstanceLock`. This will
1169     * allow multiple instances of the application to once again run side by side.
1170     */
1171    releaseSingleInstanceLock(): void;
1172    /**
1173     * Whether the call succeeded.
1174     *
1175     * This method checks if the current executable as the default handler for a
1176     * protocol (aka URI scheme). If so, it will remove the app as the default handler.
1177     *
1178     * @platform darwin,win32
1179     */
1180    removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1181    /**
1182     * The return value of this method indicates whether or not this instance of your
1183     * application successfully obtained the lock.  If it failed to obtain the lock,
1184     * you can assume that another instance of your application is already running with
1185     * the lock and exit immediately.
1186     *
1187     * I.e. This method returns `true` if your process is the primary instance of your
1188     * application and your app should continue loading.  It returns `false` if your
1189     * process should immediately quit as it has sent its parameters to another
1190     * instance that has already acquired the lock.
1191     *
1192     * On macOS, the system enforces single instance automatically when users try to
1193     * open a second instance of your app in Finder, and the `open-file` and `open-url`
1194     * events will be emitted for that. However when users start your app in command
1195     * line, the system's single instance mechanism will be bypassed, and you have to
1196     * use this method to ensure single instance.
1197     *
1198     * An example of activating the window of primary instance when a second instance
1199     * starts:
1200     */
1201    requestSingleInstanceLock(): boolean;
1202    /**
1203     * Marks the current Handoff user activity as inactive without invalidating it.
1204     *
1205     * @platform darwin
1206     */
1207    resignCurrentActivity(): void;
1208    /**
1209     * Set the about panel options. This will override the values defined in the app's
1210     * `.plist` file on MacOS. See the Apple docs for more details. On Linux, values
1211     * must be set in order to be shown; there are no defaults.
1212     *
1213     * If you do not set `credits` but still wish to surface them in your app, AppKit
1214     * will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in
1215     * that order, in the bundle returned by the NSBundle class method main. The first
1216     * file found is used, and if none is found, the info area is left blank. See Apple
1217     * documentation for more information.
1218     */
1219    setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
1220    /**
1221     * Manually enables Chrome's accessibility support, allowing to expose
1222     * accessibility switch to users in application settings. See Chromium's
1223     * accessibility docs for more details. Disabled by default.
1224     *
1225     * This API must be called after the `ready` event is emitted.
1226     *
1227     * **Note:** Rendering accessibility tree can significantly affect the performance
1228     * of your app. It should not be enabled by default.
1229
1230**Deprecated**
1231     *
1232     * @platform darwin,win32
1233     */
1234    setAccessibilitySupportEnabled(enabled: boolean): void;
1235    /**
1236     * Sets or creates a directory your app's logs which can then be manipulated with
1237     * `app.getPath()` or `app.setPath(pathName, newPath)`.
1238     *
1239     * Calling `app.setAppLogsPath()` without a `path` parameter will result in this
1240     * directory being set to `~/Library/Logs/YourAppName` on _macOS_, and inside the
1241     * `userData` directory on _Linux_ and _Windows_.
1242     */
1243    setAppLogsPath(path?: string): void;
1244    /**
1245     * Changes the Application User Model ID to `id`.
1246     *
1247     * @platform win32
1248     */
1249    setAppUserModelId(id: string): void;
1250    /**
1251     * Whether the call succeeded.
1252     *
1253     * Sets the current executable as the default handler for a protocol (aka URI
1254     * scheme). It allows you to integrate your app deeper into the operating system.
1255     * Once registered, all links with `your-protocol://` will be opened with the
1256     * current executable. The whole link, including protocol, will be passed to your
1257     * application as a parameter.
1258     *
1259     * **Note:** On macOS, you can only register protocols that have been added to your
1260     * app's `info.plist`, which cannot be modified at runtime. However, you can change
1261     * the file during build time via Electron Forge, Electron Packager, or by editing
1262     * `info.plist` with a text editor. Please refer to Apple's documentation for
1263     * details.
1264     *
1265     * **Note:** In a Windows Store environment (when packaged as an `appx`) this API
1266     * will return `true` for all calls but the registry key it sets won't be
1267     * accessible by other applications.  In order to register your Windows Store
1268     * application as a default protocol handler you must declare the protocol in your
1269     * manifest.
1270     *
1271     * The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme`
1272     * internally.
1273     */
1274    setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
1275    /**
1276     * Whether the call succeeded.
1277     *
1278     * Sets the counter badge for current app. Setting the count to `0` will hide the
1279     * badge.
1280     *
1281     * On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
1282     *
1283     * **Note:** Unity launcher requires the existence of a `.desktop` file to work,
1284     * for more information please read Desktop Environment Integration.
1285     *
1286**Deprecated**
1287     *
1288     * @platform linux,darwin
1289     */
1290    setBadgeCount(count: number): boolean;
1291    /**
1292     * Sets or removes a custom Jump List for the application, and returns one of the
1293     * following strings:
1294     *
1295     * * `ok` - Nothing went wrong.
1296     * * `error` - One or more errors occurred, enable runtime logging to figure out
1297     * the likely cause.
1298     * * `invalidSeparatorError` - An attempt was made to add a separator to a custom
1299     * category in the Jump List. Separators are only allowed in the standard `Tasks`
1300     * category.
1301     * * `fileTypeRegistrationError` - An attempt was made to add a file link to the
1302     * Jump List for a file type the app isn't registered to handle.
1303     * * `customCategoryAccessDeniedError` - Custom categories can't be added to the
1304     * Jump List due to user privacy or group policy settings.
1305     *
1306     * If `categories` is `null` the previously set custom Jump List (if any) will be
1307     * replaced by the standard Jump List for the app (managed by Windows).
1308     *
1309     * **Note:** If a `JumpListCategory` object has neither the `type` nor the `name`
1310     * property set then its `type` is assumed to be `tasks`. If the `name` property is
1311     * set but the `type` property is omitted then the `type` is assumed to be
1312     * `custom`.
1313     *
1314     * **Note:** Users can remove items from custom categories, and Windows will not
1315     * allow a removed item to be added back into a custom category until **after** the
1316     * next successful call to `app.setJumpList(categories)`. Any attempt to re-add a
1317     * removed item to a custom category earlier than that will result in the entire
1318     * custom category being omitted from the Jump List. The list of removed items can
1319     * be obtained using `app.getJumpListSettings()`.
1320     *
1321Here's a very simple example of creating a custom Jump List:
1322     *
1323     * @platform win32
1324     */
1325    setJumpList(categories: (JumpListCategory[]) | (null)): void;
1326    /**
1327     * Set the app's login item settings.
1328     *
1329     * To work with Electron's `autoUpdater` on Windows, which uses Squirrel, you'll
1330     * want to set the launch path to Update.exe, and pass arguments that specify your
1331     * application name. For example:
1332     *
1333     * @platform darwin,win32
1334     */
1335    setLoginItemSettings(settings: Settings): void;
1336    /**
1337     * Overrides the current application's name.
1338     *
1339     * **Note:** This function overrides the name used internally by Electron; it does
1340     * not affect the name that the OS uses.
1341
1342**Deprecated**
1343     */
1344    setName(name: string): void;
1345    /**
1346     * Overrides the `path` to a special directory or file associated with `name`. If
1347     * the path specifies a directory that does not exist, an `Error` is thrown. In
1348     * that case, the directory should be created with `fs.mkdirSync` or similar.
1349     *
1350     * You can only override paths of a `name` defined in `app.getPath`.
1351     *
1352     * By default, web pages' cookies and caches will be stored under the `userData`
1353     * directory. If you want to change this location, you have to override the
1354     * `userData` path before the `ready` event of the `app` module is emitted.
1355     */
1356    setPath(name: string, path: string): void;
1357    /**
1358     * Creates an `NSUserActivity` and sets it as the current activity. The activity is
1359     * eligible for Handoff to another device afterward.
1360     *
1361     * @platform darwin
1362     */
1363    setUserActivity(type: string, userInfo: any, webpageURL?: string): void;
1364    /**
1365     * Adds `tasks` to the Tasks category of the Jump List on Windows.
1366     *
1367     * `tasks` is an array of `Task` objects.
1368     *
1369     * Whether the call succeeded.
1370     *
1371     * **Note:** If you'd like to customize the Jump List even more use
1372     * `app.setJumpList(categories)` instead.
1373     *
1374     * @platform win32
1375     */
1376    setUserTasks(tasks: Task[]): boolean;
1377    /**
1378     * Shows application windows after they were hidden. Does not automatically focus
1379     * them.
1380     *
1381     * @platform darwin
1382     */
1383    show(): void;
1384    /**
1385     * Show the app's about panel options. These options can be overridden with
1386     * `app.setAboutPanelOptions(options)`.
1387     */
1388    showAboutPanel(): void;
1389    /**
1390     * Show the platform's native emoji picker.
1391     *
1392     * @platform darwin,win32
1393     */
1394    showEmojiPanel(): void;
1395    /**
1396     * This function **must** be called once you have finished accessing the security
1397     * scoped file. If you do not remember to stop accessing the bookmark, kernel
1398     * resources will be leaked and your app will lose its ability to reach outside the
1399     * sandbox completely, until your app is restarted.
1400     *
1401     * Start accessing a security scoped resource. With this method Electron
1402     * applications that are packaged for the Mac App Store may reach outside their
1403     * sandbox to access files chosen by the user. See Apple's documentation for a
1404     * description of how this system works.
1405     *
1406     * @platform mas
1407     */
1408    startAccessingSecurityScopedResource(bookmarkData: string): Function;
1409    /**
1410     * Updates the current activity if its type matches `type`, merging the entries
1411     * from `userInfo` into its current `userInfo` dictionary.
1412     *
1413     * @platform darwin
1414     */
1415    updateCurrentActivity(type: string, userInfo: any): void;
1416    /**
1417     * fulfilled when Electron is initialized. May be used as a convenient alternative
1418     * to checking `app.isReady()` and subscribing to the `ready` event if the app is
1419     * not ready yet.
1420     */
1421    whenReady(): Promise<void>;
1422    /**
1423     * A `Boolean` property that's `true` if Chrome's accessibility support is enabled,
1424     * `false` otherwise. This property will be `true` if the use of assistive
1425     * technologies, such as screen readers, has been detected. Setting this property
1426     * to `true` manually enables Chrome's accessibility support, allowing developers
1427     * to expose accessibility switch to users in application settings.
1428     *
1429     * See Chromium's accessibility docs for more details. Disabled by default.
1430     *
1431     * This API must be called after the `ready` event is emitted.
1432     *
1433     * **Note:** Rendering accessibility tree can significantly affect the performance
1434     * of your app. It should not be enabled by default.
1435     *
1436     * @platform darwin,win32
1437     */
1438    accessibilitySupportEnabled: boolean;
1439    /**
1440     * A `Boolean` which when `true` disables the overrides that Electron has in place
1441     * to ensure renderer processes are restarted on every navigation.  The current
1442     * default value for this property is `false`.
1443     *
1444     * The intention is for these overrides to become disabled by default and then at
1445     * some point in the future this property will be removed.  This property impacts
1446     * which native modules you can use in the renderer process.  For more information
1447     * on the direction Electron is going with renderer process restarts and usage of
1448     * native modules in the renderer process please check out this Tracking Issue.
1449     */
1450    allowRendererProcessReuse: boolean;
1451    /**
1452     * A `Menu | null` property that returns `Menu` if one has been set and `null`
1453     * otherwise. Users can pass a Menu to set this property.
1454     */
1455    applicationMenu: (Menu) | (null);
1456    /**
1457     * An `Integer` property that returns the badge count for current app. Setting the
1458     * count to `0` will hide the badge.
1459     *
1460     * On macOS, setting this with any nonzero integer shows on the dock icon. On
1461     * Linux, this property only works for Unity launcher.
1462     *
1463     * **Note:** Unity launcher requires the existence of a `.desktop` file to work,
1464     * for more information please read Desktop Environment Integration.
1465     *
1466     * @platform linux,darwin
1467     */
1468    badgeCount: number;
1469    /**
1470     * A `CommandLine` object that allows you to read and manipulate the command line
1471     * arguments that Chromium uses.
1472     *
1473     */
1474    readonly commandLine: CommandLine;
1475    /**
1476     * A `Dock` object that allows you to perform actions on your app icon in the
1477     * user's dock on macOS.
1478     *
1479     * @platform darwin
1480     */
1481    readonly dock: Dock;
1482    /**
1483     * A `Boolean` property that returns  `true` if the app is packaged, `false`
1484     * otherwise. For many apps, this property can be used to distinguish development
1485     * and production environments.
1486     *
1487     */
1488    readonly isPackaged: boolean;
1489    /**
1490     * A `String` property that indicates the current application's name, which is the
1491     * name in the application's `package.json` file.
1492     *
1493     * Usually the `name` field of `package.json` is a short lowercase name, according
1494     * to the npm modules spec. You should usually also specify a `productName` field,
1495     * which is your application's full capitalized name, and which will be preferred
1496     * over `name` by Electron.
1497     */
1498    name: string;
1499    /**
1500     * A `String` which is the user agent string Electron will use as a global
1501     * fallback.
1502     *
1503     * This is the user agent that will be used when no user agent is set at the
1504     * `webContents` or `session` level.  It is useful for ensuring that your entire
1505     * app has the same user agent.  Set to a custom value as early as possible in your
1506     * app's initialization to ensure that your overridden value is used.
1507     */
1508    userAgentFallback: string;
1509  }
1510
1511  interface AutoUpdater extends NodeJS.EventEmitter {
1512
1513    // Docs: http://electronjs.org/docs/api/auto-updater
1514
1515    /**
1516     * This event is emitted after a user calls `quitAndInstall()`.
1517     *
1518     * When this API is called, the `before-quit` event is not emitted before all
1519     * windows are closed. As a result you should listen to this event if you wish to
1520     * perform actions before the windows are closed while a process is quitting, as
1521     * well as listening to `before-quit`.
1522     */
1523    on(event: 'before-quit-for-update', listener: Function): this;
1524    once(event: 'before-quit-for-update', listener: Function): this;
1525    addListener(event: 'before-quit-for-update', listener: Function): this;
1526    removeListener(event: 'before-quit-for-update', listener: Function): this;
1527    /**
1528     * Emitted when checking if an update has started.
1529     */
1530    on(event: 'checking-for-update', listener: Function): this;
1531    once(event: 'checking-for-update', listener: Function): this;
1532    addListener(event: 'checking-for-update', listener: Function): this;
1533    removeListener(event: 'checking-for-update', listener: Function): this;
1534    /**
1535     * Emitted when there is an error while updating.
1536     */
1537    on(event: 'error', listener: (error: Error) => void): this;
1538    once(event: 'error', listener: (error: Error) => void): this;
1539    addListener(event: 'error', listener: (error: Error) => void): this;
1540    removeListener(event: 'error', listener: (error: Error) => void): this;
1541    /**
1542     * Emitted when there is an available update. The update is downloaded
1543     * automatically.
1544     */
1545    on(event: 'update-available', listener: Function): this;
1546    once(event: 'update-available', listener: Function): this;
1547    addListener(event: 'update-available', listener: Function): this;
1548    removeListener(event: 'update-available', listener: Function): this;
1549    /**
1550     * Emitted when an update has been downloaded.
1551     *
1552     * On Windows only `releaseName` is available.
1553     *
1554     * **Note:** It is not strictly necessary to handle this event. A successfully
1555     * downloaded update will still be applied the next time the application starts.
1556     */
1557    on(event: 'update-downloaded', listener: (event: Event,
1558                                              releaseNotes: string,
1559                                              releaseName: string,
1560                                              releaseDate: Date,
1561                                              updateURL: string) => void): this;
1562    once(event: 'update-downloaded', listener: (event: Event,
1563                                              releaseNotes: string,
1564                                              releaseName: string,
1565                                              releaseDate: Date,
1566                                              updateURL: string) => void): this;
1567    addListener(event: 'update-downloaded', listener: (event: Event,
1568                                              releaseNotes: string,
1569                                              releaseName: string,
1570                                              releaseDate: Date,
1571                                              updateURL: string) => void): this;
1572    removeListener(event: 'update-downloaded', listener: (event: Event,
1573                                              releaseNotes: string,
1574                                              releaseName: string,
1575                                              releaseDate: Date,
1576                                              updateURL: string) => void): this;
1577    /**
1578     * Emitted when there is no available update.
1579     */
1580    on(event: 'update-not-available', listener: Function): this;
1581    once(event: 'update-not-available', listener: Function): this;
1582    addListener(event: 'update-not-available', listener: Function): this;
1583    removeListener(event: 'update-not-available', listener: Function): this;
1584    /**
1585     * Asks the server whether there is an update. You must call `setFeedURL` before
1586     * using this API.
1587     */
1588    checkForUpdates(): void;
1589    /**
1590     * The current update feed URL.
1591     */
1592    getFeedURL(): string;
1593    /**
1594     * Restarts the app and installs the update after it has been downloaded. It should
1595     * only be called after `update-downloaded` has been emitted.
1596     *
1597     * Under the hood calling `autoUpdater.quitAndInstall()` will close all application
1598     * windows first, and automatically call `app.quit()` after all windows have been
1599     * closed.
1600     *
1601     * **Note:** It is not strictly necessary to call this function to apply an update,
1602     * as a successfully downloaded update will always be applied the next time the
1603     * application starts.
1604     */
1605    quitAndInstall(): void;
1606    /**
1607     * Sets the `url` and initialize the auto updater.
1608     */
1609    setFeedURL(options: FeedURLOptions): void;
1610  }
1611
1612  interface BluetoothDevice {
1613
1614    // Docs: http://electronjs.org/docs/api/structures/bluetooth-device
1615
1616    deviceId: string;
1617    deviceName: string;
1618  }
1619
1620  class BrowserView {
1621
1622    // Docs: http://electronjs.org/docs/api/browser-view
1623
1624    /**
1625     * BrowserView
1626     */
1627    constructor(options?: BrowserViewConstructorOptions);
1628    /**
1629     * The view with the given `id`.
1630     */
1631    static fromId(id: number): BrowserView;
1632    /**
1633     * The BrowserView that owns the given `webContents` or `null` if the contents are
1634     * not owned by a BrowserView.
1635     */
1636    static fromWebContents(webContents: WebContents): (BrowserView) | (null);
1637    /**
1638     * An array of all opened BrowserViews.
1639     */
1640    static getAllViews(): BrowserView[];
1641    /**
1642     * Force closing the view, the `unload` and `beforeunload` events won't be emitted
1643     * for the web page. After you're done with a view, call this function in order to
1644     * free memory and other resources as soon as possible.
1645     */
1646    destroy(): void;
1647    /**
1648     * The `bounds` of this BrowserView instance as `Object`.
1649     *
1650     * @experimental
1651     */
1652    getBounds(): Rectangle;
1653    /**
1654     * Whether the view is destroyed.
1655     */
1656    isDestroyed(): boolean;
1657    setAutoResize(options: AutoResizeOptions): void;
1658    setBackgroundColor(color: string): void;
1659    /**
1660     * Resizes and moves the view to the supplied bounds relative to the window.
1661     *
1662     * @experimental
1663     */
1664    setBounds(bounds: Rectangle): void;
1665    id: number;
1666    webContents: WebContents;
1667  }
1668
1669  class BrowserWindow extends NodeJS.EventEmitter {
1670
1671    // Docs: http://electronjs.org/docs/api/browser-window
1672
1673    /**
1674     * Emitted when the window is set or unset to show always on top of other windows.
1675     */
1676    on(event: 'always-on-top-changed', listener: (event: Event,
1677                                                  isAlwaysOnTop: boolean) => void): this;
1678    once(event: 'always-on-top-changed', listener: (event: Event,
1679                                                  isAlwaysOnTop: boolean) => void): this;
1680    addListener(event: 'always-on-top-changed', listener: (event: Event,
1681                                                  isAlwaysOnTop: boolean) => void): this;
1682    removeListener(event: 'always-on-top-changed', listener: (event: Event,
1683                                                  isAlwaysOnTop: boolean) => void): this;
1684    /**
1685     * Emitted when an App Command is invoked. These are typically related to keyboard
1686     * media keys or browser commands, as well as the "Back" button built into some
1687     * mice on Windows.
1688     *
1689     * Commands are lowercased, underscores are replaced with hyphens, and the
1690     * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
1691     * emitted as `browser-backward`.
1692     *
1693     * The following app commands are explicitly supported on Linux:
1694     *
1695* `browser-backward`
1696* `browser-forward`
1697     *
1698     * @platform win32,linux
1699     */
1700    on(event: 'app-command', listener: (event: Event,
1701                                        command: string) => void): this;
1702    once(event: 'app-command', listener: (event: Event,
1703                                        command: string) => void): this;
1704    addListener(event: 'app-command', listener: (event: Event,
1705                                        command: string) => void): this;
1706    removeListener(event: 'app-command', listener: (event: Event,
1707                                        command: string) => void): this;
1708    /**
1709     * Emitted when the window loses focus.
1710     */
1711    on(event: 'blur', listener: Function): this;
1712    once(event: 'blur', listener: Function): this;
1713    addListener(event: 'blur', listener: Function): this;
1714    removeListener(event: 'blur', listener: Function): this;
1715    /**
1716     * Emitted when the window is going to be closed. It's emitted before the
1717     * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
1718     * will cancel the close.
1719     *
1720     * Usually you would want to use the `beforeunload` handler to decide whether the
1721     * window should be closed, which will also be called when the window is reloaded.
1722     * In Electron, returning any value other than `undefined` would cancel the close.
1723     * For example:
1724     *
1725     * _**Note**: There is a subtle difference between the behaviors of
1726     * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
1727     * handler)`. It is recommended to always set the `event.returnValue` explicitly,
1728     * instead of only returning a value, as the former works more consistently within
1729     * Electron._
1730     */
1731    on(event: 'close', listener: (event: Event) => void): this;
1732    once(event: 'close', listener: (event: Event) => void): this;
1733    addListener(event: 'close', listener: (event: Event) => void): this;
1734    removeListener(event: 'close', listener: (event: Event) => void): this;
1735    /**
1736     * Emitted when the window is closed. After you have received this event you should
1737     * remove the reference to the window and avoid using it any more.
1738     */
1739    on(event: 'closed', listener: Function): this;
1740    once(event: 'closed', listener: Function): this;
1741    addListener(event: 'closed', listener: Function): this;
1742    removeListener(event: 'closed', listener: Function): this;
1743    /**
1744     * Emitted when the window enters a full-screen state.
1745     */
1746    on(event: 'enter-full-screen', listener: Function): this;
1747    once(event: 'enter-full-screen', listener: Function): this;
1748    addListener(event: 'enter-full-screen', listener: Function): this;
1749    removeListener(event: 'enter-full-screen', listener: Function): this;
1750    /**
1751     * Emitted when the window enters a full-screen state triggered by HTML API.
1752     */
1753    on(event: 'enter-html-full-screen', listener: Function): this;
1754    once(event: 'enter-html-full-screen', listener: Function): this;
1755    addListener(event: 'enter-html-full-screen', listener: Function): this;
1756    removeListener(event: 'enter-html-full-screen', listener: Function): this;
1757    /**
1758     * Emitted when the window gains focus.
1759     */
1760    on(event: 'focus', listener: Function): this;
1761    once(event: 'focus', listener: Function): this;
1762    addListener(event: 'focus', listener: Function): this;
1763    removeListener(event: 'focus', listener: Function): this;
1764    /**
1765     * Emitted when the window is hidden.
1766     */
1767    on(event: 'hide', listener: Function): this;
1768    once(event: 'hide', listener: Function): this;
1769    addListener(event: 'hide', listener: Function): this;
1770    removeListener(event: 'hide', listener: Function): this;
1771    /**
1772     * Emitted when the window leaves a full-screen state.
1773     */
1774    on(event: 'leave-full-screen', listener: Function): this;
1775    once(event: 'leave-full-screen', listener: Function): this;
1776    addListener(event: 'leave-full-screen', listener: Function): this;
1777    removeListener(event: 'leave-full-screen', listener: Function): this;
1778    /**
1779     * Emitted when the window leaves a full-screen state triggered by HTML API.
1780     */
1781    on(event: 'leave-html-full-screen', listener: Function): this;
1782    once(event: 'leave-html-full-screen', listener: Function): this;
1783    addListener(event: 'leave-html-full-screen', listener: Function): this;
1784    removeListener(event: 'leave-html-full-screen', listener: Function): this;
1785    /**
1786     * Emitted when window is maximized.
1787     */
1788    on(event: 'maximize', listener: Function): this;
1789    once(event: 'maximize', listener: Function): this;
1790    addListener(event: 'maximize', listener: Function): this;
1791    removeListener(event: 'maximize', listener: Function): this;
1792    /**
1793     * Emitted when the window is minimized.
1794     */
1795    on(event: 'minimize', listener: Function): this;
1796    once(event: 'minimize', listener: Function): this;
1797    addListener(event: 'minimize', listener: Function): this;
1798    removeListener(event: 'minimize', listener: Function): this;
1799    /**
1800     * Emitted when the window is being moved to a new position.
1801     *
1802__Note__: On macOS this event is an alias of `moved`.
1803     */
1804    on(event: 'move', listener: Function): this;
1805    once(event: 'move', listener: Function): this;
1806    addListener(event: 'move', listener: Function): this;
1807    removeListener(event: 'move', listener: Function): this;
1808    /**
1809     * Emitted once when the window is moved to a new position.
1810     *
1811     * @platform darwin
1812     */
1813    on(event: 'moved', listener: Function): this;
1814    once(event: 'moved', listener: Function): this;
1815    addListener(event: 'moved', listener: Function): this;
1816    removeListener(event: 'moved', listener: Function): this;
1817    /**
1818     * Emitted when the native new tab button is clicked.
1819     *
1820     * @platform darwin
1821     */
1822    on(event: 'new-window-for-tab', listener: Function): this;
1823    once(event: 'new-window-for-tab', listener: Function): this;
1824    addListener(event: 'new-window-for-tab', listener: Function): this;
1825    removeListener(event: 'new-window-for-tab', listener: Function): this;
1826    /**
1827     * Emitted when the document changed its title, calling `event.preventDefault()`
1828     * will prevent the native window's title from changing. `explicitSet` is false
1829     * when title is synthesized from file URL.
1830     */
1831    on(event: 'page-title-updated', listener: (event: Event,
1832                                               title: string,
1833                                               explicitSet: boolean) => void): this;
1834    once(event: 'page-title-updated', listener: (event: Event,
1835                                               title: string,
1836                                               explicitSet: boolean) => void): this;
1837    addListener(event: 'page-title-updated', listener: (event: Event,
1838                                               title: string,
1839                                               explicitSet: boolean) => void): this;
1840    removeListener(event: 'page-title-updated', listener: (event: Event,
1841                                               title: string,
1842                                               explicitSet: boolean) => void): this;
1843    /**
1844     * Emitted when the web page has been rendered (while not being shown) and window
1845     * can be displayed without a visual flash.
1846     *
1847     * Please note that using this event implies that the renderer will be considered
1848     * "visible" and paint even though `show` is false.  This event will never fire if
1849     * you use `paintWhenInitiallyHidden: false`
1850     */
1851    on(event: 'ready-to-show', listener: Function): this;
1852    once(event: 'ready-to-show', listener: Function): this;
1853    addListener(event: 'ready-to-show', listener: Function): this;
1854    removeListener(event: 'ready-to-show', listener: Function): this;
1855    /**
1856     * Emitted after the window has been resized.
1857     */
1858    on(event: 'resize', listener: Function): this;
1859    once(event: 'resize', listener: Function): this;
1860    addListener(event: 'resize', listener: Function): this;
1861    removeListener(event: 'resize', listener: Function): this;
1862    /**
1863     * Emitted when the unresponsive web page becomes responsive again.
1864     */
1865    on(event: 'responsive', listener: Function): this;
1866    once(event: 'responsive', listener: Function): this;
1867    addListener(event: 'responsive', listener: Function): this;
1868    removeListener(event: 'responsive', listener: Function): this;
1869    /**
1870     * Emitted when the window is restored from a minimized state.
1871     */
1872    on(event: 'restore', listener: Function): this;
1873    once(event: 'restore', listener: Function): this;
1874    addListener(event: 'restore', listener: Function): this;
1875    removeListener(event: 'restore', listener: Function): this;
1876    /**
1877     * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
1878     * is ended. The `rotation` value on each emission is the angle in degrees rotated
1879     * since the last emission. The last emitted event upon a rotation gesture will
1880     * always be of value `0`. Counter-clockwise rotation values are positive, while
1881     * clockwise ones are negative.
1882     *
1883     * @platform darwin
1884     */
1885    on(event: 'rotate-gesture', listener: (event: Event,
1886                                           rotation: number) => void): this;
1887    once(event: 'rotate-gesture', listener: (event: Event,
1888                                           rotation: number) => void): this;
1889    addListener(event: 'rotate-gesture', listener: (event: Event,
1890                                           rotation: number) => void): this;
1891    removeListener(event: 'rotate-gesture', listener: (event: Event,
1892                                           rotation: number) => void): this;
1893    /**
1894     * Emitted when scroll wheel event phase has begun.
1895     *
1896     * @platform darwin
1897     */
1898    on(event: 'scroll-touch-begin', listener: Function): this;
1899    once(event: 'scroll-touch-begin', listener: Function): this;
1900    addListener(event: 'scroll-touch-begin', listener: Function): this;
1901    removeListener(event: 'scroll-touch-begin', listener: Function): this;
1902    /**
1903     * Emitted when scroll wheel event phase filed upon reaching the edge of element.
1904     *
1905     * @platform darwin
1906     */
1907    on(event: 'scroll-touch-edge', listener: Function): this;
1908    once(event: 'scroll-touch-edge', listener: Function): this;
1909    addListener(event: 'scroll-touch-edge', listener: Function): this;
1910    removeListener(event: 'scroll-touch-edge', listener: Function): this;
1911    /**
1912     * Emitted when scroll wheel event phase has ended.
1913     *
1914     * @platform darwin
1915     */
1916    on(event: 'scroll-touch-end', listener: Function): this;
1917    once(event: 'scroll-touch-end', listener: Function): this;
1918    addListener(event: 'scroll-touch-end', listener: Function): this;
1919    removeListener(event: 'scroll-touch-end', listener: Function): this;
1920    /**
1921     * Emitted when window session is going to end due to force shutdown or machine
1922     * restart or session log off.
1923     *
1924     * @platform win32
1925     */
1926    on(event: 'session-end', listener: Function): this;
1927    once(event: 'session-end', listener: Function): this;
1928    addListener(event: 'session-end', listener: Function): this;
1929    removeListener(event: 'session-end', listener: Function): this;
1930    /**
1931     * Emitted when the window opens a sheet.
1932     *
1933     * @platform darwin
1934     */
1935    on(event: 'sheet-begin', listener: Function): this;
1936    once(event: 'sheet-begin', listener: Function): this;
1937    addListener(event: 'sheet-begin', listener: Function): this;
1938    removeListener(event: 'sheet-begin', listener: Function): this;
1939    /**
1940     * Emitted when the window has closed a sheet.
1941     *
1942     * @platform darwin
1943     */
1944    on(event: 'sheet-end', listener: Function): this;
1945    once(event: 'sheet-end', listener: Function): this;
1946    addListener(event: 'sheet-end', listener: Function): this;
1947    removeListener(event: 'sheet-end', listener: Function): this;
1948    /**
1949     * Emitted when the window is shown.
1950     */
1951    on(event: 'show', listener: Function): this;
1952    once(event: 'show', listener: Function): this;
1953    addListener(event: 'show', listener: Function): this;
1954    removeListener(event: 'show', listener: Function): this;
1955    /**
1956     * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
1957     * `left`.
1958     *
1959     * The method underlying this event is built to handle older macOS-style trackpad
1960     * swiping, where the content on the screen doesn't move with the swipe. Most macOS
1961     * trackpads are not configured to allow this kind of swiping anymore, so in order
1962     * for it to emit properly the 'Swipe between pages' preference in `System
1963     * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
1964     * fingers'.
1965     *
1966     * @platform darwin
1967     */
1968    on(event: 'swipe', listener: (event: Event,
1969                                  direction: string) => void): this;
1970    once(event: 'swipe', listener: (event: Event,
1971                                  direction: string) => void): this;
1972    addListener(event: 'swipe', listener: (event: Event,
1973                                  direction: string) => void): this;
1974    removeListener(event: 'swipe', listener: (event: Event,
1975                                  direction: string) => void): this;
1976    /**
1977     * Emitted when the window exits from a maximized state.
1978     */
1979    on(event: 'unmaximize', listener: Function): this;
1980    once(event: 'unmaximize', listener: Function): this;
1981    addListener(event: 'unmaximize', listener: Function): this;
1982    removeListener(event: 'unmaximize', listener: Function): this;
1983    /**
1984     * Emitted when the web page becomes unresponsive.
1985     */
1986    on(event: 'unresponsive', listener: Function): this;
1987    once(event: 'unresponsive', listener: Function): this;
1988    addListener(event: 'unresponsive', listener: Function): this;
1989    removeListener(event: 'unresponsive', listener: Function): this;
1990    /**
1991     * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
1992     * will prevent the window from being moved.
1993     *
1994     * Note that this is only emitted when the window is being resized manually.
1995     * Resizing the window with `setBounds`/`setSize` will not emit this event.
1996     *
1997     * @platform darwin,win32
1998     */
1999    on(event: 'will-move', listener: (event: Event,
2000                                      /**
2001                                       * Location the window is being moved to.
2002                                       */
2003                                      newBounds: Rectangle) => void): this;
2004    once(event: 'will-move', listener: (event: Event,
2005                                      /**
2006                                       * Location the window is being moved to.
2007                                       */
2008                                      newBounds: Rectangle) => void): this;
2009    addListener(event: 'will-move', listener: (event: Event,
2010                                      /**
2011                                       * Location the window is being moved to.
2012                                       */
2013                                      newBounds: Rectangle) => void): this;
2014    removeListener(event: 'will-move', listener: (event: Event,
2015                                      /**
2016                                       * Location the window is being moved to.
2017                                       */
2018                                      newBounds: Rectangle) => void): this;
2019    /**
2020     * Emitted before the window is resized. Calling `event.preventDefault()` will
2021     * prevent the window from being resized.
2022     *
2023     * Note that this is only emitted when the window is being resized manually.
2024     * Resizing the window with `setBounds`/`setSize` will not emit this event.
2025     *
2026     * @platform darwin,win32
2027     */
2028    on(event: 'will-resize', listener: (event: Event,
2029                                        /**
2030                                         * Size the window is being resized to.
2031                                         */
2032                                        newBounds: Rectangle) => void): this;
2033    once(event: 'will-resize', listener: (event: Event,
2034                                        /**
2035                                         * Size the window is being resized to.
2036                                         */
2037                                        newBounds: Rectangle) => void): this;
2038    addListener(event: 'will-resize', listener: (event: Event,
2039                                        /**
2040                                         * Size the window is being resized to.
2041                                         */
2042                                        newBounds: Rectangle) => void): this;
2043    removeListener(event: 'will-resize', listener: (event: Event,
2044                                        /**
2045                                         * Size the window is being resized to.
2046                                         */
2047                                        newBounds: Rectangle) => void): this;
2048    /**
2049     * BrowserWindow
2050     */
2051    constructor(options?: BrowserWindowConstructorOptions);
2052    /**
2053     * Adds DevTools extension located at `path`, and returns extension's name.
2054     *
2055     * The extension will be remembered so you only need to call this API once, this
2056     * API is not for programming use. If you try to add an extension that has already
2057     * been loaded, this method will not return and instead log a warning to the
2058     * console.
2059     *
2060     * The method will also not return if the extension's manifest is missing or
2061     * incomplete.
2062     *
2063     * **Note:** This API cannot be called before the `ready` event of the `app` module
2064     * is emitted.
2065     */
2066    static addDevToolsExtension(path: string): void;
2067    /**
2068     * Adds Chrome extension located at `path`, and returns extension's name.
2069     *
2070     * The method will also not return if the extension's manifest is missing or
2071     * incomplete.
2072     *
2073     * **Note:** This API cannot be called before the `ready` event of the `app` module
2074     * is emitted.
2075     */
2076    static addExtension(path: string): void;
2077    /**
2078     * The window that owns the given `browserView`. If the given view is not attached
2079     * to any window, returns `null`.
2080     */
2081    static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
2082    /**
2083     * The window with the given `id`.
2084     */
2085    static fromId(id: number): BrowserWindow;
2086    /**
2087     * The window that owns the given `webContents` or `null` if the contents are not
2088     * owned by a window.
2089     */
2090    static fromWebContents(webContents: WebContents): (BrowserWindow) | (null);
2091    /**
2092     * An array of all opened browser windows.
2093     */
2094    static getAllWindows(): BrowserWindow[];
2095    /**
2096     * The keys are the extension names and each value is an Object containing `name`
2097     * and `version` properties.
2098     *
2099     * To check if a DevTools extension is installed you can run the following:
2100     *
2101     * **Note:** This API cannot be called before the `ready` event of the `app` module
2102     * is emitted.
2103     */
2104    static getDevToolsExtensions(): Record<string, ExtensionInfo>;
2105    /**
2106     * The keys are the extension names and each value is an Object containing `name`
2107     * and `version` properties.
2108     *
2109     * **Note:** This API cannot be called before the `ready` event of the `app` module
2110     * is emitted.
2111     */
2112    static getExtensions(): Record<string, ExtensionInfo>;
2113    /**
2114     * The window that is focused in this application, otherwise returns `null`.
2115     */
2116    static getFocusedWindow(): (BrowserWindow) | (null);
2117    /**
2118     * Remove a DevTools extension by name.
2119     *
2120     * **Note:** This API cannot be called before the `ready` event of the `app` module
2121     * is emitted.
2122     */
2123    static removeDevToolsExtension(name: string): void;
2124    /**
2125     * Remove a Chrome extension by name.
2126     *
2127     * **Note:** This API cannot be called before the `ready` event of the `app` module
2128     * is emitted.
2129     */
2130    static removeExtension(name: string): void;
2131    /**
2132     * Replacement API for setBrowserView supporting work with multi browser views.
2133     *
2134     * @experimental
2135     */
2136    addBrowserView(browserView: BrowserView): void;
2137    /**
2138     * Adds a window as a tab on this window, after the tab for the window instance.
2139     *
2140     * @platform darwin
2141     */
2142    addTabbedWindow(browserWindow: BrowserWindow): void;
2143    /**
2144     * Removes focus from the window.
2145     */
2146    blur(): void;
2147    blurWebView(): void;
2148    /**
2149     * Resolves with a NativeImage
2150     *
2151     * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
2152     * whole visible page.
2153     */
2154    capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
2155    /**
2156     * Moves window to the center of the screen.
2157     */
2158    center(): void;
2159    /**
2160     * Try to close the window. This has the same effect as a user manually clicking
2161     * the close button of the window. The web page may cancel the close though. See
2162     * the close event.
2163     */
2164    close(): void;
2165    /**
2166     * Closes the currently open Quick Look panel.
2167     *
2168     * @platform darwin
2169     */
2170    closeFilePreview(): void;
2171    /**
2172     * Force closing the window, the `unload` and `beforeunload` event won't be emitted
2173     * for the web page, and `close` event will also not be emitted for this window,
2174     * but it guarantees the `closed` event will be emitted.
2175     */
2176    destroy(): void;
2177    /**
2178     * Starts or stops flashing the window to attract user's attention.
2179     */
2180    flashFrame(flag: boolean): void;
2181    /**
2182     * Focuses on the window.
2183     */
2184    focus(): void;
2185    focusOnWebView(): void;
2186    /**
2187     * The `bounds` of the window as `Object`.
2188     */
2189    getBounds(): Rectangle;
2190    /**
2191     * The `BrowserView` attached to `win`. Returns `null` if one is not attached.
2192     * Throws an error if multiple `BrowserView`s are attached.
2193     *
2194     * @experimental
2195     */
2196    getBrowserView(): (BrowserView) | (null);
2197    /**
2198     * an array of all BrowserViews that have been attached with `addBrowserView` or
2199     * `setBrowserView`.
2200     *
2201     * **Note:** The BrowserView API is currently experimental and may change or be
2202     * removed in future Electron releases.
2203     *
2204     * @experimental
2205     */
2206    getBrowserViews(): BrowserView[];
2207    /**
2208     * All child windows.
2209     */
2210    getChildWindows(): BrowserWindow[];
2211    /**
2212     * The `bounds` of the window's client area as `Object`.
2213     */
2214    getContentBounds(): Rectangle;
2215    /**
2216     * Contains the window's client area's width and height.
2217     */
2218    getContentSize(): number[];
2219    /**
2220     * Contains the window's maximum width and height.
2221     */
2222    getMaximumSize(): number[];
2223    /**
2224     * Window id in the format of DesktopCapturerSource's id. For example
2225     * "window:1234:0".
2226     *
2227     * More precisely the format is `window:id:other_id` where `id` is `HWND` on
2228     * Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
2229     * Linux. `other_id` is used to identify web contents (tabs) so within the same top
2230     * level window.
2231     */
2232    getMediaSourceId(): string;
2233    /**
2234     * Contains the window's minimum width and height.
2235     */
2236    getMinimumSize(): number[];
2237    /**
2238     * The platform-specific handle of the window.
2239     *
2240     * The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
2241     * `Window` (`unsigned long`) on Linux.
2242     */
2243    getNativeWindowHandle(): Buffer;
2244    /**
2245     * Contains the window bounds of the normal state
2246     *
2247     * **Note:** whatever the current state of the window : maximized, minimized or in
2248     * fullscreen, this function always returns the position and size of the window in
2249     * normal state. In normal state, getBounds and getNormalBounds returns the same
2250     * `Rectangle`.
2251     */
2252    getNormalBounds(): Rectangle;
2253    /**
2254     * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
2255     * 1.
2256     */
2257    getOpacity(): number;
2258    /**
2259     * The parent window.
2260     */
2261    getParentWindow(): BrowserWindow;
2262    /**
2263     * Contains the window's current position.
2264     */
2265    getPosition(): number[];
2266    /**
2267     * The pathname of the file the window represents.
2268     *
2269     * @platform darwin
2270     */
2271    getRepresentedFilename(): string;
2272    /**
2273     * Contains the window's width and height.
2274     */
2275    getSize(): number[];
2276    /**
2277     * The title of the native window.
2278     *
2279     * **Note:** The title of the web page can be different from the title of the
2280     * native window.
2281     */
2282    getTitle(): string;
2283    /**
2284     * The current position for the traffic light buttons. Can only be used with
2285     * `titleBarStyle` set to `hidden`.
2286     *
2287     * @platform darwin
2288     */
2289    getTrafficLightPosition(): Point;
2290    /**
2291     * Whether the window has a shadow.
2292     */
2293    hasShadow(): boolean;
2294    /**
2295     * Hides the window.
2296     */
2297    hide(): void;
2298    /**
2299     * Hooks a windows message. The `callback` is called when the message is received
2300     * in the WndProc.
2301     *
2302     * @platform win32
2303     */
2304    hookWindowMessage(message: number, callback: () => void): void;
2305    /**
2306     * Whether the window is always on top of other windows.
2307     */
2308    isAlwaysOnTop(): boolean;
2309    /**
2310     * Whether the window can be manually closed by user.
2311     *
2312On Linux always returns `true`.
2313
2314**Deprecated**
2315     *
2316     * @platform darwin,win32
2317     */
2318    isClosable(): boolean;
2319    /**
2320     * Whether the window is destroyed.
2321     */
2322    isDestroyed(): boolean;
2323    /**
2324     * Whether the window's document has been edited.
2325     *
2326     * @platform darwin
2327     */
2328    isDocumentEdited(): boolean;
2329    /**
2330     * Returns Boolean - whether the window is enabled.
2331     */
2332    isEnabled(): void;
2333    /**
2334     * Whether the window is focused.
2335     */
2336    isFocused(): boolean;
2337    /**
2338     * Whether the window is in fullscreen mode.
2339     */
2340    isFullScreen(): boolean;
2341    /**
2342     * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
2343     * window.
2344
2345**Deprecated**
2346     */
2347    isFullScreenable(): boolean;
2348    /**
2349     * Whether the window is in kiosk mode.
2350     */
2351    isKiosk(): boolean;
2352    /**
2353     * Whether the window can be manually maximized by user.
2354     *
2355On Linux always returns `true`.
2356
2357**Deprecated**
2358     *
2359     * @platform darwin,win32
2360     */
2361    isMaximizable(): boolean;
2362    /**
2363     * Whether the window is maximized.
2364     */
2365    isMaximized(): boolean;
2366    /**
2367     * Whether menu bar automatically hides itself.
2368
2369**Deprecated**
2370     */
2371    isMenuBarAutoHide(): boolean;
2372    /**
2373     * Whether the menu bar is visible.
2374     */
2375    isMenuBarVisible(): boolean;
2376    /**
2377     * Whether the window can be manually minimized by user
2378     *
2379On Linux always returns `true`.
2380
2381**Deprecated**
2382     *
2383     * @platform darwin,win32
2384     */
2385    isMinimizable(): boolean;
2386    /**
2387     * Whether the window is minimized.
2388     */
2389    isMinimized(): boolean;
2390    /**
2391     * Whether current window is a modal window.
2392     */
2393    isModal(): boolean;
2394    /**
2395     * Whether the window can be moved by user.
2396     *
2397On Linux always returns `true`.
2398
2399**Deprecated**
2400     *
2401     * @platform darwin,win32
2402     */
2403    isMovable(): boolean;
2404    /**
2405     * Whether the window is in normal state (not maximized, not minimized, not in
2406     * fullscreen mode).
2407     */
2408    isNormal(): boolean;
2409    /**
2410     * Whether the window can be manually resized by user.
2411
2412**Deprecated**
2413     */
2414    isResizable(): boolean;
2415    /**
2416     * Whether the window is in simple (pre-Lion) fullscreen mode.
2417     *
2418     * @platform darwin
2419     */
2420    isSimpleFullScreen(): boolean;
2421    /**
2422     * Whether the window is visible to the user.
2423     */
2424    isVisible(): boolean;
2425    /**
2426     * Whether the window is visible on all workspaces.
2427     *
2428**Note:** This API always returns false on Windows.
2429     */
2430    isVisibleOnAllWorkspaces(): boolean;
2431    /**
2432     * `true` or `false` depending on whether the message is hooked.
2433     *
2434     * @platform win32
2435     */
2436    isWindowMessageHooked(message: number): boolean;
2437    /**
2438     * the promise will resolve when the page has finished loading (see
2439     * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
2440     *
2441     * Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
2442     * relative to the root of your application.  See the `webContents` docs for more
2443     * information.
2444     */
2445    loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
2446    /**
2447     * the promise will resolve when the page has finished loading (see
2448     * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
2449     *
2450     * Same as `webContents.loadURL(url[, options])`.
2451     *
2452     * The `url` can be a remote address (e.g. `http://`) or a path to a local HTML
2453     * file using the `file://` protocol.
2454     *
2455     * To ensure that file URLs are properly formatted, it is recommended to use Node's
2456     * `url.format` method:
2457     *
2458     * You can load a URL using a `POST` request with URL-encoded data by doing the
2459     * following:
2460     */
2461    loadURL(url: string, options?: LoadURLOptions): Promise<void>;
2462    /**
2463     * Maximizes the window. This will also show (but not focus) the window if it isn't
2464     * being displayed already.
2465     */
2466    maximize(): void;
2467    /**
2468     * Merges all windows into one window with multiple tabs when native tabs are
2469     * enabled and there is more than one open window.
2470     *
2471     * @platform darwin
2472     */
2473    mergeAllWindows(): void;
2474    /**
2475     * Minimizes the window. On some platforms the minimized window will be shown in
2476     * the Dock.
2477     */
2478    minimize(): void;
2479    /**
2480     * Moves window above the source window in the sense of z-order. If the
2481     * `mediaSourceId` is not of type window or if the window does not exist then this
2482     * method throws an error.
2483     */
2484    moveAbove(mediaSourceId: string): void;
2485    /**
2486     * Moves the current tab into a new window if native tabs are enabled and there is
2487     * more than one tab in the current window.
2488     *
2489     * @platform darwin
2490     */
2491    moveTabToNewWindow(): void;
2492    /**
2493     * Moves window to top(z-order) regardless of focus
2494     */
2495    moveTop(): void;
2496    /**
2497     * Uses Quick Look to preview a file at a given path.
2498     *
2499     * @platform darwin
2500     */
2501    previewFile(path: string, displayName?: string): void;
2502    /**
2503     * Same as `webContents.reload`.
2504     */
2505    reload(): void;
2506    removeBrowserView(browserView: BrowserView): void;
2507    /**
2508     * Remove the window's menu bar.
2509     *
2510     * @platform linux,win32
2511     */
2512    removeMenu(): void;
2513    /**
2514     * Restores the window from minimized state to its previous state.
2515     */
2516    restore(): void;
2517    /**
2518     * Selects the next tab when native tabs are enabled and there are other tabs in
2519     * the window.
2520     *
2521     * @platform darwin
2522     */
2523    selectNextTab(): void;
2524    /**
2525     * Selects the previous tab when native tabs are enabled and there are other tabs
2526     * in the window.
2527     *
2528     * @platform darwin
2529     */
2530    selectPreviousTab(): void;
2531    /**
2532     * Sets whether the window should show always on top of other windows. After
2533     * setting this, the window is still a normal window, not a toolbox window which
2534     * can not be focused on.
2535     */
2536    setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver', relativeLevel?: number): void;
2537    /**
2538     * Sets the properties for the window's taskbar button.
2539     *
2540     * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
2541     * together. If one of those properties is not set, then neither will be used.
2542     *
2543     * @platform win32
2544     */
2545    setAppDetails(options: AppDetailsOptions): void;
2546    /**
2547     * This will make a window maintain an aspect ratio. The extra size allows a
2548     * developer to have space, specified in pixels, not included within the aspect
2549     * ratio calculations. This API already takes into account the difference between a
2550     * window's size and its content size.
2551     *
2552     * Consider a normal window with an HD video player and associated controls.
2553     * Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
2554     * on the right edge and 50 pixels of controls below the player. In order to
2555     * maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
2556     * the player itself we would call this function with arguments of 16/9 and [ 40,
2557     * 50 ]. The second argument doesn't care where the extra width and height are
2558     * within the content view--only that they exist. Sum any extra width and height
2559     * areas you have within the overall content view.
2560     *
2561     * Calling this function with a value of `0` will remove any previously set aspect
2562     * ratios.
2563     *
2564     * @platform darwin
2565     */
2566    setAspectRatio(aspectRatio: number, extraSize?: Size): void;
2567    /**
2568     * Controls whether to hide cursor when typing.
2569     *
2570     * @platform darwin
2571     */
2572    setAutoHideCursor(autoHide: boolean): void;
2573    /**
2574     * Sets whether the window menu bar should hide itself automatically. Once set the
2575     * menu bar will only show when users press the single `Alt` key.
2576     *
2577     * If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
2578     * hide it immediately.
2579
2580**Deprecated**
2581     */
2582    setAutoHideMenuBar(hide: boolean): void;
2583    /**
2584     * Sets the background color of the window. See Setting `backgroundColor`.
2585     */
2586    setBackgroundColor(backgroundColor: string): void;
2587    /**
2588     * Resizes and moves the window to the supplied bounds. Any properties that are not
2589     * supplied will default to their current values.
2590     */
2591    setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
2592    setBrowserView(browserView: (BrowserView) | (null)): void;
2593    /**
2594     * Sets whether the window can be manually closed by user. On Linux does nothing.
2595     *
2596**Deprecated**
2597     *
2598     * @platform darwin,win32
2599     */
2600    setClosable(closable: boolean): void;
2601    /**
2602     * Resizes and moves the window's client area (e.g. the web page) to the supplied
2603     * bounds.
2604     */
2605    setContentBounds(bounds: Rectangle, animate?: boolean): void;
2606    /**
2607     * Prevents the window contents from being captured by other apps.
2608     *
2609     * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
2610     * it calls SetWindowDisplayAffinity with `WDA_MONITOR`.
2611     *
2612     * @platform darwin,win32
2613     */
2614    setContentProtection(enable: boolean): void;
2615    /**
2616     * Resizes the window's client area (e.g. the web page) to `width` and `height`.
2617     */
2618    setContentSize(width: number, height: number, animate?: boolean): void;
2619    /**
2620     * Specifies whether the window’s document has been edited, and the icon in title
2621     * bar will become gray when set to `true`.
2622     *
2623     * @platform darwin
2624     */
2625    setDocumentEdited(edited: boolean): void;
2626    /**
2627     * Disable or enable the window.
2628     */
2629    setEnabled(enable: boolean): void;
2630    /**
2631     * Changes whether the window can be focused.
2632     *
2633On macOS it does not remove the focus from the window.
2634     *
2635     * @platform darwin,win32
2636     */
2637    setFocusable(focusable: boolean): void;
2638    /**
2639     * Sets whether the window should be in fullscreen mode.
2640     */
2641    setFullScreen(flag: boolean): void;
2642    /**
2643     * Sets whether the maximize/zoom window button toggles fullscreen mode or
2644     * maximizes the window.
2645
2646**Deprecated**
2647     */
2648    setFullScreenable(fullscreenable: boolean): void;
2649    /**
2650     * Sets whether the window should have a shadow.
2651     */
2652    setHasShadow(hasShadow: boolean): void;
2653    /**
2654     * Changes window icon.
2655     *
2656     * @platform win32,linux
2657     */
2658    setIcon(icon: (NativeImage) | (string)): void;
2659    /**
2660     * Makes the window ignore all mouse events.
2661     *
2662     * All mouse events happened in this window will be passed to the window below this
2663     * window, but if this window has focus, it will still receive keyboard events.
2664     */
2665    setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
2666    /**
2667     * Enters or leaves the kiosk mode.
2668     */
2669    setKiosk(flag: boolean): void;
2670    /**
2671     * Sets whether the window can be manually maximized by user. On Linux does
2672     * nothing.
2673
2674**Deprecated**
2675     *
2676     * @platform darwin,win32
2677     */
2678    setMaximizable(maximizable: boolean): void;
2679    /**
2680     * Sets the maximum size of window to `width` and `height`.
2681     */
2682    setMaximumSize(width: number, height: number): void;
2683    /**
2684     * Sets the `menu` as the window's menu bar.
2685     *
2686     * @platform linux,win32
2687     */
2688    setMenu(menu: (Menu) | (null)): void;
2689    /**
2690     * Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
2691     * can still bring up the menu bar by pressing the single `Alt` key.
2692     *
2693     * @platform win32,linux
2694     */
2695    setMenuBarVisibility(visible: boolean): void;
2696    /**
2697     * Sets whether the window can be manually minimized by user. On Linux does
2698     * nothing.
2699
2700**Deprecated**
2701     *
2702     * @platform darwin,win32
2703     */
2704    setMinimizable(minimizable: boolean): void;
2705    /**
2706     * Sets the minimum size of window to `width` and `height`.
2707     */
2708    setMinimumSize(width: number, height: number): void;
2709    /**
2710     * Sets whether the window can be moved by user. On Linux does nothing.
2711     *
2712**Deprecated**
2713     *
2714     * @platform darwin,win32
2715     */
2716    setMovable(movable: boolean): void;
2717    /**
2718     * Sets the opacity of the window. On Linux, does nothing. Out of bound number
2719     * values are clamped to the [0, 1] range.
2720     *
2721     * @platform win32,darwin
2722     */
2723    setOpacity(opacity: number): void;
2724    /**
2725     * Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
2726     * convey some sort of application status or to passively notify the user.
2727     *
2728     * @platform win32
2729     */
2730    setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
2731    /**
2732     * Sets `parent` as current window's parent window, passing `null` will turn
2733     * current window into a top-level window.
2734     */
2735    setParentWindow(parent: (BrowserWindow) | (null)): void;
2736    /**
2737     * Moves window to `x` and `y`.
2738     */
2739    setPosition(x: number, y: number, animate?: boolean): void;
2740    /**
2741     * Sets progress value in progress bar. Valid range is [0, 1.0].
2742     *
2743     * Remove progress bar when progress < 0; Change to indeterminate mode when
2744     * progress > 1.
2745     *
2746     * On Linux platform, only supports Unity desktop environment, you need to specify
2747     * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
2748     * it will assume `{app.name}.desktop`.
2749     *
2750     * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
2751     * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
2752     * mode set (but with a value within the valid range), `normal` will be assumed.
2753     */
2754    setProgressBar(progress: number, options?: ProgressBarOptions): void;
2755    /**
2756     * Sets the pathname of the file the window represents, and the icon of the file
2757     * will show in window's title bar.
2758     *
2759     * @platform darwin
2760     */
2761    setRepresentedFilename(filename: string): void;
2762    /**
2763     * Sets whether the window can be manually resized by user.
2764
2765**Deprecated**
2766     */
2767    setResizable(resizable: boolean): void;
2768    /**
2769     * Setting a window shape determines the area within the window where the system
2770     * permits drawing and user interaction. Outside of the given region, no pixels
2771     * will be drawn and no mouse events will be registered. Mouse events outside of
2772     * the region will not be received by that window, but will fall through to
2773     * whatever is behind the window.
2774     *
2775     * @experimental
2776     * @platform win32,linux
2777     */
2778    setShape(rects: Rectangle[]): void;
2779    /**
2780     * Changes the attachment point for sheets on macOS. By default, sheets are
2781     * attached just below the window frame, but you may want to display them beneath a
2782     * HTML-rendered toolbar. For example:
2783     *
2784     * @platform darwin
2785     */
2786    setSheetOffset(offsetY: number, offsetX?: number): void;
2787    /**
2788     * Enters or leaves simple fullscreen mode.
2789     *
2790     * Simple fullscreen mode emulates the native fullscreen behavior found in versions
2791     * of Mac OS X prior to Lion (10.7).
2792     *
2793     * @platform darwin
2794     */
2795    setSimpleFullScreen(flag: boolean): void;
2796    /**
2797     * Resizes the window to `width` and `height`. If `width` or `height` are below any
2798     * set minimum size constraints the window will snap to its minimum size.
2799     */
2800    setSize(width: number, height: number, animate?: boolean): void;
2801    /**
2802     * Makes the window not show in the taskbar.
2803     */
2804    setSkipTaskbar(skip: boolean): void;
2805    /**
2806     * Whether the buttons were added successfully
2807     *
2808     * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
2809     * of a window in a taskbar button layout. Returns a `Boolean` object indicates
2810     * whether the thumbnail has been added successfully.
2811     *
2812     * The number of buttons in thumbnail toolbar should be no greater than 7 due to
2813     * the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
2814     * removed due to the platform's limitation. But you can call the API with an empty
2815     * array to clean the buttons.
2816     *
2817     * The `buttons` is an array of `Button` objects:
2818     *
2819     * * `Button` Object
2820     *   * `icon` NativeImage - The icon showing in thumbnail toolbar.
2821     *   * `click` Function
2822     *   * `tooltip` String (optional) - The text of the button's tooltip.
2823     *   * `flags` String[] (optional) - Control specific states and behaviors of the
2824     * button. By default, it is `['enabled']`.
2825     *
2826     * The `flags` is an array that can include following `String`s:
2827     *
2828     * * `enabled` - The button is active and available to the user.
2829     * * `disabled` - The button is disabled. It is present, but has a visual state
2830     * indicating it will not respond to user action.
2831     * * `dismissonclick` - When the button is clicked, the thumbnail window closes
2832     * immediately.
2833     * * `nobackground` - Do not draw a button border, use only the image.
2834     * * `hidden` - The button is not shown to the user.
2835     * * `noninteractive` - The button is enabled but not interactive; no pressed
2836     * button state is drawn. This value is intended for instances where the button is
2837     * used in a notification.
2838     *
2839     * @platform win32
2840     */
2841    setThumbarButtons(buttons: ThumbarButton[]): boolean;
2842    /**
2843     * Sets the region of the window to show as the thumbnail image displayed when
2844     * hovering over the window in the taskbar. You can reset the thumbnail to be the
2845     * entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
2846     * }`.
2847     *
2848     * @platform win32
2849     */
2850    setThumbnailClip(region: Rectangle): void;
2851    /**
2852     * Sets the toolTip that is displayed when hovering over the window thumbnail in
2853     * the taskbar.
2854     *
2855     * @platform win32
2856     */
2857    setThumbnailToolTip(toolTip: string): void;
2858    /**
2859     * Changes the title of native window to `title`.
2860     */
2861    setTitle(title: string): void;
2862    /**
2863     * Sets the touchBar layout for the current window. Specifying `null` or
2864     * `undefined` clears the touch bar. This method only has an effect if the machine
2865     * has a touch bar and is running on macOS 10.12.1+.
2866     *
2867     * **Note:** The TouchBar API is currently experimental and may change or be
2868     * removed in future Electron releases.
2869     *
2870     * @experimental
2871     * @platform darwin
2872     */
2873    setTouchBar(touchBar: (TouchBar) | (null)): void;
2874    /**
2875     * Set a custom position for the traffic light buttons. Can only be used with
2876     * `titleBarStyle` set to `hidden`.
2877     *
2878     * @platform darwin
2879     */
2880    setTrafficLightPosition(position: Point): void;
2881    /**
2882     * Adds a vibrancy effect to the browser window. Passing `null` or an empty string
2883     * will remove the vibrancy effect on the window.
2884     *
2885     * Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark`
2886     * have been deprecated and will be removed in an upcoming version of macOS.
2887     *
2888     * @platform darwin
2889     */
2890    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;
2891    /**
2892     * Sets whether the window should be visible on all workspaces.
2893     *
2894**Note:** This API does nothing on Windows.
2895     */
2896    setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
2897    /**
2898     * Sets whether the window traffic light buttons should be visible.
2899     *
2900This cannot be called when `titleBarStyle` is set to `customButtonsOnHover`.
2901     *
2902     * @platform darwin
2903     */
2904    setWindowButtonVisibility(visible: boolean): void;
2905    /**
2906     * Shows and gives focus to the window.
2907     */
2908    show(): void;
2909    /**
2910     * Same as `webContents.showDefinitionForSelection()`.
2911     *
2912     * @platform darwin
2913     */
2914    showDefinitionForSelection(): void;
2915    /**
2916     * Shows the window but doesn't focus on it.
2917     */
2918    showInactive(): void;
2919    /**
2920     * Toggles the visibility of the tab bar if native tabs are enabled and there is
2921     * only one tab in the current window.
2922     *
2923     * @platform darwin
2924     */
2925    toggleTabBar(): void;
2926    /**
2927     * Unhooks all of the window messages.
2928     *
2929     * @platform win32
2930     */
2931    unhookAllWindowMessages(): void;
2932    /**
2933     * Unhook the window message.
2934     *
2935     * @platform win32
2936     */
2937    unhookWindowMessage(message: number): void;
2938    /**
2939     * Unmaximizes the window.
2940     */
2941    unmaximize(): void;
2942    accessibleTitle: string;
2943    autoHideMenuBar: boolean;
2944    closable: boolean;
2945    excludedFromShownWindowsMenu: boolean;
2946    fullScreenable: boolean;
2947    readonly id: number;
2948    maximizable: boolean;
2949    minimizable: boolean;
2950    movable: boolean;
2951    resizable: boolean;
2952    readonly webContents: WebContents;
2953  }
2954
2955  class BrowserWindowProxy {
2956
2957    // Docs: http://electronjs.org/docs/api/browser-window-proxy
2958
2959    /**
2960     * Removes focus from the child window.
2961     */
2962    blur(): void;
2963    /**
2964     * Forcefully closes the child window without calling its unload event.
2965     */
2966    close(): void;
2967    /**
2968     * Evaluates the code in the child window.
2969     */
2970    eval(code: string): void;
2971    /**
2972     * Focuses the child window (brings the window to front).
2973     */
2974    focus(): void;
2975    /**
2976     * Sends a message to the child window with the specified origin or `*` for no
2977     * origin preference.
2978     *
2979     * In addition to these methods, the child window implements `window.opener` object
2980     * with no properties and a single method.
2981     */
2982    postMessage(message: any, targetOrigin: string): void;
2983    /**
2984     * Invokes the print dialog on the child window.
2985     */
2986    print(): void;
2987    closed: boolean;
2988  }
2989
2990  interface Certificate {
2991
2992    // Docs: http://electronjs.org/docs/api/structures/certificate
2993
2994    /**
2995     * PEM encoded data
2996     */
2997    data: string;
2998    /**
2999     * Fingerprint of the certificate
3000     */
3001    fingerprint: string;
3002    /**
3003     * Issuer principal
3004     */
3005    issuer: CertificatePrincipal;
3006    /**
3007     * Issuer certificate (if not self-signed)
3008     */
3009    issuerCert: Certificate;
3010    /**
3011     * Issuer's Common Name
3012     */
3013    issuerName: string;
3014    /**
3015     * Hex value represented string
3016     */
3017    serialNumber: string;
3018    /**
3019     * Subject principal
3020     */
3021    subject: CertificatePrincipal;
3022    /**
3023     * Subject's Common Name
3024     */
3025    subjectName: string;
3026    /**
3027     * End date of the certificate being valid in seconds
3028     */
3029    validExpiry: number;
3030    /**
3031     * Start date of the certificate being valid in seconds
3032     */
3033    validStart: number;
3034  }
3035
3036  interface CertificatePrincipal {
3037
3038    // Docs: http://electronjs.org/docs/api/structures/certificate-principal
3039
3040    /**
3041     * Common Name.
3042     */
3043    commonName: string;
3044    /**
3045     * Country or region.
3046     */
3047    country: string;
3048    /**
3049     * Locality.
3050     */
3051    locality: string;
3052    /**
3053     * Organization names.
3054     */
3055    organizations: string[];
3056    /**
3057     * Organization Unit names.
3058     */
3059    organizationUnits: string[];
3060    /**
3061     * State or province.
3062     */
3063    state: string;
3064  }
3065
3066  class ClientRequest extends NodeJS.EventEmitter {
3067
3068    // Docs: http://electronjs.org/docs/api/client-request
3069
3070    /**
3071     * Emitted when the `request` is aborted. The `abort` event will not be fired if
3072     * the `request` is already closed.
3073     */
3074    on(event: 'abort', listener: Function): this;
3075    once(event: 'abort', listener: Function): this;
3076    addListener(event: 'abort', listener: Function): this;
3077    removeListener(event: 'abort', listener: Function): this;
3078    /**
3079     * Emitted as the last event in the HTTP request-response transaction. The `close`
3080     * event indicates that no more events will be emitted on either the `request` or
3081     * `response` objects.
3082     */
3083    on(event: 'close', listener: Function): this;
3084    once(event: 'close', listener: Function): this;
3085    addListener(event: 'close', listener: Function): this;
3086    removeListener(event: 'close', listener: Function): this;
3087    /**
3088     * Emitted when the `net` module fails to issue a network request. Typically when
3089     * the `request` object emits an `error` event, a `close` event will subsequently
3090     * follow and no response object will be provided.
3091     */
3092    on(event: 'error', listener: (
3093                                  /**
3094                                   * an error object providing some information about the failure.
3095                                   */
3096                                  error: Error) => void): this;
3097    once(event: 'error', listener: (
3098                                  /**
3099                                   * an error object providing some information about the failure.
3100                                   */
3101                                  error: Error) => void): this;
3102    addListener(event: 'error', listener: (
3103                                  /**
3104                                   * an error object providing some information about the failure.
3105                                   */
3106                                  error: Error) => void): this;
3107    removeListener(event: 'error', listener: (
3108                                  /**
3109                                   * an error object providing some information about the failure.
3110                                   */
3111                                  error: Error) => void): this;
3112    /**
3113     * Emitted just after the last chunk of the `request`'s data has been written into
3114     * the `request` object.
3115     */
3116    on(event: 'finish', listener: Function): this;
3117    once(event: 'finish', listener: Function): this;
3118    addListener(event: 'finish', listener: Function): this;
3119    removeListener(event: 'finish', listener: Function): this;
3120    /**
3121     * Emitted when an authenticating proxy is asking for user credentials.
3122     *
3123     * The `callback` function is expected to be called back with user credentials:
3124     *
3125     * * `username` String
3126     * * `password` String
3127     *
3128     * Providing empty credentials will cancel the request and report an authentication
3129     * error on the response object:
3130     */
3131    on(event: 'login', listener: (authInfo: AuthInfo,
3132                                  callback: (username?: string, password?: string) => void) => void): this;
3133    once(event: 'login', listener: (authInfo: AuthInfo,
3134                                  callback: (username?: string, password?: string) => void) => void): this;
3135    addListener(event: 'login', listener: (authInfo: AuthInfo,
3136                                  callback: (username?: string, password?: string) => void) => void): this;
3137    removeListener(event: 'login', listener: (authInfo: AuthInfo,
3138                                  callback: (username?: string, password?: string) => void) => void): this;
3139    /**
3140     * Emitted when the server returns a redirect response (e.g. 301 Moved
3141     * Permanently). Calling `request.followRedirect` will continue with the
3142     * redirection.  If this event is handled, `request.followRedirect` must be called
3143     * **synchronously**, otherwise the request will be cancelled.
3144     */
3145    on(event: 'redirect', listener: (statusCode: number,
3146                                     method: string,
3147                                     redirectUrl: string,
3148                                     responseHeaders: Record<string, string[]>) => void): this;
3149    once(event: 'redirect', listener: (statusCode: number,
3150                                     method: string,
3151                                     redirectUrl: string,
3152                                     responseHeaders: Record<string, string[]>) => void): this;
3153    addListener(event: 'redirect', listener: (statusCode: number,
3154                                     method: string,
3155                                     redirectUrl: string,
3156                                     responseHeaders: Record<string, string[]>) => void): this;
3157    removeListener(event: 'redirect', listener: (statusCode: number,
3158                                     method: string,
3159                                     redirectUrl: string,
3160                                     responseHeaders: Record<string, string[]>) => void): this;
3161    on(event: 'response', listener: (
3162                                     /**
3163                                      * An object representing the HTTP response message.
3164                                      */
3165                                     response: IncomingMessage) => void): this;
3166    once(event: 'response', listener: (
3167                                     /**
3168                                      * An object representing the HTTP response message.
3169                                      */
3170                                     response: IncomingMessage) => void): this;
3171    addListener(event: 'response', listener: (
3172                                     /**
3173                                      * An object representing the HTTP response message.
3174                                      */
3175                                     response: IncomingMessage) => void): this;
3176    removeListener(event: 'response', listener: (
3177                                     /**
3178                                      * An object representing the HTTP response message.
3179                                      */
3180                                     response: IncomingMessage) => void): this;
3181    /**
3182     * ClientRequest
3183     */
3184    constructor(options: (ClientRequestConstructorOptions) | (string));
3185    /**
3186     * Cancels an ongoing HTTP transaction. If the request has already emitted the
3187     * `close` event, the abort operation will have no effect. Otherwise an ongoing
3188     * event will emit `abort` and `close` events. Additionally, if there is an ongoing
3189     * response object,it will emit the `aborted` event.
3190     */
3191    abort(): void;
3192    /**
3193     * Sends the last chunk of the request data. Subsequent write or end operations
3194     * will not be allowed. The `finish` event is emitted just after the end operation.
3195     */
3196    end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): void;
3197    /**
3198     * Continues any pending redirection. Can only be called during a `'redirect'`
3199     * event.
3200     */
3201    followRedirect(): void;
3202    /**
3203     * The value of a previously set extra header name.
3204     */
3205    getHeader(name: string): string;
3206    /**
3207     * * `active` Boolean - Whether the request is currently active. If this is false
3208     * no other properties will be set
3209     * * `started` Boolean - Whether the upload has started. If this is false both
3210     * `current` and `total` will be set to 0.
3211     * * `current` Integer - The number of bytes that have been uploaded so far
3212     * * `total` Integer - The number of bytes that will be uploaded this request
3213     *
3214     * You can use this method in conjunction with `POST` requests to get the progress
3215     * of a file upload or other data transfer.
3216     */
3217    getUploadProgress(): UploadProgress;
3218    /**
3219     * Removes a previously set extra header name. This method can be called only
3220     * before first write. Trying to call it after the first write will throw an error.
3221     */
3222    removeHeader(name: string): void;
3223    /**
3224     * Adds an extra HTTP header. The header name will be issued as-is without
3225     * lowercasing. It can be called only before first write. Calling this method after
3226     * the first write will throw an error. If the passed value is not a `String`, its
3227     * `toString()` method will be called to obtain the final value.
3228     */
3229    setHeader(name: string, value: string): void;
3230    /**
3231     * `callback` is essentially a dummy function introduced in the purpose of keeping
3232     * similarity with the Node.js API. It is called asynchronously in the next tick
3233     * after `chunk` content have been delivered to the Chromium networking layer.
3234     * Contrary to the Node.js implementation, it is not guaranteed that `chunk`
3235     * content have been flushed on the wire before `callback` is called.
3236     *
3237     * Adds a chunk of data to the request body. The first write operation may cause
3238     * the request headers to be issued on the wire. After the first write operation,
3239     * it is not allowed to add or remove a custom header.
3240     */
3241    write(chunk: (string) | (Buffer), encoding?: string, callback?: () => void): void;
3242    chunkedEncoding: boolean;
3243  }
3244
3245  interface Clipboard {
3246
3247    // Docs: http://electronjs.org/docs/api/clipboard
3248
3249    /**
3250     * An array of supported formats for the clipboard `type`.
3251     */
3252    availableFormats(type?: 'selection' | 'clipboard'): string[];
3253    /**
3254     * Clears the clipboard content.
3255     */
3256    clear(type?: 'selection' | 'clipboard'): void;
3257    /**
3258     * Whether the clipboard supports the specified `format`.
3259     *
3260     * @experimental
3261     */
3262    has(format: string, type?: 'selection' | 'clipboard'): boolean;
3263    /**
3264     * Reads `format` type from the clipboard.
3265     *
3266     * @experimental
3267     */
3268    read(format: string): string;
3269    /**
3270     * * `title` String
3271     * * `url` String
3272     *
3273     * Returns an Object containing `title` and `url` keys representing the bookmark in
3274     * the clipboard. The `title` and `url` values will be empty strings when the
3275     * bookmark is unavailable.
3276     *
3277     * @platform darwin,win32
3278     */
3279    readBookmark(): ReadBookmark;
3280    /**
3281     * Reads `format` type from the clipboard.
3282     *
3283     * @experimental
3284     */
3285    readBuffer(format: string): Buffer;
3286    /**
3287     * The text on the find pasteboard, which is the pasteboard that holds information
3288     * about the current state of the active application’s find panel.
3289     *
3290     * This method uses synchronous IPC when called from the renderer process. The
3291     * cached value is reread from the find pasteboard whenever the application is
3292     * activated.
3293     *
3294     * @platform darwin
3295     */
3296    readFindText(): string;
3297    /**
3298     * The content in the clipboard as markup.
3299     */
3300    readHTML(type?: 'selection' | 'clipboard'): string;
3301    /**
3302     * The image content in the clipboard.
3303     */
3304    readImage(type?: 'selection' | 'clipboard'): NativeImage;
3305    /**
3306     * The content in the clipboard as RTF.
3307     */
3308    readRTF(type?: 'selection' | 'clipboard'): string;
3309    /**
3310     * The content in the clipboard as plain text.
3311     */
3312    readText(type?: 'selection' | 'clipboard'): string;
3313    /**
3314     * Writes `data` to the clipboard.
3315     */
3316    write(data: Data, type?: 'selection' | 'clipboard'): void;
3317    /**
3318     * Writes the `title` and `url` into the clipboard as a bookmark.
3319     *
3320     * **Note:** Most apps on Windows don't support pasting bookmarks into them so you
3321     * can use `clipboard.write` to write both a bookmark and fallback text to the
3322     * clipboard.
3323     *
3324     * @platform darwin,win32
3325     */
3326    writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
3327    /**
3328     * Writes the `buffer` into the clipboard as `format`.
3329     *
3330     * @experimental
3331     */
3332    writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
3333    /**
3334     * Writes the `text` into the find pasteboard (the pasteboard that holds
3335     * information about the current state of the active application’s find panel) as
3336     * plain text. This method uses synchronous IPC when called from the renderer
3337     * process.
3338     *
3339     * @platform darwin
3340     */
3341    writeFindText(text: string): void;
3342    /**
3343     * Writes `markup` to the clipboard.
3344     */
3345    writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
3346    /**
3347     * Writes `image` to the clipboard.
3348     */
3349    writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
3350    /**
3351     * Writes the `text` into the clipboard in RTF.
3352     */
3353    writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
3354    /**
3355     * Writes the `text` into the clipboard as plain text.
3356     */
3357    writeText(text: string, type?: 'selection' | 'clipboard'): void;
3358  }
3359
3360  class CommandLine {
3361
3362    // Docs: http://electronjs.org/docs/api/command-line
3363
3364    /**
3365     * Append an argument to Chromium's command line. The argument will be quoted
3366     * correctly. Switches will precede arguments regardless of appending order.
3367     *
3368     * If you're appending an argument like `--switch=value`, consider using
3369     * `appendSwitch('switch', 'value')` instead.
3370     *
3371     * **Note:** This will not affect `process.argv`. The intended usage of this
3372     * function is to control Chromium's behavior.
3373     */
3374    appendArgument(value: string): void;
3375    /**
3376     * Append a switch (with optional `value`) to Chromium's command line.
3377     *
3378     * **Note:** This will not affect `process.argv`. The intended usage of this
3379     * function is to control Chromium's behavior.
3380     */
3381    appendSwitch(the_switch: string, value?: string): void;
3382    /**
3383     * The command-line switch value.
3384     *
3385     * **Note:** When the switch is not present or has no value, it returns empty
3386     * string.
3387     */
3388    getSwitchValue(the_switch: string): string;
3389    /**
3390     * Whether the command-line switch is present.
3391     */
3392    hasSwitch(the_switch: string): boolean;
3393  }
3394
3395  interface ContentTracing {
3396
3397    // Docs: http://electronjs.org/docs/api/content-tracing
3398
3399    /**
3400     * resolves with an array of category groups once all child processes have
3401     * acknowledged the `getCategories` request
3402     *
3403     * Get a set of category groups. The category groups can change as new code paths
3404     * are reached. See also the list of built-in tracing categories.
3405     */
3406    getCategories(): Promise<string[]>;
3407    /**
3408     * Resolves with an object containing the `value` and `percentage` of trace buffer
3409     * maximum usage
3410     *
3411     * * `value` Number
3412     * * `percentage` Number
3413     *
3414     * Get the maximum usage across processes of trace buffer as a percentage of the
3415     * full state.
3416     */
3417    getTraceBufferUsage(): Promise<Electron.TraceBufferUsageReturnValue>;
3418    /**
3419     * resolved once all child processes have acknowledged the `startRecording`
3420     * request.
3421     *
3422     * Start recording on all processes.
3423     *
3424     * Recording begins immediately locally and asynchronously on child processes as
3425     * soon as they receive the EnableRecording request.
3426     *
3427     * If a recording is already running, the promise will be immediately resolved, as
3428     * only one trace operation can be in progress at a time.
3429     */
3430    startRecording(options: (TraceConfig) | (TraceCategoriesAndOptions)): Promise<void>;
3431    /**
3432     * resolves with a path to a file that contains the traced data once all child
3433     * processes have acknowledged the `stopRecording` request
3434     *
3435     * Stop recording on all processes.
3436     *
3437     * Child processes typically cache trace data and only rarely flush and send trace
3438     * data back to the main process. This helps to minimize the runtime overhead of
3439     * tracing since sending trace data over IPC can be an expensive operation. So, to
3440     * end tracing, Chromium asynchronously asks all child processes to flush any
3441     * pending trace data.
3442     *
3443     * Trace data will be written into `resultFilePath`. If `resultFilePath` is empty
3444     * or not provided, trace data will be written to a temporary file, and the path
3445     * will be returned in the promise.
3446     */
3447    stopRecording(resultFilePath?: string): Promise<string>;
3448  }
3449
3450  interface ContextBridge extends NodeJS.EventEmitter {
3451
3452    // Docs: http://electronjs.org/docs/api/context-bridge
3453
3454    exposeInMainWorld(apiKey: string, api: Record<string, any>): void;
3455  }
3456
3457  interface Cookie {
3458
3459    // Docs: http://electronjs.org/docs/api/structures/cookie
3460
3461    /**
3462     * The domain of the cookie; this will be normalized with a preceding dot so that
3463     * it's also valid for subdomains.
3464     */
3465    domain?: string;
3466    /**
3467     * The expiration date of the cookie as the number of seconds since the UNIX epoch.
3468     * Not provided for session cookies.
3469     */
3470    expirationDate?: number;
3471    /**
3472     * Whether the cookie is a host-only cookie; this will only be `true` if no domain
3473     * was passed.
3474     */
3475    hostOnly?: boolean;
3476    /**
3477     * Whether the cookie is marked as HTTP only.
3478     */
3479    httpOnly?: boolean;
3480    /**
3481     * The name of the cookie.
3482     */
3483    name: string;
3484    /**
3485     * The path of the cookie.
3486     */
3487    path?: string;
3488    /**
3489     * Whether the cookie is marked as secure.
3490     */
3491    secure?: boolean;
3492    /**
3493     * Whether the cookie is a session cookie or a persistent cookie with an expiration
3494     * date.
3495     */
3496    session?: boolean;
3497    /**
3498     * The value of the cookie.
3499     */
3500    value: string;
3501  }
3502
3503  class Cookies extends NodeJS.EventEmitter {
3504
3505    // Docs: http://electronjs.org/docs/api/cookies
3506
3507    /**
3508     * Emitted when a cookie is changed because it was added, edited, removed, or
3509     * expired.
3510     */
3511    on(event: 'changed', listener: Function): this;
3512    once(event: 'changed', listener: Function): this;
3513    addListener(event: 'changed', listener: Function): this;
3514    removeListener(event: 'changed', listener: Function): this;
3515    /**
3516     * A promise which resolves when the cookie store has been flushed
3517     *
3518Writes any unwritten cookies data to disk.
3519     */
3520    flushStore(): Promise<void>;
3521    /**
3522     * A promise which resolves an array of cookie objects.
3523     *
3524     * Sends a request to get all cookies matching `filter`, and resolves a promise
3525     * with the response.
3526     */
3527    get(filter: CookiesGetFilter): Promise<Electron.Cookie[]>;
3528    /**
3529     * A promise which resolves when the cookie has been removed
3530     *
3531Removes the cookies matching `url` and `name`
3532     */
3533    remove(url: string, name: string): Promise<void>;
3534    /**
3535     * A promise which resolves when the cookie has been set
3536     *
3537Sets a cookie with `details`.
3538     */
3539    set(details: CookiesSetDetails): Promise<void>;
3540  }
3541
3542  interface CPUUsage {
3543
3544    // Docs: http://electronjs.org/docs/api/structures/cpu-usage
3545
3546    /**
3547     * The number of average idle CPU wakeups per second since the last call to
3548     * getCPUUsage. First call returns 0. Will always return 0 on Windows.
3549     */
3550    idleWakeupsPerSecond: number;
3551    /**
3552     * Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
3553     */
3554    percentCPUUsage: number;
3555  }
3556
3557  interface CrashReport {
3558
3559    // Docs: http://electronjs.org/docs/api/structures/crash-report
3560
3561    date: Date;
3562    id: string;
3563  }
3564
3565  interface CrashReporter {
3566
3567    // Docs: http://electronjs.org/docs/api/crash-reporter
3568
3569    /**
3570     * Set an extra parameter to be sent with the crash report. The values specified
3571     * here will be sent in addition to any values set via the `extra` option when
3572     * `start` was called. This API is only available on macOS and windows, if you need
3573     * to add/update extra parameters on Linux after your first call to `start` you can
3574     * call `start` again with the updated `extra` options.
3575     *
3576     * @platform darwin,win32
3577     */
3578    addExtraParameter(key: string, value: string): void;
3579    /**
3580     * The directory where crashes are temporarily stored before being uploaded.
3581     */
3582    getCrashesDirectory(): string;
3583    /**
3584     * Returns the date and ID of the last crash report. Only crash reports that have
3585     * been uploaded will be returned; even if a crash report is present on disk it
3586     * will not be returned until it is uploaded. In the case that there are no
3587     * uploaded reports, `null` is returned.
3588     */
3589    getLastCrashReport(): CrashReport;
3590    /**
3591     * See all of the current parameters being passed to the crash reporter.
3592     */
3593    getParameters(): void;
3594    /**
3595     * Returns all uploaded crash reports. Each report contains the date and uploaded
3596     * ID.
3597     */
3598    getUploadedReports(): CrashReport[];
3599    /**
3600     * Whether reports should be submitted to the server. Set through the `start`
3601     * method or `setUploadToServer`.
3602     *
3603**Note:** This API can only be called from the main process.
3604     */
3605    getUploadToServer(): boolean;
3606    /**
3607     * Remove a extra parameter from the current set of parameters so that it will not
3608     * be sent with the crash report.
3609     *
3610     * @platform darwin,win32
3611     */
3612    removeExtraParameter(key: string): void;
3613    /**
3614     * This would normally be controlled by user preferences. This has no effect if
3615     * called before `start` is called.
3616     *
3617**Note:** This API can only be called from the main process.
3618     */
3619    setUploadToServer(uploadToServer: boolean): void;
3620    /**
3621     * You are required to call this method before using any other `crashReporter` APIs
3622     * and in each process (main/renderer) from which you want to collect crash
3623     * reports. You can pass different options to `crashReporter.start` when calling
3624     * from different processes.
3625     *
3626     * **Note** Child processes created via the `child_process` module will not have
3627     * access to the Electron modules. Therefore, to collect crash reports from them,
3628     * use `process.crashReporter.start` instead. Pass the same options as above along
3629     * with an additional one called `crashesDirectory` that should point to a
3630     * directory to store the crash reports temporarily. You can test this out by
3631     * calling `process.crash()` to crash the child process.
3632     *
3633     * **Note:** If you need send additional/updated `extra` parameters after your
3634     * first call `start` you can call `addExtraParameter` on macOS or call `start`
3635     * again with the new/updated `extra` parameters on Linux and Windows.
3636     *
3637     * **Note:** On macOS and windows, Electron uses a new `crashpad` client for crash
3638     * collection and reporting. If you want to enable crash reporting, initializing
3639     * `crashpad` from the main process using `crashReporter.start` is required
3640     * regardless of which process you want to collect crashes from. Once initialized
3641     * this way, the crashpad handler collects crashes from all processes. You still
3642     * have to call `crashReporter.start` from the renderer or child process, otherwise
3643     * crashes from them will get reported without `companyName`, `productName` or any
3644     * of the `extra` information.
3645     */
3646    start(options: CrashReporterStartOptions): void;
3647  }
3648
3649  interface CustomScheme {
3650
3651    // Docs: http://electronjs.org/docs/api/structures/custom-scheme
3652
3653    privileges?: Privileges;
3654    /**
3655     * Custom schemes to be registered with options.
3656     */
3657    scheme: string;
3658  }
3659
3660  class Debugger extends NodeJS.EventEmitter {
3661
3662    // Docs: http://electronjs.org/docs/api/debugger
3663
3664    /**
3665     * Emitted when the debugging session is terminated. This happens either when
3666     * `webContents` is closed or devtools is invoked for the attached `webContents`.
3667     */
3668    on(event: 'detach', listener: (event: Event,
3669                                   /**
3670                                    * Reason for detaching debugger.
3671                                    */
3672                                   reason: string) => void): this;
3673    once(event: 'detach', listener: (event: Event,
3674                                   /**
3675                                    * Reason for detaching debugger.
3676                                    */
3677                                   reason: string) => void): this;
3678    addListener(event: 'detach', listener: (event: Event,
3679                                   /**
3680                                    * Reason for detaching debugger.
3681                                    */
3682                                   reason: string) => void): this;
3683    removeListener(event: 'detach', listener: (event: Event,
3684                                   /**
3685                                    * Reason for detaching debugger.
3686                                    */
3687                                   reason: string) => void): this;
3688    /**
3689     * Emitted whenever the debugging target issues an instrumentation event.
3690     */
3691    on(event: 'message', listener: (event: Event,
3692                                    /**
3693                                     * Method name.
3694                                     */
3695                                    method: string,
3696                                    /**
3697                                     * Event parameters defined by the 'parameters' attribute in the remote debugging
3698                                     * protocol.
3699                                     */
3700                                    params: any) => void): this;
3701    once(event: 'message', listener: (event: Event,
3702                                    /**
3703                                     * Method name.
3704                                     */
3705                                    method: string,
3706                                    /**
3707                                     * Event parameters defined by the 'parameters' attribute in the remote debugging
3708                                     * protocol.
3709                                     */
3710                                    params: any) => void): this;
3711    addListener(event: 'message', listener: (event: Event,
3712                                    /**
3713                                     * Method name.
3714                                     */
3715                                    method: string,
3716                                    /**
3717                                     * Event parameters defined by the 'parameters' attribute in the remote debugging
3718                                     * protocol.
3719                                     */
3720                                    params: any) => void): this;
3721    removeListener(event: 'message', listener: (event: Event,
3722                                    /**
3723                                     * Method name.
3724                                     */
3725                                    method: string,
3726                                    /**
3727                                     * Event parameters defined by the 'parameters' attribute in the remote debugging
3728                                     * protocol.
3729                                     */
3730                                    params: any) => void): this;
3731    /**
3732     * Attaches the debugger to the `webContents`.
3733     */
3734    attach(protocolVersion?: string): void;
3735    /**
3736     * Detaches the debugger from the `webContents`.
3737     */
3738    detach(): void;
3739    /**
3740     * Whether a debugger is attached to the `webContents`.
3741     */
3742    isAttached(): boolean;
3743    /**
3744     * A promise that resolves with the response defined by the 'returns' attribute of
3745     * the command description in the remote debugging protocol or is rejected
3746     * indicating the failure of the command.
3747     *
3748Send given command to the debugging target.
3749     */
3750    sendCommand(method: string, commandParams?: any): Promise<any>;
3751  }
3752
3753  interface DesktopCapturer {
3754
3755    // Docs: http://electronjs.org/docs/api/desktop-capturer
3756
3757    /**
3758     * Resolves with an array of `DesktopCapturerSource` objects, each
3759     * `DesktopCapturerSource` represents a screen or an individual window that can be
3760     * captured.
3761     *
3762     * **Note** Capturing the screen contents requires user consent on macOS 10.15
3763     * Catalina or higher, which can detected by
3764     * `systemPreferences.getMediaAccessStatus`.
3765     */
3766    getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
3767  }
3768
3769  interface DesktopCapturerSource {
3770
3771    // Docs: http://electronjs.org/docs/api/structures/desktop-capturer-source
3772
3773    /**
3774     * An icon image of the application that owns the window or null if the source has
3775     * a type screen. The size of the icon is not known in advance and depends on what
3776     * the the application provides.
3777     */
3778    appIcon: NativeImage;
3779    /**
3780     * A unique identifier that will correspond to the `id` of the matching Display
3781     * returned by the Screen API. On some platforms, this is equivalent to the `XX`
3782     * portion of the `id` field above and on others it will differ. It will be an
3783     * empty string if not available.
3784     */
3785    display_id: string;
3786    /**
3787     * The identifier of a window or screen that can be used as a `chromeMediaSourceId`
3788     * constraint when calling [`navigator.webkitGetUserMedia`]. The format of the
3789     * identifier will be `window:XX` or `screen:XX`, where `XX` is a random generated
3790     * number.
3791     */
3792    id: string;
3793    /**
3794     * A screen source will be named either `Entire Screen` or `Screen <index>`, while
3795     * the name of a window source will match the window title.
3796     */
3797    name: string;
3798    /**
3799     * A thumbnail image. **Note:** There is no guarantee that the size of the
3800     * thumbnail is the same as the `thumbnailSize` specified in the `options` passed
3801     * to `desktopCapturer.getSources`. The actual size depends on the scale of the
3802     * screen or window.
3803     */
3804    thumbnail: NativeImage;
3805  }
3806
3807  interface Dialog {
3808
3809    // Docs: http://electronjs.org/docs/api/dialog
3810
3811    /**
3812     * resolves when the certificate trust dialog is shown.
3813     *
3814     * On macOS, this displays a modal dialog that shows a message and certificate
3815     * information, and gives the user the option of trusting/importing the
3816     * certificate. If you provide a `browserWindow` argument the dialog will be
3817     * attached to the parent window, making it modal.
3818     *
3819     * On Windows the options are more limited, due to the Win32 APIs used:
3820     *
3821     * * The `message` argument is not used, as the OS provides its own confirmation
3822     * dialog.
3823     * * The `browserWindow` argument is ignored since it is not possible to make this
3824     * confirmation dialog modal.
3825     *
3826     * @platform darwin,win32
3827     */
3828    showCertificateTrustDialog(browserWindow: BrowserWindow, options: CertificateTrustDialogOptions): Promise<void>;
3829    /**
3830     * resolves when the certificate trust dialog is shown.
3831     *
3832     * On macOS, this displays a modal dialog that shows a message and certificate
3833     * information, and gives the user the option of trusting/importing the
3834     * certificate. If you provide a `browserWindow` argument the dialog will be
3835     * attached to the parent window, making it modal.
3836     *
3837     * On Windows the options are more limited, due to the Win32 APIs used:
3838     *
3839     * * The `message` argument is not used, as the OS provides its own confirmation
3840     * dialog.
3841     * * The `browserWindow` argument is ignored since it is not possible to make this
3842     * confirmation dialog modal.
3843     *
3844     * @platform darwin,win32
3845     */
3846    showCertificateTrustDialog(options: CertificateTrustDialogOptions): Promise<void>;
3847    /**
3848     * Displays a modal dialog that shows an error message.
3849     *
3850     * This API can be called safely before the `ready` event the `app` module emits,
3851     * it is usually used to report errors in early stage of startup. If called before
3852     * the app `ready`event on Linux, the message will be emitted to stderr, and no GUI
3853     * dialog will appear.
3854     */
3855    showErrorBox(title: string, content: string): void;
3856    /**
3857     * resolves with a promise containing the following properties:
3858     *
3859     * * `response` Number - The index of the clicked button.
3860     * * `checkboxChecked` Boolean - The checked state of the checkbox if
3861     * `checkboxLabel` was set. Otherwise `false`.
3862     *
3863     * Shows a message box, it will block the process until the message box is closed.
3864     *
3865     * The `browserWindow` argument allows the dialog to attach itself to a parent
3866     * window, making it modal.
3867     */
3868    showMessageBox(browserWindow: BrowserWindow, options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
3869    /**
3870     * resolves with a promise containing the following properties:
3871     *
3872     * * `response` Number - The index of the clicked button.
3873     * * `checkboxChecked` Boolean - The checked state of the checkbox if
3874     * `checkboxLabel` was set. Otherwise `false`.
3875     *
3876     * Shows a message box, it will block the process until the message box is closed.
3877     *
3878     * The `browserWindow` argument allows the dialog to attach itself to a parent
3879     * window, making it modal.
3880     */
3881    showMessageBox(options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
3882    /**
3883     * the index of the clicked button.
3884     *
3885     * Shows a message box, it will block the process until the message box is closed.
3886     * It returns the index of the clicked button.
3887     *
3888     * The `browserWindow` argument allows the dialog to attach itself to a parent
3889     * window, making it modal. If `browserWindow` is not shown dialog will not be
3890     * attached to it. In such case It will be displayed as independed window.
3891     */
3892    showMessageBoxSync(browserWindow: BrowserWindow, options: MessageBoxSyncOptions): number;
3893    /**
3894     * the index of the clicked button.
3895     *
3896     * Shows a message box, it will block the process until the message box is closed.
3897     * It returns the index of the clicked button.
3898     *
3899     * The `browserWindow` argument allows the dialog to attach itself to a parent
3900     * window, making it modal. If `browserWindow` is not shown dialog will not be
3901     * attached to it. In such case It will be displayed as independed window.
3902     */
3903    showMessageBoxSync(options: MessageBoxSyncOptions): number;
3904    /**
3905     * Resolve with an object containing the following:
3906     *
3907     * * `canceled` Boolean - whether or not the dialog was canceled.
3908     * * `filePaths` String[] - An array of file paths chosen by the user. If the
3909     * dialog is cancelled this will be an empty array.
3910     * * `bookmarks` String[] (optional) _macOS_ _mas_ - An array matching the
3911     * `filePaths` array of base64 encoded strings which contains security scoped
3912     * bookmark data. `securityScopedBookmarks` must be enabled for this to be
3913     * populated. (For return values, see table here.)
3914     *
3915     * The `browserWindow` argument allows the dialog to attach itself to a parent
3916     * window, making it modal.
3917     *
3918     * The `filters` specifies an array of file types that can be displayed or selected
3919     * when you want to limit the user to a specific type. For example:
3920     *
3921     * The `extensions` array should contain extensions without wildcards or dots (e.g.
3922     * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
3923     * `'*'` wildcard (no other wildcard is supported).
3924     *
3925     * **Note:** On Windows and Linux an open dialog can not be both a file selector
3926     * and a directory selector, so if you set `properties` to `['openFile',
3927     * 'openDirectory']` on these platforms, a directory selector will be shown.
3928     */
3929    showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
3930    /**
3931     * Resolve with an object containing the following:
3932     *
3933     * * `canceled` Boolean - whether or not the dialog was canceled.
3934     * * `filePaths` String[] - An array of file paths chosen by the user. If the
3935     * dialog is cancelled this will be an empty array.
3936     * * `bookmarks` String[] (optional) _macOS_ _mas_ - An array matching the
3937     * `filePaths` array of base64 encoded strings which contains security scoped
3938     * bookmark data. `securityScopedBookmarks` must be enabled for this to be
3939     * populated. (For return values, see table here.)
3940     *
3941     * The `browserWindow` argument allows the dialog to attach itself to a parent
3942     * window, making it modal.
3943     *
3944     * The `filters` specifies an array of file types that can be displayed or selected
3945     * when you want to limit the user to a specific type. For example:
3946     *
3947     * The `extensions` array should contain extensions without wildcards or dots (e.g.
3948     * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
3949     * `'*'` wildcard (no other wildcard is supported).
3950     *
3951     * **Note:** On Windows and Linux an open dialog can not be both a file selector
3952     * and a directory selector, so if you set `properties` to `['openFile',
3953     * 'openDirectory']` on these platforms, a directory selector will be shown.
3954     */
3955    showOpenDialog(options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
3956    /**
3957     * the file paths chosen by the user; if the dialog is cancelled it returns
3958     * `undefined`.
3959     *
3960     * The `browserWindow` argument allows the dialog to attach itself to a parent
3961     * window, making it modal.
3962     *
3963     * The `filters` specifies an array of file types that can be displayed or selected
3964     * when you want to limit the user to a specific type. For example:
3965     *
3966     * The `extensions` array should contain extensions without wildcards or dots (e.g.
3967     * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
3968     * `'*'` wildcard (no other wildcard is supported).
3969     *
3970     * **Note:** On Windows and Linux an open dialog can not be both a file selector
3971     * and a directory selector, so if you set `properties` to `['openFile',
3972     * 'openDirectory']` on these platforms, a directory selector will be shown.
3973     */
3974    showOpenDialogSync(browserWindow: BrowserWindow, options: OpenDialogSyncOptions): (string[]) | (undefined);
3975    /**
3976     * the file paths chosen by the user; if the dialog is cancelled it returns
3977     * `undefined`.
3978     *
3979     * The `browserWindow` argument allows the dialog to attach itself to a parent
3980     * window, making it modal.
3981     *
3982     * The `filters` specifies an array of file types that can be displayed or selected
3983     * when you want to limit the user to a specific type. For example:
3984     *
3985     * The `extensions` array should contain extensions without wildcards or dots (e.g.
3986     * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
3987     * `'*'` wildcard (no other wildcard is supported).
3988     *
3989     * **Note:** On Windows and Linux an open dialog can not be both a file selector
3990     * and a directory selector, so if you set `properties` to `['openFile',
3991     * 'openDirectory']` on these platforms, a directory selector will be shown.
3992     */
3993    showOpenDialogSync(options: OpenDialogSyncOptions): (string[]) | (undefined);
3994    /**
3995     * Resolve with an object containing the following:
3996     *
3997     * * `canceled` Boolean - whether or not the dialog was canceled.
3998     * * `filePath` String (optional) - If the dialog is canceled, this will be
3999     * `undefined`.
4000     * * `bookmark` String (optional) _macOS_ _mas_ - Base64 encoded string which
4001     * contains the security scoped bookmark data for the saved file.
4002     * `securityScopedBookmarks` must be enabled for this to be present. (For return
4003     * values, see table here.)
4004     *
4005     * The `browserWindow` argument allows the dialog to attach itself to a parent
4006     * window, making it modal.
4007     *
4008     * The `filters` specifies an array of file types that can be displayed, see
4009     * `dialog.showOpenDialog` for an example.
4010     *
4011     * **Note:** On macOS, using the asynchronous version is recommended to avoid
4012     * issues when expanding and collapsing the dialog.
4013     */
4014    showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
4015    /**
4016     * Resolve with an object containing the following:
4017     *
4018     * * `canceled` Boolean - whether or not the dialog was canceled.
4019     * * `filePath` String (optional) - If the dialog is canceled, this will be
4020     * `undefined`.
4021     * * `bookmark` String (optional) _macOS_ _mas_ - Base64 encoded string which
4022     * contains the security scoped bookmark data for the saved file.
4023     * `securityScopedBookmarks` must be enabled for this to be present. (For return
4024     * values, see table here.)
4025     *
4026     * The `browserWindow` argument allows the dialog to attach itself to a parent
4027     * window, making it modal.
4028     *
4029     * The `filters` specifies an array of file types that can be displayed, see
4030     * `dialog.showOpenDialog` for an example.
4031     *
4032     * **Note:** On macOS, using the asynchronous version is recommended to avoid
4033     * issues when expanding and collapsing the dialog.
4034     */
4035    showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
4036    /**
4037     * the path of the file chosen by the user; if the dialog is cancelled it returns
4038     * `undefined`.
4039     *
4040     * The `browserWindow` argument allows the dialog to attach itself to a parent
4041     * window, making it modal.
4042     *
4043     * The `filters` specifies an array of file types that can be displayed, see
4044     * `dialog.showOpenDialog` for an example.
4045     */
4046    showSaveDialogSync(browserWindow: BrowserWindow, options: SaveDialogSyncOptions): (string) | (undefined);
4047    /**
4048     * the path of the file chosen by the user; if the dialog is cancelled it returns
4049     * `undefined`.
4050     *
4051     * The `browserWindow` argument allows the dialog to attach itself to a parent
4052     * window, making it modal.
4053     *
4054     * The `filters` specifies an array of file types that can be displayed, see
4055     * `dialog.showOpenDialog` for an example.
4056     */
4057    showSaveDialogSync(options: SaveDialogSyncOptions): (string) | (undefined);
4058  }
4059
4060  interface Display {
4061
4062    // Docs: http://electronjs.org/docs/api/structures/display
4063
4064    /**
4065     * Can be `available`, `unavailable`, `unknown`.
4066     */
4067    accelerometerSupport: ('available' | 'unavailable' | 'unknown');
4068    bounds: Rectangle;
4069    /**
4070     * The number of bits per pixel.
4071     */
4072    colorDepth: number;
4073    /**
4074     * represent a color space (three-dimensional object which contains all realizable
4075     * color combinations) for the purpose of color conversions
4076     */
4077    colorSpace: string;
4078    /**
4079     * The number of bits per color component.
4080     */
4081    depthPerComponent: number;
4082    /**
4083     * Unique identifier associated with the display.
4084     */
4085    id: number;
4086    /**
4087     * `true` for an internal display and `false` for an external display
4088     */
4089    internal: boolean;
4090    /**
4091     * Whether or not the display is a monochrome display.
4092     */
4093    monochrome: boolean;
4094    /**
4095     * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees.
4096     */
4097    rotation: number;
4098    /**
4099     * Output device's pixel scale factor.
4100     */
4101    scaleFactor: number;
4102    size: Size;
4103    /**
4104     * Can be `available`, `unavailable`, `unknown`.
4105     */
4106    touchSupport: ('available' | 'unavailable' | 'unknown');
4107    workArea: Rectangle;
4108    workAreaSize: Size;
4109  }
4110
4111  class Dock {
4112
4113    // Docs: http://electronjs.org/docs/api/dock
4114
4115    /**
4116     * an ID representing the request.
4117     *
4118     * When `critical` is passed, the dock icon will bounce until either the
4119     * application becomes active or the request is canceled.
4120     *
4121     * When `informational` is passed, the dock icon will bounce for one second.
4122     * However, the request remains active until either the application becomes active
4123     * or the request is canceled.
4124     *
4125     * **Nota Bene:** This method can only be used while the app is not focused; when
4126     * the app is focused it will return -1.
4127     *
4128     * @platform darwin
4129     */
4130    bounce(type?: 'critical' | 'informational'): number;
4131    /**
4132     * Cancel the bounce of `id`.
4133     *
4134     * @platform darwin
4135     */
4136    cancelBounce(id: number): void;
4137    /**
4138     * Bounces the Downloads stack if the filePath is inside the Downloads folder.
4139     *
4140     * @platform darwin
4141     */
4142    downloadFinished(filePath: string): void;
4143    /**
4144     * The badge string of the dock.
4145     *
4146     * @platform darwin
4147     */
4148    getBadge(): string;
4149    /**
4150     * The application's [dock menu][dock-menu].
4151     *
4152     * @platform darwin
4153     */
4154    getMenu(): (Menu) | (null);
4155    /**
4156     * Hides the dock icon.
4157     *
4158     * @platform darwin
4159     */
4160    hide(): void;
4161    /**
4162     * Whether the dock icon is visible.
4163     *
4164     * @platform darwin
4165     */
4166    isVisible(): boolean;
4167    /**
4168     * Sets the string to be displayed in the dock’s badging area.
4169     *
4170     * @platform darwin
4171     */
4172    setBadge(text: string): void;
4173    /**
4174     * Sets the `image` associated with this dock icon.
4175     *
4176     * @platform darwin
4177     */
4178    setIcon(image: (NativeImage) | (string)): void;
4179    /**
4180     * Sets the application's [dock menu][dock-menu].
4181     *
4182     * @platform darwin
4183     */
4184    setMenu(menu: Menu): void;
4185    /**
4186     * Resolves when the dock icon is shown.
4187     *
4188     * @platform darwin
4189     */
4190    show(): Promise<void>;
4191  }
4192
4193  class DownloadItem extends NodeJS.EventEmitter {
4194
4195    // Docs: http://electronjs.org/docs/api/download-item
4196
4197    /**
4198     * Emitted when the download is in a terminal state. This includes a completed
4199     * download, a cancelled download (via `downloadItem.cancel()`), and interrupted
4200     * download that can't be resumed.
4201     *
4202     * The `state` can be one of following:
4203     *
4204     * * `completed` - The download completed successfully.
4205     * * `cancelled` - The download has been cancelled.
4206     * * `interrupted` - The download has interrupted and can not resume.
4207     */
4208    on(event: 'done', listener: (event: Event,
4209                                 /**
4210                                  * Can be `completed`, `cancelled` or `interrupted`.
4211                                  */
4212                                 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
4213    once(event: 'done', listener: (event: Event,
4214                                 /**
4215                                  * Can be `completed`, `cancelled` or `interrupted`.
4216                                  */
4217                                 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
4218    addListener(event: 'done', listener: (event: Event,
4219                                 /**
4220                                  * Can be `completed`, `cancelled` or `interrupted`.
4221                                  */
4222                                 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
4223    removeListener(event: 'done', listener: (event: Event,
4224                                 /**
4225                                  * Can be `completed`, `cancelled` or `interrupted`.
4226                                  */
4227                                 state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
4228    /**
4229     * Emitted when the download has been updated and is not done.
4230     *
4231     * The `state` can be one of following:
4232     *
4233     * * `progressing` - The download is in-progress.
4234     * * `interrupted` - The download has interrupted and can be resumed.
4235     */
4236    on(event: 'updated', listener: (event: Event,
4237                                    /**
4238                                     * Can be `progressing` or `interrupted`.
4239                                     */
4240                                    state: ('progressing' | 'interrupted')) => void): this;
4241    once(event: 'updated', listener: (event: Event,
4242                                    /**
4243                                     * Can be `progressing` or `interrupted`.
4244                                     */
4245                                    state: ('progressing' | 'interrupted')) => void): this;
4246    addListener(event: 'updated', listener: (event: Event,
4247                                    /**
4248                                     * Can be `progressing` or `interrupted`.
4249                                     */
4250                                    state: ('progressing' | 'interrupted')) => void): this;
4251    removeListener(event: 'updated', listener: (event: Event,
4252                                    /**
4253                                     * Can be `progressing` or `interrupted`.
4254                                     */
4255                                    state: ('progressing' | 'interrupted')) => void): this;
4256    /**
4257     * Cancels the download operation.
4258     */
4259    cancel(): void;
4260    /**
4261     * Whether the download can resume.
4262     */
4263    canResume(): boolean;
4264    /**
4265     * The Content-Disposition field from the response header.
4266     */
4267    getContentDisposition(): string;
4268    /**
4269     * ETag header value.
4270     */
4271    getETag(): string;
4272    /**
4273     * The file name of the download item.
4274     *
4275     * **Note:** The file name is not always the same as the actual one saved in local
4276     * disk. If user changes the file name in a prompted download saving dialog, the
4277     * actual name of saved file will be different.
4278     */
4279    getFilename(): string;
4280    /**
4281     * Last-Modified header value.
4282     */
4283    getLastModifiedTime(): string;
4284    /**
4285     * The files mime type.
4286     */
4287    getMimeType(): string;
4288    /**
4289     * The received bytes of the download item.
4290     */
4291    getReceivedBytes(): number;
4292    /**
4293     * Returns the object previously set by
4294     * `downloadItem.setSaveDialogOptions(options)`.
4295     */
4296    getSaveDialogOptions(): SaveDialogOptions;
4297    /**
4298     * The save path of the download item. This will be either the path set via
4299     * `downloadItem.setSavePath(path)` or the path selected from the shown save
4300     * dialog.
4301
4302**Deprecated: use the `savePath` property instead.**
4303     */
4304    getSavePath(): string;
4305    /**
4306     * Number of seconds since the UNIX epoch when the download was started.
4307     */
4308    getStartTime(): number;
4309    /**
4310     * The current state. Can be `progressing`, `completed`, `cancelled` or
4311     * `interrupted`.
4312     *
4313     * **Note:** The following methods are useful specifically to resume a `cancelled`
4314     * item when session is restarted.
4315     */
4316    getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
4317    /**
4318     * The total size in bytes of the download item.
4319     *
4320If the size is unknown, it returns 0.
4321     */
4322    getTotalBytes(): number;
4323    /**
4324     * The origin URL where the item is downloaded from.
4325     */
4326    getURL(): string;
4327    /**
4328     * The complete URL chain of the item including any redirects.
4329     */
4330    getURLChain(): string[];
4331    /**
4332     * Whether the download has user gesture.
4333     */
4334    hasUserGesture(): boolean;
4335    /**
4336     * Whether the download is paused.
4337     */
4338    isPaused(): boolean;
4339    /**
4340     * Pauses the download.
4341     */
4342    pause(): void;
4343    /**
4344     * Resumes the download that has been paused.
4345     *
4346     * **Note:** To enable resumable downloads the server you are downloading from must
4347     * support range requests and provide both `Last-Modified` and `ETag` header
4348     * values. Otherwise `resume()` will dismiss previously received bytes and restart
4349     * the download from the beginning.
4350     */
4351    resume(): void;
4352    /**
4353     * This API allows the user to set custom options for the save dialog that opens
4354     * for the download item by default. The API is only available in session's
4355     * `will-download` callback function.
4356     */
4357    setSaveDialogOptions(options: SaveDialogOptions): void;
4358    /**
4359     * The API is only available in session's `will-download` callback function. If
4360     * user doesn't set the save path via the API, Electron will use the original
4361     * routine to determine the save path; this usually prompts a save dialog.
4362     *
4363**Deprecated: use the `savePath` property instead.**
4364     */
4365    setSavePath(path: string): void;
4366    savePath: string;
4367  }
4368
4369  interface Event extends GlobalEvent {
4370
4371    // Docs: http://electronjs.org/docs/api/structures/event
4372
4373    preventDefault: (() => void);
4374  }
4375
4376  interface ExtensionInfo {
4377
4378    // Docs: http://electronjs.org/docs/api/structures/extension-info
4379
4380    name: string;
4381    version: string;
4382  }
4383
4384  interface FileFilter {
4385
4386    // Docs: http://electronjs.org/docs/api/structures/file-filter
4387
4388    extensions: string[];
4389    name: string;
4390  }
4391
4392  interface FilePathWithHeaders {
4393
4394    // Docs: http://electronjs.org/docs/api/structures/file-path-with-headers
4395
4396    /**
4397     * Additional headers to be sent.
4398     */
4399    headers?: Record<string, string>;
4400    /**
4401     * The path to the file to send.
4402     */
4403    path: string;
4404  }
4405
4406  interface GlobalShortcut {
4407
4408    // Docs: http://electronjs.org/docs/api/global-shortcut
4409
4410    /**
4411     * Whether this application has registered `accelerator`.
4412     *
4413     * When the accelerator is already taken by other applications, this call will
4414     * still return `false`. This behavior is intended by operating systems, since they
4415     * don't want applications to fight for global shortcuts.
4416     */
4417    isRegistered(accelerator: Accelerator): boolean;
4418    /**
4419     * Whether or not the shortcut was registered successfully.
4420     *
4421     * Registers a global shortcut of `accelerator`. The `callback` is called when the
4422     * registered shortcut is pressed by the user.
4423     *
4424     * When the accelerator is already taken by other applications, this call will
4425     * silently fail. This behavior is intended by operating systems, since they don't
4426     * want applications to fight for global shortcuts.
4427     *
4428     * The following accelerators will not be registered successfully on macOS 10.14
4429     * Mojave unless the app has been authorized as a trusted accessibility client:
4430     *
4431     * * "Media Play/Pause"
4432     * * "Media Next Track"
4433* "Media Previous Track"
4434* "Media Stop"
4435     */
4436    register(accelerator: Accelerator, callback: () => void): boolean;
4437    /**
4438     * Registers a global shortcut of all `accelerator` items in `accelerators`. The
4439     * `callback` is called when any of the registered shortcuts are pressed by the
4440     * user.
4441     *
4442     * When a given accelerator is already taken by other applications, this call will
4443     * silently fail. This behavior is intended by operating systems, since they don't
4444     * want applications to fight for global shortcuts.
4445     *
4446     * The following accelerators will not be registered successfully on macOS 10.14
4447     * Mojave unless the app has been authorized as a trusted accessibility client:
4448     *
4449     * * "Media Play/Pause"
4450     * * "Media Next Track"
4451* "Media Previous Track"
4452* "Media Stop"
4453     */
4454    registerAll(accelerators: string[], callback: () => void): void;
4455    /**
4456     * Unregisters the global shortcut of `accelerator`.
4457     */
4458    unregister(accelerator: Accelerator): void;
4459    /**
4460     * Unregisters all of the global shortcuts.
4461     */
4462    unregisterAll(): void;
4463  }
4464
4465  interface GPUFeatureStatus {
4466
4467    // Docs: http://electronjs.org/docs/api/structures/gpu-feature-status
4468
4469    /**
4470     * Canvas.
4471     */
4472    '2d_canvas': string;
4473    /**
4474     * Flash.
4475     */
4476    flash_3d: string;
4477    /**
4478     * Flash Stage3D.
4479     */
4480    flash_stage3d: string;
4481    /**
4482     * Flash Stage3D Baseline profile.
4483     */
4484    flash_stage3d_baseline: string;
4485    /**
4486     * Compositing.
4487     */
4488    gpu_compositing: string;
4489    /**
4490     * Multiple Raster Threads.
4491     */
4492    multiple_raster_threads: string;
4493    /**
4494     * Native GpuMemoryBuffers.
4495     */
4496    native_gpu_memory_buffers: string;
4497    /**
4498     * Rasterization.
4499     */
4500    rasterization: string;
4501    /**
4502     * Video Decode.
4503     */
4504    video_decode: string;
4505    /**
4506     * Video Encode.
4507     */
4508    video_encode: string;
4509    /**
4510     * VPx Video Decode.
4511     */
4512    vpx_decode: string;
4513    /**
4514     * WebGL.
4515     */
4516    webgl: string;
4517    /**
4518     * WebGL2.
4519     */
4520    webgl2: string;
4521  }
4522
4523  interface InAppPurchase extends NodeJS.EventEmitter {
4524
4525    // Docs: http://electronjs.org/docs/api/in-app-purchase
4526
4527    on(event: 'transactions-updated', listener: Function): this;
4528    once(event: 'transactions-updated', listener: Function): this;
4529    addListener(event: 'transactions-updated', listener: Function): this;
4530    removeListener(event: 'transactions-updated', listener: Function): this;
4531    /**
4532     * whether a user can make a payment.
4533     */
4534    canMakePayments(): boolean;
4535    /**
4536     * Completes all pending transactions.
4537     */
4538    finishAllTransactions(): void;
4539    /**
4540     * Completes the pending transactions corresponding to the date.
4541     */
4542    finishTransactionByDate(date: string): void;
4543    /**
4544     * Resolves with an array of `Product` objects.
4545     *
4546Retrieves the product descriptions.
4547     */
4548    getProducts(productIDs: string[]): Promise<Electron.Product[]>;
4549    /**
4550     * the path to the receipt.
4551     */
4552    getReceiptURL(): string;
4553    /**
4554     * Returns `true` if the product is valid and added to the payment queue.
4555     *
4556     * You should listen for the `transactions-updated` event as soon as possible and
4557     * certainly before you call `purchaseProduct`.
4558     */
4559    purchaseProduct(productID: string, quantity?: number): Promise<boolean>;
4560  }
4561
4562  class IncomingMessage extends NodeJS.EventEmitter {
4563
4564    // Docs: http://electronjs.org/docs/api/incoming-message
4565
4566    /**
4567     * Emitted when a request has been canceled during an ongoing HTTP transaction.
4568     */
4569    on(event: 'aborted', listener: Function): this;
4570    once(event: 'aborted', listener: Function): this;
4571    addListener(event: 'aborted', listener: Function): this;
4572    removeListener(event: 'aborted', listener: Function): this;
4573    /**
4574     * The `data` event is the usual method of transferring response data into
4575     * applicative code.
4576     */
4577    on(event: 'data', listener: (
4578                                 /**
4579                                  * A chunk of response body's data.
4580                                  */
4581                                 chunk: Buffer) => void): this;
4582    once(event: 'data', listener: (
4583                                 /**
4584                                  * A chunk of response body's data.
4585                                  */
4586                                 chunk: Buffer) => void): this;
4587    addListener(event: 'data', listener: (
4588                                 /**
4589                                  * A chunk of response body's data.
4590                                  */
4591                                 chunk: Buffer) => void): this;
4592    removeListener(event: 'data', listener: (
4593                                 /**
4594                                  * A chunk of response body's data.
4595                                  */
4596                                 chunk: Buffer) => void): this;
4597    /**
4598     * Indicates that response body has ended.
4599     */
4600    on(event: 'end', listener: Function): this;
4601    once(event: 'end', listener: Function): this;
4602    addListener(event: 'end', listener: Function): this;
4603    removeListener(event: 'end', listener: Function): this;
4604    /**
4605     * Returns:
4606     *
4607     * `error` Error - Typically holds an error string identifying failure root cause.
4608     *
4609     * Emitted when an error was encountered while streaming response data events. For
4610     * instance, if the server closes the underlying while the response is still
4611     * streaming, an `error` event will be emitted on the response object and a `close`
4612     * event will subsequently follow on the request object.
4613     */
4614    on(event: 'error', listener: Function): this;
4615    once(event: 'error', listener: Function): this;
4616    addListener(event: 'error', listener: Function): this;
4617    removeListener(event: 'error', listener: Function): this;
4618    headers: Record<string, string[]>;
4619    httpVersion: string;
4620    httpVersionMajor: number;
4621    httpVersionMinor: number;
4622    statusCode: number;
4623    statusMessage: string;
4624  }
4625
4626  interface InputEvent {
4627
4628    // Docs: http://electronjs.org/docs/api/structures/input-event
4629
4630    /**
4631     * An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`,
4632     * `meta`, `command`, `cmd`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`,
4633     * `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`.
4634     */
4635    modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>;
4636  }
4637
4638  interface IOCounters {
4639
4640    // Docs: http://electronjs.org/docs/api/structures/io-counters
4641
4642    /**
4643     * Then number of I/O other operations.
4644     */
4645    otherOperationCount: number;
4646    /**
4647     * Then number of I/O other transfers.
4648     */
4649    otherTransferCount: number;
4650    /**
4651     * The number of I/O read operations.
4652     */
4653    readOperationCount: number;
4654    /**
4655     * The number of I/O read transfers.
4656     */
4657    readTransferCount: number;
4658    /**
4659     * The number of I/O write operations.
4660     */
4661    writeOperationCount: number;
4662    /**
4663     * The number of I/O write transfers.
4664     */
4665    writeTransferCount: number;
4666  }
4667
4668  interface IpcMain extends NodeJS.EventEmitter {
4669
4670    // Docs: http://electronjs.org/docs/api/ipc-main
4671
4672    /**
4673     * Adds a handler for an `invoke`able IPC. This handler will be called whenever a
4674     * renderer calls `ipcRenderer.invoke(channel, ...args)`.
4675     *
4676     * If `listener` returns a Promise, the eventual result of the promise will be
4677     * returned as a reply to the remote caller. Otherwise, the return value of the
4678     * listener will be used as the value of the reply.
4679     *
4680     * The `event` that is passed as the first argument to the handler is the same as
4681     * that passed to a regular event listener. It includes information about which
4682     * WebContents is the source of the invoke request.
4683     */
4684    handle(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<void>) | (any)): void;
4685    /**
4686     * Handles a single `invoke`able IPC message, then removes the listener. See
4687     * `ipcMain.handle(channel, listener)`.
4688     */
4689    handleOnce(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<void>) | (any)): void;
4690    /**
4691     * Listens to `channel`, when a new message arrives `listener` would be called with
4692     * `listener(event, args...)`.
4693     */
4694    on(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
4695    /**
4696     * Adds a one time `listener` function for the event. This `listener` is invoked
4697     * only the next time a message is sent to `channel`, after which it is removed.
4698     */
4699    once(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
4700    /**
4701     * Removes listeners of the specified `channel`.
4702     */
4703    removeAllListeners(channel?: string): this;
4704    /**
4705     * Removes any handler for `channel`, if present.
4706     */
4707    removeHandler(channel: string): void;
4708    /**
4709     * Removes the specified `listener` from the listener array for the specified
4710     * `channel`.
4711     */
4712    removeListener(channel: string, listener: (...args: any[]) => void): this;
4713  }
4714
4715  interface IpcMainEvent extends Event {
4716
4717    // Docs: http://electronjs.org/docs/api/structures/ipc-main-event
4718
4719    /**
4720     * The ID of the renderer frame that sent this message
4721     */
4722    frameId: number;
4723    /**
4724     * A function that will send an IPC message to the renderer frame that sent the
4725     * original message that you are currently handling.  You should use this method to
4726     * "reply" to the sent message in order to guarantee the reply will go to the
4727     * correct process and frame.
4728     */
4729    reply: Function;
4730    /**
4731     * Set this to the value to be returned in a synchronous message
4732     */
4733    returnValue: any;
4734    /**
4735     * Returns the `webContents` that sent the message
4736     */
4737    sender: WebContents;
4738  }
4739
4740  interface IpcMainInvokeEvent extends Event {
4741
4742    // Docs: http://electronjs.org/docs/api/structures/ipc-main-invoke-event
4743
4744    /**
4745     * The ID of the renderer frame that sent this message
4746     */
4747    frameId: number;
4748    /**
4749     * Returns the `webContents` that sent the message
4750     */
4751    sender: WebContents;
4752  }
4753
4754  interface IpcRenderer extends NodeJS.EventEmitter {
4755
4756    // Docs: http://electronjs.org/docs/api/ipc-renderer
4757
4758    /**
4759     * Resolves with the response from the main process.
4760     *
4761     * Send a message to the main process via `channel` and expect a result
4762     * asynchronously. Arguments will be serialized with the Structured Clone
4763     * Algorithm, just like `postMessage`, so prototype chains will not be included.
4764     * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
4765     * exception.
4766     *
4767     * > **NOTE**: Sending non-standard JavaScript types such as DOM objects or special
4768     * Electron objects is deprecated, and will begin throwing an exception starting
4769     * with Electron 9.
4770     *
4771     * The main process should listen for `channel` with `ipcMain.handle()`.
4772     *
4773For example:
4774     */
4775    invoke(channel: string, ...args: any[]): Promise<any>;
4776    /**
4777     * Listens to `channel`, when a new message arrives `listener` would be called with
4778     * `listener(event, args...)`.
4779     */
4780    on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
4781    /**
4782     * Adds a one time `listener` function for the event. This `listener` is invoked
4783     * only the next time a message is sent to `channel`, after which it is removed.
4784     */
4785    once(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
4786    /**
4787     * Removes all listeners, or those of the specified `channel`.
4788     */
4789    removeAllListeners(channel: string): this;
4790    /**
4791     * Removes the specified `listener` from the listener array for the specified
4792     * `channel`.
4793     */
4794    removeListener(channel: string, listener: (...args: any[]) => void): this;
4795    /**
4796     * Send an asynchronous message to the main process via `channel`, along with
4797     * arguments. Arguments will be serialized with the Structured Clone Algorithm,
4798     * just like `postMessage`, so prototype chains will not be included. Sending
4799     * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
4800     *
4801     * > **NOTE**: Sending non-standard JavaScript types such as DOM objects or special
4802     * Electron objects is deprecated, and will begin throwing an exception starting
4803     * with Electron 9.
4804     *
4805     * The main process handles it by listening for `channel` with the `ipcMain`
4806     * module.
4807     */
4808    send(channel: string, ...args: any[]): void;
4809    /**
4810     * The value sent back by the `ipcMain` handler.
4811     *
4812     * Send a message to the main process via `channel` and expect a result
4813     * synchronously. Arguments will be serialized with the Structured Clone Algorithm,
4814     * just like `postMessage`, so prototype chains will not be included. Sending
4815     * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
4816     *
4817     * > **NOTE**: Sending non-standard JavaScript types such as DOM objects or special
4818     * Electron objects is deprecated, and will begin throwing an exception starting
4819     * with Electron 9.
4820     *
4821     * The main process handles it by listening for `channel` with `ipcMain` module,
4822     * and replies by setting `event.returnValue`.
4823     *
4824     * > :warning: **WARNING**: Sending a synchronous message will block the whole
4825     * renderer process until the reply is received, so use this method only as a last
4826     * resort. It's much better to use the asynchronous version, `invoke()`.
4827     */
4828    sendSync(channel: string, ...args: any[]): any;
4829    /**
4830     * Sends a message to a window with `webContentsId` via `channel`.
4831     */
4832    sendTo(webContentsId: number, channel: string, ...args: any[]): void;
4833    /**
4834     * Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
4835     * the host page instead of the main process.
4836     */
4837    sendToHost(channel: string, ...args: any[]): void;
4838  }
4839
4840  interface IpcRendererEvent extends Event {
4841
4842    // Docs: http://electronjs.org/docs/api/structures/ipc-renderer-event
4843
4844    /**
4845     * The `IpcRenderer` instance that emitted the event originally
4846     */
4847    sender: IpcRenderer;
4848    /**
4849     * The `webContents.id` that sent the message, you can call
4850     * `event.sender.sendTo(event.senderId, ...)` to reply to the message, see
4851     * ipcRenderer.sendTo for more information. This only applies to messages sent from
4852     * a different renderer. Messages sent directly from the main process set
4853     * `event.senderId` to `0`.
4854     */
4855    senderId: number;
4856  }
4857
4858  interface JumpListCategory {
4859
4860    // Docs: http://electronjs.org/docs/api/structures/jump-list-category
4861
4862    /**
4863     * Array of `JumpListItem` objects if `type` is `tasks` or `custom`, otherwise it
4864     * should be omitted.
4865     */
4866    items?: JumpListItem[];
4867    /**
4868     * Must be set if `type` is `custom`, otherwise it should be omitted.
4869     */
4870    name?: string;
4871    /**
4872     * One of the following:
4873     */
4874    type?: ('tasks' | 'frequent' | 'recent' | 'custom');
4875  }
4876
4877  interface JumpListItem {
4878
4879    // Docs: http://electronjs.org/docs/api/structures/jump-list-item
4880
4881    /**
4882     * The command line arguments when `program` is executed. Should only be set if
4883     * `type` is `task`.
4884     */
4885    args?: string;
4886    /**
4887     * Description of the task (displayed in a tooltip). Should only be set if `type`
4888     * is `task`.
4889     */
4890    description?: string;
4891    /**
4892     * The index of the icon in the resource file. If a resource file contains multiple
4893     * icons this value can be used to specify the zero-based index of the icon that
4894     * should be displayed for this task. If a resource file contains only one icon,
4895     * this property should be set to zero.
4896     */
4897    iconIndex?: number;
4898    /**
4899     * The absolute path to an icon to be displayed in a Jump List, which can be an
4900     * arbitrary resource file that contains an icon (e.g. `.ico`, `.exe`, `.dll`). You
4901     * can usually specify `process.execPath` to show the program icon.
4902     */
4903    iconPath?: string;
4904    /**
4905     * Path of the file to open, should only be set if `type` is `file`.
4906     */
4907    path?: string;
4908    /**
4909     * Path of the program to execute, usually you should specify `process.execPath`
4910     * which opens the current program. Should only be set if `type` is `task`.
4911     */
4912    program?: string;
4913    /**
4914     * The text to be displayed for the item in the Jump List. Should only be set if
4915     * `type` is `task`.
4916     */
4917    title?: string;
4918    /**
4919     * One of the following:
4920     */
4921    type?: ('task' | 'separator' | 'file');
4922    /**
4923     * The working directory. Default is empty.
4924     */
4925    workingDirectory?: string;
4926  }
4927
4928  interface KeyboardEvent extends Event {
4929
4930    // Docs: http://electronjs.org/docs/api/structures/keyboard-event
4931
4932    /**
4933     * whether an Alt key was used in an accelerator to trigger the Event
4934     */
4935    altKey?: boolean;
4936    /**
4937     * whether the Control key was used in an accelerator to trigger the Event
4938     */
4939    ctrlKey?: boolean;
4940    /**
4941     * whether a meta key was used in an accelerator to trigger the Event
4942     */
4943    metaKey?: boolean;
4944    /**
4945     * whether a Shift key was used in an accelerator to trigger the Event
4946     */
4947    shiftKey?: boolean;
4948    /**
4949     * whether an accelerator was used to trigger the event as opposed to another user
4950     * gesture like mouse click
4951     */
4952    triggeredByAccelerator?: boolean;
4953  }
4954
4955  interface KeyboardInputEvent extends InputEvent {
4956
4957    // Docs: http://electronjs.org/docs/api/structures/keyboard-input-event
4958
4959    /**
4960     * The character that will be sent as the keyboard event. Should only use the valid
4961     * key codes in Accelerator.
4962     */
4963    keyCode: string;
4964    /**
4965     * The type of the event, can be `keyDown`, `keyUp` or `char`.
4966     */
4967    type: ('keyDown' | 'keyUp' | 'char');
4968  }
4969
4970  interface MemoryInfo {
4971
4972    // Docs: http://electronjs.org/docs/api/structures/memory-info
4973
4974    /**
4975     * The maximum amount of memory that has ever been pinned to actual physical RAM.
4976     */
4977    peakWorkingSetSize: number;
4978    /**
4979     * The amount of memory not shared by other processes, such as JS heap or HTML
4980     * content.
4981     *
4982     * @platform win32
4983     */
4984    privateBytes?: number;
4985    /**
4986     * The amount of memory currently pinned to actual physical RAM.
4987     */
4988    workingSetSize: number;
4989  }
4990
4991  interface MemoryUsageDetails {
4992
4993    // Docs: http://electronjs.org/docs/api/structures/memory-usage-details
4994
4995    count: number;
4996    liveSize: number;
4997    size: number;
4998  }
4999
5000  class Menu {
5001
5002    // Docs: http://electronjs.org/docs/api/menu
5003
5004    /**
5005     * Emitted when a popup is closed either manually or with `menu.closePopup()`.
5006     */
5007    on(event: 'menu-will-close', listener: (event: Event) => void): this;
5008    once(event: 'menu-will-close', listener: (event: Event) => void): this;
5009    addListener(event: 'menu-will-close', listener: (event: Event) => void): this;
5010    removeListener(event: 'menu-will-close', listener: (event: Event) => void): this;
5011    /**
5012     * Emitted when `menu.popup()` is called.
5013     */
5014    on(event: 'menu-will-show', listener: (event: Event) => void): this;
5015    once(event: 'menu-will-show', listener: (event: Event) => void): this;
5016    addListener(event: 'menu-will-show', listener: (event: Event) => void): this;
5017    removeListener(event: 'menu-will-show', listener: (event: Event) => void): this;
5018    /**
5019     * Menu
5020     */
5021    constructor();
5022    /**
5023     * Generally, the `template` is an array of `options` for constructing a MenuItem.
5024     * The usage can be referenced above.
5025     *
5026     * You can also attach other fields to the element of the `template` and they will
5027     * become properties of the constructed menu items.
5028     */
5029    static buildFromTemplate(template: Array<(MenuItemConstructorOptions) | (MenuItem)>): Menu;
5030    /**
5031     * The application menu, if set, or `null`, if not set.
5032     *
5033     * **Note:** The returned `Menu` instance doesn't support dynamic addition or
5034     * removal of menu items. Instance properties can still be dynamically modified.
5035     */
5036    static getApplicationMenu(): (Menu) | (null);
5037    /**
5038     * Sends the `action` to the first responder of application. This is used for
5039     * emulating default macOS menu behaviors. Usually you would use the `role`
5040     * property of a `MenuItem`.
5041     *
5042     * See the macOS Cocoa Event Handling Guide for more information on macOS' native
5043     * actions.
5044     *
5045     * @platform darwin
5046     */
5047    static sendActionToFirstResponder(action: string): void;
5048    /**
5049     * Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
5050     * will be set as each window's top menu.
5051     *
5052     * Also on Windows and Linux, you can use a `&` in the top-level item name to
5053     * indicate which letter should get a generated accelerator. For example, using
5054     * `&File` for the file menu would result in a generated `Alt-F` accelerator that
5055     * opens the associated menu. The indicated character in the button label gets an
5056     * underline. The `&` character is not displayed on the button label.
5057     *
5058     * Passing `null` will suppress the default menu. On Windows and Linux, this has
5059     * the additional effect of removing the menu bar from the window.
5060     *
5061     * **Note:** The default menu will be created automatically if the app does not set
5062     * one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
5063     * `Help`.
5064     */
5065    static setApplicationMenu(menu: (Menu) | (null)): void;
5066    /**
5067     * Appends the `menuItem` to the menu.
5068     */
5069    append(menuItem: MenuItem): void;
5070    /**
5071     * Closes the context menu in the `browserWindow`.
5072     */
5073    closePopup(browserWindow?: BrowserWindow): void;
5074    /**
5075     * the item with the specified `id`
5076     */
5077    getMenuItemById(id: string): MenuItem;
5078    /**
5079     * Inserts the `menuItem` to the `pos` position of the menu.
5080     */
5081    insert(pos: number, menuItem: MenuItem): void;
5082    /**
5083     * Pops up this menu as a context menu in the `BrowserWindow`.
5084     */
5085    popup(options?: PopupOptions): void;
5086    items: MenuItem[];
5087  }
5088
5089  class MenuItem {
5090
5091    // Docs: http://electronjs.org/docs/api/menu-item
5092
5093    /**
5094     * MenuItem
5095     */
5096    constructor(options: MenuItemConstructorOptions);
5097    accelerator?: Accelerator;
5098    checked: boolean;
5099    click: Function;
5100    commandId: number;
5101    enabled: boolean;
5102    icon?: (NativeImage) | (string);
5103    id: string;
5104    label: string;
5105    menu: Menu;
5106    registerAccelerator: boolean;
5107    role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'startSpeaking' | 'stopSpeaking' | 'close' | 'minimize' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
5108    sublabel: string;
5109    submenu?: Menu;
5110    toolTip: string;
5111    type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
5112    visible: boolean;
5113  }
5114
5115  interface MimeTypedBuffer {
5116
5117    // Docs: http://electronjs.org/docs/api/structures/mime-typed-buffer
5118
5119    /**
5120     * The actual Buffer content.
5121     */
5122    data: Buffer;
5123    /**
5124     * The mimeType of the Buffer that you are sending.
5125     */
5126    mimeType: string;
5127  }
5128
5129  interface MouseInputEvent extends InputEvent {
5130
5131    // Docs: http://electronjs.org/docs/api/structures/mouse-input-event
5132
5133    /**
5134     * The button pressed, can be `left`, `middle`, `right`.
5135     */
5136    button?: ('left' | 'middle' | 'right');
5137    clickCount?: number;
5138    globalX?: number;
5139    globalY?: number;
5140    movementX?: number;
5141    movementY?: number;
5142    /**
5143     * The type of the event, can be `mouseDown`, `mouseUp`, `mouseEnter`,
5144     * `mouseLeave`, `contextMenu`, `mouseWheel` or `mouseMove`.
5145     */
5146    type: ('mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove');
5147    x: number;
5148    y: number;
5149  }
5150
5151  interface MouseWheelInputEvent extends MouseInputEvent {
5152
5153    // Docs: http://electronjs.org/docs/api/structures/mouse-wheel-input-event
5154
5155    accelerationRatioX?: number;
5156    accelerationRatioY?: number;
5157    canScroll?: boolean;
5158    deltaX?: number;
5159    deltaY?: number;
5160    hasPreciseScrollingDeltas?: boolean;
5161    /**
5162     * The type of the event, can be `mouseWheel`.
5163     */
5164    type: ('mouseWheel');
5165    wheelTicksX?: number;
5166    wheelTicksY?: number;
5167  }
5168
5169  class NativeImage {
5170
5171    // Docs: http://electronjs.org/docs/api/native-image
5172
5173    /**
5174     * Creates an empty `NativeImage` instance.
5175     */
5176    static createEmpty(): NativeImage;
5177    /**
5178     * Creates a new `NativeImage` instance from `buffer` that contains the raw bitmap
5179     * pixel data returned by `toBitmap()`. The specific format is platform-dependent.
5180     */
5181    static createFromBitmap(buffer: Buffer, options: CreateFromBitmapOptions): NativeImage;
5182    /**
5183     * Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or
5184     * JPEG first.
5185     */
5186    static createFromBuffer(buffer: Buffer, options?: CreateFromBufferOptions): NativeImage;
5187    /**
5188     * Creates a new `NativeImage` instance from `dataURL`.
5189     */
5190    static createFromDataURL(dataURL: string): NativeImage;
5191    /**
5192     * Creates a new `NativeImage` instance from the NSImage that maps to the given
5193     * image name. See `System Icons` for a list of possible values.
5194     *
5195     * The `hslShift` is applied to the image with the following rules:
5196     *
5197     * * `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0
5198     * and 360 on the hue color wheel (red).
5199     * * `hsl_shift[1]` (saturation): A saturation shift for the image, with the
5200     * following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully
5201     * saturate the image.
5202     * * `hsl_shift[2]` (lightness): A lightness shift for the image, with the
5203     * following key values: 0 = remove all lightness (make all pixels black). 0.5 =
5204     * leave unchanged. 1 = full lightness (make all pixels white).
5205     *
5206     * This means that `[-1, 0, 1]` will make the image completely white and `[-1, 1,
5207     * 0]` will make the image completely black.
5208     *
5209     * In some cases, the `NSImageName` doesn't match its string representation; one
5210     * example of this is `NSFolderImageName`, whose string representation would
5211     * actually be `NSFolder`. Therefore, you'll need to determine the correct string
5212     * representation for your image before passing it in. This can be done with the
5213     * following:
5214     *
5215     * `echo -e '#import <Cocoa/Cocoa.h>\nint main() { NSLog(@"%@", SYSTEM_IMAGE_NAME);
5216     * }' | clang -otest -x objective-c -framework Cocoa - && ./test`
5217     *
5218where `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.
5219     *
5220     * @platform darwin
5221     */
5222    static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
5223    /**
5224     * Creates a new `NativeImage` instance from a file located at `path`. This method
5225     * returns an empty image if the `path` does not exist, cannot be read, or is not a
5226     * valid image.
5227     */
5228    static createFromPath(path: string): NativeImage;
5229    /**
5230     * Add an image representation for a specific scale factor. This can be used to
5231     * explicitly add different scale factor representations to an image. This can be
5232     * called on empty images.
5233     */
5234    addRepresentation(options: AddRepresentationOptions): void;
5235    /**
5236     * The cropped image.
5237     */
5238    crop(rect: Rectangle): NativeImage;
5239    /**
5240     * The image's aspect ratio.
5241     */
5242    getAspectRatio(): number;
5243    /**
5244     * A Buffer that contains the image's raw bitmap pixel data.
5245     *
5246     * The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does
5247     * not copy the bitmap data, so you have to use the returned Buffer immediately in
5248     * current event loop tick; otherwise the data might be changed or destroyed.
5249     */
5250    getBitmap(options?: BitmapOptions): Buffer;
5251    /**
5252     * A Buffer that stores C pointer to underlying native handle of the image. On
5253     * macOS, a pointer to `NSImage` instance would be returned.
5254     *
5255     * Notice that the returned pointer is a weak pointer to the underlying native
5256     * image instead of a copy, so you _must_ ensure that the associated `nativeImage`
5257     * instance is kept around.
5258     *
5259     * @platform darwin
5260     */
5261    getNativeHandle(): Buffer;
5262    getSize(): Size;
5263    /**
5264     * Whether the image is empty.
5265     */
5266    isEmpty(): boolean;
5267    /**
5268     * Whether the image is a template image.
5269
5270**Deprecated**
5271     */
5272    isTemplateImage(): boolean;
5273    /**
5274     * The resized image.
5275     *
5276     * If only the `height` or the `width` are specified then the current aspect ratio
5277     * will be preserved in the resized image.
5278     */
5279    resize(options: ResizeOptions): NativeImage;
5280    /**
5281     * Marks the image as a template image.
5282
5283**Deprecated**
5284     */
5285    setTemplateImage(option: boolean): void;
5286    /**
5287     * A Buffer that contains a copy of the image's raw bitmap pixel data.
5288     */
5289    toBitmap(options?: ToBitmapOptions): Buffer;
5290    /**
5291     * The data URL of the image.
5292     */
5293    toDataURL(options?: ToDataURLOptions): string;
5294    /**
5295     * A Buffer that contains the image's `JPEG` encoded data.
5296     */
5297    toJPEG(quality: number): Buffer;
5298    /**
5299     * A Buffer that contains the image's `PNG` encoded data.
5300     */
5301    toPNG(options?: ToPNGOptions): Buffer;
5302    isMacTemplateImage: boolean;
5303  }
5304
5305  interface NativeTheme extends NodeJS.EventEmitter {
5306
5307    // Docs: http://electronjs.org/docs/api/native-theme
5308
5309    /**
5310     * Emitted when something in the underlying NativeTheme has changed. This normally
5311     * means that either the value of `shouldUseDarkColors`,
5312     * `shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed. You
5313     * will have to check them to determine which one has changed.
5314     */
5315    on(event: 'updated', listener: Function): this;
5316    once(event: 'updated', listener: Function): this;
5317    addListener(event: 'updated', listener: Function): this;
5318    removeListener(event: 'updated', listener: Function): this;
5319    /**
5320     * A `Boolean` for if the OS / Chromium currently has a dark mode enabled or is
5321     * being instructed to show a dark-style UI.  If you want to modify this value you
5322     * should use `themeSource` below.
5323     *
5324     */
5325    readonly shouldUseDarkColors: boolean;
5326    /**
5327     * A `Boolean` for if the OS / Chromium currently has high-contrast mode enabled or
5328     * is being instructed to show a high-constrast UI.
5329     *
5330     * @platform darwin,win32
5331     */
5332    readonly shouldUseHighContrastColors: boolean;
5333    /**
5334     * A `Boolean` for if the OS / Chromium currently has an inverted color scheme or
5335     * is being instructed to use an inverted color scheme.
5336     *
5337     * @platform darwin,win32
5338     */
5339    readonly shouldUseInvertedColorScheme: boolean;
5340    /**
5341     * A `String` property that can be `system`, `light` or `dark`.  It is used to
5342     * override and supercede the value that Chromium has chosen to use internally.
5343     *
5344     * Setting this property to `system` will remove the override and everything will
5345     * be reset to the OS default.  By default `themeSource` is `system`.
5346     *
5347     * Settings this property to `dark` will have the following effects:
5348     *
5349     * * `nativeTheme.shouldUseDarkColors` will be `true` when accessed
5350     * * Any UI Electron renders on Linux and Windows including context menus,
5351     * devtools, etc. will use the dark UI.
5352     * * Any UI the OS renders on macOS including menus, window frames, etc. will use
5353     * the dark UI.
5354     * * The `prefers-color-scheme` CSS query will match `dark` mode.
5355     * * The `updated` event will be emitted
5356     *
5357     * Settings this property to `light` will have the following effects:
5358     *
5359     * * `nativeTheme.shouldUseDarkColors` will be `false` when accessed
5360     * * Any UI Electron renders on Linux and Windows including context menus,
5361     * devtools, etc. will use the light UI.
5362     * * Any UI the OS renders on macOS including menus, window frames, etc. will use
5363     * the light UI.
5364     * * The `prefers-color-scheme` CSS query will match `light` mode.
5365     * * The `updated` event will be emitted
5366     *
5367     * The usage of this property should align with a classic "dark mode" state machine
5368     * in your application where the user has three options.
5369     *
5370     * * `Follow OS` --> `themeSource = 'system'`
5371     * * `Dark Mode` --> `themeSource = 'dark'`
5372     * * `Light Mode` --> `themeSource = 'light'`
5373     *
5374     * Your application should then always use `shouldUseDarkColors` to determine what
5375     * CSS to apply.
5376     */
5377    themeSource: ('system' | 'light' | 'dark');
5378  }
5379
5380  interface Net {
5381
5382    // Docs: http://electronjs.org/docs/api/net
5383
5384    /**
5385     * Creates a `ClientRequest` instance using the provided `options` which are
5386     * directly forwarded to the `ClientRequest` constructor. The `net.request` method
5387     * would be used to issue both secure and insecure HTTP requests according to the
5388     * specified protocol scheme in the `options` object.
5389     */
5390    request(options: (ClientRequestConstructorOptions) | (string)): ClientRequest;
5391  }
5392
5393  interface NetLog {
5394
5395    // Docs: http://electronjs.org/docs/api/net-log
5396
5397    /**
5398     * resolves when the net log has begun recording.
5399     *
5400Starts recording network events to `path`.
5401     */
5402    startLogging(path: string, options?: StartLoggingOptions): Promise<void>;
5403    /**
5404     * resolves with a file path to which network logs were recorded.
5405     *
5406     * Stops recording network events. If not called, net logging will automatically
5407     * end when app quits.
5408     */
5409    stopLogging(): Promise<string>;
5410    /**
5411     * A `Boolean` property that indicates whether network logs are recorded.
5412     *
5413     */
5414    readonly currentlyLogging: boolean;
5415    /**
5416     * A `String` property that returns the path to the current log file.
5417     *
5418     * @deprecated
5419     */
5420    readonly currentlyLoggingPath: string;
5421  }
5422
5423  interface NewWindowEvent extends Event {
5424
5425    // Docs: http://electronjs.org/docs/api/structures/new-window-event
5426
5427    newGuest?: BrowserWindow;
5428  }
5429
5430  class Notification extends NodeJS.EventEmitter {
5431
5432    // Docs: http://electronjs.org/docs/api/notification
5433
5434    on(event: 'action', listener: (event: Event,
5435                                   /**
5436                                    * The index of the action that was activated.
5437                                    */
5438                                   index: number) => void): this;
5439    once(event: 'action', listener: (event: Event,
5440                                   /**
5441                                    * The index of the action that was activated.
5442                                    */
5443                                   index: number) => void): this;
5444    addListener(event: 'action', listener: (event: Event,
5445                                   /**
5446                                    * The index of the action that was activated.
5447                                    */
5448                                   index: number) => void): this;
5449    removeListener(event: 'action', listener: (event: Event,
5450                                   /**
5451                                    * The index of the action that was activated.
5452                                    */
5453                                   index: number) => void): this;
5454    /**
5455     * Emitted when the notification is clicked by the user.
5456     */
5457    on(event: 'click', listener: (event: Event) => void): this;
5458    once(event: 'click', listener: (event: Event) => void): this;
5459    addListener(event: 'click', listener: (event: Event) => void): this;
5460    removeListener(event: 'click', listener: (event: Event) => void): this;
5461    /**
5462     * Emitted when the notification is closed by manual intervention from the user.
5463     *
5464     * This event is not guaranteed to be emitted in all cases where the notification
5465     * is closed.
5466     */
5467    on(event: 'close', listener: (event: Event) => void): this;
5468    once(event: 'close', listener: (event: Event) => void): this;
5469    addListener(event: 'close', listener: (event: Event) => void): this;
5470    removeListener(event: 'close', listener: (event: Event) => void): this;
5471    /**
5472     * Emitted when the user clicks the "Reply" button on a notification with
5473     * `hasReply: true`.
5474     *
5475     * @platform darwin
5476     */
5477    on(event: 'reply', listener: (event: Event,
5478                                  /**
5479                                   * The string the user entered into the inline reply field.
5480                                   */
5481                                  reply: string) => void): this;
5482    once(event: 'reply', listener: (event: Event,
5483                                  /**
5484                                   * The string the user entered into the inline reply field.
5485                                   */
5486                                  reply: string) => void): this;
5487    addListener(event: 'reply', listener: (event: Event,
5488                                  /**
5489                                   * The string the user entered into the inline reply field.
5490                                   */
5491                                  reply: string) => void): this;
5492    removeListener(event: 'reply', listener: (event: Event,
5493                                  /**
5494                                   * The string the user entered into the inline reply field.
5495                                   */
5496                                  reply: string) => void): this;
5497    /**
5498     * Emitted when the notification is shown to the user, note this could be fired
5499     * multiple times as a notification can be shown multiple times through the
5500     * `show()` method.
5501     */
5502    on(event: 'show', listener: (event: Event) => void): this;
5503    once(event: 'show', listener: (event: Event) => void): this;
5504    addListener(event: 'show', listener: (event: Event) => void): this;
5505    removeListener(event: 'show', listener: (event: Event) => void): this;
5506    /**
5507     * Notification
5508     */
5509    constructor(options?: NotificationConstructorOptions);
5510    /**
5511     * Whether or not desktop notifications are supported on the current system
5512     */
5513    static isSupported(): boolean;
5514    /**
5515     * Dismisses the notification.
5516     */
5517    close(): void;
5518    /**
5519     * Immediately shows the notification to the user, please note this means unlike
5520     * the HTML5 Notification implementation, instantiating a `new Notification` does
5521     * not immediately show it to the user, you need to call this method before the OS
5522     * will display it.
5523     *
5524     * If the notification has been shown before, this method will dismiss the
5525     * previously shown notification and create a new one with identical properties.
5526     */
5527    show(): void;
5528    actions: NotificationAction[];
5529    body: string;
5530    closeButtonText: string;
5531    hasReply: boolean;
5532    replyPlaceholder: string;
5533    silent: boolean;
5534    sound: string;
5535    subtitle: string;
5536    timeoutType: ('default' | 'never');
5537    title: string;
5538    urgency: ('normal' | 'critical' | 'low');
5539  }
5540
5541  interface NotificationAction {
5542
5543    // Docs: http://electronjs.org/docs/api/structures/notification-action
5544
5545    /**
5546     * The label for the given action.
5547     */
5548    text?: string;
5549    /**
5550     * The type of action, can be `button`.
5551     */
5552    type: ('button');
5553  }
5554
5555  interface Point {
5556
5557    // Docs: http://electronjs.org/docs/api/structures/point
5558
5559    x: number;
5560    y: number;
5561  }
5562
5563  interface PowerMonitor extends NodeJS.EventEmitter {
5564
5565    // Docs: http://electronjs.org/docs/api/power-monitor
5566
5567    /**
5568     * Emitted when the system is about to lock the screen.
5569     *
5570     * @platform darwin,win32
5571     */
5572    on(event: 'lock-screen', listener: Function): this;
5573    once(event: 'lock-screen', listener: Function): this;
5574    addListener(event: 'lock-screen', listener: Function): this;
5575    removeListener(event: 'lock-screen', listener: Function): this;
5576    /**
5577     * Emitted when the system changes to AC power.
5578     *
5579     * @platform win32
5580     */
5581    on(event: 'on-ac', listener: Function): this;
5582    once(event: 'on-ac', listener: Function): this;
5583    addListener(event: 'on-ac', listener: Function): this;
5584    removeListener(event: 'on-ac', listener: Function): this;
5585    /**
5586     * Emitted when system changes to battery power.
5587     *
5588     * @platform win32
5589     */
5590    on(event: 'on-battery', listener: Function): this;
5591    once(event: 'on-battery', listener: Function): this;
5592    addListener(event: 'on-battery', listener: Function): this;
5593    removeListener(event: 'on-battery', listener: Function): this;
5594    /**
5595     * Emitted when system is resuming.
5596     */
5597    on(event: 'resume', listener: Function): this;
5598    once(event: 'resume', listener: Function): this;
5599    addListener(event: 'resume', listener: Function): this;
5600    removeListener(event: 'resume', listener: Function): this;
5601    /**
5602     * Emitted when the system is about to reboot or shut down. If the event handler
5603     * invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in
5604     * order for the app to exit cleanly. If `e.preventDefault()` is called, the app
5605     * should exit as soon as possible by calling something like `app.quit()`.
5606     *
5607     * @platform linux,darwin
5608     */
5609    on(event: 'shutdown', listener: Function): this;
5610    once(event: 'shutdown', listener: Function): this;
5611    addListener(event: 'shutdown', listener: Function): this;
5612    removeListener(event: 'shutdown', listener: Function): this;
5613    /**
5614     * Emitted when the system is suspending.
5615     */
5616    on(event: 'suspend', listener: Function): this;
5617    once(event: 'suspend', listener: Function): this;
5618    addListener(event: 'suspend', listener: Function): this;
5619    removeListener(event: 'suspend', listener: Function): this;
5620    /**
5621     * Emitted as soon as the systems screen is unlocked.
5622     *
5623     * @platform darwin,win32
5624     */
5625    on(event: 'unlock-screen', listener: Function): this;
5626    once(event: 'unlock-screen', listener: Function): this;
5627    addListener(event: 'unlock-screen', listener: Function): this;
5628    removeListener(event: 'unlock-screen', listener: Function): this;
5629    /**
5630     * The system's current state. Can be `active`, `idle`, `locked` or `unknown`.
5631     *
5632     * Calculate the system idle state. `idleThreshold` is the amount of time (in
5633     * seconds) before considered idle.  `locked` is available on supported systems
5634     * only.
5635     */
5636    getSystemIdleState(idleThreshold: number): ('active' | 'idle' | 'locked' | 'unknown');
5637    /**
5638     * Idle time in seconds
5639
5640Calculate system idle time in seconds.
5641     */
5642    getSystemIdleTime(): number;
5643  }
5644
5645  interface PowerSaveBlocker {
5646
5647    // Docs: http://electronjs.org/docs/api/power-save-blocker
5648
5649    /**
5650     * Whether the corresponding `powerSaveBlocker` has started.
5651     */
5652    isStarted(id: number): boolean;
5653    /**
5654     * The blocker ID that is assigned to this power blocker.
5655     *
5656     * Starts preventing the system from entering lower-power mode. Returns an integer
5657     * identifying the power save blocker.
5658     *
5659     * **Note:** `prevent-display-sleep` has higher precedence over
5660     * `prevent-app-suspension`. Only the highest precedence type takes effect. In
5661     * other words, `prevent-display-sleep` always takes precedence over
5662     * `prevent-app-suspension`.
5663     *
5664     * For example, an API calling A requests for `prevent-app-suspension`, and another
5665     * calling B requests for `prevent-display-sleep`. `prevent-display-sleep` will be
5666     * used until B stops its request. After that, `prevent-app-suspension` is used.
5667     */
5668    start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number;
5669    /**
5670     * Stops the specified power save blocker.
5671     */
5672    stop(id: number): void;
5673  }
5674
5675  interface PrinterInfo {
5676
5677    // Docs: http://electronjs.org/docs/api/structures/printer-info
5678
5679    description: string;
5680    isDefault: boolean;
5681    name: string;
5682    status: number;
5683  }
5684
5685  interface ProcessMemoryInfo {
5686
5687    // Docs: http://electronjs.org/docs/api/structures/process-memory-info
5688
5689    /**
5690     * The amount of memory not shared by other processes, such as JS heap or HTML
5691     * content in Kilobytes.
5692     */
5693    private: number;
5694    /**
5695     * The amount of memory currently pinned to actual physical RAM in Kilobytes.
5696     *
5697     * @platform linux,win32
5698     */
5699    residentSet: number;
5700    /**
5701     * The amount of memory shared between processes, typically memory consumed by the
5702     * Electron code itself in Kilobytes.
5703     */
5704    shared: number;
5705  }
5706
5707  interface ProcessMetric {
5708
5709    // Docs: http://electronjs.org/docs/api/structures/process-metric
5710
5711    /**
5712     * CPU usage of the process.
5713     */
5714    cpu: CPUUsage;
5715    /**
5716     * Creation time for this process. The time is represented as number of
5717     * milliseconds since epoch. Since the `pid` can be reused after a process dies, it
5718     * is useful to use both the `pid` and the `creationTime` to uniquely identify a
5719     * process.
5720     */
5721    creationTime: number;
5722    /**
5723     * One of the following values:
5724     *
5725     * @platform win32
5726     */
5727    integrityLevel?: ('untrusted' | 'low' | 'medium' | 'high' | 'unknown');
5728    /**
5729     * Memory information for the process.
5730     */
5731    memory: MemoryInfo;
5732    /**
5733     * Process id of the process.
5734     */
5735    pid: number;
5736    /**
5737     * Whether the process is sandboxed on OS level.
5738     *
5739     * @platform darwin,win32
5740     */
5741    sandboxed?: boolean;
5742    /**
5743     * Process type. One of the following values:
5744     */
5745    type: ('Browser' | 'Tab' | 'Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
5746  }
5747
5748  interface Product {
5749
5750    // Docs: http://electronjs.org/docs/api/structures/product
5751
5752    /**
5753     * The total size of the content, in bytes.
5754     */
5755    contentLengths: number[];
5756    /**
5757     * A string that identifies the version of the content.
5758     */
5759    contentVersion: string;
5760    /**
5761     * The locale formatted price of the product.
5762     */
5763    formattedPrice: string;
5764    /**
5765     * A Boolean value that indicates whether the App Store has downloadable content
5766     * for this product. `true` if at least one file has been associated with the
5767     * product.
5768     */
5769    isDownloadable: boolean;
5770    /**
5771     * A description of the product.
5772     */
5773    localizedDescription: string;
5774    /**
5775     * The name of the product.
5776     */
5777    localizedTitle: string;
5778    /**
5779     * The cost of the product in the local currency.
5780     */
5781    price: number;
5782    /**
5783     * The string that identifies the product to the Apple App Store.
5784     */
5785    productIdentifier: string;
5786  }
5787
5788  interface Protocol {
5789
5790    // Docs: http://electronjs.org/docs/api/protocol
5791
5792    /**
5793     * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
5794     * which sends a `Buffer` as a response.
5795     */
5796    interceptBufferProtocol(scheme: string, handler: (request: Request, callback: (buffer?: Buffer) => void) => void, completion?: (error: Error) => void): void;
5797    /**
5798     * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
5799     * which sends a file as a response.
5800     */
5801    interceptFileProtocol(scheme: string, handler: (request: Request, callback: (filePath: string) => void) => void, completion?: (error: Error) => void): void;
5802    /**
5803     * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
5804     * which sends a new HTTP request as a response.
5805     */
5806    interceptHttpProtocol(scheme: string, handler: (request: Request, callback: (redirectRequest: RedirectRequest) => void) => void, completion?: (error: Error) => void): void;
5807    /**
5808     * Same as `protocol.registerStreamProtocol`, except that it replaces an existing
5809     * protocol handler.
5810     */
5811    interceptStreamProtocol(scheme: string, handler: (request: Request, callback: (stream?: (NodeJS.ReadableStream) | (StreamProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
5812    /**
5813     * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
5814     * which sends a `String` as a response.
5815     */
5816    interceptStringProtocol(scheme: string, handler: (request: Request, callback: (data?: (string) | (StringProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
5817    /**
5818     * fulfilled with a boolean that indicates whether there is already a handler for
5819     * `scheme`.
5820     */
5821    isProtocolHandled(scheme: string): Promise<boolean>;
5822    /**
5823     * Registers a protocol of `scheme` that will send a `Buffer` as a response.
5824     *
5825     * The usage is the same with `registerFileProtocol`, except that the `callback`
5826     * should be called with either a `Buffer` object or an object that has the `data`,
5827     * `mimeType`, and `charset` properties.
5828
5829Example:
5830     */
5831    registerBufferProtocol(scheme: string, handler: (request: Request, callback: (buffer?: (Buffer) | (MimeTypedBuffer)) => void) => void, completion?: (error: Error) => void): void;
5832    /**
5833     * Registers a protocol of `scheme` that will send the file as a response. The
5834     * `handler` will be called with `handler(request, callback)` when a `request` is
5835     * going to be created with `scheme`. `completion` will be called with
5836     * `completion(null)` when `scheme` is successfully registered or
5837     * `completion(error)` when failed.
5838     *
5839     * To handle the `request`, the `callback` should be called with either the file's
5840     * path or an object that has a `path` property, e.g. `callback(filePath)` or
5841     * `callback({ path: filePath })`. The object may also have a `headers` property
5842     * which gives a map of headers to values for the response headers, e.g.
5843     * `callback({ path: filePath, headers: {"Content-Security-Policy": "default-src
5844     * 'none'"]})`.
5845     *
5846     * When `callback` is called with nothing, a number, or an object that has an
5847     * `error` property, the `request` will fail with the `error` number you specified.
5848     * For the available error numbers you can use, please see the net error list.
5849     *
5850     * By default the `scheme` is treated like `http:`, which is parsed differently
5851     * than protocols that follow the "generic URI syntax" like `file:`.
5852     */
5853    registerFileProtocol(scheme: string, handler: (request: Request, callback: (filePath?: (string) | (FilePathWithHeaders)) => void) => void, completion?: (error: Error) => void): void;
5854    /**
5855     * Registers a protocol of `scheme` that will send an HTTP request as a response.
5856     *
5857     * The usage is the same with `registerFileProtocol`, except that the `callback`
5858     * should be called with a `redirectRequest` object that has the `url`, `method`,
5859     * `referrer`, `uploadData` and `session` properties.
5860     *
5861     * By default the HTTP request will reuse the current session. If you want the
5862     * request to have a different session you should set `session` to `null`.
5863     *
5864For POST requests the `uploadData` object must be provided.
5865     */
5866    registerHttpProtocol(scheme: string, handler: (request: Request, callback: (redirectRequest: RedirectRequest) => void) => void, completion?: (error: Error) => void): void;
5867    /**
5868     * **Note:** This method can only be used before the `ready` event of the `app`
5869     * module gets emitted and can be called only once.
5870     *
5871     * Registers the `scheme` as standard, secure, bypasses content security policy for
5872     * resources, allows registering ServiceWorker and supports fetch API.
5873     *
5874     * Specify a privilege with the value of `true` to enable the capability. An
5875     * example of registering a privileged scheme, with bypassing Content Security
5876     * Policy:
5877     *
5878     * A standard scheme adheres to what RFC 3986 calls generic URI syntax. For example
5879     * `http` and `https` are standard schemes, while `file` is not.
5880     *
5881     * Registering a scheme as standard, will allow relative and absolute resources to
5882     * be resolved correctly when served. Otherwise the scheme will behave like the
5883     * `file` protocol, but without the ability to resolve relative URLs.
5884     *
5885     * For example when you load following page with custom protocol without
5886     * registering it as standard scheme, the image will not be loaded because
5887     * non-standard schemes can not recognize relative URLs:
5888     *
5889     * Registering a scheme as standard will allow access to files through the
5890     * FileSystem API. Otherwise the renderer will throw a security error for the
5891     * scheme.
5892     *
5893     * By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
5894     * cookies) are disabled for non standard schemes. So in general if you want to
5895     * register a custom protocol to replace the `http` protocol, you have to register
5896     * it as a standard scheme.
5897     *
5898     * `protocol.registerSchemesAsPrivileged` can be used to replicate the
5899     * functionality of the previous `protocol.registerStandardSchemes`,
5900     * `webFrame.registerURLSchemeAs*` and `protocol.registerServiceWorkerSchemes`
5901     * functions that existed prior to Electron 5.0.0, for example:
5902     *
5903**before (<= v4.x)**
5904
5905**after (>= v5.x)**
5906     */
5907    registerSchemesAsPrivileged(customSchemes: CustomScheme[]): void;
5908    /**
5909     * Registers a protocol of `scheme` that will send a `Readable` as a response.
5910     *
5911     * The usage is similar to the other `register{Any}Protocol`, except that the
5912     * `callback` should be called with either a `Readable` object or an object that
5913     * has the `data`, `statusCode`, and `headers` properties.
5914     *
5915     * Example:
5916     *
5917     * It is possible to pass any object that implements the readable stream API (emits
5918     * `data`/`end`/`error` events). For example, here's how a file could be returned:
5919     */
5920    registerStreamProtocol(scheme: string, handler: (request: Request, callback: (stream?: (NodeJS.ReadableStream) | (StreamProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
5921    /**
5922     * Registers a protocol of `scheme` that will send a `String` as a response.
5923     *
5924     * The usage is the same with `registerFileProtocol`, except that the `callback`
5925     * should be called with either a `String` or an object that has the `data`,
5926     * `mimeType`, and `charset` properties.
5927     */
5928    registerStringProtocol(scheme: string, handler: (request: Request, callback: (data?: (string) | (StringProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
5929    /**
5930     * Remove the interceptor installed for `scheme` and restore its original handler.
5931     */
5932    uninterceptProtocol(scheme: string, completion?: (error: Error) => void): void;
5933    /**
5934     * Unregisters the custom protocol of `scheme`.
5935     */
5936    unregisterProtocol(scheme: string, completion?: (error: Error) => void): void;
5937  }
5938
5939  interface ProtocolRequest {
5940
5941    // Docs: http://electronjs.org/docs/api/structures/protocol-request
5942
5943    method: string;
5944    referrer: string;
5945    uploadData?: UploadData[];
5946    url: string;
5947  }
5948
5949  interface ProtocolResponse {
5950
5951    // Docs: http://electronjs.org/docs/api/structures/protocol-response
5952
5953    /**
5954     * The charset of response body, default is `"utf-8"`.
5955     */
5956    charset?: string;
5957    /**
5958     * The response body. When returning stream as response, this is a Node.js readable
5959     * stream representing the response body. When returning `Buffer` as response, this
5960     * is a `Buffer`. When returning `String` as response, this is a `String`. This is
5961     * ignored for other types of responses.
5962     */
5963    data?: (Buffer) | (string) | (NodeJS.ReadableStream);
5964    /**
5965     * When assigned, the `request` will fail with the `error` number . For the
5966     * available error numbers you can use, please see the net error list.
5967     */
5968    error?: number;
5969    /**
5970     * An object containing the response headers. The keys must be String, and values
5971     * must be either String or Array of String.
5972     */
5973    headers?: Record<string, (string) | (string[])>;
5974    /**
5975     * The HTTP `method`. This is only used for file and URL responses.
5976     */
5977    method?: string;
5978    /**
5979     * The MIME type of response body, default is `"text/html"`. Setting `mimeType`
5980     * would implicitly set the `content-type` header in response, but if
5981     * `content-type` is already set in `headers`, the `mimeType` would be ignored.
5982     */
5983    mimeType?: string;
5984    /**
5985     * Path to the file which would be sent as response body. This is only used for
5986     * file responses.
5987     */
5988    path?: string;
5989    /**
5990     * The `referrer` URL. This is only used for file and URL responses.
5991     */
5992    referrer?: string;
5993    /**
5994     * The session used for requesting URL, by default the HTTP request will reuse the
5995     * current session. Setting `session` to `null` would use a random independent
5996     * session. This is only used for URL responses.
5997     */
5998    session?: Session;
5999    /**
6000     * The HTTP response code, default is 200.
6001     */
6002    statusCode?: number;
6003    /**
6004     * The data used as upload data. This is only used for URL responses when `method`
6005     * is `"POST"`.
6006     */
6007    uploadData?: ProtocolResponseUploadData;
6008    /**
6009     * Download the `url` and pipe the result as response body. This is only used for
6010     * URL responses.
6011     */
6012    url?: string;
6013  }
6014
6015  interface ProtocolResponseUploadData {
6016
6017    // Docs: http://electronjs.org/docs/api/structures/protocol-response-upload-data
6018
6019    /**
6020     * MIME type of the content.
6021     */
6022    contentType: string;
6023    /**
6024     * Content to be sent.
6025     */
6026    data: (string) | (Buffer);
6027  }
6028
6029  interface Rectangle {
6030
6031    // Docs: http://electronjs.org/docs/api/structures/rectangle
6032
6033    /**
6034     * The height of the rectangle (must be an integer).
6035     */
6036    height: number;
6037    /**
6038     * The width of the rectangle (must be an integer).
6039     */
6040    width: number;
6041    /**
6042     * The x coordinate of the origin of the rectangle (must be an integer).
6043     */
6044    x: number;
6045    /**
6046     * The y coordinate of the origin of the rectangle (must be an integer).
6047     */
6048    y: number;
6049  }
6050
6051  interface Referrer {
6052
6053    // Docs: http://electronjs.org/docs/api/structures/referrer
6054
6055    /**
6056     * Can be `default`, `unsafe-url`, `no-referrer-when-downgrade`, `no-referrer`,
6057     * `origin`, `strict-origin-when-cross-origin`, `same-origin` or `strict-origin`.
6058     * See the Referrer-Policy spec for more details on the meaning of these values.
6059     */
6060    policy: ('default' | 'unsafe-url' | 'no-referrer-when-downgrade' | 'no-referrer' | 'origin' | 'strict-origin-when-cross-origin' | 'same-origin' | 'strict-origin');
6061    /**
6062     * HTTP Referrer URL.
6063     */
6064    url: string;
6065  }
6066
6067  interface Remote extends MainInterface {
6068
6069    // Docs: http://electronjs.org/docs/api/remote
6070
6071    /**
6072     * The web contents of this web page.
6073     */
6074    getCurrentWebContents(): WebContents;
6075    /**
6076     * The window to which this web page belongs.
6077     *
6078     * **Note:** Do not use `removeAllListeners` on `BrowserWindow`. Use of this can
6079     * remove all `blur` listeners, disable click events on touch bar buttons, and
6080     * other unintended consequences.
6081     */
6082    getCurrentWindow(): BrowserWindow;
6083    /**
6084     * The global variable of `name` (e.g. `global[name]`) in the main process.
6085     */
6086    getGlobal(name: string): any;
6087    /**
6088     * The object returned by `require(module)` in the main process. Modules specified
6089     * by their relative path will resolve relative to the entrypoint of the main
6090     * process.
6091
6092e.g.
6093     */
6094    require(module: string): any;
6095    /**
6096     * A `NodeJS.Process` object.  The `process` object in the main process. This is
6097     * the same as `remote.getGlobal('process')` but is cached.
6098     *
6099     */
6100    readonly process: NodeJS.Process;
6101  }
6102
6103  interface RemoveClientCertificate {
6104
6105    // Docs: http://electronjs.org/docs/api/structures/remove-client-certificate
6106
6107    /**
6108     * Origin of the server whose associated client certificate must be removed from
6109     * the cache.
6110     */
6111    origin: string;
6112    /**
6113     * `clientCertificate`.
6114     */
6115    type: string;
6116  }
6117
6118  interface RemovePassword {
6119
6120    // Docs: http://electronjs.org/docs/api/structures/remove-password
6121
6122    /**
6123     * When provided, the authentication info related to the origin will only be
6124     * removed otherwise the entire cache will be cleared.
6125     */
6126    origin?: string;
6127    /**
6128     * Credentials of the authentication. Must be provided if removing by `origin`.
6129     */
6130    password?: string;
6131    /**
6132     * Realm of the authentication. Must be provided if removing by `origin`.
6133     */
6134    realm?: string;
6135    /**
6136     * Scheme of the authentication. Can be `basic`, `digest`, `ntlm`, `negotiate`.
6137     * Must be provided if removing by `origin`.
6138     */
6139    scheme?: ('basic' | 'digest' | 'ntlm' | 'negotiate');
6140    /**
6141     * `password`.
6142     */
6143    type: string;
6144    /**
6145     * Credentials of the authentication. Must be provided if removing by `origin`.
6146     */
6147    username?: string;
6148  }
6149
6150  interface Screen extends NodeJS.EventEmitter {
6151
6152    // Docs: http://electronjs.org/docs/api/screen
6153
6154    /**
6155     * Emitted when `newDisplay` has been added.
6156     */
6157    on(event: 'display-added', listener: (event: Event,
6158                                          newDisplay: Display) => void): this;
6159    once(event: 'display-added', listener: (event: Event,
6160                                          newDisplay: Display) => void): this;
6161    addListener(event: 'display-added', listener: (event: Event,
6162                                          newDisplay: Display) => void): this;
6163    removeListener(event: 'display-added', listener: (event: Event,
6164                                          newDisplay: Display) => void): this;
6165    /**
6166     * Emitted when one or more metrics change in a `display`. The `changedMetrics` is
6167     * an array of strings that describe the changes. Possible changes are `bounds`,
6168     * `workArea`, `scaleFactor` and `rotation`.
6169     */
6170    on(event: 'display-metrics-changed', listener: (event: Event,
6171                                                    display: Display,
6172                                                    changedMetrics: string[]) => void): this;
6173    once(event: 'display-metrics-changed', listener: (event: Event,
6174                                                    display: Display,
6175                                                    changedMetrics: string[]) => void): this;
6176    addListener(event: 'display-metrics-changed', listener: (event: Event,
6177                                                    display: Display,
6178                                                    changedMetrics: string[]) => void): this;
6179    removeListener(event: 'display-metrics-changed', listener: (event: Event,
6180                                                    display: Display,
6181                                                    changedMetrics: string[]) => void): this;
6182    /**
6183     * Emitted when `oldDisplay` has been removed.
6184     */
6185    on(event: 'display-removed', listener: (event: Event,
6186                                            oldDisplay: Display) => void): this;
6187    once(event: 'display-removed', listener: (event: Event,
6188                                            oldDisplay: Display) => void): this;
6189    addListener(event: 'display-removed', listener: (event: Event,
6190                                            oldDisplay: Display) => void): this;
6191    removeListener(event: 'display-removed', listener: (event: Event,
6192                                            oldDisplay: Display) => void): this;
6193    /**
6194     * Converts a screen DIP point to a screen physical point. The DPI scale is
6195     * performed relative to the display containing the DIP point.
6196     *
6197     * @platform win32
6198     */
6199    dipToScreenPoint(point: Point): Point;
6200    /**
6201     * Converts a screen DIP rect to a screen physical rect. The DPI scale is performed
6202     * relative to the display nearest to `window`. If `window` is null, scaling will
6203     * be performed to the display nearest to `rect`.
6204     *
6205     * @platform win32
6206     */
6207    dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
6208    /**
6209     * An array of displays that are currently available.
6210     */
6211    getAllDisplays(): Display[];
6212    /**
6213     * The current absolute position of the mouse pointer.
6214     */
6215    getCursorScreenPoint(): Point;
6216    /**
6217     * The display that most closely intersects the provided bounds.
6218     */
6219    getDisplayMatching(rect: Rectangle): Display;
6220    /**
6221     * The display nearest the specified point.
6222     */
6223    getDisplayNearestPoint(point: Point): Display;
6224    /**
6225     * The primary display.
6226     */
6227    getPrimaryDisplay(): Display;
6228    /**
6229     * Converts a screen physical point to a screen DIP point. The DPI scale is
6230     * performed relative to the display containing the physical point.
6231     *
6232     * @platform win32
6233     */
6234    screenToDipPoint(point: Point): Point;
6235    /**
6236     * Converts a screen physical rect to a screen DIP rect. The DPI scale is performed
6237     * relative to the display nearest to `window`. If `window` is null, scaling will
6238     * be performed to the display nearest to `rect`.
6239     *
6240     * @platform win32
6241     */
6242    screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
6243  }
6244
6245  interface ScrubberItem {
6246
6247    // Docs: http://electronjs.org/docs/api/structures/scrubber-item
6248
6249    /**
6250     * The image to appear in this item.
6251     */
6252    icon?: NativeImage;
6253    /**
6254     * The text to appear in this item.
6255     */
6256    label?: string;
6257  }
6258
6259  interface SegmentedControlSegment {
6260
6261    // Docs: http://electronjs.org/docs/api/structures/segmented-control-segment
6262
6263    /**
6264     * Whether this segment is selectable. Default: true.
6265     */
6266    enabled?: boolean;
6267    /**
6268     * The image to appear in this segment.
6269     */
6270    icon?: NativeImage;
6271    /**
6272     * The text to appear in this segment.
6273     */
6274    label?: string;
6275  }
6276
6277  class Session extends NodeJS.EventEmitter {
6278
6279    // Docs: http://electronjs.org/docs/api/session
6280
6281    /**
6282     * A session instance from `partition` string. When there is an existing `Session`
6283     * with the same `partition`, it will be returned; otherwise a new `Session`
6284     * instance will be created with `options`.
6285     *
6286     * If `partition` starts with `persist:`, the page will use a persistent session
6287     * available to all pages in the app with the same `partition`. if there is no
6288     * `persist:` prefix, the page will use an in-memory session. If the `partition` is
6289     * empty then default session of the app will be returned.
6290     *
6291     * To create a `Session` with `options`, you have to ensure the `Session` with the
6292     * `partition` has never been used before. There is no way to change the `options`
6293     * of an existing `Session` object.
6294     */
6295    static fromPartition(partition: string, options?: FromPartitionOptions): Session;
6296    /**
6297     * A `Session` object, the default session object of the app.
6298     */
6299    static defaultSession: Session;
6300    /**
6301     * Emitted when a render process requests preconnection to a URL, generally due to
6302     * a resource hint.
6303     */
6304    on(event: 'preconnect', listener: (event: Event,
6305                                       /**
6306                                        * The URL being requested for preconnection by the renderer.
6307                                        */
6308                                       preconnectUrl: string,
6309                                       /**
6310                                        * True if the renderer is requesting that the connection include credentials (see
6311                                        * the spec for more details.)
6312                                        */
6313                                       allowCredentials: boolean) => void): this;
6314    once(event: 'preconnect', listener: (event: Event,
6315                                       /**
6316                                        * The URL being requested for preconnection by the renderer.
6317                                        */
6318                                       preconnectUrl: string,
6319                                       /**
6320                                        * True if the renderer is requesting that the connection include credentials (see
6321                                        * the spec for more details.)
6322                                        */
6323                                       allowCredentials: boolean) => void): this;
6324    addListener(event: 'preconnect', listener: (event: Event,
6325                                       /**
6326                                        * The URL being requested for preconnection by the renderer.
6327                                        */
6328                                       preconnectUrl: string,
6329                                       /**
6330                                        * True if the renderer is requesting that the connection include credentials (see
6331                                        * the spec for more details.)
6332                                        */
6333                                       allowCredentials: boolean) => void): this;
6334    removeListener(event: 'preconnect', listener: (event: Event,
6335                                       /**
6336                                        * The URL being requested for preconnection by the renderer.
6337                                        */
6338                                       preconnectUrl: string,
6339                                       /**
6340                                        * True if the renderer is requesting that the connection include credentials (see
6341                                        * the spec for more details.)
6342                                        */
6343                                       allowCredentials: boolean) => void): this;
6344    /**
6345     * Emitted when a hunspell dictionary file starts downloading
6346     */
6347    on(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
6348                                                                 /**
6349                                                                  * The language code of the dictionary file
6350                                                                  */
6351                                                                 languageCode: string) => void): this;
6352    once(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
6353                                                                 /**
6354                                                                  * The language code of the dictionary file
6355                                                                  */
6356                                                                 languageCode: string) => void): this;
6357    addListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
6358                                                                 /**
6359                                                                  * The language code of the dictionary file
6360                                                                  */
6361                                                                 languageCode: string) => void): this;
6362    removeListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
6363                                                                 /**
6364                                                                  * The language code of the dictionary file
6365                                                                  */
6366                                                                 languageCode: string) => void): this;
6367    /**
6368     * Emitted when a hunspell dictionary file download fails.  For details on the
6369     * failure you should collect a netlog and inspect the download request.
6370     */
6371    on(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
6372                                                                   /**
6373                                                                    * The language code of the dictionary file
6374                                                                    */
6375                                                                   languageCode: string) => void): this;
6376    once(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
6377                                                                   /**
6378                                                                    * The language code of the dictionary file
6379                                                                    */
6380                                                                   languageCode: string) => void): this;
6381    addListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
6382                                                                   /**
6383                                                                    * The language code of the dictionary file
6384                                                                    */
6385                                                                   languageCode: string) => void): this;
6386    removeListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
6387                                                                   /**
6388                                                                    * The language code of the dictionary file
6389                                                                    */
6390                                                                   languageCode: string) => void): this;
6391    /**
6392     * Emitted when a hunspell dictionary file has been successfully downloaded
6393     */
6394    on(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
6395                                                                   /**
6396                                                                    * The language code of the dictionary file
6397                                                                    */
6398                                                                   languageCode: string) => void): this;
6399    once(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
6400                                                                   /**
6401                                                                    * The language code of the dictionary file
6402                                                                    */
6403                                                                   languageCode: string) => void): this;
6404    addListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
6405                                                                   /**
6406                                                                    * The language code of the dictionary file
6407                                                                    */
6408                                                                   languageCode: string) => void): this;
6409    removeListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
6410                                                                   /**
6411                                                                    * The language code of the dictionary file
6412                                                                    */
6413                                                                   languageCode: string) => void): this;
6414    /**
6415     * Emitted when a hunspell dictionary file has been successfully initialized. This
6416     * occurs after the file has been downloaded.
6417     */
6418    on(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
6419                                                              /**
6420                                                               * The language code of the dictionary file
6421                                                               */
6422                                                              languageCode: string) => void): this;
6423    once(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
6424                                                              /**
6425                                                               * The language code of the dictionary file
6426                                                               */
6427                                                              languageCode: string) => void): this;
6428    addListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
6429                                                              /**
6430                                                               * The language code of the dictionary file
6431                                                               */
6432                                                              languageCode: string) => void): this;
6433    removeListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
6434                                                              /**
6435                                                               * The language code of the dictionary file
6436                                                               */
6437                                                              languageCode: string) => void): this;
6438    /**
6439     * Emitted when Electron is about to download `item` in `webContents`.
6440     *
6441     * Calling `event.preventDefault()` will cancel the download and `item` will not be
6442     * available from next tick of the process.
6443     */
6444    on(event: 'will-download', listener: (event: Event,
6445                                          item: DownloadItem,
6446                                          webContents: WebContents) => void): this;
6447    once(event: 'will-download', listener: (event: Event,
6448                                          item: DownloadItem,
6449                                          webContents: WebContents) => void): this;
6450    addListener(event: 'will-download', listener: (event: Event,
6451                                          item: DownloadItem,
6452                                          webContents: WebContents) => void): this;
6453    removeListener(event: 'will-download', listener: (event: Event,
6454                                          item: DownloadItem,
6455                                          webContents: WebContents) => void): this;
6456    /**
6457     * Whether the word was successfully written to the custom dictionary.
6458     *
6459     * **Note:** On macOS and Windows 10 this word will be written to the OS custom
6460     * dictionary as well
6461     */
6462    addWordToSpellCheckerDictionary(word: string): boolean;
6463    /**
6464     * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
6465     * authentication.
6466     */
6467    allowNTLMCredentialsForDomains(domains: string): void;
6468    /**
6469     * resolves when the session’s HTTP authentication cache has been cleared.
6470     */
6471    clearAuthCache(options: (RemovePassword) | (RemoveClientCertificate)): Promise<void>;
6472    /**
6473     * resolves when the cache clear operation is complete.
6474     *
6475Clears the session’s HTTP cache.
6476     */
6477    clearCache(): Promise<void>;
6478    /**
6479     * Resolves when the operation is complete.
6480
6481Clears the host resolver cache.
6482     */
6483    clearHostResolverCache(): Promise<void>;
6484    /**
6485     * resolves when the storage data has been cleared.
6486     */
6487    clearStorageData(options?: ClearStorageDataOptions): Promise<void>;
6488    /**
6489     * Allows resuming `cancelled` or `interrupted` downloads from previous `Session`.
6490     * The API will generate a DownloadItem that can be accessed with the will-download
6491     * event. The DownloadItem will not have any `WebContents` associated with it and
6492     * the initial state will be `interrupted`. The download will start only when the
6493     * `resume` API is called on the DownloadItem.
6494     */
6495    createInterruptedDownload(options: CreateInterruptedDownloadOptions): void;
6496    /**
6497     * Disables any network emulation already active for the `session`. Resets to the
6498     * original network configuration.
6499     */
6500    disableNetworkEmulation(): void;
6501    /**
6502     * Initiates a download of the resource at `url`. The API will generate a
6503     * DownloadItem that can be accessed with the will-download event.
6504     *
6505     * **Note:** This does not perform any security checks that relate to a page's
6506     * origin, unlike `webContents.downloadURL`.
6507     */
6508    downloadURL(url: string): void;
6509    /**
6510     * Emulates network with the given configuration for the `session`.
6511     */
6512    enableNetworkEmulation(options: EnableNetworkEmulationOptions): void;
6513    /**
6514     * Writes any unwritten DOMStorage data to disk.
6515     */
6516    flushStorageData(): void;
6517    /**
6518     * resolves with blob data.
6519     */
6520    getBlobData(identifier: string): Promise<Buffer>;
6521    /**
6522     * the session's current cache size, in bytes.
6523     */
6524    getCacheSize(): Promise<number>;
6525    /**
6526     * an array of paths to preload scripts that have been registered.
6527     */
6528    getPreloads(): string[];
6529    /**
6530     * An array of language codes the spellchecker is enabled for.  If this list is
6531     * empty the spellchecker will fallback to using `en-US`.  By default on launch if
6532     * this setting is an empty list Electron will try to populate this setting with
6533     * the current OS locale.  This setting is persisted across restarts.
6534     *
6535     * **Note:** On macOS the OS spellchecker is used and has it's own list of
6536     * languages.  This API is a no-op on macOS.
6537     */
6538    getSpellCheckerLanguages(): string[];
6539    /**
6540     * The user agent for this session.
6541     */
6542    getUserAgent(): string;
6543    /**
6544     * Preconnects the given number of sockets to an origin.
6545     */
6546    preconnect(options: PreconnectOptions): void;
6547    /**
6548     * Resolves with the proxy information for `url`.
6549     */
6550    resolveProxy(url: string): Promise<string>;
6551    /**
6552     * Sets the certificate verify proc for `session`, the `proc` will be called with
6553     * `proc(request, callback)` whenever a server certificate verification is
6554     * requested. Calling `callback(0)` accepts the certificate, calling `callback(-2)`
6555     * rejects it.
6556     *
6557     * Calling `setCertificateVerifyProc(null)` will revert back to default certificate
6558     * verify proc.
6559     */
6560    setCertificateVerifyProc(proc: ((request: CertificateVerifyProcProcRequest, callback: (verificationResult: number) => void) => void) | (null)): void;
6561    /**
6562     * Sets download saving directory. By default, the download directory will be the
6563     * `Downloads` under the respective app folder.
6564     */
6565    setDownloadPath(path: string): void;
6566    /**
6567     * Sets the handler which can be used to respond to permission checks for the
6568     * `session`. Returning `true` will allow the permission and `false` will reject
6569     * it. To clear the handler, call `setPermissionCheckHandler(null)`.
6570     */
6571    setPermissionCheckHandler(handler: ((webContents: WebContents, permission: string, requestingOrigin: string, details: Details) => boolean) | (null)): void;
6572    /**
6573     * Sets the handler which can be used to respond to permission requests for the
6574     * `session`. Calling `callback(true)` will allow the permission and
6575     * `callback(false)` will reject it. To clear the handler, call
6576     * `setPermissionRequestHandler(null)`.
6577     */
6578    setPermissionRequestHandler(handler: ((webContents: WebContents, permission: string, callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerHandlerDetails) => void) | (null)): void;
6579    /**
6580     * Adds scripts that will be executed on ALL web contents that are associated with
6581     * this session just before normal `preload` scripts run.
6582     */
6583    setPreloads(preloads: string[]): void;
6584    /**
6585     * Resolves when the proxy setting process is complete.
6586     *
6587     * Sets the proxy settings.
6588     *
6589     * When `pacScript` and `proxyRules` are provided together, the `proxyRules` option
6590     * is ignored and `pacScript` configuration is applied.
6591     *
6592     * The `proxyRules` has to follow the rules below:
6593     *
6594     * For example:
6595     *
6596     * * `http=foopy:80;ftp=foopy2` - Use HTTP proxy `foopy:80` for `http://` URLs, and
6597     * HTTP proxy `foopy2:80` for `ftp://` URLs.
6598     * * `foopy:80` - Use HTTP proxy `foopy:80` for all URLs.
6599     * * `foopy:80,bar,direct://` - Use HTTP proxy `foopy:80` for all URLs, failing
6600     * over to `bar` if `foopy:80` is unavailable, and after that using no proxy.
6601     * * `socks4://foopy` - Use SOCKS v4 proxy `foopy:1080` for all URLs.
6602     * * `http=foopy,socks5://bar.com` - Use HTTP proxy `foopy` for http URLs, and fail
6603     * over to the SOCKS5 proxy `bar.com` if `foopy` is unavailable.
6604     * * `http=foopy,direct://` - Use HTTP proxy `foopy` for http URLs, and use no
6605     * proxy if `foopy` is unavailable.
6606     * * `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use
6607     * `socks4://foopy2` for all other URLs.
6608     *
6609     * The `proxyBypassRules` is a comma separated list of rules described below:
6610     *
6611     * * `[ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" <port> ]`
6612     *
6613     * Match all hostnames that match the pattern HOSTNAME_PATTERN.
6614     *
6615     * Examples: "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99",
6616     * "https://x.*.y.com:99"
6617     * * `"." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]`
6618     *
6619     * Match a particular domain suffix.
6620     *
6621     * Examples: ".google.com", ".com", "http://.google.com"
6622     * * `[ SCHEME "://" ] IP_LITERAL [ ":" PORT ]`
6623     *
6624     * Match URLs which are IP address literals.
6625     *
6626     * Examples: "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
6627     * * `IP_LITERAL "/" PREFIX_LENGTH_IN_BITS`
6628     *
6629     * Match any URL that is to an IP literal that falls between the given range. IP
6630     * range is specified using CIDR notation.
6631     *
6632     * Examples: "192.168.1.1/16", "fefe:13::abc/33".
6633     * * `<local>`
6634     *
6635     * Match local addresses. The meaning of `<local>` is whether the host matches one
6636     * of: "127.0.0.1", "::1", "localhost".
6637     */
6638    setProxy(config: Config): Promise<void>;
6639    /**
6640     * By default Electron will download hunspell dictionaries from the Chromium CDN.
6641     * If you want to override this behavior you can use this API to point the
6642     * dictionary downloader at your own hosted version of the hunspell dictionaries.
6643     * We publish a `hunspell_dictionaries.zip` file with each release which contains
6644     * the files you need to host here, the file server must be **case insensitive**
6645     * you must upload each file twice, once with the case it has in the ZIP file and
6646     * once with the filename as all lower case.
6647     *
6648     * If the files present in `hunspell_dictionaries.zip` are available at
6649     * `https://example.com/dictionaries/language-code.bdic` then you should call this
6650     * api with
6651     * `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`.
6652     *  Please note the trailing slash.  The URL to the dictionaries is formed as
6653     * `${url}${filename}`.
6654     *
6655     * **Note:** On macOS the OS spellchecker is used and therefore we do not download
6656     * any dictionary files.  This API is a no-op on macOS.
6657     */
6658    setSpellCheckerDictionaryDownloadURL(url: string): void;
6659    /**
6660     * The built in spellchecker does not automatically detect what language a user is
6661     * typing in.  In order for the spell checker to correctly check their words you
6662     * must call this API with an array of language codes.  You can get the list of
6663     * supported language codes with the `ses.availableSpellCheckerLanguages` property.
6664     *
6665     * **Note:** On macOS the OS spellchecker is used and will detect your language
6666     * automatically.  This API is a no-op on macOS.
6667     */
6668    setSpellCheckerLanguages(languages: string[]): void;
6669    /**
6670     * Overrides the `userAgent` and `acceptLanguages` for this session.
6671     *
6672     * The `acceptLanguages` must a comma separated ordered list of language codes, for
6673     * example `"en-US,fr,de,ko,zh-CN,ja"`.
6674     *
6675     * This doesn't affect existing `WebContents`, and each `WebContents` can use
6676     * `webContents.setUserAgent` to override the session-wide user agent.
6677     */
6678    setUserAgent(userAgent: string, acceptLanguages?: string): void;
6679    readonly availableSpellCheckerLanguages: string[];
6680    readonly cookies: Cookies;
6681    readonly netLog: NetLog;
6682    readonly protocol: Protocol;
6683    readonly webRequest: WebRequest;
6684  }
6685
6686  interface SharedWorkerInfo {
6687
6688    // Docs: http://electronjs.org/docs/api/structures/shared-worker-info
6689
6690    /**
6691     * The unique id of the shared worker.
6692     */
6693    id: string;
6694    /**
6695     * The url of the shared worker.
6696     */
6697    url: string;
6698  }
6699
6700  interface Shell {
6701
6702    // Docs: http://electronjs.org/docs/api/shell
6703
6704    /**
6705     * Play the beep sound.
6706     */
6707    beep(): void;
6708    /**
6709     * Whether the item was successfully moved to the trash or otherwise deleted.
6710     *
6711Move the given file to trash and returns a boolean status for the operation.
6712     */
6713    moveItemToTrash(fullPath: string, deleteOnFail?: boolean): boolean;
6714    /**
6715     * Open the given external protocol URL in the desktop's default manner. (For
6716     * example, mailto: URLs in the user's default mail agent).
6717     */
6718    openExternal(url: string, options?: OpenExternalOptions): Promise<void>;
6719    /**
6720     * Whether the item was successfully opened.
6721     *
6722Open the given file in the desktop's default manner.
6723     */
6724    openItem(fullPath: string): boolean;
6725    /**
6726     * Resolves the shortcut link at `shortcutPath`.
6727     *
6728An exception will be thrown when any error happens.
6729     *
6730     * @platform win32
6731     */
6732    readShortcutLink(shortcutPath: string): ShortcutDetails;
6733    /**
6734     * Show the given file in a file manager. If possible, select the file.
6735     */
6736    showItemInFolder(fullPath: string): void;
6737    /**
6738     * Whether the shortcut was created successfully.
6739     *
6740Creates or updates a shortcut link at `shortcutPath`.
6741     *
6742     * @platform win32
6743     */
6744    writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutDetails): boolean;
6745    /**
6746     * Whether the shortcut was created successfully.
6747     *
6748Creates or updates a shortcut link at `shortcutPath`.
6749     *
6750     * @platform win32
6751     */
6752    writeShortcutLink(shortcutPath: string, options: ShortcutDetails): boolean;
6753  }
6754
6755  interface ShortcutDetails {
6756
6757    // Docs: http://electronjs.org/docs/api/structures/shortcut-details
6758
6759    /**
6760     * The Application User Model ID. Default is empty.
6761     */
6762    appUserModelId?: string;
6763    /**
6764     * The arguments to be applied to `target` when launching from this shortcut.
6765     * Default is empty.
6766     */
6767    args?: string;
6768    /**
6769     * The working directory. Default is empty.
6770     */
6771    cwd?: string;
6772    /**
6773     * The description of the shortcut. Default is empty.
6774     */
6775    description?: string;
6776    /**
6777     * The path to the icon, can be a DLL or EXE. `icon` and `iconIndex` have to be set
6778     * together. Default is empty, which uses the target's icon.
6779     */
6780    icon?: string;
6781    /**
6782     * The resource ID of icon when `icon` is a DLL or EXE. Default is 0.
6783     */
6784    iconIndex?: number;
6785    /**
6786     * The target to launch from this shortcut.
6787     */
6788    target: string;
6789  }
6790
6791  interface Size {
6792
6793    // Docs: http://electronjs.org/docs/api/structures/size
6794
6795    height: number;
6796    width: number;
6797  }
6798
6799  interface StreamProtocolResponse {
6800
6801    // Docs: http://electronjs.org/docs/api/structures/stream-protocol-response
6802
6803    /**
6804     * A Node.js readable stream representing the response body.
6805     */
6806    data: (NodeJS.ReadableStream) | (null);
6807    /**
6808     * An object containing the response headers.
6809     */
6810    headers?: Record<string, (string) | (string[])>;
6811    /**
6812     * The HTTP response code.
6813     */
6814    statusCode?: number;
6815  }
6816
6817  interface StringProtocolResponse {
6818
6819    // Docs: http://electronjs.org/docs/api/structures/string-protocol-response
6820
6821    /**
6822     * Charset of the response.
6823     */
6824    charset?: string;
6825    /**
6826     * A string representing the response body.
6827     */
6828    data: (string) | (null);
6829    /**
6830     * MIME type of the response.
6831     */
6832    mimeType?: string;
6833  }
6834
6835  interface SystemPreferences extends NodeJS.EventEmitter {
6836
6837    // Docs: http://electronjs.org/docs/api/system-preferences
6838
6839    on(event: 'accent-color-changed', listener: (event: Event,
6840                                                 /**
6841                                                  * The new RGBA color the user assigned to be their system accent color.
6842                                                  */
6843                                                 newColor: string) => void): this;
6844    once(event: 'accent-color-changed', listener: (event: Event,
6845                                                 /**
6846                                                  * The new RGBA color the user assigned to be their system accent color.
6847                                                  */
6848                                                 newColor: string) => void): this;
6849    addListener(event: 'accent-color-changed', listener: (event: Event,
6850                                                 /**
6851                                                  * The new RGBA color the user assigned to be their system accent color.
6852                                                  */
6853                                                 newColor: string) => void): this;
6854    removeListener(event: 'accent-color-changed', listener: (event: Event,
6855                                                 /**
6856                                                  * The new RGBA color the user assigned to be their system accent color.
6857                                                  */
6858                                                 newColor: string) => void): this;
6859    on(event: 'color-changed', listener: (event: Event) => void): this;
6860    once(event: 'color-changed', listener: (event: Event) => void): this;
6861    addListener(event: 'color-changed', listener: (event: Event) => void): this;
6862    removeListener(event: 'color-changed', listener: (event: Event) => void): this;
6863    /**
6864     * **Deprecated:** Should use the new `updated` event on the `nativeTheme` module.
6865     *
6866     * @deprecated
6867     * @platform win32
6868     */
6869    on(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
6870                                                               /**
6871                                                                * `true` if a high contrast theme is being used, `false` otherwise.
6872                                                                */
6873                                                               highContrastColorScheme: boolean) => void): this;
6874    once(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
6875                                                               /**
6876                                                                * `true` if a high contrast theme is being used, `false` otherwise.
6877                                                                */
6878                                                               highContrastColorScheme: boolean) => void): this;
6879    addListener(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
6880                                                               /**
6881                                                                * `true` if a high contrast theme is being used, `false` otherwise.
6882                                                                */
6883                                                               highContrastColorScheme: boolean) => void): this;
6884    removeListener(event: 'high-contrast-color-scheme-changed', listener: (event: Event,
6885                                                               /**
6886                                                                * `true` if a high contrast theme is being used, `false` otherwise.
6887                                                                */
6888                                                               highContrastColorScheme: boolean) => void): this;
6889    /**
6890     * **Deprecated:** Should use the new `updated` event on the `nativeTheme` module.
6891     *
6892     * @deprecated
6893     * @platform win32
6894     */
6895    on(event: 'inverted-color-scheme-changed', listener: (event: Event,
6896                                                          /**
6897                                                           * `true` if an inverted color scheme (a high contrast color scheme with light text
6898                                                           * and dark backgrounds) is being used, `false` otherwise.
6899                                                           */
6900                                                          invertedColorScheme: boolean) => void): this;
6901    once(event: 'inverted-color-scheme-changed', listener: (event: Event,
6902                                                          /**
6903                                                           * `true` if an inverted color scheme (a high contrast color scheme with light text
6904                                                           * and dark backgrounds) is being used, `false` otherwise.
6905                                                           */
6906                                                          invertedColorScheme: boolean) => void): this;
6907    addListener(event: 'inverted-color-scheme-changed', listener: (event: Event,
6908                                                          /**
6909                                                           * `true` if an inverted color scheme (a high contrast color scheme with light text
6910                                                           * and dark backgrounds) is being used, `false` otherwise.
6911                                                           */
6912                                                          invertedColorScheme: boolean) => void): this;
6913    removeListener(event: 'inverted-color-scheme-changed', listener: (event: Event,
6914                                                          /**
6915                                                           * `true` if an inverted color scheme (a high contrast color scheme with light text
6916                                                           * and dark backgrounds) is being used, `false` otherwise.
6917                                                           */
6918                                                          invertedColorScheme: boolean) => void): this;
6919    /**
6920     * A promise that resolves with `true` if consent was granted and `false` if it was
6921     * denied. If an invalid `mediaType` is passed, the promise will be rejected. If an
6922     * access request was denied and later is changed through the System Preferences
6923     * pane, a restart of the app will be required for the new permissions to take
6924     * effect. If access has already been requested and denied, it _must_ be changed
6925     * through the preference pane; an alert will not pop up and the promise will
6926     * resolve with the existing access status.
6927     *
6928     * **Important:** In order to properly leverage this API, you must set the
6929     * `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your
6930     * app's `Info.plist` file. The values for these keys will be used to populate the
6931     * permission dialogs so that the user will be properly informed as to the purpose
6932     * of the permission request. See Electron Application Distribution for more
6933     * information about how to set these in the context of Electron.
6934     *
6935     * This user consent was not required until macOS 10.14 Mojave, so this method will
6936     * always return `true` if your system is running 10.13 High Sierra or lower.
6937     *
6938     * @platform darwin
6939     */
6940    askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise<boolean>;
6941    /**
6942     * whether or not this device has the ability to use Touch ID.
6943     *
6944     * **NOTE:** This API will return `false` on macOS systems older than Sierra
6945     * 10.12.2.
6946     *
6947     * @platform darwin
6948     */
6949    canPromptTouchID(): boolean;
6950    /**
6951     * The users current system wide accent color preference in RGBA hexadecimal form.
6952     *
6953This API is only available on macOS 10.14 Mojave or newer.
6954     *
6955     * @platform win32,darwin
6956     */
6957    getAccentColor(): string;
6958    /**
6959     * * `shouldRenderRichAnimation` Boolean - Returns true if rich animations should
6960     * be rendered. Looks at session type (e.g. remote desktop) and accessibility
6961     * settings to give guidance for heavy animations.
6962     * * `scrollAnimationsEnabledBySystem` Boolean - Determines on a per-platform basis
6963     * whether scroll animations (e.g. produced by home/end key) should be enabled.
6964     * * `prefersReducedMotion` Boolean - Determines whether the user desires reduced
6965     * motion based on platform APIs.
6966     *
6967Returns an object with system animation settings.
6968     */
6969    getAnimationSettings(): AnimationSettings;
6970    /**
6971     * | `null` - Can be `dark`, `light` or `unknown`.
6972     *
6973     * Gets the macOS appearance setting that you have declared you want for your
6974     * application, maps to NSApplication.appearance. You can use the
6975     * `setAppLevelAppearance` API to set this value.
6976
6977**Deprecated**
6978     *
6979     * @deprecated
6980     * @platform darwin
6981     */
6982    getAppLevelAppearance(): ('dark' | 'light' | 'unknown');
6983    /**
6984     * The system color setting in RGB hexadecimal form (`#ABCDEF`). See the Windows
6985     * docs and the MacOS docs for more details.
6986     *
6987     * The following colors are only available on macOS 10.14: `find-highlight`,
6988     * `selected-content-background`, `separator`,
6989     * `unemphasized-selected-content-background`,
6990     * `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
6991     *
6992     * @platform win32,darwin
6993     */
6994    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;
6995    /**
6996     * Can be `dark`, `light` or `unknown`.
6997     *
6998     * Gets the macOS appearance setting that is currently applied to your application,
6999     * maps to NSApplication.effectiveAppearance
7000
7001**Deprecated**
7002     *
7003     * @platform darwin
7004     */
7005    getEffectiveAppearance(): ('dark' | 'light' | 'unknown');
7006    /**
7007     * Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
7008     *
7009     * This user consent was not required on macOS 10.13 High Sierra or lower so this
7010     * method will always return `granted`. macOS 10.14 Mojave or higher requires
7011     * consent for `microphone` and `camera` access. macOS 10.15 Catalina or higher
7012     * requires consent for `screen` access.
7013     *
7014     * @platform darwin
7015     */
7016    getMediaAccessStatus(mediaType: 'microphone' | 'camera' | 'screen'): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown');
7017    /**
7018     * The standard system color formatted as `#RRGGBBAA`.
7019     *
7020     * Returns one of several standard system colors that automatically adapt to
7021     * vibrancy and changes in accessibility settings like 'Increase contrast' and
7022     * 'Reduce transparency'. See Apple Documentation for  more details.
7023     *
7024     * @platform darwin
7025     */
7026    getSystemColor(color: 'blue' | 'brown' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow'): string;
7027    /**
7028     * The value of `key` in `NSUserDefaults`.
7029     *
7030     * Some popular `key` and `type`s are:
7031     *
7032     * * `AppleInterfaceStyle`: `string`
7033     * * `AppleAquaColorVariant`: `integer`
7034     * * `AppleHighlightColor`: `string`
7035     * * `AppleShowScrollBars`: `string`
7036     * * `NSNavRecentPlaces`: `array`
7037     * * `NSPreferredWebServices`: `dictionary`
7038     * * `NSUserDictionaryReplacementItems`: `array`
7039     *
7040     * @platform darwin
7041     */
7042    getUserDefault(key: string, type: 'string' | 'boolean' | 'integer' | 'float' | 'double' | 'url' | 'array' | 'dictionary'): any;
7043    /**
7044     * `true` if DWM composition (Aero Glass) is enabled, and `false` otherwise.
7045     *
7046     * An example of using it to determine if you should create a transparent window or
7047     * not (transparent windows won't work correctly when DWM composition is disabled):
7048     *
7049     * @platform win32
7050     */
7051    isAeroGlassEnabled(): boolean;
7052    /**
7053     * Whether the system is in Dark Mode.
7054     *
7055     * **Note:** On macOS 10.15 Catalina in order for this API to return the correct
7056     * value when in the "automatic" dark mode setting you must either have
7057     * `NSRequiresAquaSystemAppearance=false` in your `Info.plist` or be on Electron
7058     * `>=7.0.0`.  See the dark mode guide for more information.
7059     *
7060**Deprecated:** Should use the new `nativeTheme.shouldUseDarkColors` API.
7061     *
7062     * @deprecated
7063     * @platform darwin,win32
7064     */
7065    isDarkMode(): boolean;
7066    /**
7067     * `true` if a high contrast theme is active, `false` otherwise.
7068     *
7069     * **Depreacted:** Should use the new `nativeTheme.shouldUseHighContrastColors`
7070     * API.
7071     *
7072     * @deprecated
7073     * @platform darwin,win32
7074     */
7075    isHighContrastColorScheme(): boolean;
7076    /**
7077     * `true` if an inverted color scheme (a high contrast color scheme with light text
7078     * and dark backgrounds) is active, `false` otherwise.
7079     *
7080     * **Deprecated:** Should use the new `nativeTheme.shouldUseInvertedColorScheme`
7081     * API.
7082     *
7083     * @deprecated
7084     * @platform win32
7085     */
7086    isInvertedColorScheme(): boolean;
7087    /**
7088     * Whether the Swipe between pages setting is on.
7089     *
7090     * @platform darwin
7091     */
7092    isSwipeTrackingFromScrollEventsEnabled(): boolean;
7093    /**
7094     * `true` if the current process is a trusted accessibility client and `false` if
7095     * it is not.
7096     *
7097     * @platform darwin
7098     */
7099    isTrustedAccessibilityClient(prompt: boolean): boolean;
7100    /**
7101     * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
7102     * contains the user information dictionary sent along with the notification.
7103     *
7104     * @platform darwin
7105     */
7106    postLocalNotification(event: string, userInfo: Record<string, any>): void;
7107    /**
7108     * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
7109     * contains the user information dictionary sent along with the notification.
7110     *
7111     * @platform darwin
7112     */
7113    postNotification(event: string, userInfo: Record<string, any>, deliverImmediately?: boolean): void;
7114    /**
7115     * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
7116     * contains the user information dictionary sent along with the notification.
7117     *
7118     * @platform darwin
7119     */
7120    postWorkspaceNotification(event: string, userInfo: Record<string, any>): void;
7121    /**
7122     * resolves if the user has successfully authenticated with Touch ID.
7123     *
7124     * This API itself will not protect your user data; rather, it is a mechanism to
7125     * allow you to do so. Native apps will need to set Access Control Constants like
7126     * `kSecAccessControlUserPresence` on the their keychain entry so that reading it
7127     * would auto-prompt for Touch ID biometric consent. This could be done with
7128     * `node-keytar`, such that one would store an encryption key with `node-keytar`
7129     * and only fetch it if `promptTouchID()` resolves.
7130     *
7131     * **NOTE:** This API will return a rejected Promise on macOS systems older than
7132     * Sierra 10.12.2.
7133     *
7134     * @platform darwin
7135     */
7136    promptTouchID(reason: string): Promise<void>;
7137    /**
7138     * Add the specified defaults to your application's `NSUserDefaults`.
7139     *
7140     * @platform darwin
7141     */
7142    registerDefaults(defaults: Record<string, (string) | (boolean) | (number)>): void;
7143    /**
7144     * Removes the `key` in `NSUserDefaults`. This can be used to restore the default
7145     * or global value of a `key` previously set with `setUserDefault`.
7146     *
7147     * @platform darwin
7148     */
7149    removeUserDefault(key: string): void;
7150    /**
7151     * Sets the appearance setting for your application, this should override the
7152     * system default and override the value of `getEffectiveAppearance`.
7153     *
7154**Deprecated**
7155     *
7156     * @deprecated
7157     * @platform darwin
7158     */
7159    setAppLevelAppearance(appearance: (('dark' | 'light')) | (null)): void;
7160    /**
7161     * Set the value of `key` in `NSUserDefaults`.
7162     *
7163     * Note that `type` should match actual type of `value`. An exception is thrown if
7164     * they don't.
7165     *
7166Some popular `key` and `type`s are:
7167
7168* `ApplePressAndHoldEnabled`: `boolean`
7169     *
7170     * @platform darwin
7171     */
7172    setUserDefault(key: string, type: string, value: string): void;
7173    /**
7174     * The ID of this subscription
7175     *
7176     * Same as `subscribeNotification`, but uses `NSNotificationCenter` for local
7177     * defaults. This is necessary for events such as
7178     * `NSUserDefaultsDidChangeNotification`.
7179     *
7180     * @platform darwin
7181     */
7182    subscribeLocalNotification(event: string, callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
7183    /**
7184     * The ID of this subscription
7185     *
7186     * Subscribes to native notifications of macOS, `callback` will be called with
7187     * `callback(event, userInfo)` when the corresponding `event` happens. The
7188     * `userInfo` is an Object that contains the user information dictionary sent along
7189     * with the notification. The `object` is the sender of the notification, and only
7190     * supports `NSString` values for now.
7191     *
7192     * The `id` of the subscriber is returned, which can be used to unsubscribe the
7193     * `event`.
7194     *
7195     * Under the hood this API subscribes to `NSDistributedNotificationCenter`, example
7196     * values of `event` are:
7197     *
7198     * * `AppleInterfaceThemeChangedNotification`
7199     * * `AppleAquaColorVariantChanged`
7200     * * `AppleColorPreferencesChangedNotification`
7201     * * `AppleShowScrollBarsSettingChanged`
7202     *
7203     * @platform darwin
7204     */
7205    subscribeNotification(event: string, callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
7206    /**
7207     * Same as `subscribeNotification`, but uses
7208     * `NSWorkspace.sharedWorkspace.notificationCenter`. This is necessary for events
7209     * such as `NSWorkspaceDidActivateApplicationNotification`.
7210     *
7211     * @platform darwin
7212     */
7213    subscribeWorkspaceNotification(event: string, callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): void;
7214    /**
7215     * Same as `unsubscribeNotification`, but removes the subscriber from
7216     * `NSNotificationCenter`.
7217     *
7218     * @platform darwin
7219     */
7220    unsubscribeLocalNotification(id: number): void;
7221    /**
7222     * Removes the subscriber with `id`.
7223     *
7224     * @platform darwin
7225     */
7226    unsubscribeNotification(id: number): void;
7227    /**
7228     * Same as `unsubscribeNotification`, but removes the subscriber from
7229     * `NSWorkspace.sharedWorkspace.notificationCenter`.
7230     *
7231     * @platform darwin
7232     */
7233    unsubscribeWorkspaceNotification(id: number): void;
7234    /**
7235     * A `String` property that can be `dark`, `light` or `unknown`. It determines the
7236     * macOS appearance setting for your application. This maps to values in:
7237     * NSApplication.appearance. Setting this will override the system default as well
7238     * as the value of `getEffectiveAppearance`.
7239     *
7240     * Possible values that can be set are `dark` and `light`, and possible return
7241     * values are `dark`, `light`, and `unknown`.
7242     *
7243This property is only available on macOS 10.14 Mojave or newer.
7244     *
7245     * @platform darwin
7246     */
7247    appLevelAppearance: ('dark' | 'light' | 'unknown');
7248    /**
7249     * A `String` property that can be `dark`, `light` or `unknown`.
7250     *
7251     * Returns the macOS appearance setting that is currently applied to your
7252     * application, maps to NSApplication.effectiveAppearance
7253     *
7254     * @platform darwin
7255     */
7256    readonly effectiveAppearance: ('dark' | 'light' | 'unknown');
7257  }
7258
7259  interface Task {
7260
7261    // Docs: http://electronjs.org/docs/api/structures/task
7262
7263    /**
7264     * The command line arguments when `program` is executed.
7265     */
7266    arguments: string;
7267    /**
7268     * Description of this task.
7269     */
7270    description: string;
7271    /**
7272     * The icon index in the icon file. If an icon file consists of two or more icons,
7273     * set this value to identify the icon. If an icon file consists of one icon, this
7274     * value is 0.
7275     */
7276    iconIndex: number;
7277    /**
7278     * The absolute path to an icon to be displayed in a JumpList, which can be an
7279     * arbitrary resource file that contains an icon. You can usually specify
7280     * `process.execPath` to show the icon of the program.
7281     */
7282    iconPath: string;
7283    /**
7284     * Path of the program to execute, usually you should specify `process.execPath`
7285     * which opens the current program.
7286     */
7287    program: string;
7288    /**
7289     * The string to be displayed in a JumpList.
7290     */
7291    title: string;
7292    /**
7293     * The working directory. Default is empty.
7294     */
7295    workingDirectory?: string;
7296  }
7297
7298  interface ThumbarButton {
7299
7300    // Docs: http://electronjs.org/docs/api/structures/thumbar-button
7301
7302    click: Function;
7303    /**
7304     * Control specific states and behaviors of the button. By default, it is
7305     * `['enabled']`.
7306     */
7307    flags?: string[];
7308    /**
7309     * The icon showing in thumbnail toolbar.
7310     */
7311    icon: NativeImage;
7312    /**
7313     * The text of the button's tooltip.
7314     */
7315    tooltip?: string;
7316  }
7317
7318  class TouchBar {
7319
7320    // Docs: http://electronjs.org/docs/api/touch-bar
7321
7322    /**
7323     * TouchBar
7324     */
7325    constructor(options: TouchBarConstructorOptions);
7326    escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null);
7327    static TouchBarButton: typeof TouchBarButton;
7328    static TouchBarColorPicker: typeof TouchBarColorPicker;
7329    static TouchBarGroup: typeof TouchBarGroup;
7330    static TouchBarLabel: typeof TouchBarLabel;
7331    static TouchBarPopover: typeof TouchBarPopover;
7332    static TouchBarScrubber: typeof TouchBarScrubber;
7333    static TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
7334    static TouchBarSlider: typeof TouchBarSlider;
7335    static TouchBarSpacer: typeof TouchBarSpacer;
7336  }
7337
7338  class TouchBarButton {
7339
7340    // Docs: http://electronjs.org/docs/api/touch-bar-button
7341
7342    /**
7343     * TouchBarButton
7344     */
7345    constructor(options: TouchBarButtonConstructorOptions);
7346    accessibilityLabel: string;
7347    backgroundColor: string;
7348    icon: NativeImage;
7349    label: string;
7350  }
7351
7352  class TouchBarColorPicker extends NodeJS.EventEmitter {
7353
7354    // Docs: http://electronjs.org/docs/api/touch-bar-color-picker
7355
7356    /**
7357     * TouchBarColorPicker
7358     */
7359    constructor(options: TouchBarColorPickerConstructorOptions);
7360    availableColors: string[];
7361    selectedColor: string;
7362  }
7363
7364  class TouchBarGroup extends NodeJS.EventEmitter {
7365
7366    // Docs: http://electronjs.org/docs/api/touch-bar-group
7367
7368    /**
7369     * TouchBarGroup
7370     */
7371    constructor(options: TouchBarGroupConstructorOptions);
7372  }
7373
7374  class TouchBarLabel extends NodeJS.EventEmitter {
7375
7376    // Docs: http://electronjs.org/docs/api/touch-bar-label
7377
7378    /**
7379     * TouchBarLabel
7380     */
7381    constructor(options: TouchBarLabelConstructorOptions);
7382    accessibilityLabel: string;
7383    label: string;
7384    textColor: string;
7385  }
7386
7387  class TouchBarPopover extends NodeJS.EventEmitter {
7388
7389    // Docs: http://electronjs.org/docs/api/touch-bar-popover
7390
7391    /**
7392     * TouchBarPopover
7393     */
7394    constructor(options: TouchBarPopoverConstructorOptions);
7395    icon: NativeImage;
7396    label: string;
7397  }
7398
7399  class TouchBarScrubber extends NodeJS.EventEmitter {
7400
7401    // Docs: http://electronjs.org/docs/api/touch-bar-scrubber
7402
7403    /**
7404     * TouchBarScrubber
7405     */
7406    constructor(options: TouchBarScrubberConstructorOptions);
7407    continuous: boolean;
7408    items: ScrubberItem[];
7409    mode: ('fixed' | 'free');
7410    overlayStyle: ('background' | 'outline' | 'none');
7411    selectedStyle: ('background' | 'outline' | 'none');
7412    showArrowButtons: boolean;
7413  }
7414
7415  class TouchBarSegmentedControl extends NodeJS.EventEmitter {
7416
7417    // Docs: http://electronjs.org/docs/api/touch-bar-segmented-control
7418
7419    /**
7420     * TouchBarSegmentedControl
7421     */
7422    constructor(options: TouchBarSegmentedControlConstructorOptions);
7423    segments: SegmentedControlSegment[];
7424    segmentStyle: string;
7425    selectedIndex: number;
7426  }
7427
7428  class TouchBarSlider extends NodeJS.EventEmitter {
7429
7430    // Docs: http://electronjs.org/docs/api/touch-bar-slider
7431
7432    /**
7433     * TouchBarSlider
7434     */
7435    constructor(options: TouchBarSliderConstructorOptions);
7436    label: string;
7437    maxValue: number;
7438    minValue: number;
7439    value: number;
7440  }
7441
7442  class TouchBarSpacer extends NodeJS.EventEmitter {
7443
7444    // Docs: http://electronjs.org/docs/api/touch-bar-spacer
7445
7446    /**
7447     * TouchBarSpacer
7448     */
7449    constructor(options: TouchBarSpacerConstructorOptions);
7450  }
7451
7452  interface TraceCategoriesAndOptions {
7453
7454    // Docs: http://electronjs.org/docs/api/structures/trace-categories-and-options
7455
7456    /**
7457     * A filter to control what category groups should be traced. A filter can have an
7458     * optional '-' prefix to exclude category groups that contain a matching category.
7459     * Having both included and excluded category patterns in the same list is not
7460     * supported. Examples: `test_MyTest*`, `test_MyTest*,test_OtherStuff`,
7461     * `-excluded_category1,-excluded_category2`.
7462     */
7463    categoryFilter: string;
7464    /**
7465     * Controls what kind of tracing is enabled, it is a comma-delimited sequence of
7466     * the following strings: `record-until-full`, `record-continuously`,
7467     * `trace-to-console`, `enable-sampling`, `enable-systrace`, e.g.
7468     * `'record-until-full,enable-sampling'`. The first 3 options are trace recording
7469     * modes and hence mutually exclusive. If more than one trace recording modes
7470     * appear in the `traceOptions` string, the last one takes precedence. If none of
7471     * the trace recording modes are specified, recording mode is `record-until-full`.
7472     * The trace option will first be reset to the default option (`record_mode` set to
7473     * `record-until-full`, `enable_sampling` and `enable_systrace` set to `false`)
7474     * before options parsed from `traceOptions` are applied on it.
7475     */
7476    traceOptions: string;
7477  }
7478
7479  interface TraceConfig {
7480
7481    // Docs: http://electronjs.org/docs/api/structures/trace-config
7482
7483    /**
7484     * if true, filter event data according to a whitelist of events that have been
7485     * manually vetted to not include any PII. See the implementation in Chromium for
7486     * specifics.
7487     */
7488    enable_argument_filter?: boolean;
7489    /**
7490     * a list of tracing categories to exclude. Can include glob-like patterns using
7491     * `*` at the end of the category name. See tracing categories for the list of
7492     * categories.
7493     */
7494    excluded_categories?: string[];
7495    /**
7496     * a list of histogram names to report with the trace.
7497     */
7498    histogram_names?: string[];
7499    /**
7500     * a list of tracing categories to include. Can include glob-like patterns using
7501     * `*` at the end of the category name. See tracing categories for the list of
7502     * categories.
7503     */
7504    included_categories?: string[];
7505    /**
7506     * a list of process IDs to include in the trace. If not specified, trace all
7507     * processes.
7508     */
7509    included_process_ids?: number[];
7510    /**
7511     * if the `disabled-by-default-memory-infra` category is enabled, this contains
7512     * optional additional configuration for data collection. See the Chromium
7513     * memory-infra docs for more information.
7514     */
7515    memory_dump_config?: Record<string, any>;
7516    /**
7517     * Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible`
7518     * or `trace-to-console`. Defaults to `record-until-full`.
7519     */
7520    recording_mode?: ('record-until-full' | 'record-continuously' | 'record-as-much-as-possible' | 'trace-to-console');
7521    /**
7522     * maximum size of the trace recording buffer in events.
7523     */
7524    trace_buffer_size_in_events?: number;
7525    /**
7526     * maximum size of the trace recording buffer in kilobytes. Defaults to 100MB.
7527     */
7528    trace_buffer_size_in_kb?: number;
7529  }
7530
7531  interface Transaction {
7532
7533    // Docs: http://electronjs.org/docs/api/structures/transaction
7534
7535    /**
7536     * The error code if an error occurred while processing the transaction.
7537     */
7538    errorCode: number;
7539    /**
7540     * The error message if an error occurred while processing the transaction.
7541     */
7542    errorMessage: string;
7543    /**
7544     * The identifier of the restored transaction by the App Store.
7545     */
7546    originalTransactionIdentifier: string;
7547    payment: Payment;
7548    /**
7549     * The date the transaction was added to the App Store’s payment queue.
7550     */
7551    transactionDate: string;
7552    /**
7553     * A string that uniquely identifies a successful payment transaction.
7554     */
7555    transactionIdentifier: string;
7556    /**
7557     * The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or
7558     * `deferred`.
7559     */
7560    transactionState: ('purchasing' | 'purchased' | 'failed' | 'restored' | 'deferred');
7561  }
7562
7563  class Tray extends NodeJS.EventEmitter {
7564
7565    // Docs: http://electronjs.org/docs/api/tray
7566
7567    /**
7568     * Emitted when the tray balloon is clicked.
7569     *
7570     * @platform win32
7571     */
7572    on(event: 'balloon-click', listener: Function): this;
7573    once(event: 'balloon-click', listener: Function): this;
7574    addListener(event: 'balloon-click', listener: Function): this;
7575    removeListener(event: 'balloon-click', listener: Function): this;
7576    /**
7577     * Emitted when the tray balloon is closed because of timeout or user manually
7578     * closes it.
7579     *
7580     * @platform win32
7581     */
7582    on(event: 'balloon-closed', listener: Function): this;
7583    once(event: 'balloon-closed', listener: Function): this;
7584    addListener(event: 'balloon-closed', listener: Function): this;
7585    removeListener(event: 'balloon-closed', listener: Function): this;
7586    /**
7587     * Emitted when the tray balloon shows.
7588     *
7589     * @platform win32
7590     */
7591    on(event: 'balloon-show', listener: Function): this;
7592    once(event: 'balloon-show', listener: Function): this;
7593    addListener(event: 'balloon-show', listener: Function): this;
7594    removeListener(event: 'balloon-show', listener: Function): this;
7595    /**
7596     * Emitted when the tray icon is clicked.
7597     */
7598    on(event: 'click', listener: (event: KeyboardEvent,
7599                                  /**
7600                                   * The bounds of tray icon.
7601                                   */
7602                                  bounds: Rectangle,
7603                                  /**
7604                                   * The position of the event.
7605                                   */
7606                                  position: Point) => void): this;
7607    once(event: 'click', listener: (event: KeyboardEvent,
7608                                  /**
7609                                   * The bounds of tray icon.
7610                                   */
7611                                  bounds: Rectangle,
7612                                  /**
7613                                   * The position of the event.
7614                                   */
7615                                  position: Point) => void): this;
7616    addListener(event: 'click', listener: (event: KeyboardEvent,
7617                                  /**
7618                                   * The bounds of tray icon.
7619                                   */
7620                                  bounds: Rectangle,
7621                                  /**
7622                                   * The position of the event.
7623                                   */
7624                                  position: Point) => void): this;
7625    removeListener(event: 'click', listener: (event: KeyboardEvent,
7626                                  /**
7627                                   * The bounds of tray icon.
7628                                   */
7629                                  bounds: Rectangle,
7630                                  /**
7631                                   * The position of the event.
7632                                   */
7633                                  position: Point) => void): this;
7634    /**
7635     * Emitted when the tray icon is double clicked.
7636     *
7637     * @platform darwin,win32
7638     */
7639    on(event: 'double-click', listener: (event: KeyboardEvent,
7640                                         /**
7641                                          * The bounds of tray icon.
7642                                          */
7643                                         bounds: Rectangle) => void): this;
7644    once(event: 'double-click', listener: (event: KeyboardEvent,
7645                                         /**
7646                                          * The bounds of tray icon.
7647                                          */
7648                                         bounds: Rectangle) => void): this;
7649    addListener(event: 'double-click', listener: (event: KeyboardEvent,
7650                                         /**
7651                                          * The bounds of tray icon.
7652                                          */
7653                                         bounds: Rectangle) => void): this;
7654    removeListener(event: 'double-click', listener: (event: KeyboardEvent,
7655                                         /**
7656                                          * The bounds of tray icon.
7657                                          */
7658                                         bounds: Rectangle) => void): this;
7659    /**
7660     * Emitted when a drag operation ends on the tray or ends at another location.
7661     *
7662     * @platform darwin
7663     */
7664    on(event: 'drag-end', listener: Function): this;
7665    once(event: 'drag-end', listener: Function): this;
7666    addListener(event: 'drag-end', listener: Function): this;
7667    removeListener(event: 'drag-end', listener: Function): this;
7668    /**
7669     * Emitted when a drag operation enters the tray icon.
7670     *
7671     * @platform darwin
7672     */
7673    on(event: 'drag-enter', listener: Function): this;
7674    once(event: 'drag-enter', listener: Function): this;
7675    addListener(event: 'drag-enter', listener: Function): this;
7676    removeListener(event: 'drag-enter', listener: Function): this;
7677    /**
7678     * Emitted when a drag operation exits the tray icon.
7679     *
7680     * @platform darwin
7681     */
7682    on(event: 'drag-leave', listener: Function): this;
7683    once(event: 'drag-leave', listener: Function): this;
7684    addListener(event: 'drag-leave', listener: Function): this;
7685    removeListener(event: 'drag-leave', listener: Function): this;
7686    /**
7687     * Emitted when any dragged items are dropped on the tray icon.
7688     *
7689     * @platform darwin
7690     */
7691    on(event: 'drop', listener: Function): this;
7692    once(event: 'drop', listener: Function): this;
7693    addListener(event: 'drop', listener: Function): this;
7694    removeListener(event: 'drop', listener: Function): this;
7695    /**
7696     * Emitted when dragged files are dropped in the tray icon.
7697     *
7698     * @platform darwin
7699     */
7700    on(event: 'drop-files', listener: (event: Event,
7701                                       /**
7702                                        * The paths of the dropped files.
7703                                        */
7704                                       files: string[]) => void): this;
7705    once(event: 'drop-files', listener: (event: Event,
7706                                       /**
7707                                        * The paths of the dropped files.
7708                                        */
7709                                       files: string[]) => void): this;
7710    addListener(event: 'drop-files', listener: (event: Event,
7711                                       /**
7712                                        * The paths of the dropped files.
7713                                        */
7714                                       files: string[]) => void): this;
7715    removeListener(event: 'drop-files', listener: (event: Event,
7716                                       /**
7717                                        * The paths of the dropped files.
7718                                        */
7719                                       files: string[]) => void): this;
7720    /**
7721     * Emitted when dragged text is dropped in the tray icon.
7722     *
7723     * @platform darwin
7724     */
7725    on(event: 'drop-text', listener: (event: Event,
7726                                      /**
7727                                       * the dropped text string.
7728                                       */
7729                                      text: string) => void): this;
7730    once(event: 'drop-text', listener: (event: Event,
7731                                      /**
7732                                       * the dropped text string.
7733                                       */
7734                                      text: string) => void): this;
7735    addListener(event: 'drop-text', listener: (event: Event,
7736                                      /**
7737                                       * the dropped text string.
7738                                       */
7739                                      text: string) => void): this;
7740    removeListener(event: 'drop-text', listener: (event: Event,
7741                                      /**
7742                                       * the dropped text string.
7743                                       */
7744                                      text: string) => void): this;
7745    /**
7746     * Emitted when the mouse enters the tray icon.
7747     *
7748     * @platform darwin
7749     */
7750    on(event: 'mouse-enter', listener: (event: KeyboardEvent,
7751                                        /**
7752                                         * The position of the event.
7753                                         */
7754                                        position: Point) => void): this;
7755    once(event: 'mouse-enter', listener: (event: KeyboardEvent,
7756                                        /**
7757                                         * The position of the event.
7758                                         */
7759                                        position: Point) => void): this;
7760    addListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
7761                                        /**
7762                                         * The position of the event.
7763                                         */
7764                                        position: Point) => void): this;
7765    removeListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
7766                                        /**
7767                                         * The position of the event.
7768                                         */
7769                                        position: Point) => void): this;
7770    /**
7771     * Emitted when the mouse exits the tray icon.
7772     *
7773     * @platform darwin
7774     */
7775    on(event: 'mouse-leave', listener: (event: KeyboardEvent,
7776                                        /**
7777                                         * The position of the event.
7778                                         */
7779                                        position: Point) => void): this;
7780    once(event: 'mouse-leave', listener: (event: KeyboardEvent,
7781                                        /**
7782                                         * The position of the event.
7783                                         */
7784                                        position: Point) => void): this;
7785    addListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
7786                                        /**
7787                                         * The position of the event.
7788                                         */
7789                                        position: Point) => void): this;
7790    removeListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
7791                                        /**
7792                                         * The position of the event.
7793                                         */
7794                                        position: Point) => void): this;
7795    /**
7796     * Emitted when the mouse moves in the tray icon.
7797     *
7798     * @platform darwin,win32
7799     */
7800    on(event: 'mouse-move', listener: (event: KeyboardEvent,
7801                                       /**
7802                                        * The position of the event.
7803                                        */
7804                                       position: Point) => void): this;
7805    once(event: 'mouse-move', listener: (event: KeyboardEvent,
7806                                       /**
7807                                        * The position of the event.
7808                                        */
7809                                       position: Point) => void): this;
7810    addListener(event: 'mouse-move', listener: (event: KeyboardEvent,
7811                                       /**
7812                                        * The position of the event.
7813                                        */
7814                                       position: Point) => void): this;
7815    removeListener(event: 'mouse-move', listener: (event: KeyboardEvent,
7816                                       /**
7817                                        * The position of the event.
7818                                        */
7819                                       position: Point) => void): this;
7820    /**
7821     * Emitted when the tray icon is right clicked.
7822     *
7823     * @platform darwin,win32
7824     */
7825    on(event: 'right-click', listener: (event: KeyboardEvent,
7826                                        /**
7827                                         * The bounds of tray icon.
7828                                         */
7829                                        bounds: Rectangle) => void): this;
7830    once(event: 'right-click', listener: (event: KeyboardEvent,
7831                                        /**
7832                                         * The bounds of tray icon.
7833                                         */
7834                                        bounds: Rectangle) => void): this;
7835    addListener(event: 'right-click', listener: (event: KeyboardEvent,
7836                                        /**
7837                                         * The bounds of tray icon.
7838                                         */
7839                                        bounds: Rectangle) => void): this;
7840    removeListener(event: 'right-click', listener: (event: KeyboardEvent,
7841                                        /**
7842                                         * The bounds of tray icon.
7843                                         */
7844                                        bounds: Rectangle) => void): this;
7845    /**
7846     * Tray
7847     */
7848    constructor(image: (NativeImage) | (string));
7849    /**
7850     * Destroys the tray icon immediately.
7851     */
7852    destroy(): void;
7853    /**
7854     * Displays a tray balloon.
7855     *
7856     * @platform win32
7857     */
7858    displayBalloon(options: DisplayBalloonOptions): void;
7859    /**
7860     * Returns focus to the taskbar notification area. Notification area icons should
7861     * use this message when they have completed their UI operation. For example, if
7862     * the icon displays a shortcut menu, but the user presses ESC to cancel it, use
7863     * `tray.focus()` to return focus to the notification area.
7864     *
7865     * @platform win32
7866     */
7867    focus(): void;
7868    /**
7869     * The `bounds` of this tray icon as `Object`.
7870     *
7871     * @platform darwin,win32
7872     */
7873    getBounds(): Rectangle;
7874    /**
7875     * Whether double click events will be ignored.
7876     *
7877     * @platform darwin
7878     */
7879    getIgnoreDoubleClickEvents(): boolean;
7880    /**
7881     * the title displayed next to the tray icon in the status bar
7882     *
7883     * @platform darwin
7884     */
7885    getTitle(): string;
7886    /**
7887     * Whether the tray icon is destroyed.
7888     */
7889    isDestroyed(): boolean;
7890    /**
7891     * Pops up the context menu of the tray icon. When `menu` is passed, the `menu`
7892     * will be shown instead of the tray icon's context menu.
7893     *
7894The `position` is only available on Windows, and it is (0, 0) by default.
7895     *
7896     * @platform darwin,win32
7897     */
7898    popUpContextMenu(menu?: Menu, position?: Point): void;
7899    /**
7900     * Removes a tray balloon.
7901     *
7902     * @platform win32
7903     */
7904    removeBalloon(): void;
7905    /**
7906     * Sets the context menu for this icon.
7907     */
7908    setContextMenu(menu: (Menu) | (null)): void;
7909    /**
7910     * Sets the option to ignore double click events. Ignoring these events allows you
7911     * to detect every individual click of the tray icon.
7912     *
7913This value is set to false by default.
7914     *
7915     * @platform darwin
7916     */
7917    setIgnoreDoubleClickEvents(ignore: boolean): void;
7918    /**
7919     * Sets the `image` associated with this tray icon.
7920     */
7921    setImage(image: (NativeImage) | (string)): void;
7922    /**
7923     * Sets the `image` associated with this tray icon when pressed on macOS.
7924     *
7925     * @platform darwin
7926     */
7927    setPressedImage(image: (NativeImage) | (string)): void;
7928    /**
7929     * Sets the title displayed next to the tray icon in the status bar (Support ANSI
7930     * colors).
7931     *
7932     * @platform darwin
7933     */
7934    setTitle(title: string): void;
7935    /**
7936     * Sets the hover text for this tray icon.
7937     */
7938    setToolTip(toolTip: string): void;
7939  }
7940
7941  interface UploadBlob {
7942
7943    // Docs: http://electronjs.org/docs/api/structures/upload-blob
7944
7945    /**
7946     * UUID of blob data to upload.
7947     */
7948    blobUUID: string;
7949    /**
7950     * `blob`.
7951     */
7952    type: string;
7953  }
7954
7955  interface UploadData {
7956
7957    // Docs: http://electronjs.org/docs/api/structures/upload-data
7958
7959    /**
7960     * UUID of blob data. Use ses.getBlobData method to retrieve the data.
7961     */
7962    blobUUID?: string;
7963    /**
7964     * Content being sent.
7965     */
7966    bytes: Buffer;
7967    /**
7968     * Path of file being uploaded.
7969     */
7970    file?: string;
7971  }
7972
7973  interface UploadFile {
7974
7975    // Docs: http://electronjs.org/docs/api/structures/upload-file
7976
7977    /**
7978     * Path of file to be uploaded.
7979     */
7980    filePath: string;
7981    /**
7982     * Number of bytes to read from `offset`. Defaults to `0`.
7983     */
7984    length: number;
7985    /**
7986     * Last Modification time in number of seconds since the UNIX epoch.
7987     */
7988    modificationTime: number;
7989    /**
7990     * Defaults to `0`.
7991     */
7992    offset: number;
7993    /**
7994     * `file`.
7995     */
7996    type: string;
7997  }
7998
7999  interface UploadRawData {
8000
8001    // Docs: http://electronjs.org/docs/api/structures/upload-raw-data
8002
8003    /**
8004     * Data to be uploaded.
8005     */
8006    bytes: Buffer;
8007    /**
8008     * `rawData`.
8009     */
8010    type: string;
8011  }
8012
8013  class WebContents extends NodeJS.EventEmitter {
8014
8015    // Docs: http://electronjs.org/docs/api/web-contents
8016
8017    /**
8018     * A WebContents instance with the given ID.
8019     */
8020    static fromId(id: number): WebContents;
8021    /**
8022     * An array of all `WebContents` instances. This will contain web contents for all
8023     * windows, webviews, opened devtools, and devtools extension background pages.
8024     */
8025    static getAllWebContents(): WebContents[];
8026    /**
8027     * The web contents that is focused in this application, otherwise returns `null`.
8028     */
8029    static getFocusedWebContents(): WebContents;
8030    /**
8031     * Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
8032     * `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
8033     * menu shortcuts.
8034     *
8035To only prevent the menu shortcuts, use `setIgnoreMenuShortcuts`:
8036     */
8037    on(event: 'before-input-event', listener: (event: Event,
8038                                               /**
8039                                                * Input properties.
8040                                                */
8041                                               input: Input) => void): this;
8042    once(event: 'before-input-event', listener: (event: Event,
8043                                               /**
8044                                                * Input properties.
8045                                                */
8046                                               input: Input) => void): this;
8047    addListener(event: 'before-input-event', listener: (event: Event,
8048                                               /**
8049                                                * Input properties.
8050                                                */
8051                                               input: Input) => void): this;
8052    removeListener(event: 'before-input-event', listener: (event: Event,
8053                                               /**
8054                                                * Input properties.
8055                                                */
8056                                               input: Input) => void): this;
8057    /**
8058     * Emitted when failed to verify the `certificate` for `url`.
8059     *
8060The usage is the same with the `certificate-error` event of `app`.
8061     */
8062    on(event: 'certificate-error', listener: (event: Event,
8063                                              url: string,
8064                                              /**
8065                                               * The error code.
8066                                               */
8067                                              error: string,
8068                                              certificate: Certificate,
8069                                              callback: (isTrusted: boolean) => void) => void): this;
8070    once(event: 'certificate-error', listener: (event: Event,
8071                                              url: string,
8072                                              /**
8073                                               * The error code.
8074                                               */
8075                                              error: string,
8076                                              certificate: Certificate,
8077                                              callback: (isTrusted: boolean) => void) => void): this;
8078    addListener(event: 'certificate-error', listener: (event: Event,
8079                                              url: string,
8080                                              /**
8081                                               * The error code.
8082                                               */
8083                                              error: string,
8084                                              certificate: Certificate,
8085                                              callback: (isTrusted: boolean) => void) => void): this;
8086    removeListener(event: 'certificate-error', listener: (event: Event,
8087                                              url: string,
8088                                              /**
8089                                               * The error code.
8090                                               */
8091                                              error: string,
8092                                              certificate: Certificate,
8093                                              callback: (isTrusted: boolean) => void) => void): this;
8094    /**
8095     * Emitted when the associated window logs a console message.
8096     */
8097    on(event: 'console-message', listener: (event: Event,
8098                                            level: number,
8099                                            message: string,
8100                                            line: number,
8101                                            sourceId: string) => void): this;
8102    once(event: 'console-message', listener: (event: Event,
8103                                            level: number,
8104                                            message: string,
8105                                            line: number,
8106                                            sourceId: string) => void): this;
8107    addListener(event: 'console-message', listener: (event: Event,
8108                                            level: number,
8109                                            message: string,
8110                                            line: number,
8111                                            sourceId: string) => void): this;
8112    removeListener(event: 'console-message', listener: (event: Event,
8113                                            level: number,
8114                                            message: string,
8115                                            line: number,
8116                                            sourceId: string) => void): this;
8117    /**
8118     * Emitted when there is a new context menu that needs to be handled.
8119     */
8120    on(event: 'context-menu', listener: (event: Event,
8121                                         params: ContextMenuParams) => void): this;
8122    once(event: 'context-menu', listener: (event: Event,
8123                                         params: ContextMenuParams) => void): this;
8124    addListener(event: 'context-menu', listener: (event: Event,
8125                                         params: ContextMenuParams) => void): this;
8126    removeListener(event: 'context-menu', listener: (event: Event,
8127                                         params: ContextMenuParams) => void): this;
8128    /**
8129     * Emitted when the renderer process crashes or is killed.
8130     */
8131    on(event: 'crashed', listener: (event: Event,
8132                                    killed: boolean) => void): this;
8133    once(event: 'crashed', listener: (event: Event,
8134                                    killed: boolean) => void): this;
8135    addListener(event: 'crashed', listener: (event: Event,
8136                                    killed: boolean) => void): this;
8137    removeListener(event: 'crashed', listener: (event: Event,
8138                                    killed: boolean) => void): this;
8139    /**
8140     * Emitted when the cursor's type changes. The `type` parameter can be `default`,
8141     * `crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
8142     * `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`,
8143     * `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`,
8144     * `row-resize`, `m-panning`, `e-panning`, `n-panning`, `ne-panning`, `nw-panning`,
8145     * `s-panning`, `se-panning`, `sw-panning`, `w-panning`, `move`, `vertical-text`,
8146     * `cell`, `context-menu`, `alias`, `progress`, `nodrop`, `copy`, `none`,
8147     * `not-allowed`, `zoom-in`, `zoom-out`, `grab`, `grabbing` or `custom`.
8148     *
8149     * If the `type` parameter is `custom`, the `image` parameter will hold the custom
8150     * cursor image in a `NativeImage`, and `scale`, `size` and `hotspot` will hold
8151     * additional information about the custom cursor.
8152     */
8153    on(event: 'cursor-changed', listener: (event: Event,
8154                                           type: string,
8155                                           image: NativeImage,
8156                                           /**
8157                                            * scaling factor for the custom cursor.
8158                                            */
8159                                           scale: number,
8160                                           /**
8161                                            * the size of the `image`.
8162                                            */
8163                                           size: Size,
8164                                           /**
8165                                            * coordinates of the custom cursor's hotspot.
8166                                            */
8167                                           hotspot: Point) => void): this;
8168    once(event: 'cursor-changed', listener: (event: Event,
8169                                           type: string,
8170                                           image: NativeImage,
8171                                           /**
8172                                            * scaling factor for the custom cursor.
8173                                            */
8174                                           scale: number,
8175                                           /**
8176                                            * the size of the `image`.
8177                                            */
8178                                           size: Size,
8179                                           /**
8180                                            * coordinates of the custom cursor's hotspot.
8181                                            */
8182                                           hotspot: Point) => void): this;
8183    addListener(event: 'cursor-changed', listener: (event: Event,
8184                                           type: string,
8185                                           image: NativeImage,
8186                                           /**
8187                                            * scaling factor for the custom cursor.
8188                                            */
8189                                           scale: number,
8190                                           /**
8191                                            * the size of the `image`.
8192                                            */
8193                                           size: Size,
8194                                           /**
8195                                            * coordinates of the custom cursor's hotspot.
8196                                            */
8197                                           hotspot: Point) => void): this;
8198    removeListener(event: 'cursor-changed', listener: (event: Event,
8199                                           type: string,
8200                                           image: NativeImage,
8201                                           /**
8202                                            * scaling factor for the custom cursor.
8203                                            */
8204                                           scale: number,
8205                                           /**
8206                                            * the size of the `image`.
8207                                            */
8208                                           size: Size,
8209                                           /**
8210                                            * coordinates of the custom cursor's hotspot.
8211                                            */
8212                                           hotspot: Point) => void): this;
8213    /**
8214     * Emitted when `desktopCapturer.getSources()` is called in the renderer process.
8215     * Calling `event.preventDefault()` will make it return empty sources.
8216     */
8217    on(event: 'desktop-capturer-get-sources', listener: (event: Event) => void): this;
8218    once(event: 'desktop-capturer-get-sources', listener: (event: Event) => void): this;
8219    addListener(event: 'desktop-capturer-get-sources', listener: (event: Event) => void): this;
8220    removeListener(event: 'desktop-capturer-get-sources', listener: (event: Event) => void): this;
8221    /**
8222     * Emitted when `webContents` is destroyed.
8223     */
8224    on(event: 'destroyed', listener: Function): this;
8225    once(event: 'destroyed', listener: Function): this;
8226    addListener(event: 'destroyed', listener: Function): this;
8227    removeListener(event: 'destroyed', listener: Function): this;
8228    /**
8229     * Emitted when DevTools is closed.
8230     */
8231    on(event: 'devtools-closed', listener: Function): this;
8232    once(event: 'devtools-closed', listener: Function): this;
8233    addListener(event: 'devtools-closed', listener: Function): this;
8234    removeListener(event: 'devtools-closed', listener: Function): this;
8235    /**
8236     * Emitted when DevTools is focused / opened.
8237     */
8238    on(event: 'devtools-focused', listener: Function): this;
8239    once(event: 'devtools-focused', listener: Function): this;
8240    addListener(event: 'devtools-focused', listener: Function): this;
8241    removeListener(event: 'devtools-focused', listener: Function): this;
8242    /**
8243     * Emitted when DevTools is opened.
8244     */
8245    on(event: 'devtools-opened', listener: Function): this;
8246    once(event: 'devtools-opened', listener: Function): this;
8247    addListener(event: 'devtools-opened', listener: Function): this;
8248    removeListener(event: 'devtools-opened', listener: Function): this;
8249    /**
8250     * Emitted when the devtools window instructs the webContents to reload
8251     */
8252    on(event: 'devtools-reload-page', listener: Function): this;
8253    once(event: 'devtools-reload-page', listener: Function): this;
8254    addListener(event: 'devtools-reload-page', listener: Function): this;
8255    removeListener(event: 'devtools-reload-page', listener: Function): this;
8256    /**
8257     * Emitted when a `<webview>` has been attached to this web contents.
8258     */
8259    on(event: 'did-attach-webview', listener: (event: Event,
8260                                               /**
8261                                                * The guest web contents that is used by the `<webview>`.
8262                                                */
8263                                               webContents: WebContents) => void): this;
8264    once(event: 'did-attach-webview', listener: (event: Event,
8265                                               /**
8266                                                * The guest web contents that is used by the `<webview>`.
8267                                                */
8268                                               webContents: WebContents) => void): this;
8269    addListener(event: 'did-attach-webview', listener: (event: Event,
8270                                               /**
8271                                                * The guest web contents that is used by the `<webview>`.
8272                                                */
8273                                               webContents: WebContents) => void): this;
8274    removeListener(event: 'did-attach-webview', listener: (event: Event,
8275                                               /**
8276                                                * The guest web contents that is used by the `<webview>`.
8277                                                */
8278                                               webContents: WebContents) => void): this;
8279    /**
8280     * Emitted when a page's theme color changes. This is usually due to encountering a
8281     * meta tag:
8282     */
8283    on(event: 'did-change-theme-color', listener: (event: Event,
8284                                                   /**
8285                                                    * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
8286                                                    */
8287                                                   color: (string) | (null)) => void): this;
8288    once(event: 'did-change-theme-color', listener: (event: Event,
8289                                                   /**
8290                                                    * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
8291                                                    */
8292                                                   color: (string) | (null)) => void): this;
8293    addListener(event: 'did-change-theme-color', listener: (event: Event,
8294                                                   /**
8295                                                    * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
8296                                                    */
8297                                                   color: (string) | (null)) => void): this;
8298    removeListener(event: 'did-change-theme-color', listener: (event: Event,
8299                                                   /**
8300                                                    * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
8301                                                    */
8302                                                   color: (string) | (null)) => void): this;
8303    /**
8304     * This event is like `did-finish-load` but emitted when the load failed. The full
8305     * list of error codes and their meaning is available here.
8306     */
8307    on(event: 'did-fail-load', listener: (event: Event,
8308                                          errorCode: number,
8309                                          errorDescription: string,
8310                                          validatedURL: string,
8311                                          isMainFrame: boolean,
8312                                          frameProcessId: number,
8313                                          frameRoutingId: number) => void): this;
8314    once(event: 'did-fail-load', listener: (event: Event,
8315                                          errorCode: number,
8316                                          errorDescription: string,
8317                                          validatedURL: string,
8318                                          isMainFrame: boolean,
8319                                          frameProcessId: number,
8320                                          frameRoutingId: number) => void): this;
8321    addListener(event: 'did-fail-load', listener: (event: Event,
8322                                          errorCode: number,
8323                                          errorDescription: string,
8324                                          validatedURL: string,
8325                                          isMainFrame: boolean,
8326                                          frameProcessId: number,
8327                                          frameRoutingId: number) => void): this;
8328    removeListener(event: 'did-fail-load', listener: (event: Event,
8329                                          errorCode: number,
8330                                          errorDescription: string,
8331                                          validatedURL: string,
8332                                          isMainFrame: boolean,
8333                                          frameProcessId: number,
8334                                          frameRoutingId: number) => void): this;
8335    /**
8336     * This event is like `did-fail-load` but emitted when the load was cancelled (e.g.
8337     * `window.stop()` was invoked).
8338     */
8339    on(event: 'did-fail-provisional-load', listener: (event: Event,
8340                                                      errorCode: number,
8341                                                      errorDescription: string,
8342                                                      validatedURL: string,
8343                                                      isMainFrame: boolean,
8344                                                      frameProcessId: number,
8345                                                      frameRoutingId: number) => void): this;
8346    once(event: 'did-fail-provisional-load', listener: (event: Event,
8347                                                      errorCode: number,
8348                                                      errorDescription: string,
8349                                                      validatedURL: string,
8350                                                      isMainFrame: boolean,
8351                                                      frameProcessId: number,
8352                                                      frameRoutingId: number) => void): this;
8353    addListener(event: 'did-fail-provisional-load', listener: (event: Event,
8354                                                      errorCode: number,
8355                                                      errorDescription: string,
8356                                                      validatedURL: string,
8357                                                      isMainFrame: boolean,
8358                                                      frameProcessId: number,
8359                                                      frameRoutingId: number) => void): this;
8360    removeListener(event: 'did-fail-provisional-load', listener: (event: Event,
8361                                                      errorCode: number,
8362                                                      errorDescription: string,
8363                                                      validatedURL: string,
8364                                                      isMainFrame: boolean,
8365                                                      frameProcessId: number,
8366                                                      frameRoutingId: number) => void): this;
8367    /**
8368     * Emitted when the navigation is done, i.e. the spinner of the tab has stopped
8369     * spinning, and the `onload` event was dispatched.
8370     */
8371    on(event: 'did-finish-load', listener: Function): this;
8372    once(event: 'did-finish-load', listener: Function): this;
8373    addListener(event: 'did-finish-load', listener: Function): this;
8374    removeListener(event: 'did-finish-load', listener: Function): this;
8375    /**
8376     * Emitted when a frame has done navigation.
8377     */
8378    on(event: 'did-frame-finish-load', listener: (event: Event,
8379                                                  isMainFrame: boolean,
8380                                                  frameProcessId: number,
8381                                                  frameRoutingId: number) => void): this;
8382    once(event: 'did-frame-finish-load', listener: (event: Event,
8383                                                  isMainFrame: boolean,
8384                                                  frameProcessId: number,
8385                                                  frameRoutingId: number) => void): this;
8386    addListener(event: 'did-frame-finish-load', listener: (event: Event,
8387                                                  isMainFrame: boolean,
8388                                                  frameProcessId: number,
8389                                                  frameRoutingId: number) => void): this;
8390    removeListener(event: 'did-frame-finish-load', listener: (event: Event,
8391                                                  isMainFrame: boolean,
8392                                                  frameProcessId: number,
8393                                                  frameRoutingId: number) => void): this;
8394    /**
8395     * Emitted when any frame navigation is done.
8396     *
8397     * This event is not emitted for in-page navigations, such as clicking anchor links
8398     * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
8399     * this purpose.
8400     */
8401    on(event: 'did-frame-navigate', listener: (event: Event,
8402                                               url: string,
8403                                               /**
8404                                                * -1 for non HTTP navigations
8405                                                */
8406                                               httpResponseCode: number,
8407                                               /**
8408                                                * empty for non HTTP navigations,
8409                                                */
8410                                               httpStatusText: string,
8411                                               isMainFrame: boolean,
8412                                               frameProcessId: number,
8413                                               frameRoutingId: number) => void): this;
8414    once(event: 'did-frame-navigate', listener: (event: Event,
8415                                               url: string,
8416                                               /**
8417                                                * -1 for non HTTP navigations
8418                                                */
8419                                               httpResponseCode: number,
8420                                               /**
8421                                                * empty for non HTTP navigations,
8422                                                */
8423                                               httpStatusText: string,
8424                                               isMainFrame: boolean,
8425                                               frameProcessId: number,
8426                                               frameRoutingId: number) => void): this;
8427    addListener(event: 'did-frame-navigate', listener: (event: Event,
8428                                               url: string,
8429                                               /**
8430                                                * -1 for non HTTP navigations
8431                                                */
8432                                               httpResponseCode: number,
8433                                               /**
8434                                                * empty for non HTTP navigations,
8435                                                */
8436                                               httpStatusText: string,
8437                                               isMainFrame: boolean,
8438                                               frameProcessId: number,
8439                                               frameRoutingId: number) => void): this;
8440    removeListener(event: 'did-frame-navigate', listener: (event: Event,
8441                                               url: string,
8442                                               /**
8443                                                * -1 for non HTTP navigations
8444                                                */
8445                                               httpResponseCode: number,
8446                                               /**
8447                                                * empty for non HTTP navigations,
8448                                                */
8449                                               httpStatusText: string,
8450                                               isMainFrame: boolean,
8451                                               frameProcessId: number,
8452                                               frameRoutingId: number) => void): this;
8453    /**
8454     * Emitted when a main frame navigation is done.
8455     *
8456     * This event is not emitted for in-page navigations, such as clicking anchor links
8457     * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
8458     * this purpose.
8459     */
8460    on(event: 'did-navigate', listener: (event: Event,
8461                                         url: string,
8462                                         /**
8463                                          * -1 for non HTTP navigations
8464                                          */
8465                                         httpResponseCode: number,
8466                                         /**
8467                                          * empty for non HTTP navigations
8468                                          */
8469                                         httpStatusText: string) => void): this;
8470    once(event: 'did-navigate', listener: (event: Event,
8471                                         url: string,
8472                                         /**
8473                                          * -1 for non HTTP navigations
8474                                          */
8475                                         httpResponseCode: number,
8476                                         /**
8477                                          * empty for non HTTP navigations
8478                                          */
8479                                         httpStatusText: string) => void): this;
8480    addListener(event: 'did-navigate', listener: (event: Event,
8481                                         url: string,
8482                                         /**
8483                                          * -1 for non HTTP navigations
8484                                          */
8485                                         httpResponseCode: number,
8486                                         /**
8487                                          * empty for non HTTP navigations
8488                                          */
8489                                         httpStatusText: string) => void): this;
8490    removeListener(event: 'did-navigate', listener: (event: Event,
8491                                         url: string,
8492                                         /**
8493                                          * -1 for non HTTP navigations
8494                                          */
8495                                         httpResponseCode: number,
8496                                         /**
8497                                          * empty for non HTTP navigations
8498                                          */
8499                                         httpStatusText: string) => void): this;
8500    /**
8501     * Emitted when an in-page navigation happened in any frame.
8502     *
8503     * When in-page navigation happens, the page URL changes but does not cause
8504     * navigation outside of the page. Examples of this occurring are when anchor links
8505     * are clicked or when the DOM `hashchange` event is triggered.
8506     */
8507    on(event: 'did-navigate-in-page', listener: (event: Event,
8508                                                 url: string,
8509                                                 isMainFrame: boolean,
8510                                                 frameProcessId: number,
8511                                                 frameRoutingId: number) => void): this;
8512    once(event: 'did-navigate-in-page', listener: (event: Event,
8513                                                 url: string,
8514                                                 isMainFrame: boolean,
8515                                                 frameProcessId: number,
8516                                                 frameRoutingId: number) => void): this;
8517    addListener(event: 'did-navigate-in-page', listener: (event: Event,
8518                                                 url: string,
8519                                                 isMainFrame: boolean,
8520                                                 frameProcessId: number,
8521                                                 frameRoutingId: number) => void): this;
8522    removeListener(event: 'did-navigate-in-page', listener: (event: Event,
8523                                                 url: string,
8524                                                 isMainFrame: boolean,
8525                                                 frameProcessId: number,
8526                                                 frameRoutingId: number) => void): this;
8527    /**
8528     * Emitted after a server side redirect occurs during navigation.  For example a
8529     * 302 redirect.
8530     *
8531     * This event can not be prevented, if you want to prevent redirects you should
8532     * checkout out the `will-redirect` event above.
8533     */
8534    on(event: 'did-redirect-navigation', listener: (event: Event,
8535                                                    url: string,
8536                                                    isInPlace: boolean,
8537                                                    isMainFrame: boolean,
8538                                                    frameProcessId: number,
8539                                                    frameRoutingId: number) => void): this;
8540    once(event: 'did-redirect-navigation', listener: (event: Event,
8541                                                    url: string,
8542                                                    isInPlace: boolean,
8543                                                    isMainFrame: boolean,
8544                                                    frameProcessId: number,
8545                                                    frameRoutingId: number) => void): this;
8546    addListener(event: 'did-redirect-navigation', listener: (event: Event,
8547                                                    url: string,
8548                                                    isInPlace: boolean,
8549                                                    isMainFrame: boolean,
8550                                                    frameProcessId: number,
8551                                                    frameRoutingId: number) => void): this;
8552    removeListener(event: 'did-redirect-navigation', listener: (event: Event,
8553                                                    url: string,
8554                                                    isInPlace: boolean,
8555                                                    isMainFrame: boolean,
8556                                                    frameProcessId: number,
8557                                                    frameRoutingId: number) => void): this;
8558    /**
8559     * Corresponds to the points in time when the spinner of the tab started spinning.
8560     */
8561    on(event: 'did-start-loading', listener: Function): this;
8562    once(event: 'did-start-loading', listener: Function): this;
8563    addListener(event: 'did-start-loading', listener: Function): this;
8564    removeListener(event: 'did-start-loading', listener: Function): this;
8565    /**
8566     * Emitted when any frame (including main) starts navigating. `isInplace` will be
8567     * `true` for in-page navigations.
8568     */
8569    on(event: 'did-start-navigation', listener: (event: Event,
8570                                                 url: string,
8571                                                 isInPlace: boolean,
8572                                                 isMainFrame: boolean,
8573                                                 frameProcessId: number,
8574                                                 frameRoutingId: number) => void): this;
8575    once(event: 'did-start-navigation', listener: (event: Event,
8576                                                 url: string,
8577                                                 isInPlace: boolean,
8578                                                 isMainFrame: boolean,
8579                                                 frameProcessId: number,
8580                                                 frameRoutingId: number) => void): this;
8581    addListener(event: 'did-start-navigation', listener: (event: Event,
8582                                                 url: string,
8583                                                 isInPlace: boolean,
8584                                                 isMainFrame: boolean,
8585                                                 frameProcessId: number,
8586                                                 frameRoutingId: number) => void): this;
8587    removeListener(event: 'did-start-navigation', listener: (event: Event,
8588                                                 url: string,
8589                                                 isInPlace: boolean,
8590                                                 isMainFrame: boolean,
8591                                                 frameProcessId: number,
8592                                                 frameRoutingId: number) => void): this;
8593    /**
8594     * Corresponds to the points in time when the spinner of the tab stopped spinning.
8595     */
8596    on(event: 'did-stop-loading', listener: Function): this;
8597    once(event: 'did-stop-loading', listener: Function): this;
8598    addListener(event: 'did-stop-loading', listener: Function): this;
8599    removeListener(event: 'did-stop-loading', listener: Function): this;
8600    /**
8601     * Emitted when the document in the given frame is loaded.
8602     */
8603    on(event: 'dom-ready', listener: (event: Event) => void): this;
8604    once(event: 'dom-ready', listener: (event: Event) => void): this;
8605    addListener(event: 'dom-ready', listener: (event: Event) => void): this;
8606    removeListener(event: 'dom-ready', listener: (event: Event) => void): this;
8607    /**
8608     * Emitted when the window enters a full-screen state triggered by HTML API.
8609     */
8610    on(event: 'enter-html-full-screen', listener: Function): this;
8611    once(event: 'enter-html-full-screen', listener: Function): this;
8612    addListener(event: 'enter-html-full-screen', listener: Function): this;
8613    removeListener(event: 'enter-html-full-screen', listener: Function): this;
8614    /**
8615     * Emitted when a result is available for [`webContents.findInPage`] request.
8616     */
8617    on(event: 'found-in-page', listener: (event: Event,
8618                                          result: Result) => void): this;
8619    once(event: 'found-in-page', listener: (event: Event,
8620                                          result: Result) => void): this;
8621    addListener(event: 'found-in-page', listener: (event: Event,
8622                                          result: Result) => void): this;
8623    removeListener(event: 'found-in-page', listener: (event: Event,
8624                                          result: Result) => void): this;
8625    /**
8626     * Emitted when the renderer process sends an asynchronous message via
8627     * `ipcRenderer.send()`.
8628     */
8629    on(event: 'ipc-message', listener: (event: Event,
8630                                        channel: string,
8631                                        ...args: any[]) => void): this;
8632    once(event: 'ipc-message', listener: (event: Event,
8633                                        channel: string,
8634                                        ...args: any[]) => void): this;
8635    addListener(event: 'ipc-message', listener: (event: Event,
8636                                        channel: string,
8637                                        ...args: any[]) => void): this;
8638    removeListener(event: 'ipc-message', listener: (event: Event,
8639                                        channel: string,
8640                                        ...args: any[]) => void): this;
8641    /**
8642     * Emitted when the renderer process sends a synchronous message via
8643     * `ipcRenderer.sendSync()`.
8644     */
8645    on(event: 'ipc-message-sync', listener: (event: Event,
8646                                             channel: string,
8647                                             ...args: any[]) => void): this;
8648    once(event: 'ipc-message-sync', listener: (event: Event,
8649                                             channel: string,
8650                                             ...args: any[]) => void): this;
8651    addListener(event: 'ipc-message-sync', listener: (event: Event,
8652                                             channel: string,
8653                                             ...args: any[]) => void): this;
8654    removeListener(event: 'ipc-message-sync', listener: (event: Event,
8655                                             channel: string,
8656                                             ...args: any[]) => void): this;
8657    /**
8658     * Emitted when the window leaves a full-screen state triggered by HTML API.
8659     */
8660    on(event: 'leave-html-full-screen', listener: Function): this;
8661    once(event: 'leave-html-full-screen', listener: Function): this;
8662    addListener(event: 'leave-html-full-screen', listener: Function): this;
8663    removeListener(event: 'leave-html-full-screen', listener: Function): this;
8664    /**
8665     * Emitted when `webContents` wants to do basic auth.
8666     *
8667The usage is the same with the `login` event of `app`.
8668     */
8669    on(event: 'login', listener: (event: Event,
8670                                  authenticationResponseDetails: AuthenticationResponseDetails,
8671                                  authInfo: AuthInfo,
8672                                  callback: (username?: string, password?: string) => void) => void): this;
8673    once(event: 'login', listener: (event: Event,
8674                                  authenticationResponseDetails: AuthenticationResponseDetails,
8675                                  authInfo: AuthInfo,
8676                                  callback: (username?: string, password?: string) => void) => void): this;
8677    addListener(event: 'login', listener: (event: Event,
8678                                  authenticationResponseDetails: AuthenticationResponseDetails,
8679                                  authInfo: AuthInfo,
8680                                  callback: (username?: string, password?: string) => void) => void): this;
8681    removeListener(event: 'login', listener: (event: Event,
8682                                  authenticationResponseDetails: AuthenticationResponseDetails,
8683                                  authInfo: AuthInfo,
8684                                  callback: (username?: string, password?: string) => void) => void): this;
8685    /**
8686     * Emitted when media is paused or done playing.
8687     */
8688    on(event: 'media-paused', listener: Function): this;
8689    once(event: 'media-paused', listener: Function): this;
8690    addListener(event: 'media-paused', listener: Function): this;
8691    removeListener(event: 'media-paused', listener: Function): this;
8692    /**
8693     * Emitted when media starts playing.
8694     */
8695    on(event: 'media-started-playing', listener: Function): this;
8696    once(event: 'media-started-playing', listener: Function): this;
8697    addListener(event: 'media-started-playing', listener: Function): this;
8698    removeListener(event: 'media-started-playing', listener: Function): this;
8699    /**
8700     * Emitted when the page requests to open a new window for a `url`. It could be
8701     * requested by `window.open` or an external link like `<a target='_blank'>`.
8702     *
8703     * By default a new `BrowserWindow` will be created for the `url`.
8704     *
8705     * Calling `event.preventDefault()` will prevent Electron from automatically
8706     * creating a new `BrowserWindow`. If you call `event.preventDefault()` and
8707     * manually create a new `BrowserWindow` then you must set `event.newGuest` to
8708     * reference the new `BrowserWindow` instance, failing to do so may result in
8709     * unexpected behavior. For example:
8710     */
8711    on(event: 'new-window', listener: (event: NewWindowEvent,
8712                                       url: string,
8713                                       frameName: string,
8714                                       /**
8715                                        * Can be `default`, `foreground-tab`, `background-tab`, `new-window`,
8716                                        * `save-to-disk` and `other`.
8717                                        */
8718                                       disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
8719                                       /**
8720                                        * The options which will be used for creating the new `BrowserWindow`.
8721                                        */
8722                                       options: BrowserWindowConstructorOptions,
8723                                       /**
8724                                        * The non-standard features (features not handled by Chromium or Electron) given
8725                                        * to `window.open()`.
8726                                        */
8727                                       additionalFeatures: string[],
8728                                       /**
8729                                        * The referrer that will be passed to the new window. May or may not result in the
8730                                        * `Referer` header being sent, depending on the referrer policy.
8731                                        */
8732                                       referrer: Referrer) => void): this;
8733    once(event: 'new-window', listener: (event: NewWindowEvent,
8734                                       url: string,
8735                                       frameName: string,
8736                                       /**
8737                                        * Can be `default`, `foreground-tab`, `background-tab`, `new-window`,
8738                                        * `save-to-disk` and `other`.
8739                                        */
8740                                       disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
8741                                       /**
8742                                        * The options which will be used for creating the new `BrowserWindow`.
8743                                        */
8744                                       options: BrowserWindowConstructorOptions,
8745                                       /**
8746                                        * The non-standard features (features not handled by Chromium or Electron) given
8747                                        * to `window.open()`.
8748                                        */
8749                                       additionalFeatures: string[],
8750                                       /**
8751                                        * The referrer that will be passed to the new window. May or may not result in the
8752                                        * `Referer` header being sent, depending on the referrer policy.
8753                                        */
8754                                       referrer: Referrer) => void): this;
8755    addListener(event: 'new-window', listener: (event: NewWindowEvent,
8756                                       url: string,
8757                                       frameName: string,
8758                                       /**
8759                                        * Can be `default`, `foreground-tab`, `background-tab`, `new-window`,
8760                                        * `save-to-disk` and `other`.
8761                                        */
8762                                       disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
8763                                       /**
8764                                        * The options which will be used for creating the new `BrowserWindow`.
8765                                        */
8766                                       options: BrowserWindowConstructorOptions,
8767                                       /**
8768                                        * The non-standard features (features not handled by Chromium or Electron) given
8769                                        * to `window.open()`.
8770                                        */
8771                                       additionalFeatures: string[],
8772                                       /**
8773                                        * The referrer that will be passed to the new window. May or may not result in the
8774                                        * `Referer` header being sent, depending on the referrer policy.
8775                                        */
8776                                       referrer: Referrer) => void): this;
8777    removeListener(event: 'new-window', listener: (event: NewWindowEvent,
8778                                       url: string,
8779                                       frameName: string,
8780                                       /**
8781                                        * Can be `default`, `foreground-tab`, `background-tab`, `new-window`,
8782                                        * `save-to-disk` and `other`.
8783                                        */
8784                                       disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
8785                                       /**
8786                                        * The options which will be used for creating the new `BrowserWindow`.
8787                                        */
8788                                       options: BrowserWindowConstructorOptions,
8789                                       /**
8790                                        * The non-standard features (features not handled by Chromium or Electron) given
8791                                        * to `window.open()`.
8792                                        */
8793                                       additionalFeatures: string[],
8794                                       /**
8795                                        * The referrer that will be passed to the new window. May or may not result in the
8796                                        * `Referer` header being sent, depending on the referrer policy.
8797                                        */
8798                                       referrer: Referrer) => void): this;
8799    /**
8800     * Emitted when page receives favicon urls.
8801     */
8802    on(event: 'page-favicon-updated', listener: (event: Event,
8803                                                 /**
8804                                                  * Array of URLs.
8805                                                  */
8806                                                 favicons: string[]) => void): this;
8807    once(event: 'page-favicon-updated', listener: (event: Event,
8808                                                 /**
8809                                                  * Array of URLs.
8810                                                  */
8811                                                 favicons: string[]) => void): this;
8812    addListener(event: 'page-favicon-updated', listener: (event: Event,
8813                                                 /**
8814                                                  * Array of URLs.
8815                                                  */
8816                                                 favicons: string[]) => void): this;
8817    removeListener(event: 'page-favicon-updated', listener: (event: Event,
8818                                                 /**
8819                                                  * Array of URLs.
8820                                                  */
8821                                                 favicons: string[]) => void): this;
8822    /**
8823     * Fired when page title is set during navigation. `explicitSet` is false when
8824     * title is synthesized from file url.
8825     */
8826    on(event: 'page-title-updated', listener: (event: Event,
8827                                               title: string,
8828                                               explicitSet: boolean) => void): this;
8829    once(event: 'page-title-updated', listener: (event: Event,
8830                                               title: string,
8831                                               explicitSet: boolean) => void): this;
8832    addListener(event: 'page-title-updated', listener: (event: Event,
8833                                               title: string,
8834                                               explicitSet: boolean) => void): this;
8835    removeListener(event: 'page-title-updated', listener: (event: Event,
8836                                               title: string,
8837                                               explicitSet: boolean) => void): this;
8838    /**
8839     * Emitted when a new frame is generated. Only the dirty area is passed in the
8840     * buffer.
8841     */
8842    on(event: 'paint', listener: (event: Event,
8843                                  dirtyRect: Rectangle,
8844                                  /**
8845                                   * The image data of the whole frame.
8846                                   */
8847                                  image: NativeImage) => void): this;
8848    once(event: 'paint', listener: (event: Event,
8849                                  dirtyRect: Rectangle,
8850                                  /**
8851                                   * The image data of the whole frame.
8852                                   */
8853                                  image: NativeImage) => void): this;
8854    addListener(event: 'paint', listener: (event: Event,
8855                                  dirtyRect: Rectangle,
8856                                  /**
8857                                   * The image data of the whole frame.
8858                                   */
8859                                  image: NativeImage) => void): this;
8860    removeListener(event: 'paint', listener: (event: Event,
8861                                  dirtyRect: Rectangle,
8862                                  /**
8863                                   * The image data of the whole frame.
8864                                   */
8865                                  image: NativeImage) => void): this;
8866    /**
8867     * Emitted when a plugin process has crashed.
8868     */
8869    on(event: 'plugin-crashed', listener: (event: Event,
8870                                           name: string,
8871                                           version: string) => void): this;
8872    once(event: 'plugin-crashed', listener: (event: Event,
8873                                           name: string,
8874                                           version: string) => void): this;
8875    addListener(event: 'plugin-crashed', listener: (event: Event,
8876                                           name: string,
8877                                           version: string) => void): this;
8878    removeListener(event: 'plugin-crashed', listener: (event: Event,
8879                                           name: string,
8880                                           version: string) => void): this;
8881    /**
8882     * Emitted when the preload script `preloadPath` throws an unhandled exception
8883     * `error`.
8884     */
8885    on(event: 'preload-error', listener: (event: Event,
8886                                          preloadPath: string,
8887                                          error: Error) => void): this;
8888    once(event: 'preload-error', listener: (event: Event,
8889                                          preloadPath: string,
8890                                          error: Error) => void): this;
8891    addListener(event: 'preload-error', listener: (event: Event,
8892                                          preloadPath: string,
8893                                          error: Error) => void): this;
8894    removeListener(event: 'preload-error', listener: (event: Event,
8895                                          preloadPath: string,
8896                                          error: Error) => void): this;
8897    /**
8898     * Emitted when `remote.getBuiltin()` is called in the renderer process. Calling
8899     * `event.preventDefault()` will prevent the module from being returned. Custom
8900     * value can be returned by setting `event.returnValue`.
8901     */
8902    on(event: 'remote-get-builtin', listener: (event: IpcMainEvent,
8903                                               moduleName: string) => void): this;
8904    once(event: 'remote-get-builtin', listener: (event: IpcMainEvent,
8905                                               moduleName: string) => void): this;
8906    addListener(event: 'remote-get-builtin', listener: (event: IpcMainEvent,
8907                                               moduleName: string) => void): this;
8908    removeListener(event: 'remote-get-builtin', listener: (event: IpcMainEvent,
8909                                               moduleName: string) => void): this;
8910    /**
8911     * Emitted when `remote.getCurrentWebContents()` is called in the renderer process.
8912     * Calling `event.preventDefault()` will prevent the object from being returned.
8913     * Custom value can be returned by setting `event.returnValue`.
8914     */
8915    on(event: 'remote-get-current-web-contents', listener: (event: IpcMainEvent) => void): this;
8916    once(event: 'remote-get-current-web-contents', listener: (event: IpcMainEvent) => void): this;
8917    addListener(event: 'remote-get-current-web-contents', listener: (event: IpcMainEvent) => void): this;
8918    removeListener(event: 'remote-get-current-web-contents', listener: (event: IpcMainEvent) => void): this;
8919    /**
8920     * Emitted when `remote.getCurrentWindow()` is called in the renderer process.
8921     * Calling `event.preventDefault()` will prevent the object from being returned.
8922     * Custom value can be returned by setting `event.returnValue`.
8923     */
8924    on(event: 'remote-get-current-window', listener: (event: IpcMainEvent) => void): this;
8925    once(event: 'remote-get-current-window', listener: (event: IpcMainEvent) => void): this;
8926    addListener(event: 'remote-get-current-window', listener: (event: IpcMainEvent) => void): this;
8927    removeListener(event: 'remote-get-current-window', listener: (event: IpcMainEvent) => void): this;
8928    /**
8929     * Emitted when `remote.getGlobal()` is called in the renderer process. Calling
8930     * `event.preventDefault()` will prevent the global from being returned. Custom
8931     * value can be returned by setting `event.returnValue`.
8932     */
8933    on(event: 'remote-get-global', listener: (event: IpcMainEvent,
8934                                              globalName: string) => void): this;
8935    once(event: 'remote-get-global', listener: (event: IpcMainEvent,
8936                                              globalName: string) => void): this;
8937    addListener(event: 'remote-get-global', listener: (event: IpcMainEvent,
8938                                              globalName: string) => void): this;
8939    removeListener(event: 'remote-get-global', listener: (event: IpcMainEvent,
8940                                              globalName: string) => void): this;
8941    /**
8942     * Emitted when `<webview>.getWebContents()` is called in the renderer process.
8943     * Calling `event.preventDefault()` will prevent the object from being returned.
8944     * Custom value can be returned by setting `event.returnValue`.
8945     */
8946    on(event: 'remote-get-guest-web-contents', listener: (event: IpcMainEvent,
8947                                                          guestWebContents: WebContents) => void): this;
8948    once(event: 'remote-get-guest-web-contents', listener: (event: IpcMainEvent,
8949                                                          guestWebContents: WebContents) => void): this;
8950    addListener(event: 'remote-get-guest-web-contents', listener: (event: IpcMainEvent,
8951                                                          guestWebContents: WebContents) => void): this;
8952    removeListener(event: 'remote-get-guest-web-contents', listener: (event: IpcMainEvent,
8953                                                          guestWebContents: WebContents) => void): this;
8954    /**
8955     * Emitted when `remote.require()` is called in the renderer process. Calling
8956     * `event.preventDefault()` will prevent the module from being returned. Custom
8957     * value can be returned by setting `event.returnValue`.
8958     */
8959    on(event: 'remote-require', listener: (event: IpcMainEvent,
8960                                           moduleName: string) => void): this;
8961    once(event: 'remote-require', listener: (event: IpcMainEvent,
8962                                           moduleName: string) => void): this;
8963    addListener(event: 'remote-require', listener: (event: IpcMainEvent,
8964                                           moduleName: string) => void): this;
8965    removeListener(event: 'remote-require', listener: (event: IpcMainEvent,
8966                                           moduleName: string) => void): this;
8967    /**
8968     * Emitted when the unresponsive web page becomes responsive again.
8969     */
8970    on(event: 'responsive', listener: Function): this;
8971    once(event: 'responsive', listener: Function): this;
8972    addListener(event: 'responsive', listener: Function): this;
8973    removeListener(event: 'responsive', listener: Function): this;
8974    /**
8975     * Emitted when bluetooth device needs to be selected on call to
8976     * `navigator.bluetooth.requestDevice`. To use `navigator.bluetooth` api
8977     * `webBluetooth` should be enabled. If `event.preventDefault` is not called, first
8978     * available device will be selected. `callback` should be called with `deviceId`
8979     * to be selected, passing empty string to `callback` will cancel the request.
8980     */
8981    on(event: 'select-bluetooth-device', listener: (event: Event,
8982                                                    devices: BluetoothDevice[],
8983                                                    callback: (deviceId: string) => void) => void): this;
8984    once(event: 'select-bluetooth-device', listener: (event: Event,
8985                                                    devices: BluetoothDevice[],
8986                                                    callback: (deviceId: string) => void) => void): this;
8987    addListener(event: 'select-bluetooth-device', listener: (event: Event,
8988                                                    devices: BluetoothDevice[],
8989                                                    callback: (deviceId: string) => void) => void): this;
8990    removeListener(event: 'select-bluetooth-device', listener: (event: Event,
8991                                                    devices: BluetoothDevice[],
8992                                                    callback: (deviceId: string) => void) => void): this;
8993    /**
8994     * Emitted when a client certificate is requested.
8995     *
8996The usage is the same with the `select-client-certificate` event of `app`.
8997     */
8998    on(event: 'select-client-certificate', listener: (event: Event,
8999                                                      url: string,
9000                                                      certificateList: Certificate[],
9001                                                      callback: (certificate: Certificate) => void) => void): this;
9002    once(event: 'select-client-certificate', listener: (event: Event,
9003                                                      url: string,
9004                                                      certificateList: Certificate[],
9005                                                      callback: (certificate: Certificate) => void) => void): this;
9006    addListener(event: 'select-client-certificate', listener: (event: Event,
9007                                                      url: string,
9008                                                      certificateList: Certificate[],
9009                                                      callback: (certificate: Certificate) => void) => void): this;
9010    removeListener(event: 'select-client-certificate', listener: (event: Event,
9011                                                      url: string,
9012                                                      certificateList: Certificate[],
9013                                                      callback: (certificate: Certificate) => void) => void): this;
9014    /**
9015     * Emitted when the web page becomes unresponsive.
9016     */
9017    on(event: 'unresponsive', listener: Function): this;
9018    once(event: 'unresponsive', listener: Function): this;
9019    addListener(event: 'unresponsive', listener: Function): this;
9020    removeListener(event: 'unresponsive', listener: Function): this;
9021    /**
9022     * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
9023     */
9024    on(event: 'update-target-url', listener: (event: Event,
9025                                              url: string) => void): this;
9026    once(event: 'update-target-url', listener: (event: Event,
9027                                              url: string) => void): this;
9028    addListener(event: 'update-target-url', listener: (event: Event,
9029                                              url: string) => void): this;
9030    removeListener(event: 'update-target-url', listener: (event: Event,
9031                                              url: string) => void): this;
9032    /**
9033     * Emitted when a `<webview>`'s web contents is being attached to this web
9034     * contents. Calling `event.preventDefault()` will destroy the guest page.
9035     *
9036     * This event can be used to configure `webPreferences` for the `webContents` of a
9037     * `<webview>` before it's loaded, and provides the ability to set settings that
9038     * can't be set via `<webview>` attributes.
9039     *
9040     * **Note:** The specified `preload` script option will be appear as `preloadURL`
9041     * (not `preload`) in the `webPreferences` object emitted with this event.
9042     */
9043    on(event: 'will-attach-webview', listener: (event: Event,
9044                                                /**
9045                                                 * The web preferences that will be used by the guest page. This object can be
9046                                                 * modified to adjust the preferences for the guest page.
9047                                                 */
9048                                                webPreferences: WebPreferences,
9049                                                /**
9050                                                 * The other `<webview>` parameters such as the `src` URL. This object can be
9051                                                 * modified to adjust the parameters of the guest page.
9052                                                 */
9053                                                params: Record<string, string>) => void): this;
9054    once(event: 'will-attach-webview', listener: (event: Event,
9055                                                /**
9056                                                 * The web preferences that will be used by the guest page. This object can be
9057                                                 * modified to adjust the preferences for the guest page.
9058                                                 */
9059                                                webPreferences: WebPreferences,
9060                                                /**
9061                                                 * The other `<webview>` parameters such as the `src` URL. This object can be
9062                                                 * modified to adjust the parameters of the guest page.
9063                                                 */
9064                                                params: Record<string, string>) => void): this;
9065    addListener(event: 'will-attach-webview', listener: (event: Event,
9066                                                /**
9067                                                 * The web preferences that will be used by the guest page. This object can be
9068                                                 * modified to adjust the preferences for the guest page.
9069                                                 */
9070                                                webPreferences: WebPreferences,
9071                                                /**
9072                                                 * The other `<webview>` parameters such as the `src` URL. This object can be
9073                                                 * modified to adjust the parameters of the guest page.
9074                                                 */
9075                                                params: Record<string, string>) => void): this;
9076    removeListener(event: 'will-attach-webview', listener: (event: Event,
9077                                                /**
9078                                                 * The web preferences that will be used by the guest page. This object can be
9079                                                 * modified to adjust the preferences for the guest page.
9080                                                 */
9081                                                webPreferences: WebPreferences,
9082                                                /**
9083                                                 * The other `<webview>` parameters such as the `src` URL. This object can be
9084                                                 * modified to adjust the parameters of the guest page.
9085                                                 */
9086                                                params: Record<string, string>) => void): this;
9087    /**
9088     * Emitted when a user or the page wants to start navigation. It can happen when
9089     * the `window.location` object is changed or a user clicks a link in the page.
9090     *
9091     * This event will not emit when the navigation is started programmatically with
9092     * APIs like `webContents.loadURL` and `webContents.back`.
9093     *
9094     * It is also not emitted for in-page navigations, such as clicking anchor links or
9095     * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
9096     * purpose.
9097
9098Calling `event.preventDefault()` will prevent the navigation.
9099     */
9100    on(event: 'will-navigate', listener: (event: Event,
9101                                          url: string) => void): this;
9102    once(event: 'will-navigate', listener: (event: Event,
9103                                          url: string) => void): this;
9104    addListener(event: 'will-navigate', listener: (event: Event,
9105                                          url: string) => void): this;
9106    removeListener(event: 'will-navigate', listener: (event: Event,
9107                                          url: string) => void): this;
9108    /**
9109     * Emitted when a `beforeunload` event handler is attempting to cancel a page
9110     * unload.
9111     *
9112     * Calling `event.preventDefault()` will ignore the `beforeunload` event handler
9113     * and allow the page to be unloaded.
9114     */
9115    on(event: 'will-prevent-unload', listener: (event: Event) => void): this;
9116    once(event: 'will-prevent-unload', listener: (event: Event) => void): this;
9117    addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
9118    removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
9119    /**
9120     * Emitted as a server side redirect occurs during navigation.  For example a 302
9121     * redirect.
9122     *
9123     * This event will be emitted after `did-start-navigation` and always before the
9124     * `did-redirect-navigation` event for the same navigation.
9125     *
9126     * Calling `event.preventDefault()` will prevent the navigation (not just the
9127     * redirect).
9128     */
9129    on(event: 'will-redirect', listener: (event: Event,
9130                                          url: string,
9131                                          isInPlace: boolean,
9132                                          isMainFrame: boolean,
9133                                          frameProcessId: number,
9134                                          frameRoutingId: number) => void): this;
9135    once(event: 'will-redirect', listener: (event: Event,
9136                                          url: string,
9137                                          isInPlace: boolean,
9138                                          isMainFrame: boolean,
9139                                          frameProcessId: number,
9140                                          frameRoutingId: number) => void): this;
9141    addListener(event: 'will-redirect', listener: (event: Event,
9142                                          url: string,
9143                                          isInPlace: boolean,
9144                                          isMainFrame: boolean,
9145                                          frameProcessId: number,
9146                                          frameRoutingId: number) => void): this;
9147    removeListener(event: 'will-redirect', listener: (event: Event,
9148                                          url: string,
9149                                          isInPlace: boolean,
9150                                          isMainFrame: boolean,
9151                                          frameProcessId: number,
9152                                          frameRoutingId: number) => void): this;
9153    /**
9154     * Emitted when the user is requesting to change the zoom level using the mouse
9155     * wheel.
9156     */
9157    on(event: 'zoom-changed', listener: (event: Event,
9158                                         /**
9159                                          * Can be `in` or `out`.
9160                                          */
9161                                         zoomDirection: ('in' | 'out')) => void): this;
9162    once(event: 'zoom-changed', listener: (event: Event,
9163                                         /**
9164                                          * Can be `in` or `out`.
9165                                          */
9166                                         zoomDirection: ('in' | 'out')) => void): this;
9167    addListener(event: 'zoom-changed', listener: (event: Event,
9168                                         /**
9169                                          * Can be `in` or `out`.
9170                                          */
9171                                         zoomDirection: ('in' | 'out')) => void): this;
9172    removeListener(event: 'zoom-changed', listener: (event: Event,
9173                                         /**
9174                                          * Can be `in` or `out`.
9175                                          */
9176                                         zoomDirection: ('in' | 'out')) => void): this;
9177    /**
9178     * Adds the specified path to DevTools workspace. Must be used after DevTools
9179     * creation:
9180     */
9181    addWorkSpace(path: string): void;
9182    /**
9183     * Begin subscribing for presentation events and captured frames, the `callback`
9184     * will be called with `callback(image, dirtyRect)` when there is a presentation
9185     * event.
9186     *
9187     * The `image` is an instance of NativeImage that stores the captured frame.
9188     *
9189     * The `dirtyRect` is an object with `x, y, width, height` properties that
9190     * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
9191     * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
9192     */
9193    beginFrameSubscription(onlyDirty: boolean, callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
9194    /**
9195     * Begin subscribing for presentation events and captured frames, the `callback`
9196     * will be called with `callback(image, dirtyRect)` when there is a presentation
9197     * event.
9198     *
9199     * The `image` is an instance of NativeImage that stores the captured frame.
9200     *
9201     * The `dirtyRect` is an object with `x, y, width, height` properties that
9202     * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
9203     * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
9204     */
9205    beginFrameSubscription(callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
9206    /**
9207     * Whether the browser can go back to previous web page.
9208     */
9209    canGoBack(): boolean;
9210    /**
9211     * Whether the browser can go forward to next web page.
9212     */
9213    canGoForward(): boolean;
9214    /**
9215     * Whether the web page can go to `offset`.
9216     */
9217    canGoToOffset(offset: number): boolean;
9218    /**
9219     * Resolves with a NativeImage
9220     *
9221     * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
9222     * whole visible page.
9223     */
9224    capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
9225    /**
9226     * Clears the navigation history.
9227     */
9228    clearHistory(): void;
9229    /**
9230     * Closes the devtools.
9231     */
9232    closeDevTools(): void;
9233    /**
9234     * Executes the editing command `copy` in web page.
9235     */
9236    copy(): void;
9237    /**
9238     * Copy the image at the given position to the clipboard.
9239     */
9240    copyImageAt(x: number, y: number): void;
9241    /**
9242     * Executes the editing command `cut` in web page.
9243     */
9244    cut(): void;
9245    /**
9246     * Decrease the capturer count by one. The page will be set to hidden or occluded
9247     * state when its browser window is hidden or occluded and the capturer count
9248     * reaches zero. If you want to decrease the hidden capturer count instead you
9249     * should set `stayHidden` to true.
9250     */
9251    decrementCapturerCount(stayHidden?: boolean): void;
9252    /**
9253     * Executes the editing command `delete` in web page.
9254     */
9255    delete(): void;
9256    /**
9257     * Disable device emulation enabled by `webContents.enableDeviceEmulation`.
9258     */
9259    disableDeviceEmulation(): void;
9260    /**
9261     * Initiates a download of the resource at `url` without navigating. The
9262     * `will-download` event of `session` will be triggered.
9263     */
9264    downloadURL(url: string): void;
9265    /**
9266     * Enable device emulation with the given parameters.
9267     */
9268    enableDeviceEmulation(parameters: Parameters): void;
9269    /**
9270     * End subscribing for frame presentation events.
9271     */
9272    endFrameSubscription(): void;
9273    /**
9274     * A promise that resolves with the result of the executed code or is rejected if
9275     * the result of the code is a rejected promise.
9276     *
9277     * Evaluates `code` in page.
9278     *
9279     * In the browser window some HTML APIs like `requestFullScreen` can only be
9280     * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
9281     * this limitation.
9282
9283Code execution will be suspended until web page stop loading.
9284     */
9285    executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
9286    /**
9287     * A promise that resolves with the result of the executed code or is rejected if
9288     * the result of the code is a rejected promise.
9289     *
9290Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
9291     */
9292    executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean): Promise<any>;
9293    /**
9294     * The request id used for the request.
9295     *
9296     * Starts a request to find all matches for the `text` in the web page. The result
9297     * of the request can be obtained by subscribing to `found-in-page` event.
9298     */
9299    findInPage(text: string, options?: FindInPageOptions): number;
9300    /**
9301     * Focuses the web page.
9302     */
9303    focus(): void;
9304    /**
9305     * Information about all Shared Workers.
9306     */
9307    getAllSharedWorkers(): SharedWorkerInfo[];
9308    /**
9309     * If *offscreen rendering* is enabled returns the current frame rate.
9310     *
9311**Deprecated**
9312     */
9313    getFrameRate(): number;
9314    /**
9315     * The operating system `pid` of the associated renderer process.
9316     */
9317    getOSProcessId(): number;
9318    /**
9319     * Get the system printer list.
9320     */
9321    getPrinters(): PrinterInfo[];
9322    /**
9323     * The Chromium internal `pid` of the associated renderer. Can be compared to the
9324     * `frameProcessId` passed by frame specific navigation events (e.g.
9325     * `did-frame-navigate`)
9326     */
9327    getProcessId(): number;
9328    /**
9329     * The title of the current web page.
9330     */
9331    getTitle(): string;
9332    /**
9333     * the type of the webContent. Can be `backgroundPage`, `window`, `browserView`,
9334     * `remote`, `webview` or `offscreen`.
9335     */
9336    getType(): ('backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen');
9337    /**
9338     * The URL of the current web page.
9339     */
9340    getURL(): string;
9341    /**
9342     * The user agent for this web page.
9343
9344**Deprecated**
9345     */
9346    getUserAgent(): string;
9347    /**
9348     * Returns the WebRTC IP Handling Policy.
9349     */
9350    getWebRTCIPHandlingPolicy(): string;
9351    /**
9352     * the current zoom factor.
9353
9354**Deprecated**
9355     */
9356    getZoomFactor(): number;
9357    /**
9358     * the current zoom level.
9359
9360**Deprecated**
9361     */
9362    getZoomLevel(): number;
9363    /**
9364     * Makes the browser go back a web page.
9365     */
9366    goBack(): void;
9367    /**
9368     * Makes the browser go forward a web page.
9369     */
9370    goForward(): void;
9371    /**
9372     * Navigates browser to the specified absolute web page index.
9373     */
9374    goToIndex(index: number): void;
9375    /**
9376     * Navigates to the specified offset from the "current entry".
9377     */
9378    goToOffset(offset: number): void;
9379    /**
9380     * Increase the capturer count by one. The page is considered visible when its
9381     * browser window is hidden and the capturer count is non-zero. If you would like
9382     * the page to stay hidden, you should ensure that `stayHidden` is set to true.
9383     *
9384This also affects the Page Visibility API.
9385     */
9386    incrementCapturerCount(size?: Size, stayHidden?: boolean): void;
9387    /**
9388     * A promise that resolves with a key for the inserted CSS that can later be used
9389     * to remove the CSS via `contents.removeInsertedCSS(key)`.
9390     *
9391     * Injects CSS into the current web page and returns a unique key for the inserted
9392     * stylesheet.
9393     */
9394    insertCSS(css: string, options?: InsertCSSOptions): Promise<string>;
9395    /**
9396     * Inserts `text` to the focused element.
9397     */
9398    insertText(text: string): Promise<void>;
9399    /**
9400     * Starts inspecting element at position (`x`, `y`).
9401     */
9402    inspectElement(x: number, y: number): void;
9403    /**
9404     * Opens the developer tools for the service worker context.
9405     */
9406    inspectServiceWorker(): void;
9407    /**
9408     * Opens the developer tools for the shared worker context.
9409     */
9410    inspectSharedWorker(): void;
9411    /**
9412     * Inspects the shared worker based on its ID.
9413     */
9414    inspectSharedWorkerById(workerId: string): void;
9415    /**
9416     * Schedules a full repaint of the window this web contents is in.
9417     *
9418     * If *offscreen rendering* is enabled invalidates the frame and generates a new
9419     * one through the `'paint'` event.
9420     */
9421    invalidate(): void;
9422    /**
9423     * Whether this page has been muted.
9424
9425**Deprecated**
9426     */
9427    isAudioMuted(): boolean;
9428    /**
9429     * Whether this page is being captured. It returns true when the capturer count is
9430     * large then 0.
9431     */
9432    isBeingCaptured(): boolean;
9433    /**
9434     * Whether the renderer process has crashed.
9435     */
9436    isCrashed(): boolean;
9437    /**
9438     * Whether audio is currently playing.
9439     */
9440    isCurrentlyAudible(): boolean;
9441    /**
9442     * Whether the web page is destroyed.
9443     */
9444    isDestroyed(): boolean;
9445    /**
9446     * Whether the devtools view is focused .
9447     */
9448    isDevToolsFocused(): boolean;
9449    /**
9450     * Whether the devtools is opened.
9451     */
9452    isDevToolsOpened(): boolean;
9453    /**
9454     * Whether the web page is focused.
9455     */
9456    isFocused(): boolean;
9457    /**
9458     * Whether web page is still loading resources.
9459     */
9460    isLoading(): boolean;
9461    /**
9462     * Whether the main frame (and not just iframes or frames within it) is still
9463     * loading.
9464     */
9465    isLoadingMainFrame(): boolean;
9466    /**
9467     * Indicates whether *offscreen rendering* is enabled.
9468     */
9469    isOffscreen(): boolean;
9470    /**
9471     * If *offscreen rendering* is enabled returns whether it is currently painting.
9472     */
9473    isPainting(): boolean;
9474    /**
9475     * Whether the web page is waiting for a first-response from the main resource of
9476     * the page.
9477     */
9478    isWaitingForResponse(): boolean;
9479    /**
9480     * the promise will resolve when the page has finished loading (see
9481     * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
9482     *
9483     * Loads the given file in the window, `filePath` should be a path to an HTML file
9484     * relative to the root of your application.  For instance an app structure like
9485     * this:
9486
9487Would require code like this
9488     */
9489    loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
9490    /**
9491     * the promise will resolve when the page has finished loading (see
9492     * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
9493     * A noop rejection handler is already attached, which avoids unhandled rejection
9494     * errors.
9495     *
9496     * Loads the `url` in the window. The `url` must contain the protocol prefix, e.g.
9497     * the `http://` or `file://`. If the load should bypass http cache then use the
9498     * `pragma` header to achieve it.
9499     */
9500    loadURL(url: string, options?: LoadURLOptions): Promise<void>;
9501    /**
9502     * Opens the devtools.
9503     *
9504     * When `contents` is a `<webview>` tag, the `mode` would be `detach` by default,
9505     * explicitly passing an empty `mode` can force using last used dock state.
9506     */
9507    openDevTools(options?: OpenDevToolsOptions): void;
9508    /**
9509     * Executes the editing command `paste` in web page.
9510     */
9511    paste(): void;
9512    /**
9513     * Executes the editing command `pasteAndMatchStyle` in web page.
9514     */
9515    pasteAndMatchStyle(): void;
9516    /**
9517     * Prints window's web page. When `silent` is set to `true`, Electron will pick the
9518     * system's default printer if `deviceName` is empty and the default settings for
9519     * printing.
9520     *
9521     * Use `page-break-before: always;` CSS style to force to print to a new page.
9522     *
9523Example usage:
9524     */
9525    print(options?: WebContentsPrintOptions, callback?: (success: boolean, failureReason: string) => void): void;
9526    /**
9527     * Resolves with the generated PDF data.
9528     *
9529     * Prints window's web page as PDF with Chromium's preview printing custom
9530     * settings.
9531     *
9532     * The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
9533     *
9534     * By default, an empty `options` will be regarded as:
9535     *
9536     * Use `page-break-before: always;` CSS style to force to print to a new page.
9537     *
9538An example of `webContents.printToPDF`:
9539     */
9540    printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
9541    /**
9542     * Executes the editing command `redo` in web page.
9543     */
9544    redo(): void;
9545    /**
9546     * Reloads the current web page.
9547     */
9548    reload(): void;
9549    /**
9550     * Reloads current page and ignores cache.
9551     */
9552    reloadIgnoringCache(): void;
9553    /**
9554     * Resolves if the removal was successful.
9555     *
9556     * Removes the inserted CSS from the current web page. The stylesheet is identified
9557     * by its key, which is returned from `contents.insertCSS(css)`.
9558     */
9559    removeInsertedCSS(key: string): Promise<void>;
9560    /**
9561     * Removes the specified path from DevTools workspace.
9562     */
9563    removeWorkSpace(path: string): void;
9564    /**
9565     * Executes the editing command `replace` in web page.
9566     */
9567    replace(text: string): void;
9568    /**
9569     * Executes the editing command `replaceMisspelling` in web page.
9570     */
9571    replaceMisspelling(text: string): void;
9572    /**
9573     * resolves if the page is saved.
9574     */
9575    savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
9576    /**
9577     * Executes the editing command `selectAll` in web page.
9578     */
9579    selectAll(): void;
9580    /**
9581     * Send an asynchronous message to the renderer process via `channel`, along with
9582     * arguments. Arguments will be serialized with the Structured Clone Algorithm,
9583     * just like `postMessage`, so prototype chains will not be included. Sending
9584     * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
9585     *
9586     * > **NOTE**: Sending non-standard JavaScript types such as DOM objects or special
9587     * Electron objects is deprecated, and will begin throwing an exception starting
9588     * with Electron 9.
9589     *
9590     * The renderer process can handle the message by listening to `channel` with the
9591     * `ipcRenderer` module.
9592     *
9593An example of sending messages from the main process to the renderer process:
9594     */
9595    send(channel: string, ...args: any[]): void;
9596    /**
9597     * Sends an input `event` to the page. **Note:** The `BrowserWindow` containing the
9598     * contents needs to be focused for `sendInputEvent()` to work.
9599     */
9600    sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
9601    /**
9602     * Send an asynchronous message to a specific frame in a renderer process via
9603     * `channel`, along with arguments. Arguments will be serialized with the
9604     * Structured Clone Algorithm, just like `postMessage`, so prototype chains will
9605     * not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets
9606     * will throw an exception.
9607     *
9608     * > **NOTE**: Sending non-standard JavaScript types such as DOM objects or special
9609     * Electron objects is deprecated, and will begin throwing an exception starting
9610     * with Electron 9.
9611     *
9612     * The renderer process can handle the message by listening to `channel` with the
9613     * `ipcRenderer` module.
9614     *
9615     * If you want to get the `frameId` of a given renderer context you should use the
9616     * `webFrame.routingId` value.  E.g.
9617     *
9618You can also read `frameId` from all incoming IPC messages in the main process.
9619     */
9620    sendToFrame(frameId: number, channel: string, ...args: any[]): void;
9621    /**
9622     * Mute the audio on the current web page.
9623
9624**Deprecated**
9625     */
9626    setAudioMuted(muted: boolean): void;
9627    /**
9628     * Controls whether or not this WebContents will throttle animations and timers
9629     * when the page becomes backgrounded. This also affects the Page Visibility API.
9630     */
9631    setBackgroundThrottling(allowed: boolean): void;
9632    /**
9633     * Uses the `devToolsWebContents` as the target `WebContents` to show devtools.
9634     *
9635     * The `devToolsWebContents` must not have done any navigation, and it should not
9636     * be used for other purposes after the call.
9637     *
9638     * By default Electron manages the devtools by creating an internal `WebContents`
9639     * with native view, which developers have very limited control of. With the
9640     * `setDevToolsWebContents` method, developers can use any `WebContents` to show
9641     * the devtools in it, including `BrowserWindow`, `BrowserView` and `<webview>`
9642     * tag.
9643     *
9644     * Note that closing the devtools does not destroy the `devToolsWebContents`, it is
9645     * caller's responsibility to destroy `devToolsWebContents`.
9646     *
9647     * An example of showing devtools in a `<webview>` tag:
9648     *
9649An example of showing devtools in a `BrowserWindow`:
9650     */
9651    setDevToolsWebContents(devToolsWebContents: WebContents): void;
9652    /**
9653     * If *offscreen rendering* is enabled sets the frame rate to the specified number.
9654     * Only values between 1 and 60 are accepted.
9655
9656**Deprecated**
9657     */
9658    setFrameRate(fps: number): void;
9659    /**
9660     * Ignore application menu shortcuts while this web contents is focused.
9661     *
9662     * @experimental
9663     */
9664    setIgnoreMenuShortcuts(ignore: boolean): void;
9665    /**
9666     * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
9667     *
9668**Deprecated:** This API is no longer supported by Chromium.
9669     *
9670     * @deprecated
9671     */
9672    setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
9673    /**
9674     * Overrides the user agent for this web page.
9675
9676**Deprecated**
9677     */
9678    setUserAgent(userAgent: string): void;
9679    /**
9680     * Sets the maximum and minimum pinch-to-zoom level.
9681     *
9682     * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
9683     * call:
9684     */
9685    setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
9686    /**
9687     * Setting the WebRTC IP handling policy allows you to control which IPs are
9688     * exposed via WebRTC. See BrowserLeaks for more details.
9689     */
9690    setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
9691    /**
9692     * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
9693     * divided by 100, so 300% = 3.0.
9694     *
9695The factor must be greater than 0.0.
9696
9697**Deprecated**
9698     */
9699    setZoomFactor(factor: number): void;
9700    /**
9701     * Changes the zoom level to the specified level. The original size is 0 and each
9702     * increment above or below represents zooming 20% larger or smaller to default
9703     * limits of 300% and 50% of original size, respectively. The formula for this is
9704     * `scale := 1.2 ^ level`.
9705
9706**Deprecated**
9707     */
9708    setZoomLevel(level: number): void;
9709    /**
9710     * Shows pop-up dictionary that searches the selected word on the page.
9711     *
9712     * @platform darwin
9713     */
9714    showDefinitionForSelection(): void;
9715    /**
9716     * Sets the `item` as dragging item for current drag-drop operation, `file` is the
9717     * absolute path of the file to be dragged, and `icon` is the image showing under
9718     * the cursor when dragging.
9719     */
9720    startDrag(item: Item): void;
9721    /**
9722     * If *offscreen rendering* is enabled and not painting, start painting.
9723     */
9724    startPainting(): void;
9725    /**
9726     * Stops any pending navigation.
9727     */
9728    stop(): void;
9729    /**
9730     * Stops any `findInPage` request for the `webContents` with the provided `action`.
9731     */
9732    stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
9733    /**
9734     * If *offscreen rendering* is enabled and painting, stop painting.
9735     */
9736    stopPainting(): void;
9737    /**
9738     * Indicates whether the snapshot has been created successfully.
9739     *
9740Takes a V8 heap snapshot and saves it to `filePath`.
9741     */
9742    takeHeapSnapshot(filePath: string): Promise<void>;
9743    /**
9744     * Toggles the developer tools.
9745     */
9746    toggleDevTools(): void;
9747    /**
9748     * Executes the editing command `undo` in web page.
9749     */
9750    undo(): void;
9751    /**
9752     * Executes the editing command `unselect` in web page.
9753     */
9754    unselect(): void;
9755    audioMuted: boolean;
9756    readonly debugger: Debugger;
9757    readonly devToolsWebContents: (WebContents) | (null);
9758    frameRate: number;
9759    readonly hostWebContents: WebContents;
9760    readonly id: number;
9761    readonly session: Session;
9762    userAgent: string;
9763    zoomFactor: number;
9764    zoomLevel: number;
9765  }
9766
9767  interface WebFrame extends NodeJS.EventEmitter {
9768
9769    // Docs: http://electronjs.org/docs/api/web-frame
9770
9771    /**
9772     * Attempts to free memory that is no longer being used (like images from a
9773     * previous navigation).
9774     *
9775     * Note that blindly calling this method probably makes Electron slower since it
9776     * will have to refill these emptied caches, you should only call it if an event in
9777     * your app has occurred that makes you think your page is actually using less
9778     * memory (i.e. you have navigated from a super heavy page to a mostly empty one,
9779     * and intend to stay there).
9780     */
9781    clearCache(): void;
9782    /**
9783     * A promise that resolves with the result of the executed code or is rejected if
9784     * the result of the code is a rejected promise.
9785     *
9786     * Evaluates `code` in page.
9787     *
9788     * In the browser window some HTML APIs like `requestFullScreen` can only be
9789     * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
9790     * this limitation.
9791     */
9792    executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
9793    /**
9794     * A promise that resolves with the result of the executed code or is rejected if
9795     * the result of the code is a rejected promise.
9796     *
9797Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
9798     */
9799    executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean): Promise<any>;
9800    /**
9801     * A child of `webFrame` with the supplied `name`, `null` would be returned if
9802     * there's no such frame or if the frame is not in the current renderer process.
9803     */
9804    findFrameByName(name: string): WebFrame;
9805    /**
9806     * that has the supplied `routingId`, `null` if not found.
9807     */
9808    findFrameByRoutingId(routingId: number): WebFrame;
9809    /**
9810     * The frame element in `webFrame's` document selected by `selector`, `null` would
9811     * be returned if `selector` does not select a frame or if the frame is not in the
9812     * current renderer process.
9813     */
9814    getFrameForSelector(selector: string): WebFrame;
9815    /**
9816     * * `images` MemoryUsageDetails
9817     * * `scripts` MemoryUsageDetails
9818     * * `cssStyleSheets` MemoryUsageDetails
9819     * * `xslStyleSheets` MemoryUsageDetails
9820     * * `fonts` MemoryUsageDetails
9821     * * `other` MemoryUsageDetails
9822     *
9823     * Returns an object describing usage information of Blink's internal memory
9824     * caches.
9825
9826This will generate:
9827     */
9828    getResourceUsage(): ResourceUsage;
9829    /**
9830     * The current zoom factor.
9831     */
9832    getZoomFactor(): number;
9833    /**
9834     * The current zoom level.
9835     */
9836    getZoomLevel(): number;
9837    /**
9838     * A key for the inserted CSS that can later be used to remove the CSS via
9839     * `webFrame.removeInsertedCSS(key)`.
9840     *
9841     * Injects CSS into the current web page and returns a unique key for the inserted
9842     * stylesheet.
9843     */
9844    insertCSS(css: string): string;
9845    /**
9846     * Inserts `text` to the focused element.
9847     */
9848    insertText(text: string): void;
9849    /**
9850     * Removes the inserted CSS from the current web page. The stylesheet is identified
9851     * by its key, which is returned from `webFrame.insertCSS(css)`.
9852     */
9853    removeInsertedCSS(key: string): void;
9854    /**
9855     * Set the security origin, content security policy and name of the isolated world.
9856     * Note: If the `csp` is specified, then the `securityOrigin` also has to be
9857     * specified.
9858     */
9859    setIsolatedWorldInfo(worldId: number, info: Info): void;
9860    /**
9861     * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
9862     *
9863**Deprecated:** This API is no longer supported by Chromium.
9864     *
9865     * @deprecated
9866     */
9867    setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
9868    /**
9869     * Sets a provider for spell checking in input fields and text areas.
9870     *
9871     * If you want to use this method you must disable the builtin spellchecker when
9872     * you construct the window.
9873     *
9874     * The `provider` must be an object that has a `spellCheck` method that accepts an
9875     * array of individual words for spellchecking. The `spellCheck` function runs
9876     * asynchronously and calls the `callback` function with an array of misspelt words
9877     * when complete.
9878
9879An example of using node-spellchecker as provider:
9880     */
9881    setSpellCheckProvider(language: string, provider: Provider): void;
9882    /**
9883     * Sets the maximum and minimum pinch-to-zoom level.
9884     *
9885     * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
9886     * call:
9887     */
9888    setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
9889    /**
9890     * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
9891     * divided by 100, so 300% = 3.0.
9892
9893The factor must be greater than 0.0.
9894     */
9895    setZoomFactor(factor: number): void;
9896    /**
9897     * Changes the zoom level to the specified level. The original size is 0 and each
9898     * increment above or below represents zooming 20% larger or smaller to default
9899     * limits of 300% and 50% of original size, respectively.
9900     */
9901    setZoomLevel(level: number): void;
9902    /**
9903     * A `WebFrame | null` representing the first child frame of `webFrame`, the
9904     * property would be `null` if `webFrame` has no children or if first child is not
9905     * in the current renderer process.
9906     *
9907     */
9908    readonly firstChild: (WebFrame) | (null);
9909    /**
9910     * A `WebFrame | null` representing next sibling frame, the property would be
9911     * `null` if `webFrame` is the last frame in its parent or if the next sibling is
9912     * not in the current renderer process.
9913     *
9914     */
9915    readonly nextSibling: (WebFrame) | (null);
9916    /**
9917     * A `WebFrame | null` representing the frame which opened `webFrame`, the property
9918     * would be `null` if there's no opener or opener is not in the current renderer
9919     * process.
9920     *
9921     */
9922    readonly opener: (WebFrame) | (null);
9923    /**
9924     * A `WebFrame | null` representing parent frame of `webFrame`, the property would
9925     * be `null` if `webFrame` is top or parent is not in the current renderer process.
9926     *
9927     */
9928    readonly parent: (WebFrame) | (null);
9929    /**
9930     * An `Integer` representing the unique frame id in the current renderer process.
9931     * Distinct WebFrame instances that refer to the same underlying frame will have
9932     * the same `routingId`.
9933     *
9934     */
9935    readonly routingId: number;
9936    /**
9937     * A `WebFrame | null` representing top frame in frame hierarchy to which
9938     * `webFrame` belongs, the property would be `null` if top frame is not in the
9939     * current renderer process.
9940     *
9941     */
9942    readonly top: (WebFrame) | (null);
9943  }
9944
9945  class WebRequest {
9946
9947    // Docs: http://electronjs.org/docs/api/web-request
9948
9949    /**
9950     * The `listener` will be called with `listener(details)` when a server initiated
9951     * redirect is about to occur.
9952     */
9953    onBeforeRedirect(filter: Filter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
9954    /**
9955     * The `listener` will be called with `listener(details)` when a server initiated
9956     * redirect is about to occur.
9957     */
9958    onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
9959    /**
9960     * The `listener` will be called with `listener(details, callback)` when a request
9961     * is about to occur.
9962     *
9963     * The `uploadData` is an array of `UploadData` objects.
9964     *
9965     * The `callback` has to be called with an `response` object.
9966     *
9967Some examples of valid `urls`:
9968     */
9969    onBeforeRequest(filter: Filter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: Response) => void) => void) | (null)): void;
9970    /**
9971     * The `listener` will be called with `listener(details, callback)` when a request
9972     * is about to occur.
9973     *
9974     * The `uploadData` is an array of `UploadData` objects.
9975     *
9976     * The `callback` has to be called with an `response` object.
9977     *
9978Some examples of valid `urls`:
9979     */
9980    onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: Response) => void) => void) | (null)): void;
9981    /**
9982     * The `listener` will be called with `listener(details, callback)` before sending
9983     * an HTTP request, once the request headers are available. This may occur after a
9984     * TCP connection is made to the server, but before any http data is sent.
9985     *
9986The `callback` has to be called with a `response` object.
9987     */
9988    onBeforeSendHeaders(filter: Filter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
9989    /**
9990     * The `listener` will be called with `listener(details, callback)` before sending
9991     * an HTTP request, once the request headers are available. This may occur after a
9992     * TCP connection is made to the server, but before any http data is sent.
9993     *
9994The `callback` has to be called with a `response` object.
9995     */
9996    onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
9997    /**
9998     * The `listener` will be called with `listener(details)` when a request is
9999     * completed.
10000     */
10001    onCompleted(filter: Filter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
10002    /**
10003     * The `listener` will be called with `listener(details)` when a request is
10004     * completed.
10005     */
10006    onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
10007    /**
10008     * The `listener` will be called with `listener(details)` when an error occurs.
10009     */
10010    onErrorOccurred(filter: Filter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
10011    /**
10012     * The `listener` will be called with `listener(details)` when an error occurs.
10013     */
10014    onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
10015    /**
10016     * The `listener` will be called with `listener(details, callback)` when HTTP
10017     * response headers of a request have been received.
10018     *
10019The `callback` has to be called with a `response` object.
10020     */
10021    onHeadersReceived(filter: Filter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
10022    /**
10023     * The `listener` will be called with `listener(details, callback)` when HTTP
10024     * response headers of a request have been received.
10025     *
10026The `callback` has to be called with a `response` object.
10027     */
10028    onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
10029    /**
10030     * The `listener` will be called with `listener(details)` when first byte of the
10031     * response body is received. For HTTP requests, this means that the status line
10032     * and response headers are available.
10033     */
10034    onResponseStarted(filter: Filter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
10035    /**
10036     * The `listener` will be called with `listener(details)` when first byte of the
10037     * response body is received. For HTTP requests, this means that the status line
10038     * and response headers are available.
10039     */
10040    onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
10041    /**
10042     * The `listener` will be called with `listener(details)` just before a request is
10043     * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
10044     * response are visible by the time this listener is fired.
10045     */
10046    onSendHeaders(filter: Filter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
10047    /**
10048     * The `listener` will be called with `listener(details)` just before a request is
10049     * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
10050     * response are visible by the time this listener is fired.
10051     */
10052    onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
10053  }
10054
10055  interface WebSource {
10056
10057    // Docs: http://electronjs.org/docs/api/structures/web-source
10058
10059    code: string;
10060    /**
10061     * Default is 1.
10062     */
10063    startLine?: number;
10064    url?: string;
10065  }
10066
10067  interface WebviewTag extends HTMLElement {
10068
10069    // Docs: http://electronjs.org/docs/api/webview-tag
10070
10071    /**
10072     * Fired when a load has committed. This includes navigation within the current
10073     * document as well as subframe document-level loads, but does not include
10074     * asynchronous resource loads.
10075     */
10076    addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
10077    removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
10078    /**
10079     * Fired when the navigation is done, i.e. the spinner of the tab will stop
10080     * spinning, and the `onload` event is dispatched.
10081     */
10082    addEventListener(event: 'did-finish-load', listener: (event: Event) => void, useCapture?: boolean): this;
10083    removeEventListener(event: 'did-finish-load', listener: (event: Event) => void): this;
10084    /**
10085     * This event is like `did-finish-load`, but fired when the load failed or was
10086     * cancelled, e.g. `window.stop()` is invoked.
10087     */
10088    addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
10089    removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
10090    /**
10091     * Fired when a frame has done navigation.
10092     */
10093    addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
10094    removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
10095    /**
10096     * Corresponds to the points in time when the spinner of the tab starts spinning.
10097     */
10098    addEventListener(event: 'did-start-loading', listener: (event: Event) => void, useCapture?: boolean): this;
10099    removeEventListener(event: 'did-start-loading', listener: (event: Event) => void): this;
10100    /**
10101     * Corresponds to the points in time when the spinner of the tab stops spinning.
10102     */
10103    addEventListener(event: 'did-stop-loading', listener: (event: Event) => void, useCapture?: boolean): this;
10104    removeEventListener(event: 'did-stop-loading', listener: (event: Event) => void): this;
10105    /**
10106     * Fired when document in the given frame is loaded.
10107     */
10108    addEventListener(event: 'dom-ready', listener: (event: Event) => void, useCapture?: boolean): this;
10109    removeEventListener(event: 'dom-ready', listener: (event: Event) => void): this;
10110    /**
10111     * Fired when page title is set during navigation. `explicitSet` is false when
10112     * title is synthesized from file url.
10113     */
10114    addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
10115    removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
10116    /**
10117     * Fired when page receives favicon urls.
10118     */
10119    addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
10120    removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
10121    /**
10122     * Fired when page enters fullscreen triggered by HTML API.
10123     */
10124    addEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
10125    removeEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void): this;
10126    /**
10127     * Fired when page leaves fullscreen triggered by HTML API.
10128     */
10129    addEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
10130    removeEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void): this;
10131    /**
10132     * Fired when the guest window logs a console message.
10133     *
10134     * The following example code forwards all log messages to the embedder's console
10135     * without regard for log level or other properties.
10136     */
10137    addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
10138    removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
10139    /**
10140     * Fired when a result is available for `webview.findInPage` request.
10141     */
10142    addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
10143    removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
10144    /**
10145     * Fired when the guest page attempts to open a new browser window.
10146     *
10147The following example code opens the new url in system's default browser.
10148     */
10149    addEventListener(event: 'new-window', listener: (event: NewWindowEvent) => void, useCapture?: boolean): this;
10150    removeEventListener(event: 'new-window', listener: (event: NewWindowEvent) => void): this;
10151    /**
10152     * Emitted when a user or the page wants to start navigation. It can happen when
10153     * the `window.location` object is changed or a user clicks a link in the page.
10154     *
10155     * This event will not emit when the navigation is started programmatically with
10156     * APIs like `<webview>.loadURL` and `<webview>.back`.
10157     *
10158     * It is also not emitted during in-page navigation, such as clicking anchor links
10159     * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
10160     * this purpose.
10161
10162Calling `event.preventDefault()` does __NOT__ have any effect.
10163     */
10164    addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
10165    removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
10166    /**
10167     * Emitted when a navigation is done.
10168     *
10169     * This event is not emitted for in-page navigations, such as clicking anchor links
10170     * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
10171     * this purpose.
10172     */
10173    addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
10174    removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
10175    /**
10176     * Emitted when an in-page navigation happened.
10177     *
10178     * When in-page navigation happens, the page URL changes but does not cause
10179     * navigation outside of the page. Examples of this occurring are when anchor links
10180     * are clicked or when the DOM `hashchange` event is triggered.
10181     */
10182    addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
10183    removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
10184    /**
10185     * Fired when the guest page attempts to close itself.
10186     *
10187     * The following example code navigates the `webview` to `about:blank` when the
10188     * guest attempts to close itself.
10189     */
10190    addEventListener(event: 'close', listener: (event: Event) => void, useCapture?: boolean): this;
10191    removeEventListener(event: 'close', listener: (event: Event) => void): this;
10192    /**
10193     * Fired when the guest page has sent an asynchronous message to embedder page.
10194     *
10195     * With `sendToHost` method and `ipc-message` event you can communicate between
10196     * guest page and embedder page:
10197     */
10198    addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
10199    removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
10200    /**
10201     * Fired when the renderer process is crashed.
10202     */
10203    addEventListener(event: 'crashed', listener: (event: Event) => void, useCapture?: boolean): this;
10204    removeEventListener(event: 'crashed', listener: (event: Event) => void): this;
10205    /**
10206     * Fired when a plugin process is crashed.
10207     */
10208    addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
10209    removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
10210    /**
10211     * Fired when the WebContents is destroyed.
10212     */
10213    addEventListener(event: 'destroyed', listener: (event: Event) => void, useCapture?: boolean): this;
10214    removeEventListener(event: 'destroyed', listener: (event: Event) => void): this;
10215    /**
10216     * Emitted when media starts playing.
10217     */
10218    addEventListener(event: 'media-started-playing', listener: (event: Event) => void, useCapture?: boolean): this;
10219    removeEventListener(event: 'media-started-playing', listener: (event: Event) => void): this;
10220    /**
10221     * Emitted when media is paused or done playing.
10222     */
10223    addEventListener(event: 'media-paused', listener: (event: Event) => void, useCapture?: boolean): this;
10224    removeEventListener(event: 'media-paused', listener: (event: Event) => void): this;
10225    /**
10226     * Emitted when a page's theme color changes. This is usually due to encountering a
10227     * meta tag:
10228     */
10229    addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
10230    removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
10231    /**
10232     * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
10233     */
10234    addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
10235    removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
10236    /**
10237     * Emitted when DevTools is opened.
10238     */
10239    addEventListener(event: 'devtools-opened', listener: (event: Event) => void, useCapture?: boolean): this;
10240    removeEventListener(event: 'devtools-opened', listener: (event: Event) => void): this;
10241    /**
10242     * Emitted when DevTools is closed.
10243     */
10244    addEventListener(event: 'devtools-closed', listener: (event: Event) => void, useCapture?: boolean): this;
10245    removeEventListener(event: 'devtools-closed', listener: (event: Event) => void): this;
10246    /**
10247     * Emitted when DevTools is focused / opened.
10248     */
10249    addEventListener(event: 'devtools-focused', listener: (event: Event) => void, useCapture?: boolean): this;
10250    removeEventListener(event: 'devtools-focused', listener: (event: Event) => void): this;
10251    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
10252    addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
10253    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
10254    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
10255    /**
10256     * Whether the guest page can go back.
10257     */
10258    canGoBack(): boolean;
10259    /**
10260     * Whether the guest page can go forward.
10261     */
10262    canGoForward(): boolean;
10263    /**
10264     * Whether the guest page can go to `offset`.
10265     */
10266    canGoToOffset(offset: number): boolean;
10267    /**
10268     * Resolves with a NativeImage
10269     *
10270     * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
10271     * whole visible page.
10272     */
10273    capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
10274    /**
10275     * Clears the navigation history.
10276     */
10277    clearHistory(): void;
10278    /**
10279     * Closes the DevTools window of guest page.
10280     */
10281    closeDevTools(): void;
10282    /**
10283     * Executes editing command `copy` in page.
10284     */
10285    copy(): void;
10286    /**
10287     * Executes editing command `cut` in page.
10288     */
10289    cut(): void;
10290    /**
10291     * Executes editing command `delete` in page.
10292     */
10293    delete(): void;
10294    /**
10295     * Initiates a download of the resource at `url` without navigating.
10296     */
10297    downloadURL(url: string): void;
10298    /**
10299     * A promise that resolves with the result of the executed code or is rejected if
10300     * the result of the code is a rejected promise.
10301     *
10302     * Evaluates `code` in page. If `userGesture` is set, it will create the user
10303     * gesture context in the page. HTML APIs like `requestFullScreen`, which require
10304     * user action, can take advantage of this option for automation.
10305     */
10306    executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
10307    /**
10308     * The request id used for the request.
10309     *
10310     * Starts a request to find all matches for the `text` in the web page. The result
10311     * of the request can be obtained by subscribing to `found-in-page` event.
10312     */
10313    findInPage(text: string, options?: FindInPageOptions): number;
10314    /**
10315     * The title of guest page.
10316     */
10317    getTitle(): string;
10318    /**
10319     * The URL of guest page.
10320     */
10321    getURL(): string;
10322    /**
10323     * The user agent for guest page.
10324     */
10325    getUserAgent(): string;
10326    /**
10327     * The web contents associated with this `webview`.
10328     *
10329     * It depends on the `remote` module, it is therefore not available when this
10330     * module is disabled.
10331     *
10332     * @deprecated
10333     */
10334    getWebContents(): WebContents;
10335    /**
10336     * The WebContents ID of this `webview`.
10337     */
10338    getWebContentsId(): number;
10339    /**
10340     * the current zoom factor.
10341     */
10342    getZoomFactor(): number;
10343    /**
10344     * the current zoom level.
10345     */
10346    getZoomLevel(): number;
10347    /**
10348     * Makes the guest page go back.
10349     */
10350    goBack(): void;
10351    /**
10352     * Makes the guest page go forward.
10353     */
10354    goForward(): void;
10355    /**
10356     * Navigates to the specified absolute index.
10357     */
10358    goToIndex(index: number): void;
10359    /**
10360     * Navigates to the specified offset from the "current entry".
10361     */
10362    goToOffset(offset: number): void;
10363    /**
10364     * A promise that resolves with a key for the inserted CSS that can later be used
10365     * to remove the CSS via `<webview>.removeInsertedCSS(key)`.
10366     *
10367     * Injects CSS into the current web page and returns a unique key for the inserted
10368     * stylesheet.
10369     */
10370    insertCSS(css: string): Promise<string>;
10371    /**
10372     * Inserts `text` to the focused element.
10373     */
10374    insertText(text: string): Promise<void>;
10375    /**
10376     * Starts inspecting element at position (`x`, `y`) of guest page.
10377     */
10378    inspectElement(x: number, y: number): void;
10379    /**
10380     * Opens the DevTools for the service worker context present in the guest page.
10381     */
10382    inspectServiceWorker(): void;
10383    /**
10384     * Opens the DevTools for the shared worker context present in the guest page.
10385     */
10386    inspectSharedWorker(): void;
10387    /**
10388     * Whether guest page has been muted.
10389     */
10390    isAudioMuted(): boolean;
10391    /**
10392     * Whether the renderer process has crashed.
10393     */
10394    isCrashed(): boolean;
10395    /**
10396     * Whether audio is currently playing.
10397     */
10398    isCurrentlyAudible(): boolean;
10399    /**
10400     * Whether DevTools window of guest page is focused.
10401     */
10402    isDevToolsFocused(): boolean;
10403    /**
10404     * Whether guest page has a DevTools window attached.
10405     */
10406    isDevToolsOpened(): boolean;
10407    /**
10408     * Whether guest page is still loading resources.
10409     */
10410    isLoading(): boolean;
10411    /**
10412     * Whether the main frame (and not just iframes or frames within it) is still
10413     * loading.
10414     */
10415    isLoadingMainFrame(): boolean;
10416    /**
10417     * Whether the guest page is waiting for a first-response for the main resource of
10418     * the page.
10419     */
10420    isWaitingForResponse(): boolean;
10421    /**
10422     * The promise will resolve when the page has finished loading (see
10423     * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
10424     *
10425     * Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
10426     * the `http://` or `file://`.
10427     */
10428    loadURL(url: string, options?: LoadURLOptions): Promise<void>;
10429    /**
10430     * Opens a DevTools window for guest page.
10431     */
10432    openDevTools(): void;
10433    /**
10434     * Executes editing command `paste` in page.
10435     */
10436    paste(): void;
10437    /**
10438     * Executes editing command `pasteAndMatchStyle` in page.
10439     */
10440    pasteAndMatchStyle(): void;
10441    /**
10442     * Prints `webview`'s web page. Same as `webContents.print([options])`.
10443     */
10444    print(options?: WebviewTagPrintOptions): Promise<void>;
10445    /**
10446     * Resolves with the generated PDF data.
10447     *
10448Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
10449     */
10450    printToPDF(options: PrintToPDFOptions): Promise<Uint8Array>;
10451    /**
10452     * Executes editing command `redo` in page.
10453     */
10454    redo(): void;
10455    /**
10456     * Reloads the guest page.
10457     */
10458    reload(): void;
10459    /**
10460     * Reloads the guest page and ignores cache.
10461     */
10462    reloadIgnoringCache(): void;
10463    /**
10464     * Resolves if the removal was successful.
10465     *
10466     * Removes the inserted CSS from the current web page. The stylesheet is identified
10467     * by its key, which is returned from `<webview>.insertCSS(css)`.
10468     */
10469    removeInsertedCSS(key: string): Promise<void>;
10470    /**
10471     * Executes editing command `replace` in page.
10472     */
10473    replace(text: string): void;
10474    /**
10475     * Executes editing command `replaceMisspelling` in page.
10476     */
10477    replaceMisspelling(text: string): void;
10478    /**
10479     * Executes editing command `selectAll` in page.
10480     */
10481    selectAll(): void;
10482    /**
10483     * Send an asynchronous message to renderer process via `channel`, you can also
10484     * send arbitrary arguments. The renderer process can handle the message by
10485     * listening to the `channel` event with the `ipcRenderer` module.
10486     *
10487See webContents.send for examples.
10488     */
10489    send(channel: string, ...args: any[]): Promise<void>;
10490    /**
10491     * Sends an input `event` to the page.
10492     *
10493See webContents.sendInputEvent for detailed description of `event` object.
10494     */
10495    sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
10496    /**
10497     * Set guest page muted.
10498     */
10499    setAudioMuted(muted: boolean): void;
10500    /**
10501     * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
10502     *
10503**Deprecated:** This API is no longer supported by Chromium.
10504     *
10505     * @deprecated
10506     */
10507    setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
10508    /**
10509     * Overrides the user agent for the guest page.
10510     */
10511    setUserAgent(userAgent: string): void;
10512    /**
10513     * Sets the maximum and minimum pinch-to-zoom level.
10514     */
10515    setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
10516    /**
10517     * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
10518     * divided by 100, so 300% = 3.0.
10519     */
10520    setZoomFactor(factor: number): void;
10521    /**
10522     * Changes the zoom level to the specified level. The original size is 0 and each
10523     * increment above or below represents zooming 20% larger or smaller to default
10524     * limits of 300% and 50% of original size, respectively. The formula for this is
10525     * `scale := 1.2 ^ level`.
10526     */
10527    setZoomLevel(level: number): void;
10528    /**
10529     * Shows pop-up dictionary that searches the selected word on the page.
10530     *
10531     * @platform darwin
10532     */
10533    showDefinitionForSelection(): void;
10534    /**
10535     * Stops any pending navigation.
10536     */
10537    stop(): void;
10538    /**
10539     * Stops any `findInPage` request for the `webview` with the provided `action`.
10540     */
10541    stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
10542    /**
10543     * Executes editing command `undo` in page.
10544     */
10545    undo(): void;
10546    /**
10547     * Executes editing command `unselect` in page.
10548     */
10549    unselect(): void;
10550    /**
10551     * A `Boolean`. When this attribute is present the guest page will be allowed to
10552     * open new windows. Popups are disabled by default.
10553     */
10554    allowpopups: boolean;
10555    /**
10556     * A `String` which is a list of strings which specifies the blink features to be
10557     * disabled separated by `,`. The full list of supported feature strings can be
10558     * found in the RuntimeEnabledFeatures.json5 file.
10559     */
10560    disableblinkfeatures: string;
10561    /**
10562     * A `Boolean`. When this attribute is present the guest page will have web
10563     * security disabled. Web security is enabled by default.
10564     */
10565    disablewebsecurity: boolean;
10566    /**
10567     * A `String` which is a list of strings which specifies the blink features to be
10568     * enabled separated by `,`. The full list of supported feature strings can be
10569     * found in the RuntimeEnabledFeatures.json5 file.
10570     */
10571    enableblinkfeatures: string;
10572    /**
10573     * A `Boolean`. When this attribute is `false` the guest page in `webview` will not
10574     * have access to the `remote` module. The remote module is available by default.
10575     */
10576    enableremotemodule: boolean;
10577    /**
10578     * A `String` that sets the referrer URL for the guest page.
10579     */
10580    httpreferrer: string;
10581    /**
10582     * A `Boolean`. When this attribute is present the guest page in `webview` will
10583     * have node integration and can use node APIs like `require` and `process` to
10584     * access low level system resources. Node integration is disabled by default in
10585     * the guest page.
10586     */
10587    nodeintegration: boolean;
10588    /**
10589     * A `Boolean` for the experimental option for enabling NodeJS support in
10590     * sub-frames such as iframes inside the `webview`. All your preloads will load for
10591     * every iframe, you can use `process.isMainFrame` to determine if you are in the
10592     * main frame or not. This option is disabled by default in the guest page.
10593     */
10594    nodeintegrationinsubframes: boolean;
10595    /**
10596     * A `String` that sets the session used by the page. If `partition` starts with
10597     * `persist:`, the page will use a persistent session available to all pages in the
10598     * app with the same `partition`. if there is no `persist:` prefix, the page will
10599     * use an in-memory session. By assigning the same `partition`, multiple pages can
10600     * share the same session. If the `partition` is unset then default session of the
10601     * app will be used.
10602     *
10603     * This value can only be modified before the first navigation, since the session
10604     * of an active renderer process cannot change. Subsequent attempts to modify the
10605     * value will fail with a DOM exception.
10606     */
10607    partition: string;
10608    /**
10609     * A `Boolean`. When this attribute is present the guest page in `webview` will be
10610     * able to use browser plugins. Plugins are disabled by default.
10611     */
10612    plugins: boolean;
10613    /**
10614     * A `String` that specifies a script that will be loaded before other scripts run
10615     * in the guest page. The protocol of script's URL must be either `file:` or
10616     * `asar:`, because it will be loaded by `require` in guest page under the hood.
10617     *
10618     * When the guest page doesn't have node integration this script will still have
10619     * access to all Node APIs, but global objects injected by Node will be deleted
10620     * after this script has finished executing.
10621     *
10622     * **Note:** This option will appear as `preloadURL` (not `preload`) in the
10623     * `webPreferences` specified to the `will-attach-webview` event.
10624     */
10625    preload: string;
10626    /**
10627     * A `String` representing the visible URL. Writing to this attribute initiates
10628     * top-level navigation.
10629     *
10630     * Assigning `src` its own value will reload the current page.
10631     *
10632     * The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
10633     * world!`.
10634     */
10635    src: string;
10636    /**
10637     * A `String` that sets the user agent for the guest page before the page is
10638     * navigated to. Once the page is loaded, use the `setUserAgent` method to change
10639     * the user agent.
10640     */
10641    useragent: string;
10642    /**
10643     * A `String` which is a comma separated list of strings which specifies the web
10644     * preferences to be set on the webview. The full list of supported preference
10645     * strings can be found in BrowserWindow.
10646     *
10647     * The string follows the same format as the features string in `window.open`. A
10648     * name by itself is given a `true` boolean value. A preference can be set to
10649     * another value by including an `=`, followed by the value. Special values `yes`
10650     * and `1` are interpreted as `true`, while `no` and `0` are interpreted as
10651     * `false`.
10652     */
10653    webpreferences: string;
10654  }
10655
10656  interface AboutPanelOptionsOptions {
10657    /**
10658     * The app's name.
10659     */
10660    applicationName?: string;
10661    /**
10662     * The app's version.
10663     */
10664    applicationVersion?: string;
10665    /**
10666     * Copyright information.
10667     */
10668    copyright?: string;
10669    /**
10670     * The app's build version number.
10671     *
10672     * @platform darwin
10673     */
10674    version?: string;
10675    /**
10676     * Credit information.
10677     *
10678     * @platform darwin,win32
10679     */
10680    credits?: string;
10681    /**
10682     * List of app authors.
10683     *
10684     * @platform linux
10685     */
10686    authors?: string[];
10687    /**
10688     * The app's website.
10689     *
10690     * @platform linux
10691     */
10692    website?: string;
10693    /**
10694     * Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining
10695     * aspect ratio.
10696     *
10697     * @platform linux,win32
10698     */
10699    iconPath?: string;
10700  }
10701
10702  interface AddRepresentationOptions {
10703    /**
10704     * The scale factor to add the image representation for.
10705     */
10706    scaleFactor: number;
10707    /**
10708     * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
10709     */
10710    width?: number;
10711    /**
10712     * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
10713     */
10714    height?: number;
10715    /**
10716     * The buffer containing the raw image data.
10717     */
10718    buffer?: Buffer;
10719    /**
10720     * The data URL containing either a base 64 encoded PNG or JPEG image.
10721     */
10722    dataURL?: string;
10723  }
10724
10725  interface AnimationSettings {
10726    /**
10727     * Returns true if rich animations should be rendered. Looks at session type (e.g.
10728     * remote desktop) and accessibility settings to give guidance for heavy
10729     * animations.
10730     */
10731    shouldRenderRichAnimation: boolean;
10732    /**
10733     * Determines on a per-platform basis whether scroll animations (e.g. produced by
10734     * home/end key) should be enabled.
10735     */
10736    scrollAnimationsEnabledBySystem: boolean;
10737    /**
10738     * Determines whether the user desires reduced motion based on platform APIs.
10739     */
10740    prefersReducedMotion: boolean;
10741  }
10742
10743  interface AppDetailsOptions {
10744    /**
10745     * Window's App User Model ID. It has to be set, otherwise the other options will
10746     * have no effect.
10747     */
10748    appId?: string;
10749    /**
10750     * Window's Relaunch Icon.
10751     */
10752    appIconPath?: string;
10753    /**
10754     * Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
10755     * Default is `0`.
10756     */
10757    appIconIndex?: number;
10758    /**
10759     * Window's Relaunch Command.
10760     */
10761    relaunchCommand?: string;
10762    /**
10763     * Window's Relaunch Display Name.
10764     */
10765    relaunchDisplayName?: string;
10766  }
10767
10768  interface AuthenticationResponseDetails {
10769    url: string;
10770  }
10771
10772  interface AuthInfo {
10773    isProxy: boolean;
10774    scheme: string;
10775    host: string;
10776    port: number;
10777    realm: string;
10778  }
10779
10780  interface AutoResizeOptions {
10781    /**
10782     * If `true`, the view's width will grow and shrink together with the window.
10783     * `false` by default.
10784     */
10785    width?: boolean;
10786    /**
10787     * If `true`, the view's height will grow and shrink together with the window.
10788     * `false` by default.
10789     */
10790    height?: boolean;
10791    /**
10792     * If `true`, the view's x position and width will grow and shrink proportionally
10793     * with the window. `false` by default.
10794     */
10795    horizontal?: boolean;
10796    /**
10797     * If `true`, the view's y position and height will grow and shrink proportionally
10798     * with the window. `false` by default.
10799     */
10800    vertical?: boolean;
10801  }
10802
10803  interface BeforeSendResponse {
10804    cancel?: boolean;
10805    /**
10806     * When provided, request will be made with these headers.
10807     */
10808    requestHeaders?: Record<string, (string) | (string[])>;
10809  }
10810
10811  interface BitmapOptions {
10812    /**
10813     * Defaults to 1.0.
10814     */
10815    scaleFactor?: number;
10816  }
10817
10818  interface BlinkMemoryInfo {
10819    /**
10820     * Size of all allocated objects in Kilobytes.
10821     */
10822    allocated: number;
10823    /**
10824     * Size of all marked objects in Kilobytes.
10825     */
10826    marked: number;
10827    /**
10828     * Total allocated space in Kilobytes.
10829     */
10830    total: number;
10831  }
10832
10833  interface BrowserViewConstructorOptions {
10834    /**
10835     * See BrowserWindow.
10836     */
10837    webPreferences?: WebPreferences;
10838  }
10839
10840  interface BrowserWindowConstructorOptions {
10841    /**
10842     * Window's width in pixels. Default is `800`.
10843     */
10844    width?: number;
10845    /**
10846     * Window's height in pixels. Default is `600`.
10847     */
10848    height?: number;
10849    /**
10850     * (**required** if y is used) Window's left offset from screen. Default is to
10851     * center the window.
10852     */
10853    x?: number;
10854    /**
10855     * (**required** if x is used) Window's top offset from screen. Default is to
10856     * center the window.
10857     */
10858    y?: number;
10859    /**
10860     * The `width` and `height` would be used as web page's size, which means the
10861     * actual window's size will include window frame's size and be slightly larger.
10862     * Default is `false`.
10863     */
10864    useContentSize?: boolean;
10865    /**
10866     * Show window in the center of the screen.
10867     */
10868    center?: boolean;
10869    /**
10870     * Window's minimum width. Default is `0`.
10871     */
10872    minWidth?: number;
10873    /**
10874     * Window's minimum height. Default is `0`.
10875     */
10876    minHeight?: number;
10877    /**
10878     * Window's maximum width. Default is no limit.
10879     */
10880    maxWidth?: number;
10881    /**
10882     * Window's maximum height. Default is no limit.
10883     */
10884    maxHeight?: number;
10885    /**
10886     * Whether window is resizable. Default is `true`.
10887     */
10888    resizable?: boolean;
10889    /**
10890     * Whether window is movable. This is not implemented on Linux. Default is `true`.
10891     */
10892    movable?: boolean;
10893    /**
10894     * Whether window is minimizable. This is not implemented on Linux. Default is
10895     * `true`.
10896     */
10897    minimizable?: boolean;
10898    /**
10899     * Whether window is maximizable. This is not implemented on Linux. Default is
10900     * `true`.
10901     */
10902    maximizable?: boolean;
10903    /**
10904     * Whether window is closable. This is not implemented on Linux. Default is `true`.
10905     */
10906    closable?: boolean;
10907    /**
10908     * Whether the window can be focused. Default is `true`. On Windows setting
10909     * `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
10910     * `focusable: false` makes the window stop interacting with wm, so the window will
10911     * always stay on top in all workspaces.
10912     */
10913    focusable?: boolean;
10914    /**
10915     * Whether the window should always stay on top of other windows. Default is
10916     * `false`.
10917     */
10918    alwaysOnTop?: boolean;
10919    /**
10920     * Whether the window should show in fullscreen. When explicitly set to `false` the
10921     * fullscreen button will be hidden or disabled on macOS. Default is `false`.
10922     */
10923    fullscreen?: boolean;
10924    /**
10925     * Whether the window can be put into fullscreen mode. On macOS, also whether the
10926     * maximize/zoom button should toggle full screen mode or maximize window. Default
10927     * is `true`.
10928     */
10929    fullscreenable?: boolean;
10930    /**
10931     * Use pre-Lion fullscreen on macOS. Default is `false`.
10932     */
10933    simpleFullscreen?: boolean;
10934    /**
10935     * Whether to show the window in taskbar. Default is `false`.
10936     */
10937    skipTaskbar?: boolean;
10938    /**
10939     * The kiosk mode. Default is `false`.
10940     */
10941    kiosk?: boolean;
10942    /**
10943     * Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
10944     * defined in the HTML file loaded by `loadURL()`, this property will be ignored.
10945     */
10946    title?: string;
10947    /**
10948     * The window icon. On Windows it is recommended to use `ICO` icons to get best
10949     * visual effects, you can also leave it undefined so the executable's icon will be
10950     * used.
10951     */
10952    icon?: (NativeImage) | (string);
10953    /**
10954     * Whether window should be shown when created. Default is `true`.
10955     */
10956    show?: boolean;
10957    /**
10958     * Whether the renderer should be active when `show` is `false` and it has just
10959     * been created.  In order for `document.visibilityState` to work correctly on
10960     * first load with `show: false` you should set this to `false`.  Setting this to
10961     * `false` will cause the `ready-to-show` event to not fire.  Default is `true`.
10962     */
10963    paintWhenInitiallyHidden?: boolean;
10964    /**
10965     * Specify `false` to create a Frameless Window. Default is `true`.
10966     */
10967    frame?: boolean;
10968    /**
10969     * Specify parent window. Default is `null`.
10970     */
10971    parent?: BrowserWindow;
10972    /**
10973     * Whether this is a modal window. This only works when the window is a child
10974     * window. Default is `false`.
10975     */
10976    modal?: boolean;
10977    /**
10978     * Whether the web view accepts a single mouse-down event that simultaneously
10979     * activates the window. Default is `false`.
10980     */
10981    acceptFirstMouse?: boolean;
10982    /**
10983     * Whether to hide cursor when typing. Default is `false`.
10984     */
10985    disableAutoHideCursor?: boolean;
10986    /**
10987     * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
10988     */
10989    autoHideMenuBar?: boolean;
10990    /**
10991     * Enable the window to be resized larger than screen. Only relevant for macOS, as
10992     * other OSes allow larger-than-screen windows by default. Default is `false`.
10993     */
10994    enableLargerThanScreen?: boolean;
10995    /**
10996     * Window's background color as a hexadecimal value, like `#66CD00` or `#FFF` or
10997     * `#80FFFFFF` (alpha in #AARRGGBB format is supported if `transparent` is set to
10998     * `true`). Default is `#FFF` (white).
10999     */
11000    backgroundColor?: string;
11001    /**
11002     * Whether window should have a shadow. Default is `true`.
11003     */
11004    hasShadow?: boolean;
11005    /**
11006     * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
11007     * (fully opaque). This is only implemented on Windows and macOS.
11008     */
11009    opacity?: number;
11010    /**
11011     * Forces using dark theme for the window, only works on some GTK+3 desktop
11012     * environments. Default is `false`.
11013     */
11014    darkTheme?: boolean;
11015    /**
11016     * Makes the window transparent. Default is `false`. On Windows, does not work
11017     * unless the window is frameless.
11018     */
11019    transparent?: boolean;
11020    /**
11021     * The type of window, default is normal window. See more about this below.
11022     */
11023    type?: string;
11024    /**
11025     * The style of window title bar. Default is `default`. Possible values are:
11026     */
11027    titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
11028    /**
11029     * Set a custom position for the traffic light buttons. Can only be used with
11030     * `titleBarStyle` set to `hidden`
11031     */
11032    trafficLightPosition?: Point;
11033    /**
11034     * Shows the title in the title bar in full screen mode on macOS for all
11035     * `titleBarStyle` options. Default is `false`.
11036     */
11037    fullscreenWindowTitle?: boolean;
11038    /**
11039     * Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
11040     * window frame. Setting it to `false` will remove window shadow and window
11041     * animations. Default is `true`.
11042     */
11043    thickFrame?: boolean;
11044    /**
11045     * Add a type of vibrancy effect to the window, only on macOS. Can be
11046     * `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`,
11047     * `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`,
11048     * `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`.  Please
11049     * note that using `frame: false` in combination with a vibrancy value requires
11050     * that you use a non-default `titleBarStyle` as well. Also note that
11051     * `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been
11052     * deprecated and will be removed in an upcoming version of macOS.
11053     */
11054    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');
11055    /**
11056     * Controls the behavior on macOS when option-clicking the green stoplight button
11057     * on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
11058     * will grow to the preferred width of the web page when zoomed, `false` will cause
11059     * it to zoom to the width of the screen. This will also affect the behavior when
11060     * calling `maximize()` directly. Default is `false`.
11061     */
11062    zoomToPageWidth?: boolean;
11063    /**
11064     * Tab group name, allows opening the window as a native tab on macOS 10.12+.
11065     * Windows with the same tabbing identifier will be grouped together. This also
11066     * adds a native new tab button to your window's tab bar and allows your `app` and
11067     * window to receive the `new-window-for-tab` event.
11068     */
11069    tabbingIdentifier?: string;
11070    /**
11071     * Settings of web page's features.
11072     */
11073    webPreferences?: WebPreferences;
11074  }
11075
11076  interface CertificateTrustDialogOptions {
11077    /**
11078     * The certificate to trust/import.
11079     */
11080    certificate: Certificate;
11081    /**
11082     * The message to display to the user.
11083     */
11084    message: string;
11085  }
11086
11087  interface CertificateVerifyProcProcRequest {
11088    hostname: string;
11089    certificate: Certificate;
11090    /**
11091     * Verification result from chromium.
11092     */
11093    verificationResult: string;
11094    /**
11095     * Error code.
11096     */
11097    errorCode: number;
11098  }
11099
11100  interface ClearStorageDataOptions {
11101    /**
11102     * Should follow `window.location.origin`’s representation `scheme://host:port`.
11103     */
11104    origin?: string;
11105    /**
11106     * The types of storages to clear, can contain: `appcache`, `cookies`,
11107     * `filesystem`, `indexdb`, `localstorage`, `shadercache`, `websql`,
11108     * `serviceworkers`, `cachestorage`.
11109     */
11110    storages?: string[];
11111    /**
11112     * The types of quotas to clear, can contain: `temporary`, `persistent`,
11113     * `syncable`.
11114     */
11115    quotas?: string[];
11116  }
11117
11118  interface ClientRequestConstructorOptions {
11119    /**
11120     * The HTTP request method. Defaults to the GET method.
11121     */
11122    method?: string;
11123    /**
11124     * The request URL. Must be provided in the absolute form with the protocol scheme
11125     * specified as http or https.
11126     */
11127    url?: string;
11128    /**
11129     * The `Session` instance with which the request is associated.
11130     */
11131    session?: Session;
11132    /**
11133     * The name of the `partition` with which the request is associated. Defaults to
11134     * the empty string. The `session` option prevails on `partition`. Thus if a
11135     * `session` is explicitly specified, `partition` is ignored.
11136     */
11137    partition?: string;
11138    /**
11139     * Whether to send cookies with this request from the provided session.  This will
11140     * make the `net` request's cookie behavior match a `fetch` request. Default is
11141     * `false`.
11142     */
11143    useSessionCookies?: boolean;
11144    /**
11145     * The protocol scheme in the form 'scheme:'. Currently supported values are
11146     * 'http:' or 'https:'. Defaults to 'http:'.
11147     */
11148    protocol?: string;
11149    /**
11150     * The server host provided as a concatenation of the hostname and the port number
11151     * 'hostname:port'.
11152     */
11153    host?: string;
11154    /**
11155     * The server host name.
11156     */
11157    hostname?: string;
11158    /**
11159     * The server's listening port number.
11160     */
11161    port?: number;
11162    /**
11163     * The path part of the request URL.
11164     */
11165    path?: string;
11166    /**
11167     * The redirect mode for this request. Should be one of `follow`, `error` or
11168     * `manual`. Defaults to `follow`. When mode is `error`, any redirection will be
11169     * aborted. When mode is `manual` the redirection will be cancelled unless
11170     * `request.followRedirect` is invoked synchronously during the `redirect` event.
11171     */
11172    redirect?: string;
11173  }
11174
11175  interface Config {
11176    /**
11177     * The URL associated with the PAC file.
11178     */
11179    pacScript?: string;
11180    /**
11181     * Rules indicating which proxies to use.
11182     */
11183    proxyRules?: string;
11184    /**
11185     * Rules indicating which URLs should bypass the proxy settings.
11186     */
11187    proxyBypassRules?: string;
11188  }
11189
11190  interface ConsoleMessageEvent extends Event {
11191    level: number;
11192    message: string;
11193    line: number;
11194    sourceId: string;
11195  }
11196
11197  interface ContextMenuParams {
11198    /**
11199     * x coordinate.
11200     */
11201    x: number;
11202    /**
11203     * y coordinate.
11204     */
11205    y: number;
11206    /**
11207     * URL of the link that encloses the node the context menu was invoked on.
11208     */
11209    linkURL: string;
11210    /**
11211     * Text associated with the link. May be an empty string if the contents of the
11212     * link are an image.
11213     */
11214    linkText: string;
11215    /**
11216     * URL of the top level page that the context menu was invoked on.
11217     */
11218    pageURL: string;
11219    /**
11220     * URL of the subframe that the context menu was invoked on.
11221     */
11222    frameURL: string;
11223    /**
11224     * Source URL for the element that the context menu was invoked on. Elements with
11225     * source URLs are images, audio and video.
11226     */
11227    srcURL: string;
11228    /**
11229     * Type of the node the context menu was invoked on. Can be `none`, `image`,
11230     * `audio`, `video`, `canvas`, `file` or `plugin`.
11231     */
11232    mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
11233    /**
11234     * Whether the context menu was invoked on an image which has non-empty contents.
11235     */
11236    hasImageContents: boolean;
11237    /**
11238     * Whether the context is editable.
11239     */
11240    isEditable: boolean;
11241    /**
11242     * Text of the selection that the context menu was invoked on.
11243     */
11244    selectionText: string;
11245    /**
11246     * Title or alt text of the selection that the context was invoked on.
11247     */
11248    titleText: string;
11249    /**
11250     * The misspelled word under the cursor, if any.
11251     */
11252    misspelledWord: string;
11253    /**
11254     * An array of suggested words to show the user to replace the `misspelledWord`.
11255     * Only available if there is a misspelled word and spellchecker is enabled.
11256     */
11257    dictionarySuggestions: string[];
11258    /**
11259     * The character encoding of the frame on which the menu was invoked.
11260     */
11261    frameCharset: string;
11262    /**
11263     * If the context menu was invoked on an input field, the type of that field.
11264     * Possible values are `none`, `plainText`, `password`, `other`.
11265     */
11266    inputFieldType: string;
11267    /**
11268     * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
11269     * `touch` or `touchMenu`.
11270     */
11271    menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu');
11272    /**
11273     * The flags for the media element the context menu was invoked on.
11274     */
11275    mediaFlags: MediaFlags;
11276    /**
11277     * These flags indicate whether the renderer believes it is able to perform the
11278     * corresponding action.
11279     */
11280    editFlags: EditFlags;
11281  }
11282
11283  interface CookiesGetFilter {
11284    /**
11285     * Retrieves cookies which are associated with `url`. Empty implies retrieving
11286     * cookies of all URLs.
11287     */
11288    url?: string;
11289    /**
11290     * Filters cookies by name.
11291     */
11292    name?: string;
11293    /**
11294     * Retrieves cookies whose domains match or are subdomains of `domains`.
11295     */
11296    domain?: string;
11297    /**
11298     * Retrieves cookies whose path matches `path`.
11299     */
11300    path?: string;
11301    /**
11302     * Filters cookies by their Secure property.
11303     */
11304    secure?: boolean;
11305    /**
11306     * Filters out session or persistent cookies.
11307     */
11308    session?: boolean;
11309  }
11310
11311  interface CookiesSetDetails {
11312    /**
11313     * The URL to associate the cookie with. The promise will be rejected if the URL is
11314     * invalid.
11315     */
11316    url: string;
11317    /**
11318     * The name of the cookie. Empty by default if omitted.
11319     */
11320    name?: string;
11321    /**
11322     * The value of the cookie. Empty by default if omitted.
11323     */
11324    value?: string;
11325    /**
11326     * The domain of the cookie; this will be normalized with a preceding dot so that
11327     * it's also valid for subdomains. Empty by default if omitted.
11328     */
11329    domain?: string;
11330    /**
11331     * The path of the cookie. Empty by default if omitted.
11332     */
11333    path?: string;
11334    /**
11335     * Whether the cookie should be marked as Secure. Defaults to false.
11336     */
11337    secure?: boolean;
11338    /**
11339     * Whether the cookie should be marked as HTTP only. Defaults to false.
11340     */
11341    httpOnly?: boolean;
11342    /**
11343     * The expiration date of the cookie as the number of seconds since the UNIX epoch.
11344     * If omitted then the cookie becomes a session cookie and will not be retained
11345     * between sessions.
11346     */
11347    expirationDate?: number;
11348  }
11349
11350  interface CrashReporterStartOptions {
11351    companyName: string;
11352    /**
11353     * URL that crash reports will be sent to as POST.
11354     */
11355    submitURL: string;
11356    /**
11357     * Defaults to `app.name`.
11358     */
11359    productName?: string;
11360    /**
11361     * Whether crash reports should be sent to the server. Default is `true`.
11362     */
11363    uploadToServer?: boolean;
11364    /**
11365     * Default is `false`.
11366     */
11367    ignoreSystemCrashHandler?: boolean;
11368    /**
11369     * An object you can define that will be sent along with the report. Only string
11370     * properties are sent correctly. Nested objects are not supported. When using
11371     * Windows, the property names and values must be fewer than 64 characters.
11372     */
11373    extra?: Record<string, string>;
11374    /**
11375     * Directory to store the crash reports temporarily (only used when the crash
11376     * reporter is started via `process.crashReporter.start`).
11377     */
11378    crashesDirectory?: string;
11379  }
11380
11381  interface CreateFromBitmapOptions {
11382    width: number;
11383    height: number;
11384    /**
11385     * Defaults to 1.0.
11386     */
11387    scaleFactor?: number;
11388  }
11389
11390  interface CreateFromBufferOptions {
11391    /**
11392     * Required for bitmap buffers.
11393     */
11394    width?: number;
11395    /**
11396     * Required for bitmap buffers.
11397     */
11398    height?: number;
11399    /**
11400     * Defaults to 1.0.
11401     */
11402    scaleFactor?: number;
11403  }
11404
11405  interface CreateInterruptedDownloadOptions {
11406    /**
11407     * Absolute path of the download.
11408     */
11409    path: string;
11410    /**
11411     * Complete URL chain for the download.
11412     */
11413    urlChain: string[];
11414    mimeType?: string;
11415    /**
11416     * Start range for the download.
11417     */
11418    offset: number;
11419    /**
11420     * Total length of the download.
11421     */
11422    length: number;
11423    /**
11424     * Last-Modified header value.
11425     */
11426    lastModified?: string;
11427    /**
11428     * ETag header value.
11429     */
11430    eTag?: string;
11431    /**
11432     * Time when download was started in number of seconds since UNIX epoch.
11433     */
11434    startTime?: number;
11435  }
11436
11437  interface Data {
11438    text?: string;
11439    html?: string;
11440    image?: NativeImage;
11441    rtf?: string;
11442    /**
11443     * The title of the URL at `text`.
11444     */
11445    bookmark?: string;
11446  }
11447
11448  interface Details {
11449    /**
11450     * The security orign of the `media` check.
11451     */
11452    securityOrigin: string;
11453    /**
11454     * The type of media access being requested, can be `video`, `audio` or `unknown`
11455     */
11456    mediaType: ('video' | 'audio' | 'unknown');
11457    /**
11458     * The last URL the requesting frame loaded
11459     */
11460    requestingUrl: string;
11461    /**
11462     * Whether the frame making the request is the main frame
11463     */
11464    isMainFrame: boolean;
11465  }
11466
11467  interface DidChangeThemeColorEvent extends Event {
11468    themeColor: string;
11469  }
11470
11471  interface DidFailLoadEvent extends Event {
11472    errorCode: number;
11473    errorDescription: string;
11474    validatedURL: string;
11475    isMainFrame: boolean;
11476  }
11477
11478  interface DidFrameFinishLoadEvent extends Event {
11479    isMainFrame: boolean;
11480  }
11481
11482  interface DidNavigateEvent extends Event {
11483    url: string;
11484  }
11485
11486  interface DidNavigateInPageEvent extends Event {
11487    isMainFrame: boolean;
11488    url: string;
11489  }
11490
11491  interface DisplayBalloonOptions {
11492    /**
11493     * Icon to use when `iconType` is `custom`.
11494     */
11495    icon?: (NativeImage) | (string);
11496    /**
11497     * Can be `none`, `info`, `warning`, `error` or `custom`. Default is `custom`.
11498     */
11499    iconType?: ('none' | 'info' | 'warning' | 'error' | 'custom');
11500    title: string;
11501    content: string;
11502    /**
11503     * The large version of the icon should be used. Default is `true`. Maps to
11504     * `NIIF_LARGE_ICON`.
11505     */
11506    largeIcon?: boolean;
11507    /**
11508     * Do not play the associated sound. Default is `false`. Maps to `NIIF_NOSOUND`.
11509     */
11510    noSound?: boolean;
11511    /**
11512     * Do not display the balloon notification if the current user is in "quiet time".
11513     * Default is `false`. Maps to `NIIF_RESPECT_QUIET_TIME`.
11514     */
11515    respectQuietTime?: boolean;
11516  }
11517
11518  interface EnableNetworkEmulationOptions {
11519    /**
11520     * Whether to emulate network outage. Defaults to false.
11521     */
11522    offline?: boolean;
11523    /**
11524     * RTT in ms. Defaults to 0 which will disable latency throttling.
11525     */
11526    latency?: number;
11527    /**
11528     * Download rate in Bps. Defaults to 0 which will disable download throttling.
11529     */
11530    downloadThroughput?: number;
11531    /**
11532     * Upload rate in Bps. Defaults to 0 which will disable upload throttling.
11533     */
11534    uploadThroughput?: number;
11535  }
11536
11537  interface FeedURLOptions {
11538    url: string;
11539    /**
11540     * HTTP request headers.
11541     *
11542     * @platform darwin
11543     */
11544    headers?: Record<string, string>;
11545    /**
11546     * Either `json` or `default`, see the Squirrel.Mac README for more information.
11547     *
11548     * @platform darwin
11549     */
11550    serverType?: string;
11551  }
11552
11553  interface FileIconOptions {
11554    size: ('small' | 'normal' | 'large');
11555  }
11556
11557  interface Filter {
11558    /**
11559     * Array of URL patterns that will be used to filter out the requests that do not
11560     * match the URL patterns.
11561     */
11562    urls: string[];
11563  }
11564
11565  interface FindInPageOptions {
11566    /**
11567     * Whether to search forward or backward, defaults to `true`.
11568     */
11569    forward?: boolean;
11570    /**
11571     * Whether the operation is first request or a follow up, defaults to `false`.
11572     */
11573    findNext?: boolean;
11574    /**
11575     * Whether search should be case-sensitive, defaults to `false`.
11576     */
11577    matchCase?: boolean;
11578    /**
11579     * Whether to look only at the start of words. defaults to `false`.
11580     */
11581    wordStart?: boolean;
11582    /**
11583     * When combined with `wordStart`, accepts a match in the middle of a word if the
11584     * match begins with an uppercase letter followed by a lowercase or non-letter.
11585     * Accepts several other intra-word matches, defaults to `false`.
11586     */
11587    medialCapitalAsWordStart?: boolean;
11588  }
11589
11590  interface FocusOptions {
11591    /**
11592     * Make the receiver the active app even if another app is currently active.
11593     *
11594     * @platform darwin
11595     */
11596    steal: boolean;
11597  }
11598
11599  interface FoundInPageEvent extends Event {
11600    result: FoundInPageResult;
11601  }
11602
11603  interface FromPartitionOptions {
11604    /**
11605     * Whether to enable cache.
11606     */
11607    cache: boolean;
11608  }
11609
11610  interface HeadersReceivedResponse {
11611    cancel?: boolean;
11612    /**
11613     * When provided, the server is assumed to have responded with these headers.
11614     */
11615    responseHeaders?: Record<string, (string) | (string[])>;
11616    /**
11617     * Should be provided when overriding `responseHeaders` to change header status
11618     * otherwise original response header's status will be used.
11619     */
11620    statusLine?: string;
11621  }
11622
11623  interface HeapStatistics {
11624    totalHeapSize: number;
11625    totalHeapSizeExecutable: number;
11626    totalPhysicalSize: number;
11627    totalAvailableSize: number;
11628    usedHeapSize: number;
11629    heapSizeLimit: number;
11630    mallocedMemory: number;
11631    peakMallocedMemory: number;
11632    doesZapGarbage: boolean;
11633  }
11634
11635  interface IgnoreMouseEventsOptions {
11636    /**
11637     * If true, forwards mouse move messages to Chromium, enabling mouse related events
11638     * such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false,
11639     * forwarding is always disabled regardless of this value.
11640     *
11641     * @platform darwin,win32
11642     */
11643    forward?: boolean;
11644  }
11645
11646  interface ImportCertificateOptions {
11647    /**
11648     * Path for the pkcs12 file.
11649     */
11650    certificate: string;
11651    /**
11652     * Passphrase for the certificate.
11653     */
11654    password: string;
11655  }
11656
11657  interface Info {
11658    /**
11659     * Security origin for the isolated world.
11660     */
11661    securityOrigin?: string;
11662    /**
11663     * Content Security Policy for the isolated world.
11664     */
11665    csp?: string;
11666    /**
11667     * Name for isolated world. Useful in devtools.
11668     */
11669    name?: string;
11670  }
11671
11672  interface Input {
11673    /**
11674     * Either `keyUp` or `keyDown`.
11675     */
11676    type: string;
11677    /**
11678     * Equivalent to KeyboardEvent.key.
11679     */
11680    key: string;
11681    /**
11682     * Equivalent to KeyboardEvent.code.
11683     */
11684    code: string;
11685    /**
11686     * Equivalent to KeyboardEvent.repeat.
11687     */
11688    isAutoRepeat: boolean;
11689    /**
11690     * Equivalent to KeyboardEvent.shiftKey.
11691     */
11692    shift: boolean;
11693    /**
11694     * Equivalent to KeyboardEvent.controlKey.
11695     */
11696    control: boolean;
11697    /**
11698     * Equivalent to KeyboardEvent.altKey.
11699     */
11700    alt: boolean;
11701    /**
11702     * Equivalent to KeyboardEvent.metaKey.
11703     */
11704    meta: boolean;
11705  }
11706
11707  interface InsertCSSOptions {
11708    /**
11709     * Can be either 'user' or 'author'; Specifying 'user' enables you to prevent
11710     * websites from overriding the CSS you insert. Default is 'author'.
11711     */
11712    cssOrigin?: string;
11713  }
11714
11715  interface IpcMessageEvent extends Event {
11716    channel: string;
11717    args: any[];
11718  }
11719
11720  interface Item {
11721    /**
11722     * The path(s) to the file(s) being dragged.
11723     */
11724    file: (string[]) | (string);
11725    /**
11726     * The image must be non-empty on macOS.
11727     */
11728    icon: (NativeImage) | (string);
11729  }
11730
11731  interface JumpListSettings {
11732    /**
11733     * The minimum number of items that will be shown in the Jump List (for a more
11734     * detailed description of this value see the MSDN docs).
11735     */
11736    minItems: number;
11737    /**
11738     * Array of `JumpListItem` objects that correspond to items that the user has
11739     * explicitly removed from custom categories in the Jump List. These items must not
11740     * be re-added to the Jump List in the **next** call to `app.setJumpList()`,
11741     * Windows will not display any custom category that contains any of the removed
11742     * items.
11743     */
11744    removedItems: JumpListItem[];
11745  }
11746
11747  interface LoadCommitEvent extends Event {
11748    url: string;
11749    isMainFrame: boolean;
11750  }
11751
11752  interface LoadFileOptions {
11753    /**
11754     * Passed to `url.format()`.
11755     */
11756    query?: Record<string, string>;
11757    /**
11758     * Passed to `url.format()`.
11759     */
11760    search?: string;
11761    /**
11762     * Passed to `url.format()`.
11763     */
11764    hash?: string;
11765  }
11766
11767  interface LoadURLOptions {
11768    /**
11769     * An HTTP Referrer url.
11770     */
11771    httpReferrer?: (string) | (Referrer);
11772    /**
11773     * A user agent originating the request.
11774     */
11775    userAgent?: string;
11776    /**
11777     * Extra headers separated by "\n"
11778     */
11779    extraHeaders?: string;
11780    postData?: (UploadRawData[]) | (UploadFile[]) | (UploadBlob[]);
11781    /**
11782     * Base url (with trailing path separator) for files to be loaded by the data url.
11783     * This is needed only if the specified `url` is a data url and needs to load other
11784     * files.
11785     */
11786    baseURLForDataURL?: string;
11787  }
11788
11789  interface LoginItemSettings {
11790    /**
11791     * `true` if the app is set to open at login.
11792     */
11793    openAtLogin: boolean;
11794    /**
11795     * `true` if the app is set to open as hidden at login. This setting is not
11796     * available on MAS builds.
11797     *
11798     * @platform darwin
11799     */
11800    openAsHidden: boolean;
11801    /**
11802     * `true` if the app was opened at login automatically. This setting is not
11803     * available on MAS builds.
11804     *
11805     * @platform darwin
11806     */
11807    wasOpenedAtLogin: boolean;
11808    /**
11809     * `true` if the app was opened as a hidden login item. This indicates that the app
11810     * should not open any windows at startup. This setting is not available on MAS
11811     * builds.
11812     *
11813     * @platform darwin
11814     */
11815    wasOpenedAsHidden: boolean;
11816    /**
11817     * `true` if the app was opened as a login item that should restore the state from
11818     * the previous session. This indicates that the app should restore the windows
11819     * that were open the last time the app was closed. This setting is not available
11820     * on MAS builds.
11821     *
11822     * @platform darwin
11823     */
11824    restoreState: boolean;
11825  }
11826
11827  interface LoginItemSettingsOptions {
11828    /**
11829     * The executable path to compare against. Defaults to `process.execPath`.
11830     *
11831     * @platform win32
11832     */
11833    path?: string;
11834    /**
11835     * The command-line arguments to compare against. Defaults to an empty array.
11836     *
11837     * @platform win32
11838     */
11839    args?: string[];
11840  }
11841
11842  interface MenuItemConstructorOptions {
11843    /**
11844     * Will be called with `click(menuItem, browserWindow, event)` when the menu item
11845     * is clicked.
11846     */
11847    click?: (menuItem: MenuItem, browserWindow: BrowserWindow, event: KeyboardEvent) => void;
11848    /**
11849     * Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`,
11850     * `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`,
11851     * `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`,
11852     * `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`,
11853     * `stopSpeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`,
11854     * `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`,
11855     * `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`,
11856     * `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when
11857     * specified the `click` property will be ignored. See roles.
11858     */
11859    role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'startSpeaking' | 'stopSpeaking' | 'close' | 'minimize' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
11860    /**
11861     * Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
11862     */
11863    type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
11864    label?: string;
11865    sublabel?: string;
11866    /**
11867     * Hover text for this menu item.
11868     *
11869     * @platform darwin
11870     */
11871    toolTip?: string;
11872    accelerator?: Accelerator;
11873    icon?: (NativeImage) | (string);
11874    /**
11875     * If false, the menu item will be greyed out and unclickable.
11876     */
11877    enabled?: boolean;
11878    /**
11879     * default is `true`, and when `false` will prevent the accelerator from triggering
11880     * the item if the item is not visible`.
11881     *
11882     * @platform darwin
11883     */
11884    acceleratorWorksWhenHidden?: boolean;
11885    /**
11886     * If false, the menu item will be entirely hidden.
11887     */
11888    visible?: boolean;
11889    /**
11890     * Should only be specified for `checkbox` or `radio` type menu items.
11891     */
11892    checked?: boolean;
11893    /**
11894     * If false, the accelerator won't be registered with the system, but it will still
11895     * be displayed. Defaults to true.
11896     *
11897     * @platform linux,win32
11898     */
11899    registerAccelerator?: boolean;
11900    /**
11901     * Should be specified for `submenu` type menu items. If `submenu` is specified,
11902     * the `type: 'submenu'` can be omitted. If the value is not a `Menu` then it will
11903     * be automatically converted to one using `Menu.buildFromTemplate`.
11904     */
11905    submenu?: (MenuItemConstructorOptions[]) | (Menu);
11906    /**
11907     * Unique within a single menu. If defined then it can be used as a reference to
11908     * this item by the position attribute.
11909     */
11910    id?: string;
11911    /**
11912     * Inserts this item before the item with the specified label. If the referenced
11913     * item doesn't exist the item will be inserted at the end of  the menu. Also
11914     * implies that the menu item in question should be placed in the same “group” as
11915     * the item.
11916     */
11917    before?: string[];
11918    /**
11919     * Inserts this item after the item with the specified label. If the referenced
11920     * item doesn't exist the item will be inserted at the end of the menu.
11921     */
11922    after?: string[];
11923    /**
11924     * Provides a means for a single context menu to declare the placement of their
11925     * containing group before the containing group of the item with the specified
11926     * label.
11927     */
11928    beforeGroupContaining?: string[];
11929    /**
11930     * Provides a means for a single context menu to declare the placement of their
11931     * containing group after the containing group of the item with the specified
11932     * label.
11933     */
11934    afterGroupContaining?: string[];
11935  }
11936
11937  interface MessageBoxOptions {
11938    /**
11939     * Can be `"none"`, `"info"`, `"error"`, `"question"` or `"warning"`. On Windows,
11940     * `"question"` displays the same icon as `"info"`, unless you set an icon using
11941     * the `"icon"` option. On macOS, both `"warning"` and `"error"` display the same
11942     * warning icon.
11943     */
11944    type?: string;
11945    /**
11946     * Array of texts for buttons. On Windows, an empty array will result in one button
11947     * labeled "OK".
11948     */
11949    buttons?: string[];
11950    /**
11951     * Index of the button in the buttons array which will be selected by default when
11952     * the message box opens.
11953     */
11954    defaultId?: number;
11955    /**
11956     * Title of the message box, some platforms will not show it.
11957     */
11958    title?: string;
11959    /**
11960     * Content of the message box.
11961     */
11962    message: string;
11963    /**
11964     * Extra information of the message.
11965     */
11966    detail?: string;
11967    /**
11968     * If provided, the message box will include a checkbox with the given label.
11969     */
11970    checkboxLabel?: string;
11971    /**
11972     * Initial checked state of the checkbox. `false` by default.
11973     */
11974    checkboxChecked?: boolean;
11975    icon?: NativeImage;
11976    /**
11977     * The index of the button to be used to cancel the dialog, via the `Esc` key. By
11978     * default this is assigned to the first button with "cancel" or "no" as the label.
11979     * If no such labeled buttons exist and this option is not set, `0` will be used as
11980     * the return value.
11981     */
11982    cancelId?: number;
11983    /**
11984     * On Windows Electron will try to figure out which one of the `buttons` are common
11985     * buttons (like "Cancel" or "Yes"), and show the others as command links in the
11986     * dialog. This can make the dialog appear in the style of modern Windows apps. If
11987     * you don't like this behavior, you can set `noLink` to `true`.
11988     */
11989    noLink?: boolean;
11990    /**
11991     * Normalize the keyboard access keys across platforms. Default is `false`.
11992     * Enabling this assumes `&` is used in the button labels for the placement of the
11993     * keyboard shortcut access key and labels will be converted so they work correctly
11994     * on each platform, `&` characters are removed on macOS, converted to `_` on
11995     * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
11996     * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
11997     * via `Alt-W` on Windows and Linux.
11998     */
11999    normalizeAccessKeys?: boolean;
12000  }
12001
12002  interface MessageBoxReturnValue {
12003    /**
12004     * The index of the clicked button.
12005     */
12006    response: number;
12007    /**
12008     * The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.
12009     */
12010    checkboxChecked: boolean;
12011  }
12012
12013  interface MessageBoxSyncOptions {
12014    /**
12015     * Can be `"none"`, `"info"`, `"error"`, `"question"` or `"warning"`. On Windows,
12016     * `"question"` displays the same icon as `"info"`, unless you set an icon using
12017     * the `"icon"` option. On macOS, both `"warning"` and `"error"` display the same
12018     * warning icon.
12019     */
12020    type?: string;
12021    /**
12022     * Array of texts for buttons. On Windows, an empty array will result in one button
12023     * labeled "OK".
12024     */
12025    buttons?: string[];
12026    /**
12027     * Index of the button in the buttons array which will be selected by default when
12028     * the message box opens.
12029     */
12030    defaultId?: number;
12031    /**
12032     * Title of the message box, some platforms will not show it.
12033     */
12034    title?: string;
12035    /**
12036     * Content of the message box.
12037     */
12038    message: string;
12039    /**
12040     * Extra information of the message.
12041     */
12042    detail?: string;
12043    /**
12044     * If provided, the message box will include a checkbox with the given label.
12045     */
12046    checkboxLabel?: string;
12047    /**
12048     * Initial checked state of the checkbox. `false` by default.
12049     */
12050    checkboxChecked?: boolean;
12051    icon?: (NativeImage) | (string);
12052    /**
12053     * The index of the button to be used to cancel the dialog, via the `Esc` key. By
12054     * default this is assigned to the first button with "cancel" or "no" as the label.
12055     * If no such labeled buttons exist and this option is not set, `0` will be used as
12056     * the return value.
12057     */
12058    cancelId?: number;
12059    /**
12060     * On Windows Electron will try to figure out which one of the `buttons` are common
12061     * buttons (like "Cancel" or "Yes"), and show the others as command links in the
12062     * dialog. This can make the dialog appear in the style of modern Windows apps. If
12063     * you don't like this behavior, you can set `noLink` to `true`.
12064     */
12065    noLink?: boolean;
12066    /**
12067     * Normalize the keyboard access keys across platforms. Default is `false`.
12068     * Enabling this assumes `&` is used in the button labels for the placement of the
12069     * keyboard shortcut access key and labels will be converted so they work correctly
12070     * on each platform, `&` characters are removed on macOS, converted to `_` on
12071     * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
12072     * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
12073     * via `Alt-W` on Windows and Linux.
12074     */
12075    normalizeAccessKeys?: boolean;
12076  }
12077
12078  interface MoveToApplicationsFolderOptions {
12079    /**
12080     * A handler for potential conflict in move failure.
12081     */
12082    conflictHandler?: (conflictType: 'exists' | 'existsAndRunning') => boolean;
12083  }
12084
12085  interface NewWindowEvent extends Event {
12086    url: string;
12087    frameName: string;
12088    /**
12089     * Can be `default`, `foreground-tab`, `background-tab`, `new-window`,
12090     * `save-to-disk` and `other`.
12091     */
12092    disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other');
12093    /**
12094     * The options which should be used for creating the new `BrowserWindow`.
12095     */
12096    options: BrowserWindowConstructorOptions;
12097  }
12098
12099  interface NotificationConstructorOptions {
12100    /**
12101     * A title for the notification, which will be shown at the top of the notification
12102     * window when it is shown.
12103     */
12104    title: string;
12105    /**
12106     * A subtitle for the notification, which will be displayed below the title.
12107     *
12108     * @platform darwin
12109     */
12110    subtitle?: string;
12111    /**
12112     * The body text of the notification, which will be displayed below the title or
12113     * subtitle.
12114     */
12115    body: string;
12116    /**
12117     * Whether or not to emit an OS notification noise when showing the notification.
12118     */
12119    silent?: boolean;
12120    /**
12121     * An icon to use in the notification.
12122     */
12123    icon?: (string) | (NativeImage);
12124    /**
12125     * Whether or not to add an inline reply option to the notification.
12126     *
12127     * @platform darwin
12128     */
12129    hasReply?: boolean;
12130    /**
12131     * The timeout duration of the notification. Can be 'default' or 'never'.
12132     *
12133     * @platform linux,win32
12134     */
12135    timeoutType?: ('default' | 'never');
12136    /**
12137     * The placeholder to write in the inline reply input field.
12138     *
12139     * @platform darwin
12140     */
12141    replyPlaceholder?: string;
12142    /**
12143     * The name of the sound file to play when the notification is shown.
12144     *
12145     * @platform darwin
12146     */
12147    sound?: string;
12148    /**
12149     * The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
12150     *
12151     * @platform linux
12152     */
12153    urgency?: ('normal' | 'critical' | 'low');
12154    /**
12155     * Actions to add to the notification. Please read the available actions and
12156     * limitations in the `NotificationAction` documentation.
12157     *
12158     * @platform darwin
12159     */
12160    actions?: NotificationAction[];
12161    /**
12162     * A custom title for the close button of an alert. An empty string will cause the
12163     * default localized text to be used.
12164     *
12165     * @platform darwin
12166     */
12167    closeButtonText?: string;
12168  }
12169
12170  interface OnBeforeRedirectListenerDetails {
12171    id: number;
12172    url: string;
12173    method: string;
12174    webContentsId?: number;
12175    resourceType: string;
12176    referrer: string;
12177    timestamp: number;
12178    redirectURL: string;
12179    statusCode: number;
12180    statusLine: string;
12181    /**
12182     * The server IP address that the request was actually sent to.
12183     */
12184    ip?: string;
12185    fromCache: boolean;
12186    responseHeaders?: Record<string, string[]>;
12187  }
12188
12189  interface OnBeforeRequestListenerDetails {
12190    id: number;
12191    url: string;
12192    method: string;
12193    webContentsId?: number;
12194    resourceType: string;
12195    referrer: string;
12196    timestamp: number;
12197    uploadData: UploadData[];
12198  }
12199
12200  interface OnBeforeSendHeadersListenerDetails {
12201    id: number;
12202    url: string;
12203    method: string;
12204    webContentsId?: number;
12205    resourceType: string;
12206    referrer: string;
12207    timestamp: number;
12208    requestHeaders: Record<string, string>;
12209  }
12210
12211  interface OnCompletedListenerDetails {
12212    id: number;
12213    url: string;
12214    method: string;
12215    webContentsId?: number;
12216    resourceType: string;
12217    referrer: string;
12218    timestamp: number;
12219    responseHeaders?: Record<string, string[]>;
12220    fromCache: boolean;
12221    statusCode: number;
12222    statusLine: string;
12223    error: string;
12224  }
12225
12226  interface OnErrorOccurredListenerDetails {
12227    id: number;
12228    url: string;
12229    method: string;
12230    webContentsId?: number;
12231    resourceType: string;
12232    referrer: string;
12233    timestamp: number;
12234    fromCache: boolean;
12235    /**
12236     * The error description.
12237     */
12238    error: string;
12239  }
12240
12241  interface OnHeadersReceivedListenerDetails {
12242    id: number;
12243    url: string;
12244    method: string;
12245    webContentsId?: number;
12246    resourceType: string;
12247    referrer: string;
12248    timestamp: number;
12249    statusLine: string;
12250    statusCode: number;
12251    requestHeaders: Record<string, string>;
12252    responseHeaders?: Record<string, string[]>;
12253  }
12254
12255  interface OnResponseStartedListenerDetails {
12256    id: number;
12257    url: string;
12258    method: string;
12259    webContentsId?: number;
12260    resourceType: string;
12261    referrer: string;
12262    timestamp: number;
12263    responseHeaders?: Record<string, string[]>;
12264    /**
12265     * Indicates whether the response was fetched from disk cache.
12266     */
12267    fromCache: boolean;
12268    statusCode: number;
12269    statusLine: string;
12270  }
12271
12272  interface OnSendHeadersListenerDetails {
12273    id: number;
12274    url: string;
12275    method: string;
12276    webContentsId?: number;
12277    resourceType: string;
12278    referrer: string;
12279    timestamp: number;
12280    requestHeaders: Record<string, string>;
12281  }
12282
12283  interface OpenDevToolsOptions {
12284    /**
12285     * Opens the devtools with specified dock state, can be `right`, `bottom`,
12286     * `undocked`, `detach`. Defaults to last used dock state. In `undocked` mode it's
12287     * possible to dock back. In `detach` mode it's not.
12288     */
12289    mode: ('right' | 'bottom' | 'undocked' | 'detach');
12290    /**
12291     * Whether to bring the opened devtools window to the foreground. The default is
12292     * `true`.
12293     */
12294    activate?: boolean;
12295  }
12296
12297  interface OpenDialogOptions {
12298    title?: string;
12299    defaultPath?: string;
12300    /**
12301     * Custom label for the confirmation button, when left empty the default label will
12302     * be used.
12303     */
12304    buttonLabel?: string;
12305    filters?: FileFilter[];
12306    /**
12307     * Contains which features the dialog should use. The following values are
12308     * supported:
12309     */
12310    properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
12311    /**
12312     * Message to display above input boxes.
12313     *
12314     * @platform darwin
12315     */
12316    message?: string;
12317    /**
12318     * Create security scoped bookmarks when packaged for the Mac App Store.
12319     *
12320     * @platform darwin,mas
12321     */
12322    securityScopedBookmarks?: boolean;
12323  }
12324
12325  interface OpenDialogReturnValue {
12326    /**
12327     * whether or not the dialog was canceled.
12328     */
12329    canceled: boolean;
12330    /**
12331     * An array of file paths chosen by the user. If the dialog is cancelled this will
12332     * be an empty array.
12333     */
12334    filePaths: string[];
12335    /**
12336     * An array matching the `filePaths` array of base64 encoded strings which contains
12337     * security scoped bookmark data. `securityScopedBookmarks` must be enabled for
12338     * this to be populated. (For return values, see table here.)
12339     *
12340     * @platform darwin,mas
12341     */
12342    bookmarks?: string[];
12343  }
12344
12345  interface OpenDialogSyncOptions {
12346    title?: string;
12347    defaultPath?: string;
12348    /**
12349     * Custom label for the confirmation button, when left empty the default label will
12350     * be used.
12351     */
12352    buttonLabel?: string;
12353    filters?: FileFilter[];
12354    /**
12355     * Contains which features the dialog should use. The following values are
12356     * supported:
12357     */
12358    properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
12359    /**
12360     * Message to display above input boxes.
12361     *
12362     * @platform darwin
12363     */
12364    message?: string;
12365    /**
12366     * Create security scoped bookmarks when packaged for the Mac App Store.
12367     *
12368     * @platform darwin,mas
12369     */
12370    securityScopedBookmarks?: boolean;
12371  }
12372
12373  interface OpenExternalOptions {
12374    /**
12375     * `true` to bring the opened application to the foreground. The default is `true`.
12376     *
12377     * @platform darwin
12378     */
12379    activate?: boolean;
12380    /**
12381     * The working directory.
12382     *
12383     * @platform win32
12384     */
12385    workingDirectory?: string;
12386  }
12387
12388  interface PageFaviconUpdatedEvent extends Event {
12389    /**
12390     * Array of URLs.
12391     */
12392    favicons: string[];
12393  }
12394
12395  interface PageTitleUpdatedEvent extends Event {
12396    title: string;
12397    explicitSet: boolean;
12398  }
12399
12400  interface Parameters {
12401    /**
12402     * Specify the screen type to emulate (default: `desktop`):
12403     */
12404    screenPosition: ('desktop' | 'mobile');
12405    /**
12406     * Set the emulated screen size (screenPosition == mobile).
12407     */
12408    screenSize: Size;
12409    /**
12410     * Position the view on the screen (screenPosition == mobile) (default: `{ x: 0, y:
12411     * 0 }`).
12412     */
12413    viewPosition: Point;
12414    /**
12415     * Set the device scale factor (if zero defaults to original device scale factor)
12416     * (default: `0`).
12417     */
12418    deviceScaleFactor: number;
12419    /**
12420     * Set the emulated view size (empty means no override)
12421     */
12422    viewSize: Size;
12423    /**
12424     * Scale of emulated view inside available space (not in fit to view mode)
12425     * (default: `1`).
12426     */
12427    scale: number;
12428  }
12429
12430  interface Payment {
12431    /**
12432     * The identifier of the purchased product.
12433     */
12434    productIdentifier: string;
12435    /**
12436     * The quantity purchased.
12437     */
12438    quantity: number;
12439  }
12440
12441  interface PermissionRequestHandlerHandlerDetails {
12442    /**
12443     * The url of the `openExternal` request.
12444     */
12445    externalURL?: string;
12446    /**
12447     * The types of media access being requested, elements can be `video` or `audio`
12448     */
12449    mediaTypes?: Array<'video' | 'audio'>;
12450    /**
12451     * The last URL the requesting frame loaded
12452     */
12453    requestingUrl: string;
12454    /**
12455     * Whether the frame making the request is the main frame
12456     */
12457    isMainFrame: boolean;
12458  }
12459
12460  interface PluginCrashedEvent extends Event {
12461    name: string;
12462    version: string;
12463  }
12464
12465  interface PopupOptions {
12466    /**
12467     * Default is the focused window.
12468     */
12469    window?: BrowserWindow;
12470    /**
12471     * Default is the current mouse cursor position. Must be declared if `y` is
12472     * declared.
12473     */
12474    x?: number;
12475    /**
12476     * Default is the current mouse cursor position. Must be declared if `x` is
12477     * declared.
12478     */
12479    y?: number;
12480    /**
12481     * The index of the menu item to be positioned under the mouse cursor at the
12482     * specified coordinates. Default is -1.
12483     *
12484     * @platform darwin
12485     */
12486    positioningItem?: number;
12487    /**
12488     * Called when menu is closed.
12489     */
12490    callback?: () => void;
12491  }
12492
12493  interface PreconnectOptions {
12494    /**
12495     * URL for preconnect. Only the origin is relevant for opening the socket.
12496     */
12497    url: string;
12498    /**
12499     * number of sockets to preconnect. Must be between 1 and 6. Defaults to 1.
12500     */
12501    numSockets?: number;
12502  }
12503
12504  interface PrintToPDFOptions {
12505    /**
12506     * Specifies the type of margins to use. Uses 0 for default margin, 1 for no
12507     * margin, and 2 for minimum margin.
12508     */
12509    marginsType?: number;
12510    /**
12511     * Specify page size of the generated PDF. Can be `A3`, `A4`, `A5`, `Legal`,
12512     * `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
12513     */
12514    pageSize?: (string) | (Size);
12515    /**
12516     * Whether to print CSS backgrounds.
12517     */
12518    printBackground?: boolean;
12519    /**
12520     * Whether to print selection only.
12521     */
12522    printSelectionOnly?: boolean;
12523    /**
12524     * `true` for landscape, `false` for portrait.
12525     */
12526    landscape?: boolean;
12527  }
12528
12529  interface Privileges {
12530    /**
12531     * Default false.
12532     */
12533    standard?: boolean;
12534    /**
12535     * Default false.
12536     */
12537    secure?: boolean;
12538    /**
12539     * Default false.
12540     */
12541    bypassCSP?: boolean;
12542    /**
12543     * Default false.
12544     */
12545    allowServiceWorkers?: boolean;
12546    /**
12547     * Default false.
12548     */
12549    supportFetchAPI?: boolean;
12550    /**
12551     * Default false.
12552     */
12553    corsEnabled?: boolean;
12554  }
12555
12556  interface ProgressBarOptions {
12557    /**
12558     * Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or
12559     * `paused`.
12560     *
12561     * @platform win32
12562     */
12563    mode: ('none' | 'normal' | 'indeterminate' | 'error' | 'paused');
12564  }
12565
12566  interface Provider {
12567    spellCheck: (words: string[], callback: (misspeltWords: string[]) => void) => void;
12568  }
12569
12570  interface ReadBookmark {
12571    title: string;
12572    url: string;
12573  }
12574
12575  interface RedirectRequest {
12576    url: string;
12577    method?: string;
12578    session?: (Session) | (null);
12579    uploadData?: ProtocolResponseUploadData;
12580  }
12581
12582  interface RelaunchOptions {
12583    args?: string[];
12584    execPath?: string;
12585  }
12586
12587  interface Request {
12588    url: string;
12589    headers: Record<string, string>;
12590    referrer: string;
12591    method: string;
12592    uploadData: UploadData[];
12593  }
12594
12595  interface ResizeOptions {
12596    /**
12597     * Defaults to the image's width.
12598     */
12599    width?: number;
12600    /**
12601     * Defaults to the image's height.
12602     */
12603    height?: number;
12604    /**
12605     * The desired quality of the resize image. Possible values are `good`, `better`,
12606     * or `best`. The default is `best`. These values express a desired quality/speed
12607     * tradeoff. They are translated into an algorithm-specific method that depends on
12608     * the capabilities (CPU, GPU) of the underlying platform. It is possible for all
12609     * three methods to be mapped to the same algorithm on a given platform.
12610     */
12611    quality?: string;
12612  }
12613
12614  interface ResourceUsage {
12615    images: MemoryUsageDetails;
12616    scripts: MemoryUsageDetails;
12617    cssStyleSheets: MemoryUsageDetails;
12618    xslStyleSheets: MemoryUsageDetails;
12619    fonts: MemoryUsageDetails;
12620    other: MemoryUsageDetails;
12621  }
12622
12623  interface Response {
12624    cancel?: boolean;
12625    /**
12626     * The original request is prevented from being sent or completed and is instead
12627     * redirected to the given URL.
12628     */
12629    redirectURL?: string;
12630  }
12631
12632  interface Result {
12633    requestId: number;
12634    /**
12635     * Position of the active match.
12636     */
12637    activeMatchOrdinal: number;
12638    /**
12639     * Number of Matches.
12640     */
12641    matches: number;
12642    /**
12643     * Coordinates of first match region.
12644     */
12645    selectionArea: Rectangle;
12646    finalUpdate: boolean;
12647  }
12648
12649  interface SaveDialogOptions {
12650    title?: string;
12651    /**
12652     * Absolute directory path, absolute file path, or file name to use by default.
12653     */
12654    defaultPath?: string;
12655    /**
12656     * Custom label for the confirmation button, when left empty the default label will
12657     * be used.
12658     */
12659    buttonLabel?: string;
12660    filters?: FileFilter[];
12661    /**
12662     * Message to display above text fields.
12663     *
12664     * @platform darwin
12665     */
12666    message?: string;
12667    /**
12668     * Custom label for the text displayed in front of the filename text field.
12669     *
12670     * @platform darwin
12671     */
12672    nameFieldLabel?: string;
12673    /**
12674     * Show the tags input box, defaults to `true`.
12675     *
12676     * @platform darwin
12677     */
12678    showsTagField?: boolean;
12679    properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
12680    /**
12681     * Create a security scoped bookmark when packaged for the Mac App Store. If this
12682     * option is enabled and the file doesn't already exist a blank file will be
12683     * created at the chosen path.
12684     *
12685     * @platform darwin,mas
12686     */
12687    securityScopedBookmarks?: boolean;
12688  }
12689
12690  interface SaveDialogReturnValue {
12691    /**
12692     * whether or not the dialog was canceled.
12693     */
12694    canceled: boolean;
12695    /**
12696     * If the dialog is canceled, this will be `undefined`.
12697     */
12698    filePath?: string;
12699    /**
12700     * Base64 encoded string which contains the security scoped bookmark data for the
12701     * saved file. `securityScopedBookmarks` must be enabled for this to be present.
12702     * (For return values, see table here.)
12703     *
12704     * @platform darwin,mas
12705     */
12706    bookmark?: string;
12707  }
12708
12709  interface SaveDialogSyncOptions {
12710    title?: string;
12711    /**
12712     * Absolute directory path, absolute file path, or file name to use by default.
12713     */
12714    defaultPath?: string;
12715    /**
12716     * Custom label for the confirmation button, when left empty the default label will
12717     * be used.
12718     */
12719    buttonLabel?: string;
12720    filters?: FileFilter[];
12721    /**
12722     * Message to display above text fields.
12723     *
12724     * @platform darwin
12725     */
12726    message?: string;
12727    /**
12728     * Custom label for the text displayed in front of the filename text field.
12729     *
12730     * @platform darwin
12731     */
12732    nameFieldLabel?: string;
12733    /**
12734     * Show the tags input box, defaults to `true`.
12735     *
12736     * @platform darwin
12737     */
12738    showsTagField?: boolean;
12739    properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
12740    /**
12741     * Create a security scoped bookmark when packaged for the Mac App Store. If this
12742     * option is enabled and the file doesn't already exist a blank file will be
12743     * created at the chosen path.
12744     *
12745     * @platform darwin,mas
12746     */
12747    securityScopedBookmarks?: boolean;
12748  }
12749
12750  interface Settings {
12751    /**
12752     * `true` to open the app at login, `false` to remove the app as a login item.
12753     * Defaults to `false`.
12754     */
12755    openAtLogin?: boolean;
12756    /**
12757     * `true` to open the app as hidden. Defaults to `false`. The user can edit this
12758     * setting from the System Preferences so
12759     * `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is
12760     * opened to know the current value. This setting is not available on MAS builds.
12761     *
12762     * @platform darwin
12763     */
12764    openAsHidden?: boolean;
12765    /**
12766     * The executable to launch at login. Defaults to `process.execPath`.
12767     *
12768     * @platform win32
12769     */
12770    path?: string;
12771    /**
12772     * The command-line arguments to pass to the executable. Defaults to an empty
12773     * array. Take care to wrap paths in quotes.
12774     *
12775     * @platform win32
12776     */
12777    args?: string[];
12778  }
12779
12780  interface SourcesOptions {
12781    /**
12782     * An array of Strings that lists the types of desktop sources to be captured,
12783     * available types are `screen` and `window`.
12784     */
12785    types: string[];
12786    /**
12787     * The size that the media source thumbnail should be scaled to. Default is `150` x
12788     * `150`. Set width or height to 0 when you do not need the thumbnails. This will
12789     * save the processing time required for capturing the content of each window and
12790     * screen.
12791     */
12792    thumbnailSize?: Size;
12793    /**
12794     * Set to true to enable fetching window icons. The default value is false. When
12795     * false the appIcon property of the sources return null. Same if a source has the
12796     * type screen.
12797     */
12798    fetchWindowIcons?: boolean;
12799  }
12800
12801  interface StartLoggingOptions {
12802    /**
12803     * What kinds of data should be captured. By default, only metadata about requests
12804     * will be captured. Setting this to `includeSensitive` will include cookies and
12805     * authentication data. Setting it to `everything` will include all bytes
12806     * transferred on sockets. Can be `default`, `includeSensitive` or `everything`.
12807     */
12808    captureMode?: ('default' | 'includeSensitive' | 'everything');
12809    /**
12810     * When the log grows beyond this size, logging will automatically stop. Defaults
12811     * to unlimited.
12812     */
12813    maxFileSize?: number;
12814  }
12815
12816  interface SystemMemoryInfo {
12817    /**
12818     * The total amount of physical memory in Kilobytes available to the system.
12819     */
12820    total: number;
12821    /**
12822     * The total amount of memory not being used by applications or disk cache.
12823     */
12824    free: number;
12825    /**
12826     * The total amount of swap memory in Kilobytes available to the system.
12827     *
12828     * @platform win32,linux
12829     */
12830    swapTotal: number;
12831    /**
12832     * The free amount of swap memory in Kilobytes available to the system.
12833     *
12834     * @platform win32,linux
12835     */
12836    swapFree: number;
12837  }
12838
12839  interface ToBitmapOptions {
12840    /**
12841     * Defaults to 1.0.
12842     */
12843    scaleFactor?: number;
12844  }
12845
12846  interface ToDataURLOptions {
12847    /**
12848     * Defaults to 1.0.
12849     */
12850    scaleFactor?: number;
12851  }
12852
12853  interface ToPNGOptions {
12854    /**
12855     * Defaults to 1.0.
12856     */
12857    scaleFactor?: number;
12858  }
12859
12860  interface TouchBarButtonConstructorOptions {
12861    /**
12862     * Button text.
12863     */
12864    label?: string;
12865    /**
12866     * A short description of the button for use by screenreaders like VoiceOver.
12867     */
12868    accessibilityLabel?: string;
12869    /**
12870     * Button background color in hex format, i.e `#ABCDEF`.
12871     */
12872    backgroundColor?: string;
12873    /**
12874     * Button icon.
12875     */
12876    icon?: (NativeImage) | (string);
12877    /**
12878     * Can be `left`, `right` or `overlay`. Defaults to `overlay`.
12879     */
12880    iconPosition?: ('left' | 'right' | 'overlay');
12881    /**
12882     * Function to call when the button is clicked.
12883     */
12884    click?: () => void;
12885  }
12886
12887  interface TouchBarColorPickerConstructorOptions {
12888    /**
12889     * Array of hex color strings to appear as possible colors to select.
12890     */
12891    availableColors?: string[];
12892    /**
12893     * The selected hex color in the picker, i.e `#ABCDEF`.
12894     */
12895    selectedColor?: string;
12896    /**
12897     * Function to call when a color is selected.
12898     */
12899    change?: (color: string) => void;
12900  }
12901
12902  interface TouchBarConstructorOptions {
12903    items?: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>;
12904    escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null);
12905  }
12906
12907  interface TouchBarGroupConstructorOptions {
12908    /**
12909     * Items to display as a group.
12910     */
12911    items: TouchBar;
12912  }
12913
12914  interface TouchBarLabelConstructorOptions {
12915    /**
12916     * Text to display.
12917     */
12918    label?: string;
12919    /**
12920     * A short description of the button for use by screenreaders like VoiceOver.
12921     */
12922    accessibilityLabel?: string;
12923    /**
12924     * Hex color of text, i.e `#ABCDEF`.
12925     */
12926    textColor?: string;
12927  }
12928
12929  interface TouchBarPopoverConstructorOptions {
12930    /**
12931     * Popover button text.
12932     */
12933    label?: string;
12934    /**
12935     * Popover button icon.
12936     */
12937    icon?: NativeImage;
12938    /**
12939     * Items to display in the popover.
12940     */
12941    items: TouchBar;
12942    /**
12943     * `true` to display a close button on the left of the popover, `false` to not show
12944     * it. Default is `true`.
12945     */
12946    showCloseButton?: boolean;
12947  }
12948
12949  interface TouchBarScrubberConstructorOptions {
12950    /**
12951     * An array of items to place in this scrubber.
12952     */
12953    items: ScrubberItem[];
12954    /**
12955     * Called when the user taps an item that was not the last tapped item.
12956     */
12957    select?: (selectedIndex: number) => void;
12958    /**
12959     * Called when the user taps any item.
12960     */
12961    highlight?: (highlightedIndex: number) => void;
12962    /**
12963     * Selected item style. Can be `background`, `outline` or `none`. Defaults to
12964     * `none`.
12965     */
12966    selectedStyle?: ('background' | 'outline' | 'none');
12967    /**
12968     * Selected overlay item style. Can be `background`, `outline` or `none`. Defaults
12969     * to `none`.
12970     */
12971    overlayStyle?: ('background' | 'outline' | 'none');
12972    /**
12973     * Defaults to `false`.
12974     */
12975    showArrowButtons?: boolean;
12976    /**
12977     * Can be `fixed` or `free`. The default is `free`.
12978     */
12979    mode?: ('fixed' | 'free');
12980    /**
12981     * Defaults to `true`.
12982     */
12983    continuous?: boolean;
12984  }
12985
12986  interface TouchBarSegmentedControlConstructorOptions {
12987    /**
12988     * Style of the segments:
12989     */
12990    segmentStyle?: ('automatic' | 'rounded' | 'textured-rounded' | 'round-rect' | 'textured-square' | 'capsule' | 'small-square' | 'separated');
12991    /**
12992     * The selection mode of the control:
12993     */
12994    mode?: ('single' | 'multiple' | 'buttons');
12995    /**
12996     * An array of segments to place in this control.
12997     */
12998    segments: SegmentedControlSegment[];
12999    /**
13000     * The index of the currently selected segment, will update automatically with user
13001     * interaction. When the mode is `multiple` it will be the last selected item.
13002     */
13003    selectedIndex?: number;
13004    /**
13005     * Called when the user selects a new segment.
13006     */
13007    change?: (selectedIndex: number, isSelected: boolean) => void;
13008  }
13009
13010  interface TouchBarSliderConstructorOptions {
13011    /**
13012     * Label text.
13013     */
13014    label?: string;
13015    /**
13016     * Selected value.
13017     */
13018    value?: number;
13019    /**
13020     * Minimum value.
13021     */
13022    minValue?: number;
13023    /**
13024     * Maximum value.
13025     */
13026    maxValue?: number;
13027    /**
13028     * Function to call when the slider is changed.
13029     */
13030    change?: (newValue: number) => void;
13031  }
13032
13033  interface TouchBarSpacerConstructorOptions {
13034    /**
13035     * Size of spacer, possible values are:
13036     */
13037    size?: ('small' | 'large' | 'flexible');
13038  }
13039
13040  interface TraceBufferUsageReturnValue {
13041    value: number;
13042    percentage: number;
13043  }
13044
13045  interface UpdateTargetUrlEvent extends Event {
13046    url: string;
13047  }
13048
13049  interface UploadProgress {
13050    /**
13051     * Whether the request is currently active. If this is false no other properties
13052     * will be set
13053     */
13054    active: boolean;
13055    /**
13056     * Whether the upload has started. If this is false both `current` and `total` will
13057     * be set to 0.
13058     */
13059    started: boolean;
13060    /**
13061     * The number of bytes that have been uploaded so far
13062     */
13063    current: number;
13064    /**
13065     * The number of bytes that will be uploaded this request
13066     */
13067    total: number;
13068  }
13069
13070  interface VisibleOnAllWorkspacesOptions {
13071    /**
13072     * Sets whether the window should be visible above fullscreen windows _deprecated_
13073     *
13074     * @platform darwin
13075     */
13076    visibleOnFullScreen?: boolean;
13077  }
13078
13079  interface WebContentsPrintOptions {
13080    /**
13081     * Don't ask user for print settings. Default is `false`.
13082     */
13083    silent?: boolean;
13084    /**
13085     * Prints the background color and image of the web page. Default is `false`.
13086     */
13087    printBackground?: boolean;
13088    /**
13089     * Set the printer device name to use. Must be the system-defined name and not the
13090     * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
13091     */
13092    deviceName?: string;
13093    /**
13094     * Set whether the printed web page will be in color or grayscale. Default is
13095     * `true`.
13096     */
13097    color?: boolean;
13098    margins?: Margins;
13099    /**
13100     * Whether the web page should be printed in landscape mode. Default is `false`.
13101     */
13102    landscape?: boolean;
13103    /**
13104     * The scale factor of the web page.
13105     */
13106    scaleFactor?: number;
13107    /**
13108     * The number of pages to print per page sheet.
13109     */
13110    pagesPerSheet?: number;
13111    /**
13112     * Whether the web page should be collated.
13113     */
13114    collate?: boolean;
13115    /**
13116     * The number of copies of the web page to print.
13117     */
13118    copies?: number;
13119    /**
13120     * The page range to print. Should have two keys: `from` and `to`.
13121     */
13122    pageRanges?: Record<string, number>;
13123    /**
13124     * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
13125     * `longEdge`.
13126     */
13127    duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
13128    dpi?: Dpi;
13129    /**
13130     * String to be printed as page header.
13131     */
13132    header?: string;
13133    /**
13134     * String to be printed as page footer.
13135     */
13136    footer?: string;
13137  }
13138
13139  interface WebviewTagPrintOptions {
13140    /**
13141     * Don't ask user for print settings. Default is `false`.
13142     */
13143    silent?: boolean;
13144    /**
13145     * Also prints the background color and image of the web page. Default is `false`.
13146     */
13147    printBackground?: boolean;
13148    /**
13149     * Set the printer device name to use. Default is `''`.
13150     */
13151    deviceName?: string;
13152  }
13153
13154  interface WillNavigateEvent extends Event {
13155    url: string;
13156  }
13157
13158  interface Dpi {
13159    /**
13160     * The horizontal dpi.
13161     */
13162    horizontal?: number;
13163    /**
13164     * The vertical dpi.
13165     */
13166    vertical?: number;
13167  }
13168
13169  interface EditFlags {
13170    /**
13171     * Whether the renderer believes it can undo.
13172     */
13173    canUndo: boolean;
13174    /**
13175     * Whether the renderer believes it can redo.
13176     */
13177    canRedo: boolean;
13178    /**
13179     * Whether the renderer believes it can cut.
13180     */
13181    canCut: boolean;
13182    /**
13183     * Whether the renderer believes it can copy
13184     */
13185    canCopy: boolean;
13186    /**
13187     * Whether the renderer believes it can paste.
13188     */
13189    canPaste: boolean;
13190    /**
13191     * Whether the renderer believes it can delete.
13192     */
13193    canDelete: boolean;
13194    /**
13195     * Whether the renderer believes it can select all.
13196     */
13197    canSelectAll: boolean;
13198  }
13199
13200  interface FoundInPageResult {
13201    requestId: number;
13202    /**
13203     * Position of the active match.
13204     */
13205    activeMatchOrdinal: number;
13206    /**
13207     * Number of Matches.
13208     */
13209    matches: number;
13210    /**
13211     * Coordinates of first match region.
13212     */
13213    selectionArea: Rectangle;
13214    finalUpdate: boolean;
13215  }
13216
13217  interface Margins {
13218    /**
13219     * Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
13220     * you will also need to specify `top`, `bottom`, `left`, and `right`.
13221     */
13222    marginType?: ('default' | 'none' | 'printableArea' | 'custom');
13223    /**
13224     * The top margin of the printed web page, in pixels.
13225     */
13226    top?: number;
13227    /**
13228     * The bottom margin of the printed web page, in pixels.
13229     */
13230    bottom?: number;
13231    /**
13232     * The left margin of the printed web page, in pixels.
13233     */
13234    left?: number;
13235    /**
13236     * The right margin of the printed web page, in pixels.
13237     */
13238    right?: number;
13239  }
13240
13241  interface MediaFlags {
13242    /**
13243     * Whether the media element has crashed.
13244     */
13245    inError: boolean;
13246    /**
13247     * Whether the media element is paused.
13248     */
13249    isPaused: boolean;
13250    /**
13251     * Whether the media element is muted.
13252     */
13253    isMuted: boolean;
13254    /**
13255     * Whether the media element has audio.
13256     */
13257    hasAudio: boolean;
13258    /**
13259     * Whether the media element is looping.
13260     */
13261    isLooping: boolean;
13262    /**
13263     * Whether the media element's controls are visible.
13264     */
13265    isControlsVisible: boolean;
13266    /**
13267     * Whether the media element's controls are toggleable.
13268     */
13269    canToggleControls: boolean;
13270    /**
13271     * Whether the media element can be rotated.
13272     */
13273    canRotate: boolean;
13274  }
13275
13276  interface WebPreferences {
13277    /**
13278     * Whether to enable DevTools. If it is set to `false`, can not use
13279     * `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
13280     */
13281    devTools?: boolean;
13282    /**
13283     * Whether node integration is enabled. Default is `false`.
13284     */
13285    nodeIntegration?: boolean;
13286    /**
13287     * Whether node integration is enabled in web workers. Default is `false`. More
13288     * about this can be found in Multithreading.
13289     */
13290    nodeIntegrationInWorker?: boolean;
13291    /**
13292     * Experimental option for enabling Node.js support in sub-frames such as iframes
13293     * and child windows. All your preloads will load for every iframe, you can use
13294     * `process.isMainFrame` to determine if you are in the main frame or not.
13295     */
13296    nodeIntegrationInSubFrames?: boolean;
13297    /**
13298     * Specifies a script that will be loaded before other scripts run in the page.
13299     * This script will always have access to node APIs no matter whether node
13300     * integration is turned on or off. The value should be the absolute file path to
13301     * the script. When node integration is turned off, the preload script can
13302     * reintroduce Node global symbols back to the global scope. See example here.
13303     */
13304    preload?: string;
13305    /**
13306     * If set, this will sandbox the renderer associated with the window, making it
13307     * compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
13308     * This is not the same as the `nodeIntegration` option and the APIs available to
13309     * the preload script are more limited. Read more about the option here.
13310     */
13311    sandbox?: boolean;
13312    /**
13313     * Whether to enable the `remote` module. Default is `true`.
13314     */
13315    enableRemoteModule?: boolean;
13316    /**
13317     * Sets the session used by the page. Instead of passing the Session object
13318     * directly, you can also choose to use the `partition` option instead, which
13319     * accepts a partition string. When both `session` and `partition` are provided,
13320     * `session` will be preferred. Default is the default session.
13321     */
13322    session?: Session;
13323    /**
13324     * Sets the session used by the page according to the session's partition string.
13325     * If `partition` starts with `persist:`, the page will use a persistent session
13326     * available to all pages in the app with the same `partition`. If there is no
13327     * `persist:` prefix, the page will use an in-memory session. By assigning the same
13328     * `partition`, multiple pages can share the same session. Default is the default
13329     * session.
13330     */
13331    partition?: string;
13332    /**
13333     * When specified, web pages with the same `affinity` will run in the same renderer
13334     * process. Note that due to reusing the renderer process, certain `webPreferences`
13335     * options will also be shared between the web pages even when you specified
13336     * different values for them, including but not limited to `preload`, `sandbox` and
13337     * `nodeIntegration`. So it is suggested to use exact same `webPreferences` for web
13338     * pages with the same `affinity`. _This property is experimental_
13339     */
13340    affinity?: string;
13341    /**
13342     * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
13343     */
13344    zoomFactor?: number;
13345    /**
13346     * Enables JavaScript support. Default is `true`.
13347     */
13348    javascript?: boolean;
13349    /**
13350     * When `false`, it will disable the same-origin policy (usually using testing
13351     * websites by people), and set `allowRunningInsecureContent` to `true` if this
13352     * options has not been set by user. Default is `true`.
13353     */
13354    webSecurity?: boolean;
13355    /**
13356     * Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is
13357     * `false`.
13358     */
13359    allowRunningInsecureContent?: boolean;
13360    /**
13361     * Enables image support. Default is `true`.
13362     */
13363    images?: boolean;
13364    /**
13365     * Make TextArea elements resizable. Default is `true`.
13366     */
13367    textAreasAreResizable?: boolean;
13368    /**
13369     * Enables WebGL support. Default is `true`.
13370     */
13371    webgl?: boolean;
13372    /**
13373     * Whether plugins should be enabled. Default is `false`.
13374     */
13375    plugins?: boolean;
13376    /**
13377     * Enables Chromium's experimental features. Default is `false`.
13378     */
13379    experimentalFeatures?: boolean;
13380    /**
13381     * Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.
13382     */
13383    scrollBounce?: boolean;
13384    /**
13385     * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
13386     * to enable. The full list of supported feature strings can be found in the
13387     * RuntimeEnabledFeatures.json5 file.
13388     */
13389    enableBlinkFeatures?: string;
13390    /**
13391     * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
13392     * to disable. The full list of supported feature strings can be found in the
13393     * RuntimeEnabledFeatures.json5 file.
13394     */
13395    disableBlinkFeatures?: string;
13396    /**
13397     * Sets the default font for the font-family.
13398     */
13399    defaultFontFamily?: DefaultFontFamily;
13400    /**
13401     * Defaults to `16`.
13402     */
13403    defaultFontSize?: number;
13404    /**
13405     * Defaults to `13`.
13406     */
13407    defaultMonospaceFontSize?: number;
13408    /**
13409     * Defaults to `0`.
13410     */
13411    minimumFontSize?: number;
13412    /**
13413     * Defaults to `ISO-8859-1`.
13414     */
13415    defaultEncoding?: string;
13416    /**
13417     * Whether to throttle animations and timers when the page becomes background. This
13418     * also affects the Page Visibility API. Defaults to `true`.
13419     */
13420    backgroundThrottling?: boolean;
13421    /**
13422     * Whether to enable offscreen rendering for the browser window. Defaults to
13423     * `false`. See the offscreen rendering tutorial for more details.
13424     */
13425    offscreen?: boolean;
13426    /**
13427     * Whether to run Electron APIs and the specified `preload` script in a separate
13428     * JavaScript context. Defaults to `false`. The context that the `preload` script
13429     * runs in will still have full access to the `document` and `window` globals but
13430     * it will use its own set of JavaScript builtins (`Array`, `Object`, `JSON`, etc.)
13431     * and will be isolated from any changes made to the global environment by the
13432     * loaded page. The Electron API will only be available in the `preload` script and
13433     * not the loaded page. This option should be used when loading potentially
13434     * untrusted remote content to ensure the loaded content cannot tamper with the
13435     * `preload` script and any Electron APIs being used. This option uses the same
13436     * technique used by Chrome Content Scripts. You can access this context in the dev
13437     * tools by selecting the 'Electron Isolated Context' entry in the combo box at the
13438     * top of the Console tab.
13439     */
13440    contextIsolation?: boolean;
13441    /**
13442     * Whether to use native `window.open()`. Defaults to `false`. Child windows will
13443     * always have node integration disabled unless `nodeIntegrationInSubFrames` is
13444     * true. **Note:** This option is currently experimental.
13445     */
13446    nativeWindowOpen?: boolean;
13447    /**
13448     * Whether to enable the `<webview>` tag. Defaults to `false`. **Note:** The
13449     * `preload` script configured for the `<webview>` will have node integration
13450     * enabled when it is executed so you should ensure remote/untrusted content is not
13451     * able to create a `<webview>` tag with a possibly malicious `preload` script. You
13452     * can use the `will-attach-webview` event on webContents to strip away the
13453     * `preload` script and to validate or alter the `<webview>`'s initial settings.
13454     */
13455    webviewTag?: boolean;
13456    /**
13457     * A list of strings that will be appended to `process.argv` in the renderer
13458     * process of this app.  Useful for passing small bits of data down to renderer
13459     * process preload scripts.
13460     */
13461    additionalArguments?: string[];
13462    /**
13463     * Whether to enable browser style consecutive dialog protection. Default is
13464     * `false`.
13465     */
13466    safeDialogs?: boolean;
13467    /**
13468     * The message to display when consecutive dialog protection is triggered. If not
13469     * defined the default message would be used, note that currently the default
13470     * message is in English and not localized.
13471     */
13472    safeDialogsMessage?: string;
13473    /**
13474     * Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
13475     * `false`.
13476     */
13477    disableDialogs?: boolean;
13478    /**
13479     * Whether dragging and dropping a file or link onto the page causes a navigation.
13480     * Default is `false`.
13481     */
13482    navigateOnDragDrop?: boolean;
13483    /**
13484     * Autoplay policy to apply to content in the window, can be
13485     * `no-user-gesture-required`, `user-gesture-required`,
13486     * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
13487     */
13488    autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
13489    /**
13490     * Whether to prevent the window from resizing when entering HTML Fullscreen.
13491     * Default is `false`.
13492     */
13493    disableHtmlFullscreenWindowResize?: boolean;
13494    /**
13495     * An alternative title string provided only to accessibility tools such as screen
13496     * readers. This string is not directly visible to users.
13497     */
13498    accessibleTitle?: string;
13499    /**
13500     * Whether to enable the builtin spellchecker. Default is `false`.
13501     */
13502    spellcheck?: boolean;
13503    /**
13504     * Whether to enable the WebSQL api. Default is `true`.
13505     */
13506    enableWebSQL?: boolean;
13507  }
13508
13509  interface DefaultFontFamily {
13510    /**
13511     * Defaults to `Times New Roman`.
13512     */
13513    standard?: string;
13514    /**
13515     * Defaults to `Times New Roman`.
13516     */
13517    serif?: string;
13518    /**
13519     * Defaults to `Arial`.
13520     */
13521    sansSerif?: string;
13522    /**
13523     * Defaults to `Courier New`.
13524     */
13525    monospace?: string;
13526    /**
13527     * Defaults to `Script`.
13528     */
13529    cursive?: string;
13530    /**
13531     * Defaults to `Impact`.
13532     */
13533    fantasy?: string;
13534  }
13535
13536}
13537
13538declare module 'electron' {
13539  export = Electron;
13540}
13541
13542interface NodeRequireFunction {
13543  (moduleName: 'electron'): typeof Electron;
13544}
13545
13546interface File {
13547 /**
13548  * The real path to the file on the users filesystem
13549  */
13550  path: string;
13551}
13552
13553declare module 'original-fs' {
13554  import * as fs from 'fs';
13555  export = fs;
13556}
13557
13558interface Document {
13559  createElement(tagName: 'webview'): Electron.WebviewTag;
13560}
13561
13562declare namespace NodeJS {
13563  interface Process extends NodeJS.EventEmitter {
13564
13565    // Docs: http://electronjs.org/docs/api/process
13566
13567    /**
13568     * Emitted when Electron has loaded its internal initialization script and is
13569     * beginning to load the web page or the main script.
13570     *
13571     * It can be used by the preload script to add removed Node global symbols back to
13572     * the global scope when node integration is turned off:
13573     */
13574    on(event: 'loaded', listener: Function): this;
13575    once(event: 'loaded', listener: Function): this;
13576    addListener(event: 'loaded', listener: Function): this;
13577    removeListener(event: 'loaded', listener: Function): this;
13578    /**
13579     * Causes the main thread of the current process crash.
13580     */
13581    crash(): void;
13582    /**
13583     * * `allocated` Integer - Size of all allocated objects in Kilobytes.
13584     * * `marked` Integer - Size of all marked objects in Kilobytes.
13585     * * `total` Integer - Total allocated space in Kilobytes.
13586     *
13587     * Returns an object with Blink memory information. It can be useful for debugging
13588     * rendering / DOM related memory issues. Note that all values are reported in
13589     * Kilobytes.
13590     */
13591    getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
13592    getCPUUsage(): Electron.CPUUsage;
13593    /**
13594     * The number of milliseconds since epoch, or `null` if the information is
13595     * unavailable
13596     *
13597     * Indicates the creation time of the application. The time is represented as
13598     * number of milliseconds since epoch. It returns null if it is unable to get the
13599     * process creation time.
13600     */
13601    getCreationTime(): (number) | (null);
13602    /**
13603     * * `totalHeapSize` Integer
13604     * * `totalHeapSizeExecutable` Integer
13605     * * `totalPhysicalSize` Integer
13606     * * `totalAvailableSize` Integer
13607     * * `usedHeapSize` Integer
13608     * * `heapSizeLimit` Integer
13609     * * `mallocedMemory` Integer
13610     * * `peakMallocedMemory` Integer
13611     * * `doesZapGarbage` Boolean
13612     *
13613     * Returns an object with V8 heap statistics. Note that all statistics are reported
13614     * in Kilobytes.
13615     */
13616    getHeapStatistics(): Electron.HeapStatistics;
13617    getIOCounters(): Electron.IOCounters;
13618    /**
13619     * Resolves with a ProcessMemoryInfo
13620     *
13621     * Returns an object giving memory usage statistics about the current process. Note
13622     * that all statistics are reported in Kilobytes. This api should be called after
13623     * app ready.
13624     *
13625     * Chromium does not provide `residentSet` value for macOS. This is because macOS
13626     * performs in-memory compression of pages that haven't been recently used. As a
13627     * result the resident set size value is not what one would expect. `private`
13628     * memory is more representative of the actual pre-compression memory usage of the
13629     * process on macOS.
13630     */
13631    getProcessMemoryInfo(): Promise<Electron.ProcessMemoryInfo>;
13632    /**
13633     * * `total` Integer - The total amount of physical memory in Kilobytes available
13634     * to the system.
13635     * * `free` Integer - The total amount of memory not being used by applications or
13636     * disk cache.
13637     * * `swapTotal` Integer _Windows_ _Linux_ - The total amount of swap memory in
13638     * Kilobytes available to the system.
13639     * * `swapFree` Integer _Windows_ _Linux_ - The free amount of swap memory in
13640     * Kilobytes available to the system.
13641     *
13642     * Returns an object giving memory usage statistics about the entire system. Note
13643     * that all statistics are reported in Kilobytes.
13644     */
13645    getSystemMemoryInfo(): Electron.SystemMemoryInfo;
13646    /**
13647     * The version of the host operating system.
13648     *
13649     * Example:
13650     *
13651     * **Note:** It returns the actual operating system version instead of kernel
13652     * version on macOS unlike `os.release()`.
13653     */
13654    getSystemVersion(): string;
13655    /**
13656     * Causes the main thread of the current process hang.
13657     */
13658    hang(): void;
13659    /**
13660     * Sets the file descriptor soft limit to `maxDescriptors` or the OS hard limit,
13661     * whichever is lower for the current process.
13662     *
13663     * @platform darwin,linux
13664     */
13665    setFdLimit(maxDescriptors: number): void;
13666    /**
13667     * Indicates whether the snapshot has been created successfully.
13668     *
13669Takes a V8 heap snapshot and saves it to `filePath`.
13670     */
13671    takeHeapSnapshot(filePath: string): boolean;
13672    /**
13673     * A `String` representing Chrome's version string.
13674     *
13675     */
13676    readonly chrome: string;
13677    /**
13678     * A `Boolean`. When app is started by being passed as parameter to the default
13679     * app, this property is `true` in the main process, otherwise it is `undefined`.
13680     *
13681     */
13682    readonly defaultApp: boolean;
13683    /**
13684     * A `String` representing Electron's version string.
13685     *
13686     */
13687    readonly electron: string;
13688    /**
13689     * A `Boolean` that controls whether or not deprecation warnings are printed to
13690     * `stderr` when formerly callback-based APIs converted to Promises are invoked
13691     * using callbacks. Setting this to `true` will enable deprecation warnings.
13692     */
13693    enablePromiseAPIs: boolean;
13694    /**
13695     * A `Boolean`, `true` when the current renderer context is the "main" renderer
13696     * frame. If you want the ID of the current frame you should use
13697     * `webFrame.routingId`.
13698     *
13699     */
13700    readonly isMainFrame: boolean;
13701    /**
13702     * A `Boolean`. For Mac App Store build, this property is `true`, for other builds
13703     * it is `undefined`.
13704     *
13705     */
13706    readonly mas: boolean;
13707    /**
13708     * A `Boolean` that controls ASAR support inside your application. Setting this to
13709     * `true` will disable the support for `asar` archives in Node's built-in modules.
13710     */
13711    noAsar: boolean;
13712    /**
13713     * A `Boolean` that controls whether or not deprecation warnings are printed to
13714     * `stderr`. Setting this to `true` will silence deprecation warnings. This
13715     * property is used instead of the `--no-deprecation` command line flag.
13716     */
13717    noDeprecation: boolean;
13718    /**
13719     * A `String` representing the path to the resources directory.
13720     *
13721     */
13722    readonly resourcesPath: string;
13723    /**
13724     * A `Boolean`. When the renderer process is sandboxed, this property is `true`,
13725     * otherwise it is `undefined`.
13726     *
13727     */
13728    readonly sandboxed: boolean;
13729    /**
13730     * A `Boolean` that controls whether or not deprecation warnings will be thrown as
13731     * exceptions. Setting this to `true` will throw errors for deprecations. This
13732     * property is used instead of the `--throw-deprecation` command line flag.
13733     */
13734    throwDeprecation: boolean;
13735    /**
13736     * A `Boolean` that controls whether or not deprecations printed to `stderr`
13737     * include their stack trace. Setting this to `true` will print stack traces for
13738     * deprecations. This property is instead of the `--trace-deprecation` command line
13739     * flag.
13740     */
13741    traceDeprecation: boolean;
13742    /**
13743     * A `Boolean` that controls whether or not process warnings printed to `stderr`
13744     * include their stack trace. Setting this to `true` will print stack traces for
13745     * process warnings (including deprecations). This property is instead of the
13746     * `--trace-warnings` command line flag.
13747     */
13748    traceProcessWarnings: boolean;
13749    /**
13750     * A `String` representing the current process's type, can be `"browser"` (i.e.
13751     * main process), `"renderer"`, or `"worker"` (i.e. web worker).
13752     *
13753     */
13754    readonly type: string;
13755    /**
13756     * A `Boolean`. If the app is running as a Windows Store app (appx), this property
13757     * is `true`, for otherwise it is `undefined`.
13758     *
13759     */
13760    readonly windowsStore: boolean;
13761  }
13762  interface ProcessVersions {
13763    readonly electron: string;
13764    readonly chrome: string;
13765  }
13766}