@overwolf/ow-electron 42.11.4 → 44.5.1-beta.0

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.
package/electron.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 42.11.4
1
+ // Type definitions for Electron 44.5.1
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/typescript-definitions
@@ -50,7 +50,7 @@ declare namespace Electron {
50
50
  // Docs: https://electronjs.org/docs/api/app
51
51
 
52
52
  /**
53
- * Emitted when Chrome's accessibility support changes. This event fires when
53
+ * Emitted when Chromium's accessibility support changes. This event fires when
54
54
  * assistive technologies, such as screen readers, are enabled or disabled. See
55
55
  * https://www.chromium.org/developers/design-documents/accessibility for more
56
56
  * details.
@@ -59,7 +59,7 @@ declare namespace Electron {
59
59
  */
60
60
  on(event: 'accessibility-support-changed', listener: (event: Event,
61
61
  /**
62
- * `true` when Chrome's accessibility support is enabled, `false` otherwise.
62
+ * `true` when Chromium's accessibility support is enabled, `false` otherwise.
63
63
  */
64
64
  accessibilitySupportEnabled: boolean) => void): this;
65
65
  /**
@@ -67,7 +67,7 @@ declare namespace Electron {
67
67
  */
68
68
  off(event: 'accessibility-support-changed', listener: (event: Event,
69
69
  /**
70
- * `true` when Chrome's accessibility support is enabled, `false` otherwise.
70
+ * `true` when Chromium's accessibility support is enabled, `false` otherwise.
71
71
  */
72
72
  accessibilitySupportEnabled: boolean) => void): this;
73
73
  /**
@@ -75,7 +75,7 @@ declare namespace Electron {
75
75
  */
76
76
  once(event: 'accessibility-support-changed', listener: (event: Event,
77
77
  /**
78
- * `true` when Chrome's accessibility support is enabled, `false` otherwise.
78
+ * `true` when Chromium's accessibility support is enabled, `false` otherwise.
79
79
  */
80
80
  accessibilitySupportEnabled: boolean) => void): this;
81
81
  /**
@@ -83,7 +83,7 @@ declare namespace Electron {
83
83
  */
84
84
  addListener(event: 'accessibility-support-changed', listener: (event: Event,
85
85
  /**
86
- * `true` when Chrome's accessibility support is enabled, `false` otherwise.
86
+ * `true` when Chromium's accessibility support is enabled, `false` otherwise.
87
87
  */
88
88
  accessibilitySupportEnabled: boolean) => void): this;
89
89
  /**
@@ -91,7 +91,7 @@ declare namespace Electron {
91
91
  */
92
92
  removeListener(event: 'accessibility-support-changed', listener: (event: Event,
93
93
  /**
94
- * `true` when Chrome's accessibility support is enabled, `false` otherwise.
94
+ * `true` when Chromium's accessibility support is enabled, `false` otherwise.
95
95
  */
96
96
  accessibilitySupportEnabled: boolean) => void): this;
97
97
  /**
@@ -300,7 +300,8 @@ declare namespace Electron {
300
300
  isMainFrame: boolean) => void): this;
301
301
  /**
302
302
  * Emitted when the child process unexpectedly disappears. This is normally because
303
- * it was crashed or killed. It does not include renderer processes.
303
+ * it was crashed or killed, or because it failed to launch. It does not include
304
+ * renderer processes.
304
305
  */
305
306
  on(event: 'child-process-gone', listener: (event: Event,
306
307
  details: Details) => void): this;
@@ -518,27 +519,27 @@ declare namespace Electron {
518
519
  * page.
519
520
  */
520
521
  on(event: 'login', listener: (event: Event,
521
- webContents: WebContents,
522
+ webContents: (WebContents) | (null),
522
523
  authenticationResponseDetails: AuthenticationResponseDetails,
523
524
  authInfo: AuthInfo,
524
525
  callback: (username?: string, password?: string) => void) => void): this;
525
526
  off(event: 'login', listener: (event: Event,
526
- webContents: WebContents,
527
+ webContents: (WebContents) | (null),
527
528
  authenticationResponseDetails: AuthenticationResponseDetails,
528
529
  authInfo: AuthInfo,
529
530
  callback: (username?: string, password?: string) => void) => void): this;
530
531
  once(event: 'login', listener: (event: Event,
531
- webContents: WebContents,
532
+ webContents: (WebContents) | (null),
532
533
  authenticationResponseDetails: AuthenticationResponseDetails,
533
534
  authInfo: AuthInfo,
534
535
  callback: (username?: string, password?: string) => void) => void): this;
535
536
  addListener(event: 'login', listener: (event: Event,
536
- webContents: WebContents,
537
+ webContents: (WebContents) | (null),
537
538
  authenticationResponseDetails: AuthenticationResponseDetails,
538
539
  authInfo: AuthInfo,
539
540
  callback: (username?: string, password?: string) => void) => void): this;
540
541
  removeListener(event: 'login', listener: (event: Event,
541
- webContents: WebContents,
542
+ webContents: (WebContents) | (null),
542
543
  authenticationResponseDetails: AuthenticationResponseDetails,
543
544
  authInfo: AuthInfo,
544
545
  callback: (username?: string, password?: string) => void) => void): this;
@@ -806,29 +807,36 @@ declare namespace Electron {
806
807
  * and `callback` can be called with an entry filtered from the list. Using
807
808
  * `event.preventDefault()` prevents the application from using the first
808
809
  * certificate from the store.
810
+ *
811
+ * `webContents` is `null` when the request does not originate from a renderer
812
+ * process, for example when using `net.request` or `net.fetch` in the main
813
+ * process, or from a utility process created with
814
+ * `respondToAuthRequestsFromMainProcess: true`. For utility processes created
815
+ * without that flag, `net` requests proceed without a client certificate and this
816
+ * event is not emitted.
809
817
  */
810
818
  on(event: 'select-client-certificate', listener: (event: Event,
811
- webContents: WebContents,
819
+ webContents: (WebContents) | (null),
812
820
  url: string,
813
821
  certificateList: Certificate[],
814
822
  callback: (certificate?: Certificate) => void) => void): this;
815
823
  off(event: 'select-client-certificate', listener: (event: Event,
816
- webContents: WebContents,
824
+ webContents: (WebContents) | (null),
817
825
  url: string,
818
826
  certificateList: Certificate[],
819
827
  callback: (certificate?: Certificate) => void) => void): this;
820
828
  once(event: 'select-client-certificate', listener: (event: Event,
821
- webContents: WebContents,
829
+ webContents: (WebContents) | (null),
822
830
  url: string,
823
831
  certificateList: Certificate[],
824
832
  callback: (certificate?: Certificate) => void) => void): this;
825
833
  addListener(event: 'select-client-certificate', listener: (event: Event,
826
- webContents: WebContents,
834
+ webContents: (WebContents) | (null),
827
835
  url: string,
828
836
  certificateList: Certificate[],
829
837
  callback: (certificate?: Certificate) => void) => void): this;
830
838
  removeListener(event: 'select-client-certificate', listener: (event: Event,
831
- webContents: WebContents,
839
+ webContents: (WebContents) | (null),
832
840
  url: string,
833
841
  certificateList: Certificate[],
834
842
  callback: (certificate?: Certificate) => void) => void): this;
@@ -1149,6 +1157,12 @@ declare namespace Electron {
1149
1157
  /**
1150
1158
  * Array of `ProcessMetric` objects that correspond to memory and CPU usage
1151
1159
  * statistics of all the processes associated with the app.
1160
+ *
1161
+ * > [!NOTE] `cpu.percentCPUUsage` and `cpu.idleWakeupsPerSecond` are averages over
1162
+ * the time since the last call to `app.getAppMetrics()`, and each call starts a
1163
+ * new measurement interval for every process at once. Other code in the main
1164
+ * process, including dependencies, shares those intervals. See `CPUUsage` for more
1165
+ * details.
1152
1166
  */
1153
1167
  getAppMetrics(): ProcessMetric[];
1154
1168
  /**
@@ -1158,7 +1172,7 @@ declare namespace Electron {
1158
1172
  /**
1159
1173
  * The current value displayed in the counter badge.
1160
1174
  *
1161
- * @platform linux,darwin
1175
+ * @platform darwin
1162
1176
  */
1163
1177
  getBadgeCount(): number;
1164
1178
  /**
@@ -1245,19 +1259,8 @@ declare namespace Electron {
1245
1259
  *
1246
1260
  *
1247
1261
  * * `openAtLogin` boolean - `true` if the app is set to open at login.
1248
- * * `openAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app is set to open
1249
- * as hidden at login. This does not work on macOS 13 and up.
1250
1262
  * * `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
1251
1263
  * automatically.
1252
- * * `wasOpenedAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app was
1253
- * opened as a hidden login item. This indicates that the app should not open any
1254
- * windows at startup. This setting is not available on MAS builds or on macOS 13
1255
- * and up.
1256
- * * `restoreState` boolean _macOS_ _Deprecated_ - `true` if the app was opened as
1257
- * a login item that should restore the state from the previous session. This
1258
- * indicates that the app should restore the windows that were open the last time
1259
- * the app was closed. This setting is not available on MAS builds or on macOS 13
1260
- * and up.
1261
1264
  * * `status` string _macOS_ - can be `not-registered`, `enabled`,
1262
1265
  * `requires-approval`, or `not-found`.
1263
1266
  * * `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open
@@ -1396,9 +1399,9 @@ declare namespace Electron {
1396
1399
  */
1397
1400
  invalidateCurrentActivity(): void;
1398
1401
  /**
1399
- * `true` if Chrome's accessibility support is enabled, `false` otherwise. This API
1400
- * will return `true` if the use of assistive technologies, such as screen readers,
1401
- * has been detected. See
1402
+ * `true` if Chromium's accessibility support is enabled, `false` otherwise. This
1403
+ * API will return `true` if the use of assistive technologies, such as screen
1404
+ * readers, has been detected. See
1402
1405
  * https://www.chromium.org/developers/design-documents/accessibility for more
1403
1406
  * details.
1404
1407
  *
@@ -1462,12 +1465,6 @@ declare namespace Electron {
1462
1465
  * @platform darwin
1463
1466
  */
1464
1467
  isSecureKeyboardEntryEnabled(): boolean;
1465
- /**
1466
- * Whether the current desktop environment is Unity launcher.
1467
- *
1468
- * @platform linux
1469
- */
1470
- isUnityRunning(): boolean;
1471
1468
  /**
1472
1469
  * Whether the move was successful. Please note that if the move is successful,
1473
1470
  * your application will quit and relaunch.
@@ -1594,7 +1591,7 @@ declare namespace Electron {
1594
1591
  */
1595
1592
  setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
1596
1593
  /**
1597
- * Manually enables Chrome's accessibility support, allowing to expose
1594
+ * Manually enables Chromium's accessibility support, allowing to expose
1598
1595
  * accessibility switch to users in application settings. See Chromium's
1599
1596
  * accessibility docs for more details. Disabled by default.
1600
1597
  *
@@ -1689,10 +1686,12 @@ declare namespace Electron {
1689
1686
  * Sets the counter badge for current app. Setting the count to `0` will hide the
1690
1687
  * badge.
1691
1688
  *
1692
- * On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
1689
+ * On macOS, it shows on the Dock icon. On Linux, it shows on docks and taskbars
1690
+ * that support the LauncherEntry D-Bus API,
1693
1691
  *
1694
- * > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
1695
- * information, please read the Unity integration documentation.
1692
+ * > [!NOTE] On Linux, the badge is associated with the app's `.desktop` file, so
1693
+ * `app.setDesktopName` (or the `desktopName` field in `package.json`) must match
1694
+ * the name of the app's actual `.desktop` file.
1696
1695
  *
1697
1696
  * > [!NOTE] On macOS, you need to ensure that your application has the permission
1698
1697
  * to display notifications for this method to work.
@@ -1706,14 +1705,31 @@ declare namespace Electron {
1706
1705
  */
1707
1706
  setClientCertRequestPasswordHandler(handler: (clientCertRequestParams: ClientCertRequestParams) => Promise<string>): void;
1708
1707
  /**
1709
- * Sets the `.desktop` filename on Linux. This should match the base filename of
1710
- * the app's installed `.desktop` file. The `.desktop` suffix is optional.
1708
+ * Sets the `.desktop` filename on Linux. This must match the base filename of the
1709
+ * app's installed `.desktop` file. The `.desktop` suffix is optional.
1710
+ *
1711
+ * The name (without the `.desktop` suffix) is the app's identity for Linux desktop
1712
+ * integration. It should be a reverse-DNS style ID such as `com.example.MyApp`,
1713
+ * following the desktop entry naming conventions. This value is used as:
1711
1714
  *
1712
- * This value is used to determine the default XDG application ID on Wayland and
1713
- * `WM_CLASS` on X11. If it is not set, Electron will attempt to infer a name, but
1714
- * it may not match the packaged app's actual `.desktop` file. This could result in
1715
- * the app showing a generic icon or failing to respond to global keyboard
1716
- * shortcuts.
1715
+ * * the XDG application ID (`app_id`) on Wayland and `WM_CLASS` on X11, used to
1716
+ * match the app's icon and window grouping.
1717
+ * * the app ID that `xdg-desktop-portal` reports to portal backends such as
1718
+ * GlobalShortcuts.
1719
+ *
1720
+ * Portals increasingly enforce this identity. If the name is not a valid
1721
+ * reverse-DNS ID or does not match an installed `.desktop` file:
1722
+ *
1723
+ * * GNOME 50.0/50.1 (Ubuntu 26.04) rejects `globalShortcut` binds with
1724
+ * `org.freedesktop.portal.Error.NotAllowed` — with no error surfaced to the app
1725
+ * (see #52218).
1726
+ * * `xdg-desktop-portal` 1.21 and later refuses portal sessions for app IDs it
1727
+ * cannot resolve to a `.desktop` file.
1728
+ *
1729
+ * If this value is not set and `desktopName` is not present in `package.json`,
1730
+ * Electron falls back to a lowercased, hyphenated slug of the app's name (e.g. `My
1731
+ * App` → `my-app.desktop`), which is unlikely to be a valid portal identity —
1732
+ * packaged apps should always set it explicitly.
1717
1733
  *
1718
1734
  * This API must be called before the `ready` event. The value can also be set
1719
1735
  * using `desktopName` in `package.json`.
@@ -1768,8 +1784,8 @@ declare namespace Electron {
1768
1784
  * is a stub application automatically generated by Squirrel which will
1769
1785
  * automatically launch the latest version.
1770
1786
  *
1771
- * For more information about setting different services as login items on macOS 13
1772
- * and up, see `SMAppService`.
1787
+ * For more information about setting different services as login items on macOS,
1788
+ * see `SMAppService`.
1773
1789
  *
1774
1790
  * @platform darwin,win32
1775
1791
  */
@@ -1881,7 +1897,7 @@ declare namespace Electron {
1881
1897
  * resources will be leaked and your app will lose its ability to reach outside the
1882
1898
  * sandbox completely, until your app is restarted.
1883
1899
  *
1884
- * Start accessing a security scoped resource. With this method Electron
1900
+ * Start accessing a security scoped resource. With this method, Electron
1885
1901
  * applications that are packaged for the Mac App Store may reach outside their
1886
1902
  * sandbox to access files chosen by the user. See Apple's documentation for a
1887
1903
  * description of how this system works.
@@ -1903,10 +1919,10 @@ declare namespace Electron {
1903
1919
  */
1904
1920
  whenReady(): Promise<void>;
1905
1921
  /**
1906
- * A `boolean` property that's `true` if Chrome's accessibility support is enabled,
1907
- * `false` otherwise. This property will be `true` if the use of assistive
1922
+ * A `boolean` property that's `true` if Chromium's accessibility support is
1923
+ * enabled, `false` otherwise. This property will be `true` if the use of assistive
1908
1924
  * technologies, such as screen readers, has been detected. Setting this property
1909
- * to `true` manually enables Chrome's accessibility support, allowing developers
1925
+ * to `true` manually enables Chromium's accessibility support, allowing developers
1910
1926
  * to expose accessibility switch to users in application settings.
1911
1927
  *
1912
1928
  * See Chromium's accessibility docs for more details. Disabled by default.
@@ -1926,13 +1942,8 @@ declare namespace Electron {
1926
1942
  applicationMenu: (Menu) | (null);
1927
1943
  /**
1928
1944
  * An `Integer` property that returns the badge count for current app. Setting the
1929
- * count to `0` will hide the badge.
1930
- *
1931
- * On macOS, setting this with any nonzero integer shows on the dock icon. On
1932
- * Linux, this property only works for Unity launcher.
1933
- *
1934
- * > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
1935
- * information, please read the Unity integration documentation.
1945
+ * count to `0` will hide the badge. Setting this with any nonzero integer shows
1946
+ * the count on the Dock icon on macOS, or on the launcher on Linux.
1936
1947
  *
1937
1948
  * > [!NOTE] On macOS, you need to ensure that your application has the permission
1938
1949
  * to display notifications for this property to take effect.
@@ -2318,6 +2329,20 @@ declare namespace Electron {
2318
2329
  * @platform darwin
2319
2330
  */
2320
2331
  removeListener(event: 'new-window-for-tab', listener: () => void): this;
2332
+ /**
2333
+ * Emitted after the persisted window state has been restored.
2334
+ *
2335
+ * Window state includes the window bounds (x, y, height, width) and display mode
2336
+ * (maximized, fullscreen, kiosk).
2337
+ *
2338
+ * > [!NOTE] This event is only emitted when windowStatePersistence is enabled in
2339
+ * BaseWindowConstructorOptions or in BrowserWindowConstructorOptions.
2340
+ */
2341
+ on(event: 'persisted-state-restored', listener: () => void): this;
2342
+ off(event: 'persisted-state-restored', listener: () => void): this;
2343
+ once(event: 'persisted-state-restored', listener: () => void): this;
2344
+ addListener(event: 'persisted-state-restored', listener: () => void): this;
2345
+ removeListener(event: 'persisted-state-restored', listener: () => void): this;
2321
2346
  /**
2322
2347
  * Emitted when a session is about to end due to a shutdown, machine restart, or
2323
2348
  * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
@@ -2695,6 +2720,15 @@ declare namespace Electron {
2695
2720
  * BaseWindow
2696
2721
  */
2697
2722
  constructor(options?: BaseWindowConstructorOptions);
2723
+ /**
2724
+ * Clears the saved state for a window with the given name. This removes all
2725
+ * persisted window bounds, display mode, and work area information that was
2726
+ * previously saved when `windowStatePersistence` was enabled.
2727
+ *
2728
+ * If the window `name` is empty or the window state doesn't exist, the method will
2729
+ * log a warning.
2730
+ */
2731
+ static clearPersistedState(name: string): void;
2698
2732
  /**
2699
2733
  * The window with the given `id`.
2700
2734
  */
@@ -2900,6 +2934,8 @@ declare namespace Electron {
2900
2934
  invalidateShadow(): void;
2901
2935
  /**
2902
2936
  * Whether the window is always on top of other windows.
2937
+ *
2938
+ * Not supported on Wayland (Linux).
2903
2939
  */
2904
2940
  isAlwaysOnTop(): boolean;
2905
2941
  /**
@@ -2918,6 +2954,10 @@ declare namespace Electron {
2918
2954
  isContentProtected(): boolean;
2919
2955
  /**
2920
2956
  * Whether the window is destroyed.
2957
+ *
2958
+ * > [!NOTE] Once a window is destroyed, accessing most of its other properties and
2959
+ * methods throws `Object has been destroyed`, so callbacks that may run after the
2960
+ * window is gone should guard with `isDestroyed()`.
2921
2961
  */
2922
2962
  isDestroyed(): boolean;
2923
2963
  /**
@@ -3151,6 +3191,8 @@ declare namespace Electron {
3151
3191
  * Sets whether the window should show always on top of other windows. After
3152
3192
  * setting this, the window is still a normal window, not a toolbox window which
3153
3193
  * can not be focused on.
3194
+ *
3195
+ * Not supported on Wayland (Linux).
3154
3196
  */
3155
3197
  setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock', relativeLevel?: number): void;
3156
3198
  /**
@@ -3267,6 +3309,16 @@ declare namespace Electron {
3267
3309
  * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
3268
3310
  * version 2004 and up the window will be removed from capture entirely, older
3269
3311
  * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
3312
+ * The change takes effect with the next desktop composition, not when the call
3313
+ * returns, so a capture started immediately afterwards can still contain the
3314
+ * window.
3315
+ *
3316
+ * Protection also applies in a Windows remote session. A Remote Desktop client
3317
+ * still shows the window to the remote user, but remote access software that works
3318
+ * by capturing the desktop cannot. To leave windows unprotected in remote sessions
3319
+ * instead, disable the `AllowWindowCaptureExclusionInRemoteSessions` Chromium
3320
+ * feature at the start of your main script. `win.isContentProtected()` still
3321
+ * returns `true` in that case.
3270
3322
  *
3271
3323
  * @platform darwin,win32
3272
3324
  */
@@ -3332,7 +3384,10 @@ declare namespace Electron {
3332
3384
  * Makes the window ignore all mouse events.
3333
3385
  *
3334
3386
  * All mouse events happened in this window will be passed to the window below this
3335
- * window, but if this window has focus, it will still receive keyboard events.
3387
+ * window, but if this window has focus, it will still receive keyboard events. On
3388
+ * Linux this is supported on both X11 and Wayland. On X11 the X server has applied
3389
+ * the window's new input shape when the call returns; on Wayland the new input
3390
+ * region is applied with the window's next frame.
3336
3391
  */
3337
3392
  setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
3338
3393
  /**
@@ -3409,13 +3464,14 @@ declare namespace Electron {
3409
3464
  * Remove progress bar when progress < 0; Change to indeterminate mode when
3410
3465
  * progress > 1.
3411
3466
  *
3412
- * On Linux platform, only supports Unity desktop environment, you need to specify
3413
- * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
3414
- * it will assume `{app.name}.desktop`.
3415
- *
3416
3467
  * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
3417
3468
  * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
3418
3469
  * mode set (but with a value within the valid range), `normal` will be assumed.
3470
+ *
3471
+ * On Linux, the progress bar shows on docks and taskbars that support the
3472
+ * LauncherEntry D-Bus API. It is associated with the app's `.desktop` file, so
3473
+ * `app.setDesktopName` must match the name of the app's actual `.desktop` file.
3474
+ * Indeterminate mode is not supported.
3419
3475
  */
3420
3476
  setProgressBar(progress: number, options?: ProgressBarOptions): void;
3421
3477
  /**
@@ -3796,7 +3852,7 @@ declare namespace Electron {
3796
3852
  acceptFirstMouse?: boolean;
3797
3853
  /**
3798
3854
  * Whether the window should always stay on top of other windows. Default is
3799
- * `false`.
3855
+ * `false`. Not supported on Wayland (Linux).
3800
3856
  */
3801
3857
  alwaysOnTop?: boolean;
3802
3858
  /**
@@ -3934,7 +3990,11 @@ declare namespace Electron {
3934
3990
  */
3935
3991
  movable?: boolean;
3936
3992
  /**
3937
- * Set internal window name (ow-electron).
3993
+ * A unique identifier for the window, used internally by Electron to enable
3994
+ * features such as state persistence. Each window must have a distinct name. It
3995
+ * can only be reused after the corresponding window has been destroyed. An error
3996
+ * is thrown if the name is already in use. This is not the visible title shown to
3997
+ * users on the title bar.
3938
3998
  */
3939
3999
  name?: string;
3940
4000
  /**
@@ -3953,11 +4013,10 @@ declare namespace Electron {
3953
4013
  */
3954
4014
  resizable?: boolean;
3955
4015
  /**
3956
- * Whether frameless window should have rounded corners. Default is `true`. On
4016
+ * Whether a frameless window should have rounded corners. Default is `true`. On
3957
4017
  * Windows versions older than Windows 11 Build 22000 this property has no effect,
3958
- * and frameless windows will not have rounded corners.
3959
- *
3960
- * @platform darwin,win32
4018
+ * and frameless windows will not have rounded corners. On Linux, rounded corners
4019
+ * are only drawn when the desktop environment supports client-side decorations.
3961
4020
  */
3962
4021
  roundedCorners?: boolean;
3963
4022
  /**
@@ -4055,6 +4114,13 @@ declare namespace Electron {
4055
4114
  * Window's width in pixels. Default is `800`.
4056
4115
  */
4057
4116
  width?: number;
4117
+ /**
4118
+ * Configures or enables the persistence of window state (position, size, maximized
4119
+ * state, etc.) across application restarts. Has no effect if window `name` is not
4120
+ * provided. Automatically disabled when there is no available display.
4121
+ * _Experimental_
4122
+ */
4123
+ windowStatePersistence?: (WindowStatePersistence) | (boolean);
4058
4124
  /**
4059
4125
  * (**required** if y is used) Window's left offset from screen. Default is to
4060
4126
  * center the window.
@@ -4591,6 +4657,20 @@ declare namespace Electron {
4591
4657
  removeListener(event: 'page-title-updated', listener: (event: Event,
4592
4658
  title: string,
4593
4659
  explicitSet: boolean) => void): this;
4660
+ /**
4661
+ * Emitted after the persisted window state has been restored.
4662
+ *
4663
+ * Window state includes the window bounds (x, y, height, width) and display mode
4664
+ * (maximized, fullscreen, kiosk).
4665
+ *
4666
+ * > [!NOTE] This event is only emitted when windowStatePersistence is enabled in
4667
+ * BaseWindowConstructorOptions or in BrowserWindowConstructorOptions.
4668
+ */
4669
+ on(event: 'persisted-state-restored', listener: () => void): this;
4670
+ off(event: 'persisted-state-restored', listener: () => void): this;
4671
+ once(event: 'persisted-state-restored', listener: () => void): this;
4672
+ addListener(event: 'persisted-state-restored', listener: () => void): this;
4673
+ removeListener(event: 'persisted-state-restored', listener: () => void): this;
4594
4674
  /**
4595
4675
  * Emitted when a session is about to end due to a shutdown, machine restart, or
4596
4676
  * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
@@ -5571,8 +5651,7 @@ declare namespace Electron {
5571
5651
  */
5572
5652
  getNormalBounds(): Rectangle;
5573
5653
  /**
5574
- * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
5575
- * 1.
5654
+ * between 0.0 (fully transparent) and 1.0 (fully opaque).
5576
5655
  */
5577
5656
  getOpacity(): number;
5578
5657
  /**
@@ -5638,6 +5717,8 @@ declare namespace Electron {
5638
5717
  invalidateShadow(): void;
5639
5718
  /**
5640
5719
  * Whether the window is always on top of other windows.
5720
+ *
5721
+ * Not supported on Wayland (Linux).
5641
5722
  */
5642
5723
  isAlwaysOnTop(): boolean;
5643
5724
  /**
@@ -5935,6 +6016,8 @@ declare namespace Electron {
5935
6016
  * Sets whether the window should show always on top of other windows. After
5936
6017
  * setting this, the window is still a normal window, not a toolbox window which
5937
6018
  * can not be focused on.
6019
+ *
6020
+ * Not supported on Wayland (Linux).
5938
6021
  */
5939
6022
  setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock', relativeLevel?: number): void;
5940
6023
  /**
@@ -6063,7 +6146,16 @@ declare namespace Electron {
6063
6146
  * On Windows, it calls `SetWindowDisplayAffinity` with `WDA_EXCLUDEFROMCAPTURE`.
6064
6147
  * For Windows 10 version 2004 and up the window will be removed from capture
6065
6148
  * entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing
6066
- * a black window.
6149
+ * a black window. The change takes effect with the next desktop composition, not
6150
+ * when the call returns, so a capture started immediately afterwards can still
6151
+ * contain the window.
6152
+ *
6153
+ * Protection also applies in a Windows remote session. A Remote Desktop client
6154
+ * still shows the window to the remote user, but remote access software that works
6155
+ * by capturing the desktop cannot. To leave windows unprotected in remote sessions
6156
+ * instead, disable the `AllowWindowCaptureExclusionInRemoteSessions` Chromium
6157
+ * feature at the start of your main script. `win.isContentProtected()` still
6158
+ * returns `true` in that case.
6067
6159
  *
6068
6160
  * On macOS, it sets the `NSWindow`'s `sharingType` to `NSWindowSharingNone`.
6069
6161
  * Unfortunately, due to an intentional change in macOS, newer Mac applications
@@ -6133,7 +6225,10 @@ declare namespace Electron {
6133
6225
  * Makes the window ignore all mouse events.
6134
6226
  *
6135
6227
  * All mouse events happened in this window will be passed to the window below this
6136
- * window, but if this window has focus, it will still receive keyboard events.
6228
+ * window, but if this window has focus, it will still receive keyboard events. On
6229
+ * Linux this is supported on both X11 and Wayland. On X11 the X server has applied
6230
+ * the window's new input shape when the call returns; on Wayland the new input
6231
+ * region is applied with the window's next frame.
6137
6232
  */
6138
6233
  setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
6139
6234
  /**
@@ -6182,10 +6277,8 @@ declare namespace Electron {
6182
6277
  */
6183
6278
  setMovable(movable: boolean): void;
6184
6279
  /**
6185
- * Sets the opacity of the window. On Linux, does nothing. Out of bound number
6186
- * values are clamped to the [0, 1] range.
6187
- *
6188
- * @platform win32,darwin
6280
+ * Sets the opacity of the window. Out of bound number values are clamped to the
6281
+ * [0, 1] range.
6189
6282
  */
6190
6283
  setOpacity(opacity: number): void;
6191
6284
  /**
@@ -6212,13 +6305,14 @@ declare namespace Electron {
6212
6305
  * Remove progress bar when progress < 0; Change to indeterminate mode when
6213
6306
  * progress > 1.
6214
6307
  *
6215
- * On Linux platform, only supports Unity desktop environment, you need to specify
6216
- * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
6217
- * it will assume `{app.name}.desktop`.
6218
- *
6219
6308
  * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
6220
6309
  * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
6221
6310
  * mode set (but with a value within the valid range), `normal` will be assumed.
6311
+ *
6312
+ * On Linux, the progress bar shows on docks and taskbars that support the
6313
+ * LauncherEntry D-Bus API. It is associated with the app's `.desktop` file, so
6314
+ * `app.setDesktopName` must match the name of the app's actual `.desktop` file.
6315
+ * Indeterminate mode is not supported.
6222
6316
  */
6223
6317
  setProgressBar(progress: number, options?: ProgressBarOptions): void;
6224
6318
  /**
@@ -6596,6 +6690,9 @@ declare namespace Electron {
6596
6690
  *
6597
6691
  * See the `webContents` documentation for its methods and events.
6598
6692
  *
6693
+ * > [!NOTE] Reading this property throws `Object has been destroyed` once the
6694
+ * window has been destroyed; see `win.isDestroyed()`.
6695
+ *
6599
6696
  */
6600
6697
  readonly webContents: WebContents;
6601
6698
  }
@@ -6921,118 +7018,91 @@ declare namespace Electron {
6921
7018
 
6922
7019
  // Docs: https://electronjs.org/docs/api/clipboard
6923
7020
 
6924
- /**
6925
- * An array of supported formats for the clipboard `type`.
6926
- */
6927
- availableFormats(type?: 'selection' | 'clipboard'): string[];
6928
7021
  /**
6929
7022
  * Clears the clipboard content.
6930
7023
  */
6931
- clear(type?: 'selection' | 'clipboard'): void;
6932
- /**
6933
- * Whether the clipboard supports the specified `format`.
6934
- *
6935
- * @experimental
6936
- */
6937
- has(format: string, type?: 'selection' | 'clipboard'): boolean;
6938
- /**
6939
- * Reads `format` type from the clipboard.
6940
- *
6941
- * `format` should contain valid ASCII characters and have `/` separator. `a/c`,
6942
- * `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid.
6943
- *
6944
- * @experimental
6945
- */
6946
- read(format: string): string;
6947
- /**
6948
- * * `title` string
6949
- * * `url` string
6950
- *
6951
- * Returns an Object containing `title` and `url` keys representing the bookmark in
6952
- * the clipboard. The `title` and `url` values will be empty strings when the
6953
- * bookmark is unavailable. The `title` value will always be empty on Windows.
6954
- *
6955
- * @platform darwin,win32
6956
- */
6957
- readBookmark(): ReadBookmark;
6958
- /**
6959
- * Reads `format` type from the clipboard.
6960
- *
6961
- * @experimental
6962
- */
6963
- readBuffer(format: string): Buffer;
6964
- /**
6965
- * The text on the find pasteboard, which is the pasteboard that holds information
6966
- * about the current state of the active application’s find panel.
6967
- *
6968
- * This method uses synchronous IPC when called from the renderer process. The
6969
- * cached value is reread from the find pasteboard whenever the application is
6970
- * activated.
6971
- *
6972
- * @platform darwin
6973
- */
6974
- readFindText(): string;
7024
+ clear(): void;
6975
7025
  /**
6976
- * The content in the clipboard as markup.
7026
+ * A promise that resolves with `true` if the clipboard contains data of the
7027
+ * specified `mimetype`, otherwise `false`. To check for a raw format, eg
7028
+ * `public/utf8-plain-text`, use the `electron application/osclipboard` custom
7029
+ * format (`electron application/osclipboard;format="public/utf8-plain-text"`).
6977
7030
  */
6978
- readHTML(type?: 'selection' | 'clipboard'): string;
7031
+ has(mimetype: string): Promise<boolean>;
6979
7032
  /**
6980
- * The image content in the clipboard.
7033
+ * A promise that resolves with an array of ClipboardItem objects containing the
7034
+ * clipboard's contents.
6981
7035
  */
6982
- readImage(type?: 'selection' | 'clipboard'): NativeImage;
7036
+ read(): Promise<Electron.ClipboardItem[]>;
6983
7037
  /**
6984
- * The content in the clipboard as RTF.
7038
+ * A promise that resolves with the content of the clipboard as plain text. Modeled
7039
+ * after the W3C `navigator.clipboard.readText` API.
6985
7040
  */
6986
- readRTF(type?: 'selection' | 'clipboard'): string;
7041
+ readText(): Promise<string>;
6987
7042
  /**
6988
- * The content in the clipboard as plain text.
7043
+ * Resolves once the data has been written to the clipboard. All entries supplied
7044
+ * in a single `write()` call are committed to the system clipboard atomically.
6989
7045
  */
6990
- readText(type?: 'selection' | 'clipboard'): string;
7046
+ write(data: ClipboardItem[]): Promise<void>;
6991
7047
  /**
6992
- * Writes `data` to the clipboard.
7048
+ * A promise that resolves once the text has been written to the clipboard. Modeled
7049
+ * after the W3C `navigator.clipboard.writeText` API.
6993
7050
  */
6994
- write(data: Data, type?: 'selection' | 'clipboard'): void;
7051
+ writeText(text: string): Promise<void>;
6995
7052
  /**
6996
- * Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
6997
- *
6998
- * > [!NOTE] Most apps on Windows don't support pasting bookmarks into them so you
6999
- * can use `clipboard.write` to write both a bookmark and fallback text to the
7000
- * clipboard.
7053
+ * A `Clipboard` property — a `Clipboard` object on Linux that operates against the
7054
+ * selection clipboard instead of the system clipboard, and `undefined` on all
7055
+ * other platforms. It exposes the same `read`, `write`, `readText`, `writeText`,
7056
+ * `has`, and `clear` methods as the top-level `clipboard` module.
7001
7057
  *
7002
- * @platform darwin,win32
7058
+ * @platform linux
7003
7059
  */
7004
- writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
7060
+ readonly selection: Clipboard;
7061
+ }
7062
+
7063
+ interface ClipboardBookmark {
7064
+
7065
+ // Docs: https://electronjs.org/docs/api/structures/clipboard-bookmark
7066
+
7005
7067
  /**
7006
- * Writes the `buffer` into the clipboard as `format`.
7007
- *
7008
- * @experimental
7068
+ * The title of the bookmark.
7009
7069
  */
7010
- writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
7070
+ title: string;
7011
7071
  /**
7012
- * Writes the `text` into the find pasteboard (the pasteboard that holds
7013
- * information about the current state of the active application’s find panel) as
7014
- * plain text. This method uses synchronous IPC when called from the renderer
7015
- * process.
7016
- *
7017
- * @platform darwin
7072
+ * The URL of the bookmark.
7018
7073
  */
7019
- writeFindText(text: string): void;
7074
+ url: string;
7075
+ }
7076
+
7077
+ class ClipboardItem {
7078
+
7079
+ // Docs: https://electronjs.org/docs/api/clipboard-item
7080
+
7020
7081
  /**
7021
- * Writes `markup` to the clipboard.
7082
+ * ClipboardItem
7022
7083
  */
7023
- writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
7084
+ constructor(items: Record<string, (string) | (ClipboardBookmark) | (Blob) | (Promise<(Blob) | (string)>)>);
7024
7085
  /**
7025
- * Writes `image` to the clipboard.
7086
+ * Resolves with the payload for the given MIME type. Modeled after the W3C
7087
+ * `ClipboardItem.getType` method. The promise resolves to a `Blob` for most MIME
7088
+ * types; the one exception is `getType('electron application/bookmark')`, which
7089
+ * resolves to a ClipboardBookmark object instead. Rejects when `type` is not
7090
+ * present in `clipboardItem.types`.
7026
7091
  */
7027
- writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
7092
+ getType<T extends string>(type: T): Promise<string extends T ? (Blob | ClipboardBookmark) : T extends 'electron application/bookmark' ? ClipboardBookmark : Blob>;
7028
7093
  /**
7029
- * Writes the `text` into the clipboard in RTF.
7094
+ * Resolves with a ClipboardBookmark when a bookmark is available in the clipboard.
7095
+ * Rejects when a bookmark is not available in the clipboard.
7030
7096
  */
7031
- writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
7097
+ getType(bookmark: 'electron application/bookmark'): Promise<Electron.ClipboardBookmark>;
7032
7098
  /**
7033
- * Writes the `text` into the clipboard as plain text.
7099
+ * A `string[]` property — the MIME types of the data carried by this entry. For a
7100
+ * constructed `ClipboardItem` these are the keys passed to the constructor; for an
7101
+ * item returned by `clipboard.read()` these are the MIME types the platform
7102
+ * clipboard currently makes available.
7103
+ *
7034
7104
  */
7035
- writeText(text: string, type?: 'selection' | 'clipboard'): void;
7105
+ readonly types: string[];
7036
7106
  }
7037
7107
 
7038
7108
  interface ColorSpace {
@@ -7371,12 +7441,14 @@ declare namespace Electron {
7371
7441
  */
7372
7442
  cumulativeCPUUsage?: number;
7373
7443
  /**
7374
- * The number of average idle CPU wakeups per second since the last call to
7375
- * getCPUUsage. First call returns 0. Will always return 0 on Windows.
7444
+ * The number of average idle CPU wakeups per second since the last call to the API
7445
+ * that returned this object. First call returns 0. Will always return 0 on
7446
+ * Windows.
7376
7447
  */
7377
7448
  idleWakeupsPerSecond: number;
7378
7449
  /**
7379
- * Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
7450
+ * Percentage of CPU used since the last call to the API that returned this object.
7451
+ * First call returns 0.
7380
7452
  */
7381
7453
  percentCPUUsage: number;
7382
7454
  }
@@ -7396,7 +7468,9 @@ declare namespace Electron {
7396
7468
  /**
7397
7469
  * Set an extra parameter to be sent with the crash report. The values specified
7398
7470
  * here will be sent in addition to any values set via the `extra` option when
7399
- * `start` was called.
7471
+ * `start` was called. Calling this again with the same key replaces the value. The
7472
+ * value is read when a crash happens, so you can update it as your app's state
7473
+ * changes.
7400
7474
  *
7401
7475
  * Parameters added in this fashion (or via the `extra` parameter to
7402
7476
  * `crashReporter.start`) are specific to the calling process. Adding extra
@@ -7404,29 +7478,42 @@ declare namespace Electron {
7404
7478
  * with crashes from renderer or other child processes. Similarly, adding extra
7405
7479
  * parameters in a renderer process will not result in those parameters being sent
7406
7480
  * with crashes that occur in other renderer processes or in the main process.
7481
+ * Processes created with `utilityProcess` have no API for setting extra
7482
+ * parameters, so only `globalExtra` values are sent with their crashes.
7407
7483
  *
7408
7484
  * > [!NOTE] Parameters have limits on the length of the keys and values. Key names
7409
7485
  * must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
7410
- * Keys with names longer than the maximum will be silently ignored. Key values
7411
- * longer than the maximum length will be truncated.
7486
+ * Keys with names longer than the maximum are ignored, and a warning is emitted.
7487
+ * Values longer than the maximum length are truncated.
7412
7488
  */
7413
7489
  addExtraParameter(key: string, value: string): void;
7414
7490
  /**
7415
- * The date and ID of the last crash report. Only crash reports that have been
7416
- * uploaded will be returned; even if a crash report is present on disk it will not
7417
- * be returned until it is uploaded. In the case that there are no uploaded
7418
- * reports, `null` is returned.
7491
+ * The date and ID of the crash report with the most recent upload time, from the
7492
+ * list returned by `getUploadedReports()`. If there are no crash reports at all,
7493
+ * `null` is returned.
7494
+ *
7495
+ * If no report has been uploaded yet but some are stored on disk, a report that
7496
+ * has not been uploaded may be returned. Check that its `id` is not empty before
7497
+ * treating it as uploaded.
7419
7498
  *
7420
7499
  * > [!NOTE] This method is only available in the main process.
7421
7500
  */
7422
7501
  getLastCrashReport(): (CrashReport) | (null);
7423
7502
  /**
7424
- * The current 'extra' parameters of the crash reporter.
7503
+ * The current 'extra' parameters of the crash reporter in the calling process, as
7504
+ * set with the `extra` option and `addExtraParameter`. Parameters set with the
7505
+ * `globalExtra` option are not included.
7425
7506
  */
7426
7507
  getParameters(): Record<string, string>;
7427
7508
  /**
7428
- * Returns all uploaded crash reports. Each report contains the date and uploaded
7429
- * ID.
7509
+ * Returns the crash reports stored on disk. Each report contains the date it was
7510
+ * uploaded and the ID that the crash server returned for it.
7511
+ *
7512
+ * Despite the method's name, reports that have not been uploaded (for example
7513
+ * because `uploadToServer` is `false`, the upload failed, or the report was rate
7514
+ * limited) are included too. For those reports, `id` is an empty string and `date`
7515
+ * is not meaningful. To list only uploaded reports, filter out reports with an
7516
+ * empty `id`.
7430
7517
  *
7431
7518
  * > [!NOTE] This method is only available in the main process.
7432
7519
  */
@@ -7469,9 +7556,9 @@ declare namespace Electron {
7469
7556
  *
7470
7557
  * > [!NOTE] Parameters passed in `extra`, `globalExtra` or set with
7471
7558
  * `addExtraParameter` have limits on the length of the keys and values. Key names
7472
- * must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
7473
- * with names longer than the maximum will be silently ignored. Key values longer
7474
- * than the maximum length will be truncated.
7559
+ * must be at most 39 bytes long, and values must be no longer than 20320 bytes.
7560
+ * Keys with names longer than the maximum are ignored, and a warning is emitted.
7561
+ * Values longer than the maximum length are truncated.
7475
7562
  *
7476
7563
  * > [!NOTE] This method is only available in the main process.
7477
7564
  */
@@ -7618,6 +7705,14 @@ declare namespace Electron {
7618
7705
  * indicating the failure of the command.
7619
7706
  *
7620
7707
  * Send given command to the debugging target.
7708
+ *
7709
+ * > [!NOTE]
7710
+ *
7711
+ * * If `sendCommand` is called before the target has navigated (e.g. immediately
7712
+ * after `attach()`), the returned promise may not resolve until navigation occurs.
7713
+ * * If the command's response has no `result` data, as defined by that command's
7714
+ * entry in the remote debugging protocol, the promise resolves with an empty
7715
+ * object (`{}`), not `null` or `undefined`.
7621
7716
  */
7622
7717
  sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
7623
7718
  }
@@ -8077,6 +8172,11 @@ declare namespace Electron {
8077
8172
  /**
8078
8173
  * Hides the dock icon.
8079
8174
  *
8175
+ * > [!IMPORTANT] **Known issue:** Calling `dock.hide()` within one second of a
8176
+ * previous call will have no effect. As a workaround, ensure at least one second
8177
+ * has elapsed between calls — for example, by deferring with a `setTimeout` of
8178
+ * 1100ms or more after a previous call.
8179
+ *
8080
8180
  * @platform darwin
8081
8181
  */
8082
8182
  hide(): void;
@@ -8220,6 +8320,14 @@ declare namespace Electron {
8220
8320
  * actual name of saved file will be different.
8221
8321
  */
8222
8322
  getFilename(): string;
8323
+ /**
8324
+ * The origin that started the download (for example `https://example.com`, or
8325
+ * `null` for an opaque origin), or an empty string if the download was not started
8326
+ * by web content (for example `webContents.downloadURL()`). Use this rather than
8327
+ * `getURL()` or the `webContents` to decide whose download it is: the URL is
8328
+ * chosen by the initiator and the `webContents` is the whole tab.
8329
+ */
8330
+ getInitiatorOrigin(): string;
8223
8331
  /**
8224
8332
  * Last-Modified header value.
8225
8333
  */
@@ -9579,6 +9687,27 @@ declare namespace Electron {
9579
9687
  * An `Accelerator | null` indicating the item's accelerator, if set.
9580
9688
  */
9581
9689
  accelerator: (Accelerator) | (null);
9690
+ /**
9691
+ * A `string` indicating the item's accessibility label (used by assistive
9692
+ * technology), if set.
9693
+ *
9694
+ * This property can be dynamically changed.
9695
+ *
9696
+ * @platform darwin
9697
+ */
9698
+ accessibilityLabel: string;
9699
+ /**
9700
+ * A `MenuItemBadge` (optional) indicating the badge for the menu item.
9701
+ *
9702
+ * This property can be dynamically changed; setting it to `undefined` removes the
9703
+ * badge. Only available on macOS 14 and up.
9704
+ *
9705
+ * Badges are not displayed in Dock menus, though the same item shows its badge in
9706
+ * an application menu.
9707
+ *
9708
+ * @platform darwin
9709
+ */
9710
+ badge?: MenuItemBadge;
9582
9711
  /**
9583
9712
  * A `boolean` indicating whether the item is checked.
9584
9713
  *
@@ -9706,6 +9835,27 @@ declare namespace Electron {
9706
9835
  visible: boolean;
9707
9836
  }
9708
9837
 
9838
+ interface MenuItemBadge {
9839
+
9840
+ // Docs: https://electronjs.org/docs/api/structures/menu-item-badge
9841
+
9842
+ /**
9843
+ * A custom string to display in the badge. Required for, and only usable with, the
9844
+ * `none` type.
9845
+ */
9846
+ content?: string;
9847
+ /**
9848
+ * The number of items the badge displays. Required for the `alerts`, `updates` and
9849
+ * `new-items` types; cannot be used with `none`.
9850
+ */
9851
+ count?: number;
9852
+ /**
9853
+ * Can be `alerts`, `updates`, `new-items` or `none`. Default is `none`. See
9854
+ * Creating badges of a specific type for further explanation of these types.
9855
+ */
9856
+ type?: ('alerts' | 'updates' | 'new-items' | 'none');
9857
+ }
9858
+
9709
9859
  class MessageChannelMain {
9710
9860
 
9711
9861
  // Docs: https://electronjs.org/docs/api/message-channel-main
@@ -9870,13 +10020,20 @@ declare namespace Electron {
9870
10020
  *
9871
10021
  * @platform darwin
9872
10022
  */
9873
- static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
10023
+ static createFromNamedImage(imageName: string, options?: (CreateFromNamedImageOptions) | (number[])): NativeImage;
9874
10024
  /**
9875
10025
  * Creates a new `NativeImage` instance from an image file (e.g., PNG or JPEG)
9876
10026
  * located at `path`. This method returns an empty image if the `path` does not
9877
10027
  * exist, cannot be read, or is not a valid image.
9878
10028
  */
9879
10029
  static createFromPath(path: string): NativeImage;
10030
+ /**
10031
+ * Creates a new `NativeImage` instance from an SF Symbol for use in a native Menu.
10032
+ * See SF Symbols for a list of possible values.
10033
+ *
10034
+ * @platform darwin
10035
+ */
10036
+ static createMenuSymbol(imageName: string): NativeImage;
9880
10037
  /**
9881
10038
  * fulfilled with the file's thumbnail preview image, which is a NativeImage.
9882
10039
  *
@@ -10179,8 +10336,8 @@ declare namespace Electron {
10179
10336
  * see Response.
10180
10337
  *
10181
10338
  * Sends a request, similarly to how `fetch()` works in the renderer, using
10182
- * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
10183
- * HTTP stack.
10339
+ * Chromium's network stack. This differs from Node's `fetch()`, which uses
10340
+ * Node.js's HTTP stack.
10184
10341
  *
10185
10342
  * Example:
10186
10343
  *
@@ -11302,7 +11459,8 @@ declare namespace Electron {
11302
11459
  // Docs: https://electronjs.org/docs/api/structures/process-metric
11303
11460
 
11304
11461
  /**
11305
- * CPU usage of the process.
11462
+ * CPU usage of the process. Its `percentCPUUsage` and `idleWakeupsPerSecond` are
11463
+ * averages over the time since the previous call to the API returning this object.
11306
11464
  */
11307
11465
  cpu: CPUUsage;
11308
11466
  /**
@@ -11467,6 +11625,12 @@ declare namespace Electron {
11467
11625
  * Register a protocol handler for `scheme`. Requests made to URLs with this scheme
11468
11626
  * will delegate to this handler to determine what response should be sent.
11469
11627
  *
11628
+ * In addition to the standard `Request` fields, `request.initiatorOrigin` is set
11629
+ * to the origin that issued the request (for example `https://example.com`, or
11630
+ * `null` for an opaque origin) when web content made it; it is absent for requests
11631
+ * the browser started itself. Unlike `request.referrer` it is not controlled by
11632
+ * the requesting page, so prefer it when deciding whether to serve a request.
11633
+ *
11470
11634
  * Either a `Response` or a `Promise<Response>` can be returned.
11471
11635
  *
11472
11636
  * Example:
@@ -11671,6 +11835,12 @@ declare namespace Electron {
11671
11835
  // Docs: https://electronjs.org/docs/api/structures/protocol-request
11672
11836
 
11673
11837
  headers: Record<string, string>;
11838
+ /**
11839
+ * The origin that issued the request (for example `https://example.com`, or `null`
11840
+ * for an opaque origin). Absent for requests the browser started itself. Unlike
11841
+ * `referrer`, this is not controlled by the requesting page.
11842
+ */
11843
+ initiatorOrigin?: string;
11674
11844
  method: string;
11675
11845
  referrer: string;
11676
11846
  uploadData?: UploadData[];
@@ -12539,7 +12709,11 @@ declare namespace Electron {
12539
12709
  * True if the renderer is requesting that the connection include credentials (see
12540
12710
  * the spec for more details.)
12541
12711
  */
12542
- allowCredentials: boolean) => void): this;
12712
+ allowCredentials: boolean,
12713
+ /**
12714
+ * The frame that requested the preconnection, if it still exists.
12715
+ */
12716
+ frame: (WebFrameMain) | (null)) => void): this;
12543
12717
  off(event: 'preconnect', listener: (event: Event,
12544
12718
  /**
12545
12719
  * The URL being requested for preconnection by the renderer.
@@ -12549,7 +12723,11 @@ declare namespace Electron {
12549
12723
  * True if the renderer is requesting that the connection include credentials (see
12550
12724
  * the spec for more details.)
12551
12725
  */
12552
- allowCredentials: boolean) => void): this;
12726
+ allowCredentials: boolean,
12727
+ /**
12728
+ * The frame that requested the preconnection, if it still exists.
12729
+ */
12730
+ frame: (WebFrameMain) | (null)) => void): this;
12553
12731
  once(event: 'preconnect', listener: (event: Event,
12554
12732
  /**
12555
12733
  * The URL being requested for preconnection by the renderer.
@@ -12559,7 +12737,11 @@ declare namespace Electron {
12559
12737
  * True if the renderer is requesting that the connection include credentials (see
12560
12738
  * the spec for more details.)
12561
12739
  */
12562
- allowCredentials: boolean) => void): this;
12740
+ allowCredentials: boolean,
12741
+ /**
12742
+ * The frame that requested the preconnection, if it still exists.
12743
+ */
12744
+ frame: (WebFrameMain) | (null)) => void): this;
12563
12745
  addListener(event: 'preconnect', listener: (event: Event,
12564
12746
  /**
12565
12747
  * The URL being requested for preconnection by the renderer.
@@ -12569,7 +12751,11 @@ declare namespace Electron {
12569
12751
  * True if the renderer is requesting that the connection include credentials (see
12570
12752
  * the spec for more details.)
12571
12753
  */
12572
- allowCredentials: boolean) => void): this;
12754
+ allowCredentials: boolean,
12755
+ /**
12756
+ * The frame that requested the preconnection, if it still exists.
12757
+ */
12758
+ frame: (WebFrameMain) | (null)) => void): this;
12573
12759
  removeListener(event: 'preconnect', listener: (event: Event,
12574
12760
  /**
12575
12761
  * The URL being requested for preconnection by the renderer.
@@ -12579,7 +12765,11 @@ declare namespace Electron {
12579
12765
  * True if the renderer is requesting that the connection include credentials (see
12580
12766
  * the spec for more details.)
12581
12767
  */
12582
- allowCredentials: boolean) => void): this;
12768
+ allowCredentials: boolean,
12769
+ /**
12770
+ * The frame that requested the preconnection, if it still exists.
12771
+ */
12772
+ frame: (WebFrameMain) | (null)) => void): this;
12583
12773
  /**
12584
12774
  * Emitted when a HID device needs to be selected when a call to
12585
12775
  * `navigator.hid.requestDevice` is made. `callback` should be called with
@@ -12917,26 +13107,47 @@ declare namespace Electron {
12917
13107
  removeListener(event: 'usb-device-revoked', listener: (event: Event,
12918
13108
  details: UsbDeviceRevokedDetails) => void): this;
12919
13109
  /**
12920
- * Emitted when Electron is about to download `item` in `webContents`.
13110
+ * Emitted when Electron is about to download `item` in `webContents`. See also
13111
+ * `item.getInitiatorOrigin()`.
12921
13112
  *
12922
13113
  * Calling `event.preventDefault()` will cancel the download and `item` will not be
12923
13114
  * available from next tick of the process.
12924
13115
  */
12925
13116
  on(event: 'will-download', listener: (event: Event,
12926
13117
  item: DownloadItem,
12927
- webContents: WebContents) => void): this;
13118
+ webContents: WebContents,
13119
+ /**
13120
+ * The frame that started the download, if it still exists.
13121
+ */
13122
+ frame: (WebFrameMain) | (null)) => void): this;
12928
13123
  off(event: 'will-download', listener: (event: Event,
12929
13124
  item: DownloadItem,
12930
- webContents: WebContents) => void): this;
13125
+ webContents: WebContents,
13126
+ /**
13127
+ * The frame that started the download, if it still exists.
13128
+ */
13129
+ frame: (WebFrameMain) | (null)) => void): this;
12931
13130
  once(event: 'will-download', listener: (event: Event,
12932
13131
  item: DownloadItem,
12933
- webContents: WebContents) => void): this;
13132
+ webContents: WebContents,
13133
+ /**
13134
+ * The frame that started the download, if it still exists.
13135
+ */
13136
+ frame: (WebFrameMain) | (null)) => void): this;
12934
13137
  addListener(event: 'will-download', listener: (event: Event,
12935
13138
  item: DownloadItem,
12936
- webContents: WebContents) => void): this;
13139
+ webContents: WebContents,
13140
+ /**
13141
+ * The frame that started the download, if it still exists.
13142
+ */
13143
+ frame: (WebFrameMain) | (null)) => void): this;
12937
13144
  removeListener(event: 'will-download', listener: (event: Event,
12938
13145
  item: DownloadItem,
12939
- webContents: WebContents) => void): this;
13146
+ webContents: WebContents,
13147
+ /**
13148
+ * The frame that started the download, if it still exists.
13149
+ */
13150
+ frame: (WebFrameMain) | (null)) => void): this;
12940
13151
  /**
12941
13152
  * Whether the word was successfully written to the custom dictionary. This API
12942
13153
  * will not work on non-persistent (in-memory) sessions.
@@ -13042,8 +13253,8 @@ declare namespace Electron {
13042
13253
  * see Response.
13043
13254
  *
13044
13255
  * Sends a request, similarly to how `fetch()` works in the renderer, using
13045
- * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
13046
- * HTTP stack.
13256
+ * Chromium's network stack. This differs from Node's `fetch()`, which uses
13257
+ * Node.js's HTTP stack.
13047
13258
  *
13048
13259
  * Example:
13049
13260
  *
@@ -13333,7 +13544,7 @@ declare namespace Electron {
13333
13544
  * > [!NOTE] `isMainFrame` will always be `false` for a `fileSystem` request as a
13334
13545
  * result of Chromium limitations.
13335
13546
  */
