electron 9.0.0-beta.7 → 9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/electron.d.ts +199 -159
  2. package/package.json +1 -1
package/electron.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 9.0.0-beta.7
1
+ // Type definitions for Electron 9.0.2
2
2
  // Project: http://electronjs.org/
3
3
  // Definitions by: The Electron Team <https://github.com/electron/electron>
4
4
  // Definitions: https://github.com/electron/electron-typescript-definitions
@@ -695,7 +695,7 @@ You should call `event.preventDefault()` if you want to handle this event.
695
695
  * Emitted when Handoff is about to be resumed on another device. If you need to
696
696
  * update the state to be transferred, you should call `event.preventDefault()`
697
697
  * immediately, construct a new `userInfo` dictionary and call
698
- * `app.updateCurrentActiviy()` in a timely manner. Otherwise, the operation will
698
+ * `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will
699
699
  * fail and `continue-activity-error` will be called.
700
700
  *
701
701
  * @platform darwin
@@ -789,8 +789,8 @@ In most cases, you should do everything in the `ready` event handler.
789
789
  removeListener(event: 'will-finish-launching', listener: Function): this;
790
790
  /**
791
791
  * Emitted when all windows have been closed and the application will quit. Calling
792
- * `event.preventDefault()` will prevent the default behaviour, which is
793
- * terminating the application.
792
+ * `event.preventDefault()` will prevent the default behavior, which is terminating
793
+ * the application.
794
794
  *
795
795
  * See the description of the `window-all-closed` event for the differences between
796
796
  * the `will-quit` and `window-all-closed` events.
@@ -834,7 +834,7 @@ In most cases, you should do everything in the `ready` event handler.
834
834
  /**
835
835
  * By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain
836
836
  * basis if the GPU processes crashes too frequently. This function disables that
837
- * behaviour.
837
+ * behavior.
838
838
 
839
839
  This method can only be called before app is ready.
840
840
  */
@@ -863,8 +863,10 @@ This method can only be called before app is ready.
863
863
  /**
864
864
  * On Linux, focuses on the first visible window. On macOS, makes the application
865
865
  * the active app. On Windows, focuses on the application's first window.
866
+ *
867
+ You should seek to use the `steal` option as sparingly as possible.
866
868
  */
867
- focus(): void;
869
+ focus(options?: FocusOptions): void;
868
870
  /**
869
871
  * Name of the application handling the protocol, or an empty string if there is no
870
872
  * handler. For instance, if Electron is the default handler of the URL, this could
@@ -887,8 +889,6 @@ This method can only be called before app is ready.
887
889
  getAppPath(): string;
888
890
  /**
889
891
  * The current value displayed in the counter badge.
890
-
891
- **Deprecated**
892
892
  *
893
893
  * @platform linux,darwin
894
894
  */
@@ -993,8 +993,6 @@ This method can only be called before app is ready.
993
993
  * to the npm modules spec. You should usually also specify a `productName` field,
994
994
  * which is your application's full capitalized name, and which will be preferred
995
995
  * over `name` by Electron.
996
-
997
- **Deprecated**
998
996
  */
999
997
  getName(): string;
1000
998
  /**
@@ -1005,7 +1003,7 @@ This method can only be called before app is ready.
1005
1003
  * called first, a default log directory will be created equivalent to calling
1006
1004
  * `app.setAppLogsPath()` without a `path` parameter.
1007
1005
  */
1008
- getPath(name: 'home' | 'appData' | 'userData' | 'cache' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'logs' | 'pepperFlashSystemPlugin'): string;
1006
+ getPath(name: 'home' | 'appData' | 'userData' | 'cache' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'logs' | 'pepperFlashSystemPlugin' | 'crashDumps'): string;
1009
1007
  /**
1010
1008
  * The version of the loaded application. If no version is found in the
1011
1009
  * application's `package.json` file, the version of the current bundle or
@@ -1046,8 +1044,6 @@ This method can only be called before app is ready.
1046
1044
  * has been detected. See
1047
1045
  * https://www.chromium.org/developers/design-documents/accessibility for more
1048
1046
  * details.
1049
-
1050
- **Deprecated**
1051
1047
  *
1052
1048
  * @platform darwin,win32
1053
1049
  */
@@ -1191,7 +1187,7 @@ This method can only be called before app is ready.
1191
1187
  resignCurrentActivity(): void;
1192
1188
  /**
1193
1189
  * Set the about panel options. This will override the values defined in the app's
1194
- * `.plist` file on MacOS. See the Apple docs for more details. On Linux, values
1190
+ * `.plist` file on macOS. See the Apple docs for more details. On Linux, values
1195
1191
  * must be set in order to be shown; there are no defaults.
1196
1192
  *
1197
1193
  * If you do not set `credits` but still wish to surface them in your app, AppKit
@@ -1210,8 +1206,6 @@ This method can only be called before app is ready.
1210
1206
  *
1211
1207
  * **Note:** Rendering accessibility tree can significantly affect the performance
1212
1208
  * of your app. It should not be enabled by default.
1213
-
1214
- **Deprecated**
1215
1209
  *
1216
1210
  * @platform darwin,win32
1217
1211
  */
@@ -1282,8 +1276,6 @@ This method can only be called before app is ready.
1282
1276
  *
1283
1277
  * **Note:** Unity launcher requires the existence of a `.desktop` file to work,
1284
1278
  * for more information please read Desktop Environment Integration.
1285
- *
1286
- **Deprecated**
1287
1279
  *
1288
1280
  * @platform linux,darwin
1289
1281
  */
@@ -1338,8 +1330,6 @@ Here's a very simple example of creating a custom Jump List:
1338
1330
  *
1339
1331
  * **Note:** This function overrides the name used internally by Electron; it does
1340
1332
  * not affect the name that the OS uses.
1341
-
1342
- **Deprecated**
1343
1333
  */
1344
1334
  setName(name: string): void;
1345
1335
  /**
@@ -1956,6 +1946,13 @@ __Note__: On macOS this event is an alias of `moved`.
1956
1946
  * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
1957
1947
  * `left`.
1958
1948
  *
1949
+ * The method underlying this event is built to handle older macOS-style trackpad
1950
+ * swiping, where the content on the screen doesn't move with the swipe. Most macOS
1951
+ * trackpads are not configured to allow this kind of swiping anymore, so in order
1952
+ * for it to emit properly the 'Swipe between pages' preference in `System
1953
+ * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
1954
+ * fingers'.
1955
+ *
1959
1956
  * @platform darwin
