@overwolf/ow-electron 42.11.15 → 44.9.0-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.15
1
+ // Type definitions for Electron 44.9.0
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
  /**
@@ -187,6 +187,96 @@ declare namespace Electron {
187
187
  * Contains app-specific state stored by the activity.
188
188
  */
189
189
  userInfo: unknown) => void): this;
190
+ /**
191
+ * Emitted when an app shim connects to your app. Shims can only connect after
192
+ * `app.startAppShimServer()` has been called.
193
+ *
194
+ * Any process running as the same user can connect. Verify the shim before
195
+ * creating windows in it, for example with `shim.satisfiesCodeRequirement()`, and
196
+ * call `shim.quit()` to reject a shim that you do not trust.
197
+ *
198
+ * @experimental
199
+ * @platform darwin
200
+ */
201
+ on(event: 'app-shim-connected', listener: (event: Event,
202
+ shim: AppShimHost) => void): this;
203
+ /**
204
+ * @experimental
205
+ * @platform darwin
206
+ */
207
+ off(event: 'app-shim-connected', listener: (event: Event,
208
+ shim: AppShimHost) => void): this;
209
+ /**
210
+ * @experimental
211
+ * @platform darwin
212
+ */
213
+ once(event: 'app-shim-connected', listener: (event: Event,
214
+ shim: AppShimHost) => void): this;
215
+ /**
216
+ * @experimental
217
+ * @platform darwin
218
+ */
219
+ addListener(event: 'app-shim-connected', listener: (event: Event,
220
+ shim: AppShimHost) => void): this;
221
+ /**
222
+ * @experimental
223
+ * @platform darwin
224
+ */
225
+ removeListener(event: 'app-shim-connected', listener: (event: Event,
226
+ shim: AppShimHost) => void): this;
227
+ /**
228
+ * Emitted when an app shim was launched but could not connect because your app's
229
+ * bundle has been replaced by a different version since your app started. A shim
230
+ * loads the version of Electron that is on disk, which cannot communicate with the
231
+ * version that is still running.
232
+ *
233
+ * The shim quits without showing any UI, so use this event to tell the user what
234
+ * happened. Shims can connect again after your app restarts.
235
+ *
236
+ * @experimental
237
+ * @platform darwin
238
+ */
239
+ on(event: 'app-shim-version-mismatch', listener: (event: Event,
240
+ /**
241
+ * The path of the app shim's bundle.
242
+ */
243
+ bundlePath: string) => void): this;
244
+ /**
245
+ * @experimental
246
+ * @platform darwin
247
+ */
248
+ off(event: 'app-shim-version-mismatch', listener: (event: Event,
249
+ /**
250
+ * The path of the app shim's bundle.
251
+ */
252
+ bundlePath: string) => void): this;
253
+ /**
254
+ * @experimental
255
+ * @platform darwin
256
+ */
257
+ once(event: 'app-shim-version-mismatch', listener: (event: Event,
258
+ /**
259
+ * The path of the app shim's bundle.
260
+ */
261
+ bundlePath: string) => void): this;
262
+ /**
263
+ * @experimental
264
+ * @platform darwin
265
+ */
266
+ addListener(event: 'app-shim-version-mismatch', listener: (event: Event,
267
+ /**
268
+ * The path of the app shim's bundle.
269
+ */
270
+ bundlePath: string) => void): this;
271
+ /**
272
+ * @experimental
273
+ * @platform darwin
274
+ */
275
+ removeListener(event: 'app-shim-version-mismatch', listener: (event: Event,
276
+ /**
277
+ * The path of the app shim's bundle.
278
+ */
279
+ bundlePath: string) => void): this;
190
280
  /**
191
281
  * Emitted before the application starts closing its windows. Calling
192
282
  * `event.preventDefault()` will prevent the default behavior, which is terminating
@@ -300,7 +390,8 @@ declare namespace Electron {
300
390
  isMainFrame: boolean) => void): this;
301
391
  /**
302
392
  * Emitted when the child process unexpectedly disappears. This is normally because
303
- * it was crashed or killed. It does not include renderer processes.
393
+ * it was crashed or killed, or because it failed to launch. It does not include
394
+ * renderer processes.
304
395
  */
305
396
  on(event: 'child-process-gone', listener: (event: Event,
306
397
  details: Details) => void): this;