13336
- setPermissionCheckHandler(handler: ((webContents: (WebContents) | (null), permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'geolocation' | 'fullscreen' | 'hid' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'openExternal' | 'pointerLock' | 'serial' | 'storage-access' | 'top-level-storage-access' | 'usb' | 'deprecated-sync-clipboard-read' | 'fileSystem', requestingOrigin: string, details: PermissionCheckHandlerHandlerDetails) => boolean) | (null)): void;
13547
+ setPermissionCheckHandler(handler: ((webContents: (WebContents) | (null), permission: 'ar' | 'automatic-fullscreen' | 'background-fetch' | 'background-sync' | 'captured-surface-control' | 'clipboard-read' | 'clipboard-sanitized-write' | 'deprecated-sync-clipboard-read' | 'display-capture' | 'fileSystem' | 'fullscreen' | 'geolocation' | 'geolocation-approximate' | 'hand-tracking' | 'hid' | 'idle-detection' | 'keyboardLock' | 'local-fonts' | 'local-network' | 'local-network-access' | 'loopback-network' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'nfc' | 'notifications' | 'openExternal' | 'payment-handler' | 'periodic-background-sync' | 'persistent-storage' | 'pointerLock' | 'screen-wake-lock' | 'sensors' | 'serial' | 'smart-card' | 'speaker-selection' | 'storage-access' | 'system-wake-lock' | 'top-level-storage-access' | 'usb' | 'vr' | 'web-app-installation' | 'web-printing' | 'window-management' | 'unknown', requestingOrigin: string, details: PermissionCheckHandlerHandlerDetails) => boolean) | (null)): void;
13337
13548
  /**
13338
13549
  * Sets the handler which can be used to respond to permission requests for the
13339
13550
  * `session`. Calling `callback(true)` will allow the permission and
@@ -13342,7 +13553,7 @@ declare namespace Electron {
13342
13553
  * `setPermissionCheckHandler` to get complete permission handling. Most web APIs
13343
13554
  * do a permission check and then make a permission request if the check is denied.
13344
13555
  */