1960
1957
  */
1961
1958
  on(event: 'swipe', listener: (event: Event,
@@ -2333,8 +2330,6 @@ __Note__: On macOS this event is an alias of `moved`.
2333
2330
  * Whether the window can be manually closed by user.
2334
2331
  *
2335
2332
  On Linux always returns `true`.
2336
-
2337
- **Deprecated**
2338
2333
  *
2339
2334
  * @platform darwin,win32
2340
2335
  */
@@ -2364,8 +2359,6 @@ On Linux always returns `true`.
2364
2359
  /**
2365
2360
  * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
2366
2361
  * window.
2367
-
2368
- **Deprecated**
2369
2362
  */
2370
2363
  isFullScreenable(): boolean;
2371
2364
  /**
@@ -2376,8 +2369,6 @@ On Linux always returns `true`.
2376
2369
  * Whether the window can be manually maximized by user.
2377
2370
  *
2378
2371
  On Linux always returns `true`.
2379
-
2380
- **Deprecated**
2381
2372
  *
2382
2373
  * @platform darwin,win32
2383
2374
  */
@@ -2388,8 +2379,6 @@ On Linux always returns `true`.
2388
2379
  isMaximized(): boolean;
2389
2380
  /**
2390
2381
  * Whether menu bar automatically hides itself.
2391
-
2392
- **Deprecated**
2393
2382
  */
2394
2383
  isMenuBarAutoHide(): boolean;
2395
2384
  /**
@@ -2397,11 +2386,9 @@ On Linux always returns `true`.
2397
2386
  */
2398
2387
  isMenuBarVisible(): boolean;
2399
2388
  /**
2400
- * Whether the window can be manually minimized by user
2389
+ * Whether the window can be manually minimized by the user.
2401
2390
  *
2402
2391
  On Linux always returns `true`.
2403
-
2404
- **Deprecated**
2405
2392
  *
2406
2393
  * @platform darwin,win32
2407
2394
  */
@@ -2416,10 +2403,8 @@ On Linux always returns `true`.
2416
2403
  isModal(): boolean;
2417
2404
  /**
2418
2405
  * Whether the window can be moved by user.
2419
- *
2420
- On Linux always returns `true`.
2421
2406
 
2422
- **Deprecated**
2407
+ On Linux always returns `true`.
2423
2408
  *
2424
2409
  * @platform darwin,win32
2425
2410
  */
@@ -2430,9 +2415,7 @@ On Linux always returns `true`.
2430
2415
  */
2431
2416
  isNormal(): boolean;
2432
2417
  /**
2433
- * Whether the window can be manually resized by user.
2434
-
2435
- **Deprecated**
2418
+ * Whether the window can be manually resized by the user.
2436
2419
  */
2437
2420
  isResizable(): boolean;
2438
2421
  /**
@@ -2596,8 +2579,6 @@ On Linux always returns `true`.
2596
2579
  *
2597
2580
  * If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
2598
2581
  * hide it immediately.
2599
-
2600
- **Deprecated**
2601
2582
  */
2602
2583
  setAutoHideMenuBar(hide: boolean): void;
2603
2584
  /**
@@ -2612,8 +2593,6 @@ On Linux always returns `true`.
2612
2593
  setBrowserView(browserView: (BrowserView) | (null)): void;
2613
2594
  /**
2614
2595
  * Sets whether the window can be manually closed by user. On Linux does nothing.
2615
- *
2616
- **Deprecated**
2617
2596
  *
2618
2597
  * @platform darwin,win32
2619
2598
  */
@@ -2662,8 +2641,6 @@ On macOS it does not remove the focus from the window.
2662
2641
  /**
2663
2642
  * Sets whether the maximize/zoom window button toggles fullscreen mode or
2664
2643
  * maximizes the window.
2665
-
2666
- **Deprecated**
2667
2644
  */
2668
2645
  setFullScreenable(fullscreenable: boolean): void;
2669
2646
  /**
@@ -2684,14 +2661,12 @@ On macOS it does not remove the focus from the window.
2684
2661
  */
2685
2662
  setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
2686
2663
  /**
2687
- * Enters or leaves the kiosk mode.
2664
+ * Enters or leaves kiosk mode.
2688
2665
  */
2689
2666
  setKiosk(flag: boolean): void;
2690
2667
  /**
2691
2668
  * Sets whether the window can be manually maximized by user. On Linux does
2692
2669
  * nothing.
2693
-
2694
- **Deprecated**
2695
2670
  *
2696
2671
  * @platform darwin,win32
2697
2672
  */
@@ -2716,8 +2691,6 @@ On macOS it does not remove the focus from the window.
2716
2691
  /**
2717
2692
  * Sets whether the window can be manually minimized by user. On Linux does
2718
2693
  * nothing.
2719
-
2720
- **Deprecated**
2721
2694
  *
2722
2695
  * @platform darwin,win32
2723
2696
  */
@@ -2728,8 +2701,6 @@ On macOS it does not remove the focus from the window.
2728
2701
  setMinimumSize(width: number, height: number): void;
2729
2702
  /**
2730
2703
  * Sets whether the window can be moved by user. On Linux does nothing.
2731
- *
2732
- **Deprecated**
2733
2704
  *
2734
2705
  * @platform darwin,win32
2735
2706
  */
@@ -2780,9 +2751,7 @@ On macOS it does not remove the focus from the window.
2780
2751
  */
2781
2752
  setRepresentedFilename(filename: string): void;
2782
2753
  /**
2783
- * Sets whether the window can be manually resized by user.
2784
-
2785
- **Deprecated**
2754
+ * Sets whether the window can be manually resized by the user.
2786
2755
  */
2787
2756
  setResizable(resizable: boolean): void;
2788
2757
  /**
@@ -2808,7 +2777,7 @@ On macOS it does not remove the focus from the window.
2808
2777
  * Enters or leaves simple fullscreen mode.
2809
2778
  *
2810
2779
  * Simple fullscreen mode emulates the native fullscreen behavior found in versions
2811
- * of Mac OS X prior to Lion (10.7).
2780
+ * of macOS prior to Lion (10.7).
2812
2781
  *
2813
2782
  * @platform darwin
2814
2783
  */
@@ -2962,13 +2931,22 @@ This cannot be called when `titleBarStyle` is set to `customButtonsOnHover`.
2962
2931
  accessibleTitle: string;
2963
2932
  autoHideMenuBar: boolean;
2964
2933
  closable: boolean;
2934
+ documentEdited: boolean;
2965
2935
  excludedFromShownWindowsMenu: boolean;
2936
+ fullScreen: boolean;
2966
2937
  fullScreenable: boolean;
2967
2938
  readonly id: number;
2939
+ kiosk: boolean;
2968
2940
  maximizable: boolean;
2941
+ menuBarVisible: boolean;
2969
2942
  minimizable: boolean;
2970
2943
  movable: boolean;
2944
+ representedFilename: string;
2971
2945
  resizable: boolean;
2946
+ shadow: boolean;
2947
+ simpleFullScreen: boolean;
2948
+ title: string;
2949
+ visibleOnAllWorkspaces: boolean;
2972
2950
  readonly webContents: WebContents;
2973
2951
  }
2974
2952
 
@@ -3592,79 +3570,92 @@ Sets a cookie with `details`.
3592
3570
  /**
3593
3571
  * Set an extra parameter to be sent with the crash report. The values specified
3594
3572
  * here will be sent in addition to any values set via the `extra` option when
3595
- * `start` was called. This API is only available on macOS and windows, if you need
3596
- * to add/update extra parameters on Linux after your first call to `start` you can
3597
- * call `start` again with the updated `extra` options.
3573
+ * `start` was called.
3598
3574
  *
3599
- * @platform darwin,win32
3575
+ * Parameters added in this fashion (or via the `extra` parameter to
3576
+ * `crashReporter.start`) are specific to the calling process. Adding extra
3577
+ * parameters in the main process will not cause those parameters to be sent along
3578
+ * with crashes from renderer or other child processes. Similarly, adding extra
3579
+ * parameters in a renderer process will not result in those parameters being sent
3580
+ * with crashes that occur in other renderer processes or in the main process.
3581
+ *
3582
+ * **Note:** Parameters have limits on the length of the keys and values. Key names
3583
+ * must be no longer than 39 bytes, and values must be no longer than 127 bytes.
3584
+ * Keys with names longer than the maximum will be silently ignored. Key values
3585
+ * longer than the maximum length will be truncated.
3600
3586
  */
3601
3587
  addExtraParameter(key: string, value: string): void;
3602
3588
  /**
3603
3589
  * The directory where crashes are temporarily stored before being uploaded.
3590
+ *
3591
+ **Note:** This method is deprecated, use `app.getPath('crashDumps')` instead.
3592
+ *
3593
+ * @deprecated
3604
3594
  */
3605
3595
  getCrashesDirectory(): string;
3606
3596
  /**
3607
- * Returns the date and ID of the last crash report. Only crash reports that have
3608
- * been uploaded will be returned; even if a crash report is present on disk it
3609
- * will not be returned until it is uploaded. In the case that there are no
3610
- * uploaded reports, `null` is returned.
3597
+ * The date and ID of the last crash report. Only crash reports that have been
3598
+ * uploaded will be returned; even if a crash report is present on disk it will not
3599
+ * be returned until it is uploaded. In the case that there are no uploaded
3600
+ * reports, `null` is returned.
3601
+ *
3602
+ **Note:** Calling this method from the renderer process is deprecated.
3611
3603
  */
3612
3604
  getLastCrashReport(): CrashReport;
3613
3605
  /**
3614
- * See all of the current parameters being passed to the crash reporter.
3606
+ * The current 'extra' parameters of the crash reporter.
3615
3607
  */
3616
- getParameters(): void;
3608
+ getParameters(): Record<string, string>;
3617
3609
  /**
3618
3610
  * Returns all uploaded crash reports. Each report contains the date and uploaded
3619
3611
  * ID.
3612
+
3613
+ **Note:** Calling this method from the renderer process is deprecated.
3620
3614
  */
3621
3615
  getUploadedReports(): CrashReport[];
3622
3616
  /**
3623
3617
  * Whether reports should be submitted to the server. Set through the `start`
3624
3618
  * method or `setUploadToServer`.
3625
3619
  *
3626
- **Note:** This API can only be called from the main process.
3620
+ **Note:** Calling this method from the renderer process is deprecated.
3627
3621
  */
3628
3622
  getUploadToServer(): boolean;
3629
3623
  /**
3630
- * Remove a extra parameter from the current set of parameters so that it will not
3631
- * be sent with the crash report.
3632
- *
3633
- * @platform darwin,win32
3624
+ * Remove a extra parameter from the current set of parameters. Future crashes will
3625
+ * not include this parameter.
3634
3626
  */
3635
3627
  removeExtraParameter(key: string): void;
3636
3628
  /**
3637
3629
  * This would normally be controlled by user preferences. This has no effect if
3638
3630
  * called before `start` is called.
3639
3631
  *
3640
- **Note:** This API can only be called from the main process.
3632
+ **Note:** Calling this method from the renderer process is deprecated.
3641
3633
  */
3642
3634
  setUploadToServer(uploadToServer: boolean): void;
3643
3635
  /**
3644
- * You are required to call this method before using any other `crashReporter` APIs
3645
- * and in each process (main/renderer) from which you want to collect crash
3646
- * reports. You can pass different options to `crashReporter.start` when calling
3647
- * from different processes.
3648
- *
3649
- * **Note** Child processes created via the `child_process` module will not have
3650
- * access to the Electron modules. Therefore, to collect crash reports from them,
3651
- * use `process.crashReporter.start` instead. Pass the same options as above along
3652
- * with an additional one called `crashesDirectory` that should point to a
3653
- * directory to store the crash reports temporarily. You can test this out by
3654
- * calling `process.crash()` to crash the child process.
3655
- *
3656
- * **Note:** If you need send additional/updated `extra` parameters after your
3657
- * first call `start` you can call `addExtraParameter` on macOS or call `start`
3658
- * again with the new/updated `extra` parameters on Linux and Windows.
3659
- *
3660
- * **Note:** On macOS and windows, Electron uses a new `crashpad` client for crash
3661
- * collection and reporting. If you want to enable crash reporting, initializing
3662
- * `crashpad` from the main process using `crashReporter.start` is required
3663
- * regardless of which process you want to collect crashes from. Once initialized
3664
- * this way, the crashpad handler collects crashes from all processes. You still
3665
- * have to call `crashReporter.start` from the renderer or child process, otherwise
3666
- * crashes from them will get reported without `companyName`, `productName` or any
3667
- * of the `extra` information.
3636
+ * This method must be called before using any other `crashReporter` APIs. Once
3637
+ * initialized this way, the crashpad handler collects crashes from all
3638
+ * subsequently created processes. The crash reporter cannot be disabled once
3639
+ * started.
3640
+ *
3641
+ * This method should be called as early as possible in app startup, preferably
3642
+ * before `app.on('ready')`. If the crash reporter is not initialized at the time a
3643
+ * renderer process is created, then that renderer process will not be monitored by
3644
+ * the crash reporter.
3645
+ *
3646
+ * **Note:** You can test out the crash reporter by generating a crash using
3647
+ * `process.crash()`.
3648
+ *
3649
+ * **Note:** If you need to send additional/updated `extra` parameters after your
3650
+ * first call `start` you can call `addExtraParameter`.
3651
+ *
3652
+ * **Note:** Parameters passed in `extra`, `globalExtra` or set with
3653
+ * `addExtraParameter` have limits on the length of the keys and values. Key names
3654
+ * must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
3655
+ * with names longer than the maximum will be silently ignored. Key values longer
3656
+ * than the maximum length will be truncated.
3657
+ *
3658
+ **Note:** Calling this method from the renderer process is deprecated.
3668
3659
  */
3669
3660
  start(options: CrashReporterStartOptions): void;
3670
3661
  }