@@ -518,27 +609,27 @@ declare namespace Electron {
518
609
  * page.
519
610
  */
520
611
  on(event: 'login', listener: (event: Event,
521
- webContents: WebContents,
612
+ webContents: (WebContents) | (null),
522
613
  authenticationResponseDetails: AuthenticationResponseDetails,
523
614
  authInfo: AuthInfo,
524
615
  callback: (username?: string, password?: string) => void) => void): this;
525
616
  off(event: 'login', listener: (event: Event,
526
- webContents: WebContents,
617
+ webContents: (WebContents) | (null),
527
618
  authenticationResponseDetails: AuthenticationResponseDetails,
528
619
  authInfo: AuthInfo,
529
620
  callback: (username?: string, password?: string) => void) => void): this;
530
621
  once(event: 'login', listener: (event: Event,
531
- webContents: WebContents,
622
+ webContents: (WebContents) | (null),
532
623
  authenticationResponseDetails: AuthenticationResponseDetails,
533
624
  authInfo: AuthInfo,
534
625
  callback: (username?: string, password?: string) => void) => void): this;
535
626
  addListener(event: 'login', listener: (event: Event,
536
- webContents: WebContents,
627
+ webContents: (WebContents) | (null),
537
628
  authenticationResponseDetails: AuthenticationResponseDetails,
538
629
  authInfo: AuthInfo,
539
630
  callback: (username?: string, password?: string) => void) => void): this;
540
631
  removeListener(event: 'login', listener: (event: Event,
541
- webContents: WebContents,
632
+ webContents: (WebContents) | (null),
542
633
  authenticationResponseDetails: AuthenticationResponseDetails,
543
634
  authInfo: AuthInfo,
544
635
  callback: (username?: string, password?: string) => void) => void): this;
@@ -806,29 +897,36 @@ declare namespace Electron {
806
897
  * and `callback` can be called with an entry filtered from the list. Using
807
898
  * `event.preventDefault()` prevents the application from using the first
808
899
  * certificate from the store.
900
+ *
901
+ * `webContents` is `null` when the request does not originate from a renderer
902
+ * process, for example when using `net.request` or `net.fetch` in the main
903
+ * process, or from a utility process created with
904
+ * `respondToAuthRequestsFromMainProcess: true`. For utility processes created
905
+ * without that flag, `net` requests proceed without a client certificate and this
906
+ * event is not emitted.
809
907
  */
810
908
  on(event: 'select-client-certificate', listener: (event: Event,
811
- webContents: WebContents,
909
+ webContents: (WebContents) | (null),
812
910
  url: string,
813
911
  certificateList: Certificate[],
814
912
  callback: (certificate?: Certificate) => void) => void): this;
815
913
  off(event: 'select-client-certificate', listener: (event: Event,
816
- webContents: WebContents,
914
+ webContents: (WebContents) | (null),
817
915
  url: string,
818
916
  certificateList: Certificate[],
819
917
  callback: (certificate?: Certificate) => void) => void): this;
820
918
  once(event: 'select-client-certificate', listener: (event: Event,
821
- webContents: WebContents,
919
+ webContents: (WebContents) | (null),
822
920
  url: string,
823
921
  certificateList: Certificate[],
824
922
  callback: (certificate?: Certificate) => void) => void): this;
825
923
  addListener(event: 'select-client-certificate', listener: (event: Event,
826
- webContents: WebContents,
924
+ webContents: (WebContents) | (null),
827
925
  url: string,
828
926
  certificateList: Certificate[],
829
927
  callback: (certificate?: Certificate) => void) => void): this;
830
928
  removeListener(event: 'select-client-certificate', listener: (event: Event,
831
- webContents: WebContents,
929
+ webContents: (WebContents) | (null),
832
930
  url: string,
833
931
  certificateList: Certificate[],
834
932
  callback: (certificate?: Certificate) => void) => void): this;
@@ -1149,6 +1247,12 @@ declare namespace Electron {
1149
1247
  /**
1150
1248
  * Array of `ProcessMetric` objects that correspond to memory and CPU usage
1151
1249
  * statistics of all the processes associated with the app.
1250
+ *
1251
+ * > [!NOTE] `cpu.percentCPUUsage` and `cpu.idleWakeupsPerSecond` are averages over
1252
+ * the time since the last call to `app.getAppMetrics()`, and each call starts a
1253
+ * new measurement interval for every process at once. Other code in the main
1254
+ * process, including dependencies, shares those intervals. See `CPUUsage` for more
1255
+ * details.
1152
1256
  */
1153
1257
  getAppMetrics(): ProcessMetric[];
1154
1258
  /**
@@ -1158,7 +1262,7 @@ declare namespace Electron {
1158
1262
  /**
1159
1263
  * The current value displayed in the counter badge.
1160
1264
  *
1161
- * @platform linux,darwin
1265
+ * @platform darwin
1162
1266
  */
1163
1267
  getBadgeCount(): number;
1164
1268
  /**
@@ -1245,19 +1349,8 @@ declare namespace Electron {
1245
1349
  *
1246
1350
  *
1247
1351
  * * `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
1352
  * * `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
1251
1353
  * 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
1354
  * * `status` string _macOS_ - can be `not-registered`, `enabled`,
1262
1355
  * `requires-approval`, or `not-found`.
1263
1356
  * * `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open
@@ -1396,9 +1489,9 @@ declare namespace Electron {
1396
1489
  */
1397
1490
  invalidateCurrentActivity(): void;
1398
1491
  /**
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
1492
+ * `true` if Chromium's accessibility support is enabled, `false` otherwise. This
1493
+ * API will return `true` if the use of assistive technologies, such as screen
1494
+ * readers, has been detected. See
1402
1495
  * https://www.chromium.org/developers/design-documents/accessibility for more
1403
1496
  * details.
1404
1497
  *
@@ -1462,12 +1555,6 @@ declare namespace Electron {
1462
1555
  * @platform darwin
1463
1556
  */
1464
1557
  isSecureKeyboardEntryEnabled(): boolean;
1465
- /**
1466
- * Whether the current desktop environment is Unity launcher.
1467
- *
1468
- * @platform linux
1469
- */
1470
- isUnityRunning(): boolean;
1471
1558
  /**
1472
1559
  * Whether the move was successful. Please note that if the move is successful,
1473
1560
  * your application will quit and relaunch.
@@ -1594,7 +1681,7 @@ declare namespace Electron {
1594
1681
  */
1595
1682
  setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
1596
1683
  /**
1597
- * Manually enables Chrome's accessibility support, allowing to expose
1684
+ * Manually enables Chromium's accessibility support, allowing to expose
1598
1685
  * accessibility switch to users in application settings. See Chromium's
1599
1686
  * accessibility docs for more details. Disabled by default.
1600
1687
  *
@@ -1689,10 +1776,12 @@ declare namespace Electron {
1689
1776
  * Sets the counter badge for current app. Setting the count to `0` will hide the
1690
1777
  * badge.
1691
1778
  *
1692
- * On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
1779
+ * On macOS, it shows on the Dock icon. On Linux, it shows on docks and taskbars
1780
+ * that support the LauncherEntry D-Bus API,
1693
1781
  *
1694
- * > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
1695
- * information, please read the Unity integration documentation.
1782
+ * > [!NOTE] On Linux, the badge is associated with the app's `.desktop` file, so
1783
+ * `app.setDesktopName` (or the `desktopName` field in `package.json`) must match
1784
+ * the name of the app's actual `.desktop` file.
1696
1785
  *
1697
1786
  * > [!NOTE] On macOS, you need to ensure that your application has the permission
1698
1787
  * to display notifications for this method to work.
@@ -1706,14 +1795,31 @@ declare namespace Electron {
1706
1795
  */
1707
1796
  setClientCertRequestPasswordHandler(handler: (clientCertRequestParams: ClientCertRequestParams) => Promise<string>): void;
1708
1797
  /**
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.
1798
+ * Sets the `.desktop` filename on Linux. This must match the base filename of the
1799
+ * app's installed `.desktop` file. The `.desktop` suffix is optional.
1800
+ *
1801
+ * The name (without the `.desktop` suffix) is the app's identity for Linux desktop
1802
+ * integration. It should be a reverse-DNS style ID such as `com.example.MyApp`,
1803
+ * following the desktop entry naming conventions. This value is used as:
1711
1804
  *
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.
1805
+ * * the XDG application ID (`app_id`) on Wayland and `WM_CLASS` on X11, used to
1806
+ * match the app's icon and window grouping.
1807
+ * * the app ID that `xdg-desktop-portal` reports to portal backends such as
1808
+ * GlobalShortcuts.
1809
+ *
1810
+ * Portals increasingly enforce this identity. If the name is not a valid
1811
+ * reverse-DNS ID or does not match an installed `.desktop` file:
1812
+ *
1813
+ * * GNOME 50.0/50.1 (Ubuntu 26.04) rejects `globalShortcut` binds with
1814
+ * `org.freedesktop.portal.Error.NotAllowed` — with no error surfaced to the app
1815
+ * (see #52218).
1816
+ * * `xdg-desktop-portal` 1.21 and later refuses portal sessions for app IDs it
1817
+ * cannot resolve to a `.desktop` file.
1818
+ *
1819
+ * If this value is not set and `desktopName` is not present in `package.json`,
1820
+ * Electron falls back to a lowercased, hyphenated slug of the app's name (e.g. `My
1821
+ * App` → `my-app.desktop`), which is unlikely to be a valid portal identity —
1822
+ * packaged apps should always set it explicitly.
1717
1823
  *
1718
1824
  * This API must be called before the `ready` event. The value can also be set
1719
1825
  * using `desktopName` in `package.json`.
@@ -1768,8 +1874,8 @@ declare namespace Electron {
1768
1874
  * is a stub application automatically generated by Squirrel which will
1769
1875
  * automatically launch the latest version.
1770
1876
  *
1771
- * For more information about setting different services as login items on macOS 13
1772
- * and up, see `SMAppService`.
1877
+ * For more information about setting different services as login items on macOS,
1878
+ * see `SMAppService`.
1773
1879
  *
1774
1880
  * @platform darwin,win32
1775
1881
  */
@@ -1881,7 +1987,7 @@ declare namespace Electron {
1881
1987
  * resources will be leaked and your app will lose its ability to reach outside the
1882
1988
  * sandbox completely, until your app is restarted.
1883
1989
  *
1884
- * Start accessing a security scoped resource. With this method Electron
1990
+ * Start accessing a security scoped resource. With this method, Electron
1885
1991
  * applications that are packaged for the Mac App Store may reach outside their
1886
1992
  * sandbox to access files chosen by the user. See Apple's documentation for a
1887
1993
  * description of how this system works.
@@ -1889,6 +1995,28 @@ declare namespace Electron {
1889
1995
  * @platform mas
1890
1996
  */
1891
1997
  startAccessingSecurityScopedResource(bookmarkData: string): Function;
1998
+ /**
1999
+ * Starts accepting connections from app shims. An `app-shim-connected` event is
2000
+ * emitted for each shim that connects.
2001
+ *
2002
+ * Throws if the server cannot be started, for example because another copy of your
2003
+ * app has already started a server with the same `name`.
2004
+ *
2005
+ * This method can only be called after the app is ready. It is not available in
2006
+ * Mac App Store builds.
2007
+ *
2008
+ * @experimental
2009
+ * @platform darwin
2010
+ */
2011
+ startAppShimServer(options?: StartAppShimServerOptions): void;
2012
+ /**
2013
+ * Stops accepting connections from app shims. Shims that have already connected
2014
+ * stay connected.
2015
+ *
2016
+ * @experimental
2017
+ * @platform darwin
2018
+ */
2019
+ stopAppShimServer(): void;
1892
2020
  /**
1893
2021
  * Updates the current activity if its type matches `type`, merging the entries
1894
2022
  * from `userInfo` into its current `userInfo` dictionary.
@@ -1903,10 +2031,10 @@ declare namespace Electron {
1903
2031
  */
1904
2032
  whenReady(): Promise<void>;
1905
2033
  /**
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
2034
+ * A `boolean` property that's `true` if Chromium's accessibility support is
2035
+ * enabled, `false` otherwise. This property will be `true` if the use of assistive
1908
2036
  * technologies, such as screen readers, has been detected. Setting this property
1909
- * to `true` manually enables Chrome's accessibility support, allowing developers
2037
+ * to `true` manually enables Chromium's accessibility support, allowing developers
1910
2038
  * to expose accessibility switch to users in application settings.
1911
2039
  *
1912
2040
  * See Chromium's accessibility docs for more details. Disabled by default.
@@ -1926,13 +2054,8 @@ declare namespace Electron {
1926
2054
  applicationMenu: (Menu) | (null);
1927
2055
  /**
1928
2056
  * 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.
2057
+ * count to `0` will hide the badge. Setting this with any nonzero integer shows
2058
+ * the count on the Dock icon on macOS, or on the launcher on Linux.
1936
2059
  *
1937
2060
  * > [!NOTE] On macOS, you need to ensure that your application has the permission
1938
2061
  * to display notifications for this property to take effect.
@@ -2001,6 +2124,230 @@ declare namespace Electron {
2001
2124
  userAgentFallback: string;
2002
2125
  }
2003
2126
 
2127
+ class AppShimHost extends NodeEventEmitter {
2128
+
2129
+ // Docs: https://electronjs.org/docs/api/app-shim-host
2130
+
2131
+ /**
2132
+ * Emitted when the user clicks the shim's Dock icon, or launches the shim again
2133
+ * while it is already running.
2134
+ *
2135
+ * @experimental
2136
+ */
2137
+ on(event: 'activate', listener: (event: Event,
2138
+ hasVisibleWindows: boolean) => void): this;
2139
+ /**
2140
+ * @experimental
2141
+ */
2142
+ off(event: 'activate', listener: (event: Event,
2143
+ hasVisibleWindows: boolean) => void): this;
2144
+ /**
2145
+ * @experimental
2146
+ */
2147
+ once(event: 'activate', listener: (event: Event,
2148
+ hasVisibleWindows: boolean) => void): this;
2149
+ /**
2150
+ * @experimental
2151
+ */
2152
+ addListener(event: 'activate', listener: (event: Event,
2153
+ hasVisibleWindows: boolean) => void): this;
2154
+ /**
2155
+ * @experimental
2156
+ */
2157
+ removeListener(event: 'activate', listener: (event: Event,
2158
+ hasVisibleWindows: boolean) => void): this;
2159
+ /**
2160
+ * Emitted when the shim's process has exited or its connection was lost. All
2161
+ * windows that were created in the shim have already been closed.
2162
+ *
2163
+ * @experimental
2164
+ */
2165
+ on(event: 'disconnected', listener: (event: Event) => void): this;
2166
+ /**
2167
+ * @experimental
2168
+ */
2169
+ off(event: 'disconnected', listener: (event: Event) => void): this;
2170
+ /**
2171
+ * @experimental
2172
+ */
2173
+ once(event: 'disconnected', listener: (event: Event) => void): this;
2174
+ /**
2175
+ * @experimental
2176
+ */
2177
+ addListener(event: 'disconnected', listener: (event: Event) => void): this;
2178
+ /**
2179
+ * @experimental
2180
+ */
2181
+ removeListener(event: 'disconnected', listener: (event: Event) => void): this;
2182
+ /**
2183
+ * Emitted when the user opens a file with the shim.
2184
+ *
2185
+ * @experimental
2186
+ */
2187
+ on(event: 'open-file', listener: (event: Event,
2188
+ path: string) => void): this;
2189
+ /**
2190
+ * @experimental
2191
+ */
2192
+ off(event: 'open-file', listener: (event: Event,
2193
+ path: string) => void): this;
2194
+ /**
2195
+ * @experimental
2196
+ */
2197
+ once(event: 'open-file', listener: (event: Event,
2198
+ path: string) => void): this;
2199
+ /**
2200
+ * @experimental
2201
+ */
2202
+ addListener(event: 'open-file', listener: (event: Event,
2203
+ path: string) => void): this;
2204
+ /**
2205
+ * @experimental
2206
+ */
2207
+ removeListener(event: 'open-file', listener: (event: Event,
2208
+ path: string) => void): this;
2209
+ /**
2210
+ * Emitted when the user opens a URL with the shim.
2211
+ *
2212
+ * @experimental
2213
+ */
2214
+ on(event: 'open-url', listener: (event: Event,
2215
+ url: string) => void): this;
2216
+ /**
2217
+ * @experimental
2218
+ */
2219
+ off(event: 'open-url', listener: (event: Event,
2220
+ url: string) => void): this;
2221
+ /**
2222
+ * @experimental
2223
+ */
2224
+ once(event: 'open-url', listener: (event: Event,
2225
+ url: string) => void): this;
2226
+ /**
2227
+ * @experimental
2228
+ */
2229
+ addListener(event: 'open-url', listener: (event: Event,
2230
+ url: string) => void): this;
2231
+ /**
2232
+ * @experimental
2233
+ */
2234
+ removeListener(event: 'open-url', listener: (event: Event,
2235
+ url: string) => void): this;
2236
+ /**
2237
+ * Emitted when the shim is asked to quit: by the user, for example with Cmd+Q or
2238
+ * from its Dock menu, or by macOS at logout.
2239
+ *
2240
+ * By default, the shim quits and its windows are closed without emitting their
2241
+ * `close` events. To keep the shim running, call `event.preventDefault()`. You can
2242
+ * then close its windows yourself and call `shim.quit()` when you are done.
2243
+ *
2244
+ * `event.preventDefault()` must be called synchronously in the listener. If your
2245
+ * app's main process is unresponsive for more than five seconds, the shim quits
2246
+ * without waiting for it.
2247
+ *
2248
+ * @experimental
2249
+ */
2250
+ on(event: 'quit-requested', listener: (event: Event) => void): this;
2251
+ /**
2252
+ * @experimental
2253
+ */
2254
+ off(event: 'quit-requested', listener: (event: Event) => void): this;
2255
+ /**
2256
+ * @experimental
2257
+ */
2258
+ once(event: 'quit-requested', listener: (event: Event) => void): this;
2259
+ /**
2260
+ * @experimental
2261
+ */
2262
+ addListener(event: 'quit-requested', listener: (event: Event) => void): this;
2263
+ /**
2264
+ * @experimental
2265
+ */
2266
+ removeListener(event: 'quit-requested', listener: (event: Event) => void): this;
2267
+ /**
2268
+ * Bounces the shim's Dock icon, in the same way that `dock.bounce()` bounces your
2269
+ * app's.
2270
+ *
2271
+ * @experimental
2272
+ */
2273
+ bounce(type?: 'critical' | 'informational'): void;
2274
+ /**
2275
+ * Cancels a bounce started by `shim.bounce()`.
2276
+ *
2277
+ * @experimental
2278
+ */
2279
+ cancelBounce(): void;
2280
+ /**
2281
+ * Whether the shim's process is still connected.
2282
+ *
2283
+ * @experimental
2284
+ */
2285
+ isConnected(): boolean;
2286
+ /**
2287
+ * Quits the shim's process and closes its windows. The windows do not emit `close`
2288
+ * events. They emit `closed` shortly after this method returns.
2289
+ * `shim.isConnected()` returns `false` as soon as this method returns.
2290
+ *
2291
+ * @experimental
2292
+ */
2293
+ quit(): void;
2294
+ /**
2295
+ * Whether the code signature of the shim's process satisfies `requirement`. The
2296
+ * check is performed on the running process that connected, not on the bundle at
2297
+ * `shim.bundlePath`.
2298
+ *
2299
+ * Throws if `requirement` cannot be parsed.
2300
+ *
2301
+ * @experimental
2302
+ */
2303
+ satisfiesCodeRequirement(requirement: string): boolean;
2304
+ /**
2305
+ * Sets the menu bar that is shown while the shim is the active app. This is the
2306
+ * shim's equivalent of `Menu.setApplicationMenu()`. Passing `null` restores the
2307
+ * shim's minimal default menu.
2308
+ *
2309
+ * The `click` handlers of the menu's items and the menu's `menu-will-show` event
2310
+ * run in your app's main process. Items with a `role` act on the shim instead of
2311
+ * your app: for example, the `quit` role quits the shim. The default labels of the
2312
+ * `about`, `hide` and `quit` roles use the shim's name.
2313
+ *
2314
+ * The shim displays the menu's items as they were when this method was called.
2315
+ * Later changes to an item's `label`, `enabled`, `checked` or `visible` properties
2316
+ * are applied when the shim becomes the active app, when one of its menus is
2317
+ * opened, and after an item is clicked.
2318
+ *
2319
+ * @experimental
2320
+ */
2321
+ setApplicationMenu(menu: (Menu) | (null)): void;
2322
+ /**
2323
+ * Sets the text displayed on the shim's Dock icon. An empty string clears it.
2324
+ *
2325
+ * @experimental
2326
+ */
2327
+ setBadge(text: string): void;
2328
+ /**
2329
+ * A `string` representing the bundle identifier from that bundle's `Info.plist`.
2330
+ * This value is not verified, so do not use it to decide whether to trust the
2331
+ * shim. Use `shim.satisfiesCodeRequirement()` instead.
2332
+ *
2333
+ * @experimental
2334
+ */
2335
+ readonly bundleId: string;
2336
+ /**
2337
+ * A `string` representing the path of the app bundle that the shim's process was
2338
+ * launched from.
2339
+ *
2340
+ * @experimental
2341
+ */
2342
+ readonly bundlePath: string;
2343
+ /**
2344
+ * A `number` representing the process ID of the shim.
2345
+ *
2346
+ * @experimental
2347
+ */
2348
+ readonly pid: number;
2349
+ }
2350
+
2004
2351
  interface AutoUpdater extends NodeJS.EventEmitter {
2005
2352
 
2006
2353
  // Docs: https://electronjs.org/docs/api/auto-updater
@@ -2318,6 +2665,20 @@ declare namespace Electron {
2318
2665
  * @platform darwin
2319
2666
  */
2320
2667
  removeListener(event: 'new-window-for-tab', listener: () => void): this;
2668
+ /**
2669
+ * Emitted after the persisted window state has been restored.
2670
+ *
2671
+ * Window state includes the window bounds (x, y, height, width) and display mode
2672
+ * (maximized, fullscreen, kiosk).
2673
+ *
2674
+ * > [!NOTE] This event is only emitted when windowStatePersistence is enabled in
2675
+ * BaseWindowConstructorOptions or in BrowserWindowConstructorOptions.
2676
+ */
2677
+ on(event: 'persisted-state-restored', listener: () => void): this;
2678
+ off(event: 'persisted-state-restored', listener: () => void): this;
2679
+ once(event: 'persisted-state-restored', listener: () => void): this;
2680
+ addListener(event: 'persisted-state-restored', listener: () => void): this;
2681
+ removeListener(event: 'persisted-state-restored', listener: () => void): this;
2321
2682
  /**
2322
2683
  * Emitted when a session is about to end due to a shutdown, machine restart, or
2323
2684
  * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
@@ -2695,6 +3056,15 @@ declare namespace Electron {
2695
3056
  * BaseWindow
2696
3057
  */
2697
3058
  constructor(options?: BaseWindowConstructorOptions);
3059
+ /**
3060
+ * Clears the saved state for a window with the given name. This removes all
3061
+ * persisted window bounds, display mode, and work area information that was
3062
+ * previously saved when `windowStatePersistence` was enabled.
3063
+ *
3064
+ * If the window `name` is empty or the window state doesn't exist, the method will
3065
+ * log a warning.
3066
+ */
3067
+ static clearPersistedState(name: string): void;
2698
3068
  /**
2699
3069
  * The window with the given `id`.
2700
3070
  */
@@ -2900,6 +3270,8 @@ declare namespace Electron {
2900
3270
  invalidateShadow(): void;
2901
3271
  /**
2902
3272
  * Whether the window is always on top of other windows.
3273
+ *
3274
+ * Not supported on Wayland (Linux).
2903
3275
  */
2904
3276
  isAlwaysOnTop(): boolean;
2905
3277
  /**
@@ -2918,6 +3290,10 @@ declare namespace Electron {
2918
3290
  isContentProtected(): boolean;
2919
3291
  /**
2920
3292
  * Whether the window is destroyed.
3293
+ *
3294
+ * > [!NOTE] Once a window is destroyed, accessing most of its other properties and
3295
+ * methods throws `Object has been destroyed`, so callbacks that may run after the
3296
+ * window is gone should guard with `isDestroyed()`.
2921
3297
  */
2922
3298
  isDestroyed(): boolean;
2923
3299
  /**
@@ -3151,6 +3527,8 @@ declare namespace Electron {
3151
3527
  * Sets whether the window should show always on top of other windows. After
3152
3528
  * setting this, the window is still a normal window, not a toolbox window which
3153
3529
  * can not be focused on.
3530
+ *
3531
+ * Not supported on Wayland (Linux).
3154
3532
  */
3155
3533
  setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock', relativeLevel?: number): void;
3156
3534
  /**
@@ -3267,6 +3645,16 @@ declare namespace Electron {
3267
3645
  * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
3268
3646
  * version 2004 and up the window will be removed from capture entirely, older
3269
3647
  * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
3648
+ * The change takes effect with the next desktop composition, not when the call
3649
+ * returns, so a capture started immediately afterwards can still contain the
3650
+ * window.
3651
+ *
3652
+ * Protection also applies in a Windows remote session. A Remote Desktop client
3653
+ * still shows the window to the remote user, but remote access software that works
3654
+ * by capturing the desktop cannot. To leave windows unprotected in remote sessions
3655
+ * instead, disable the `AllowWindowCaptureExclusionInRemoteSessions` Chromium
3656
+ * feature at the start of your main script. `win.isContentProtected()` still
3657
+ * returns `true` in that case.
3270
3658
  *
3271
3659
  * @platform darwin,win32
3272
3660
  */
@@ -3332,7 +3720,10 @@ declare namespace Electron {
3332
3720
  * Makes the window ignore all mouse events.
3333
3721
  *
3334
3722
  * 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.
3723
+ * window, but if this window has focus, it will still receive keyboard events. On
3724
+ * Linux this is supported on both X11 and Wayland. On X11 the X server has applied
3725
+ * the window's new input shape when the call returns; on Wayland the new input
3726
+ * region is applied with the window's next frame.
3336
3727
  */
3337
3728
  setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
3338
3729
  /**
@@ -3409,13 +3800,14 @@ declare namespace Electron {
3409
3800
  * Remove progress bar when progress < 0; Change to indeterminate mode when
3410
3801
  * progress > 1.
3411
3802
  *
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
3803
  * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
3417
3804
  * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
3418
3805
  * mode set (but with a value within the valid range), `normal` will be assumed.
3806
+ *
3807
+ * On Linux, the progress bar shows on docks and taskbars that support the
3808
+ * LauncherEntry D-Bus API. It is associated with the app's `.desktop` file, so
3809
+ * `app.setDesktopName` must match the name of the app's actual `.desktop` file.
3810
+ * Indeterminate mode is not supported.
3419
3811
  */
3420
3812
  setProgressBar(progress: number, options?: ProgressBarOptions): void;
3421
3813
  /**
@@ -3796,9 +4188,18 @@ declare namespace Electron {
3796
4188
  acceptFirstMouse?: boolean;
3797
4189
  /**
3798
4190
  * Whether the window should always stay on top of other windows. Default is
3799
- * `false`.
4191
+ * `false`. Not supported on Wayland (Linux).
3800
4192
  */
3801
4193
  alwaysOnTop?: boolean;
4194
+ /**
4195
+ * Creates the native window in the process of this app shim, so that it belongs to
4196
+ * the shim's Dock icon and not to your app's. See AppShimHost for what affordances
4197
+ * are granted to the window.
4198
+ *
4199
+ * @experimental
4200
+ * @platform darwin
4201
+ */
4202
+ appShim?: AppShimHost;
3802
4203
  /**
3803
4204
  * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
3804
4205
  *
@@ -3934,7 +4335,11 @@ declare namespace Electron {
3934
4335
  */
3935
4336
  movable?: boolean;
3936
4337
  /**
3937
- * Set internal window name (ow-electron).
4338
+ * A unique identifier for the window, used internally by Electron to enable
4339
+ * features such as state persistence. Each window must have a distinct name. It
4340
+ * can only be reused after the corresponding window has been destroyed. An error
4341
+ * is thrown if the name is already in use. This is not the visible title shown to
4342
+ * users on the title bar.
3938
4343
  */
3939
4344
  name?: string;
3940
4345
  /**
@@ -3953,11 +4358,10 @@ declare namespace Electron {
3953
4358
  */
3954
4359
  resizable?: boolean;
3955
4360
  /**
3956
- * Whether frameless window should have rounded corners. Default is `true`. On
4361
+ * Whether a frameless window should have rounded corners. Default is `true`. On
3957
4362
  * 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
4363
+ * and frameless windows will not have rounded corners. On Linux, rounded corners
4364
+ * are only drawn when the desktop environment supports client-side decorations.
3961
4365
  */
3962
4366
  roundedCorners?: boolean;
3963
4367
  /**
@@ -4055,6 +4459,13 @@ declare namespace Electron {
4055
4459
  * Window's width in pixels. Default is `800`.
4056
4460
  */
4057
4461
  width?: number;
4462
+ /**
4463
+ * Configures or enables the persistence of window state (position, size, maximized
4464
+ * state, etc.) across application restarts. Has no effect if window `name` is not
4465
+ * provided. Automatically disabled when there is no available display.
4466
+ * _Experimental_
4467
+ */
4468
+ windowStatePersistence?: (WindowStatePersistence) | (boolean);
4058
4469
  /**
4059
4470
  * (**required** if y is used) Window's left offset from screen. Default is to
4060
4471
  * center the window.
@@ -4591,6 +5002,20 @@ declare namespace Electron {
4591
5002
  removeListener(event: 'page-title-updated', listener: (event: Event,
4592
5003
  title: string,
4593
5004
  explicitSet: boolean) => void): this;
5005
+ /**
5006
+ * Emitted after the persisted window state has been restored.
5007
+ *
5008
+ * Window state includes the window bounds (x, y, height, width) and display mode
5009
+ * (maximized, fullscreen, kiosk).
5010
+ *
5011
+ * > [!NOTE] This event is only emitted when windowStatePersistence is enabled in
5012
+ * BaseWindowConstructorOptions or in BrowserWindowConstructorOptions.
5013
+ */
5014
+ on(event: 'persisted-state-restored', listener: () => void): this;
5015
+ off(event: 'persisted-state-restored', listener: () => void): this;
5016
+ once(event: 'persisted-state-restored', listener: () => void): this;
5017
+ addListener(event: 'persisted-state-restored', listener: () => void): this;
5018
+ removeListener(event: 'persisted-state-restored', listener: () => void): this;
4594
5019
  /**
4595
5020
  * Emitted when a session is about to end due to a shutdown, machine restart, or
4596
5021
  * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
@@ -5571,8 +5996,7 @@ declare namespace Electron {
5571
5996
  */
5572
5997
  getNormalBounds(): Rectangle;
5573
5998
  /**
5574
- * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
5575
- * 1.
5999
+ * between 0.0 (fully transparent) and 1.0 (fully opaque).
5576
6000
  */
5577
6001
  getOpacity(): number;
5578
6002
  /**
@@ -5638,6 +6062,8 @@ declare namespace Electron {
5638
6062
  invalidateShadow(): void;
5639
6063
  /**
5640
6064
  * Whether the window is always on top of other windows.
6065
+ *
6066
+ * Not supported on Wayland (Linux).
5641
6067
  */
5642
6068
  isAlwaysOnTop(): boolean;
5643
6069
  /**
@@ -5935,6 +6361,8 @@ declare namespace Electron {
5935
6361
  * Sets whether the window should show always on top of other windows. After
5936
6362
  * setting this, the window is still a normal window, not a toolbox window which
5937
6363
  * can not be focused on.
6364
+ *
6365
+ * Not supported on Wayland (Linux).
5938
6366
  */
5939
6367
  setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock', relativeLevel?: number): void;
5940
6368
  /**
@@ -6063,7 +6491,16 @@ declare namespace Electron {
6063
6491
  * On Windows, it calls `SetWindowDisplayAffinity` with `WDA_EXCLUDEFROMCAPTURE`.
6064
6492
  * For Windows 10 version 2004 and up the window will be removed from capture
6065
6493
  * entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing
6066
- * a black window.
6494
+ * a black window. The change takes effect with the next desktop composition, not
6495
+ * when the call returns, so a capture started immediately afterwards can still
6496
+ * contain the window.
6497
+ *
6498
+ * Protection also applies in a Windows remote session. A Remote Desktop client
6499
+ * still shows the window to the remote user, but remote access software that works
6500
+ * by capturing the desktop cannot. To leave windows unprotected in remote sessions
6501
+ * instead, disable the `AllowWindowCaptureExclusionInRemoteSessions` Chromium
6502
+ * feature at the start of your main script. `win.isContentProtected()` still
6503
+ * returns `true` in that case.
6067
6504
  *
6068
6505
  * On macOS, it sets the `NSWindow`'s `sharingType` to `NSWindowSharingNone`.
6069
6506
  * Unfortunately, due to an intentional change in macOS, newer Mac applications
@@ -6133,7 +6570,10 @@ declare namespace Electron {
6133
6570
  * Makes the window ignore all mouse events.
6134
6571
  *
6135
6572
  * 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.
6573
+ * window, but if this window has focus, it will still receive keyboard events. On
6574
+ * Linux this is supported on both X11 and Wayland. On X11 the X server has applied
6575
+ * the window's new input shape when the call returns; on Wayland the new input
6576
+ * region is applied with the window's next frame.
6137
6577
  */
6138
6578
  setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
6139
6579
  /**
@@ -6182,10 +6622,8 @@ declare namespace Electron {
6182
6622
  */
6183
6623
  setMovable(movable: boolean): void;
6184
6624
  /**
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
6625
+ * Sets the opacity of the window. Out of bound number values are clamped to the
6626
+ * [0, 1] range.
6189
6627
  */
6190
6628
  setOpacity(opacity: number): void;
6191
6629
  /**
@@ -6212,13 +6650,14 @@ declare namespace Electron {
6212
6650
  * Remove progress bar when progress < 0; Change to indeterminate mode when
6213
6651
  * progress > 1.
6214
6652
  *
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
6653
  * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
6220
6654
  * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
6221
6655
  * mode set (but with a value within the valid range), `normal` will be assumed.
6656
+ *
6657
+ * On Linux, the progress bar shows on docks and taskbars that support the
6658
+ * LauncherEntry D-Bus API. It is associated with the app's `.desktop` file, so
6659
+ * `app.setDesktopName` must match the name of the app's actual `.desktop` file.
6660
+ * Indeterminate mode is not supported.
6222
6661
  */
6223
6662
  setProgressBar(progress: number, options?: ProgressBarOptions): void;
6224
6663
  /**
@@ -6596,6 +7035,9 @@ declare namespace Electron {
6596
7035
  *
6597
7036
  * See the `webContents` documentation for its methods and events.
6598
7037
  *
7038
+ * > [!NOTE] Reading this property throws `Object has been destroyed` once the
7039
+ * window has been destroyed; see `win.isDestroyed()`.
7040
+ *
6599
7041
  */
6600
7042
  readonly webContents: WebContents;
6601
7043
  }
@@ -6921,118 +7363,91 @@ declare namespace Electron {
6921
7363
 
6922
7364
  // Docs: https://electronjs.org/docs/api/clipboard
6923
7365
 
6924
- /**
6925
- * An array of supported formats for the clipboard `type`.
6926
- */
6927
- availableFormats(type?: 'selection' | 'clipboard'): string[];
6928
7366
  /**
6929
7367
  * Clears the clipboard content.
6930
7368
  */
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;
7369
+ clear(): void;
6975
7370
  /**
6976
- * The content in the clipboard as markup.
7371
+ * A promise that resolves with `true` if the clipboard contains data of the
7372
+ * specified `mimetype`, otherwise `false`. To check for a raw format, eg
7373
+ * `public/utf8-plain-text`, use the `electron application/osclipboard` custom
7374
+ * format (`electron application/osclipboard;format="public/utf8-plain-text"`).
6977
7375
  */
6978
- readHTML(type?: 'selection' | 'clipboard'): string;
7376
+ has(mimetype: string): Promise<boolean>;
6979
7377
  /**
6980
- * The image content in the clipboard.
7378
+ * A promise that resolves with an array of ClipboardItem objects containing the
7379
+ * clipboard's contents.
6981
7380
  */
6982
- readImage(type?: 'selection' | 'clipboard'): NativeImage;
7381
+ read(): Promise<Electron.ClipboardItem[]>;
6983
7382
  /**
6984
- * The content in the clipboard as RTF.
7383
+ * A promise that resolves with the content of the clipboard as plain text. Modeled
7384
+ * after the W3C `navigator.clipboard.readText` API.
6985
7385
  */
6986
- readRTF(type?: 'selection' | 'clipboard'): string;
7386
+ readText(): Promise<string>;
6987
7387
  /**
6988
- * The content in the clipboard as plain text.
7388
+ * Resolves once the data has been written to the clipboard. All entries supplied
7389
+ * in a single `write()` call are committed to the system clipboard atomically.
6989
7390
  */
6990
- readText(type?: 'selection' | 'clipboard'): string;
7391
+ write(data: ClipboardItem[]): Promise<void>;
6991
7392
  /**
6992
- * Writes `data` to the clipboard.
7393
+ * A promise that resolves once the text has been written to the clipboard. Modeled
7394
+ * after the W3C `navigator.clipboard.writeText` API.
6993
7395
  */
6994
- write(data: Data, type?: 'selection' | 'clipboard'): void;
7396
+ writeText(text: string): Promise<void>;
6995
7397
  /**
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.
7398
+ * A `Clipboard` property — a `Clipboard` object on Linux that operates against the
7399
+ * selection clipboard instead of the system clipboard, and `undefined` on all
7400
+ * other platforms. It exposes the same `read`, `write`, `readText`, `writeText`,
7401
+ * `has`, and `clear` methods as the top-level `clipboard` module.
7001
7402
  *
7002
- * @platform darwin,win32
7403
+ * @platform linux
7003
7404
  */
7004
- writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
7405
+ readonly selection: Clipboard;
7406
+ }
7407
+
7408
+ interface ClipboardBookmark {
7409
+
7410
+ // Docs: https://electronjs.org/docs/api/structures/clipboard-bookmark
7411
+
7005
7412
  /**
7006
- * Writes the `buffer` into the clipboard as `format`.
7007
- *
7008
- * @experimental
7413
+ * The title of the bookmark.
7009
7414
  */
7010
- writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
7415
+ title: string;
7011
7416
  /**
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
7417
+ * The URL of the bookmark.
7018
7418
  */
7019
- writeFindText(text: string): void;
7419
+ url: string;
7420
+ }
7421
+
7422
+ class ClipboardItem {
7423
+
7424
+ // Docs: https://electronjs.org/docs/api/clipboard-item
7425
+
7020
7426
  /**
7021
- * Writes `markup` to the clipboard.
7427
+ * ClipboardItem
7022
7428
  */
7023
- writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
7429
+ constructor(items: Record<string, (string) | (ClipboardBookmark) | (Blob) | (Promise<(Blob) | (string)>)>);
7024
7430
  /**
7025
- * Writes `image` to the clipboard.
7431
+ * Resolves with the payload for the given MIME type. Modeled after the W3C
7432
+ * `ClipboardItem.getType` method. The promise resolves to a `Blob` for most MIME
7433
+ * types; the one exception is `getType('electron application/bookmark')`, which
7434
+ * resolves to a ClipboardBookmark object instead. Rejects when `type` is not
7435
+ * present in `clipboardItem.types`.
7026
7436
  */
7027
- writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
7437
+ getType<T extends string>(type: T): Promise<string extends T ? (Blob | ClipboardBookmark) : T extends 'electron application/bookmark' ? ClipboardBookmark : Blob>;
7028
7438
  /**
7029
- * Writes the `text` into the clipboard in RTF.
7439
+ * Resolves with a ClipboardBookmark when a bookmark is available in the clipboard.
7440
+ * Rejects when a bookmark is not available in the clipboard.
7030
7441
  */
7031
- writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
7442
+ getType(bookmark: 'electron application/bookmark'): Promise<Electron.ClipboardBookmark>;
7032
7443
  /**
7033
- * Writes the `text` into the clipboard as plain text.
7444
+ * A `string[]` property — the MIME types of the data carried by this entry. For a
7445
+ * constructed `ClipboardItem` these are the keys passed to the constructor; for an
7446
+ * item returned by `clipboard.read()` these are the MIME types the platform
7447
+ * clipboard currently makes available.
7448
+ *
7034
7449
  */
7035
- writeText(text: string, type?: 'selection' | 'clipboard'): void;
7450
+ readonly types: string[];
7036
7451
  }
7037
7452
 
7038
7453
  interface ColorSpace {
@@ -7371,12 +7786,14 @@ declare namespace Electron {
7371
7786
  */
7372
7787
  cumulativeCPUUsage?: number;
7373
7788
  /**
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.
7789
+ * The number of average idle CPU wakeups per second since the last call to the API
7790
+ * that returned this object. First call returns 0. Will always return 0 on
7791
+ * Windows.
7376
7792
  */
7377
7793
  idleWakeupsPerSecond: number;
7378
7794
  /**
7379
- * Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
7795
+ * Percentage of CPU used since the last call to the API that returned this object.
7796
+ * First call returns 0.
7380
7797
  */
7381
7798
  percentCPUUsage: number;
7382
7799
  }
@@ -7396,7 +7813,9 @@ declare namespace Electron {
7396
7813
  /**
7397
7814
  * Set an extra parameter to be sent with the crash report. The values specified
7398
7815
  * here will be sent in addition to any values set via the `extra` option when
7399
- * `start` was called.
7816
+ * `start` was called. Calling this again with the same key replaces the value. The
7817
+ * value is read when a crash happens, so you can update it as your app's state
7818
+ * changes.
7400
7819
  *
7401
7820
  * Parameters added in this fashion (or via the `extra` parameter to
7402
7821
  * `crashReporter.start`) are specific to the calling process. Adding extra
@@ -7404,29 +7823,42 @@ declare namespace Electron {
7404
7823
  * with crashes from renderer or other child processes. Similarly, adding extra
7405
7824
  * parameters in a renderer process will not result in those parameters being sent
7406
7825
  * with crashes that occur in other renderer processes or in the main process.
7826
+ * Processes created with `utilityProcess` have no API for setting extra
7827
+ * parameters, so only `globalExtra` values are sent with their crashes.
7407
7828
  *
7408
7829
  * > [!NOTE] Parameters have limits on the length of the keys and values. Key names
7409
7830
  * 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.
7831
+ * Keys with names longer than the maximum are ignored, and a warning is emitted.
7832
+ * Values longer than the maximum length are truncated.
7412
7833
  */
7413
7834
  addExtraParameter(key: string, value: string): void;
7414
7835
  /**
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.
7836
+ * The date and ID of the crash report with the most recent upload time, from the
7837
+ * list returned by `getUploadedReports()`. If there are no crash reports at all,
7838
+ * `null` is returned.
7839
+ *
7840
+ * If no report has been uploaded yet but some are stored on disk, a report that
7841
+ * has not been uploaded may be returned. Check that its `id` is not empty before
7842
+ * treating it as uploaded.
7419
7843
  *
7420
7844
  * > [!NOTE] This method is only available in the main process.
7421
7845
  */
7422
7846
  getLastCrashReport(): (CrashReport) | (null);
7423
7847
  /**
7424
- * The current 'extra' parameters of the crash reporter.
7848
+ * The current 'extra' parameters of the crash reporter in the calling process, as
7849
+ * set with the `extra` option and `addExtraParameter`. Parameters set with the
7850
+ * `globalExtra` option are not included.
7425
7851
  */
7426
7852
  getParameters(): Record<string, string>;
7427
7853
  /**
7428
- * Returns all uploaded crash reports. Each report contains the date and uploaded
7429
- * ID.
7854
+ * Returns the crash reports stored on disk. Each report contains the date it was
7855
+ * uploaded and the ID that the crash server returned for it.
7856
+ *
7857
+ * Despite the method's name, reports that have not been uploaded (for example
7858
+ * because `uploadToServer` is `false`, the upload failed, or the report was rate
7859
+ * limited) are included too. For those reports, `id` is an empty string and `date`
7860
+ * is not meaningful. To list only uploaded reports, filter out reports with an
7861
+ * empty `id`.
7430
7862
  *
7431
7863
  * > [!NOTE] This method is only available in the main process.
7432
7864
  */
@@ -7469,9 +7901,9 @@ declare namespace Electron {
7469
7901
  *
7470
7902
  * > [!NOTE] Parameters passed in `extra`, `globalExtra` or set with
7471
7903
  * `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.
7904
+ * must be at most 39 bytes long, and values must be no longer than 20320 bytes.
7905
+ * Keys with names longer than the maximum are ignored, and a warning is emitted.
7906
+ * Values longer than the maximum length are truncated.
7475
7907
  *
7476
7908
  * > [!NOTE] This method is only available in the main process.
7477
7909
  */
@@ -7618,6 +8050,14 @@ declare namespace Electron {
7618
8050
  * indicating the failure of the command.
7619
8051
  *
7620
8052
  * Send given command to the debugging target.
8053
+ *
8054
+ * > [!NOTE]
8055
+ *
8056
+ * * If `sendCommand` is called before the target has navigated (e.g. immediately
8057
+ * after `attach()`), the returned promise may not resolve until navigation occurs.
8058
+ * * If the command's response has no `result` data, as defined by that command's
8059
+ * entry in the remote debugging protocol, the promise resolves with an empty
8060
+ * object (`{}`), not `null` or `undefined`.
7621
8061
  */
7622
8062
  sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
7623
8063
  }
@@ -8077,6 +8517,11 @@ declare namespace Electron {
8077
8517
  /**
8078
8518
  * Hides the dock icon.
8079
8519
  *
8520
+ * > [!IMPORTANT] **Known issue:** Calling `dock.hide()` within one second of a
8521
+ * previous call will have no effect. As a workaround, ensure at least one second
8522
+ * has elapsed between calls — for example, by deferring with a `setTimeout` of
8523
+ * 1100ms or more after a previous call.
8524
+ *
8080
8525
  * @platform darwin
8081
8526
  */
8082
8527
  hide(): void;
@@ -8220,6 +8665,14 @@ declare namespace Electron {
8220
8665
  * actual name of saved file will be different.
8221
8666
  */
8222
8667
  getFilename(): string;
8668
+ /**
8669
+ * The origin that started the download (for example `https://example.com`, or
8670
+ * `null` for an opaque origin), or an empty string if the download was not started
8671
+ * by web content (for example `webContents.downloadURL()`). Use this rather than
8672
+ * `getURL()` or the `webContents` to decide whose download it is: the URL is
8673
+ * chosen by the initiator and the `webContents` is the whole tab.
8674
+ */
8675
+ getInitiatorOrigin(): string;
8223
8676
  /**
8224
8677
  * Last-Modified header value.
8225
8678
  */
@@ -9520,6 +9973,10 @@ declare namespace Electron {
9520
9973
  * Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
9521
9974
  * will be set as each window's top menu.
9522
9975
  *
9976
+ * On Linux, the menu bar uses GTK theme colors when GTK is available. If GTK
9977
+ * cannot initialize, it uses Chromium's built-in light or dark menu colors,
9978
+ * following `nativeTheme.shouldUseDarkColors`.
9979
+ *
9523
9980
  * Also on Windows and Linux, you can use a `&` in the top-level item name to
9524
9981
  * indicate which letter should get a generated accelerator. For example, using
9525
9982
  * `&File` for the file menu would result in a generated `Alt-F` accelerator that
@@ -9579,6 +10036,27 @@ declare namespace Electron {
9579
10036
  * An `Accelerator | null` indicating the item's accelerator, if set.
9580
10037
  */
9581
10038
  accelerator: (Accelerator) | (null);
10039
+ /**
10040
+ * A `string` indicating the item's accessibility label (used by assistive
10041
+ * technology), if set.
10042
+ *
10043
+ * This property can be dynamically changed.
10044
+ *
10045
+ * @platform darwin
10046
+ */
10047
+ accessibilityLabel: string;
10048
+ /**
10049
+ * A `MenuItemBadge` (optional) indicating the badge for the menu item.
10050
+ *
10051
+ * This property can be dynamically changed; setting it to `undefined` removes the
10052
+ * badge. Only available on macOS 14 and up.
10053
+ *
10054
+ * Badges are not displayed in Dock menus, though the same item shows its badge in
10055
+ * an application menu.
10056
+ *
10057
+ * @platform darwin
10058
+ */
10059
+ badge?: MenuItemBadge;
9582
10060
  /**
9583
10061
  * A `boolean` indicating whether the item is checked.
9584
10062
  *
@@ -9706,6 +10184,27 @@ declare namespace Electron {
9706
10184
  visible: boolean;
9707
10185
  }
9708
10186
 
10187
+ interface MenuItemBadge {
10188
+
10189
+ // Docs: https://electronjs.org/docs/api/structures/menu-item-badge
10190
+
10191
+ /**
10192
+ * A custom string to display in the badge. Required for, and only usable with, the
10193
+ * `none` type.
10194
+ */
10195
+ content?: string;
10196
+ /**
10197
+ * The number of items the badge displays. Required for the `alerts`, `updates` and
10198
+ * `new-items` types; cannot be used with `none`.
10199
+ */
10200
+ count?: number;
10201
+ /**
10202
+ * Can be `alerts`, `updates`, `new-items` or `none`. Default is `none`. See
10203
+ * Creating badges of a specific type for further explanation of these types.
10204
+ */
10205
+ type?: ('alerts' | 'updates' | 'new-items' | 'none');
10206
+ }
10207
+
9709
10208
  class MessageChannelMain {
9710
10209
 
9711
10210
  // Docs: https://electronjs.org/docs/api/message-channel-main
@@ -9870,13 +10369,20 @@ declare namespace Electron {
9870
10369
  *
9871
10370
  * @platform darwin
9872
10371
  */
9873
- static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
10372
+ static createFromNamedImage(imageName: string, options?: (CreateFromNamedImageOptions) | (number[])): NativeImage;
9874
10373
  /**
9875
10374
  * Creates a new `NativeImage` instance from an image file (e.g., PNG or JPEG)
9876
10375
  * located at `path`. This method returns an empty image if the `path` does not
9877
10376
  * exist, cannot be read, or is not a valid image.
9878
10377
  */
9879
10378
  static createFromPath(path: string): NativeImage;
10379
+ /**
10380
+ * Creates a new `NativeImage` instance from an SF Symbol for use in a native Menu.
10381
+ * See SF Symbols for a list of possible values.
10382
+ *
10383
+ * @platform darwin
10384
+ */
10385
+ static createMenuSymbol(imageName: string): NativeImage;
9880
10386
  /**
9881
10387
  * fulfilled with the file's thumbnail preview image, which is a NativeImage.
9882
10388
  *
@@ -10179,8 +10685,8 @@ declare namespace Electron {
10179
10685
  * see Response.
10180
10686
  *
10181
10687
  * 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.
10688
+ * Chromium's network stack. This differs from Node's `fetch()`, which uses
10689
+ * Node.js's HTTP stack.
10184
10690
  *
10185
10691
  * Example:
10186
10692
  *
@@ -10277,9 +10783,6 @@ declare namespace Electron {
10277
10783
 
10278
10784
  // Docs: https://electronjs.org/docs/api/notification
10279
10785
 
10280
- /**
10281
- * @platform darwin,win32
10282
- */
10283
10786
  on(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10284
10787
  /**
10285
10788
  * @deprecated
@@ -10290,9 +10793,6 @@ declare namespace Electron {
10290
10793
  * @platform win32
10291
10794
  */
10292
10795
  selectionIndex: number) => void): this;
10293
- /**
10294
- * @platform darwin,win32
10295
- */
10296
10796
  off(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10297
10797
  /**
10298
10798
  * @deprecated
@@ -10303,9 +10803,6 @@ declare namespace Electron {
10303
10803
  * @platform win32
10304
10804
  */
10305
10805
  selectionIndex: number) => void): this;
10306
- /**
10307
- * @platform darwin,win32
10308
- */
10309
10806
  once(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10310
10807
  /**
10311
10808
  * @deprecated
@@ -10316,9 +10813,6 @@ declare namespace Electron {
10316
10813
  * @platform win32
10317
10814
  */
10318
10815
  selectionIndex: number) => void): this;
10319
- /**
10320
- * @platform darwin,win32
10321
- */
10322
10816
  addListener(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10323
10817
  /**
10324
10818
  * @deprecated
@@ -10329,9 +10823,6 @@ declare namespace Electron {
10329
10823
  * @platform win32
10330
10824
  */
10331
10825
  selectionIndex: number) => void): this;
10332
- /**
10333
- * @platform darwin,win32
10334
- */
10335
10826
  removeListener(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10336
10827
  /**
10337
10828
  * @deprecated
@@ -11302,7 +11793,8 @@ declare namespace Electron {
11302
11793
  // Docs: https://electronjs.org/docs/api/structures/process-metric
11303
11794
 
11304
11795
  /**
11305
- * CPU usage of the process.
11796
+ * CPU usage of the process. Its `percentCPUUsage` and `idleWakeupsPerSecond` are
11797
+ * averages over the time since the previous call to the API returning this object.
11306
11798
  */
11307
11799
  cpu: CPUUsage;
11308
11800
  /**
@@ -11463,10 +11955,22 @@ declare namespace Electron {
11463
11955
 
11464
11956
  // Docs: https://electronjs.org/docs/api/protocol
11465
11957
 
11958
+ /**
11959
+ * The source registered for `scheme` with `protocol.registerSource`, or `null`.
11960
+ *
11961
+ * @experimental
11962
+ */
11963
+ getSource(scheme: string): (ProtocolSource) | (null);
11466
11964
  /**
11467
11965
  * Register a protocol handler for `scheme`. Requests made to URLs with this scheme
11468
11966
  * will delegate to this handler to determine what response should be sent.
11469
11967
  *
11968
+ * In addition to the standard `Request` fields, `request.initiatorOrigin` is set
11969
+ * to the origin that issued the request (for example `https://example.com`, or
11970
+ * `null` for an opaque origin) when web content made it; it is absent for requests
11971
+ * the browser started itself. Unlike `request.referrer` it is not controlled by
11972
+ * the requesting page, so prefer it when deciding whether to serve a request.
11973
+ *
11470
11974
  * Either a `Response` or a `Promise<Response>` can be returned.
11471
11975
  *
11472
11976
  * Example:
@@ -11520,7 +12024,7 @@ declare namespace Electron {
11520
12024
  */
11521
12025
  interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
11522
12026
  /**
11523
- * Whether `scheme` is already handled.
12027
+ * Whether `scheme` already has a handler or a source.
11524
12028
  */
11525
12029
  isProtocolHandled(scheme: string): boolean;
11526
12030
  /**
@@ -11615,6 +12119,28 @@ declare namespace Electron {
11615
12119
  * correctly expect streaming responses.
11616
12120
  */
11617
12121
  registerSchemesAsPrivileged(customSchemes: CustomScheme[]): void;
12122
+ /**
12123
+ * Serves `scheme` from directories on disk without a JavaScript handler. Each
12124
+ * request is matched against `routes` (a route with a `host` wins over one
12125
+ * without, then the longest `path` prefix wins), the rest of the URL's path is
12126
+ * resolved inside that route's `root`, and the file is streamed to the requester
12127
+ * the way `file:` URLs are, including from `asar` archives, with `Content-Type`
12128
+ * taken from the file extension. A path that resolves outside `root`, a missing
12129
+ * file, a request that matches no route, or a method other than `GET`/`HEAD` fails
12130
+ * with `net::ERR_FILE_NOT_FOUND`. A URL whose path ends in `/` serves the route's
12131
+ * `index` file.
12132
+ *
12133
+ * Use this instead of `protocol.handle` when a scheme only serves an app's own
12134
+ * bundled files: no request touches the main thread, so pages and their
12135
+ * subresources load at the same speed whether or not the main process is busy.
12136
+ *
12137
+ * A scheme has either a handler or a source; `protocol.unhandle` removes either,
12138
+ * and `protocol.isProtocolHandled` reports both. `webRequest` listeners apply to
12139
+ * these requests as to any other.
12140
+ *
12141
+ * @experimental
12142
+ */
12143
+ registerSource(scheme: string, source: ProtocolSource): void;
11618
12144
  /**
11619
12145
  * Whether the protocol was successfully registered
11620
12146
  *
@@ -11645,7 +12171,8 @@ declare namespace Electron {
11645
12171
  */
11646
12172
  registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
11647
12173
  /**
11648
- * Removes a protocol handler registered with `protocol.handle`.
12174
+ * Removes a protocol handler registered with `protocol.handle` or a source
12175
+ * registered with `protocol.registerSource`.
11649
12176
  */
11650
12177
  unhandle(scheme: string): void;
11651
12178
  /**
@@ -11671,6 +12198,12 @@ declare namespace Electron {
11671
12198
  // Docs: https://electronjs.org/docs/api/structures/protocol-request
11672
12199
 
11673
12200
  headers: Record<string, string>;
12201
+ /**
12202
+ * The origin that issued the request (for example `https://example.com`, or `null`
12203
+ * for an opaque origin). Absent for requests the browser started itself. Unlike
12204
+ * `referrer`, this is not controlled by the requesting page.
12205
+ */
12206
+ initiatorOrigin?: string;
11674
12207
  method: string;
11675
12208
  referrer: string;
11676
12209
  uploadData?: UploadData[];
@@ -11756,6 +12289,32 @@ declare namespace Electron {
11756
12289
  data: (string) | (Buffer);
11757
12290
  }
11758
12291
 
12292
+ interface ProtocolRoute {
12293
+
12294
+ // Docs: https://electronjs.org/docs/api/structures/protocol-route
12295
+
12296
+ /**
12297
+ * Which URLs on the scheme this route serves. A route without `match` serves every
12298
+ * URL.
12299
+ */
12300
+ match?: Match;
12301
+ /**
12302
+ * What the matched URLs are served from.
12303
+ */
12304
+ source: Source;
12305
+ }
12306
+
12307
+ interface ProtocolSource {
12308
+
12309
+ // Docs: https://electronjs.org/docs/api/structures/protocol-source
12310
+
12311
+ /**
12312
+ * How URLs on the scheme map to directories on disk; see
12313
+ * `protocol.registerSource`.
12314
+ */
12315
+ routes: ProtocolRoute[];
12316
+ }
12317
+
11759
12318
  interface ProxyConfig {
11760
12319
 
11761
12320
  // Docs: https://electronjs.org/docs/api/structures/proxy-config
@@ -12539,7 +13098,11 @@ declare namespace Electron {
12539
13098
  * True if the renderer is requesting that the connection include credentials (see
12540
13099
  * the spec for more details.)
12541
13100
  */
12542
- allowCredentials: boolean) => void): this;
13101
+ allowCredentials: boolean,
13102
+ /**
13103
+ * The frame that requested the preconnection, if it still exists.
13104
+ */
13105
+ frame: (WebFrameMain) | (null)) => void): this;
12543
13106
  off(event: 'preconnect', listener: (event: Event,
12544
13107
  /**
12545
13108
  * The URL being requested for preconnection by the renderer.
@@ -12549,7 +13112,11 @@ declare namespace Electron {
12549
13112
  * True if the renderer is requesting that the connection include credentials (see
12550
13113
  * the spec for more details.)
12551
13114
  */
12552
- allowCredentials: boolean) => void): this;
13115
+ allowCredentials: boolean,
13116
+ /**
13117
+ * The frame that requested the preconnection, if it still exists.
13118
+ */
13119
+ frame: (WebFrameMain) | (null)) => void): this;
12553
13120
  once(event: 'preconnect', listener: (event: Event,
12554
13121
  /**
12555
13122
  * The URL being requested for preconnection by the renderer.
@@ -12559,7 +13126,11 @@ declare namespace Electron {
12559
13126
  * True if the renderer is requesting that the connection include credentials (see
12560
13127
  * the spec for more details.)
12561
13128
  */
12562
- allowCredentials: boolean) => void): this;
13129
+ allowCredentials: boolean,
13130
+ /**
13131
+ * The frame that requested the preconnection, if it still exists.
13132
+ */
13133
+ frame: (WebFrameMain) | (null)) => void): this;
12563
13134
  addListener(event: 'preconnect', listener: (event: Event,
12564
13135
  /**
12565
13136
  * The URL being requested for preconnection by the renderer.
@@ -12569,7 +13140,11 @@ declare namespace Electron {
12569
13140
  * True if the renderer is requesting that the connection include credentials (see
12570
13141
  * the spec for more details.)
12571
13142
  */
12572
- allowCredentials: boolean) => void): this;
13143
+ allowCredentials: boolean,
13144
+ /**
13145
+ * The frame that requested the preconnection, if it still exists.
13146
+ */
13147
+ frame: (WebFrameMain) | (null)) => void): this;
12573
13148
  removeListener(event: 'preconnect', listener: (event: Event,
12574
13149
  /**
12575
13150
  * The URL being requested for preconnection by the renderer.
@@ -12579,7 +13154,11 @@ declare namespace Electron {
12579
13154
  * True if the renderer is requesting that the connection include credentials (see
12580
13155
  * the spec for more details.)
12581
13156
  */
12582
- allowCredentials: boolean) => void): this;
13157
+ allowCredentials: boolean,
13158
+ /**
13159
+ * The frame that requested the preconnection, if it still exists.
13160
+ */
13161
+ frame: (WebFrameMain) | (null)) => void): this;
12583
13162
  /**
12584
13163
  * Emitted when a HID device needs to be selected when a call to
12585
13164
  * `navigator.hid.requestDevice` is made. `callback` should be called with
@@ -12917,26 +13496,47 @@ declare namespace Electron {
12917
13496
  removeListener(event: 'usb-device-revoked', listener: (event: Event,
12918
13497
  details: UsbDeviceRevokedDetails) => void): this;
12919
13498
  /**
12920
- * Emitted when Electron is about to download `item` in `webContents`.
13499
+ * Emitted when Electron is about to download `item` in `webContents`. See also
13500
+ * `item.getInitiatorOrigin()`.
12921
13501
  *
12922
13502
  * Calling `event.preventDefault()` will cancel the download and `item` will not be
12923
13503
  * available from next tick of the process.
12924
13504
  */