13345
- setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'display-capture' | 'fullscreen' | 'geolocation' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'pointerLock' | 'keyboardLock' | 'openExternal' | 'speaker-selection' | 'storage-access' | 'top-level-storage-access' | 'window-management' | 'unknown' | 'fileSystem', callback: (permissionGranted: boolean) => void, details: (PermissionRequest) | (FilesystemPermissionRequest) | (MediaAccessPermissionRequest) | (OpenExternalPermissionRequest)) => void) | (null)): void;
13556
+ setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'ar' | 'automatic-fullscreen' | 'background-fetch' | 'background-sync' | 'captured-surface-control' | 'clipboard-read' | 'clipboard-sanitized-write' | 'deprecated-sync-clipboard-read' | 'display-capture' | 'fileSystem' | 'fullscreen' | 'geolocation' | 'geolocation-approximate' | 'hand-tracking' | 'hid' | 'idle-detection' | 'keyboardLock' | 'local-fonts' | 'local-network' | 'local-network-access' | 'loopback-network' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'nfc' | 'notifications' | 'openExternal' | 'payment-handler' | 'periodic-background-sync' | 'persistent-storage' | 'pointerLock' | 'screen-wake-lock' | 'sensors' | 'serial' | 'smart-card' | 'speaker-selection' | 'storage-access' | 'system-wake-lock' | 'top-level-storage-access' | 'usb' | 'vr' | 'web-app-installation' | 'web-printing' | 'window-management' | 'unknown', callback: (permissionGranted: boolean) => void, details: (PermissionRequest) | (FilesystemPermissionRequest) | (MediaAccessPermissionRequest) | (OpenExternalPermissionRequest)) => void) | (null)): void;
13346
13557
  /**
13347
13558
  * Adds scripts that will be executed on ALL web contents that are associated with
13348
13559
  * this session just before normal `preload` scripts run.
@@ -15914,6 +16125,11 @@ declare namespace Electron {
15914
16125
  * no-op.
15915
16126
  */