@@ -3909,7 +3900,8 @@ Send given command to the debugging target.
3909
3900
  * It returns the index of the clicked button.
3910
3901
  *
3911
3902
  * The `browserWindow` argument allows the dialog to attach itself to a parent
3912
- * window, making it modal.
3903
+ * window, making it modal. If `browserWindow` is not shown dialog will not be
3904
+ * attached to it. In such case It will be displayed as independed window.
3913
3905
  */
3914
3906
  showMessageBoxSync(browserWindow: BrowserWindow, options: MessageBoxSyncOptions): number;
3915
3907
  /**
@@ -3919,7 +3911,8 @@ Send given command to the debugging target.
3919
3911
  * It returns the index of the clicked button.
3920
3912
  *
3921
3913
  * The `browserWindow` argument allows the dialog to attach itself to a parent
3922
- * window, making it modal.
3914
+ * window, making it modal. If `browserWindow` is not shown dialog will not be
3915
+ * attached to it. In such case It will be displayed as independed window.
3923
3916
  */
3924
3917
  showMessageBoxSync(options: MessageBoxSyncOptions): number;
3925
3918
  /**
@@ -4319,8 +4312,6 @@ Send given command to the debugging target.
4319
4312
  * The save path of the download item. This will be either the path set via
4320
4313
  * `downloadItem.setSavePath(path)` or the path selected from the shown save
4321
4314
  * dialog.
4322
-
4323
- **Deprecated: use the `savePath` property instead.**
4324
4315
  */