12925
13505
  on(event: 'will-download', listener: (event: Event,
12926
13506
  item: DownloadItem,
12927
- webContents: WebContents) => void): this;
13507
+ webContents: WebContents,
13508
+ /**
13509
+ * The frame that started the download, if it still exists.
13510
+ */
13511
+ frame: (WebFrameMain) | (null)) => void): this;
12928
13512
  off(event: 'will-download', listener: (event: Event,
12929
13513
  item: DownloadItem,
12930
- webContents: WebContents) => void): this;
13514
+ webContents: WebContents,
13515
+ /**
13516
+ * The frame that started the download, if it still exists.
13517
+ */
13518
+ frame: (WebFrameMain) | (null)) => void): this;
12931
13519
  once(event: 'will-download', listener: (event: Event,
12932
13520
  item: DownloadItem,
12933
- webContents: WebContents) => void): this;
13521
+ webContents: WebContents,
13522
+ /**
13523
+ * The frame that started the download, if it still exists.
13524
+ */
13525
+ frame: (WebFrameMain) | (null)) => void): this;
12934
13526
  addListener(event: 'will-download', listener: (event: Event,
12935
13527
  item: DownloadItem,
12936
- webContents: WebContents) => void): this;
13528
+ webContents: WebContents,
13529
+ /**
13530
+ * The frame that started the download, if it still exists.
13531
+ */
13532
+ frame: (WebFrameMain) | (null)) => void): this;
12937
13533
  removeListener(event: 'will-download', listener: (event: Event,
12938
13534
  item: DownloadItem,
12939
- webContents: WebContents) => void): this;
13535
+ webContents: WebContents,
13536
+ /**
13537
+ * The frame that started the download, if it still exists.
13538
+ */
13539
+ frame: (WebFrameMain) | (null)) => void): this;
12940
13540
  /**
12941
13541
  * Whether the word was successfully written to the custom dictionary. This API
12942
13542
  * will not work on non-persistent (in-memory) sessions.
@@ -13042,8 +13642,8 @@ declare namespace Electron {
13042
13642
  * see Response.
13043
13643
  *
13044
13644
  * 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.
13645
+ * Chromium's network stack. This differs from Node's `fetch()`, which uses
13646
+ * Node.js's HTTP stack.
13047
13647
  *
13048
13648
  * Example:
13049
13649
  *
@@ -13316,7 +13916,7 @@ declare namespace Electron {
13316
13916
  *
13317
13917
  * Passing `null` instead of a function resets the handler to its default state.
13318
13918
  */