15916
16127
  removeChildView(view: View): void;
16128
+ /**
16129
+ * > [!NOTE] You must set a background color with an alpha channel (e.g.
16130
+ * `#80ffffff`) in order for the blur effect to be visible.
16131
+ */
16132
+ setBackgroundBlur(blurRadius: number): void;
15917
16133
  /**
15918
16134
  * Examples of valid `color` values:
15919
16135
  *
@@ -17942,6 +18158,31 @@ declare namespace Electron {
17942
18158
  * @deprecated
17943
18159
  */
17944
18160
  clearHistory(): void;
18161
+ /**
18162
+ * A cloned WebContents instance. This method creates a copy of the WebContents
18163
+ * with the following attributes:
18164
+ *
18165
+ * * **WebPreferences** - All preferences from the original WebContents are copied
18166
+ * * **SiteInstance** - Uses the same SiteInstance as the original. This means the
18167
+ * cloned WebContents will reuse the same render process as the original when
18168
+ * loading same-origin pages, and only spawn a new render process for cross-origin
18169
+ * navigations. This process allocation behavior is consistent with window.open and
18170
+ * tab duplication in Chromium. For more details, see Chromium's Site Isolation
18171
+ * design document.
18172
+ * * **Opener relationship** - Inherits the opener (window.opener) relationship
18173
+ * * **Navigation state** - Copies the navigation history and controller state
18174
+ *
18175
+ * The cloned WebContents is an independent instance with its own lifecycle that
18176
+ * can be destroyed separately and will not contain any open web pages.
18177
+ *
18178
+ * This API is useful for use cases where you want to create a new WebContents that
18179
+ * shares the same render process with the original for same-origin content, while
18180
+ * maintaining full lifecycle independence. Additionally, reusing the existing
18181
+ * render process can help optimize memory usage and page load speed to a certain
18182
+ * extent, as it eliminates the overhead of spawning and initializing a new render
18183
+ * process from scratch.
18184
+ */
18185
+ clone(): WebContents;
17945
18186
  /**
17946
18187
  * Closes the page, as if the web content had called `window.close()`.
17947
18188
  *
@@ -17962,6 +18203,11 @@ declare namespace Electron {
17962
18203
  * Copy the image at the given position to the clipboard.
17963
18204
  */