4325
4316
  getSavePath(): string;
4326
4317
  /**
@@ -4380,8 +4371,6 @@ If the size is unknown, it returns 0.
4380
4371
  * The API is only available in session's `will-download` callback function. If
4381
4372
  * user doesn't set the save path via the API, Electron will use the original
4382
4373
  * routine to determine the save path; this usually prompts a save dialog.
4383
- *
4384
- **Deprecated: use the `savePath` property instead.**
4385
4374
  */
4386
4375
  setSavePath(path: string): void;
4387
4376
  savePath: string;
@@ -4399,7 +4388,19 @@ If the size is unknown, it returns 0.
4399
4388
  // Docs: http://electronjs.org/docs/api/structures/extension
4400
4389
 
4401
4390
  id: string;
4391
+ /**
4392
+ * Copy of the extension's manifest data.
4393
+ */
4394
+ manifest: any;
4402
4395
  name: string;
4396
+ /**
4397
+ * The extension's file path.
4398
+ */
4399
+ path: string;
4400
+ /**
4401
+ * The extension's `chrome-extension://` URL.
4402
+ */
4403
+ url: string;
4403
4404
  version: string;
4404
4405
  }
4405
4406
 
@@ -5144,7 +5145,7 @@ For example:
5144
5145
  label: string;