13319
- setDisplayMediaRequestHandler(handler: ((request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: Streams) => void) => void) | (null), opts?: DisplayMediaRequestHandlerOpts): void;
13919
+ setDisplayMediaRequestHandler(handler: ((request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: (Streams) | (null)) => void) => void) | (null), opts?: DisplayMediaRequestHandlerOpts): void;
13320
13920
  /**
13321
13921
  * Sets download saving directory. By default, the download directory will be the
13322
13922
  * `Downloads` under the respective app folder.
@@ -13333,7 +13933,7 @@ declare namespace Electron {
13333
13933
  * > [!NOTE] `isMainFrame` will always be `false` for a `fileSystem` request as a
13334
13934
  * result of Chromium limitations.
13335
13935
  */
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;
13936
+ 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
13937
  /**
13338
13938
  * Sets the handler which can be used to respond to permission requests for the
13339
13939
  * `session`. Calling `callback(true)` will allow the permission and
@@ -13342,7 +13942,7 @@ declare namespace Electron {
13342
13942
  * `setPermissionCheckHandler` to get complete permission handling. Most web APIs
13343
13943
  * do a permission check and then make a permission request if the check is denied.
13344
13944
  */
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;
13945
+ 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
13946
  /**
13347
13947
  * Adds scripts that will be executed on ALL web contents that are associated with
13348
13948
  * this session just before normal `preload` scripts run.
@@ -15800,26 +16400,34 @@ declare namespace Electron {
15800
16400
  /**
15801
16401
  * Emitted when the utility process encounters an HTTP 401 or 407 authentication
15802
16402
  * challenge, if the process was created with both
15803
- * `respondToAuthRequestsFromMainProcess: true` and a `session` option. The
15804
- * `callback` should be called with credentials to respond to the challenge.
15805
- * Calling `callback` without arguments will cancel the request.
16403
+ * `respondToAuthRequestsFromMainProcess: true` and a `session` option.
16404
+ *
16405
+ * The default behavior is to cancel the authentication. To override this you
16406
+ * should prevent the default behavior with `event.preventDefault()` and call
16407
+ * `callback(username, password)` with the credentials. Calling `callback` without
16408
+ * arguments will cancel the request.
15806
16409
  *
15807
16410
  * This behaves the same as the `login` event on `app` but is scoped to the
15808
16411
  * individual utility process instance.
15809
16412
  */
