@overwolf/ow-electron 34.5.7 → 37.2.6-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 34.5.7
1
+ // Type definitions for Electron 37.2.6
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
@@ -165,11 +165,11 @@ declare namespace Electron {
165
165
  * `event.preventDefault()` will prevent the default behavior, which is terminating
166
166
  * the application.
167
167
  *
168
- * **Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
168
+ * > [!NOTE] If application quit was initiated by `autoUpdater.quitAndInstall()`,
169
169
  * then `before-quit` is emitted _after_ emitting `close` event on all windows and
170
170
  * closing them.
171
171
  *
172
- * **Note:** On Windows, this event will not be emitted if the app is closed due to
172
+ * > [!NOTE] On Windows, this event will not be emitted if the app is closed due to
173
173
  * a shutdown/restart of the system or a user logout.
174
174
  */
175
175
  on(event: 'before-quit', listener: (event: Event) => void): this;
@@ -612,7 +612,7 @@ declare namespace Electron {
612
612
  /**
613
613
  * Emitted when the application is quitting.
614
614
  *
615
- * **Note:** On Windows, this event will not be emitted if the app is closed due to
615
+ * > [!NOTE] On Windows, this event will not be emitted if the app is closed due to
616
616
  * a shutdown/restart of the system or a user logout.
617
617
  */
618
618
  on(event: 'quit', listener: (event: Event,
@@ -633,7 +633,7 @@ declare namespace Electron {
633
633
  * this event has already fired and `app.whenReady()` to get a Promise that is
634
634
  * fulfilled when Electron is initialized.
635
635
  *
636
- * **Note**: The `ready` event is only fired after the main process has finished
636
+ * > [!NOTE] The `ready` event is only fired after the main process has finished
637
637
  * running the first tick of the event loop. If an Electron API needs to be called
638
638
  * before the `ready` event, ensure that it is called synchronously in the
639
639
  * top-level context of the main process.
@@ -690,18 +690,18 @@ declare namespace Electron {
690
690
  * `workingDirectory` is its current working directory. Usually applications
691
691
  * respond to this by making their primary window focused and non-minimized.
692
692
  *
693
- * **Note:** `argv` will not be exactly the same list of arguments as those passed
693
+ * > [!NOTE] `argv` will not be exactly the same list of arguments as those passed
694
694
  * to the second instance. The order might change and additional arguments might be
695
695
  * appended. If you need to maintain the exact same arguments, it's advised to use
696
696
  * `additionalData` instead.
697
697
  *
698
- * **Note:** If the second instance is started by a different user than the first,
698
+ * > [!NOTE] If the second instance is started by a different user than the first,
699
699
  * the `argv` array will not include the arguments.
700
700
  *
701
701
  * This event is guaranteed to be emitted after the `ready` event of `app` gets
702
702
  * emitted.
703
703
  *
704
- * **Note:** Extra command line arguments might be added by Chromium, such as
704
+ * > [!NOTE] Extra command line arguments might be added by Chromium, such as
705
705
  * `--original-process-start-time`.
706
706
  */
707
707
  on(event: 'second-instance', listener: (event: Event,
@@ -954,7 +954,7 @@ declare namespace Electron {
954
954
  * See the description of the `window-all-closed` event for the differences between
955
955
  * the `will-quit` and `window-all-closed` events.
956
956
  *
957
- * **Note:** On Windows, this event will not be emitted if the app is closed due to
957
+ * > [!NOTE] On Windows, this event will not be emitted if the app is closed due to
958
958
  * a shutdown/restart of the system or a user logout.
959
959
  */
960
960
  on(event: 'will-quit', listener: (event: Event) => void): this;
@@ -1110,7 +1110,7 @@ declare namespace Electron {
1110
1110
  /**
1111
1111
  * The Graphics Feature Status from `chrome://gpu/`.
1112
1112
  *
1113
- * **Note:** This information is only usable after the `gpu-info-update` event is
1113
+ * > [!NOTE] This information is only usable after the `gpu-info-update` event is
1114
1114
  * emitted.
1115
1115
  */
1116
1116
  getGPUFeatureStatus(): GPUFeatureStatus;
@@ -1146,12 +1146,12 @@ declare namespace Electron {
1146
1146
  * To set the locale, you'll want to use a command line switch at app startup,
1147
1147
  * which may be found here.
1148
1148
  *
1149
- * **Note:** When distributing your packaged app, you have to also ship the
1149
+ * > [!NOTE] When distributing your packaged app, you have to also ship the
1150
1150
  * `locales` folder.
1151
1151
  *
1152
- * **Note:** This API must be called after the `ready` event is emitted.
1152
+ * > [!NOTE] This API must be called after the `ready` event is emitted.
1153
1153
  *
1154
- * **Note:** To see example return values of this API compared to other locale and
1154
+ * > [!NOTE] To see example return values of this API compared to other locale and
1155
1155
  * language APIs, see `app.getPreferredSystemLanguages()`.
1156
1156
  */
1157
1157
  getLocale(): string;
@@ -1159,7 +1159,7 @@ declare namespace Electron {
1159
1159
  * User operating system's locale two-letter ISO 3166 country code. The value is
1160
1160
  * taken from native OS APIs.
1161
1161
  *
1162
- * **Note:** When unable to detect locale country code, it returns empty string.
1162
+ * > [!NOTE] When unable to detect locale country code, it returns empty string.
1163
1163
  */
1164
1164
  getLocaleCountryCode(): string;
1165
1165
  /**
@@ -1272,9 +1272,9 @@ declare namespace Electron {
1272
1272
  * rendering dates and times in a calendar app, especially when the developer wants
1273
1273
  * the format to be consistent with the OS.
1274
1274
  *
1275
- * **Note:** This API must be called after the `ready` event is emitted.
1275
+ * > [!NOTE] This API must be called after the `ready` event is emitted.
1276
1276
  *
1277
- * **Note:** To see example return values of this API compared to other locale and
1277
+ * > [!NOTE] To see example return values of this API compared to other locale and
1278
1278
  * language APIs, see `app.getPreferredSystemLanguages()`.
1279
1279
  */
1280
1280
  getSystemLocale(): string;
@@ -1326,7 +1326,7 @@ declare namespace Electron {
1326
1326
  * Whether the current executable is the default handler for a protocol (aka URI
1327
1327
  * scheme).
1328
1328
  *
1329
- * **Note:** On macOS, you can use this method to check if the app has been
1329
+ * > [!NOTE] On macOS, you can use this method to check if the app has been
1330
1330
  * registered as the default protocol handler for a protocol. You can also verify
1331
1331
  * this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
1332
1332
  * macOS machine. Please refer to Apple's documentation for details.
@@ -1499,7 +1499,7 @@ declare namespace Electron {
1499
1499
  *
1500
1500
  * This API must be called after the `ready` event is emitted.
1501
1501
  *
1502
- * **Note:** Rendering accessibility tree can significantly affect the performance
1502
+ * > [!NOTE] Rendering accessibility tree can significantly affect the performance
1503
1503
  * of your app. It should not be enabled by default.
1504
1504
  *
1505
1505
  * @platform darwin,win32
@@ -1545,13 +1545,13 @@ declare namespace Electron {
1545
1545
  * current executable. The whole link, including protocol, will be passed to your
1546
1546
  * application as a parameter.
1547
1547
  *
1548
- * **Note:** On macOS, you can only register protocols that have been added to your
1548
+ * > [!NOTE] On macOS, you can only register protocols that have been added to your
1549
1549
  * app's `info.plist`, which cannot be modified at runtime. However, you can change
1550
1550
  * the file during build time via Electron Forge, Electron Packager, or by editing
1551
1551
  * `info.plist` with a text editor. Please refer to Apple's documentation for
1552
1552
  * details.
1553
1553
  *
1554
- * **Note:** In a Windows Store environment (when packaged as an `appx`) this API
1554
+ * > [!NOTE] In a Windows Store environment (when packaged as an `appx`) this API
1555
1555
  * will return `true` for all calls but the registry key it sets won't be
1556
1556
  * accessible by other applications. In order to register your Windows Store
1557
1557
  * application as a default protocol handler you must declare the protocol in your
@@ -1569,10 +1569,10 @@ declare namespace Electron {
1569
1569
  *
1570
1570
  * On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
1571
1571
  *
1572
- * **Note:** Unity launcher requires a `.desktop` file to work. For more
1572
+ * > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
1573
1573
  * information, please read the Unity integration documentation.
1574
1574
  *
1575
- * **Note:** On macOS, you need to ensure that your application has the permission
1575
+ * > [!NOTE] On macOS, you need to ensure that your application has the permission
1576
1576
  * to display notifications for this method to work.
1577
1577
  *
1578
1578
  * @platform linux,darwin
@@ -1601,19 +1601,19 @@ declare namespace Electron {
1601
1601
  * If `categories` is `null` the previously set custom Jump List (if any) will be
1602
1602
  * replaced by the standard Jump List for the app (managed by Windows).
1603
1603
  *
1604
- * **Note:** If a `JumpListCategory` object has neither the `type` nor the `name`
1604
+ * > [!NOTE] If a `JumpListCategory` object has neither the `type` nor the `name`
1605
1605
  * property set then its `type` is assumed to be `tasks`. If the `name` property is
1606
1606
  * set but the `type` property is omitted then the `type` is assumed to be
1607
1607
  * `custom`.
1608
1608
  *
1609
- * **Note:** Users can remove items from custom categories, and Windows will not
1609
+ * > [!NOTE] Users can remove items from custom categories, and Windows will not
1610
1610
  * allow a removed item to be added back into a custom category until **after** the
1611
1611
  * next successful call to `app.setJumpList(categories)`. Any attempt to re-add a
1612
1612
  * removed item to a custom category earlier than that will result in the entire
1613
1613
  * custom category being omitted from the Jump List. The list of removed items can
1614
1614
  * be obtained using `app.getJumpListSettings()`.
1615
1615
  *
1616
- * **Note:** The maximum length of a Jump List item's `description` property is 260
1616
+ * > [!NOTE] The maximum length of a Jump List item's `description` property is 260
1617
1617
  * characters. Beyond this limit, the item will not be added to the Jump List, nor
1618
1618
  * will it be displayed.
1619
1619
  *
@@ -1626,8 +1626,9 @@ declare namespace Electron {
1626
1626
  * Set the app's login item settings.
1627
1627
  *
1628
1628
  * To work with Electron's `autoUpdater` on Windows, which uses Squirrel, you'll
1629
- * want to set the launch path to Update.exe, and pass arguments that specify your
1630
- * application name. For example:
1629
+ * want to set the launch path to your executable's name but a directory up, which
1630
+ * is a stub application automatically generated by Squirrel which will
1631
+ * automatically launch the latest version.
1631
1632
  *
1632
1633
  * For more information about setting different services as login items on macOS 13
1633
1634
  * and up, see `SMAppService`.
@@ -1638,7 +1639,7 @@ declare namespace Electron {
1638
1639
  /**
1639
1640
  * Overrides the current application's name.
1640
1641
  *
1641
- * **Note:** This function overrides the name used internally by Electron; it does
1642
+ * > [!NOTE] This function overrides the name used internally by Electron; it does
1642
1643
  * not affect the name that the OS uses.
1643
1644
  */
1644
1645
  setName(name: string): void;
@@ -1654,7 +1655,16 @@ declare namespace Electron {
1654
1655
  * `sessionData` path before the `ready` event of the `app` module is emitted.
1655
1656
  */
1656
1657
  setPath(name: string, path: string): void;
1657
- setProxy(config: ProxyConfig): void;
1658
+ /**
1659
+ * Resolves when the proxy setting process is complete.
1660
+ *
1661
+ * Sets the proxy settings for networks requests made without an associated
1662
+ * Session. Currently this will affect requests made with Net in the utility
1663
+ * process and internal requests made by the runtime (ex: geolocation queries).
1664
+ *
1665
+ * This method can only be called after app is ready.
1666
+ */
1667
+ setProxy(config: ProxyConfig): Promise<void>;
1658
1668
  /**
1659
1669
  * Set the `Secure Keyboard Entry` is enabled in your application.
1660
1670
  *
@@ -1663,7 +1673,7 @@ declare namespace Electron {
1663
1673
  *
1664
1674
  * See Apple's documentation for more details.
1665
1675
  *
1666
- * **Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it
1676
+ * > [!NOTE] Enable `Secure Keyboard Entry` only when it is needed and disable it
1667
1677
  * when it is no longer needed.
1668
1678
  *
1669
1679
  * @platform darwin
@@ -1683,7 +1693,7 @@ declare namespace Electron {
1683
1693
  *
1684
1694
  * Whether the call succeeded.
1685
1695
  *
1686
- * **Note:** If you'd like to customize the Jump List even more use
1696
+ * > [!NOTE] If you'd like to customize the Jump List even more use
1687
1697
  * `app.setJumpList(categories)` instead.
1688
1698
  *
1689
1699
  * @platform win32
@@ -1745,7 +1755,7 @@ declare namespace Electron {
1745
1755
  *
1746
1756
  * This API must be called after the `ready` event is emitted.
1747
1757
  *
1748
- * **Note:** Rendering accessibility tree can significantly affect the performance
1758
+ * > [!NOTE] Rendering accessibility tree can significantly affect the performance
1749
1759
  * of your app. It should not be enabled by default.
1750
1760
  *
1751
1761
  * @platform darwin,win32
@@ -1763,10 +1773,10 @@ declare namespace Electron {
1763
1773
  * On macOS, setting this with any nonzero integer shows on the dock icon. On
1764
1774
  * Linux, this property only works for Unity launcher.
1765
1775
  *
1766
- * **Note:** Unity launcher requires a `.desktop` file to work. For more
1776
+ * > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
1767
1777
  * information, please read the Unity integration documentation.
1768
1778
  *
1769
- * **Note:** On macOS, you need to ensure that your application has the permission
1779
+ * > [!NOTE] On macOS, you need to ensure that your application has the permission
1770
1780
  * to display notifications for this property to take effect.
1771
1781
  *
1772
1782
  * @platform linux,darwin
@@ -1779,12 +1789,13 @@ declare namespace Electron {
1779
1789
  */
1780
1790
  readonly commandLine: CommandLine;
1781
1791
  /**
1782
- * A `Dock` `| undefined` object that allows you to perform actions on your app
1783
- * icon in the user's dock on macOS.
1792
+ * A `Dock | undefined` property (`Dock` on macOS, `undefined` on all other
1793
+ * platforms) that allows you to perform actions on your app icon in the user's
1794
+ * dock.
1784
1795
  *
1785
1796
  * @platform darwin
1786
1797
  */
1787
- readonly dock: Dock;
1798
+ readonly dock: (Dock) | (undefined);
1788
1799
  /**
1789
1800
  * A `boolean` property that returns `true` if the app is packaged, `false`
1790
1801
  * otherwise. For many apps, this property can be used to distinguish development
@@ -1844,7 +1855,7 @@ declare namespace Electron {
1844
1855
  addListener(event: 'before-quit-for-update', listener: () => void): this;
1845
1856
  removeListener(event: 'before-quit-for-update', listener: () => void): this;
1846
1857
  /**
1847
- * Emitted when checking if an update has started.
1858
+ * Emitted when checking for an available update has started.
1848
1859
  */
1849
1860
  on(event: 'checking-for-update', listener: () => void): this;
1850
1861
  off(event: 'checking-for-update', listener: () => void): this;
@@ -1873,7 +1884,7 @@ declare namespace Electron {
1873
1884
  *
1874
1885
  * On Windows only `releaseName` is available.
1875
1886
  *
1876
- * **Note:** It is not strictly necessary to handle this event. A successfully
1887
+ * > [!NOTE] It is not strictly necessary to handle this event. A successfully
1877
1888
  * downloaded update will still be applied the next time the application starts.
1878
1889
  */
1879
1890
  on(event: 'update-downloaded', listener: (event: Event,
@@ -1913,7 +1924,7 @@ declare namespace Electron {
1913
1924
  * Asks the server whether there is an update. You must call `setFeedURL` before
1914
1925
  * using this API.
1915
1926
  *
1916
- * **Note:** If an update is available it will be downloaded automatically. Calling
1927
+ * > [!NOTE] If an update is available it will be downloaded automatically. Calling
1917
1928
  * `autoUpdater.checkForUpdates()` twice will download the update two times.
1918
1929
  */
1919
1930
  checkForUpdates(): void;
@@ -1929,7 +1940,7 @@ declare namespace Electron {
1929
1940
  * windows first, and automatically call `app.quit()` after all windows have been
1930
1941
  * closed.
1931
1942
  *
1932
- * **Note:** It is not strictly necessary to call this function to apply an update,
1943
+ * > [!NOTE] It is not strictly necessary to call this function to apply an update,
1933
1944
  * as a successfully downloaded update will always be applied the next time the
1934
1945
  * application starts.
1935
1946
  */
@@ -2013,11 +2024,11 @@ declare namespace Electron {
2013
2024
  * In Electron, returning any value other than `undefined` would cancel the close.
2014
2025
  * For example:
2015
2026
  *
2016
- * _**Note**: There is a subtle difference between the behaviors of
2027
+ * > [!NOTE] There is a subtle difference between the behaviors of
2017
2028
  * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
2018
2029
  * handler)`. It is recommended to always set the `event.returnValue` explicitly,
2019
2030
  * instead of only returning a value, as the former works more consistently within
2020
- * Electron._
2031
+ * Electron.
2021
2032
  */
2022
2033
  on(event: 'close', listener: (event: Event) => void): this;
2023
2034
  off(event: 'close', listener: (event: Event) => void): this;
@@ -2092,7 +2103,7 @@ declare namespace Electron {
2092
2103
  /**
2093
2104
  * Emitted once when the window is moved to a new position.
2094
2105
  *
2095
- * **Note**: On macOS this event is an alias of `move`.
2106
+ * > [!NOTE] On macOS, this event is an alias of `move`.
2096
2107
  *
2097
2108
  * @platform darwin,win32
2098
2109
  */
@@ -2135,6 +2146,32 @@ declare namespace Electron {
2135
2146
  * @platform darwin
2136
2147
  */
2137
2148
  removeListener(event: 'new-window-for-tab', listener: () => void): this;
2149
+ /**
2150
+ * Emitted when a session is about to end due to a shutdown, machine restart, or
2151
+ * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
2152
+ * though it’s generally best to respect the user’s choice to end the session.
2153
+ * However, you may choose to use it if ending the session puts the user at risk of
2154
+ * losing data.
2155
+ *
2156
+ * @platform win32
2157
+ */
2158
+ on(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
2159
+ /**
2160
+ * @platform win32
2161
+ */
2162
+ off(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
2163
+ /**
2164
+ * @platform win32
2165
+ */
2166
+ once(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
2167
+ /**
2168
+ * @platform win32
2169
+ */
2170
+ addListener(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
2171
+ /**
2172
+ * @platform win32
2173
+ */
2174
+ removeListener(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
2138
2175
  /**
2139
2176
  * Emitted after the window has been resized.
2140
2177
  */
@@ -2209,28 +2246,29 @@ declare namespace Electron {
2209
2246
  removeListener(event: 'rotate-gesture', listener: (event: Event,
2210
2247
  rotation: number) => void): this;
2211
2248
  /**
2212
- * Emitted when window session is going to end due to force shutdown or machine
2213
- * restart or session log off.
2249
+ * Emitted when a session is about to end due to a shutdown, machine restart, or
2250
+ * user log-off. Once this event fires, there is no way to prevent the session from
2251
+ * ending.
2214
2252
  *
2215
2253
  * @platform win32
2216
2254
  */
2217
- on(event: 'session-end', listener: () => void): this;
2255
+ on(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
2218
2256
  /**
2219
2257
  * @platform win32
2220
2258
  */
2221
- off(event: 'session-end', listener: () => void): this;
2259
+ off(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
2222
2260
  /**
2223
2261
  * @platform win32
2224
2262
  */
2225
- once(event: 'session-end', listener: () => void): this;
2263
+ once(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
2226
2264
  /**
2227
2265
  * @platform win32
2228
2266
  */
2229
- addListener(event: 'session-end', listener: () => void): this;
2267
+ addListener(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
2230
2268
  /**
2231
2269
  * @platform win32
2232
2270
  */
2233
- removeListener(event: 'session-end', listener: () => void): this;
2271
+ removeListener(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
2234
2272
  /**
2235
2273
  * Emitted when the window opens a sheet.
2236
2274
  *
@@ -2326,43 +2364,45 @@ declare namespace Electron {
2326
2364
  *
2327
2365
  * Calling `event.preventDefault()` will prevent the menu from being displayed.
2328
2366
  *
2329
- * @platform win32
2367
+ * To convert `point` to DIP, use `screen.screenToDipPoint(point)`.
2368
+ *
2369
+ * @platform win32,linux
2330
2370
  */
2331
2371
  on(event: 'system-context-menu', listener: (event: Event,
2332
2372
  /**
2333
- * The screen coordinates the context menu was triggered at
2373
+ * The screen coordinates where the context menu was triggered.
2334
2374
  */
2335
2375
  point: Point) => void): this;
2336
2376
  /**
2337
- * @platform win32
2377
+ * @platform win32,linux
2338
2378
  */
2339
2379
  off(event: 'system-context-menu', listener: (event: Event,
2340
2380
  /**
2341
- * The screen coordinates the context menu was triggered at
2381
+ * The screen coordinates where the context menu was triggered.
2342
2382
  */
2343
2383
  point: Point) => void): this;
2344
2384
  /**
2345
- * @platform win32
2385
+ * @platform win32,linux
2346
2386
  */
2347
2387
  once(event: 'system-context-menu', listener: (event: Event,
2348
2388
  /**
2349
- * The screen coordinates the context menu was triggered at
2389
+ * The screen coordinates where the context menu was triggered.
2350
2390
  */
2351
2391
  point: Point) => void): this;
2352
2392
  /**
2353
- * @platform win32
2393
+ * @platform win32,linux
2354
2394
  */
2355
2395
  addListener(event: 'system-context-menu', listener: (event: Event,
2356
2396
  /**
2357
- * The screen coordinates the context menu was triggered at
2397
+ * The screen coordinates where the context menu was triggered.
2358
2398
  */
2359
2399
  point: Point) => void): this;
2360
2400
  /**
2361
- * @platform win32
2401
+ * @platform win32,linux
2362
2402
  */
2363
2403
  removeListener(event: 'system-context-menu', listener: (event: Event,
2364
2404
  /**
2365
- * The screen coordinates the context menu was triggered at
2405
+ * The screen coordinates where the context menu was triggered.
2366
2406
  */
2367
2407
  point: Point) => void): this;
2368
2408
  /**
@@ -2540,14 +2580,14 @@ declare namespace Electron {
2540
2580
  *
2541
2581
  * See Setting `backgroundColor`.
2542
2582
  *
2543
- * **Note:** The alpha value is _not_ returned alongside the red, green, and blue
2583
+ * > [!NOTE] The alpha value is _not_ returned alongside the red, green, and blue
2544
2584
  * values.
2545
2585
  */
2546
2586
  getBackgroundColor(): string;
2547
2587
  /**
2548
2588
  * The `bounds` of the window as `Object`.
2549
2589
  *
2550
- * **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
2590
+ * > [!NOTE] On macOS, the y-coordinate value returned will be at minimum the Tray
2551
2591
  * height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
2552
2592
  * 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
2553
2593
  * 25, y: 38, width: 800, height: 600 }`.
@@ -2566,9 +2606,9 @@ declare namespace Electron {
2566
2606
  */
2567
2607
  getContentSize(): number[];
2568
2608
  /**
2569
- * Returns View - The content view of the window.
2609
+ * The content view of the window.
2570
2610
  */
2571
- getContentView(): void;
2611
+ getContentView(): View;
2572
2612
  /**
2573
2613
  * Contains the window's maximum width and height.
2574
2614
  */
@@ -2597,7 +2637,7 @@ declare namespace Electron {
2597
2637
  /**
2598
2638
  * Contains the window bounds of the normal state
2599
2639
  *
2600
- * **Note:** whatever the current state of the window : maximized, minimized or in
2640
+ * > [!NOTE] Whatever the current state of the window : maximized, minimized or in
2601
2641
  * fullscreen, this function always returns the position and size of the window in
2602
2642
  * normal state. In normal state, getBounds and getNormalBounds returns the same
2603
2643
  * `Rectangle`.
@@ -2629,7 +2669,7 @@ declare namespace Electron {
2629
2669
  /**
2630
2670
  * The title of the native window.
2631
2671
  *
2632
- * **Note:** The title of the web page can be different from the title of the
2672
+ * > [!NOTE] The title of the web page can be different from the title of the
2633
2673
  * native window.
2634
2674
  */
2635
2675
  getTitle(): string;
@@ -2678,6 +2718,12 @@ declare namespace Electron {
2678
2718
  * @platform darwin,win32
2679
2719
  */
2680
2720
  isClosable(): boolean;
2721
+ /**
2722
+ * whether or not content protection is currently enabled.
2723
+ *
2724
+ * @platform darwin,win32
2725
+ */
2726
+ isContentProtected(): boolean;
2681
2727
  /**
2682
2728
  * Whether the window is destroyed.
2683
2729
  */
@@ -2784,6 +2830,15 @@ declare namespace Electron {
2784
2830
  * @platform darwin
2785
2831
  */
2786
2832
  isSimpleFullScreen(): boolean;
2833
+ /**
2834
+ * whether the window is arranged via Snap.
2835
+ *
2836
+ * The window is snapped via buttons shown when the mouse is hovered over window
2837
+ * maximize button, or by dragging it to the edges of the screen.
2838
+ *
2839
+ * @platform win32
2840
+ */
2841
+ isSnapped(): boolean;
2787
2842
  /**
2788
2843
  * Whether the window is in Windows 10 tablet mode.
2789
2844
  *
@@ -2804,7 +2859,7 @@ declare namespace Electron {
2804
2859
  /**
2805
2860
  * Whether the window is visible on all workspaces.
2806
2861
  *
2807
- * **Note:** This API always returns false on Windows.
2862
+ * > [!NOTE] This API always returns false on Windows.
2808
2863
  *
2809
2864
  * @platform darwin,linux
2810
2865
  */
@@ -2888,7 +2943,7 @@ declare namespace Electron {
2888
2943
  /**
2889
2944
  * Sets the properties for the window's taskbar button.
2890
2945
  *
2891
- * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
2946
+ * > [!NOTE] `relaunchCommand` and `relaunchDisplayName` must always be set
2892
2947
  * together. If one of those properties is not set, then neither will be used.
2893
2948
  *
2894
2949
  * @platform win32
@@ -2966,7 +3021,7 @@ declare namespace Electron {
2966
3021
  *
2967
3022
  * See the Windows documentation for more details.
2968
3023
  *
2969
- * **Note:** This method is only supported on Windows 11 22H2 and up.
3024
+ * > [!NOTE] This method is only supported on Windows 11 22H2 and up.
2970
3025
  *
2971
3026
  * @platform win32
2972
3027
  */
@@ -2975,7 +3030,7 @@ declare namespace Electron {
2975
3030
  * Resizes and moves the window to the supplied bounds. Any properties that are not
2976
3031
  * supplied will default to their current values.
2977
3032
  *
2978
- * **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
3033
+ * > [!NOTE] On macOS, the y-coordinate value cannot be smaller than the Tray
2979
3034
  * height. The tray height has changed over time and depends on the operating
2980
3035
  * system, but is between 20-40px. Passing a value lower than the tray height will
2981
3036
  * result in a window that is flush to the tray.
@@ -3033,8 +3088,8 @@ declare namespace Electron {
3033
3088
  /**
3034
3089
  * Sets whether the window should be in fullscreen mode.
3035
3090
  *
3036
- * **Note:** On macOS, fullscreen transitions take place asynchronously. If further
3037
- * actions depend on the fullscreen state, use the 'enter-full-screen' or
3091
+ * > [!NOTE] On macOS, fullscreen transitions take place asynchronously. If further
3092
+ * actions depend on the fullscreen state, use the 'enter-full-screen' or >
3038
3093
  * 'leave-full-screen' events.
3039
3094
  */
3040
3095
  setFullScreen(flag: boolean): void;
@@ -3272,7 +3327,7 @@ declare namespace Electron {
3272
3327
  * `undefined` clears the touch bar. This method only has an effect if the machine
3273
3328
  * has a touch bar.
3274
3329
  *
3275
- * **Note:** The TouchBar API is currently experimental and may change or be
3330
+ * > [!NOTE] The TouchBar API is currently experimental and may change or be
3276
3331
  * removed in future Electron releases.
3277
3332
  *
3278
3333
  * @platform darwin
@@ -3288,7 +3343,7 @@ declare namespace Electron {
3288
3343
  /**
3289
3344
  * Sets whether the window should be visible on all workspaces.
3290
3345
  *
3291
- * **Note:** This API does nothing on Windows.
3346
+ * > [!NOTE] This API does nothing on Windows.
3292
3347
  *
3293
3348
  * @platform darwin,linux
3294
3349
  */
@@ -3426,7 +3481,7 @@ declare namespace Electron {
3426
3481
  /**
3427
3482
  * A `boolean` property that determines whether the menu bar should be visible.
3428
3483
  *
3429
- * **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
3484
+ * > [!NOTE] If the menu bar is auto-hide, users can still bring up the menu bar by
3430
3485
  * pressing the single `Alt` key.
3431
3486
  *
3432
3487
  * @platform win32,linux
@@ -3476,6 +3531,12 @@ declare namespace Electron {
3476
3531
  * fullscreen mode.
3477
3532
  */
3478
3533
  simpleFullScreen: boolean;
3534
+ /**
3535
+ * A `boolean` property that indicates whether the window is arranged via Snap.
3536
+ *
3537
+ * @platform win32
3538
+ */
3539
+ readonly snapped: boolean;
3479
3540
  /**
3480
3541
  * A `string` (optional) property that is equal to the `tabbingIdentifier` passed
3481
3542
  * to the `BrowserWindow` constructor or `undefined` if none was set.
@@ -3486,7 +3547,7 @@ declare namespace Electron {
3486
3547
  /**
3487
3548
  * A `string` property that determines the title of the native window.
3488
3549
  *
3489
- * **Note:** The title of the web page can be different from the title of the
3550
+ * > [!NOTE] The title of the web page can be different from the title of the
3490
3551
  * native window.
3491
3552
  */
3492
3553
  title: string;
@@ -3494,7 +3555,7 @@ declare namespace Electron {
3494
3555
  * A `boolean` property that determines whether the window is visible on all
3495
3556
  * workspaces.
3496
3557
  *
3497
- * **Note:** Always returns false on Windows.
3558
+ * > [!NOTE] Always returns false on Windows.
3498
3559
  *
3499
3560
  * @platform darwin,linux
3500
3561
  */
@@ -3505,6 +3566,14 @@ declare namespace Electron {
3505
3566
 
3506
3567
  // Docs: https://electronjs.org/docs/api/structures/base-window-options
3507
3568
 
3569
+ /**
3570
+ * The accent color for the window. By default, follows user preference in System
3571
+ * Settings. Set to `false` to explicitly disable, or set the color in Hex, RGB,
3572
+ * RGBA, HSL, HSLA or named CSS color format. Alpha values will be ignored.
3573
+ *
3574
+ * @platform win32
3575
+ */
3576
+ accentColor?: (boolean) | (string);
3508
3577
  /**
3509
3578
  * Whether clicking an inactive window will also click through to the web contents.
3510
3579
  * Default is `false` on macOS. This option is not configurable on other platforms.
@@ -3844,7 +3913,7 @@ declare namespace Electron {
3844
3913
  * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
3845
3914
  * * e.g. `blueviolet` or `red`
3846
3915
  *
3847
- * **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
3916
+ * > [!NOTE] Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
3848
3917
  * `RGB`.
3849
3918
  *
3850
3919
  * @experimental
@@ -3999,11 +4068,11 @@ declare namespace Electron {
3999
4068
  * In Electron, returning any value other than `undefined` would cancel the close.
4000
4069
  * For example:
4001
4070
  *
4002
- * _**Note**: There is a subtle difference between the behaviors of
4071
+ * > [!NOTE] There is a subtle difference between the behaviors of
4003
4072
  * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
4004
4073
  * handler)`. It is recommended to always set the `event.returnValue` explicitly,
4005
4074
  * instead of only returning a value, as the former works more consistently within
4006
- * Electron._
4075
+ * Electron.
4007
4076
  */
4008
4077
  on(event: 'close', listener: (event: Event) => void): this;
4009
4078
  off(event: 'close', listener: (event: Event) => void): this;
@@ -4020,11 +4089,11 @@ declare namespace Electron {
4020
4089
  * In Electron, returning any value other than `undefined` would cancel the close.
4021
4090
  * For example:
4022
4091
  *
4023
- * _**Note**: There is a subtle difference between the behaviors of
4092
+ * > [!NOTE] There is a subtle difference between the behaviors of
4024
4093
  * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
4025
4094
  * handler)`. It is recommended to always set the `event.returnValue` explicitly,
4026
4095
  * instead of only returning a value, as the former works more consistently within
4027
- * Electron._
4096
+ * Electron.
4028
4097
  */
4029
4098
  on(event: 'close', listener: (event: Event) => void): this;
4030
4099
  off(event: 'close', listener: (event: Event) => void): this;
@@ -4180,7 +4249,7 @@ declare namespace Electron {
4180
4249
  /**
4181
4250
  * Emitted once when the window is moved to a new position.
4182
4251
  *
4183
- * **Note**: On macOS this event is an alias of `move`.
4252
+ * > [!NOTE] On macOS, this event is an alias of `move`.
4184
4253
  *
4185
4254
  * @platform darwin,win32
4186
4255
  */
@@ -4204,7 +4273,7 @@ declare namespace Electron {
4204
4273
  /**
4205
4274
  * Emitted once when the window is moved to a new position.
4206
4275
  *
4207
- * **Note**: On macOS this event is an alias of `move`.
4276
+ * > [!NOTE] On macOS, this event is an alias of `move`.
4208
4277
  *
4209
4278
  * @platform darwin,win32
4210
4279
  */
@@ -4289,6 +4358,58 @@ declare namespace Electron {
4289
4358
  removeListener(event: 'page-title-updated', listener: (event: Event,
4290
4359
  title: string,
4291
4360
  explicitSet: boolean) => void): this;
4361
+ /**
4362
+ * Emitted when a session is about to end due to a shutdown, machine restart, or
4363
+ * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
4364
+ * though it’s generally best to respect the user’s choice to end the session.
4365
+ * However, you may choose to use it if ending the session puts the user at risk of
4366
+ * losing data.
4367
+ *
4368
+ * @platform win32
4369
+ */
4370
+ on(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4371
+ /**
4372
+ * @platform win32
4373
+ */
4374
+ off(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4375
+ /**
4376
+ * @platform win32
4377
+ */
4378
+ once(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4379
+ /**
4380
+ * @platform win32
4381
+ */
4382
+ addListener(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4383
+ /**
4384
+ * @platform win32
4385
+ */
4386
+ removeListener(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4387
+ /**
4388
+ * Emitted when a session is about to end due to a shutdown, machine restart, or
4389
+ * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
4390
+ * though it’s generally best to respect the user’s choice to end the session.
4391
+ * However, you may choose to use it if ending the session puts the user at risk of
4392
+ * losing data.
4393
+ *
4394
+ * @platform win32
4395
+ */
4396
+ on(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4397
+ /**
4398
+ * @platform win32
4399
+ */
4400
+ off(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4401
+ /**
4402
+ * @platform win32
4403
+ */
4404
+ once(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4405
+ /**
4406
+ * @platform win32
4407
+ */
4408
+ addListener(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4409
+ /**
4410
+ * @platform win32
4411
+ */
4412
+ removeListener(event: 'query-session-end', listener: (event: WindowSessionEndEvent) => void): this;
4292
4413
  /**
4293
4414
  * Emitted when the web page has been rendered (while not being shown) and window
4294
4415
  * can be displayed without a visual flash.
@@ -4457,51 +4578,53 @@ declare namespace Electron {
4457
4578
  removeListener(event: 'rotate-gesture', listener: (event: Event,
4458
4579
  rotation: number) => void): this;
4459
4580
  /**
4460
- * Emitted when window session is going to end due to force shutdown or machine
4461
- * restart or session log off.
4581
+ * Emitted when a session is about to end due to a shutdown, machine restart, or
4582
+ * user log-off. Once this event fires, there is no way to prevent the session from
4583
+ * ending.
4462
4584
  *
4463
4585
  * @platform win32
4464
4586
  */
4465
- on(event: 'session-end', listener: () => void): this;
4587
+ on(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4466
4588
  /**
4467
4589
  * @platform win32
4468
4590
  */
4469
- off(event: 'session-end', listener: () => void): this;
4591
+ off(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4470
4592
  /**
4471
4593
  * @platform win32
4472
4594
  */
4473
- once(event: 'session-end', listener: () => void): this;
4595
+ once(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4474
4596
  /**
4475
4597
  * @platform win32
4476
4598
  */
4477
- addListener(event: 'session-end', listener: () => void): this;
4599
+ addListener(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4478
4600
  /**
4479
4601
  * @platform win32
4480
4602
  */
4481
- removeListener(event: 'session-end', listener: () => void): this;
4603
+ removeListener(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4482
4604
  /**
4483
- * Emitted when window session is going to end due to force shutdown or machine
4484
- * restart or session log off.
4605
+ * Emitted when a session is about to end due to a shutdown, machine restart, or
4606
+ * user log-off. Once this event fires, there is no way to prevent the session from
4607
+ * ending.
4485
4608
  *
4486
4609
  * @platform win32
4487
4610
  */
4488
- on(event: 'session-end', listener: () => void): this;
4611
+ on(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4489
4612
  /**
4490
4613
  * @platform win32
4491
4614
  */
4492
- off(event: 'session-end', listener: () => void): this;
4615
+ off(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4493
4616
  /**
4494
4617
  * @platform win32
4495
4618
  */
4496
- once(event: 'session-end', listener: () => void): this;
4619
+ once(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4497
4620
  /**
4498
4621
  * @platform win32
4499
4622
  */
4500
- addListener(event: 'session-end', listener: () => void): this;
4623
+ addListener(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4501
4624
  /**
4502
4625
  * @platform win32
4503
4626
  */
4504
- removeListener(event: 'session-end', listener: () => void): this;
4627
+ removeListener(event: 'session-end', listener: (event: WindowSessionEndEvent) => void): this;
4505
4628
  /**
4506
4629
  * Emitted when the window opens a sheet.
4507
4630
  *
@@ -4684,43 +4807,45 @@ declare namespace Electron {
4684
4807
  *
4685
4808
  * Calling `event.preventDefault()` will prevent the menu from being displayed.
4686
4809
  *
4687
- * @platform win32
4810
+ * To convert `point` to DIP, use `screen.screenToDipPoint(point)`.
4811
+ *
4812
+ * @platform win32,linux
4688
4813
  */
4689
4814
  on(event: 'system-context-menu', listener: (event: Event,
4690
4815
  /**
4691
- * The screen coordinates the context menu was triggered at
4816
+ * The screen coordinates where the context menu was triggered.
4692
4817
  */
4693
4818
  point: Point) => void): this;
4694
4819
  /**
4695
- * @platform win32
4820
+ * @platform win32,linux
4696
4821
  */
4697
4822
  off(event: 'system-context-menu', listener: (event: Event,
4698
4823
  /**
4699
- * The screen coordinates the context menu was triggered at
4824
+ * The screen coordinates where the context menu was triggered.
4700
4825
  */
4701
4826
  point: Point) => void): this;
4702
4827
  /**
4703
- * @platform win32
4828
+ * @platform win32,linux
4704
4829
  */
4705
4830
  once(event: 'system-context-menu', listener: (event: Event,
4706
4831
  /**
4707
- * The screen coordinates the context menu was triggered at
4832
+ * The screen coordinates where the context menu was triggered.
4708
4833
  */
4709
4834
  point: Point) => void): this;
4710
4835
  /**
4711
- * @platform win32
4836
+ * @platform win32,linux
4712
4837
  */
4713
4838
  addListener(event: 'system-context-menu', listener: (event: Event,
4714
4839
  /**
4715
- * The screen coordinates the context menu was triggered at
4840
+ * The screen coordinates where the context menu was triggered.
4716
4841
  */
4717
4842
  point: Point) => void): this;
4718
4843
  /**
4719
- * @platform win32
4844
+ * @platform win32,linux
4720
4845
  */
4721
4846
  removeListener(event: 'system-context-menu', listener: (event: Event,
4722
4847
  /**
4723
- * The screen coordinates the context menu was triggered at
4848
+ * The screen coordinates where the context menu was triggered.
4724
4849
  */
4725
4850
  point: Point) => void): this;
4726
4851
  /**
@@ -4731,43 +4856,45 @@ declare namespace Electron {
4731
4856
  *
4732
4857
  * Calling `event.preventDefault()` will prevent the menu from being displayed.
4733
4858
  *
4734
- * @platform win32
4859
+ * To convert `point` to DIP, use `screen.screenToDipPoint(point)`.
4860
+ *
4861
+ * @platform win32,linux
4735
4862
  */
4736
4863
  on(event: 'system-context-menu', listener: (event: Event,
4737
4864
  /**
4738
- * The screen coordinates the context menu was triggered at
4865
+ * The screen coordinates where the context menu was triggered.
4739
4866
  */
4740
4867
  point: Point) => void): this;
4741
4868
  /**
4742
- * @platform win32
4869
+ * @platform win32,linux
4743
4870
  */
4744
4871
  off(event: 'system-context-menu', listener: (event: Event,
4745
4872
  /**
4746
- * The screen coordinates the context menu was triggered at
4873
+ * The screen coordinates where the context menu was triggered.
4747
4874
  */
4748
4875
  point: Point) => void): this;
4749
4876
  /**
4750
- * @platform win32
4877
+ * @platform win32,linux
4751
4878
  */
4752
4879
  once(event: 'system-context-menu', listener: (event: Event,
4753
4880
  /**
4754
- * The screen coordinates the context menu was triggered at
4881
+ * The screen coordinates where the context menu was triggered.
4755
4882
  */
4756
4883
  point: Point) => void): this;
4757
4884
  /**
4758
- * @platform win32
4885
+ * @platform win32,linux
4759
4886
  */
4760
4887
  addListener(event: 'system-context-menu', listener: (event: Event,
4761
4888
  /**
4762
- * The screen coordinates the context menu was triggered at
4889
+ * The screen coordinates where the context menu was triggered.
4763
4890
  */
4764
4891
  point: Point) => void): this;
4765
4892
  /**
4766
- * @platform win32
4893
+ * @platform win32,linux
4767
4894
  */
4768
4895
  removeListener(event: 'system-context-menu', listener: (event: Event,
4769
4896
  /**
4770
- * The screen coordinates the context menu was triggered at
4897
+ * The screen coordinates where the context menu was triggered.
4771
4898
  */
4772
4899
  point: Point) => void): this;
4773
4900
  /**
@@ -5011,7 +5138,7 @@ declare namespace Electron {
5011
5138
  */
5012
5139
  constructor(options?: BrowserWindowConstructorOptions);
5013
5140
  /**
5014
- * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5141
+ * > [!NOTE] The `BrowserView` class is deprecated, and replaced by the new
5015
5142
  * `WebContentsView` class.
5016
5143
  *
5017
5144
  * The window that owns the given `browserView`. If the given view is not attached
@@ -5040,7 +5167,7 @@ declare namespace Electron {
5040
5167
  /**
5041
5168
  * Replacement API for setBrowserView supporting work with multi browser views.
5042
5169
  *
5043
- * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5170
+ * > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
5044
5171
  * `WebContentsView` class.
5045
5172
  *
5046
5173
  * @experimental
@@ -5104,14 +5231,14 @@ declare namespace Electron {
5104
5231
  *
5105
5232
  * See Setting `backgroundColor`.
5106
5233
  *
5107
- * **Note:** The alpha value is _not_ returned alongside the red, green, and blue
5234
+ * > [!NOTE] The alpha value is _not_ returned alongside the red, green, and blue
5108
5235
  * values.
5109
5236
  */
5110
5237
  getBackgroundColor(): string;
5111
5238
  /**
5112
5239
  * The `bounds` of the window as `Object`.
5113
5240
  *
5114
- * **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
5241
+ * > [!NOTE] On macOS, the y-coordinate value returned will be at minimum the Tray
5115
5242
  * height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
5116
5243
  * 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
5117
5244
  * 25, y: 38, width: 800, height: 600 }`.
@@ -5121,7 +5248,7 @@ declare namespace Electron {
5121
5248
  * The `BrowserView` attached to `win`. Returns `null` if one is not attached.
5122
5249
  * Throws an error if multiple `BrowserView`s are attached.
5123
5250
  *
5124
- * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5251
+ * > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
5125
5252
  * `WebContentsView` class.
5126
5253
  *
5127
5254
  * @experimental
@@ -5133,7 +5260,7 @@ declare namespace Electron {
5133
5260
  * `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
5134
5261
  * element of the array.
5135
5262
  *
5136
- * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5263
+ * > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
5137
5264
  * `WebContentsView` class.
5138
5265
  *
5139
5266
  * @experimental
@@ -5180,9 +5307,9 @@ declare namespace Electron {
5180
5307
  /**
5181
5308
  * Contains the window bounds of the normal state
5182
5309
  *
5183
- * **Note:** whatever the current state of the window : maximized, minimized or in
5184
- * fullscreen, this function always returns the position and size of the window in
5185
- * normal state. In normal state, getBounds and getNormalBounds returns the same
5310
+ * > [!NOTE] Whatever the current state of the window (maximized, minimized or in
5311
+ * fullscreen), this function always returns the position and size of the window in
5312
+ * normal state. In normal state, `getBounds` and `getNormalBounds` return the same
5186
5313
  * `Rectangle`.
5187
5314
  */
5188
5315
  getNormalBounds(): Rectangle;
@@ -5212,7 +5339,7 @@ declare namespace Electron {
5212
5339
  /**
5213
5340
  * The title of the native window.
5214
5341
  *
5215
- * **Note:** The title of the web page can be different from the title of the
5342
+ * > [!NOTE] The title of the web page can be different from the title of the
5216
5343
  * native window.
5217
5344
  */
5218
5345
  getTitle(): string;
@@ -5261,6 +5388,12 @@ declare namespace Electron {
5261
5388
  * @platform darwin,win32
5262
5389
  */
5263
5390
  isClosable(): boolean;
5391
+ /**
5392
+ * whether or not content protection is currently enabled.
5393
+ *
5394
+ * @platform darwin,win32
5395
+ */
5396
+ isContentProtected(): boolean;
5264
5397
  /**
5265
5398
  * Whether the window is destroyed.
5266
5399
  */
@@ -5288,7 +5421,7 @@ declare namespace Electron {
5288
5421
  /**
5289
5422
  * Whether the window is in fullscreen mode.
5290
5423
  *
5291
- * **Note:** On macOS, fullscreen transitions take place asynchronously. When
5424
+ * > [!NOTE] On macOS, fullscreen transitions take place asynchronously. When
5292
5425
  * querying for a BrowserWindow's fullscreen status, you should ensure that either
5293
5426
  * the 'enter-full-screen' or 'leave-full-screen' events have been emitted.
5294
5427
  */
@@ -5371,6 +5504,15 @@ declare namespace Electron {
5371
5504
  * @platform darwin
5372
5505
  */
5373
5506
  isSimpleFullScreen(): boolean;
5507
+ /**
5508
+ * whether the window is arranged via Snap.
5509
+ *
5510
+ * The window is snapped via buttons shown when the mouse is hovered over window
5511
+ * maximize button, or by dragging it to the edges of the screen.
5512
+ *
5513
+ * @platform win32
5514
+ */
5515
+ isSnapped(): boolean;
5374
5516
  /**
5375
5517
  * Whether the window is in Windows 10 tablet mode.
5376
5518
  *
@@ -5391,7 +5533,7 @@ declare namespace Electron {
5391
5533
  /**
5392
5534
  * Whether the window is visible on all workspaces.
5393
5535
  *
5394
- * **Note:** This API always returns false on Windows.
5536
+ * > [!NOTE] This API always returns false on Windows.
5395
5537
  *
5396
5538
  * @platform darwin,linux
5397
5539
  */
@@ -5472,7 +5614,7 @@ declare namespace Electron {
5472
5614
  */
5473
5615
  reload(): void;
5474
5616
  /**
5475
- * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5617
+ * > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
5476
5618
  * `WebContentsView` class.
5477
5619
  *
5478
5620
  * @experimental
@@ -5512,7 +5654,7 @@ declare namespace Electron {
5512
5654
  /**
5513
5655
  * Sets the properties for the window's taskbar button.
5514
5656
  *
5515
- * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
5657
+ * > [!NOTE] `relaunchCommand` and `relaunchDisplayName` must always be set
5516
5658
  * together. If one of those properties is not set, then neither will be used.
5517
5659
  *
5518
5660
  * @platform win32
@@ -5590,7 +5732,7 @@ declare namespace Electron {
5590
5732
  *
5591
5733
  * See the Windows documentation for more details.
5592
5734
  *
5593
- * **Note:** This method is only supported on Windows 11 22H2 and up.
5735
+ * > [!NOTE] This method is only supported on Windows 11 22H2 and up.
5594
5736
  *
5595
5737
  * @platform win32
5596
5738
  */
@@ -5599,14 +5741,14 @@ declare namespace Electron {
5599
5741
  * Resizes and moves the window to the supplied bounds. Any properties that are not
5600
5742
  * supplied will default to their current values.
5601
5743
  *
5602
- * **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
5744
+ * > [!NOTE] On macOS, the y-coordinate value cannot be smaller than the Tray
5603
5745
  * height. The tray height has changed over time and depends on the operating
5604
5746
  * system, but is between 20-40px. Passing a value lower than the tray height will
5605
5747
  * result in a window that is flush to the tray.
5606
5748
  */
5607
5749
  setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
5608
5750
  /**
5609
- * > **Note** The `BrowserView` class is deprecated, and replaced by the new
5751
+ * > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
5610
5752
  * `WebContentsView` class.
5611
5753
  *
5612
5754
  * @experimental
@@ -5627,10 +5769,11 @@ declare namespace Electron {
5627
5769
  /**
5628
5770
  * Prevents the window contents from being captured by other apps.
5629
5771
  *
5630
- * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
5631
- * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
5632
- * version 2004 and up the window will be removed from capture entirely, older
5633
- * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
5772
+ * On macOS it sets the NSWindow's `sharingType` to `NSWindowSharingNone`. On
5773
+ * Windows it calls `SetWindowDisplayAffinity` with `WDA_EXCLUDEFROMCAPTURE`. For
5774
+ * Windows 10 version 2004 and up the window will be removed from capture entirely,
5775
+ * older Windows versions behave as if `WDA_MONITOR` is applied capturing a black
5776
+ * window.
5634
5777
  *
5635
5778
  * @platform darwin,win32
5636
5779
  */
@@ -5661,7 +5804,7 @@ declare namespace Electron {
5661
5804
  /**
5662
5805
  * Sets whether the window should be in fullscreen mode.
5663
5806
  *
5664
- * **Note:** On macOS, fullscreen transitions take place asynchronously. If further
5807
+ * > [!NOTE] On macOS, fullscreen transitions take place asynchronously. If further
5665
5808
  * actions depend on the fullscreen state, use the 'enter-full-screen' or
5666
5809
  * 'leave-full-screen' events.
5667
5810
  */
@@ -5899,7 +6042,7 @@ declare namespace Electron {
5899
6042
  * Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
5900
6043
  * error if `browserView` is not attached to `win`.
5901
6044
  *
5902
- * > **Note** The `BrowserView` class is deprecated, and replaced by the new
6045
+ * > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
5903
6046
  * `WebContentsView` class.
5904
6047
  *
5905
6048
  * @experimental
@@ -5911,7 +6054,7 @@ declare namespace Electron {
5911
6054
  * `undefined` clears the touch bar. This method only has an effect if the machine
5912
6055
  * has a touch bar.
5913
6056
  *
5914
- * **Note:** The TouchBar API is currently experimental and may change or be
6057
+ * > [!NOTE] The TouchBar API is currently experimental and may change or be
5915
6058
  * removed in future Electron releases.
5916
6059
  *
5917
6060
  * @platform darwin
@@ -5919,15 +6062,17 @@ declare namespace Electron {
5919
6062
  setTouchBar(touchBar: (TouchBar) | (null)): void;
5920
6063
  /**
5921
6064
  * Adds a vibrancy effect to the browser window. Passing `null` or an empty string
5922
- * will remove the vibrancy effect on the window.
6065
+ * will remove the vibrancy effect on the window. The `animationDuration` parameter
6066
+ * only animates fading in or fading out the vibrancy effect. Animating between
6067
+ * different types of vibrancy is not supported.
5923
6068
  *
5924
6069
  * @platform darwin
5925
6070
  */
5926
- setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
6071
+ setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null), options?: VibrancyOptions): void;
5927
6072
  /**
5928
6073
  * Sets whether the window should be visible on all workspaces.
5929
6074
  *
5930
- * **Note:** This API does nothing on Windows.
6075
+ * > [!NOTE] This API does nothing on Windows.
5931
6076
  *
5932
6077
  * @platform darwin,linux
5933
6078
  */
@@ -6067,7 +6212,7 @@ declare namespace Electron {
6067
6212
  /**
6068
6213
  * A `boolean` property that determines whether the menu bar should be visible.
6069
6214
  *
6070
- * **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
6215
+ * > [!NOTE] If the menu bar is auto-hide, users can still bring up the menu bar by
6071
6216
  * pressing the single `Alt` key.
6072
6217
  *
6073
6218
  * @platform win32,linux
@@ -6111,6 +6256,12 @@ declare namespace Electron {
6111
6256
  * fullscreen mode.
6112
6257
  */
6113
6258
  simpleFullScreen: boolean;
6259
+ /**
6260
+ * A `boolean` property that indicates whether the window is arranged via Snap.
6261
+ *
6262
+ * @platform win32
6263
+ */
6264
+ readonly snapped: boolean;
6114
6265
  /**
6115
6266
  * A `string` (optional) property that is equal to the `tabbingIdentifier` passed
6116
6267
  * to the `BrowserWindow` constructor or `undefined` if none was set.
@@ -6121,7 +6272,7 @@ declare namespace Electron {
6121
6272
  /**
6122
6273
  * A `string` property that determines the title of the native window.
6123
6274
  *
6124
- * **Note:** The title of the web page can be different from the title of the
6275
+ * > [!NOTE] The title of the web page can be different from the title of the
6125
6276
  * native window.
6126
6277
  */
6127
6278
  title: string;
@@ -6129,7 +6280,7 @@ declare namespace Electron {
6129
6280
  * A `boolean` property that determines whether the window is visible on all
6130
6281
  * workspaces.
6131
6282
  *
6132
- * **Note:** Always returns false on Windows.
6283
+ * > [!NOTE] Always returns false on Windows.
6133
6284
  *
6134
6285
  * @platform darwin,linux
6135
6286
  */
@@ -6539,7 +6690,7 @@ declare namespace Electron {
6539
6690
  /**
6540
6691
  * Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
6541
6692
  *
6542
- * **Note:** Most apps on Windows don't support pasting bookmarks into them so you
6693
+ * > [!NOTE] Most apps on Windows don't support pasting bookmarks into them so you
6543
6694
  * can use `clipboard.write` to write both a bookmark and fallback text to the
6544
6695
  * clipboard.
6545
6696
  *
@@ -6590,21 +6741,25 @@ declare namespace Electron {
6590
6741
  * If you're appending an argument like `--switch=value`, consider using
6591
6742
  * `appendSwitch('switch', 'value')` instead.
6592
6743
  *
6593
- * **Note:** This will not affect `process.argv`. The intended usage of this
6744
+ * > [!NOTE] This will not affect `process.argv`. The intended usage of this
6594
6745
  * function is to control Chromium's behavior.
6595
6746
  */
6596
6747
  appendArgument(value: string): void;
6597
6748
  /**
6598
6749
  * Append a switch (with optional `value`) to Chromium's command line.
6599
6750
  *
6600
- * **Note:** This will not affect `process.argv`. The intended usage of this
6751
+ * > [!NOTE] This will not affect `process.argv`. The intended usage of this
6601
6752
  * function is to control Chromium's behavior.
6602
6753
  */
6603
6754
  appendSwitch(the_switch: string, value?: string): void;
6604
6755
  /**
6605
6756
  * The command-line switch value.
6606
6757
  *
6607
- * **Note:** When the switch is not present or has no value, it returns empty
6758
+ * This function is meant to obtain Chromium command line switches. It is not meant
6759
+ * to be used for application-specific command line arguments. For the latter,
6760
+ * please use `process.argv`.
6761
+ *
6762
+ * > [!NOTE] When the switch is not present or has no value, it returns empty
6608
6763
  * string.
6609
6764
  */
6610
6765
  getSwitchValue(the_switch: string): string;
@@ -6615,7 +6770,7 @@ declare namespace Electron {
6615
6770
  /**
6616
6771
  * Removes the specified switch from Chromium's command line.
6617
6772
  *
6618
- * **Note:** This will not affect `process.argv`. The intended usage of this
6773
+ * > [!NOTE] This will not affect `process.argv`. The intended usage of this
6619
6774
  * function is to control Chromium's behavior.
6620
6775
  */
6621
6776
  removeSwitch(the_switch: string): void;
@@ -6683,6 +6838,13 @@ declare namespace Electron {
6683
6838
 
6684
6839
  // Docs: https://electronjs.org/docs/api/context-bridge
6685
6840
 
6841
+ /**
6842
+ * A copy of the resulting value from executing the function in the main world.
6843
+ * Refer to the table on how values are copied between worlds.
6844
+ *
6845
+ * @experimental
6846
+ */
6847
+ executeInMainWorld(executionScript: ExecutionScript): any;
6686
6848
  exposeInIsolatedWorld(worldId: number, apiKey: string, api: any): void;
6687
6849
  exposeInMainWorld(apiKey: string, api: any): void;
6688
6850
  }
@@ -6886,7 +7048,7 @@ declare namespace Electron {
6886
7048
  * parameters in a renderer process will not result in those parameters being sent
6887
7049
  * with crashes that occur in other renderer processes or in the main process.
6888
7050
  *
6889
- * **Note:** Parameters have limits on the length of the keys and values. Key names
7051
+ * > [!NOTE] Parameters have limits on the length of the keys and values. Key names
6890
7052
  * must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
6891
7053
  * Keys with names longer than the maximum will be silently ignored. Key values
6892
7054
  * longer than the maximum length will be truncated.
@@ -6898,7 +7060,7 @@ declare namespace Electron {
6898
7060
  * be returned until it is uploaded. In the case that there are no uploaded
6899
7061
  * reports, `null` is returned.
6900
7062
  *
6901
- * **Note:** This method is only available in the main process.
7063
+ * > [!NOTE] This method is only available in the main process.
6902
7064
  */
6903
7065
  getLastCrashReport(): (CrashReport) | (null);
6904
7066
  /**
@@ -6909,14 +7071,14 @@ declare namespace Electron {
6909
7071
  * Returns all uploaded crash reports. Each report contains the date and uploaded
6910
7072
  * ID.
6911
7073
  *
6912
- * **Note:** This method is only available in the main process.
7074
+ * > [!NOTE] This method is only available in the main process.
6913
7075
  */
6914
7076
  getUploadedReports(): CrashReport[];
6915
7077
  /**
6916
7078
  * Whether reports should be submitted to the server. Set through the `start`
6917
7079
  * method or `setUploadToServer`.
6918
7080
  *
6919
- * **Note:** This method is only available in the main process.
7081
+ * > [!NOTE] This method is only available in the main process.
6920
7082
  */
6921
7083
  getUploadToServer(): boolean;
6922
7084
  /**
@@ -6928,7 +7090,7 @@ declare namespace Electron {
6928
7090
  * This would normally be controlled by user preferences. This has no effect if
6929
7091
  * called before `start` is called.
6930
7092
  *
6931
- * **Note:** This method is only available in the main process.
7093
+ * > [!NOTE] This method is only available in the main process.
6932
7094
  */
6933
7095
  setUploadToServer(uploadToServer: boolean): void;
6934
7096
  /**
@@ -6942,19 +7104,19 @@ declare namespace Electron {
6942
7104
  * renderer process is created, then that renderer process will not be monitored by
6943
7105
  * the crash reporter.
6944
7106
  *
6945
- * **Note:** You can test out the crash reporter by generating a crash using
7107
+ * > [!NOTE] You can test out the crash reporter by generating a crash using
6946
7108
  * `process.crash()`.
6947
7109
  *
6948
- * **Note:** If you need to send additional/updated `extra` parameters after your
7110
+ * > [!NOTE] If you need to send additional/updated `extra` parameters after your
6949
7111
  * first call `start` you can call `addExtraParameter`.
6950
7112
  *
6951
- * **Note:** Parameters passed in `extra`, `globalExtra` or set with
7113
+ * > [!NOTE] Parameters passed in `extra`, `globalExtra` or set with
6952
7114
  * `addExtraParameter` have limits on the length of the keys and values. Key names
6953
7115
  * must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
6954
7116
  * with names longer than the maximum will be silently ignored. Key values longer
6955
7117
  * than the maximum length will be truncated.
6956
7118
  *
6957
- * **Note:** This method is only available in the main process.
7119
+ * > [!NOTE] This method is only available in the main process.
6958
7120
  */
6959
7121
  start(options: CrashReporterStartOptions): void;
6960
7122
  }
@@ -7112,7 +7274,7 @@ declare namespace Electron {
7112
7274
  * `DesktopCapturerSource` represents a screen or an individual window that can be
7113
7275
  * captured.
7114
7276
  *
7115
- * **Note** Capturing the screen contents requires user consent on macOS 10.15
7277
+ * > [!NOTE] Capturing the screen contents requires user consent on macOS 10.15
7116
7278
  * Catalina or higher, which can detected by
7117
7279
  * `systemPreferences.getMediaAccessStatus`.
7118
7280
  */
@@ -7276,11 +7438,11 @@ declare namespace Electron {
7276
7438
  * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
7277
7439
  * `'*'` wildcard (no other wildcard is supported).
7278
7440
  *
7279
- * **Note:** On Windows and Linux an open dialog can not be both a file selector
7441
+ * > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
7280
7442
  * and a directory selector, so if you set `properties` to `['openFile',
7281
7443
  * 'openDirectory']` on these platforms, a directory selector will be shown.
7282
7444
  *
7283
- * **Note:** On Linux `defaultPath` is not supported when using portal file chooser
7445
+ * > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
7284
7446
  * dialogs unless the portal backend is version 4 or higher. You can use
7285
7447
  * `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
7286
7448
  */
@@ -7306,11 +7468,11 @@ declare namespace Electron {
7306
7468
  * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
7307
7469
  * `'*'` wildcard (no other wildcard is supported).
7308
7470
  *
7309
- * **Note:** On Windows and Linux an open dialog can not be both a file selector
7471
+ * > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
7310
7472
  * and a directory selector, so if you set `properties` to `['openFile',
7311
7473
  * 'openDirectory']` on these platforms, a directory selector will be shown.
7312
7474
  *
7313
- * **Note:** On Linux `defaultPath` is not supported when using portal file chooser
7475
+ * > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
7314
7476
  * dialogs unless the portal backend is version 4 or higher. You can use
7315
7477
  * `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
7316
7478
  */
@@ -7329,11 +7491,11 @@ declare namespace Electron {
7329
7491
  * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
7330
7492
  * `'*'` wildcard (no other wildcard is supported).
7331
7493
  *
7332
- * **Note:** On Windows and Linux an open dialog can not be both a file selector
7494
+ * > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
7333
7495
  * and a directory selector, so if you set `properties` to `['openFile',
7334
7496
  * 'openDirectory']` on these platforms, a directory selector will be shown.
7335
7497
  *
7336
- * **Note:** On Linux `defaultPath` is not supported when using portal file chooser
7498
+ * > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
7337
7499
  * dialogs unless the portal backend is version 4 or higher. You can use
7338
7500
  * `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
7339
7501
  */
@@ -7352,11 +7514,11 @@ declare namespace Electron {
7352
7514
  * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
7353
7515
  * `'*'` wildcard (no other wildcard is supported).
7354
7516
  *
7355
- * **Note:** On Windows and Linux an open dialog can not be both a file selector
7517
+ * > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
7356
7518
  * and a directory selector, so if you set `properties` to `['openFile',
7357
7519
  * 'openDirectory']` on these platforms, a directory selector will be shown.
7358
7520
  *
7359
- * **Note:** On Linux `defaultPath` is not supported when using portal file chooser
7521
+ * > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
7360
7522
  * dialogs unless the portal backend is version 4 or higher. You can use
7361
7523
  * `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
7362
7524
  */
@@ -7377,7 +7539,7 @@ declare namespace Electron {
7377
7539
  * The `filters` specifies an array of file types that can be displayed, see
7378
7540
  * `dialog.showOpenDialog` for an example.
7379
7541
  *
7380
- * **Note:** On macOS, using the asynchronous version is recommended to avoid
7542
+ * > [!NOTE] On macOS, using the asynchronous version is recommended to avoid
7381
7543
  * issues when expanding and collapsing the dialog.
7382
7544
  */
7383
7545
  showSaveDialog(window: BaseWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
@@ -7397,7 +7559,7 @@ declare namespace Electron {
7397
7559
  * The `filters` specifies an array of file types that can be displayed, see
7398
7560
  * `dialog.showOpenDialog` for an example.
7399
7561
  *
7400
- * **Note:** On macOS, using the asynchronous version is recommended to avoid
7562
+ * > [!NOTE] On macOS, using the asynchronous version is recommended to avoid
7401
7563
  * issues when expanding and collapsing the dialog.
7402
7564
  */
7403
7565
  showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
@@ -7451,7 +7613,7 @@ declare namespace Electron {
7451
7613
  */
7452
7614
  depthPerComponent: number;
7453
7615
  /**
7454
- * `true`` if the display is detected by the system.
7616
+ * `true` if the display is detected by the system.
7455
7617
  */
7456
7618
  detected: boolean;
7457
7619
  /**
@@ -7522,7 +7684,7 @@ declare namespace Electron {
7522
7684
  * However, the request remains active until either the application becomes active
7523
7685
  * or the request is canceled.
7524
7686
  *
7525
- * **Note:** This method can only be used while the app is not focused; when the
7687
+ * > [!NOTE] This method can only be used while the app is not focused; when the
7526
7688
  * app is focused it will return -1.
7527
7689
  *
7528
7690
  * @platform darwin
@@ -7690,7 +7852,7 @@ declare namespace Electron {
7690
7852
  /**
7691
7853
  * The file name of the download item.
7692
7854
  *
7693
- * **Note:** The file name is not always the same as the actual one saved in local
7855
+ * > [!NOTE] The file name is not always the same as the actual one saved in local
7694
7856
  * disk. If user changes the file name in a prompted download saving dialog, the
7695
7857
  * actual name of saved file will be different.
7696
7858
  */
@@ -7730,7 +7892,7 @@ declare namespace Electron {
7730
7892
  * The current state. Can be `progressing`, `completed`, `cancelled` or
7731
7893
  * `interrupted`.
7732
7894
  *
7733
- * **Note:** The following methods are useful specifically to resume a `cancelled`
7895
+ * > [!NOTE] The following methods are useful specifically to resume a `cancelled`
7734
7896
  * item when session is restarted.
7735
7897
  */
7736
7898
  getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
@@ -7763,7 +7925,7 @@ declare namespace Electron {
7763
7925
  /**
7764
7926
  * Resumes the download that has been paused.
7765
7927
  *
7766
- * **Note:** To enable resumable downloads the server you are downloading from must
7928
+ * > [!NOTE] To enable resumable downloads the server you are downloading from must
7767
7929
  * support range requests and provide both `Last-Modified` and `ETag` header
7768
7930
  * values. Otherwise `resume()` will dismiss previously received bytes and restart
7769
7931
  * the download from the beginning.
@@ -7821,6 +7983,104 @@ declare namespace Electron {
7821
7983
  version: string;
7822
7984
  }
7823
7985
 
7986
+ class Extensions extends NodeEventEmitter {
7987
+
7988
+ // Docs: https://electronjs.org/docs/api/extensions-api
7989
+
7990
+ /**
7991
+ * Emitted after an extension is loaded. This occurs whenever an extension is added
7992
+ * to the "enabled" set of extensions. This includes:
7993
+ *
7994
+ * * Extensions being loaded from `Extensions.loadExtension`.
7995
+ * * Extensions being reloaded:
7996
+ * * from a crash.
7997
+ * * if the extension requested it (`chrome.runtime.reload()`).
7998
+ */
7999
+ on(event: 'extension-loaded', listener: (event: Event,
8000
+ extension: Extension) => void): this;
8001
+ off(event: 'extension-loaded', listener: (event: Event,
8002
+ extension: Extension) => void): this;
8003
+ once(event: 'extension-loaded', listener: (event: Event,
8004
+ extension: Extension) => void): this;
8005
+ addListener(event: 'extension-loaded', listener: (event: Event,
8006
+ extension: Extension) => void): this;
8007
+ removeListener(event: 'extension-loaded', listener: (event: Event,
8008
+ extension: Extension) => void): this;
8009
+ /**
8010
+ * Emitted after an extension is loaded and all necessary browser state is
8011
+ * initialized to support the start of the extension's background page.
8012
+ */
8013
+ on(event: 'extension-ready', listener: (event: Event,
8014
+ extension: Extension) => void): this;
8015
+ off(event: 'extension-ready', listener: (event: Event,
8016
+ extension: Extension) => void): this;
8017
+ once(event: 'extension-ready', listener: (event: Event,
8018
+ extension: Extension) => void): this;
8019
+ addListener(event: 'extension-ready', listener: (event: Event,
8020
+ extension: Extension) => void): this;
8021
+ removeListener(event: 'extension-ready', listener: (event: Event,
8022
+ extension: Extension) => void): this;
8023
+ /**
8024
+ * Emitted after an extension is unloaded. This occurs when
8025
+ * `Session.removeExtension` is called.
8026
+ */
8027
+ on(event: 'extension-unloaded', listener: (event: Event,
8028
+ extension: Extension) => void): this;
8029
+ off(event: 'extension-unloaded', listener: (event: Event,
8030
+ extension: Extension) => void): this;
8031
+ once(event: 'extension-unloaded', listener: (event: Event,
8032
+ extension: Extension) => void): this;
8033
+ addListener(event: 'extension-unloaded', listener: (event: Event,
8034
+ extension: Extension) => void): this;
8035
+ removeListener(event: 'extension-unloaded', listener: (event: Event,
8036
+ extension: Extension) => void): this;
8037
+ /**
8038
+ * A list of all loaded extensions.
8039
+ *
8040
+ * > [!NOTE] This API cannot be called before the `ready` event of the `app` module
8041
+ * is emitted.
8042
+ */
8043
+ getAllExtensions(): Extension[];
8044
+ /**
8045
+ * The loaded extension with the given ID.
8046
+ *
8047
+ * > [!NOTE] This API cannot be called before the `ready` event of the `app` module
8048
+ * is emitted.
8049
+ */
8050
+ getExtension(extensionId: string): (Extension) | (null);
8051
+ /**
8052
+ * resolves when the extension is loaded.
8053
+ *
8054
+ * This method will raise an exception if the extension could not be loaded. If
8055
+ * there are warnings when installing the extension (e.g. if the extension requests
8056
+ * an API that Electron does not support) then they will be logged to the console.
8057
+ *
8058
+ * Note that Electron does not support the full range of Chrome extensions APIs.
8059
+ * See Supported Extensions APIs for more details on what is supported.
8060
+ *
8061
+ * Note that in previous versions of Electron, extensions that were loaded would be
8062
+ * remembered for future runs of the application. This is no longer the case:
8063
+ * `loadExtension` must be called on every boot of your app if you want the
8064
+ * extension to be loaded.
8065
+ *
8066
+ * This API does not support loading packed (.crx) extensions.
8067
+ *
8068
+ * > [!NOTE] This API cannot be called before the `ready` event of the `app` module
8069
+ * is emitted.
8070
+ *
8071
+ * > [!NOTE] Loading extensions into in-memory (non-persistent) sessions is not
8072
+ * supported and will throw an error.
8073
+ */
8074
+ loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
8075
+ /**
8076
+ * Unloads an extension.
8077
+ *
8078
+ * > [!NOTE] This API cannot be called before the `ready` event of the `app` module
8079
+ * is emitted.
8080
+ */
8081
+ removeExtension(extensionId: string): void;
8082
+ }
8083
+
7824
8084
  interface FileFilter {
7825
8085
 
7826
8086
  // Docs: https://electronjs.org/docs/api/structures/file-filter
@@ -7982,6 +8242,10 @@ declare namespace Electron {
7982
8242
 
7983
8243
  // Docs: https://electronjs.org/docs/api/structures/hid-device
7984
8244
 
8245
+ /**
8246
+ * an array of report formats. See MDN documentation for more.
8247
+ */
8248
+ collections: Array<Collections>;
7985
8249
  /**
7986
8250
  * Unique identifier for the device.
7987
8251
  */
@@ -8009,15 +8273,64 @@ declare namespace Electron {
8009
8273
  vendorId: number;
8010
8274
  }
8011
8275
 
8276
+ class ImageView extends View {
8277
+
8278
+ // Docs: https://electronjs.org/docs/api/image-view
8279
+
8280
+ /**
8281
+ * Emitted when the view's bounds have changed in response to being laid out. The
8282
+ * new bounds can be retrieved with `view.getBounds()`.
8283
+ */
8284
+ on(event: 'bounds-changed', listener: () => void): this;
8285
+ off(event: 'bounds-changed', listener: () => void): this;
8286
+ once(event: 'bounds-changed', listener: () => void): this;
8287
+ addListener(event: 'bounds-changed', listener: () => void): this;
8288
+ removeListener(event: 'bounds-changed', listener: () => void): this;
8289
+ /**
8290
+ * ImageView
8291
+ */
8292
+ constructor();
8293
+ /**
8294
+ * Sets the image for this `ImageView`. Note that only image formats supported by
8295
+ * `NativeImage` can be used with an `ImageView`.
8296
+ *
8297
+ * @experimental
8298
+ */
8299
+ setImage(image: NativeImage): void;
8300
+ }
8301
+
8012
8302
  interface InAppPurchase extends NodeJS.EventEmitter {
8013
8303
 
8014
8304
  // Docs: https://electronjs.org/docs/api/in-app-purchase
8015
8305
 
8016
- on(event: 'transactions-updated', listener: () => void): this;
8017
- off(event: 'transactions-updated', listener: () => void): this;
8018
- once(event: 'transactions-updated', listener: () => void): this;
8019
- addListener(event: 'transactions-updated', listener: () => void): this;
8020
- removeListener(event: 'transactions-updated', listener: () => void): this;
8306
+ /**
8307
+ * Emitted when one or more transactions have been updated.
8308
+ */
8309
+ on(event: 'transactions-updated', listener: (event: Event,
8310
+ /**
8311
+ * Array of `Transaction` objects.
8312
+ */
8313
+ transactions: Transaction[]) => void): this;
8314
+ off(event: 'transactions-updated', listener: (event: Event,
8315
+ /**
8316
+ * Array of `Transaction` objects.
8317
+ */
8318
+ transactions: Transaction[]) => void): this;
8319
+ once(event: 'transactions-updated', listener: (event: Event,
8320
+ /**
8321
+ * Array of `Transaction` objects.
8322
+ */
8323
+ transactions: Transaction[]) => void): this;
8324
+ addListener(event: 'transactions-updated', listener: (event: Event,
8325
+ /**
8326
+ * Array of `Transaction` objects.
8327
+ */
8328
+ transactions: Transaction[]) => void): this;
8329
+ removeListener(event: 'transactions-updated', listener: (event: Event,
8330
+ /**
8331
+ * Array of `Transaction` objects.
8332
+ */
8333
+ transactions: Transaction[]) => void): this;
8021
8334
  /**
8022
8335
  * whether a user can make a payment.
8023
8336
  */
@@ -8192,10 +8505,10 @@ declare namespace Electron {
8192
8505
 
8193
8506
  /**
8194
8507
  * An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`,
8195
- * `meta`, `command`, `cmd`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`,
8196
- * `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`.
8508
+ * `meta`, `command`, `cmd`, `iskeypad`, `isautorepeat`, `leftbuttondown`,
8509
+ * `middlebuttondown`, `rightbuttondown`, `capslock`, `numlock`, `left`, `right`.
8197
8510
  */
8198
- modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>;
8511
+ modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'iskeypad' | 'isautorepeat' | 'leftbuttondown' | 'middlebuttondown' | 'rightbuttondown' | 'capslock' | 'numlock' | 'left' | 'right'>;
8199
8512
  /**
8200
8513
  * Can be `undefined`, `mouseDown`, `mouseUp`, `mouseMove`, `mouseEnter`,
8201
8514
  * `mouseLeave`, `contextMenu`, `mouseWheel`, `rawKeyDown`, `keyDown`, `keyUp`,
@@ -8308,6 +8621,10 @@ declare namespace Electron {
8308
8621
  *
8309
8622
  */
8310
8623
  readonly senderFrame: (WebFrameMain) | (null);
8624
+ /**
8625
+ * Possible values include `frame`
8626
+ */
8627
+ type: ('frame');
8311
8628
  }
8312
8629
 
8313
8630
  interface IpcMainInvokeEvent extends Event {
@@ -8332,6 +8649,106 @@ declare namespace Electron {
8332
8649
  *
8333
8650
  */
8334
8651
  readonly senderFrame: (WebFrameMain) | (null);
8652
+ /**
8653
+ * Possible values include `frame`
8654
+ */
8655
+ type: ('frame');
8656
+ }
8657
+
8658
+ class IpcMainServiceWorker extends NodeEventEmitter {
8659
+
8660
+ // Docs: https://electronjs.org/docs/api/ipc-main-service-worker
8661
+
8662
+ handle(channel: string, listener: (event: IpcMainServiceWorkerInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
8663
+ /**
8664
+ * Handles a single `invoke`able IPC message, then removes the listener. See
8665
+ * `ipcMainServiceWorker.handle(channel, listener)`.
8666
+ */
8667
+ handleOnce(channel: string, listener: (event: IpcMainServiceWorkerInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
8668
+ /**
8669
+ * Listens to `channel`, when a new message arrives `listener` would be called with
8670
+ * `listener(event, args...)`.
8671
+ */
8672
+ on(channel: string, listener: (event: IpcMainServiceWorkerEvent, ...args: any[]) => void): this;
8673
+ /**
8674
+ * Adds a one time `listener` function for the event. This `listener` is invoked
8675
+ * only the next time a message is sent to `channel`, after which it is removed.
8676
+ */
8677
+ once(channel: string, listener: (event: IpcMainServiceWorkerEvent, ...args: any[]) => void): this;
8678
+ /**
8679
+ * Removes listeners of the specified `channel`.
8680
+ */
8681
+ removeAllListeners(channel?: string): this;
8682
+ /**
8683
+ * Removes any handler for `channel`, if present.
8684
+ */
8685
+ removeHandler(channel: string): void;
8686
+ /**
8687
+ * Removes the specified `listener` from the listener array for the specified
8688
+ * `channel`.
8689
+ */
8690
+ removeListener(channel: string, listener: (...args: any[]) => void): this;
8691
+ }
8692
+
8693
+ interface IpcMainServiceWorkerEvent extends Event {
8694
+
8695
+ // Docs: https://electronjs.org/docs/api/structures/ipc-main-service-worker-event
8696
+
8697
+ /**
8698
+ * A list of MessagePorts that were transferred with this message
8699
+ */
8700
+ ports: MessagePortMain[];
8701
+ /**
8702
+ * A function that will send an IPC message to the renderer frame that sent the
8703
+ * original message that you are currently handling. You should use this method to
8704
+ * "reply" to the sent message in order to guarantee the reply will go to the
8705
+ * correct process and frame.
8706
+ */
8707
+ reply: (channel: string, ...args: any[]) => void;
8708
+ /**
8709
+ * Set this to the value to be returned in a synchronous message
8710
+ */
8711
+ returnValue: any;
8712
+ /**
8713
+ * The service worker that sent this message
8714
+ *
8715
+ */
8716
+ readonly serviceWorker: ServiceWorkerMain;
8717
+ /**
8718
+ * The `Session` instance with which the event is associated.
8719
+ */
8720
+ session: Session;
8721
+ /**
8722
+ * Possible values include `service-worker`.
8723
+ */
8724
+ type: ('service-worker');
8725
+ /**
8726
+ * The service worker version ID.
8727
+ */
8728
+ versionId: number;
8729
+ }
8730
+
8731
+ interface IpcMainServiceWorkerInvokeEvent extends Event {
8732
+
8733
+ // Docs: https://electronjs.org/docs/api/structures/ipc-main-service-worker-invoke-event
8734
+
8735
+ /**
8736
+ * The service worker that sent this message
8737
+ *
8738
+ */
8739
+ readonly serviceWorker: ServiceWorkerMain;
8740
+ /**
8741
+ * The `Session` instance with which the event is associated.
8742
+ */
8743
+ session: Session;
8744
+ /**
8745
+ * Possible values include `service-worker`.
8746
+ */
8747
+ type: ('service-worker');
8748
+ /**
8749
+ * The service worker version ID.
8750
+ */
8751
+ versionId: number;
8335
8752
  }
8336
8753
 
8337
8754
  interface IpcRenderer extends NodeJS.EventEmitter {
@@ -8360,7 +8777,7 @@ declare namespace Electron {
8360
8777
  *
8361
8778
  * If you do not need a response to the message, consider using `ipcRenderer.send`.
8362
8779
  *
8363
- * > **Note** Sending non-standard JavaScript types such as DOM objects or special
8780
+ * > [!NOTE] Sending non-standard JavaScript types such as DOM objects or special
8364
8781
  * Electron objects will throw an exception.
8365
8782
  *
8366
8783
  * Since the main process does not have support for DOM objects such as
@@ -8368,7 +8785,7 @@ declare namespace Electron {
8368
8785
  * Electron's IPC to the main process, as the main process would have no way to
8369
8786
  * decode them. Attempting to send such objects over IPC will result in an error.
8370
8787
  *
8371
- * > **Note** If the handler in the main process throws an error, the promise
8788
+ * > [!NOTE] If the handler in the main process throws an error, the promise
8372
8789
  * returned by `invoke` will reject. However, the `Error` object in the renderer
8373
8790
  * process will not be the same as the one thrown in the main process.
8374
8791
  */
@@ -8463,9 +8880,9 @@ declare namespace Electron {
8463
8880
  * The main process handles it by listening for `channel` with `ipcMain` module,
8464
8881
  * and replies by setting `event.returnValue`.
8465
8882
  *
8466
- * > :warning: **WARNING**: Sending a synchronous message will block the whole
8467
- * renderer process until the reply is received, so use this method only as a last
8468
- * resort. It's much better to use the asynchronous version, `invoke()`.
8883
+ * > [!WARNING] Sending a synchronous message will block the whole renderer process
8884
+ * until the reply is received, so use this method only as a last resort. It's much
8885
+ * better to use the asynchronous version, `invoke()`.
8469
8886
  */
8470
8887
  sendSync(channel: string, ...args: any[]): any;
8471
8888
  /**
@@ -8680,7 +9097,7 @@ declare namespace Electron {
8680
9097
  /**
8681
9098
  * The application menu, if set, or `null`, if not set.
8682
9099
  *
8683
- * **Note:** The returned `Menu` instance doesn't support dynamic addition or
9100
+ * > [!NOTE] The returned `Menu` instance doesn't support dynamic addition or
8684
9101
  * removal of menu items. Instance properties can still be dynamically modified.
8685
9102
  */
8686
9103
  static getApplicationMenu(): (Menu) | (null);
@@ -8711,7 +9128,7 @@ declare namespace Electron {
8711
9128
  * Passing `null` will suppress the default menu. On Windows and Linux, this has
8712
9129
  * the additional effect of removing the menu bar from the window.
8713
9130
  *
8714
- * **Note:** The default menu will be created automatically if the app does not set
9131
+ * > [!NOTE] The default menu will be created automatically if the app does not set
8715
9132
  * one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
8716
9133
  * `Help`.
8717
9134
  */
@@ -8848,14 +9265,16 @@ declare namespace Electron {
8848
9265
  toolTip: string;
8849
9266
  /**
8850
9267
  * A `string` indicating the type of the item. Can be `normal`, `separator`,
8851
- * `submenu`, `checkbox` or `radio`.
9268
+ * `submenu`, `checkbox`, `radio`, `header` or `palette`.
9269
+ *
9270
+ * > [!NOTE] `header` and `palette` are only available on macOS 14 and up.
8852
9271
  */
8853
- type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
9272
+ type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio' | 'header' | 'palette');
8854
9273
  /**
8855
9274
  * An `Accelerator | null` indicating the item's user-assigned accelerator for the
8856
9275
  * menu item.
8857
9276
  *
8858
- * **Note:** This property is only initialized after the `MenuItem` has been added
9277
+ * > [!NOTE] This property is only initialized after the `MenuItem` has been added
8859
9278
  * to a `Menu`. Either via `Menu.buildFromTemplate` or via
8860
9279
  * `Menu.append()/insert()`. Accessing before initialization will just return
8861
9280
  * `null`.
@@ -9032,15 +9451,15 @@ declare namespace Electron {
9032
9451
  */
9033
9452
  static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
9034
9453
  /**
9035
- * Creates a new `NativeImage` instance from a file located at `path`. This method
9036
- * returns an empty image if the `path` does not exist, cannot be read, or is not a
9037
- * valid image.
9454
+ * Creates a new `NativeImage` instance from an image file (e.g., PNG or JPEG)
9455
+ * located at `path`. This method returns an empty image if the `path` does not
9456
+ * exist, cannot be read, or is not a valid image.
9038
9457
  */
9039
9458
  static createFromPath(path: string): NativeImage;
9040
9459
  /**
9041
9460
  * fulfilled with the file's thumbnail preview image, which is a NativeImage.
9042
9461
  *
9043
- * Note: The Windows implementation will ignore `size.height` and scale the height
9462
+ * > [!NOTE] Windows implementation will ignore `size.height` and scale the height
9044
9463
  * according to `size.width`.
9045
9464
  *
9046
9465
  * @platform darwin,win32
@@ -9064,13 +9483,11 @@ declare namespace Electron {
9064
9483
  */
9065
9484
  getAspectRatio(scaleFactor?: number): number;
9066
9485
  /**
9067
- * A Buffer that contains the image's raw bitmap pixel data.
9486
+ * Legacy alias for `image.toBitmap()`.
9068
9487
  *
9069
- * The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does
9070
- * not copy the bitmap data, so you have to use the returned Buffer immediately in
9071
- * current event loop tick; otherwise the data might be changed or destroyed.
9488
+ * @deprecated
9072
9489
  */
9073
- getBitmap(options?: BitmapOptions): Buffer;
9490
+ getBitmap(options?: BitmapOptions): void;
9074
9491
  /**
9075
9492
  * A Buffer that stores C pointer to underlying native handle of the image. On
9076
9493
  * macOS, a pointer to `NSImage` instance is returned.
@@ -9174,6 +9591,17 @@ declare namespace Electron {
9174
9591
  *
9175
9592
  */
9176
9593
  readonly shouldUseDarkColors: boolean;
9594
+ /**
9595
+ * A `boolean` property indicating whether or not the system theme has been set to
9596
+ * dark or light.
9597
+ *
9598
+ * On Windows this property distinguishes between system and app light/dark theme,
9599
+ * returning `true` if the system theme is set to dark theme and `false` otherwise.
9600
+ * On macOS the return value will be the same as `nativeTheme.shouldUseDarkColors`.
9601
+ *
9602
+ * @platform darwin,win32
9603
+ */
9604
+ readonly shouldUseDarkColorsForSystemIntegratedUI: boolean;
9177
9605
  /**
9178
9606
  * A `boolean` for if the OS / Chromium currently has high-contrast mode enabled or
9179
9607
  * is being instructed to show a high-contrast UI.
@@ -9345,7 +9773,7 @@ declare namespace Electron {
9345
9773
  * intercepted request to the built-in handler. webRequest handlers will still be
9346
9774
  * triggered when bypassing custom protocols.
9347
9775
  *
9348
- * Note: in the utility process custom protocols are not supported.
9776
+ * > [!NOTE] In the utility process, custom protocols are not supported.
9349
9777
  */
9350
9778
  fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
9351
9779
  /**
@@ -9932,23 +10360,23 @@ declare namespace Electron {
9932
10360
  *
9933
10361
  * @platform darwin,win32
9934
10362
  */
9935
- on(event: 'speed-limit-change', listener: () => void): this;
10363
+ on(event: 'speed-limit-change', listener: (details: Event<PowerMonitorSpeedLimitChangeEventParams>) => void): this;
9936
10364
  /**
9937
10365
  * @platform darwin,win32
9938
10366
  */
9939
- off(event: 'speed-limit-change', listener: () => void): this;
10367
+ off(event: 'speed-limit-change', listener: (details: Event<PowerMonitorSpeedLimitChangeEventParams>) => void): this;
9940
10368
  /**
9941
10369
  * @platform darwin,win32
9942
10370
  */
9943
- once(event: 'speed-limit-change', listener: () => void): this;
10371
+ once(event: 'speed-limit-change', listener: (details: Event<PowerMonitorSpeedLimitChangeEventParams>) => void): this;
9944
10372
  /**
9945
10373
  * @platform darwin,win32
9946
10374
  */
9947
- addListener(event: 'speed-limit-change', listener: () => void): this;
10375
+ addListener(event: 'speed-limit-change', listener: (details: Event<PowerMonitorSpeedLimitChangeEventParams>) => void): this;
9948
10376
  /**
9949
10377
  * @platform darwin,win32
9950
10378
  */
9951
- removeListener(event: 'speed-limit-change', listener: () => void): this;
10379
+ removeListener(event: 'speed-limit-change', listener: (details: Event<PowerMonitorSpeedLimitChangeEventParams>) => void): this;
9952
10380
  /**
9953
10381
  * Emitted when the system is suspending.
9954
10382
  */
@@ -10108,7 +10536,7 @@ declare namespace Electron {
10108
10536
  * Starts preventing the system from entering lower-power mode. Returns an integer
10109
10537
  * identifying the power save blocker.
10110
10538
  *
10111
- * **Note:** `prevent-display-sleep` has higher precedence over
10539
+ * > [!NOTE] `prevent-display-sleep` has higher precedence over
10112
10540
  * `prevent-app-suspension`. Only the highest precedence type takes effect. In
10113
10541
  * other words, `prevent-display-sleep` always takes precedence over
10114
10542
  * `prevent-app-suspension`.
@@ -10126,6 +10554,44 @@ declare namespace Electron {
10126
10554
  stop(id: number): boolean;
10127
10555
  }
10128
10556
 
10557
+ interface PreloadScript {
10558
+
10559
+ // Docs: https://electronjs.org/docs/api/structures/preload-script
10560
+
10561
+ /**
10562
+ * Path of the script file. Must be an absolute path.
10563
+ */
10564
+ filePath: string;
10565
+ /**
10566
+ * Unique ID of preload script.
10567
+ */
10568
+ id: string;
10569
+ /**
10570
+ * Context type where the preload script will be executed. Possible values include
10571
+ * `frame` or `service-worker`.
10572
+ */
10573
+ type: ('frame' | 'service-worker');
10574
+ }
10575
+
10576
+ interface PreloadScriptRegistration {
10577
+
10578
+ // Docs: https://electronjs.org/docs/api/structures/preload-script-registration
10579
+
10580
+ /**
10581
+ * Path of the script file. Must be an absolute path.
10582
+ */
10583
+ filePath: string;
10584
+ /**
10585
+ * Unique ID of preload script. Defaults to a random UUID.
10586
+ */
10587
+ id?: string;
10588
+ /**
10589
+ * Context type where the preload script will be executed. Possible values include
10590
+ * `frame` or `service-worker`.
10591
+ */
10592
+ type: ('frame' | 'service-worker');
10593
+ }
10594
+
10129
10595
  interface PrinterInfo {
10130
10596
 
10131
10597
  // Docs: https://electronjs.org/docs/api/structures/printer-info
@@ -10138,10 +10604,6 @@ declare namespace Electron {
10138
10604
  * the name of the printer as shown in Print Preview.
10139
10605
  */
10140
10606
  displayName: string;
10141
- /**
10142
- * whether or not a given printer is set as the default printer on the OS.
10143
- */
10144
- isDefault: boolean;
10145
10607
  /**
10146
10608
  * the name of the printer as understood by the OS.
10147
10609
  */
@@ -10150,10 +10612,6 @@ declare namespace Electron {
10150
10612
  * an object containing a variable number of platform-specific printer information.
10151
10613
  */
10152
10614
  options: Options;
10153
- /**
10154
- * the current status of the printer.
10155
- */
10156
- status: number;
10157
10615
  }
10158
10616
 
10159
10617
  interface ProcessMemoryInfo {
@@ -10459,7 +10917,7 @@ declare namespace Electron {
10459
10917
  */
10460
10918
  registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
10461
10919
  /**
10462
- * **Note:** This method can only be used before the `ready` event of the `app`
10920
+ * > [!NOTE] This method can only be used before the `ready` event of the `app`
10463
10921
  * module gets emitted and can be called only once.
10464
10922
  *
10465
10923
  * Registers the `scheme` as standard, secure, bypasses content security policy for
@@ -10603,9 +11061,8 @@ declare namespace Electron {
10603
11061
  */
10604
11062
  referrer?: string;
10605
11063
  /**
10606
- * The session used for requesting URL, by default the HTTP request will reuse the
10607
- * current session. Setting `session` to `null` would use a random independent
10608
- * session. This is only used for URL responses.
11064
+ * The session used for requesting URL. The HTTP request will reuse the current
11065
+ * session by default.
10609
11066
  */
10610
11067
  session?: Session;
10611
11068
  /**
@@ -10822,7 +11279,8 @@ declare namespace Electron {
10822
11279
  * line flag is provided `--password-store="kwallet"`.
10823
11280
  * * `kwallet5` - When the desktop session is `kde5` or if the following command
10824
11281
  * line flag is provided `--password-store="kwallet5"`.
10825
- * * `kwallet6` - When the desktop session is `kde6`.
11282
+ * * `kwallet6` - When the desktop session is `kde6` or if the following command
11283
+ * line flag is provided `--password-store="kwallet6"`.
10826
11284
  * * `unknown` - When the function is called before app has emitted the `ready`
10827
11285
  * event.
10828
11286
  *
@@ -10900,7 +11358,9 @@ declare namespace Electron {
10900
11358
  * Converts a screen DIP point to a screen physical point. The DPI scale is
10901
11359
  * performed relative to the display containing the DIP point.
10902
11360
  *
10903
- * @platform win32
11361
+ * Not currently supported on Wayland.
11362
+ *
11363
+ * @platform win32,linux
10904
11364
  */
10905
11365
  dipToScreenPoint(point: Point): Point;
10906
11366
  /**
@@ -10918,7 +11378,7 @@ declare namespace Electron {
10918
11378
  /**
10919
11379
  * The current absolute position of the mouse pointer.
10920
11380
  *
10921
- * **Note:** The return value is a DIP point, not a screen physical point.
11381
+ * > [!NOTE] The return value is a DIP point, not a screen physical point.
10922
11382
  */
10923
11383
  getCursorScreenPoint(): Point;
10924
11384
  /**
@@ -10937,7 +11397,10 @@ declare namespace Electron {
10937
11397
  * Converts a screen physical point to a screen DIP point. The DPI scale is
10938
11398
  * performed relative to the display containing the physical point.
10939
11399
  *
10940
- * @platform win32
11400
+ * Not currently supported on Wayland - if used there it will return the point
11401
+ * passed in with no changes.
11402
+ *
11403
+ * @platform win32,linux
10941
11404
  */
10942
11405
  screenToDipPoint(point: Point): Point;
10943
11406
  /**
@@ -11042,6 +11505,69 @@ declare namespace Electron {
11042
11505
  * The full URL to the script that this service worker runs
11043
11506
  */
11044
11507
  scriptUrl: string;
11508
+ /**
11509
+ * ID of the service worker version
11510
+ */
11511
+ versionId: number;
11512
+ }
11513
+
11514
+ class ServiceWorkerMain {
11515
+
11516
+ // Docs: https://electronjs.org/docs/api/service-worker-main
11517
+
11518
+ /**
11519
+ * Whether the service worker has been destroyed.
11520
+ *
11521
+ * @experimental
11522
+ */
11523
+ isDestroyed(): boolean;
11524
+ /**
11525
+ * Send an asynchronous message to the service worker process via `channel`, along
11526
+ * with arguments. Arguments will be serialized with the Structured Clone
11527
+ * Algorithm, just like `postMessage`, so prototype chains will not be included.
11528
+ * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
11529
+ * exception.
11530
+ *
11531
+ * The service worker process can handle the message by listening to `channel` with
11532
+ * the `ipcRenderer` module.
11533
+ *
11534
+ * @experimental
11535
+ */
11536
+ send(channel: string, ...args: any[]): void;
11537
+ /**
11538
+ * * `end` Function - Method to call when the task has ended. If never called, the
11539
+ * service won't terminate while otherwise idle.
11540
+ *
11541
+ * Initiate a task to keep the service worker alive until ended.
11542
+ *
11543
+ * @experimental
11544
+ */
11545
+ startTask(): StartTask;
11546
+ /**
11547
+ * An `IpcMainServiceWorker` instance scoped to the service worker.
11548
+ *
11549
+ * @experimental
11550
+ */
11551
+ readonly ipc: IpcMainServiceWorker;
11552
+ /**
11553
+ * A `string` representing the scope URL of the service worker.
11554
+ *
11555
+ * @experimental
11556
+ */
11557
+ readonly scope: string;
11558
+ /**
11559
+ * A `string` representing the script URL of the service worker.
11560
+ *
11561
+ * @experimental
11562
+ */
11563
+ readonly scriptURL: string;
11564
+ /**
11565
+ * A `number` representing the ID of the specific version of the service worker
11566
+ * script in its scope.
11567
+ *
11568
+ * @experimental
11569
+ */
11570
+ readonly versionId: number;
11045
11571
  }
11046
11572
 
11047
11573
  class ServiceWorkers extends NodeEventEmitter {
@@ -11106,6 +11632,28 @@ declare namespace Electron {
11106
11632
  * Information about the registered service worker
11107
11633
  */
11108
11634
  details: RegistrationCompletedDetails) => void): this;
11635
+ /**
11636
+ * Emitted when a service worker's running status has changed.
11637
+ *
11638
+ * @experimental
11639
+ */
11640
+ on(event: 'running-status-changed', listener: (details: Event<ServiceWorkersRunningStatusChangedEventParams>) => void): this;
11641
+ /**
11642
+ * @experimental
11643
+ */
11644
+ off(event: 'running-status-changed', listener: (details: Event<ServiceWorkersRunningStatusChangedEventParams>) => void): this;
11645
+ /**
11646
+ * @experimental
11647
+ */
11648
+ once(event: 'running-status-changed', listener: (details: Event<ServiceWorkersRunningStatusChangedEventParams>) => void): this;
11649
+ /**
11650
+ * @experimental
11651
+ */
11652
+ addListener(event: 'running-status-changed', listener: (details: Event<ServiceWorkersRunningStatusChangedEventParams>) => void): this;
11653
+ /**
11654
+ * @experimental
11655
+ */
11656
+ removeListener(event: 'running-status-changed', listener: (details: Event<ServiceWorkersRunningStatusChangedEventParams>) => void): this;
11109
11657
  /**
11110
11658
  * A ServiceWorkerInfo object where the keys are the service worker version ID and
11111
11659
  * the values are the information about that service worker.
@@ -11116,8 +11664,35 @@ declare namespace Electron {
11116
11664
  *
11117
11665
  * If the service worker does not exist or is not running this method will throw an
11118
11666
  * exception.
11667
+ *
11668
+ * **Deprecated:** Use the new `serviceWorkers.getInfoFromVersionID` API.
11669
+ *
11670
+ * @deprecated
11119
11671
  */
11120
11672
  getFromVersionID(versionId: number): ServiceWorkerInfo;
11673
+ /**
11674
+ * Information about this service worker
11675
+ *
11676
+ * If the service worker does not exist or is not running this method will throw an
11677
+ * exception.
11678
+ */
11679
+ getInfoFromVersionID(versionId: number): ServiceWorkerInfo;
11680
+ /**
11681
+ * Instance of the service worker associated with the given version ID. If there's
11682
+ * no associated version, or its running status has changed to 'stopped', this will
11683
+ * return `undefined`.
11684
+ *
11685
+ * @experimental
11686
+ */
11687
+ getWorkerFromVersionID(versionId: number): (ServiceWorkerMain) | (undefined);
11688
+ /**
11689
+ * Resolves with the service worker when it's started.
11690
+ *
11691
+ * Starts the service worker or does nothing if already running.
11692
+ *
11693
+ * @experimental
11694
+ */
11695
+ startWorkerForScope(scope: string): Promise<Electron.ServiceWorkerMain>;
11121
11696
  }
11122
11697
 
11123
11698
  class Session extends NodeEventEmitter {
@@ -11650,8 +12225,8 @@ declare namespace Electron {
11650
12225
  * Whether the word was successfully written to the custom dictionary. This API
11651
12226
  * will not work on non-persistent (in-memory) sessions.
11652
12227
  *
11653
- * **Note:** On macOS and Windows 10 this word will be written to the OS custom
11654
- * dictionary as well
12228
+ * > [!NOTE] On macOS and Windows, this word will be written to the OS custom
12229
+ * dictionary as well.
11655
12230
  */
11656
12231
  addWordToSpellCheckerDictionary(word: string): boolean;
11657
12232
  /**
@@ -11681,7 +12256,7 @@ declare namespace Electron {
11681
12256
  * This method clears more types of data and is more thorough than the
11682
12257
  * `clearStorageData` method.
11683
12258
  *
11684
- * **Note:** Cookies are stored at a broader scope than origins. When removing
12259
+ * > [!NOTE] Cookies are stored at a broader scope than origins. When removing
11685
12260
  * cookies and filtering by `origins` (or `excludeOrigins`), the cookies will be
11686
12261
  * removed at the registrable domain level. For example, clearing cookies for the
11687
12262
  * origin `https://really.specific.origin.example.com/` will end up clearing all
@@ -11689,7 +12264,7 @@ declare namespace Electron {
11689
12264
  * `https://my.website.example.co.uk/` will end up clearing all cookies for
11690
12265
  * `example.co.uk`.
11691
12266
  *
11692
- * **Note:** Clearing cache data will also clear the shared dictionary cache. This
12267
+ * > [!NOTE] Clearing cache data will also clear the shared dictionary cache. This
11693
12268
  * means that any dictionaries used for compression may be reloaded after clearing
11694
12269
  * the cache. If you wish to clear the shared dictionary cache but leave other
11695
12270
  * cached data intact, you may want to use the `clearSharedDictionaryCache` method.
@@ -11719,7 +12294,7 @@ declare namespace Electron {
11719
12294
  /**
11720
12295
  * Resolves when all connections are closed.
11721
12296
  *
11722
- * **Note:** It will terminate / fail all requests currently in flight.
12297
+ * > [!NOTE] It will terminate / fail all requests currently in flight.
11723
12298
  */
11724
12299
  closeAllConnections(): Promise<void>;
11725
12300
  /**
@@ -11739,7 +12314,7 @@ declare namespace Electron {
11739
12314
  * Initiates a download of the resource at `url`. The API will generate a
11740
12315
  * DownloadItem that can be accessed with the will-download event.
11741
12316
  *
11742
- * **Note:** This does not perform any security checks that relate to a page's
12317
+ * > [!NOTE] This does not perform any security checks that relate to a page's
11743
12318
  * origin, unlike `webContents.downloadURL`.
11744
12319
  */
11745
12320
  downloadURL(url: string, options?: DownloadURLOptions): void;
@@ -11788,8 +12363,12 @@ declare namespace Electron {
11788
12363
  /**
11789
12364
  * A list of all loaded extensions.
11790
12365
  *
11791
- * **Note:** This API cannot be called before the `ready` event of the `app` module
12366
+ * > [!NOTE] This API cannot be called before the `ready` event of the `app` module
11792
12367
  * is emitted.
12368
+ *
12369
+ * **Deprecated:** Use the new `ses.extensions.getAllExtensions` API.
12370
+ *
12371
+ * @deprecated
11793
12372
  */
11794
12373
  getAllExtensions(): Extension[];
11795
12374
  /**
@@ -11803,14 +12382,27 @@ declare namespace Electron {
11803
12382
  /**
11804
12383
  * The loaded extension with the given ID.
11805
12384
  *
11806
- * **Note:** This API cannot be called before the `ready` event of the `app` module
12385
+ * > [!NOTE] This API cannot be called before the `ready` event of the `app` module
11807
12386
  * is emitted.
12387
+ *
12388
+ * **Deprecated:** Use the new `ses.extensions.getExtension` API.
12389
+ *
12390
+ * @deprecated
11808
12391
  */
11809
12392
  getExtension(extensionId: string): (Extension) | (null);
11810
12393
  /**
11811
12394
  * an array of paths to preload scripts that have been registered.
12395
+ *
12396
+ * **Deprecated:** Use the new `ses.getPreloadScripts` API. This will only return
12397
+ * preload script paths for `frame` context types.
12398
+ *
12399
+ * @deprecated
11812
12400
  */
11813
12401
  getPreloads(): string[];
12402
+ /**
12403
+ * An array of paths to preload scripts that have been registered.
12404
+ */
12405
+ getPreloadScripts(): PreloadScript[];
11814
12406
  /**
11815
12407
  * an array of shared dictionary information entries in Chromium's networking
11816
12408
  * service's storage.
@@ -11839,7 +12431,7 @@ declare namespace Electron {
11839
12431
  * this setting is an empty list Electron will try to populate this setting with
11840
12432
  * the current OS locale. This setting is persisted across restarts.
11841
12433
  *
11842
- * **Note:** On macOS the OS spellchecker is used and has its own list of
12434
+ * > [!NOTE] On macOS, the OS spellchecker is used and has its own list of
11843
12435
  * languages. On macOS, this API will return whichever languages have been
11844
12436
  * configured by the OS.
11845
12437
  */
@@ -11886,30 +12478,46 @@ declare namespace Electron {
11886
12478
  *
11887
12479
  * This API does not support loading packed (.crx) extensions.
11888
12480
  *
11889
- * **Note:** This API cannot be called before the `ready` event of the `app` module
12481
+ * > [!NOTE] This API cannot be called before the `ready` event of the `app` module
11890
12482
  * is emitted.
11891
12483
  *
11892
- * **Note:** Loading extensions into in-memory (non-persistent) sessions is not
12484
+ * > [!NOTE] Loading extensions into in-memory (non-persistent) sessions is not
11893
12485
  * supported and will throw an error.
12486
+ *
12487
+ * **Deprecated:** Use the new `ses.extensions.loadExtension` API.
12488
+ *
12489
+ * @deprecated
11894
12490
  */
11895
12491
  loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
11896
12492
  /**
11897
12493
  * Preconnects the given number of sockets to an origin.
11898
12494
  */
11899
12495
  preconnect(options: PreconnectOptions): void;
12496
+ /**
12497
+ * Registers preload script that will be executed in its associated context type in
12498
+ * this session. For `frame` contexts, this will run prior to any preload defined
12499
+ * in the web preferences of a WebContents.
12500
+ *
12501
+ * The ID of the registered preload script.
12502
+ */
12503
+ registerPreloadScript(script: PreloadScriptRegistration): string;
11900
12504
  /**
11901
12505
  * Unloads an extension.
11902
12506
  *
11903
- * **Note:** This API cannot be called before the `ready` event of the `app` module
12507
+ * > [!NOTE] This API cannot be called before the `ready` event of the `app` module
11904
12508
  * is emitted.
12509
+ *
12510
+ * **Deprecated:** Use the new `ses.extensions.removeExtension` API.
12511
+ *
12512
+ * @deprecated
11905
12513
  */
11906
12514
  removeExtension(extensionId: string): void;
11907
12515
  /**
11908
12516
  * Whether the word was successfully removed from the custom dictionary. This API
11909
12517
  * will not work on non-persistent (in-memory) sessions.
11910
12518
  *
11911
- * **Note:** On macOS and Windows 10 this word will be removed from the OS custom
11912
- * dictionary as well
12519
+ * > [!NOTE] On macOS and Windows, this word will be removed from the OS custom
12520
+ * dictionary as well.
11913
12521
  */
11914
12522
  removeWordFromSpellCheckerDictionary(word: string): boolean;
11915
12523
  /**
@@ -12015,6 +12623,10 @@ declare namespace Electron {
12015
12623
  /**
12016
12624
  * Adds scripts that will be executed on ALL web contents that are associated with
12017
12625
  * this session just before normal `preload` scripts run.
12626
+ *
12627
+ * **Deprecated:** Use the new `ses.registerPreloadScript` API.
12628
+ *
12629
+ * @deprecated
12018
12630
  */
12019
12631
  setPreloads(preloads: string[]): void;
12020
12632
  /**
@@ -12045,8 +12657,8 @@ declare namespace Electron {
12045
12657
  * Please note the trailing slash. The URL to the dictionaries is formed as
12046
12658
  * `${url}${filename}`.
12047
12659
  *
12048
- * **Note:** On macOS the OS spellchecker is used and therefore we do not download
12049
- * any dictionary files. This API is a no-op on macOS.
12660
+ * > [!NOTE] On macOS, the OS spellchecker is used and therefore we do not download
12661
+ * any dictionary files. This API is a no-op on macOS.
12050
12662
  */
12051
12663
  setSpellCheckerDictionaryDownloadURL(url: string): void;
12052
12664
  /**
@@ -12059,8 +12671,8 @@ declare namespace Electron {
12059
12671
  * must call this API with an array of language codes. You can get the list of
12060
12672
  * supported language codes with the `ses.availableSpellCheckerLanguages` property.
12061
12673
  *
12062
- * **Note:** On macOS the OS spellchecker is used and will detect your language
12063
- * automatically. This API is a no-op on macOS.
12674
+ * > [!NOTE] On macOS, the OS spellchecker is used and will detect your language
12675
+ * automatically. This API is a no-op on macOS.
12064
12676
  */
12065
12677
  setSpellCheckerLanguages(languages: string[]): void;
12066
12678
  /**
@@ -12100,6 +12712,10 @@ declare namespace Electron {
12100
12712
  * `webContents.setUserAgent` to override the session-wide user agent.
12101
12713
  */
12102
12714
  setUserAgent(userAgent: string, acceptLanguages?: string): void;
12715
+ /**
12716
+ * Unregisters script.
12717
+ */
12718
+ unregisterPreloadScript(id: string): void;
12103
12719
  /**
12104
12720
  * A `string[]` array which consists of all the known available spell checker
12105
12721
  * languages. Providing a language code to the `setSpellCheckerLanguages` API that
@@ -12112,6 +12728,11 @@ declare namespace Electron {
12112
12728
  *
12113
12729
  */
12114
12730
  readonly cookies: Cookies;
12731
+ /**
12732
+ * A `Extensions` object for this session.
12733
+ *
12734
+ */
12735
+ readonly extensions: Extensions;
12115
12736
  /**
12116
12737
  * A `NetLog` object for this session.
12117
12738
  *
@@ -12550,15 +13171,6 @@ declare namespace Electron {
12550
13171
  * @platform darwin
12551
13172
  */
12552
13173
  getUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type): UserDefaultTypes[Type];
12553
- /**
12554
- * `true` if DWM composition (Aero Glass) is enabled, and `false` otherwise.
12555
- *
12556
- * An example of using it to determine if you should create a transparent window or
12557
- * not (transparent windows won't work correctly when DWM composition is disabled):
12558
- *
12559
- * @platform win32
12560
- */
12561
- isAeroGlassEnabled(): boolean;
12562
13174
  /**
12563
13175
  * Whether the Swipe between pages setting is on.
12564
13176
  *
@@ -13759,7 +14371,7 @@ declare namespace Electron {
13759
14371
  /**
13760
14372
  * Emitted when the mouse is released from clicking the tray icon.
13761
14373
  *
13762
- * Note: This will not be emitted if you have set a context menu for your Tray
14374
+ * > [!NOTE] This will not be emitted if you have set a context menu for your Tray
13763
14375
  * using `tray.setContextMenu`, as a result of macOS-level constraints.
13764
14376
  *
13765
14377
  * @platform darwin
@@ -13940,7 +14552,8 @@ declare namespace Electron {
13940
14552
  */
13941
14553
  setTitle(title: string, options?: TitleOptions): void;
13942
14554
  /**
13943
- * Sets the hover text for this tray icon.
14555
+ * Sets the hover text for this tray icon. Setting the text to an empty string will
14556
+ * remove the tooltip.
13944
14557
  */
13945
14558
  setToolTip(toolTip: string): void;
13946
14559
  }
@@ -14089,7 +14702,7 @@ declare namespace Electron {
14089
14702
  // Docs: https://electronjs.org/docs/api/utility-process
14090
14703
 
14091
14704
  /**
14092
- * **Note:** `utilityProcess.fork` can only be called after the `ready` event has
14705
+ * > [!NOTE] `utilityProcess.fork` can only be called after the `ready` event has
14093
14706
  * been emitted on `App`.
14094
14707
  */
14095
14708
  static fork(modulePath: string, args?: string[], options?: ForkOptions): UtilityProcess;
@@ -14248,7 +14861,7 @@ declare namespace Electron {
14248
14861
  * `undefined`. When the child process exits, then the value is `undefined` after
14249
14862
  * the `exit` event is emitted.
14250
14863
  *
14251
- * **Note:** You can use the `pid` to determine if the process is currently
14864
+ * > [!NOTE] You can use the `pid` to determine if the process is currently
14252
14865
  * running.
14253
14866
  */
14254
14867
  pid: (number) | (undefined);
@@ -14329,12 +14942,12 @@ declare namespace Electron {
14329
14942
  * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
14330
14943
  * * e.g. `blueviolet` or `red`
14331
14944
  *
14332
- * **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
14945
+ * > [!NOTE] Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
14333
14946
  * `RGB`.
14334
14947
  */
14335
14948
  setBackgroundColor(color: string): void;
14336
14949
  /**
14337
- * **Note:** The area cutout of the view's border still captures clicks.
14950
+ * > [!NOTE] The area cutout of the view's border still captures clicks.
14338
14951
  */
14339
14952
  setBorderRadius(radius: number): void;
14340
14953
  setBounds(bounds: Rectangle): void;
@@ -14417,6 +15030,21 @@ declare namespace Electron {
14417
15030
  * Input properties.
14418
15031
  */
14419
15032
  input: Input) => void): this;
15033
+ /**
15034
+ * Emitted before dispatching mouse events in the page.
15035
+ *
15036
+ * Calling `event.preventDefault` will prevent the page mouse events.
15037
+ */
15038
+ on(event: 'before-mouse-event', listener: (event: Event,
15039
+ mouse: MouseInputEvent) => void): this;
15040
+ off(event: 'before-mouse-event', listener: (event: Event,
15041
+ mouse: MouseInputEvent) => void): this;
15042
+ once(event: 'before-mouse-event', listener: (event: Event,
15043
+ mouse: MouseInputEvent) => void): this;
15044
+ addListener(event: 'before-mouse-event', listener: (event: Event,
15045
+ mouse: MouseInputEvent) => void): this;
15046
+ removeListener(event: 'before-mouse-event', listener: (event: Event,
15047
+ mouse: MouseInputEvent) => void): this;
14420
15048
  /**
14421
15049
  * Emitted when the `WebContents` loses focus.
14422
15050
  */
@@ -14478,80 +15106,125 @@ declare namespace Electron {
14478
15106
  /**
14479
15107
  * Emitted when the associated window logs a console message.
14480
15108
  */
14481
- on(event: 'console-message', listener: (event: Event,
15109
+ on(event: 'console-message', listener: (details: Event<WebContentsConsoleMessageEventParams>,
14482
15110
  /**
14483
15111
  * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14484
15112
  * `error`.
15113
+ *
15114
+ * @deprecated
14485
15115
  */
14486
15116
  level: number,
14487
15117
  /**
14488
15118
  * The actual console message
15119
+ *
15120
+ * @deprecated
14489
15121
  */
14490
15122
  message: string,
14491
15123
  /**
14492
15124
  * The line number of the source that triggered this console message
15125
+ *
15126
+ * @deprecated
14493
15127
  */
14494
15128
  line: number,
15129
+ /**
15130
+ * @deprecated
15131
+ */
14495
15132
  sourceId: string) => void): this;
14496
- off(event: 'console-message', listener: (event: Event,
15133
+ off(event: 'console-message', listener: (details: Event<WebContentsConsoleMessageEventParams>,
14497
15134
  /**
14498
15135
  * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14499
15136
  * `error`.
15137
+ *
15138
+ * @deprecated
14500
15139
  */
14501
15140
  level: number,
14502
15141
  /**
14503
15142
  * The actual console message
15143
+ *
15144
+ * @deprecated
14504
15145
  */
14505
15146
  message: string,
14506
15147
  /**
14507
15148
  * The line number of the source that triggered this console message
15149
+ *
15150
+ * @deprecated
14508
15151
  */
14509
15152
  line: number,
15153
+ /**
15154
+ * @deprecated
15155
+ */
14510
15156
  sourceId: string) => void): this;
14511
- once(event: 'console-message', listener: (event: Event,
15157
+ once(event: 'console-message', listener: (details: Event<WebContentsConsoleMessageEventParams>,
14512
15158
  /**
14513
15159
  * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14514
15160
  * `error`.
15161
+ *
15162
+ * @deprecated
14515
15163
  */
14516
15164
  level: number,
14517
15165
  /**
14518
15166
  * The actual console message
15167
+ *
15168
+ * @deprecated
14519
15169
  */
14520
15170
  message: string,
14521
15171
  /**
14522
15172
  * The line number of the source that triggered this console message
15173
+ *
15174
+ * @deprecated
14523
15175
  */
14524
15176
  line: number,
15177
+ /**
15178
+ * @deprecated
15179
+ */
14525
15180
  sourceId: string) => void): this;
14526
- addListener(event: 'console-message', listener: (event: Event,
15181
+ addListener(event: 'console-message', listener: (details: Event<WebContentsConsoleMessageEventParams>,
14527
15182
  /**
14528
15183
  * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14529
15184
  * `error`.
15185
+ *
15186
+ * @deprecated
14530
15187
  */
14531
15188
  level: number,
14532
15189
  /**
14533
15190
  * The actual console message
15191
+ *
15192
+ * @deprecated
14534
15193
  */
14535
15194
  message: string,
14536
15195
  /**
14537
15196
  * The line number of the source that triggered this console message
15197
+ *
15198
+ * @deprecated
14538
15199
  */
14539
15200
  line: number,
15201
+ /**
15202
+ * @deprecated
15203
+ */
14540
15204
  sourceId: string) => void): this;
14541
- removeListener(event: 'console-message', listener: (event: Event,
15205
+ removeListener(event: 'console-message', listener: (details: Event<WebContentsConsoleMessageEventParams>,
14542
15206
  /**
14543
15207
  * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
14544
15208
  * `error`.
15209
+ *
15210
+ * @deprecated
14545
15211
  */
14546
15212
  level: number,
14547
15213
  /**
14548
15214
  * The actual console message
15215
+ *
15216
+ * @deprecated
14549
15217
  */
14550
15218
  message: string,
14551
15219
  /**
14552
15220
  * The line number of the source that triggered this console message
15221
+ *
15222
+ * @deprecated
14553
15223
  */
14554
15224
  line: number,
15225
+ /**
15226
+ * @deprecated
15227
+ */
14555
15228
  sourceId: string) => void): this;
14556
15229
  /**
14557
15230
  * Emitted when the page calls `window.moveTo`, `window.resizeTo` or related APIs.
@@ -15596,6 +16269,10 @@ declare namespace Electron {
15596
16269
  * that you call `texture.release()` as soon as you're done with the texture. By
15597
16270
  * managing the texture lifecycle by yourself, you can safely pass the
15598
16271
  * `texture.textureInfo` to other processes through IPC.
16272
+ *
16273
+ * More details can be found in the offscreen rendering tutorial. To learn about
16274
+ * how to handle the texture in native code, refer to offscreen rendering's code
16275
+ * documentation..
15599
16276
  */
15600
16277
  on(event: 'paint', listener: (details: Event<WebContentsPaintEventParams>,
15601
16278
  dirtyRect: Rectangle,
@@ -15728,9 +16405,11 @@ declare namespace Electron {
15728
16405
  * the `deviceId` of the device to be selected. Passing an empty string to
15729
16406
  * `callback` will cancel the request.
15730
16407
  *
15731
- * If an event listener is not added for this event, or if `event.preventDefault`
15732
- * is not called when handling this event, the first available device will be
15733
- * automatically selected.
16408
+ * If no event listener is added for this event, all bluetooth requests will be
16409
+ * cancelled.
16410
+ *
16411
+ * If `event.preventDefault` is not called when handling this event, the first
16412
+ * available device will be automatically selected.
15734
16413
  *
15735
16414
  * Due to the nature of bluetooth, scanning for devices when
15736
16415
  * `navigator.bluetooth.requestDevice` is called may take time and will cause
@@ -16010,7 +16689,7 @@ declare namespace Electron {
16010
16689
  * Calling `event.preventDefault()` will ignore the `beforeunload` event handler
16011
16690
  * and allow the page to be unloaded.
16012
16691
  *
16013
- * **Note:** This will be emitted for `BrowserViews` but will _not_ be respected -
16692
+ * > [!NOTE] This will be emitted for `BrowserViews` but will _not_ be respected -
16014
16693
  * this is because we have chosen not to tie the `BrowserView` lifecycle to its
16015
16694
  * owning BrowserWindow should one exist per the specification.
16016
16695
  */
@@ -16684,8 +17363,10 @@ declare namespace Electron {
16684
17363
  */
16685
17364
  send(channel: string, ...args: any[]): void;
16686
17365
  /**
16687
- * Sends an input `event` to the page. **Note:** The `BrowserWindow` containing the
16688
- * contents needs to be focused for `sendInputEvent()` to work.
17366
+ * Sends an input `event` to the page.
17367
+ *
17368
+ * > [!NOTE] The `BrowserWindow` containing the contents needs to be focused for
17369
+ * `sendInputEvent()` to work.
16689
17370
  */
16690
17371
  sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
16691
17372
  /**
@@ -16767,8 +17448,7 @@ declare namespace Electron {
16767
17448
  /**
16768
17449
  * Sets the maximum and minimum pinch-to-zoom level.
16769
17450
  *
16770
- * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
16771
- * call:
17451
+ * > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
16772
17452
  */
16773
17453
  setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
16774
17454
  /**
@@ -16778,8 +17458,10 @@ declare namespace Electron {
16778
17458
  setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
16779
17459
  /**
16780
17460
  * Setting the WebRTC UDP Port Range allows you to restrict the udp port range used
16781
- * by WebRTC. By default the port range is unrestricted. **Note:** To reset to an
16782
- * unrestricted port range this value should be set to `{ min: 0, max: 0 }`.
17461
+ * by WebRTC. By default the port range is unrestricted.
17462
+ *
17463
+ * > [!NOTE] To reset to an unrestricted port range this value should be set to `{
17464
+ * min: 0, max: 0 }`.
16783
17465
  */
16784
17466
  setWebRTCUDPPortRange(udpPortRange: UdpPortRange): void;
16785
17467
  /**
@@ -16805,10 +17487,9 @@ declare namespace Electron {
16805
17487
  * limits of 300% and 50% of original size, respectively. The formula for this is
16806
17488
  * `scale := 1.2 ^ level`.
16807
17489
  *
16808
- * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
16809
- * the zoom level for a specific domain propagates across all instances of windows
16810
- * with the same domain. Differentiating the window URLs will make zoom work
16811
- * per-window.
17490
+ * > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
17491
+ * zoom level for a specific domain propagates across all instances of windows with
17492
+ * the same domain. Differentiating the window URLs will make zoom work per-window.
16812
17493
  */
16813
17494
  setZoomLevel(level: number): void;
16814
17495
  /**
@@ -16876,11 +17557,18 @@ declare namespace Electron {
16876
17557
  * A `WebContents | null` property that represents the of DevTools `WebContents`
16877
17558
  * associated with a given `WebContents`.
16878
17559
  *
16879
- * **Note:** Users should never store this object because it may become `null` when
17560
+ * > [!NOTE] Users should never store this object because it may become `null` when
16880
17561
  * the DevTools has been closed.
16881
17562
  *
16882
17563
  */
16883
17564
  readonly devToolsWebContents: (WebContents) | (null);
17565
+ /**
17566
+ * A `WebFrameMain | null` property that represents the currently focused frame in
17567
+ * this WebContents. Can be the top frame, an inner `<iframe>`, or `null` if
17568
+ * nothing is focused.
17569
+ *
17570
+ */
17571
+ readonly focusedFrame: (WebFrameMain) | (null);
16884
17572
  /**
16885
17573
  * An `Integer` property that sets the frame rate of the web contents to the
16886
17574
  * specified number. Only values between 1 and 240 are accepted.
@@ -17099,7 +17787,8 @@ declare namespace Electron {
17099
17787
  removeInsertedCSS(key: string): void;
17100
17788
  /**
17101
17789
  * Set the security origin, content security policy and name of the isolated world.
17102
- * Note: If the `csp` is specified, then the `securityOrigin` also has to be
17790
+ *
17791
+ * > [!NOTE] If the `csp` is specified, then the `securityOrigin` also has to be
17103
17792
  * specified.
17104
17793
  */
17105
17794
  setIsolatedWorldInfo(worldId: number, info: Info): void;
@@ -17120,10 +17809,9 @@ declare namespace Electron {
17120
17809
  /**
17121
17810
  * Sets the maximum and minimum pinch-to-zoom level.
17122
17811
  *
17123
- * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
17124
- * call:
17812
+ * > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
17125
17813
  *
17126
- * > **NOTE**: Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
17814
+ * > [!NOTE] Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
17127
17815
  * shortcuts are controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem
17128
17816
  * roles in the application Menu. To disable shortcuts, manually define the Menu
17129
17817
  * and omit zoom roles from the definition.
@@ -17141,10 +17829,9 @@ declare namespace Electron {
17141
17829
  * increment above or below represents zooming 20% larger or smaller to default
17142
17830
  * limits of 300% and 50% of original size, respectively.
17143
17831
  *
17144
- * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
17145
- * the zoom level for a specific domain propagates across all instances of windows
17146
- * with the same domain. Differentiating the window URLs will make zoom work
17147
- * per-window.
17832
+ * > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
17833
+ * zoom level for a specific domain propagates across all instances of windows with
17834
+ * the same domain. Differentiating the window URLs will make zoom work per-window.
17148
17835
  */
17149
17836
  setZoomLevel(level: number): void;
17150
17837
  /**
@@ -17739,6 +18426,10 @@ declare namespace Electron {
17739
18426
 
17740
18427
  // Docs: https://electronjs.org/docs/api/structures/web-request-filter
17741
18428
 
18429
+ /**
18430
+ * Array of URL patterns used to exclude requests that match these patterns.
18431
+ */
18432
+ excludeUrls?: string[];
17742
18433
  /**
17743
18434
  * Array of types that will be used to filter out the requests that do not match
17744
18435
  * the types. When not specified, all types will be matched. Can be `mainFrame`,
@@ -17747,8 +18438,8 @@ declare namespace Electron {
17747
18438
  */
17748
18439
  types?: Array<'mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket'>;
17749
18440
  /**
17750
- * Array of URL patterns that will be used to filter out the requests that do not
17751
- * match the URL patterns.
18441
+ * Array of URL patterns used to include requests that match these patterns. Use
18442
+ * the pattern `<all_urls>` to match all URLs.
17752
18443
  */
17753
18444
  urls: string[];
17754
18445
  }
@@ -18297,10 +18988,9 @@ declare namespace Electron {
18297
18988
  * limits of 300% and 50% of original size, respectively. The formula for this is
18298
18989
  * `scale := 1.2 ^ level`.
18299
18990
  *
18300
- * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
18301
- * the zoom level for a specific domain propagates across all instances of windows
18302
- * with the same domain. Differentiating the window URLs will make zoom work
18303
- * per-window.
18991
+ * > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
18992
+ * zoom level for a specific domain propagates across all instances of windows with
18993
+ * the same domain. Differentiating the window URLs will make zoom work per-window.
18304
18994
  */
18305
18995
  setZoomLevel(level: number): void;
18306
18996
  /**
@@ -18453,6 +19143,17 @@ declare namespace Electron {
18453
19143
  overrideBrowserWindowOptions?: BrowserWindowConstructorOptions;
18454
19144
  }
18455
19145
 
19146
+ interface WindowSessionEndEvent extends Event {
19147
+
19148
+ // Docs: https://electronjs.org/docs/api/structures/window-session-end-event
19149
+
19150
+ /**
19151
+ * List of reasons for shutdown. Can be 'shutdown', 'close-app', 'critical', or
19152
+ * 'logoff'.
19153
+ */
19154
+ reasons: Array<'shutdown' | 'close-app' | 'critical' | 'logoff'>;
19155
+ }
19156
+
18456
19157
  interface AboutPanelOptionsOptions {
18457
19158
  /**
18458
19159
  * The app's name.
@@ -18760,10 +19461,10 @@ declare namespace Electron {
18760
19461
  */
18761
19462
  storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers' | 'cachestorage'>;
18762
19463
  /**
18763
- * The types of quotas to clear, can be `temporary`, `syncable`. If not specified,
18764
- * clear all quotas.
19464
+ * The types of quotas to clear, can be `temporary`. If not specified, clear all
19465
+ * quotas.
18765
19466
  */
18766
- quotas?: Array<'temporary' | 'syncable'>;
19467
+ quotas?: Array<'temporary'>;
18767
19468
  }
18768
19469
 
18769
19470
  interface ClientCertRequestParams {
@@ -18866,6 +19567,16 @@ declare namespace Electron {
18866
19567
  * `only-if-cached`.
18867
19568
  */
18868
19569
  cache?: ('default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached');
19570
+ /**
19571
+ * can be `throttled`, `idle`, `lowest`, `low`, `medium`, or `highest`. Defaults to
19572
+ * `idle`.
19573
+ */
19574
+ priority?: ('throttled' | 'idle' | 'lowest' | 'low' | 'medium' | 'highest');
19575
+ /**
19576
+ * the incremental loading flag as part of HTTP extensible priorities (RFC 9218).
19577
+ * Default is `true`.
19578
+ */
19579
+ priorityIncremental?: boolean;
18869
19580
  }
18870
19581
 
18871
19582
  interface CloseOpts {
@@ -18877,6 +19588,44 @@ declare namespace Electron {
18877
19588
  waitForBeforeUnload: boolean;
18878
19589
  }
18879
19590
 
19591
+ interface Collections {
19592
+ /**
19593
+ * An integer representing the usage ID component of the HID usage associated with
19594
+ * this collection.
19595
+ */
19596
+ usage: number;
19597
+ /**
19598
+ * An integer representing the usage page component of the HID usage associated
19599
+ * with this collection.
19600
+ */
19601
+ usagePage: number;
19602
+ /**
19603
+ * An 8-bit value representing the collection type, which describes a different
19604
+ * relationship between the grouped items.
19605
+ */
19606
+ type: number;
19607
+ /**
19608
+ * An array of sub-collections which takes the same format as a top-level
19609
+ * collection.
19610
+ */
19611
+ children: Children[];
19612
+ /**
19613
+ * An array of inputReport items which represent individual input reports described
19614
+ * in this collection.
19615
+ */
19616
+ inputReports: InputReports[];
19617
+ /**
19618
+ * An array of outputReport items which represent individual output reports
19619
+ * described in this collection.
19620
+ */
19621
+ outputReports: OutputReports[];
19622
+ /**
19623
+ * An array of featureReport items which represent individual feature reports
19624
+ * described in this collection.
19625
+ */
19626
+ featureReports: FeatureReports[];
19627
+ }
19628
+
18880
19629
  interface Config {
18881
19630
  /**
18882
19631
  * Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The minimum SSL version to allow
@@ -18908,6 +19657,13 @@ declare namespace Electron {
18908
19657
  * Windows and Linux.
18909
19658
  */
18910
19659
  enableBuiltInResolver?: boolean;
19660
+ /**
19661
+ * Whether the Happy Eyeballs V3 algorithm should be used in creating network
19662
+ * connections. When enabled, hostnames resolving to multiple IP addresses will be
19663
+ * attempted in parallel to have a chance at establishing a connection more
19664
+ * quickly.
19665
+ */
19666
+ enableHappyEyeballs?: boolean;
18911
19667
  /**
18912
19668
  * Can be 'off', 'automatic' or 'secure'. Configures the DNS-over-HTTP mode. When
18913
19669
  * 'off', no DoH lookups will be performed. When 'automatic', DoH lookups will be
@@ -19203,9 +19959,9 @@ declare namespace Electron {
19203
19959
  /**
19204
19960
  * Extra string key/value annotations that will be sent along with crash reports
19205
19961
  * that are generated in the main process. Only string values are supported.
19206
- * Crashes generated in child processes will not contain these extra parameters to
19207
- * crash reports generated from child processes, call `addExtraParameter` from the
19208
- * child process.
19962
+ * Crashes generated in child processes will not include these extra parameters. To
19963
+ * add extra parameters to crash reports generated from child processes, call
19964
+ * `addExtraParameter` from the child process.
19209
19965
  */
19210
19966
  extra?: Record<string, string>;
19211
19967
  /**
@@ -19547,6 +20303,19 @@ declare namespace Electron {
19547
20303
  uploadThroughput?: number;
19548
20304
  }
19549
20305
 
20306
+ interface ExecutionScript {
20307
+ /**
20308
+ * A JavaScript function to execute. This function will be serialized which means
20309
+ * that any bound parameters and execution context will be lost.
20310
+ */
20311
+ func: (...args: any[]) => any;
20312
+ /**
20313
+ * An array of arguments to pass to the provided function. These arguments will be
20314
+ * copied between worlds in accordance with the table of supported types.
20315
+ */
20316
+ args?: any[];
20317
+ }
20318
+
19550
20319
  interface FeedURLOptions {
19551
20320
  url: string;
19552
20321
  /**
@@ -20061,11 +20830,13 @@ declare namespace Electron {
20061
20830
  * be ignored. See roles.
20062
20831
  */
20063
20832
  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');
20833
+ type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio' | 'header' | 'palette');
20834
+ label?: string;
20064
20835
  /**
20065
- * Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
20836
+ * Available in macOS >= 14.4
20837
+ *
20838
+ * @platform darwin
20066
20839
  */
20067
- type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
20068
- label?: string;
20069
20840
  sublabel?: string;
20070
20841
  /**
20071
20842
  * Hover text for this menu item.
@@ -20842,6 +21613,13 @@ declare namespace Electron {
20842
21613
  * Default is the focused window.
20843
21614
  */
20844
21615
  window?: BaseWindow;
21616
+ /**
21617
+ * Provide the relevant frame if you want certain OS-level features such as Writing
21618
+ * Tools on macOS to function correctly. Typically, this should be `params.frame`
21619
+ * from the `context-menu` event on a WebContents, or the `focusedFrame` property
21620
+ * of a WebContents.
21621
+ */
21622
+ frame?: WebFrameMain;
20845
21623
  /**
20846
21624
  * Default is the current mouse cursor position. Must be declared if `y` is
20847
21625
  * declared.
@@ -20875,6 +21653,13 @@ declare namespace Electron {
20875
21653
  callback?: () => void;
20876
21654
  }
20877
21655
 
21656
+ interface PowerMonitorSpeedLimitChangeEventParams {
21657
+ /**
21658
+ * The operating system's advertised speed limit for CPUs, in percent.
21659
+ */
21660
+ limit: number;
21661
+ }
21662
+
20878
21663
  interface PowerMonitorThermalStateChangeEventParams {
20879
21664
  /**
20880
21665
  * The system's new thermal state. Can be `unknown`, `nominal`, `fair`, `serious`,
@@ -21300,6 +22085,18 @@ declare namespace Electron {
21300
22085
  origin: string;
21301
22086
  }
21302
22087
 
22088
+ interface ServiceWorkersRunningStatusChangedEventParams {
22089
+ /**
22090
+ * ID of the updated service worker version
22091
+ */
22092
+ versionId: number;
22093
+ /**
22094
+ * Running status. Possible values include `starting`, `running`, `stopping`, or
22095
+ * `stopped`.
22096
+ */
22097
+ runningStatus: ('starting' | 'running' | 'stopping' | 'stopped');
22098
+ }
22099
+
21303
22100
  interface Settings {
21304
22101
  /**
21305
22102
  * `true` to open the app at login, `false` to remove the app as a login item.
@@ -21410,6 +22207,14 @@ declare namespace Electron {
21410
22207
  maxFileSize?: number;
21411
22208
  }
21412
22209
 
22210
+ interface StartTask {
22211
+ /**
22212
+ * Method to call when the task has ended. If never called, the service won't
22213
+ * terminate while otherwise idle.
22214
+ */
22215
+ end: () => void;
22216
+ }
22217
+
21413
22218
  interface Streams {
21414
22219
  video?: (Video) | (WebFrameMain);
21415
22220
  /**
@@ -21810,6 +22615,14 @@ declare namespace Electron {
21810
22615
  protectedClasses: Array<'audio' | 'audio-video' | 'hid' | 'mass-storage' | 'smart-card' | 'video' | 'wireless'>;
21811
22616
  }
21812
22617
 
22618
+ interface VibrancyOptions {
22619
+ /**
22620
+ * if greater than zero, the change to vibrancy will be animated over the given
22621
+ * duration (in milliseconds).
22622
+ */
22623
+ animationDuration?: number;
22624
+ }
22625
+
21813
22626
  interface VisibleOnAllWorkspacesOptions {
21814
22627
  /**
21815
22628
  * Sets whether the window should be visible above fullscreen windows.
@@ -21836,6 +22649,30 @@ declare namespace Electron {
21836
22649
  audible: boolean;
21837
22650
  }
21838
22651
 
22652
+ interface WebContentsConsoleMessageEventParams {
22653
+ /**
22654
+ * Message text
22655
+ */
22656
+ message: string;
22657
+ /**
22658
+ * Message severity Possible values include `info`, `warning`, `error`, and
22659
+ * `debug`.
22660
+ */
22661
+ level: ('info' | 'warning' | 'error' | 'debug');
22662
+ /**
22663
+ * Line number in the log source
22664
+ */
22665
+ lineNumber: number;
22666
+ /**
22667
+ * URL of the log source
22668
+ */
22669
+ sourceId: string;
22670
+ /**
22671
+ * Frame that logged the message
22672
+ */
22673
+ frame: WebFrameMain;
22674
+ }
22675
+
21839
22676
  interface WebContentsDidRedirectNavigationEventParams {
21840
22677
  /**
21841
22678
  * The URL the frame is navigating to.
@@ -22164,6 +23001,9 @@ declare namespace Electron {
22164
23001
  edge: ('bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right');
22165
23002
  }
22166
23003
 
23004
+ interface Children {
23005
+ }
23006
+
22167
23007
  interface EditFlags {
22168
23008
  /**
22169
23009
  * Whether the renderer believes it can undo.
@@ -22202,6 +23042,9 @@ declare namespace Electron {
22202
23042
  interface Env {
22203
23043
  }
22204
23044
 
23045
+ interface FeatureReports {
23046
+ }
23047
+
22205
23048
  interface FoundInPageResult {
22206
23049
  requestId: number;
22207
23050
  /**
@@ -22219,6 +23062,9 @@ declare namespace Electron {
22219
23062
  finalUpdate: boolean;
22220
23063
  }
22221
23064
 
23065
+ interface InputReports {
23066
+ }
23067
+
22222
23068
  interface LaunchItems {
22223
23069
  /**
22224
23070
  * name value of a registry entry.
@@ -22353,6 +23199,9 @@ declare namespace Electron {
22353
23199
  frameCount?: number;
22354
23200
  }
22355
23201
 
23202
+ interface OutputReports {
23203
+ }
23204
+
22356
23205
  interface PageRanges {
22357
23206
  /**
22358
23207
  * Index of the first page to print (0-based).
@@ -22551,6 +23400,7 @@ declare namespace Electron {
22551
23400
  type ClientCertRequestParams = Electron.ClientCertRequestParams;
22552
23401
  type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
22553
23402
  type CloseOpts = Electron.CloseOpts;
23403
+ type Collections = Electron.Collections;
22554
23404
  type Config = Electron.Config;
22555
23405
  type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
22556
23406
  type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
@@ -22583,6 +23433,7 @@ declare namespace Electron {
22583
23433
  type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
22584
23434
  type DownloadURLOptions = Electron.DownloadURLOptions;
22585
23435
  type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
23436
+ type ExecutionScript = Electron.ExecutionScript;
22586
23437
  type FeedURLOptions = Electron.FeedURLOptions;
22587
23438
  type FileIconOptions = Electron.FileIconOptions;
22588
23439
  type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
@@ -22645,6 +23496,7 @@ declare namespace Electron {
22645
23496
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
22646
23497
  type PluginCrashedEvent = Electron.PluginCrashedEvent;
22647
23498
  type PopupOptions = Electron.PopupOptions;
23499
+ type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
22648
23500
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
22649
23501
  type PreconnectOptions = Electron.PreconnectOptions;
22650
23502
  type PrintToPDFOptions = Electron.PrintToPDFOptions;
@@ -22669,10 +23521,12 @@ declare namespace Electron {
22669
23521
  type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
22670
23522
  type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
22671
23523
  type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
23524
+ type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
22672
23525
  type Settings = Electron.Settings;
22673
23526
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
22674
23527
  type SourcesOptions = Electron.SourcesOptions;
22675
23528
  type StartLoggingOptions = Electron.StartLoggingOptions;
23529
+ type StartTask = Electron.StartTask;
22676
23530
  type Streams = Electron.Streams;
22677
23531
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
22678
23532
  type TextureInfo = Electron.TextureInfo;
@@ -22698,8 +23552,10 @@ declare namespace Electron {
22698
23552
  type UploadProgress = Electron.UploadProgress;
22699
23553
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
22700
23554
  type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
23555
+ type VibrancyOptions = Electron.VibrancyOptions;
22701
23556
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
22702
23557
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
23558
+ type WebContentsConsoleMessageEventParams = Electron.WebContentsConsoleMessageEventParams;
22703
23559
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
22704
23560
  type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
22705
23561
  type WebContentsPaintEventParams = Electron.WebContentsPaintEventParams;
@@ -22713,13 +23569,17 @@ declare namespace Electron {
22713
23569
  type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
22714
23570
  type WillNavigateEvent = Electron.WillNavigateEvent;
22715
23571
  type WillResizeDetails = Electron.WillResizeDetails;
23572
+ type Children = Electron.Children;
22716
23573
  type EditFlags = Electron.EditFlags;
22717
23574
  type Env = Electron.Env;
23575
+ type FeatureReports = Electron.FeatureReports;
22718
23576
  type FoundInPageResult = Electron.FoundInPageResult;
23577
+ type InputReports = Electron.InputReports;
22719
23578
  type LaunchItems = Electron.LaunchItems;
22720
23579
  type Margins = Electron.Margins;
22721
23580
  type MediaFlags = Electron.MediaFlags;
22722
23581
  type Metadata = Electron.Metadata;
23582
+ type OutputReports = Electron.OutputReports;
22723
23583
  type PageRanges = Electron.PageRanges;
22724
23584
  type Params = Electron.Params;
22725
23585
  type Planes = Electron.Planes;
@@ -22745,6 +23605,8 @@ declare namespace Electron {
22745
23605
  type InputEvent = Electron.InputEvent;
22746
23606
  type IpcMainEvent = Electron.IpcMainEvent;
22747
23607
  type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
23608
+ type IpcMainServiceWorkerEvent = Electron.IpcMainServiceWorkerEvent;
23609
+ type IpcMainServiceWorkerInvokeEvent = Electron.IpcMainServiceWorkerInvokeEvent;
22748
23610
  type IpcRendererEvent = Electron.IpcRendererEvent;
22749
23611
  type JumpListCategory = Electron.JumpListCategory;
22750
23612
  type JumpListItem = Electron.JumpListItem;
@@ -22765,6 +23627,8 @@ declare namespace Electron {
22765
23627
  type PermissionRequest = Electron.PermissionRequest;
22766
23628
  type Point = Electron.Point;
22767
23629
  type PostBody = Electron.PostBody;
23630
+ type PreloadScript = Electron.PreloadScript;
23631
+ type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
22768
23632
  type PrinterInfo = Electron.PrinterInfo;
22769
23633
  type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
22770
23634
  type ProcessMetric = Electron.ProcessMetric;
@@ -22804,6 +23668,7 @@ declare namespace Electron {
22804
23668
  type WebRequestFilter = Electron.WebRequestFilter;
22805
23669
  type WebSource = Electron.WebSource;
22806
23670
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
23671
+ type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
22807
23672
  }
22808
23673
 
22809
23674
  namespace Main {
@@ -22827,13 +23692,16 @@ declare namespace Electron {
22827
23692
  type Dialog = Electron.Dialog;
22828
23693
  type Dock = Electron.Dock;
22829
23694
  type DownloadItem = Electron.DownloadItem;
23695
+ type Extensions = Electron.Extensions;
22830
23696
  const globalShortcut: GlobalShortcut;
22831
23697
  type GlobalShortcut = Electron.GlobalShortcut;
23698
+ class ImageView extends Electron.ImageView {}
22832
23699
  const inAppPurchase: InAppPurchase;
22833
23700
  type InAppPurchase = Electron.InAppPurchase;
22834
23701
  type IncomingMessage = Electron.IncomingMessage;
22835
23702
  const ipcMain: IpcMain;
22836
23703
  type IpcMain = Electron.IpcMain;
23704
+ class IpcMainServiceWorker extends Electron.IpcMainServiceWorker {}
22837
23705
  class Menu extends Electron.Menu {}
22838
23706
  class MenuItem extends Electron.MenuItem {}
22839
23707
  class MessageChannelMain extends Electron.MessageChannelMain {}
@@ -22858,6 +23726,7 @@ declare namespace Electron {
22858
23726
  type SafeStorage = Electron.SafeStorage;
22859
23727
  const screen: Screen;
22860
23728
  type Screen = Electron.Screen;
23729
+ type ServiceWorkerMain = Electron.ServiceWorkerMain;
22861
23730
  type ServiceWorkers = Electron.ServiceWorkers;
22862
23731
  const session: typeof Session;
22863
23732
  type Session = Electron.Session;
@@ -22908,6 +23777,7 @@ declare namespace Electron {
22908
23777
  type ClientCertRequestParams = Electron.ClientCertRequestParams;
22909
23778
  type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
22910
23779
  type CloseOpts = Electron.CloseOpts;
23780
+ type Collections = Electron.Collections;
22911
23781
  type Config = Electron.Config;
22912
23782
  type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
22913
23783
  type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
@@ -22940,6 +23810,7 @@ declare namespace Electron {
22940
23810
  type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
22941
23811
  type DownloadURLOptions = Electron.DownloadURLOptions;
22942
23812
  type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
23813
+ type ExecutionScript = Electron.ExecutionScript;
22943
23814
  type FeedURLOptions = Electron.FeedURLOptions;
22944
23815
  type FileIconOptions = Electron.FileIconOptions;
22945
23816
  type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
@@ -23002,6 +23873,7 @@ declare namespace Electron {
23002
23873
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
23003
23874
  type PluginCrashedEvent = Electron.PluginCrashedEvent;
23004
23875
  type PopupOptions = Electron.PopupOptions;
23876
+ type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
23005
23877
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
23006
23878
  type PreconnectOptions = Electron.PreconnectOptions;
23007
23879
  type PrintToPDFOptions = Electron.PrintToPDFOptions;
@@ -23026,10 +23898,12 @@ declare namespace Electron {
23026
23898
  type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
23027
23899
  type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
23028
23900
  type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
23901
+ type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
23029
23902
  type Settings = Electron.Settings;
23030
23903
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
23031
23904
  type SourcesOptions = Electron.SourcesOptions;
23032
23905
  type StartLoggingOptions = Electron.StartLoggingOptions;
23906
+ type StartTask = Electron.StartTask;
23033
23907
  type Streams = Electron.Streams;
23034
23908
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
23035
23909
  type TextureInfo = Electron.TextureInfo;
@@ -23055,8 +23929,10 @@ declare namespace Electron {
23055
23929
  type UploadProgress = Electron.UploadProgress;
23056
23930
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
23057
23931
  type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
23932
+ type VibrancyOptions = Electron.VibrancyOptions;
23058
23933
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
23059
23934
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
23935
+ type WebContentsConsoleMessageEventParams = Electron.WebContentsConsoleMessageEventParams;
23060
23936
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
23061
23937
  type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
23062
23938
  type WebContentsPaintEventParams = Electron.WebContentsPaintEventParams;
@@ -23070,13 +23946,17 @@ declare namespace Electron {
23070
23946
  type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
23071
23947
  type WillNavigateEvent = Electron.WillNavigateEvent;
23072
23948
  type WillResizeDetails = Electron.WillResizeDetails;
23949
+ type Children = Electron.Children;
23073
23950
  type EditFlags = Electron.EditFlags;
23074
23951
  type Env = Electron.Env;
23952
+ type FeatureReports = Electron.FeatureReports;
23075
23953
  type FoundInPageResult = Electron.FoundInPageResult;
23954
+ type InputReports = Electron.InputReports;
23076
23955
  type LaunchItems = Electron.LaunchItems;
23077
23956
  type Margins = Electron.Margins;
23078
23957
  type MediaFlags = Electron.MediaFlags;
23079
23958
  type Metadata = Electron.Metadata;
23959
+ type OutputReports = Electron.OutputReports;
23080
23960
  type PageRanges = Electron.PageRanges;
23081
23961
  type Params = Electron.Params;
23082
23962
  type Planes = Electron.Planes;
@@ -23102,6 +23982,8 @@ declare namespace Electron {
23102
23982
  type InputEvent = Electron.InputEvent;
23103
23983
  type IpcMainEvent = Electron.IpcMainEvent;
23104
23984
  type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
23985
+ type IpcMainServiceWorkerEvent = Electron.IpcMainServiceWorkerEvent;
23986
+ type IpcMainServiceWorkerInvokeEvent = Electron.IpcMainServiceWorkerInvokeEvent;
23105
23987
  type IpcRendererEvent = Electron.IpcRendererEvent;
23106
23988
  type JumpListCategory = Electron.JumpListCategory;
23107
23989
  type JumpListItem = Electron.JumpListItem;
@@ -23122,6 +24004,8 @@ declare namespace Electron {
23122
24004
  type PermissionRequest = Electron.PermissionRequest;
23123
24005
  type Point = Electron.Point;
23124
24006
  type PostBody = Electron.PostBody;
24007
+ type PreloadScript = Electron.PreloadScript;
24008
+ type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
23125
24009
  type PrinterInfo = Electron.PrinterInfo;
23126
24010
  type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
23127
24011
  type ProcessMetric = Electron.ProcessMetric;
@@ -23161,6 +24045,7 @@ declare namespace Electron {
23161
24045
  type WebRequestFilter = Electron.WebRequestFilter;
23162
24046
  type WebSource = Electron.WebSource;
23163
24047
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
24048
+ type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
23164
24049
  }
23165
24050
 
23166
24051
  namespace Renderer {
@@ -23197,6 +24082,7 @@ declare namespace Electron {
23197
24082
  type ClientCertRequestParams = Electron.ClientCertRequestParams;
23198
24083
  type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
23199
24084
  type CloseOpts = Electron.CloseOpts;
24085
+ type Collections = Electron.Collections;
23200
24086
  type Config = Electron.Config;
23201
24087
  type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
23202
24088
  type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
@@ -23229,6 +24115,7 @@ declare namespace Electron {
23229
24115
  type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
23230
24116
  type DownloadURLOptions = Electron.DownloadURLOptions;
23231
24117
  type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
24118
+ type ExecutionScript = Electron.ExecutionScript;
23232
24119
  type FeedURLOptions = Electron.FeedURLOptions;
23233
24120
  type FileIconOptions = Electron.FileIconOptions;
23234
24121
  type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
@@ -23291,6 +24178,7 @@ declare namespace Electron {
23291
24178
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
23292
24179
  type PluginCrashedEvent = Electron.PluginCrashedEvent;
23293
24180
  type PopupOptions = Electron.PopupOptions;
24181
+ type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
23294
24182
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
23295
24183
  type PreconnectOptions = Electron.PreconnectOptions;
23296
24184
  type PrintToPDFOptions = Electron.PrintToPDFOptions;
@@ -23315,10 +24203,12 @@ declare namespace Electron {
23315
24203
  type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
23316
24204
  type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
23317
24205
  type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
24206
+ type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
23318
24207
  type Settings = Electron.Settings;
23319
24208
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
23320
24209
  type SourcesOptions = Electron.SourcesOptions;
23321
24210
  type StartLoggingOptions = Electron.StartLoggingOptions;
24211
+ type StartTask = Electron.StartTask;
23322
24212
  type Streams = Electron.Streams;
23323
24213
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
23324
24214
  type TextureInfo = Electron.TextureInfo;
@@ -23344,8 +24234,10 @@ declare namespace Electron {
23344
24234
  type UploadProgress = Electron.UploadProgress;
23345
24235
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
23346
24236
  type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
24237
+ type VibrancyOptions = Electron.VibrancyOptions;
23347
24238
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
23348
24239
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
24240
+ type WebContentsConsoleMessageEventParams = Electron.WebContentsConsoleMessageEventParams;
23349
24241
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
23350
24242
  type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
23351
24243
  type WebContentsPaintEventParams = Electron.WebContentsPaintEventParams;
@@ -23359,13 +24251,17 @@ declare namespace Electron {
23359
24251
  type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
23360
24252
  type WillNavigateEvent = Electron.WillNavigateEvent;
23361
24253
  type WillResizeDetails = Electron.WillResizeDetails;
24254
+ type Children = Electron.Children;
23362
24255
  type EditFlags = Electron.EditFlags;
23363
24256
  type Env = Electron.Env;
24257
+ type FeatureReports = Electron.FeatureReports;
23364
24258
  type FoundInPageResult = Electron.FoundInPageResult;
24259
+ type InputReports = Electron.InputReports;
23365
24260
  type LaunchItems = Electron.LaunchItems;
23366
24261
  type Margins = Electron.Margins;
23367
24262
  type MediaFlags = Electron.MediaFlags;
23368
24263
  type Metadata = Electron.Metadata;
24264
+ type OutputReports = Electron.OutputReports;
23369
24265
  type PageRanges = Electron.PageRanges;
23370
24266
  type Params = Electron.Params;
23371
24267
  type Planes = Electron.Planes;
@@ -23391,6 +24287,8 @@ declare namespace Electron {
23391
24287
  type InputEvent = Electron.InputEvent;
23392
24288
  type IpcMainEvent = Electron.IpcMainEvent;
23393
24289
  type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
24290
+ type IpcMainServiceWorkerEvent = Electron.IpcMainServiceWorkerEvent;
24291
+ type IpcMainServiceWorkerInvokeEvent = Electron.IpcMainServiceWorkerInvokeEvent;
23394
24292
  type IpcRendererEvent = Electron.IpcRendererEvent;
23395
24293
  type JumpListCategory = Electron.JumpListCategory;
23396
24294
  type JumpListItem = Electron.JumpListItem;
@@ -23411,6 +24309,8 @@ declare namespace Electron {
23411
24309
  type PermissionRequest = Electron.PermissionRequest;
23412
24310
  type Point = Electron.Point;
23413
24311
  type PostBody = Electron.PostBody;
24312
+ type PreloadScript = Electron.PreloadScript;
24313
+ type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
23414
24314
  type PrinterInfo = Electron.PrinterInfo;
23415
24315
  type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
23416
24316
  type ProcessMetric = Electron.ProcessMetric;
@@ -23450,6 +24350,7 @@ declare namespace Electron {
23450
24350
  type WebRequestFilter = Electron.WebRequestFilter;
23451
24351
  type WebSource = Electron.WebSource;
23452
24352
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
24353
+ type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
23453
24354
  }
23454
24355
 
23455
24356
  namespace Utility {
@@ -23483,6 +24384,7 @@ declare namespace Electron {
23483
24384
  type ClientCertRequestParams = Electron.ClientCertRequestParams;
23484
24385
  type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
23485
24386
  type CloseOpts = Electron.CloseOpts;
24387
+ type Collections = Electron.Collections;
23486
24388
  type Config = Electron.Config;
23487
24389
  type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
23488
24390
  type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
@@ -23515,6 +24417,7 @@ declare namespace Electron {
23515
24417
  type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
23516
24418
  type DownloadURLOptions = Electron.DownloadURLOptions;
23517
24419
  type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
24420
+ type ExecutionScript = Electron.ExecutionScript;
23518
24421
  type FeedURLOptions = Electron.FeedURLOptions;
23519
24422
  type FileIconOptions = Electron.FileIconOptions;
23520
24423
  type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
@@ -23577,6 +24480,7 @@ declare namespace Electron {
23577
24480
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
23578
24481
  type PluginCrashedEvent = Electron.PluginCrashedEvent;
23579
24482
  type PopupOptions = Electron.PopupOptions;
24483
+ type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
23580
24484
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
23581
24485
  type PreconnectOptions = Electron.PreconnectOptions;
23582
24486
  type PrintToPDFOptions = Electron.PrintToPDFOptions;
@@ -23601,10 +24505,12 @@ declare namespace Electron {
23601
24505
  type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
23602
24506
  type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
23603
24507
  type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
24508
+ type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
23604
24509
  type Settings = Electron.Settings;
23605
24510
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
23606
24511
  type SourcesOptions = Electron.SourcesOptions;
23607
24512
  type StartLoggingOptions = Electron.StartLoggingOptions;
24513
+ type StartTask = Electron.StartTask;
23608
24514
  type Streams = Electron.Streams;
23609
24515
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
23610
24516
  type TextureInfo = Electron.TextureInfo;
@@ -23630,8 +24536,10 @@ declare namespace Electron {
23630
24536
  type UploadProgress = Electron.UploadProgress;
23631
24537
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
23632
24538
  type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
24539
+ type VibrancyOptions = Electron.VibrancyOptions;
23633
24540
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
23634
24541
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
24542
+ type WebContentsConsoleMessageEventParams = Electron.WebContentsConsoleMessageEventParams;
23635
24543
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
23636
24544
  type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
23637
24545
  type WebContentsPaintEventParams = Electron.WebContentsPaintEventParams;
@@ -23645,13 +24553,17 @@ declare namespace Electron {
23645
24553
  type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
23646
24554
  type WillNavigateEvent = Electron.WillNavigateEvent;
23647
24555
  type WillResizeDetails = Electron.WillResizeDetails;
24556
+ type Children = Electron.Children;
23648
24557
  type EditFlags = Electron.EditFlags;
23649
24558
  type Env = Electron.Env;
24559
+ type FeatureReports = Electron.FeatureReports;
23650
24560
  type FoundInPageResult = Electron.FoundInPageResult;
24561
+ type InputReports = Electron.InputReports;
23651
24562
  type LaunchItems = Electron.LaunchItems;
23652
24563
  type Margins = Electron.Margins;
23653
24564
  type MediaFlags = Electron.MediaFlags;
23654
24565
  type Metadata = Electron.Metadata;
24566
+ type OutputReports = Electron.OutputReports;
23655
24567
  type PageRanges = Electron.PageRanges;
23656
24568
  type Params = Electron.Params;
23657
24569
  type Planes = Electron.Planes;
@@ -23677,6 +24589,8 @@ declare namespace Electron {
23677
24589
  type InputEvent = Electron.InputEvent;
23678
24590
  type IpcMainEvent = Electron.IpcMainEvent;
23679
24591
  type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
24592
+ type IpcMainServiceWorkerEvent = Electron.IpcMainServiceWorkerEvent;
24593
+ type IpcMainServiceWorkerInvokeEvent = Electron.IpcMainServiceWorkerInvokeEvent;
23680
24594
  type IpcRendererEvent = Electron.IpcRendererEvent;
23681
24595
  type JumpListCategory = Electron.JumpListCategory;
23682
24596
  type JumpListItem = Electron.JumpListItem;
@@ -23697,6 +24611,8 @@ declare namespace Electron {
23697
24611
  type PermissionRequest = Electron.PermissionRequest;
23698
24612
  type Point = Electron.Point;
23699
24613
  type PostBody = Electron.PostBody;
24614
+ type PreloadScript = Electron.PreloadScript;
24615
+ type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
23700
24616
  type PrinterInfo = Electron.PrinterInfo;
23701
24617
  type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
23702
24618
  type ProcessMetric = Electron.ProcessMetric;
@@ -23736,6 +24652,7 @@ declare namespace Electron {
23736
24652
  type WebRequestFilter = Electron.WebRequestFilter;
23737
24653
  type WebSource = Electron.WebSource;
23738
24654
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
24655
+ type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
23739
24656
  }
23740
24657
 
23741
24658
  namespace CrossProcessExports {
@@ -23765,13 +24682,16 @@ declare namespace Electron {
23765
24682
  type Dialog = Electron.Dialog;
23766
24683
  type Dock = Electron.Dock;
23767
24684
  type DownloadItem = Electron.DownloadItem;
24685
+ type Extensions = Electron.Extensions;
23768
24686
  const globalShortcut: GlobalShortcut;
23769
24687
  type GlobalShortcut = Electron.GlobalShortcut;
24688
+ class ImageView extends Electron.ImageView {}
23770
24689
  const inAppPurchase: InAppPurchase;
23771
24690
  type InAppPurchase = Electron.InAppPurchase;
23772
24691
  type IncomingMessage = Electron.IncomingMessage;
23773
24692
  const ipcMain: IpcMain;
23774
24693
  type IpcMain = Electron.IpcMain;
24694
+ class IpcMainServiceWorker extends Electron.IpcMainServiceWorker {}
23775
24695
  const ipcRenderer: IpcRenderer;
23776
24696
  type IpcRenderer = Electron.IpcRenderer;
23777
24697
  class Menu extends Electron.Menu {}
@@ -23800,6 +24720,7 @@ declare namespace Electron {
23800
24720
  type SafeStorage = Electron.SafeStorage;
23801
24721
  const screen: Screen;
23802
24722
  type Screen = Electron.Screen;
24723
+ type ServiceWorkerMain = Electron.ServiceWorkerMain;
23803
24724
  type ServiceWorkers = Electron.ServiceWorkers;
23804
24725
  const session: typeof Session;
23805
24726
  type Session = Electron.Session;
@@ -23857,6 +24778,7 @@ declare namespace Electron {
23857
24778
  type ClientCertRequestParams = Electron.ClientCertRequestParams;
23858
24779
  type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
23859
24780
  type CloseOpts = Electron.CloseOpts;
24781
+ type Collections = Electron.Collections;
23860
24782
  type Config = Electron.Config;
23861
24783
  type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
23862
24784
  type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
@@ -23889,6 +24811,7 @@ declare namespace Electron {
23889
24811
  type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
23890
24812
  type DownloadURLOptions = Electron.DownloadURLOptions;
23891
24813
  type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
24814
+ type ExecutionScript = Electron.ExecutionScript;
23892
24815
  type FeedURLOptions = Electron.FeedURLOptions;
23893
24816
  type FileIconOptions = Electron.FileIconOptions;
23894
24817
  type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
@@ -23951,6 +24874,7 @@ declare namespace Electron {
23951
24874
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
23952
24875
  type PluginCrashedEvent = Electron.PluginCrashedEvent;
23953
24876
  type PopupOptions = Electron.PopupOptions;
24877
+ type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
23954
24878
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
23955
24879
  type PreconnectOptions = Electron.PreconnectOptions;
23956
24880
  type PrintToPDFOptions = Electron.PrintToPDFOptions;
@@ -23975,10 +24899,12 @@ declare namespace Electron {
23975
24899
  type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
23976
24900
  type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
23977
24901
  type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
24902
+ type ServiceWorkersRunningStatusChangedEventParams = Electron.ServiceWorkersRunningStatusChangedEventParams;
23978
24903
  type Settings = Electron.Settings;
23979
24904
  type SharedDictionaryInfoOptions = Electron.SharedDictionaryInfoOptions;
23980
24905
  type SourcesOptions = Electron.SourcesOptions;
23981
24906
  type StartLoggingOptions = Electron.StartLoggingOptions;
24907
+ type StartTask = Electron.StartTask;
23982
24908
  type Streams = Electron.Streams;
23983
24909
  type SystemMemoryInfo = Electron.SystemMemoryInfo;
23984
24910
  type TextureInfo = Electron.TextureInfo;
@@ -24004,8 +24930,10 @@ declare namespace Electron {
24004
24930
  type UploadProgress = Electron.UploadProgress;
24005
24931
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
24006
24932
  type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
24933
+ type VibrancyOptions = Electron.VibrancyOptions;
24007
24934
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
24008
24935
  type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
24936
+ type WebContentsConsoleMessageEventParams = Electron.WebContentsConsoleMessageEventParams;
24009
24937
  type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
24010
24938
  type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
24011
24939
  type WebContentsPaintEventParams = Electron.WebContentsPaintEventParams;
@@ -24019,13 +24947,17 @@ declare namespace Electron {
24019
24947
  type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
24020
24948
  type WillNavigateEvent = Electron.WillNavigateEvent;
24021
24949
  type WillResizeDetails = Electron.WillResizeDetails;
24950
+ type Children = Electron.Children;
24022
24951
  type EditFlags = Electron.EditFlags;
24023
24952
  type Env = Electron.Env;
24953
+ type FeatureReports = Electron.FeatureReports;
24024
24954
  type FoundInPageResult = Electron.FoundInPageResult;
24955
+ type InputReports = Electron.InputReports;
24025
24956
  type LaunchItems = Electron.LaunchItems;
24026
24957
  type Margins = Electron.Margins;
24027
24958
  type MediaFlags = Electron.MediaFlags;
24028
24959
  type Metadata = Electron.Metadata;
24960
+ type OutputReports = Electron.OutputReports;
24029
24961
  type PageRanges = Electron.PageRanges;
24030
24962
  type Params = Electron.Params;
24031
24963
  type Planes = Electron.Planes;
@@ -24051,6 +24983,8 @@ declare namespace Electron {
24051
24983
  type InputEvent = Electron.InputEvent;
24052
24984
  type IpcMainEvent = Electron.IpcMainEvent;
24053
24985
  type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
24986
+ type IpcMainServiceWorkerEvent = Electron.IpcMainServiceWorkerEvent;
24987
+ type IpcMainServiceWorkerInvokeEvent = Electron.IpcMainServiceWorkerInvokeEvent;
24054
24988
  type IpcRendererEvent = Electron.IpcRendererEvent;
24055
24989
  type JumpListCategory = Electron.JumpListCategory;
24056
24990
  type JumpListItem = Electron.JumpListItem;
@@ -24071,6 +25005,8 @@ declare namespace Electron {
24071
25005
  type PermissionRequest = Electron.PermissionRequest;
24072
25006
  type Point = Electron.Point;
24073
25007
  type PostBody = Electron.PostBody;
25008
+ type PreloadScript = Electron.PreloadScript;
25009
+ type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
24074
25010
  type PrinterInfo = Electron.PrinterInfo;
24075
25011
  type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
24076
25012
  type ProcessMetric = Electron.ProcessMetric;
@@ -24110,6 +25046,7 @@ declare namespace Electron {
24110
25046
  type WebRequestFilter = Electron.WebRequestFilter;
24111
25047
  type WebSource = Electron.WebSource;
24112
25048
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
25049
+ type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
24113
25050
  }
24114
25051
 
24115
25052
  const app: App;
@@ -24182,13 +25119,6 @@ interface NodeRequire {
24182
25119
  (moduleName: 'electron/utility'): typeof Electron.Utility;
24183
25120
  }
24184
25121
 
24185
- interface File {
24186
- /**
24187
- * The real path to the file on the users filesystem
24188
- */
24189
- path: string;
24190
- }
24191
-
24192
25122
  declare module 'original-fs' {
24193
25123
  import * as fs from 'fs';
24194
25124
  export = fs;
@@ -24294,7 +25224,7 @@ declare namespace NodeJS {
24294
25224
  *
24295
25225
  * Example:
24296
25226
  *
24297
- * **Note:** It returns the actual operating system version instead of kernel
25227
+ * > [!NOTE] It returns the actual operating system version instead of kernel
24298
25228
  * version on macOS unlike `os.release()`.
24299
25229
  */
24300
25230
  getSystemVersion(): string;
@@ -24413,11 +25343,12 @@ declare namespace NodeJS {
24413
25343
  *
24414
25344
  * * `browser` - The main process
24415
25345
  * * `renderer` - A renderer process
25346
+ * * `service-worker` - In a service worker
24416
25347
  * * `worker` - In a web worker
24417
25348
  * * `utility` - In a node process launched as a service
24418
25349
  *
24419
25350
  */
24420
- readonly type: ('browser' | 'renderer' | 'worker' | 'utility');
25351
+ readonly type: ('browser' | 'renderer' | 'service-worker' | 'worker' | 'utility');
24421
25352
  /**
24422
25353
  * A `boolean`. If the app is running as a Windows Store app (appx), this property
24423
25354
  * is `true`, for otherwise it is `undefined`.