5145
5146
  menu: Menu;
5146
5147
  registerAccelerator: boolean;
5147
- 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');
5148
+ 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' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
5148
5149
  sublabel: string;
5149
5150
  submenu?: Menu;
5150
5151
  toolTip: string;
@@ -5306,8 +5307,6 @@ where `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.
5306
5307
  isEmpty(): boolean;
5307
5308
  /**
5308
5309
  * Whether the image is a template image.
5309
-
5310
- **Deprecated**
5311
5310
  */
5312
5311
  isTemplateImage(): boolean;
5313
5312
  /**
@@ -5319,8 +5318,6 @@ where `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.
5319
5318
  resize(options: ResizeOptions): NativeImage;
5320
5319
  /**
5321
5320
  * Marks the image as a template image.
5322
-
5323
- **Deprecated**
5324
5321
  */
5325
5322
  setTemplateImage(option: boolean): void;
5326
5323
  /**
@@ -5460,6 +5457,13 @@ Starts recording network events to `path`.
5460
5457
  readonly currentlyLoggingPath: string;
5461
5458
  }
5462
5459
 
5460
+ interface NewWindowEvent extends Event {
5461
+
5462
+ // Docs: http://electronjs.org/docs/api/structures/new-window-event
5463
+
5464
+ newGuest?: BrowserWindow;
5465
+ }
5466
+
5463
5467
  class Notification extends NodeJS.EventEmitter {
5464
5468
 
5465
5469
  // Docs: http://electronjs.org/docs/api/notification
@@ -6568,7 +6572,8 @@ e.g.
6568
6572
  item: DownloadItem,
6569
6573
  webContents: WebContents) => void): this;
6570
6574
  /**
6571
- * Whether the word was successfully written to the custom dictionary.
6575
+ * Whether the word was successfully written to the custom dictionary. This API
6576
+ * will not work on non-persistent (in-memory) sessions.
6572
6577
  *
6573
6578
  * **Note:** On macOS and Windows 10 this word will be written to the OS custom
6574
6579
  * dictionary as well
@@ -6705,7 +6710,8 @@ Clears the host resolver cache.
6705
6710
  */
6706
6711
  removeExtension(extensionId: string): void;
6707
6712
  /**
6708
- * Whether the word was successfully removed from the custom dictionary.
6713
+ * Whether the word was successfully removed from the custom dictionary. This API
6714
+ * will not work on non-persistent (in-memory) sessions.
6709
6715
  *
6710
6716
  * **Note:** On macOS and Windows 10 this word will be removed from the OS custom
6711
6717
  * dictionary as well
@@ -7142,8 +7148,6 @@ Returns an object with system animation settings.
7142
7148
  * Gets the macOS appearance setting that you have declared you want for your
7143
7149
  * application, maps to NSApplication.appearance. You can use the
7144
7150
  * `setAppLevelAppearance` API to set this value.
7145
-
7146
- **Deprecated**
7147
7151
  *
7148
7152
  * @deprecated
7149
7153
  * @platform darwin
@@ -7151,7 +7155,7 @@ Returns an object with system animation settings.
7151
7155
  getAppLevelAppearance(): ('dark' | 'light' | 'unknown');
7152
7156
  /**
7153
7157
  * The system color setting in RGB hexadecimal form (`#ABCDEF`). See the Windows
7154
- * docs and the MacOS docs for more details.
7158
+ * docs and the macOS docs for more details.
7155
7159
  *
7156
7160
  * The following colors are only available on macOS 10.14: `find-highlight`,
7157
7161
  * `selected-content-background`, `separator`,
@@ -7166,8 +7170,6 @@ Returns an object with system animation settings.
7166
7170
  *
7167
7171
  * Gets the macOS appearance setting that is currently applied to your application,
7168
7172
  * maps to NSApplication.effectiveAppearance
7169
-
7170
- **Deprecated**
7171
7173
  *
7172
7174
  * @platform darwin
7173
7175
  */