15810
- on(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
16413
+ on(event: 'login', listener: (event: Event,
16414
+ authenticationResponseDetails: AuthenticationResponseDetails,
15811
16415
  authInfo: AuthInfo,
15812
16416
  callback: (username?: string, password?: string) => void) => void): this;
15813
- off(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
16417
+ off(event: 'login', listener: (event: Event,
16418
+ authenticationResponseDetails: AuthenticationResponseDetails,
15814
16419
  authInfo: AuthInfo,
15815
16420
  callback: (username?: string, password?: string) => void) => void): this;
15816
- once(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
16421
+ once(event: 'login', listener: (event: Event,
16422
+ authenticationResponseDetails: AuthenticationResponseDetails,
15817
16423
  authInfo: AuthInfo,
15818
16424
  callback: (username?: string, password?: string) => void) => void): this;
15819
- addListener(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
16425
+ addListener(event: 'login', listener: (event: Event,
16426
+ authenticationResponseDetails: AuthenticationResponseDetails,
15820
16427
  authInfo: AuthInfo,
15821
16428
  callback: (username?: string, password?: string) => void) => void): this;
15822
- removeListener(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
16429
+ removeListener(event: 'login', listener: (event: Event,
16430
+ authenticationResponseDetails: AuthenticationResponseDetails,
15823
16431
  authInfo: AuthInfo,
15824
16432
  callback: (username?: string, password?: string) => void) => void): this;
15825
16433
  /**
@@ -15914,6 +16522,11 @@ declare namespace Electron {
15914
16522
  * no-op.
15915
16523
  */
15916
16524
  removeChildView(view: View): void;
16525
+ /**
16526
+ * > [!NOTE] You must set a background color with an alpha channel (e.g.
16527
+ * `#80ffffff`) in order for the blur effect to be visible.
16528
+ */
16529
+ setBackgroundBlur(blurRadius: number): void;
15917
16530
  /**
15918
16531
  * Examples of valid `color` values:
15919
16532
  *
@@ -16070,6 +16683,9 @@ declare namespace Electron {
16070
16683
  mouse: MouseInputEvent) => void): this;
16071
16684
  /**
16072
16685
  * Emitted when the `WebContents` loses focus.
16686
+ *
16687
+ * The `blur` event is also emitted when switching between windows or apps for the
16688
+ * `WebContents` that has focus within its window.
16073
16689
  */
16074
16690
  on(event: 'blur', listener: () => void): this;
16075
16691
  off(event: 'blur', listener: () => void): this;
@@ -17083,14 +17699,8 @@ declare namespace Electron {
17083
17699
  /**
17084
17700
  * Emitted when the `WebContents` gains focus.
17085
17701
  *
17086
- * Note that on macOS, having focus means the `WebContents` is the first responder
17087
- * of window, so switching focus between windows would not trigger the `focus` and
17088
- * `blur` events of `WebContents`, as the first responder of each window is not
17089
- * changed.
17090
- *
17091
- * The `focus` and `blur` events of `WebContents` should only be used to detect
17092
- * focus change between different `WebContents` and `BrowserView` in the same
17093
- * window.
17702
+ * The `focus` event is also emitted when switching between windows or apps for the
17703
+ * `WebContents` that has focus within its window.
17094
17704
  */
17095
17705
  on(event: 'focus', listener: () => void): this;
17096
17706
  off(event: 'focus', listener: () => void): this;
@@ -17942,6 +18552,31 @@ declare namespace Electron {
17942
18552
  * @deprecated
17943
18553
  */
17944
18554
  clearHistory(): void;
18555
+ /**
18556
+ * A cloned WebContents instance. This method creates a copy of the WebContents
18557
+ * with the following attributes:
18558
+ *
18559
+ * * **WebPreferences** - All preferences from the original WebContents are copied
18560
+ * * **SiteInstance** - Uses the same SiteInstance as the original. This means the
18561
+ * cloned WebContents will reuse the same render process as the original when
18562
+ * loading same-origin pages, and only spawn a new render process for cross-origin
18563
+ * navigations. This process allocation behavior is consistent with window.open and
18564
+ * tab duplication in Chromium. For more details, see Chromium's Site Isolation
18565
+ * design document.
18566
+ * * **Opener relationship** - Inherits the opener (window.opener) relationship
18567
+ * * **Navigation state** - Copies the navigation history and controller state
18568
+ *
18569
+ * The cloned WebContents is an independent instance with its own lifecycle that
18570
+ * can be destroyed separately and will not contain any open web pages.
18571
+ *
18572
+ * This API is useful for use cases where you want to create a new WebContents that
18573
+ * shares the same render process with the original for same-origin content, while
18574
+ * maintaining full lifecycle independence. Additionally, reusing the existing
18575
+ * render process can help optimize memory usage and page load speed to a certain
18576
+ * extent, as it eliminates the overhead of spawning and initializing a new render
18577
+ * process from scratch.
18578
+ */
18579
+ clone(): WebContents;
17945
18580
  /**
17946
18581
  * Closes the page, as if the web content had called `window.close()`.
17947
18582
  *
@@ -17962,6 +18597,11 @@ declare namespace Electron {
17962
18597
  * Copy the image at the given position to the clipboard.
17963
18598
  */
17964
18599
  copyImageAt(x: number, y: number): void;
18600
+ /**
18601
+ * When executed on a video media element, copies the frame at (x, y) to the
18602
+ * clipboard.
18603
+ */
18604
+ copyVideoFrameAt(x: number, y: number): void;
17965
18605
  /**
17966
18606
  * Executes the editing command `cut` in web page.
17967
18607
  */
@@ -18118,6 +18758,10 @@ declare namespace Electron {
18118
18758
  * the current zoom level.
18119
18759
  */
18120
18760
  getZoomLevel(): number;
18761
+ /**
18762
+ * The current zoom mode. Can be `default`, `isolated`, `manual`, or `disabled`.
18763
+ */
18764
+ getZoomMode(): ('default' | 'isolated' | 'manual' | 'disabled');
18121
18765
  /**
18122
18766
  * Makes the browser go back a web page.
18123
18767
  *
@@ -18194,6 +18838,10 @@ declare namespace Electron {
18194
18838
  * greater than 0.
18195
18839
  */
18196
18840
  isBeingCaptured(): boolean;
18841
+ /**
18842
+ * Whether caret browsing is enabled for this page.
18843
+ */
18844
+ isCaretBrowsingEnabled(): boolean;
18197
18845
  /**
18198
18846
  * Whether the renderer process has crashed.
18199
18847
  */
@@ -18361,6 +19009,11 @@ declare namespace Electron {
18361
19009
  * resolves if the page is saved.
18362
19010
  */
18363
19011
  savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
19012
+ /**
19013
+ * When executed on a video media element, shows a save dialog and saves the frame
19014
+ * at (x, y) to disk.
19015
+ */
19016
+ saveVideoFrameAs(x: number, y: number): void;
18364
19017
  /**
18365
19018
  * Scrolls to the bottom of the current `webContents`.
18366
19019
  */
@@ -18424,6 +19077,10 @@ declare namespace Electron {
18424
19077
  * when the page becomes backgrounded. This also affects the Page Visibility API.
18425
19078
  */
18426
19079
  setBackgroundThrottling(allowed: boolean): void;
19080
+ /**
19081
+ * Sets whether caret browsing is enabled on the current web page.
19082
+ */
19083
+ setCaretBrowsingEnabled(enabled: boolean): void;
18427
19084
  /**
18428
19085
  * Changes the title of the DevTools window to `title`. This will only be visible
18429
19086
  * if DevTools is opened in `undocked` or `detach` mode.
@@ -18471,7 +19128,8 @@ declare namespace Electron {
18471
19128
  */
18472
19129
  setUserAgent(userAgent: string): void;
18473
19130
  /**
18474
- * Sets the maximum and minimum pinch-to-zoom level.
19131
+ * Sets the maximum and minimum pinch-to-zoom level. The page keeps its normal
19132
+ * scale until the user pinches; a `minimumLevel` below 1 only allows zooming out.
18475
19133
  *
18476
19134
  * > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
18477
19135
  */
@@ -18503,20 +19161,39 @@ declare namespace Electron {
18503
19161
  * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
18504
19162
  * divided by 100, so 300% = 3.0.
18505
19163
  *
18506
- * The factor must be greater than 0.0.
19164
+ * The factor must be greater than 0.0. Values outside the range Chromium can
19165
+ * display (0.25 to 5.0) are clamped to it.
18507
19166
  */
18508
19167
  setZoomFactor(factor: number): void;
18509
19168
  /**
18510
19169
  * 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`.
19170
+ * increment above or below represents zooming 20% larger or smaller. The formula
19171
+ * for this is `scale := 1.2 ^ level`, and the level is clamped to the range
19172
+ * Chromium can display (25% to 500%, about -7.6 to 8.8).
18514
19173
  *
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.
19174
+ * > [!NOTE] The zoom policy at the Chromium level is same-origin by default,
19175
+ * meaning that the zoom level for a specific domain propagates across all
19176
+ * instances of windows with the same domain. To use per-webContents zoom instead,
19177
+ * set the zoom mode to `'isolated'` via `contents.setZoomMode('isolated')`.
18518
19178
  */
18519
19179
  setZoomLevel(level: number): void;
19180
+ /**
19181
+ * Sets the zoom mode for this web contents.
19182
+ *
19183
+ * * `default` - Zoom changes are handled automatically on a per-origin basis.
19184
+ * Other webContents navigated to the same origin will share the same zoom level.
19185
+ * * `isolated` - Zoom changes are handled automatically but on a per-webContents
19186
+ * basis. This webContents will not be affected by zoom changes in other
19187
+ * webContents, and vice versa.
19188
+ * * `manual` - Automatic zoom handling is disabled. The `zoom-changed` event will
19189
+ * still be dispatched, but the page will not actually be zoomed. The zoom level
19190
+ * can be managed manually by the application.
19191
+ * * `disabled` - All zooming in this webContents is disabled. The webContents will
19192
+ * revert to the default zoom level and all zoom changes will be ignored.
19193
+ *
19194
+ * The `isolated` and `manual` zoom modes persist across navigations.
19195
+ */
19196
+ setZoomMode(mode: 'default' | 'isolated' | 'manual' | 'disabled'): void;
18520
19197
  /**
18521
19198
  * Shows pop-up dictionary that searches the selected word on the page.
18522
19199
  *
@@ -18573,6 +19250,25 @@ declare namespace Electron {
18573
19250
  * affects the Page Visibility API.
18574
19251
  */
18575
19252
  backgroundThrottling: boolean;
19253
+ /**
19254
+ * A `boolean` property that determines whether caret browsing is enabled for this
19255
+ * page.
19256
+ *
19257
+ * When enabled, a movable cursor is placed in the page's text, allowing the user
19258
+ * to navigate and select content with the keyboard. Changes apply to the live page
19259
+ * without reloading it.
19260
+ *
19261
+ * A `<webview>` guest inherits this value from its embedder when it is created and
19262
+ * then tracks it independently, so disabling caret browsing on the embedder leaves
19263
+ * an existing guest enabled.
19264
+ *
19265
+ * While any `WebContents` in the process has caret browsing enabled, assistive
19266
+ * technology is notified process-wide that caret browsing is active, so that
19267
+ * screen readers report the caret's position as it moves. That notification is
19268
+ * only withdrawn once every `WebContents` that enabled caret browsing has either
19269
+ * disabled it or been destroyed.
19270
+ */
19271
+ caretBrowsingEnabled: boolean;
18576
19272
  /**
18577
19273
  * A `Debugger` instance for this webContents.
18578
19274
  *
@@ -18683,6 +19379,12 @@ declare namespace Electron {
18683
19379
  * respectively. The formula for this is `scale := 1.2 ^ level`.
18684
19380
  */
18685
19381
  zoomLevel: number;
19382
+ /**
19383
+ * A `string` property that determines the zoom mode for this web contents.
19384
+ *
19385
+ * See `contents.setZoomMode` for a description of the available modes.
19386
+ */
19387
+ zoomMode: string;
18686
19388
  }
18687
19389
 
18688
19390
  class WebContentsView extends View {
@@ -18955,6 +19657,11 @@ declare namespace Electron {
18955
19657
  * @experimental
18956
19658
  */
18957
19659
  collectJavaScriptCallStack(): (Promise<string>) | (Promise<void>);
19660
+ /**
19661
+ * When executed on a video media element, copies the frame at (x, y) to the
19662
+ * clipboard.
19663
+ */
19664
+ copyVideoFrameAt(x: number, y: number): void;
18958
19665
  /**
18959
19666
  * A promise that resolves with the result of the executed code or is rejected if
18960
19667
  * execution throws or results in a rejected promise.
@@ -19002,6 +19709,11 @@ declare namespace Electron {
19002
19709
  * frame has no history.
19003
19710
  */
19004
19711
  reload(): boolean;
19712
+ /**
19713
+ * When executed on a video media element, shows a save dialog and saves the frame
19714
+ * at (x, y) to disk.
19715
+ */
19716
+ saveVideoFrameAs(x: number, y: number): void;
19005
19717
  /**
19006
19718
  * Send an asynchronous message to the renderer process via `channel`, along with
19007
19719
  * arguments. Arguments will be serialized with the Structured Clone Algorithm,
@@ -19389,6 +20101,11 @@ declare namespace Electron {
19389
20101
  * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
19390
20102
  */
19391
20103
  zoomFactor?: number;
20104
+ /**
20105
+ * The initial zoom mode for the page. See `contents.setZoomMode` for available
20106
+ * modes. Default is `'default'`.
20107
+ */
20108
+ zoomMode?: string;
19392
20109
  }
19393
20110
 
19394
20111
  class WebRequest {
@@ -20382,6 +21099,22 @@ declare namespace Electron {
20382
21099
  reasons: Array<'shutdown' | 'close-app' | 'critical' | 'logoff'>;
20383
21100
  }
20384
21101
 
21102
+ interface WindowStatePersistence {
21103
+
21104
+ // Docs: https://electronjs.org/docs/api/structures/window-state-persistence
21105
+
21106
+ /**
21107
+ * Whether to persist window position and size across application restarts.
21108
+ * Defaults to `true` if not specified.
21109
+ */
21110
+ bounds?: boolean;
21111
+ /**
21112
+ * Whether to persist display modes (fullscreen, kiosk, maximized, etc.) across
21113
+ * application restarts. Defaults to `true` if not specified.
21114
+ */
21115
+ displayMode?: boolean;
21116
+ }
21117
+
20385
21118
  interface AboutPanelOptionsOptions {
20386
21119
  /**
20387
21120
  * The app's name.
@@ -20582,6 +21315,12 @@ declare namespace Electron {
20582
21315
  * Defaults to 1.0.
20583
21316
  */
20584
21317
  scaleFactor?: number;
21318
+ /**
21319
+ * The target color space for the output pixel data. Defaults to sRGB. Pass the
21320
+ * image's original color space to preserve the previous behavior, or another color
21321
+ * space to get pixel values in that space.
21322
+ */
21323
+ colorSpace?: ColorSpace;
20585
21324
  }
20586
21325
 
20587
21326
  interface BlinkMemoryInfo {
@@ -20704,10 +21443,10 @@ declare namespace Electron {
20704
21443
  origin?: string;
20705
21444
  /**
20706
21445
  * 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.
21446
+ * `localstorage`, `shadercache`, `serviceworkers`, `cachestorage`. If not
21447
+ * specified, clear all storage types.
20709
21448
  */
20710
- storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers' | 'cachestorage'>;
21449
+ storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'serviceworkers' | 'cachestorage'>;
20711
21450
  }
20712
21451
 
20713
21452
  interface ClientCertRequestParams {
@@ -20878,10 +21617,10 @@ declare namespace Electron {
20878
21617
 
20879
21618
  interface Config {
20880
21619
  /**
20881
- * Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The minimum SSL version to allow
20882
- * when connecting to remote servers. Defaults to `tls1`.
21620
+ * Can be `tls1.2` or `tls1.3`. The minimum SSL version to allow when connecting to
21621
+ * remote servers. Defaults to `tls1.2`.
20883
21622
  */
20884
- minVersion?: ('tls1' | 'tls1.1' | 'tls1.2' | 'tls1.3');
21623
+ minVersion?: ('tls1.2' | 'tls1.3');
20885
21624
  /**
20886
21625
  * Can be `tls1.2` or `tls1.3`. The maximum SSL version to allow when connecting to
20887
21626
  * remote servers. Defaults to `tls1.3`.
@@ -21219,18 +21958,20 @@ declare namespace Electron {
21219
21958
  uploadToServer?: boolean;
21220
21959
  /**
21221
21960
  * If true, crashes generated in the main process will not be forwarded to the
21222
- * system crash handler. Default is `false`.
21961
+ * system crash handler. This option has no effect on Windows. Default is `false`.
21962
+ *
21963
+ * @platform darwin,linux
21223
21964
  */
21224
21965
  ignoreSystemCrashHandler?: boolean;
21225
21966
  /**
21226
- * If true, limit the number of crashes uploaded to 1/hour. Default is `false`.
21227
- *
21228
- * @platform darwin,win32
21967
+ * If true, limit the number of crashes uploaded to 1/hour. Crash reports over the
21968
+ * limit are not uploaded, but are still stored on disk. Default is `false`.
21229
21969
  */
21230
21970
  rateLimit?: boolean;
21231
21971
  /**
21232
21972
  * If true, crash reports will be compressed and uploaded with `Content-Encoding:
21233
- * gzip`. Default is `true`.
21973
+ * gzip`. Setting this to `false` while `uploadToServer` is `true` is deprecated
21974
+ * and logs a deprecation warning. Default is `true`.
21234
21975
  */
21235
21976
  compress?: boolean;
21236
21977
  /**
@@ -21247,7 +21988,8 @@ declare namespace Electron {
21247
21988
  * crash reporter has been started. If a key is present in both the global extra
21248
21989
  * parameters and the process-specific extra parameters, then the global one will
21249
21990
  * take precedence. By default, `productName` and the app version are included, as
21250
- * well as the Electron version.
21991
+ * well as the Electron version. Global extra parameters are not returned by
21992
+ * `getParameters()`.
21251
21993
  */
21252
21994
  globalExtra?: Record<string, string>;
21253
21995
  }
@@ -21276,6 +22018,22 @@ declare namespace Electron {
21276
22018
  scaleFactor?: number;
21277
22019
  }
21278
22020
 
22021
+ interface CreateFromNamedImageOptions {
22022
+ hslShift?: number[];
22023
+ /**
22024
+ * Defaults to `30.0`.
22025
+ */
22026
+ pointSize?: number;
22027
+ /**
22028
+ * Defaults to `regular`.
22029
+ */
22030
+ weight?: ('ultralight') | ('thin') | ('light') | ('regular') | ('medium') | ('semibold') | ('bold') | ('heavy') | ('black');
22031
+ /**
22032
+ * Defaults to `medium`.
22033
+ */
22034
+ scale?: ('small') | ('medium') | ('large');
22035
+ }
22036
+
21279
22037
  interface CreateInterruptedDownloadOptions {
21280
22038
  /**
21281
22039
  * Absolute path of the download.
@@ -21308,17 +22066,6 @@ declare namespace Electron {
21308
22066
  startTime?: number;
21309
22067
  }
21310
22068
 
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
22069
  interface DecryptStringAsyncReturnValue {
21323
22070
  /**
21324
22071
  * whether data that has just been returned from the decrypt operation should be
@@ -21375,9 +22122,17 @@ declare namespace Electron {
21375
22122
  reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure' | 'memory-eviction');
21376
22123
  /**
21377
22124
  * The exit code for the process (e.g. status from waitpid if on POSIX, from
21378
- * GetExitCodeProcess on Windows).
22125
+ * GetExitCodeProcess on Windows), unless `reason` is `launch-failed`, in which
22126
+ * case `exitCode` will be a platform-specific launch failure error code.
21379
22127
  */
21380
22128
  exitCode: number;
22129
+ /**
22130
+ * The Windows system error code (`GetLastError()`) of the failed launch. Only set
22131
+ * when `reason` is `launch-failed`.
22132
+ *
22133
+ * @platform win32
22134
+ */
22135
+ systemErrorCode?: number;
21381
22136
  /**
21382
22137
  * The non-localized name of the process.
21383
22138
  */
@@ -21762,9 +22517,11 @@ declare namespace Electron {
21762
22517
  * With this flag, all HTTP 401 and 407 network requests created via the net module
21763
22518
  * will allow responding to them via the `login` event on the `UtilityProcess`
21764
22519
  * 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`.
22520
+ * process when using the default system network context. This flag also routes
22521
+ * client-certificate selection to the `app#select-client-certificate` event in the
22522
+ * main process; without it, `net` requests from the utility process proceed
22523
+ * without a client certificate. Without this flag, auth challenges are handled by
22524
+ * the default `login` event on the `ClientRequest` object. Default is `false`.
21768
22525
  */
21769
22526
  respondToAuthRequestsFromMainProcess?: boolean;
21770
22527
  }
@@ -22083,39 +22840,12 @@ declare namespace Electron {
22083
22840
  * `true` if the app is set to open at login.
22084
22841
  */
22085
22842
  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
22843
  /**
22095
22844
  * `true` if the app was opened at login automatically.
22096
22845
  *
22097
22846
  * @platform darwin
22098
22847
  */
22099
22848
  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
22849
  /**
22120
22850
  * can be `not-registered`, `enabled`, `requires-approval`, or `not-found`.
22121
22851
  *
@@ -22137,15 +22867,14 @@ declare namespace Electron {
22137
22867
  interface LoginItemSettingsOptions {
22138
22868
  /**
22139
22869
  * 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.
22870
+ * Defaults to `mainAppService`. See app.setLoginItemSettings for more information
22871
+ * about each type.
22142
22872
  *
22143
22873
  * @platform darwin
22144
22874
  */
22145
22875
  type?: ('mainAppService' | 'agentService' | 'daemonService' | 'loginItemService');
22146
22876
  /**
22147
- * The name of the service. Required if `type` is non-default. Only available on
22148
- * macOS 13 and up.
22877
+ * The name of the service. Required if `type` is non-default.
22149
22878
  *
22150
22879
  * @platform darwin
22151
22880
  */
@@ -22164,6 +22893,20 @@ declare namespace Electron {
22164
22893
  args?: string[];
22165
22894
  }
22166
22895
 
22896
+ interface Match {
22897
+ /**
22898
+ * Host name to match, for standard schemes. It is compared with the URL's host as
22899
+ * a whole, case-insensitively; there is no wildcard or subdomain matching. Omit to
22900
+ * match any host.
22901
+ */
22902
+ host?: string;
22903
+ /**
22904
+ * Path prefix to match, starting with `/` and written as it appears in a URL
22905
+ * (percent-encoded). Defaults to `/`.
22906
+ */
22907
+ path?: string;
22908
+ }
22909
+
22167
22910
  interface MenuItemConstructorOptions {
22168
22911
  /**
22169
22912
  * Will be called with `click(menuItem, window, event)` when the menu item is
@@ -22186,6 +22929,7 @@ declare namespace Electron {
22186
22929
  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
22930
  type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio' | 'header' | 'palette');
22188
22931
  label?: string;
22932
+ accessibilityLabel?: string;
22189
22933
  /**
22190
22934
  * Available in macOS >= 14.4
22191
22935
  *
@@ -22270,6 +23014,14 @@ declare namespace Electron {
22270
23014
  * containing group after the containing group of the item with the specified id.
22271
23015
  */
22272
23016
  afterGroupContaining?: string[];
23017
+ /**
23018
+ * A badge shown alongside the label, either a system-styled count (`alerts`,
23019
+ * `updates`, `new-items`) or a custom string. Only available on macOS 14 and up.
23020
+ * Not displayed in Dock menus.
23021
+ *
23022
+ * @platform darwin
23023
+ */
23024
+ badge?: MenuItemBadge;
22273
23025
  }
22274
23026
 
22275
23027
  interface MessageBoxOptions {
@@ -22596,8 +23348,6 @@ declare namespace Electron {
22596
23348
  /**
22597
23349
  * Actions to add to the notification. Please read the available actions and
22598
23350
  * limitations in the `NotificationAction` documentation.
22599
- *
22600
- * @platform darwin,win32
22601
23351
  */
22602
23352
  actions?: NotificationAction[];
22603
23353
  /**
@@ -22640,7 +23390,7 @@ declare namespace Electron {
22640
23390
  *
22641
23391
  * @experimental
22642
23392
  */
22643
- sharedTexturePixelFormat?: ('argb' | 'rgbaf16');
23393
+ sharedTexturePixelFormat?: ('argb' | 'rgbaf16' | 'nv12');
22644
23394
  /**
22645
23395
  * The device scale factor of the offscreen rendering output. If not set, will use
22646
23396
  * `1` as default.
@@ -22661,6 +23411,12 @@ declare namespace Electron {
22661
23411
  * or been destroyed.
22662
23412
  */
22663
23413
  frame?: (WebFrameMain) | (null);
23414
+ /**
23415
+ * The origin that issued the request (for example `https://example.com`, or `null`
23416
+ * for an opaque origin). Kept from the original request across redirects; absent
23417
+ * for requests the browser started itself.
23418
+ */
23419
+ initiatorOrigin?: string;
22664
23420
  /**
22665
23421
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22666
23422
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22690,6 +23446,12 @@ declare namespace Electron {
22690
23446
  * or been destroyed.
22691
23447
  */
22692
23448
  frame?: (WebFrameMain) | (null);
23449
+ /**
23450
+ * The origin that issued the request (for example `https://example.com`, or `null`
23451
+ * for an opaque origin). Kept from the original request across redirects; absent
23452
+ * for requests the browser started itself.
23453
+ */
23454
+ initiatorOrigin?: string;
22693
23455
  /**
22694
23456
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22695
23457
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22711,6 +23473,12 @@ declare namespace Electron {
22711
23473
  * or been destroyed.
22712
23474
  */
22713
23475
  frame?: (WebFrameMain) | (null);
23476
+ /**
23477
+ * The origin that issued the request (for example `https://example.com`, or `null`
23478
+ * for an opaque origin). Kept from the original request across redirects; absent
23479
+ * for requests the browser started itself.
23480
+ */
23481
+ initiatorOrigin?: string;
22714
23482
  /**
22715
23483
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22716
23484
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22733,6 +23501,12 @@ declare namespace Electron {
22733
23501
  * or been destroyed.
22734
23502
  */
22735
23503
  frame?: (WebFrameMain) | (null);
23504
+ /**
23505
+ * The origin that issued the request (for example `https://example.com`, or `null`
23506
+ * for an opaque origin). Kept from the original request across redirects; absent
23507
+ * for requests the browser started itself.
23508
+ */
23509
+ initiatorOrigin?: string;
22736
23510
  /**
22737
23511
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22738
23512
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22758,6 +23532,12 @@ declare namespace Electron {
22758
23532
  * or been destroyed.
22759
23533
  */
22760
23534
  frame?: (WebFrameMain) | (null);
23535
+ /**
23536
+ * The origin that issued the request (for example `https://example.com`, or `null`
23537
+ * for an opaque origin). Kept from the original request across redirects; absent
23538
+ * for requests the browser started itself.
23539
+ */
23540
+ initiatorOrigin?: string;
22761
23541
  /**
22762
23542
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22763
23543
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22783,6 +23563,12 @@ declare namespace Electron {
22783
23563
  * or been destroyed.
22784
23564
  */
22785
23565
  frame?: (WebFrameMain) | (null);
23566
+ /**
23567
+ * The origin that issued the request (for example `https://example.com`, or `null`
23568
+ * for an opaque origin). Kept from the original request across redirects; absent
23569
+ * for requests the browser started itself.
23570
+ */
23571
+ initiatorOrigin?: string;
22786
23572
  /**
22787
23573
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22788
23574
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22806,6 +23592,12 @@ declare namespace Electron {
22806
23592
  * or been destroyed.
22807
23593
  */
22808
23594
  frame?: (WebFrameMain) | (null);
23595
+ /**
23596
+ * The origin that issued the request (for example `https://example.com`, or `null`
23597
+ * for an opaque origin). Kept from the original request across redirects; absent
23598
+ * for requests the browser started itself.
23599
+ */
23600
+ initiatorOrigin?: string;
22809
23601
  /**
22810
23602
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22811
23603
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22833,6 +23625,12 @@ declare namespace Electron {
22833
23625
  * or been destroyed.
22834
23626
  */
22835
23627
  frame?: (WebFrameMain) | (null);
23628
+ /**
23629
+ * The origin that issued the request (for example `https://example.com`, or `null`
23630
+ * for an opaque origin). Kept from the original request across redirects; absent
23631
+ * for requests the browser started itself.
23632
+ */
23633
+ initiatorOrigin?: string;
22836
23634
  /**
22837
23635
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22838
23636
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22863,6 +23661,11 @@ declare namespace Electron {
22863
23661
 
22864
23662
  interface OpenDialogOptions {
22865
23663
  title?: string;
23664
+ /**
23665
+ * Absolute directory path, absolute file path, or file name to use by default. If
23666
+ * not provided, the dialog will default to the user's Downloads folder, or their
23667
+ * home directory if Downloads doesn't exist.
23668
+ */
22866
23669
  defaultPath?: string;
22867
23670
  /**
22868
23671
  * Custom label for the confirmation button, when left empty the default label will
@@ -22911,6 +23714,11 @@ declare namespace Electron {
22911
23714
 
22912
23715
  interface OpenDialogSyncOptions {
22913
23716
  title?: string;
23717
+ /**
23718
+ * Absolute directory path, absolute file path, or file name to use by default. If
23719
+ * not provided, the dialog will default to the user's Downloads folder, or their
23720
+ * home directory if Downloads doesn't exist.
23721
+ */
22914
23722
  defaultPath?: string;
22915
23723
  /**
22916
23724
  * Custom label for the confirmation button, when left empty the default label will
@@ -23210,11 +24018,6 @@ declare namespace Electron {
23210
24018
  username?: string;
23211
24019
  }
23212
24020
 
23213
- interface ReadBookmark {
23214
- title: string;
23215
- url: string;
23216
- }
23217
-
23218
24021
  interface ReceivedSharedTextureData {
23219
24022
  /**
23220
24023
  * The imported shared texture.
@@ -23365,7 +24168,9 @@ declare namespace Electron {
23365
24168
  */
23366
24169
  title?: string;
23367
24170
  /**
23368
- * Absolute directory path, absolute file path, or file name to use by default.
24171
+ * Absolute directory path, absolute file path, or file name to use by default. If
24172
+ * not provided, the dialog will default to the user's Downloads folder, or their
24173
+ * home directory if Downloads doesn't exist.
23369
24174
  */
23370
24175
  defaultPath?: string;
23371
24176
  /**
@@ -23428,7 +24233,9 @@ declare namespace Electron {
23428
24233
  */
23429
24234
  title?: string;
23430
24235
  /**
23431
- * Absolute directory path, absolute file path, or file name to use by default.
24236
+ * Absolute directory path, absolute file path, or file name to use by default. If
24237
+ * not provided, the dialog will default to the user's Downloads folder, or their
24238
+ * home directory if Downloads doesn't exist.
23432
24239
  */
23433
24240
  defaultPath?: string;
23434
24241
  /**
@@ -23543,26 +24350,13 @@ declare namespace Electron {
23543
24350
  */
23544
24351
  openAtLogin?: boolean;
23545
24352
  /**
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.
24353
+ * The type of service to add as a login item. Defaults to `mainAppService`.
23559
24354
  *
23560
24355
  * @platform darwin
23561
24356
  */
23562
24357
  type?: ('mainAppService' | 'agentService' | 'daemonService' | 'loginItemService');
23563
24358
  /**
23564
- * The name of the service. Required if `type` is non-default. Only available on
23565
- * macOS 13 and up.
24359
+ * The name of the service. Required if `type` is non-default.
23566
24360
  *
23567
24361
  * @platform darwin
23568
24362
  */
@@ -23610,6 +24404,30 @@ declare namespace Electron {
23610
24404
  topFrameSite: string;
23611
24405
  }
23612
24406
 
24407
+ interface Source {
24408
+ /**
24409
+ * Must be `directory`.
24410
+ */
24411
+ type: string;
24412
+ /**
24413
+ * Absolute path of the directory. The part of the URL's path after `match.path` is
24414
+ * resolved inside it; paths that would leave it are not served. May point into an
24415
+ * `asar` archive.
24416
+ */
24417
+ root: string;
24418
+ /**
24419
+ * File served for a URL whose path ends in `/`. Defaults to `index.html`; an empty
24420
+ * string disables it.
24421
+ */
24422
+ index?: string;
24423
+ /**
24424
+ * Response headers added to every file served by this route. Headers computed by
24425
+ * the file loader, including `Content-Type`, `Content-Length`, and
24426
+ * `Content-Range`, will override these supplied values.
24427
+ */
24428
+ headers?: Record<string, string>;
24429
+ }
24430
+
23613
24431
  interface SourcesOptions {
23614
24432
  /**
23615
24433
  * An array of strings that lists the types of desktop sources to be captured,
@@ -23631,6 +24449,16 @@ declare namespace Electron {
23631
24449
  fetchWindowIcons?: boolean;
23632
24450
  }
23633
24451
 
24452
+ interface StartAppShimServerOptions {
24453
+ /**
24454
+ * A name for this server, which lets several running copies of your app each have
24455
+ * their own. It can only contain letters, digits, `.`, `-` and `_`, and must match
24456
+ * the `ElectronAppShimServerName` of the shims that connect to it. Default is
24457
+ * `appshim`.
24458
+ */
24459
+ name?: string;
24460
+ }
24461
+
23634
24462
  interface StartLoggingOptions {
23635
24463
  /**
23636
24464
  * What kinds of data should be captured. By default, only metadata about requests
@@ -23811,6 +24639,12 @@ declare namespace Electron {
23811
24639
  * Defaults to 1.0.
23812
24640
  */
23813
24641
  scaleFactor?: number;
24642
+ /**
24643
+ * The target color space for the output pixel data. Defaults to sRGB. Pass the
24644
+ * image's original color space to preserve the previous behavior, or another color
24645
+ * space to get pixel values in that space.
24646
+ */
24647
+ colorSpace?: ColorSpace;
23814
24648
  }
23815
24649
 
23816
24650
  interface ToDataURLOptions {
@@ -24147,10 +24981,11 @@ declare namespace Electron {
24147
24981
  */
24148
24982
  frame: (WebFrameMain) | (null);
24149
24983
  /**
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.
24984
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
24985
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
24986
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
24987
+ * not initiated by a frame. This can also be null if the initiating frame was
24988
+ * deleted before the event was emitted.
24154
24989
  */
24155
24990
  initiator?: (WebFrameMain) | (null);
24156
24991
  }
@@ -24176,10 +25011,11 @@ declare namespace Electron {
24176
25011
  */
24177
25012
  frame: (WebFrameMain) | (null);
24178
25013
  /**
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.
25014
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
25015
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
25016
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
25017
+ * not initiated by a frame. This can also be null if the initiating frame was
25018
+ * deleted before the event was emitted.
24183
25019
  */
24184
25020
  initiator?: (WebFrameMain) | (null);
24185
25021
  }
@@ -24301,10 +25137,11 @@ declare namespace Electron {
24301
25137
  */
24302
25138
  frame: (WebFrameMain) | (null);
24303
25139
  /**
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.
25140
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
25141
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
25142
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
25143
+ * not initiated by a frame. This can also be null if the initiating frame was
25144
+ * deleted before the event was emitted.
24308
25145
  */
24309
25146
  initiator?: (WebFrameMain) | (null);
24310
25147
  }
@@ -24330,10 +25167,11 @@ declare namespace Electron {
24330
25167
  */
24331
25168
  frame: (WebFrameMain) | (null);
24332
25169
  /**
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.
25170
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
25171
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
25172
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
25173
+ * not initiated by a frame. This can also be null if the initiating frame was
25174
+ * deleted before the event was emitted.
24337
25175
  */
24338
25176
  initiator?: (WebFrameMain) | (null);
24339
25177
  }
@@ -24359,10 +25197,11 @@ declare namespace Electron {
24359
25197
  */
24360
25198
  frame: (WebFrameMain) | (null);
24361
25199
  /**
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.
25200
+ * The frame which initiated the navigation. This can be a parent frame (e.g. via
25201
+ * `window.open` with a frame's name), a child frame (e.g. an unsandboxed iframe
25202
+ * navigating its parent via `<a target="_top">`), or null if the navigation was
25203
+ * not initiated by a frame. This can also be null if the initiating frame was
25204
+ * deleted before the event was emitted.
24366
25205
  */
24367
25206
  initiator?: (WebFrameMain) | (null);
24368
25207
  }
@@ -24935,8 +25774,6 @@ declare namespace Electron {
24935
25774
 
24936
25775
  namespace Common {
24937
25776
  type Event<Params extends object = {}> = Electron.Event<Params>;
24938
- const clipboard: Clipboard;
24939
- type Clipboard = Electron.Clipboard;
24940
25777
  const crashReporter: CrashReporter;
24941
25778
  type CrashReporter = Electron.CrashReporter;
24942
25779
  const nativeImage: typeof NativeImage;
@@ -24984,8 +25821,8 @@ declare namespace Electron {
24984
25821
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
24985
25822
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
24986
25823
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
25824
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
24987
25825
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
24988
- type Data = Electron.Data;
24989
25826
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
24990
25827
  type DefaultFontFamily = Electron.DefaultFontFamily;
24991
25828
  type Details = Electron.Details;
@@ -25038,6 +25875,7 @@ declare namespace Electron {
25038
25875
  type LoadURLOptions = Electron.LoadURLOptions;
25039
25876
  type LoginItemSettings = Electron.LoginItemSettings;
25040
25877
  type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
25878
+ type Match = Electron.Match;
25041
25879
  type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
25042
25880
  type MessageBoxOptions = Electron.MessageBoxOptions;
25043
25881
  type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
@@ -25079,7 +25917,6 @@ declare namespace Electron {
25079
25917
  type ProgressBarOptions = Electron.ProgressBarOptions;
25080
25918
  type Provider = Electron.Provider;
25081
25919
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
25082
- type ReadBookmark = Electron.ReadBookmark;
25083
25920
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
25084
25921
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
25085
25922
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -25102,7 +25939,9 @@ declare namespace Electron {
25102
25939
  type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
25103
25940
  type Settings = Electron.Settings;
25104
25941
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
25942
+ type Source = Electron.Source;
25105
25943
  type SourcesOptions = Electron.SourcesOptions;
25944
+ type StartAppShimServerOptions = Electron.StartAppShimServerOptions;
25106
25945
  type StartLoggingOptions = Electron.StartLoggingOptions;
25107
25946
  type StartTask = Electron.StartTask;
25108
25947
  type Streams = Electron.Streams;
@@ -25174,6 +26013,7 @@ declare namespace Electron {
25174
26013
  type BluetoothDevice = Electron.BluetoothDevice;
25175
26014
  type Certificate = Electron.Certificate;
25176
26015
  type CertificatePrincipal = Electron.CertificatePrincipal;
26016
+ type ClipboardBookmark = Electron.ClipboardBookmark;
25177
26017
  type ColorSpace = Electron.ColorSpace;
25178
26018
  type Cookie = Electron.Cookie;
25179
26019
  type CPUUsage = Electron.CPUUsage;
@@ -25202,6 +26042,7 @@ declare namespace Electron {
25202
26042
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
25203
26043
  type MemoryInfo = Electron.MemoryInfo;
25204
26044
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
26045
+ type MenuItemBadge = Electron.MenuItemBadge;
25205
26046
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
25206
26047
  type MouseInputEvent = Electron.MouseInputEvent;
25207
26048
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -25227,6 +26068,8 @@ declare namespace Electron {
25227
26068
  type ProtocolRequest = Electron.ProtocolRequest;
25228
26069
  type ProtocolResponse = Electron.ProtocolResponse;
25229
26070
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
26071
+ type ProtocolRoute = Electron.ProtocolRoute;
26072
+ type ProtocolSource = Electron.ProtocolSource;
25230
26073
  type ProxyConfig = Electron.ProxyConfig;
25231
26074
  type Rectangle = Electron.Rectangle;
25232
26075
  type Referrer = Electron.Referrer;
@@ -25267,18 +26110,23 @@ declare namespace Electron {
25267
26110
  type WebSource = Electron.WebSource;
25268
26111
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
25269
26112
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26113
+ type WindowStatePersistence = Electron.WindowStatePersistence;
25270
26114
  }
25271
26115
 
25272
26116
  namespace Main {
25273
26117
  type Event<Params extends object = {}> = Electron.Event<Params>;
25274
26118
  const app: App;
25275
26119
  type App = Electron.App;
26120
+ type AppShimHost = Electron.AppShimHost;
25276
26121
  const autoUpdater: AutoUpdater;
25277
26122
  type AutoUpdater = Electron.AutoUpdater;
25278
26123
  class BaseWindow extends Electron.BaseWindow {}
25279
26124
  class BrowserView extends Electron.BrowserView {}
25280
26125
  class BrowserWindow extends Electron.BrowserWindow {}
25281
26126
  type ClientRequest = Electron.ClientRequest;
26127
+ const clipboard: Clipboard;
26128
+ type Clipboard = Electron.Clipboard;
26129
+ class ClipboardItem extends Electron.ClipboardItem {}
25282
26130
  type CommandLine = Electron.CommandLine;
25283
26131
  const contentTracing: ContentTracing;
25284
26132
  type ContentTracing = Electron.ContentTracing;
@@ -25392,8 +26240,8 @@ declare namespace Electron {
25392
26240
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
25393
26241
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
25394
26242
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
26243
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
25395
26244
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
25396
- type Data = Electron.Data;
25397
26245
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
25398
26246
  type DefaultFontFamily = Electron.DefaultFontFamily;
25399
26247
  type Details = Electron.Details;
@@ -25446,6 +26294,7 @@ declare namespace Electron {
25446
26294
  type LoadURLOptions = Electron.LoadURLOptions;
25447
26295
  type LoginItemSettings = Electron.LoginItemSettings;
25448
26296
  type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
26297
+ type Match = Electron.Match;
25449
26298
  type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
25450
26299
  type MessageBoxOptions = Electron.MessageBoxOptions;
25451
26300
  type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
@@ -25487,7 +26336,6 @@ declare namespace Electron {
25487
26336
  type ProgressBarOptions = Electron.ProgressBarOptions;
25488
26337
  type Provider = Electron.Provider;
25489
26338
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
25490
- type ReadBookmark = Electron.ReadBookmark;
25491
26339
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
25492
26340
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
25493
26341
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -25510,7 +26358,9 @@ declare namespace Electron {
25510
26358
  type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
25511
26359
  type Settings = Electron.Settings;
25512
26360
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
26361
+ type Source = Electron.Source;
25513
26362
  type SourcesOptions = Electron.SourcesOptions;
26363
+ type StartAppShimServerOptions = Electron.StartAppShimServerOptions;
25514
26364
  type StartLoggingOptions = Electron.StartLoggingOptions;
25515
26365
  type StartTask = Electron.StartTask;
25516
26366
  type Streams = Electron.Streams;
@@ -25582,6 +26432,7 @@ declare namespace Electron {
25582
26432
  type BluetoothDevice = Electron.BluetoothDevice;
25583
26433
  type Certificate = Electron.Certificate;
25584
26434
  type CertificatePrincipal = Electron.CertificatePrincipal;
26435
+ type ClipboardBookmark = Electron.ClipboardBookmark;
25585
26436
  type ColorSpace = Electron.ColorSpace;
25586
26437
  type Cookie = Electron.Cookie;
25587
26438
  type CPUUsage = Electron.CPUUsage;
@@ -25610,6 +26461,7 @@ declare namespace Electron {
25610
26461
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
25611
26462
  type MemoryInfo = Electron.MemoryInfo;
25612
26463
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
26464
+ type MenuItemBadge = Electron.MenuItemBadge;
25613
26465
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
25614
26466
  type MouseInputEvent = Electron.MouseInputEvent;
25615
26467
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -25635,6 +26487,8 @@ declare namespace Electron {
25635
26487
  type ProtocolRequest = Electron.ProtocolRequest;
25636
26488
  type ProtocolResponse = Electron.ProtocolResponse;
25637
26489
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
26490
+ type ProtocolRoute = Electron.ProtocolRoute;
26491
+ type ProtocolSource = Electron.ProtocolSource;
25638
26492
  type ProxyConfig = Electron.ProxyConfig;
25639
26493
  type Rectangle = Electron.Rectangle;
25640
26494
  type Referrer = Electron.Referrer;
@@ -25675,6 +26529,7 @@ declare namespace Electron {
25675
26529
  type WebSource = Electron.WebSource;
25676
26530
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
25677
26531
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26532
+ type WindowStatePersistence = Electron.WindowStatePersistence;
25678
26533
  }
25679
26534
 
25680
26535
  namespace Renderer {
@@ -25727,8 +26582,8 @@ declare namespace Electron {
25727
26582
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
25728
26583
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
25729
26584
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
26585
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
25730
26586
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
25731
- type Data = Electron.Data;
25732
26587
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
25733
26588
  type DefaultFontFamily = Electron.DefaultFontFamily;
25734
26589
  type Details = Electron.Details;
@@ -25781,6 +26636,7 @@ declare namespace Electron {
25781
26636
  type LoadURLOptions = Electron.LoadURLOptions;
25782
26637
  type LoginItemSettings = Electron.LoginItemSettings;
25783
26638
  type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
26639
+ type Match = Electron.Match;
25784
26640
  type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
25785
26641
  type MessageBoxOptions = Electron.MessageBoxOptions;
25786
26642
  type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
@@ -25822,7 +26678,6 @@ declare namespace Electron {
25822
26678
  type ProgressBarOptions = Electron.ProgressBarOptions;
25823
26679
  type Provider = Electron.Provider;
25824
26680
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
25825
- type ReadBookmark = Electron.ReadBookmark;
25826
26681
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
25827
26682
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
25828
26683
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -25845,7 +26700,9 @@ declare namespace Electron {
25845
26700
  type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
25846
26701
  type Settings = Electron.Settings;
25847
26702
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
26703
+ type Source = Electron.Source;
25848
26704
  type SourcesOptions = Electron.SourcesOptions;
26705
+ type StartAppShimServerOptions = Electron.StartAppShimServerOptions;
25849
26706
  type StartLoggingOptions = Electron.StartLoggingOptions;
25850
26707
  type StartTask = Electron.StartTask;
25851
26708
  type Streams = Electron.Streams;
@@ -25917,6 +26774,7 @@ declare namespace Electron {
25917
26774
  type BluetoothDevice = Electron.BluetoothDevice;
25918
26775
  type Certificate = Electron.Certificate;
25919
26776
  type CertificatePrincipal = Electron.CertificatePrincipal;
26777
+ type ClipboardBookmark = Electron.ClipboardBookmark;
25920
26778
  type ColorSpace = Electron.ColorSpace;
25921
26779
  type Cookie = Electron.Cookie;
25922
26780
  type CPUUsage = Electron.CPUUsage;
@@ -25945,6 +26803,7 @@ declare namespace Electron {
25945
26803
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
25946
26804
  type MemoryInfo = Electron.MemoryInfo;
25947
26805
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
26806
+ type MenuItemBadge = Electron.MenuItemBadge;
25948
26807
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
25949
26808
  type MouseInputEvent = Electron.MouseInputEvent;
25950
26809
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -25970,6 +26829,8 @@ declare namespace Electron {
25970
26829
  type ProtocolRequest = Electron.ProtocolRequest;
25971
26830
  type ProtocolResponse = Electron.ProtocolResponse;
25972
26831
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
26832
+ type ProtocolRoute = Electron.ProtocolRoute;
26833
+ type ProtocolSource = Electron.ProtocolSource;
25973
26834
  type ProxyConfig = Electron.ProxyConfig;
25974
26835
  type Rectangle = Electron.Rectangle;
25975
26836
  type Referrer = Electron.Referrer;
@@ -26010,6 +26871,7 @@ declare namespace Electron {
26010
26871
  type WebSource = Electron.WebSource;
26011
26872
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26012
26873
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26874
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26013
26875
  }
26014
26876
 
26015
26877
  namespace Utility {
@@ -26061,8 +26923,8 @@ declare namespace Electron {
26061
26923
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
26062
26924
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
26063
26925
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
26926
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
26064
26927
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
26065
- type Data = Electron.Data;
26066
26928
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
26067
26929
  type DefaultFontFamily = Electron.DefaultFontFamily;
26068
26930
  type Details = Electron.Details;
@@ -26115,6 +26977,7 @@ declare namespace Electron {
26115
26977
  type LoadURLOptions = Electron.LoadURLOptions;
26116
26978
  type LoginItemSettings = Electron.LoginItemSettings;
26117
26979
  type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
26980
+ type Match = Electron.Match;
26118
26981
  type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
26119
26982
  type MessageBoxOptions = Electron.MessageBoxOptions;
26120
26983
  type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
@@ -26156,7 +27019,6 @@ declare namespace Electron {
26156
27019
  type ProgressBarOptions = Electron.ProgressBarOptions;
26157
27020
  type Provider = Electron.Provider;
26158
27021
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
26159
- type ReadBookmark = Electron.ReadBookmark;
26160
27022
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
26161
27023
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
26162
27024
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -26179,7 +27041,9 @@ declare namespace Electron {
26179
27041
  type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
26180
27042
  type Settings = Electron.Settings;
26181
27043
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
27044
+ type Source = Electron.Source;
26182
27045
  type SourcesOptions = Electron.SourcesOptions;
27046
+ type StartAppShimServerOptions = Electron.StartAppShimServerOptions;
26183
27047
  type StartLoggingOptions = Electron.StartLoggingOptions;
26184
27048
  type StartTask = Electron.StartTask;
26185
27049
  type Streams = Electron.Streams;
@@ -26251,6 +27115,7 @@ declare namespace Electron {
26251
27115
  type BluetoothDevice = Electron.BluetoothDevice;
26252
27116
  type Certificate = Electron.Certificate;
26253
27117
  type CertificatePrincipal = Electron.CertificatePrincipal;
27118
+ type ClipboardBookmark = Electron.ClipboardBookmark;
26254
27119
  type ColorSpace = Electron.ColorSpace;
26255
27120
  type Cookie = Electron.Cookie;
26256
27121
  type CPUUsage = Electron.CPUUsage;
@@ -26279,6 +27144,7 @@ declare namespace Electron {
26279
27144
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
26280
27145
  type MemoryInfo = Electron.MemoryInfo;
26281
27146
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
27147
+ type MenuItemBadge = Electron.MenuItemBadge;
26282
27148
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
26283
27149
  type MouseInputEvent = Electron.MouseInputEvent;
26284
27150
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -26304,6 +27170,8 @@ declare namespace Electron {
26304
27170
  type ProtocolRequest = Electron.ProtocolRequest;
26305
27171
  type ProtocolResponse = Electron.ProtocolResponse;
26306
27172
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
27173
+ type ProtocolRoute = Electron.ProtocolRoute;
27174
+ type ProtocolSource = Electron.ProtocolSource;
26307
27175
  type ProxyConfig = Electron.ProxyConfig;
26308
27176
  type Rectangle = Electron.Rectangle;
26309
27177
  type Referrer = Electron.Referrer;
@@ -26344,12 +27212,14 @@ declare namespace Electron {
26344
27212
  type WebSource = Electron.WebSource;
26345
27213
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26346
27214
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
27215
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26347
27216
  }
26348
27217
 
26349
27218
  namespace CrossProcessExports {
26350
27219
  type Event<Params extends object = {}> = Electron.Event<Params>;
26351
27220
  const app: App;
26352
27221
  type App = Electron.App;
27222
+ type AppShimHost = Electron.AppShimHost;
26353
27223
  const autoUpdater: AutoUpdater;
26354
27224
  type AutoUpdater = Electron.AutoUpdater;
26355
27225
  class BaseWindow extends Electron.BaseWindow {}
@@ -26358,6 +27228,7 @@ declare namespace Electron {
26358
27228
  type ClientRequest = Electron.ClientRequest;
26359
27229
  const clipboard: Clipboard;
26360
27230
  type Clipboard = Electron.Clipboard;
27231
+ class ClipboardItem extends Electron.ClipboardItem {}
26361
27232
  type CommandLine = Electron.CommandLine;
26362
27233
  const contentTracing: ContentTracing;
26363
27234
  type ContentTracing = Electron.ContentTracing;
@@ -26490,8 +27361,8 @@ declare namespace Electron {
26490
27361
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
26491
27362
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
26492
27363
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
27364
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
26493
27365
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
26494
- type Data = Electron.Data;
26495
27366
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
26496
27367
  type DefaultFontFamily = Electron.DefaultFontFamily;
26497
27368
  type Details = Electron.Details;
@@ -26544,6 +27415,7 @@ declare namespace Electron {
26544
27415
  type LoadURLOptions = Electron.LoadURLOptions;
26545
27416
  type LoginItemSettings = Electron.LoginItemSettings;
26546
27417
  type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
27418
+ type Match = Electron.Match;
26547
27419
  type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
26548
27420
  type MessageBoxOptions = Electron.MessageBoxOptions;
26549
27421
  type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
@@ -26585,7 +27457,6 @@ declare namespace Electron {
26585
27457
  type ProgressBarOptions = Electron.ProgressBarOptions;
26586
27458
  type Provider = Electron.Provider;
26587
27459
  type PurchaseProductOpts = Electron.PurchaseProductOpts;
26588
- type ReadBookmark = Electron.ReadBookmark;
26589
27460
  type ReceivedSharedTextureData = Electron.ReceivedSharedTextureData;
26590
27461
  type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
26591
27462
  type RelaunchOptions = Electron.RelaunchOptions;
@@ -26608,7 +27479,9 @@ declare namespace Electron {
26608
27479
  type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
26609
27480
  type Settings = Electron.Settings;
26610
27481
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
27482
+ type Source = Electron.Source;
26611
27483
  type SourcesOptions = Electron.SourcesOptions;
27484
+ type StartAppShimServerOptions = Electron.StartAppShimServerOptions;
26612
27485
  type StartLoggingOptions = Electron.StartLoggingOptions;
26613
27486
  type StartTask = Electron.StartTask;
26614
27487
  type Streams = Electron.Streams;
@@ -26680,6 +27553,7 @@ declare namespace Electron {
26680
27553
  type BluetoothDevice = Electron.BluetoothDevice;
26681
27554
  type Certificate = Electron.Certificate;
26682
27555
  type CertificatePrincipal = Electron.CertificatePrincipal;
27556
+ type ClipboardBookmark = Electron.ClipboardBookmark;
26683
27557
  type ColorSpace = Electron.ColorSpace;
26684
27558
  type Cookie = Electron.Cookie;
26685
27559
  type CPUUsage = Electron.CPUUsage;
@@ -26708,6 +27582,7 @@ declare namespace Electron {
26708
27582
  type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
26709
27583
  type MemoryInfo = Electron.MemoryInfo;
26710
27584
  type MemoryUsageDetails = Electron.MemoryUsageDetails;
27585
+ type MenuItemBadge = Electron.MenuItemBadge;
26711
27586
  type MimeTypedBuffer = Electron.MimeTypedBuffer;
26712
27587
  type MouseInputEvent = Electron.MouseInputEvent;
26713
27588
  type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
@@ -26733,6 +27608,8 @@ declare namespace Electron {
26733
27608
  type ProtocolRequest = Electron.ProtocolRequest;
26734
27609
  type ProtocolResponse = Electron.ProtocolResponse;
26735
27610
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
27611
+ type ProtocolRoute = Electron.ProtocolRoute;
27612
+ type ProtocolSource = Electron.ProtocolSource;
26736
27613
  type ProxyConfig = Electron.ProxyConfig;
26737
27614
  type Rectangle = Electron.Rectangle;
26738
27615
  type Referrer = Electron.Referrer;
@@ -26773,6 +27650,7 @@ declare namespace Electron {
26773
27650
  type WebSource = Electron.WebSource;
26774
27651
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26775
27652
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
27653
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26776
27654
  }
26777
27655
 
26778
27656
  const app: App;
@@ -26893,6 +27771,14 @@ declare namespace NodeJS {
26893
27771
  * Kilobytes.
26894
27772
  */
26895
27773
  getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
27774
+ /**
27775
+ * CPU usage of the process this is called in.
27776
+ *
27777
+ * > [!NOTE] `percentCPUUsage` and `idleWakeupsPerSecond` are averages over the
27778
+ * time since the previous call to `process.getCPUUsage()` in this process, and
27779
+ * each call starts a new measurement interval. Every caller in the process shares
27780
+ * that interval. See `CPUUsage` for details.
27781
+ */
26896
27782
  getCPUUsage(): Electron.CPUUsage;
26897
27783
  /**
26898
27784
  * The number of milliseconds since epoch, or `null` if the information is