17964
18205
  copyImageAt(x: number, y: number): void;
18206
+ /**
18207
+ * When executed on a video media element, copies the frame at (x, y) to the
18208
+ * clipboard.
18209
+ */
18210
+ copyVideoFrameAt(x: number, y: number): void;
17965
18211
  /**
17966
18212
  * Executes the editing command `cut` in web page.
17967
18213
  */
@@ -18118,6 +18364,10 @@ declare namespace Electron {
18118
18364
  * the current zoom level.
18119
18365
  */
18120
18366
  getZoomLevel(): number;
18367
+ /**
18368
+ * The current zoom mode. Can be `default`, `isolated`, `manual`, or `disabled`.
18369
+ */
18370
+ getZoomMode(): ('default' | 'isolated' | 'manual' | 'disabled');
18121
18371
  /**
18122
18372
  * Makes the browser go back a web page.
18123
18373
  *
@@ -18194,6 +18444,10 @@ declare namespace Electron {
18194
18444
  * greater than 0.
18195
18445
  */
18196
18446
  isBeingCaptured(): boolean;
18447
+ /**
18448
+ * Whether caret browsing is enabled for this page.
18449
+ */
18450
+ isCaretBrowsingEnabled(): boolean;
18197
18451
  /**
18198
18452
  * Whether the renderer process has crashed.
18199
18453
  */
@@ -18361,6 +18615,11 @@ declare namespace Electron {
18361
18615
  * resolves if the page is saved.
18362
18616
  */
18363
18617
  savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
18618
+ /**
18619
+ * When executed on a video media element, shows a save dialog and saves the frame
18620
+ * at (x, y) to disk.
18621
+ */
18622
+ saveVideoFrameAs(x: number, y: number): void;
18364
18623
  /**
18365
18624
  * Scrolls to the bottom of the current `webContents`.
18366
18625
  */
@@ -18424,6 +18683,10 @@ declare namespace Electron {
18424
18683
  * when the page becomes backgrounded. This also affects the Page Visibility API.
18425
18684
  */
18426
18685
  setBackgroundThrottling(allowed: boolean): void;
18686
+ /**
18687
+ * Sets whether caret browsing is enabled on the current web page.
18688
+ */
18689
+ setCaretBrowsingEnabled(enabled: boolean): void;
18427
18690
  /**
18428
18691
  * Changes the title of the DevTools window to `title`. This will only be visible
18429
18692
  * if DevTools is opened in `undocked` or `detach` mode.
@@ -18471,7 +18734,8 @@ declare namespace Electron {
18471
18734
  */
18472
18735
  setUserAgent(userAgent: string): void;
18473
18736
  /**
18474
- * Sets the maximum and minimum pinch-to-zoom level.
18737
+ * Sets the maximum and minimum pinch-to-zoom level. The page keeps its normal
18738
+ * scale until the user pinches; a `minimumLevel` below 1 only allows zooming out.
18475
18739
  *
18476
18740
  * > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
18477
18741
  */
@@ -18503,20 +18767,39 @@ declare namespace Electron {
18503
18767
  * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
18504
18768
  * divided by 100, so 300% = 3.0.
18505
18769
  *
18506
- * The factor must be greater than 0.0.
18770
+ * The factor must be greater than 0.0. Values outside the range Chromium can
18771
+ * display (0.25 to 5.0) are clamped to it.
18507
18772
  */
18508
18773
  setZoomFactor(factor: number): void;
18509
18774
  /**
18510
18775
  * Changes the zoom level to the specified level. The original size is 0 and each
18511
- * increment above or below represents zooming 20% larger or smaller to default
18512
- * limits of 300% and 50% of original size, respectively. The formula for this is
18513
- * `scale := 1.2 ^ level`.
18776
+ * increment above or below represents zooming 20% larger or smaller. The formula
18777
+ * for this is `scale := 1.2 ^ level`, and the level is clamped to the range
18778
+ * Chromium can display (25% to 500%, about -7.6 to 8.8).
18514
18779
  *
18515
- * > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
18516
- * zoom level for a specific domain propagates across all instances of windows with
18517
- * the same domain. Differentiating the window URLs will make zoom work per-window.
18780
+ * > [!NOTE] The zoom policy at the Chromium level is same-origin by default,
18781
+ * meaning that the zoom level for a specific domain propagates across all
18782
+ * instances of windows with the same domain. To use per-webContents zoom instead,
18783
+ * set the zoom mode to `'isolated'` via `contents.setZoomMode('isolated')`.
18518
18784
  */
18519
18785
  setZoomLevel(level: number): void;
18786
+ /**
18787
+ * Sets the zoom mode for this web contents.
18788
+ *
18789
+ * * `default` - Zoom changes are handled automatically on a per-origin basis.
18790
+ * Other webContents navigated to the same origin will share the same zoom level.
18791
+ * * `isolated` - Zoom changes are handled automatically but on a per-webContents
18792
+ * basis. This webContents will not be affected by zoom changes in other
18793
+ * webContents, and vice versa.
18794
+ * * `manual` - Automatic zoom handling is disabled. The `zoom-changed` event will
18795
+ * still be dispatched, but the page will not actually be zoomed. The zoom level
18796
+ * can be managed manually by the application.
18797
+ * * `disabled` - All zooming in this webContents is disabled. The webContents will
18798
+ * revert to the default zoom level and all zoom changes will be ignored.
18799
+ *
18800
+ * The `isolated` and `manual` zoom modes persist across navigations.
18801
+ */
18802
+ setZoomMode(mode: 'default' | 'isolated' | 'manual' | 'disabled'): void;
18520
18803
  /**
18521
18804
  * Shows pop-up dictionary that searches the selected word on the page.
18522
18805
  *
@@ -18573,6 +18856,25 @@ declare namespace Electron {
18573
18856
  * affects the Page Visibility API.
18574
18857
  */
18575
18858
  backgroundThrottling: boolean;
18859
+ /**
18860
+ * A `boolean` property that determines whether caret browsing is enabled for this
18861
+ * page.
18862
+ *
18863
+ * When enabled, a movable cursor is placed in the page's text, allowing the user
18864
+ * to navigate and select content with the keyboard. Changes apply to the live page
18865
+ * without reloading it.
18866
+ *
18867
+ * A `<webview>` guest inherits this value from its embedder when it is created and
18868
+ * then tracks it independently, so disabling caret browsing on the embedder leaves
18869
+ * an existing guest enabled.
18870
+ *
18871
+ * While any `WebContents` in the process has caret browsing enabled, assistive
18872
+ * technology is notified process-wide that caret browsing is active, so that
18873
+ * screen readers report the caret's position as it moves. That notification is
18874
+ * only withdrawn once every `WebContents` that enabled caret browsing has either
18875
+ * disabled it or been destroyed.
18876
+ */
18877
+ caretBrowsingEnabled: boolean;
18576
18878
  /**
18577
18879
  * A `Debugger` instance for this webContents.
18578
18880
  *
@@ -18683,6 +18985,12 @@ declare namespace Electron {
18683
18985
  * respectively. The formula for this is `scale := 1.2 ^ level`.
18684
18986
  */
18685
18987
  zoomLevel: number;
18988
+ /**
18989
+ * A `string` property that determines the zoom mode for this web contents.
18990
+ *
18991
+ * See `contents.setZoomMode` for a description of the available modes.
18992
+ */
18993
+ zoomMode: string;
18686
18994
  }
18687
18995
 
18688
18996
  class WebContentsView extends View {
@@ -18955,6 +19263,11 @@ declare namespace Electron {
18955
19263
  * @experimental
18956
19264
  */
18957
19265
  collectJavaScriptCallStack(): (Promise<string>) | (Promise<void>);
19266
+ /**
19267
+ * When executed on a video media element, copies the frame at (x, y) to the
19268
+ * clipboard.
19269
+ */
19270
+ copyVideoFrameAt(x: number, y: number): void;
18958
19271
  /**
18959
19272
  * A promise that resolves with the result of the executed code or is rejected if
18960
19273
  * execution throws or results in a rejected promise.
@@ -19002,6 +19315,11 @@ declare namespace Electron {
19002
19315
  * frame has no history.
19003
19316
  */
19004
19317
  reload(): boolean;
19318
+ /**
19319
+ * When executed on a video media element, shows a save dialog and saves the frame
19320
+ * at (x, y) to disk.
19321
+ */
19322
+ saveVideoFrameAs(x: number, y: number): void;
19005
19323
  /**
19006
19324
  * Send an asynchronous message to the renderer process via `channel`, along with
19007
19325
  * arguments. Arguments will be serialized with the Structured Clone Algorithm,
@@ -19389,6 +19707,11 @@ declare namespace Electron {
19389
19707
  * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
19390
19708
  */
19391
19709
  zoomFactor?: number;
19710
+ /**
19711
+ * The initial zoom mode for the page. See `contents.setZoomMode` for available
19712
+ * modes. Default is `'default'`.
19713
+ */
19714
+ zoomMode?: string;
19392
19715
  }
19393
19716
 
19394
19717
  class WebRequest {
@@ -20382,6 +20705,22 @@ declare namespace Electron {
20382
20705
  reasons: Array<'shutdown' | 'close-app' | 'critical' | 'logoff'>;
20383
20706
  }
20384
20707
 
20708
+ interface WindowStatePersistence {
20709
+
20710
+ // Docs: https://electronjs.org/docs/api/structures/window-state-persistence
20711
+
20712
+ /**
20713
+ * Whether to persist window position and size across application restarts.
20714
+ * Defaults to `true` if not specified.
20715
+ */
20716
+ bounds?: boolean;
20717
+ /**
20718
+ * Whether to persist display modes (fullscreen, kiosk, maximized, etc.) across
20719
+ * application restarts. Defaults to `true` if not specified.
20720
+ */
20721
+ displayMode?: boolean;
20722
+ }
20723
+
20385
20724
  interface AboutPanelOptionsOptions {
20386
20725
  /**
20387
20726
  * The app's name.
@@ -20582,6 +20921,12 @@ declare namespace Electron {
20582
20921
  * Defaults to 1.0.
20583
20922
  */
20584
20923
  scaleFactor?: number;
20924
+ /**
20925
+ * The target color space for the output pixel data. Defaults to sRGB. Pass the
20926
+ * image's original color space to preserve the previous behavior, or another color
20927
+ * space to get pixel values in that space.
20928
+ */
20929
+ colorSpace?: ColorSpace;
20585
20930
  }
20586
20931
 
20587
20932
  interface BlinkMemoryInfo {
@@ -20704,10 +21049,10 @@ declare namespace Electron {
20704
21049
  origin?: string;
20705
21050
  /**
20706
21051
  * The types of storages to clear, can be `cookies`, `filesystem`, `indexdb`,
20707
- * `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If
20708
- * not specified, clear all storage types.
21052
+ * `localstorage`, `shadercache`, `serviceworkers`, `cachestorage`. If not
21053
+ * specified, clear all storage types.
20709
21054
  */
20710
- storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers' | 'cachestorage'>;
21055
+ storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'serviceworkers' | 'cachestorage'>;
20711
21056
  }
20712
21057
 
20713
21058
  interface ClientCertRequestParams {
@@ -21219,18 +21564,20 @@ declare namespace Electron {
21219
21564
  uploadToServer?: boolean;
21220
21565
  /**
21221
21566
  * If true, crashes generated in the main process will not be forwarded to the
21222
- * system crash handler. Default is `false`.
21567
+ * system crash handler. This option has no effect on Windows. Default is `false`.
21568
+ *
21569
+ * @platform darwin,linux
21223
21570
  */
21224
21571
  ignoreSystemCrashHandler?: boolean;
21225
21572
  /**
21226
- * If true, limit the number of crashes uploaded to 1/hour. Default is `false`.
21227
- *
21228
- * @platform darwin,win32
21573
+ * If true, limit the number of crashes uploaded to 1/hour. Crash reports over the
21574
+ * limit are not uploaded, but are still stored on disk. Default is `false`.
21229
21575
  */
21230
21576
  rateLimit?: boolean;
21231
21577
  /**
21232
21578
  * If true, crash reports will be compressed and uploaded with `Content-Encoding:
21233
- * gzip`. Default is `true`.
21579
+ * gzip`. Setting this to `false` while `uploadToServer` is `true` is deprecated
21580
+ * and logs a deprecation warning. Default is `true`.
21234
21581
  */
21235
21582
  compress?: boolean;
21236
21583
  /**
@@ -21247,7 +21594,8 @@ declare namespace Electron {
21247
21594
  * crash reporter has been started. If a key is present in both the global extra
21248
21595
  * parameters and the process-specific extra parameters, then the global one will
21249
21596
  * take precedence. By default, `productName` and the app version are included, as
21250
- * well as the Electron version.
21597
+ * well as the Electron version. Global extra parameters are not returned by
21598
+ * `getParameters()`.
21251
21599
  */
21252
21600
  globalExtra?: Record<string, string>;
21253
21601
  }
@@ -21276,6 +21624,22 @@ declare namespace Electron {
21276
21624
  scaleFactor?: number;
21277
21625
  }
21278
21626
 
21627
+ interface CreateFromNamedImageOptions {
21628
+ hslShift?: number[];
21629
+ /**
21630
+ * Defaults to `30.0`.
21631
+ */
21632
+ pointSize?: number;
21633
+ /**
21634
+ * Defaults to `regular`.
21635
+ */
21636
+ weight?: ('ultralight') | ('thin') | ('light') | ('regular') | ('medium') | ('semibold') | ('bold') | ('heavy') | ('black');
21637
+ /**
21638
+ * Defaults to `medium`.
21639
+ */
21640
+ scale?: ('small') | ('medium') | ('large');
21641
+ }
21642
+
21279
21643
  interface CreateInterruptedDownloadOptions {
21280
21644
  /**
21281
21645
  * Absolute path of the download.
@@ -21308,17 +21672,6 @@ declare namespace Electron {
21308
21672
  startTime?: number;
21309
21673
  }
21310
21674
 
21311
- interface Data {
21312
- text?: string;
21313
- html?: string;
21314
- image?: NativeImage;
21315
- rtf?: string;
21316
- /**
21317
- * The title of the URL at `text`.
21318
- */
21319
- bookmark?: string;
21320
- }
21321
-
21322
21675
  interface DecryptStringAsyncReturnValue {
21323
21676
  /**
21324
21677
  * whether data that has just been returned from the decrypt operation should be
@@ -21375,9 +21728,17 @@ declare namespace Electron {
21375
21728
  reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure' | 'memory-eviction');
21376
21729
  /**
21377
21730
  * The exit code for the process (e.g. status from waitpid if on POSIX, from
21378
- * GetExitCodeProcess on Windows).
21731
+ * GetExitCodeProcess on Windows), unless `reason` is `launch-failed`, in which
21732
+ * case `exitCode` will be a platform-specific launch failure error code.
21379
21733
  */
21380
21734
  exitCode: number;
21735
+ /**
21736
+ * The Windows system error code (`GetLastError()`) of the failed launch. Only set
21737
+ * when `reason` is `launch-failed`.
21738
+ *
21739
+ * @platform win32
21740
+ */
21741
+ systemErrorCode?: number;
21381
21742
  /**
21382
21743
  * The non-localized name of the process.
21383
21744
  */
@@ -21762,9 +22123,11 @@ declare namespace Electron {
21762
22123
  * With this flag, all HTTP 401 and 407 network requests created via the net module
21763
22124
  * will allow responding to them via the `login` event on the `UtilityProcess`
21764
22125
  * instance when a `session` is provided, or via the `app#login` event in the main
21765
- * process when using the default system network context. Without this flag, auth
21766
- * challenges are handled by the default `login` event on the `ClientRequest`
21767
- * object. Default is `false`.
22126
+ * process when using the default system network context. This flag also routes
22127
+ * client-certificate selection to the `app#select-client-certificate` event in the
22128
+ * main process; without it, `net` requests from the utility process proceed
22129
+ * without a client certificate. Without this flag, auth challenges are handled by
22130
+ * the default `login` event on the `ClientRequest` object. Default is `false`.
21768
22131
  */
21769
22132
  respondToAuthRequestsFromMainProcess?: boolean;
21770
22133
  }
@@ -22083,39 +22446,12 @@ declare namespace Electron {
22083
22446
  * `true` if the app is set to open at login.
22084
22447
  */
22085
22448
  openAtLogin: boolean;
22086
- /**
22087
- * `true` if the app is set to open as hidden at login. This does not work on macOS
22088
- * 13 and up.
22089
- *
22090
- * @deprecated
22091
- * @platform darwin
22092
- */
22093
- openAsHidden: boolean;
22094
22449
  /**
22095
22450
  * `true` if the app was opened at login automatically.
22096
22451
  *
22097
22452
  * @platform darwin
22098
22453
  */
22099
22454
  wasOpenedAtLogin: boolean;
22100
- /**
22101
- * `true` if the app was opened as a hidden login item. This indicates that the app
22102
- * should not open any windows at startup. This setting is not available on MAS
22103
- * builds or on macOS 13 and up.
22104
- *
22105
- * @deprecated
22106
- * @platform darwin
22107
- */
22108
- wasOpenedAsHidden: boolean;
22109
- /**
22110
- * `true` if the app was opened as a login item that should restore the state from
22111
- * the previous session. This indicates that the app should restore the windows
22112
- * that were open the last time the app was closed. This setting is not available
22113
- * on MAS builds or on macOS 13 and up.
22114
- *
22115
- * @deprecated
22116
- * @platform darwin
22117
- */
22118
- restoreState: boolean;
22119
22455
  /**
22120
22456
  * can be `not-registered`, `enabled`, `requires-approval`, or `not-found`.
22121
22457
  *
@@ -22137,15 +22473,14 @@ declare namespace Electron {
22137
22473
  interface LoginItemSettingsOptions {
22138
22474
  /**
22139
22475
  * Can be `mainAppService`, `agentService`, `daemonService`, or `loginItemService`.
22140
- * Defaults to `mainAppService`. Only available on macOS 13 and up. See
22141
- * app.setLoginItemSettings for more information about each type.
22476
+ * Defaults to `mainAppService`. See app.setLoginItemSettings for more information
22477
+ * about each type.
22142
22478
  *
22143
22479
  * @platform darwin
22144
22480
  */
22145
22481
  type?: ('mainAppService' | 'agentService' | 'daemonService' | 'loginItemService');
22146
22482
  /**
22147
- * The name of the service. Required if `type` is non-default. Only available on
22148
- * macOS 13 and up.
22483
+ * The name of the service. Required if `type` is non-default.
22149
22484
  *
22150
22485
  * @platform darwin
22151
22486
  */
@@ -22186,6 +22521,7 @@ declare namespace Electron {
22186
22521
  role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleSpellChecker' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'showSubstitutions' | 'toggleSmartQuotes' | 'toggleSmartDashes' | 'toggleTextReplacement' | 'startSpeaking' | 'stopSpeaking' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'shareMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'showAllTabs' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
22187
22522
  type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio' | 'header' | 'palette');
22188
22523
  label?: string;
22524
+ accessibilityLabel?: string;
22189
22525
  /**
22190
22526
  * Available in macOS >= 14.4
22191
22527
  *
@@ -22270,6 +22606,14 @@ declare namespace Electron {
22270
22606
  * containing group after the containing group of the item with the specified id.
22271
22607
  */
22272
22608
  afterGroupContaining?: string[];
22609
+ /**
22610
+ * A badge shown alongside the label, either a system-styled count (`alerts`,
22611
+ * `updates`, `new-items`) or a custom string. Only available on macOS 14 and up.
22612
+ * Not displayed in Dock menus.
22613
+ *
22614
+ * @platform darwin
22615
+ */
22616
+ badge?: MenuItemBadge;
22273
22617
  }
22274
22618
 
22275
22619
  interface MessageBoxOptions {
@@ -22640,7 +22984,7 @@ declare namespace Electron {
22640
22984
  *
22641
22985
  * @experimental
22642
22986
  */
22643
- sharedTexturePixelFormat?: ('argb' | 'rgbaf16');
22987
+ sharedTexturePixelFormat?: ('argb' | 'rgbaf16' | 'nv12');
22644
22988
  /**
22645
22989
  * The device scale factor of the offscreen rendering output. If not set, will use
22646
22990
  * `1` as default.
@@ -22661,6 +23005,12 @@ declare namespace Electron {
22661
23005
  * or been destroyed.
22662
23006
  */
22663
23007
  frame?: (WebFrameMain) | (null);
23008
+ /**
23009
+ * The origin that issued the request (for example `https://example.com`, or `null`
23010
+ * for an opaque origin). Kept from the original request across redirects; absent
23011
+ * for requests the browser started itself.
23012
+ */
23013
+ initiatorOrigin?: string;
22664
23014
  /**
22665
23015
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22666
23016
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22690,6 +23040,12 @@ declare namespace Electron {
22690
23040
  * or been destroyed.
22691
23041
  */
22692
23042
  frame?: (WebFrameMain) | (null);
23043
+ /**
23044
+ * The origin that issued the request (for example `https://example.com`, or `null`
23045
+ * for an opaque origin). Kept from the original request across redirects; absent
23046
+ * for requests the browser started itself.
23047
+ */
23048
+ initiatorOrigin?: string;
22693
23049
  /**
22694
23050
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22695
23051
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22711,6 +23067,12 @@ declare namespace Electron {
22711
23067
  * or been destroyed.
22712
23068
  */
22713
23069
  frame?: (WebFrameMain) | (null);
23070
+ /**
23071
+ * The origin that issued the request (for example `https://example.com`, or `null`
23072
+ * for an opaque origin). Kept from the original request across redirects; absent
23073
+ * for requests the browser started itself.
23074
+ */
23075
+ initiatorOrigin?: string;
22714
23076
  /**
22715
23077
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22716
23078
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22733,6 +23095,12 @@ declare namespace Electron {
22733
23095
  * or been destroyed.
22734
23096
  */
22735
23097
  frame?: (WebFrameMain) | (null);
23098
+ /**
23099
+ * The origin that issued the request (for example `https://example.com`, or `null`
23100
+ * for an opaque origin). Kept from the original request across redirects; absent
23101
+ * for requests the browser started itself.
23102
+ */
23103
+ initiatorOrigin?: string;
22736
23104
  /**
22737
23105
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22738
23106
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22758,6 +23126,12 @@ declare namespace Electron {
22758
23126
  * or been destroyed.
22759
23127
  */
22760
23128
  frame?: (WebFrameMain) | (null);
23129
+ /**
23130
+ * The origin that issued the request (for example `https://example.com`, or `null`
23131
+ * for an opaque origin). Kept from the original request across redirects; absent
23132
+ * for requests the browser started itself.
23133
+ */
23134
+ initiatorOrigin?: string;
22761
23135
  /**
22762
23136
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22763
23137
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22783,6 +23157,12 @@ declare namespace Electron {
22783
23157
  * or been destroyed.
22784
23158
  */
22785
23159
  frame?: (WebFrameMain) | (null);
23160
+ /**
23161
+ * The origin that issued the request (for example `https://example.com`, or `null`
23162
+ * for an opaque origin). Kept from the original request across redirects; absent
23163
+ * for requests the browser started itself.
23164
+ */
23165
+ initiatorOrigin?: string;
22786
23166
  /**
22787
23167
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22788
23168
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22806,6 +23186,12 @@ declare namespace Electron {
22806
23186
  * or been destroyed.
22807
23187
  */
22808
23188
  frame?: (WebFrameMain) | (null);
23189
+ /**
23190
+ * The origin that issued the request (for example `https://example.com`, or `null`
23191
+ * for an opaque origin). Kept from the original request across redirects; absent
23192
+ * for requests the browser started itself.
23193
+ */
23194
+ initiatorOrigin?: string;
22809
23195
  /**
22810
23196
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22811
23197
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22833,6 +23219,12 @@ declare namespace Electron {
22833
23219
  * or been destroyed.
22834
23220
  */
22835
23221
  frame?: (WebFrameMain) | (null);
23222
+ /**
23223
+ * The origin that issued the request (for example `https://example.com`, or `null`
23224
+ * for an opaque origin). Kept from the original request across redirects; absent
23225
+ * for requests the browser started itself.
23226
+ */
23227
+ initiatorOrigin?: string;
22836
23228
  /**
22837
23229
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22838
23230
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22863,6 +23255,11 @@ declare namespace Electron {
22863
23255
 
22864
23256
  interface OpenDialogOptions {
22865
23257
  title?: string;
23258
+ /**
23259
+ * Absolute directory path, absolute file path, or file name to use by default. If
23260
+ * not provided, the dialog will default to the user's Downloads folder, or their
23261
+ * home directory if Downloads doesn't exist.
23262
+ */
22866
23263
  defaultPath?: string;
22867
23264
  /**
22868
23265
  * Custom label for the confirmation button, when left empty the default label will
@@ -22911,6 +23308,11 @@ declare namespace Electron {
22911
23308
 
22912
23309
  interface OpenDialogSyncOptions {
22913
23310
  title?: string;
23311
+ /**
23312
+ * Absolute directory path, absolute file path, or file name to use by default. If
23313
+ * not provided, the dialog will default to the user's Downloads folder, or their
23314
+ * home directory if Downloads doesn't exist.
23315
+ */
22914
23316
  defaultPath?: string;
22915
23317
  /**
22916
23318
  * Custom label for the confirmation button, when left empty the default label will
@@ -23210,11 +23612,6 @@ declare namespace Electron {
23210
23612
  username?: string;
23211
23613
  }
23212
23614
 
23213
- interface ReadBookmark {
23214
- title: string;
23215
- url: string;
23216
- }
23217
-
23218
23615
  interface ReceivedSharedTextureData {
23219
23616
  /**
23220
23617
  * The imported shared texture.
@@ -23365,7 +23762,9 @@ declare namespace Electron {
23365
23762
  */
23366
23763
  title?: string;
23367
23764
  /**
23368
- * Absolute directory path, absolute file path, or file name to use by default.
23765
+ * Absolute directory path, absolute file path, or file name to use by default. If
23766
+ * not provided, the dialog will default to the user's Downloads folder, or their
23767
+ * home directory if Downloads doesn't exist.
23369
23768
  */
23370
23769
  defaultPath?: string;
23371
23770
  /**
@@ -23428,7 +23827,9 @@ declare namespace Electron {
23428
23827
  */
23429
23828
  title?: string;
23430
23829
  /**
23431
- * Absolute directory path, absolute file path, or file name to use by default.
23830
+ * Absolute directory path, absolute file path, or file name to use by default. If
23831
+ * not provided, the dialog will default to the user's Downloads folder, or their
23832
+ * home directory if Downloads doesn't exist.
23432
23833
  */
23433
23834
  defaultPath?: string;
23434
23835
  /**
@@ -23543,26 +23944,13 @@ declare namespace Electron {
23543
23944
  */
23544
23945
  openAtLogin?: boolean;
23545
23946
  /**
23546
- * `true` to open the app as hidden. Defaults to `false`. The user can edit this
23547
- * setting from the System Preferences so
23548
- * `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is
23549
- * opened to know the current value. This setting is not available on MAS builds or
23550
- * on macOS 13 and up.
23551
- *
23552
- * @deprecated
23553
- * @platform darwin
23554
- */
23555
- openAsHidden?: boolean;
23556
- /**
23557
- * The type of service to add as a login item. Defaults to `mainAppService`. Only
23558
- * available on macOS 13 and up.
23947
+ * The type of service to add as a login item. Defaults to `mainAppService`.
23559
23948
  *
23560
23949
  * @platform darwin
23561
23950
  */
23562
23951
  type?: ('mainAppService' | 'agentService' | 'daemonService' | 'loginItemService');
23563
23952
  /**
23564
- * The name of the service. Required if `type` is non-default. Only available on
23565
- * macOS 13 and up.
23953
+ * The name of the service. Required if `type` is non-default.
23566
23954
  *
23567
23955
  * @platform darwin
23568
23956
  */
@@ -23811,6 +24199,12 @@ declare namespace Electron {
23811
24199
  * Defaults to 1.0.
23812
24200
  */
23813
24201
  scaleFactor?: number;
24202
+ /**
24203
+ * The target color space for the output pixel data. Defaults to sRGB. Pass the
24204
+ * image's original color space to preserve the previous behavior, or another color
24205
+ * space to get pixel values in that space.
24206
+ */
24207
+ colorSpace?: ColorSpace;
23814
24208
  }
23815
24209
 
23816
24210
  interface ToDataURLOptions {
@@ -24147,10 +24541,11 @@ declare namespace Electron {
24147
24541
  */
24148
24542
  frame: (WebFrameMain) | (null);
24149
24543
  /**
24150
- * The frame which initiated the navigation, which can be a parent frame (e.g. via
24151
- * `window.open` with a frame's name), or null if the navigation was not initiated
24152
- * by a frame. This can also be null if the initiating frame was deleted before the
24153
- * event was emitted.
24544
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
24545
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
24546
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
24547
+ * not initiated by a frame. This can also be null if the initiating frame was
24548
+ * deleted before the event was emitted.
24154
24549
  */
24155
24550
  initiator?: (WebFrameMain) | (null);
24156
24551
  }
@@ -24176,10 +24571,11 @@ declare namespace Electron {
24176
24571
  */
24177
24572
  frame: (WebFrameMain) | (null);
24178
24573
  /**
24179
- * The frame which initiated the navigation, which can be a parent frame (e.g. via
24180
- * `window.open` with a frame's name), or null if the navigation was not initiated
24181
- * by a frame. This can also be null if the initiating frame was deleted before the
24182
- * event was emitted.
24574
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
24575
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
24576
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
24577
+ * not initiated by a frame. This can also be null if the initiating frame was
24578
+ * deleted before the event was emitted.
24183
24579
  */
24184
24580
  initiator?: (WebFrameMain) | (null);
24185
24581
  }
@@ -24301,10 +24697,11 @@ declare namespace Electron {
24301
24697
  */
24302
24698
  frame: (WebFrameMain) | (null);
24303
24699
  /**
24304
- * The frame which initiated the navigation, which can be a parent frame (e.g. via
24305
- * `window.open` with a frame's name), or null if the navigation was not initiated
24306
- * by a frame. This can also be null if the initiating frame was deleted before the
24307
- * event was emitted.
24700
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
24701
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
24702
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
24703
+ * not initiated by a frame. This can also be null if the initiating frame was
24704
+ * deleted before the event was emitted.
24308
24705
  */
24309
24706
  initiator?: (WebFrameMain) | (null);
24310
24707
  }
@@ -24330,10 +24727,11 @@ declare namespace Electron {
24330
24727
  */
24331
24728
  frame: (WebFrameMain) | (null);
24332
24729
  /**
24333
- * The frame which initiated the navigation, which can be a parent frame (e.g. via
24334
- * `window.open` with a frame's name), or null if the navigation was not initiated
24335
- * by a frame. This can also be null if the initiating frame was deleted before the
24336
- * event was emitted.
24730
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
24731
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
24732
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
24733
+ * not initiated by a frame. This can also be null if the initiating frame was
24734
+ * deleted before the event was emitted.
24337
24735
  */
24338
24736
  initiator?: (WebFrameMain) | (null);
24339
24737
  }
@@ -24359,10 +24757,11 @@ declare namespace Electron {
24359
24757
  */
24360
24758
  frame: (WebFrameMain) | (null);
24361
24759
  /**
24362
- * The frame which initiated the navigation, which can be a parent frame (e.g. via
24363
- * `window.open` with a frame's name), or null if the navigation was not initiated
24364
- * by a frame. This can also be null if the initiating frame was deleted before the
24365
- * event was emitted.
24760
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
24761
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
24762
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
24763
+ * not initiated by a frame. This can also be null if the initiating frame was
24764
+ * deleted before the event was emitted.
24366
24765
  */
24367
24766
  initiator?: (WebFrameMain) | (null);
24368
24767
  }
@@ -24935,8 +25334,6 @@ declare namespace Electron {
24935
25334
 
24936
25335
  namespace Common {
24937
25336
  type Event<Params extends object = {}> = Electron.Event<Params>;
24938
- const clipboard: Clipboard;
24939
- type Clipboard = Electron.Clipboard;
24940
25337
  const crashReporter: CrashReporter;
24941
25338
  type CrashReporter = Electron.CrashReporter;
24942
25339
  const nativeImage: typeof NativeImage;
@@ -24984,8 +25381,8 @@ declare namespace Electron {
24984
25381
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
24985
25382
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
24986
25383
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
25384
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
24987
25385
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
24988
- type Data = Electron.Data;
24989
25386
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
24990
25387
  type DefaultFontFamily = Electron.DefaultFontFamily;
24991
25388
  type Details = Electron.Details;
@@ -25079,7 +25476,6 @@ declare namespace Electron {
25079
25476
  type ProgressBarOptions = Electron.ProgressBarOptions;
25080
25477
  type Provider = Electron.Provider;
25081
25478
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
25082
- type ReadBookmark = Electron.ReadBookmark;
25083
25479
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
25084
25480
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
25085
25481
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -25174,6 +25570,7 @@ declare namespace Electron {
25174
25570
  type BluetoothDevice = Electron.BluetoothDevice;
25175
25571
  type Certificate = Electron.Certificate;
25176
25572
  type CertificatePrincipal = Electron.CertificatePrincipal;
25573
+ type ClipboardBookmark = Electron.ClipboardBookmark;
25177
25574
  type ColorSpace = Electron.ColorSpace;
25178
25575
  type Cookie = Electron.Cookie;
25179
25576
  type CPUUsage = Electron.CPUUsage;
@@ -25202,6 +25599,7 @@ declare namespace Electron {
25202
25599
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
25203
25600
  type MemoryInfo = Electron.MemoryInfo;
25204
25601
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
25602
+ type MenuItemBadge = Electron.MenuItemBadge;
25205
25603
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
25206
25604
  type MouseInputEvent = Electron.MouseInputEvent;
25207
25605
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -25267,6 +25665,7 @@ declare namespace Electron {
25267
25665
  type WebSource = Electron.WebSource;
25268
25666
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
25269
25667
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
25668
+ type WindowStatePersistence = Electron.WindowStatePersistence;
25270
25669
  }
25271
25670
 
25272
25671
  namespace Main {
@@ -25279,6 +25678,9 @@ declare namespace Electron {
25279
25678
  class BrowserView extends Electron.BrowserView {}
25280
25679
  class BrowserWindow extends Electron.BrowserWindow {}
25281
25680
  type ClientRequest = Electron.ClientRequest;
25681
+ const clipboard: Clipboard;
25682
+ type Clipboard = Electron.Clipboard;
25683
+ class ClipboardItem extends Electron.ClipboardItem {}
25282
25684
  type CommandLine = Electron.CommandLine;
25283
25685
  const contentTracing: ContentTracing;
25284
25686
  type ContentTracing = Electron.ContentTracing;
@@ -25392,8 +25794,8 @@ declare namespace Electron {
25392
25794
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
25393
25795
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
25394
25796
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
25797
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
25395
25798
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
25396
- type Data = Electron.Data;
25397
25799
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
25398
25800
  type DefaultFontFamily = Electron.DefaultFontFamily;
25399
25801
  type Details = Electron.Details;
@@ -25487,7 +25889,6 @@ declare namespace Electron {
25487
25889
  type ProgressBarOptions = Electron.ProgressBarOptions;
25488
25890
  type Provider = Electron.Provider;
25489
25891
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
25490
- type ReadBookmark = Electron.ReadBookmark;
25491
25892
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
25492
25893
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
25493
25894
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -25582,6 +25983,7 @@ declare namespace Electron {
25582
25983
  type BluetoothDevice = Electron.BluetoothDevice;
25583
25984
  type Certificate = Electron.Certificate;
25584
25985
  type CertificatePrincipal = Electron.CertificatePrincipal;
25986
+ type ClipboardBookmark = Electron.ClipboardBookmark;
25585
25987
  type ColorSpace = Electron.ColorSpace;
25586
25988
  type Cookie = Electron.Cookie;
25587
25989
  type CPUUsage = Electron.CPUUsage;
@@ -25610,6 +26012,7 @@ declare namespace Electron {
25610
26012
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
25611
26013
  type MemoryInfo = Electron.MemoryInfo;
25612
26014
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
26015
+ type MenuItemBadge = Electron.MenuItemBadge;
25613
26016
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
25614
26017
  type MouseInputEvent = Electron.MouseInputEvent;
25615
26018
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -25675,6 +26078,7 @@ declare namespace Electron {
25675
26078
  type WebSource = Electron.WebSource;
25676
26079
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
25677
26080
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26081
+ type WindowStatePersistence = Electron.WindowStatePersistence;
25678
26082
  }
25679
26083
 
25680
26084
  namespace Renderer {
@@ -25727,8 +26131,8 @@ declare namespace Electron {
25727
26131
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
25728
26132
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
25729
26133
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
26134
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
25730
26135
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
25731
- type Data = Electron.Data;
25732
26136
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
25733
26137
  type DefaultFontFamily = Electron.DefaultFontFamily;
25734
26138
  type Details = Electron.Details;
@@ -25822,7 +26226,6 @@ declare namespace Electron {
25822
26226
  type ProgressBarOptions = Electron.ProgressBarOptions;
25823
26227
  type Provider = Electron.Provider;
25824
26228
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
25825
- type ReadBookmark = Electron.ReadBookmark;
25826
26229
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
25827
26230
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
25828
26231
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -25917,6 +26320,7 @@ declare namespace Electron {
25917
26320
  type BluetoothDevice = Electron.BluetoothDevice;
25918
26321
  type Certificate = Electron.Certificate;
25919
26322
  type CertificatePrincipal = Electron.CertificatePrincipal;
26323
+ type ClipboardBookmark = Electron.ClipboardBookmark;
25920
26324
  type ColorSpace = Electron.ColorSpace;
25921
26325
  type Cookie = Electron.Cookie;
25922
26326
  type CPUUsage = Electron.CPUUsage;
@@ -25945,6 +26349,7 @@ declare namespace Electron {
25945
26349
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
25946
26350
  type MemoryInfo = Electron.MemoryInfo;
25947
26351
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
26352
+ type MenuItemBadge = Electron.MenuItemBadge;
25948
26353
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
25949
26354
  type MouseInputEvent = Electron.MouseInputEvent;
25950
26355
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -26010,6 +26415,7 @@ declare namespace Electron {
26010
26415
  type WebSource = Electron.WebSource;
26011
26416
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26012
26417
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26418
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26013
26419
  }
26014
26420
 
26015
26421
  namespace Utility {
@@ -26061,8 +26467,8 @@ declare namespace Electron {
26061
26467
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
26062
26468
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
26063
26469
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
26470
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
26064
26471
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
26065
- type Data = Electron.Data;
26066
26472
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
26067
26473
  type DefaultFontFamily = Electron.DefaultFontFamily;
26068
26474
  type Details = Electron.Details;
@@ -26156,7 +26562,6 @@ declare namespace Electron {
26156
26562
  type ProgressBarOptions = Electron.ProgressBarOptions;
26157
26563
  type Provider = Electron.Provider;
26158
26564
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
26159
- type ReadBookmark = Electron.ReadBookmark;
26160
26565
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
26161
26566
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
26162
26567
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -26251,6 +26656,7 @@ declare namespace Electron {
26251
26656
  type BluetoothDevice = Electron.BluetoothDevice;
26252
26657
  type Certificate = Electron.Certificate;
26253
26658
  type CertificatePrincipal = Electron.CertificatePrincipal;
26659
+ type ClipboardBookmark = Electron.ClipboardBookmark;
26254
26660
  type ColorSpace = Electron.ColorSpace;
26255
26661
  type Cookie = Electron.Cookie;
26256
26662
  type CPUUsage = Electron.CPUUsage;
@@ -26279,6 +26685,7 @@ declare namespace Electron {
26279
26685
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
26280
26686
  type MemoryInfo = Electron.MemoryInfo;
26281
26687
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
26688
+ type MenuItemBadge = Electron.MenuItemBadge;
26282
26689
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
26283
26690
  type MouseInputEvent = Electron.MouseInputEvent;
26284
26691
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -26344,6 +26751,7 @@ declare namespace Electron {
26344
26751
  type WebSource = Electron.WebSource;
26345
26752
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26346
26753
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26754
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26347
26755
  }
26348
26756
 
26349
26757
  namespace CrossProcessExports {
@@ -26358,6 +26766,7 @@ declare namespace Electron {
26358
26766
  type ClientRequest = Electron.ClientRequest;
26359
26767
  const clipboard: Clipboard;
26360
26768
  type Clipboard = Electron.Clipboard;
26769
+ class ClipboardItem extends Electron.ClipboardItem {}
26361
26770
  type CommandLine = Electron.CommandLine;
26362
26771
  const contentTracing: ContentTracing;
26363
26772
  type ContentTracing = Electron.ContentTracing;
@@ -26490,8 +26899,8 @@ declare namespace Electron {
26490
26899
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
26491
26900
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
26492
26901
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
26902
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
26493
26903
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
26494
- type Data = Electron.Data;
26495
26904
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
26496
26905
  type DefaultFontFamily = Electron.DefaultFontFamily;
26497
26906
  type Details = Electron.Details;
@@ -26585,7 +26994,6 @@ declare namespace Electron {
26585
26994
  type ProgressBarOptions = Electron.ProgressBarOptions;
26586
26995
  type Provider = Electron.Provider;
26587
26996
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
26588
- type ReadBookmark = Electron.ReadBookmark;
26589
26997
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
26590
26998
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
26591
26999
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -26680,6 +27088,7 @@ declare namespace Electron {
26680
27088
  type BluetoothDevice = Electron.BluetoothDevice;
26681
27089
  type Certificate = Electron.Certificate;
26682
27090
  type CertificatePrincipal = Electron.CertificatePrincipal;
27091
+ type ClipboardBookmark = Electron.ClipboardBookmark;
26683
27092
  type ColorSpace = Electron.ColorSpace;
26684
27093
  type Cookie = Electron.Cookie;
26685
27094
  type CPUUsage = Electron.CPUUsage;
@@ -26708,6 +27117,7 @@ declare namespace Electron {
26708
27117
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
26709
27118
  type MemoryInfo = Electron.MemoryInfo;
26710
27119
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
27120
+ type MenuItemBadge = Electron.MenuItemBadge;
26711
27121
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
26712
27122
  type MouseInputEvent = Electron.MouseInputEvent;
26713
27123
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -26773,6 +27183,7 @@ declare namespace Electron {
26773
27183
  type WebSource = Electron.WebSource;
26774
27184
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26775
27185
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
27186
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26776
27187
  }
26777
27188
 
26778
27189
  const app: App;
@@ -26893,6 +27304,14 @@ declare namespace NodeJS {
26893
27304
  * Kilobytes.
26894
27305
  */
26895
27306
  getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
27307
+ /**
27308
+ * CPU usage of the process this is called in.
27309
+ *
27310
+ * > [!NOTE] `percentCPUUsage` and `idleWakeupsPerSecond` are averages over the
27311
+ * time since the previous call to `process.getCPUUsage()` in this process, and
27312
+ * each call starts a new measurement interval. Every caller in the process shares
27313
+ * that interval. See `CPUUsage` for details.
27314
+ */
26896
27315
  getCPUUsage(): Electron.CPUUsage;
26897
27316
  /**
26898
27317
  * The number of milliseconds since epoch, or `null` if the information is