@@ -7235,7 +7237,7 @@ Returns an object with system animation settings.
7235
7237
  /**
7236
7238
  * `true` if a high contrast theme is active, `false` otherwise.
7237
7239
  *
7238
- * **Depreacted:** Should use the new `nativeTheme.shouldUseHighContrastColors`
7240
+ * **Deprecated:** Should use the new `nativeTheme.shouldUseHighContrastColors`
7239
7241
  * API.
7240
7242
  *
7241
7243
  * @deprecated
@@ -7319,8 +7321,6 @@ Returns an object with system animation settings.
7319
7321
  /**
7320
7322
  * Sets the appearance setting for your application, this should override the
7321
7323
  * system default and override the value of `getEffectiveAppearance`.
7322
- *
7323
- **Deprecated**
7324
7324
  *
7325
7325
  * @deprecated
7326
7326
  * @platform darwin
@@ -8937,7 +8937,7 @@ The usage is the same with the `login` event of `app`.
8937
8937
  * reference the new `BrowserWindow` instance, failing to do so may result in
8938
8938
  * unexpected behavior. For example:
8939
8939
  */
8940
- on(event: 'new-window', listener: (event: Event,
8940
+ on(event: 'new-window', listener: (event: NewWindowEvent,
8941
8941
  url: string,
8942
8942
  frameName: string,
8943
8943
  /**
@@ -8959,7 +8959,7 @@ The usage is the same with the `login` event of `app`.
8959
8959
  * `Referer` header being sent, depending on the referrer policy.
8960
8960
  */
8961
8961
  referrer: Referrer) => void): this;
8962
- once(event: 'new-window', listener: (event: Event,
8962
+ once(event: 'new-window', listener: (event: NewWindowEvent,
8963
8963
  url: string,
8964
8964
  frameName: string,
8965
8965
  /**
@@ -8981,7 +8981,7 @@ The usage is the same with the `login` event of `app`.
8981
8981
  * `Referer` header being sent, depending on the referrer policy.
8982
8982
  */
8983
8983
  referrer: Referrer) => void): this;
8984
- addListener(event: 'new-window', listener: (event: Event,
8984
+ addListener(event: 'new-window', listener: (event: NewWindowEvent,
8985
8985
  url: string,
8986
8986
  frameName: string,
8987
8987
  /**
@@ -9003,7 +9003,7 @@ The usage is the same with the `login` event of `app`.
9003
9003
  * `Referer` header being sent, depending on the referrer policy.
9004
9004
  */
9005
9005
  referrer: Referrer) => void): this;
9006
- removeListener(event: 'new-window', listener: (event: Event,
9006
+ removeListener(event: 'new-window', listener: (event: NewWindowEvent,
9007
9007
  url: string,
9008
9008
  frameName: string,
9009
9009
  /**
@@ -9523,8 +9523,6 @@ Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
9523
9523
  getAllSharedWorkers(): SharedWorkerInfo[];
9524
9524
  /**
9525
9525
  * If *offscreen rendering* is enabled returns the current frame rate.
9526
- *
9527
- **Deprecated**
9528
9526
  */
9529
9527
  getFrameRate(): number;
9530
9528
  /**
@@ -9556,8 +9554,6 @@ Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
9556
9554
  getURL(): string;
9557
9555
  /**
9558
9556
  * The user agent for this web page.
9559
-
9560
- **Deprecated**
9561
9557
  */
9562
9558
  getUserAgent(): string;
9563
9559
  /**
@@ -9566,14 +9562,10 @@ Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
9566
9562
  getWebRTCIPHandlingPolicy(): string;
9567
9563
  /**
9568
9564
  * the current zoom factor.
9569
-
9570
- **Deprecated**
9571
9565
  */
9572
9566
  getZoomFactor(): number;
9573
9567
  /**
9574
9568
  * the current zoom level.
9575
-
9576
- **Deprecated**
9577
9569
  */
9578
9570
  getZoomLevel(): number;
9579
9571
  /**
@@ -9637,8 +9629,6 @@ This also affects the Page Visibility API.
9637
9629
  invalidate(): void;
9638
9630
  /**
9639
9631
  * Whether this page has been muted.
9640
-
9641
- **Deprecated**
9642
9632
  */
9643
9633
  isAudioMuted(): boolean;
9644
9634
  /**
@@ -9836,8 +9826,6 @@ You can also read `frameId` from all incoming IPC messages in the main process.
9836
9826
  sendToFrame(frameId: number, channel: string, ...args: any[]): void;
9837
9827
  /**
9838
9828
  * Mute the audio on the current web page.
9839
-
9840
- **Deprecated**
9841
9829
  */
9842
9830
  setAudioMuted(muted: boolean): void;
9843
9831
  /**
@@ -9868,8 +9856,6 @@ An example of showing devtools in a `BrowserWindow`:
9868
9856
  /**
9869
9857
  * If *offscreen rendering* is enabled sets the frame rate to the specified number.
9870
9858
  * Only values between 1 and 60 are accepted.
9871
-
9872
- **Deprecated**
9873
9859
  */
9874
9860
  setFrameRate(fps: number): void;
9875
9861
  /**
@@ -9880,8 +9866,6 @@ An example of showing devtools in a `BrowserWindow`:
9880
9866
  setIgnoreMenuShortcuts(ignore: boolean): void;
9881
9867
  /**
9882
9868
  * Overrides the user agent for this web page.
9883
-
9884
- **Deprecated**
9885
9869
  */
9886
9870
  setUserAgent(userAgent: string): void;
9887
9871
  /**
@@ -9900,7 +9884,7 @@ An example of showing devtools in a `BrowserWindow`:
9900
9884
  * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
9901
9885
  * divided by 100, so 300% = 3.0.
9902
9886
 
9903
- **Deprecated**
9887
+ The factor must be greater than 0.0.
9904
9888
  */
9905
9889
  setZoomFactor(factor: number): void;
9906
9890
  /**
@@ -9908,8 +9892,6 @@ An example of showing devtools in a `BrowserWindow`:
9908
9892
  * increment above or below represents zooming 20% larger or smaller to default
9909
9893
  * limits of 300% and 50% of original size, respectively. The formula for this is
9910
9894
  * `scale := 1.2 ^ level`.
9911
-
9912
- **Deprecated**
9913
9895
  */
9914
9896
  setZoomLevel(level: number): void;
9915
9897
  /**
@@ -9960,7 +9942,7 @@ Takes a V8 heap snapshot and saves it to `filePath`.
9960
9942
  unselect(): void;
9961
9943
  audioMuted: boolean;
9962
9944
  readonly debugger: Debugger;
9963
- readonly devToolsWebContents: WebContents;
9945
+ readonly devToolsWebContents: (WebContents) | (null);
9964
9946
  frameRate: number;
9965
9947
  readonly hostWebContents: WebContents;
9966
9948
  readonly id: number;
@@ -9998,9 +9980,13 @@ Takes a V8 heap snapshot and saves it to `filePath`.
9998
9980
  executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
9999
9981
  /**
10000
9982
  * A promise that resolves with the result of the executed code or is rejected if
10001
- * execution throws or results in a rejected promise.
10002
- *
10003
- Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
9983
+ * execution could not start.
9984
+ *
9985
+ * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
9986
+ *
9987
+ * Note that when the execution of script fails, the returned promise will not
9988
+ * reject and the `result` would be `undefined`. This is because Chromium does not
9989
+ * dispatch errors of isolated worlds to foreign worlds.
10004
9990
  */
10005
9991
  executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
10006
9992
  /**
@@ -10087,6 +10073,8 @@ An example of using node-spellchecker as provider:
10087
10073
  /**
10088
10074
  * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
10089
10075
  * divided by 100, so 300% = 3.0.
10076
+
10077
+ The factor must be greater than 0.0.
10090
10078
  */
10091
10079
  setZoomFactor(factor: number): void;
10092
10080
  /**
@@ -11115,7 +11103,7 @@ See webContents.sendInputEvent for detailed description of `event` object.
11115
11103
  */
11116
11104
  skipTaskbar?: boolean;
11117
11105
  /**
11118
- * The kiosk mode. Default is `false`.
11106
+ * Whether the window is in kiosk mode. Default is `false`.
11119
11107
  */
11120
11108
  kiosk?: boolean;
11121
11109
  /**
@@ -11187,7 +11175,7 @@ See webContents.sendInputEvent for detailed description of `event` object.
11187
11175
  */
11188
11176
  opacity?: number;
11189
11177
  /**
11190
- * Forces using dark theme for the window, only works on some GTK+3 desktop
11178
+ * Forces using dark theme for the window, only works on some GTK desktop
11191
11179
  * environments. Default is `false`.
11192
11180
  */
11193
11181
  darkTheme?: boolean;
@@ -11315,6 +11303,12 @@ See webContents.sendInputEvent for detailed description of `event` object.
11315
11303
  * `session` is explicitly specified, `partition` is ignored.
11316
11304
  */
11317
11305
  partition?: string;
11306
+ /**
11307
+ * Whether to send cookies with this request from the provided session. This will
11308
+ * make the `net` request's cookie behavior match a `fetch` request. Default is
11309
+ * `false`.
11310
+ */
11311
+ useSessionCookies?: boolean;
11318
11312
  /**
11319
11313
  * The protocol scheme in the form 'scheme:'. Currently supported values are
11320
11314
  * 'http:' or 'https:'. Defaults to 'http:'.
@@ -11522,7 +11516,6 @@ See webContents.sendInputEvent for detailed description of `event` object.
11522
11516
  }
11523
11517
 
11524
11518
  interface CrashReporterStartOptions {
11525
- companyName: string;
11526
11519
  /**
11527
11520
  * URL that crash reports will be sent to as POST.
11528
11521
  */
@@ -11532,24 +11525,53 @@ See webContents.sendInputEvent for detailed description of `event` object.
11532
11525
  */
11533
11526
  productName?: string;
11534
11527
  /**
11535
- * Whether crash reports should be sent to the server. Default is `true`.
11528
+ * Deprecated alias for `{ globalExtra: { _companyName: ... } }`.
11529
+ *
11530
+ * @deprecated
11531
+ */
11532
+ companyName?: string;
11533
+ /**
11534
+ * Whether crash reports should be sent to the server. If false, crash reports will
11535
+ * be collected and stored in the crashes directory, but not uploaded. Default is
11536
+ * `true`.
11536
11537
  */
11537
11538
  uploadToServer?: boolean;
11538
11539
  /**
11539
- * Default is `false`.
11540
+ * If true, crashes generated in the main process will not be forwarded to the
11541
+ * system crash handler. Default is `false`.
11540
11542
  */
11541
11543
  ignoreSystemCrashHandler?: boolean;
11542
11544
  /**
11543
- * An object you can define that will be sent along with the report. Only string
11544
- * properties are sent correctly. Nested objects are not supported. When using
11545
- * Windows, the property names and values must be fewer than 64 characters.
11545
+ * If true, limit the number of crashes uploaded to 1/hour. Default is `false`.
11546
+ *
11547
+ * @platform darwin,win32
11548
+ */
11549
+ rateLimit?: boolean;
11550
+ /**
11551
+ * If true, crash reports will be compressed and uploaded with `Content-Encoding:
11552
+ * gzip`. Not all collection servers support compressed payloads. Default is
11553
+ * `false`.
11554
+ *
11555
+ * @platform darwin,win32
11556
+ */
11557
+ compress?: boolean;
11558
+ /**
11559
+ * Extra string key/value annotations that will be sent along with crash reports
11560
+ * that are generated in the main process. Only string values are supported.
11561
+ * Crashes generated in child processes will not contain these extra parameters to
11562
+ * crash reports generated from child processes, call `addExtraParameter` from the
11563
+ * child process.
11546
11564
  */
11547
11565
  extra?: Record<string, string>;
11548
11566
  /**
11549
- * Directory to store the crash reports temporarily (only used when the crash
11550
- * reporter is started via `process.crashReporter.start`).
11567
+ * Extra string key/value annotations that will be sent along with any crash
11568
+ * reports generated in any process. These annotations cannot be changed once the
11569
+ * crash reporter has been started. If a key is present in both the global extra
11570
+ * parameters and the process-specific extra parameters, then the global one will
11571
+ * take precedence. By default, `productName` and the app version are included, as
11572
+ * well as the Electron version.
11551
11573
  */
11552
- crashesDirectory?: string;
11574
+ globalExtra?: Record<string, string>;
11553
11575
  }
11554
11576
 
11555
11577
  interface CreateFromBitmapOptions {
@@ -11761,6 +11783,15 @@ See webContents.sendInputEvent for detailed description of `event` object.
11761
11783
  medialCapitalAsWordStart?: boolean;
11762
11784
  }
11763
11785
 
11786
+ interface FocusOptions {
11787
+ /**
11788
+ * Make the receiver the active app even if another app is currently active.
11789
+ *
11790
+ * @platform darwin
11791
+ */
11792
+ steal: boolean;
11793
+ }
11794
+
11764
11795
  interface FoundInPageEvent extends Event {
11765
11796
  result: FoundInPageResult;
11766
11797
  }
@@ -12015,13 +12046,13 @@ See webContents.sendInputEvent for detailed description of `event` object.
12015
12046
  * `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`,
12016
12047
  * `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`,
12017
12048
  * `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`,
12018
- * `stopSpeaking`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`,
12019
- * `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`,
12020
- * `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`,
12021
- * `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when
12022
- * specified the `click` property will be ignored. See roles.
12049
+ * `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`,
12050
+ * `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`,
12051
+ * `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
12052
+ * - Define the action of the menu item, when specified the `click` property will
12053
+ * be ignored. See roles.
12023
12054
  */
12024
- 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' | 'minimize' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
12055
+ 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' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
12025
12056
  /**
12026
12057
  * Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
12027
12058
  */
@@ -13719,6 +13750,11 @@ See webContents.sendInputEvent for detailed description of `event` object.
13719
13750
  * message is in English and not localized.
13720
13751
  */
13721
13752
  safeDialogsMessage?: string;
13753
+ /**
13754
+ * Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
13755
+ * `false`.
13756
+ */
13757
+ disableDialogs?: boolean;
13722
13758
  /**
13723
13759
  * Whether dragging and dropping a file or link onto the page causes a navigation.
13724
13760
  * Default is `false`.
@@ -13744,6 +13780,10 @@ See webContents.sendInputEvent for detailed description of `event` object.
13744
13780
  * Whether to enable the builtin spellchecker. Default is `true`.
13745
13781
  */
13746
13782
  spellcheck?: boolean;
13783
+ /**
13784
+ * Whether to enable the WebSQL api. Default is `true`.
13785
+ */
13786
+ enableWebSQL?: boolean;
13747
13787
  }
13748
13788
 
13749
13789
  interface DefaultFontFamily {
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "node": ">= 8.6"
17
17
  },
18
18
  "name": "electron",
19
- "version": "9.0.0-beta.7",
19
+ "version": "9.0.2",
20
20
  "repository": "https://github.com/electron/electron",
21
21
  "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
22
22
  "license": "MIT",