electron 37.0.0-alpha.3 → 37.0.0-alpha.4
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/checksums.json +75 -75
- package/electron.d.ts +188 -179
- package/package.json +1 -1
package/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 37.0.0-alpha.
|
|
1
|
+
// Type definitions for Electron 37.0.0-alpha.4
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
1149
|
+
* > [!NOTE] When distributing your packaged app, you have to also ship the
|
|
1150
1150
|
* `locales` folder.
|
|
1151
1151
|
*
|
|
1152
|
-
*
|
|
1152
|
+
* > [!NOTE] This API must be called after the `ready` event is emitted.
|
|
1153
1153
|
*
|
|
1154
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
1275
|
+
* > [!NOTE] This API must be called after the `ready` event is emitted.
|
|
1276
1276
|
*
|
|
1277
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
1572
|
+
* > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
|
|
1573
1573
|
* information, please read the Unity integration documentation.
|
|
1574
1574
|
*
|
|
1575
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
*
|
|
@@ -1639,7 +1639,7 @@ declare namespace Electron {
|
|
|
1639
1639
|
/**
|
|
1640
1640
|
* Overrides the current application's name.
|
|
1641
1641
|
*
|
|
1642
|
-
*
|
|
1642
|
+
* > [!NOTE] This function overrides the name used internally by Electron; it does
|
|
1643
1643
|
* not affect the name that the OS uses.
|
|
1644
1644
|
*/
|
|
1645
1645
|
setName(name: string): void;
|
|
@@ -1655,7 +1655,16 @@ declare namespace Electron {
|
|
|
1655
1655
|
* `sessionData` path before the `ready` event of the `app` module is emitted.
|
|
1656
1656
|
*/
|
|
1657
1657
|
setPath(name: string, path: string): void;
|
|
1658
|
-
|
|
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>;
|
|
1659
1668
|
/**
|
|
1660
1669
|
* Set the `Secure Keyboard Entry` is enabled in your application.
|
|
1661
1670
|
*
|
|
@@ -1664,7 +1673,7 @@ declare namespace Electron {
|
|
|
1664
1673
|
*
|
|
1665
1674
|
* See Apple's documentation for more details.
|
|
1666
1675
|
*
|
|
1667
|
-
*
|
|
1676
|
+
* > [!NOTE] Enable `Secure Keyboard Entry` only when it is needed and disable it
|
|
1668
1677
|
* when it is no longer needed.
|
|
1669
1678
|
*
|
|
1670
1679
|
* @platform darwin
|
|
@@ -1684,7 +1693,7 @@ declare namespace Electron {
|
|
|
1684
1693
|
*
|
|
1685
1694
|
* Whether the call succeeded.
|
|
1686
1695
|
*
|
|
1687
|
-
*
|
|
1696
|
+
* > [!NOTE] If you'd like to customize the Jump List even more use
|
|
1688
1697
|
* `app.setJumpList(categories)` instead.
|
|
1689
1698
|
*
|
|
1690
1699
|
* @platform win32
|
|
@@ -1746,7 +1755,7 @@ declare namespace Electron {
|
|
|
1746
1755
|
*
|
|
1747
1756
|
* This API must be called after the `ready` event is emitted.
|
|
1748
1757
|
*
|
|
1749
|
-
*
|
|
1758
|
+
* > [!NOTE] Rendering accessibility tree can significantly affect the performance
|
|
1750
1759
|
* of your app. It should not be enabled by default.
|
|
1751
1760
|
*
|
|
1752
1761
|
* @platform darwin,win32
|
|
@@ -1764,10 +1773,10 @@ declare namespace Electron {
|
|
|
1764
1773
|
* On macOS, setting this with any nonzero integer shows on the dock icon. On
|
|
1765
1774
|
* Linux, this property only works for Unity launcher.
|
|
1766
1775
|
*
|
|
1767
|
-
*
|
|
1776
|
+
* > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
|
|
1768
1777
|
* information, please read the Unity integration documentation.
|
|
1769
1778
|
*
|
|
1770
|
-
*
|
|
1779
|
+
* > [!NOTE] On macOS, you need to ensure that your application has the permission
|
|
1771
1780
|
* to display notifications for this property to take effect.
|
|
1772
1781
|
*
|
|
1773
1782
|
* @platform linux,darwin
|
|
@@ -1875,7 +1884,7 @@ declare namespace Electron {
|
|
|
1875
1884
|
*
|
|
1876
1885
|
* On Windows only `releaseName` is available.
|
|
1877
1886
|
*
|
|
1878
|
-
*
|
|
1887
|
+
* > [!NOTE] It is not strictly necessary to handle this event. A successfully
|
|
1879
1888
|
* downloaded update will still be applied the next time the application starts.
|
|
1880
1889
|
*/
|
|
1881
1890
|
on(event: 'update-downloaded', listener: (event: Event,
|
|
@@ -1915,7 +1924,7 @@ declare namespace Electron {
|
|
|
1915
1924
|
* Asks the server whether there is an update. You must call `setFeedURL` before
|
|
1916
1925
|
* using this API.
|
|
1917
1926
|
*
|
|
1918
|
-
*
|
|
1927
|
+
* > [!NOTE] If an update is available it will be downloaded automatically. Calling
|
|
1919
1928
|
* `autoUpdater.checkForUpdates()` twice will download the update two times.
|
|
1920
1929
|
*/
|
|
1921
1930
|
checkForUpdates(): void;
|
|
@@ -1931,7 +1940,7 @@ declare namespace Electron {
|
|
|
1931
1940
|
* windows first, and automatically call `app.quit()` after all windows have been
|
|
1932
1941
|
* closed.
|
|
1933
1942
|
*
|
|
1934
|
-
*
|
|
1943
|
+
* > [!NOTE] It is not strictly necessary to call this function to apply an update,
|
|
1935
1944
|
* as a successfully downloaded update will always be applied the next time the
|
|
1936
1945
|
* application starts.
|
|
1937
1946
|
*/
|
|
@@ -2015,11 +2024,11 @@ declare namespace Electron {
|
|
|
2015
2024
|
* In Electron, returning any value other than `undefined` would cancel the close.
|
|
2016
2025
|
* For example:
|
|
2017
2026
|
*
|
|
2018
|
-
*
|
|
2027
|
+
* > [!NOTE] There is a subtle difference between the behaviors of
|
|
2019
2028
|
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
|
2020
2029
|
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
|
2021
2030
|
* instead of only returning a value, as the former works more consistently within
|
|
2022
|
-
* Electron.
|
|
2031
|
+
* Electron.
|
|
2023
2032
|
*/
|
|
2024
2033
|
on(event: 'close', listener: (event: Event) => void): this;
|
|
2025
2034
|
off(event: 'close', listener: (event: Event) => void): this;
|
|
@@ -2094,7 +2103,7 @@ declare namespace Electron {
|
|
|
2094
2103
|
/**
|
|
2095
2104
|
* Emitted once when the window is moved to a new position.
|
|
2096
2105
|
*
|
|
2097
|
-
*
|
|
2106
|
+
* > [!NOTE] On macOS, this event is an alias of `move`.
|
|
2098
2107
|
*
|
|
2099
2108
|
* @platform darwin,win32
|
|
2100
2109
|
*/
|
|
@@ -2571,14 +2580,14 @@ declare namespace Electron {
|
|
|
2571
2580
|
*
|
|
2572
2581
|
* See Setting `backgroundColor`.
|
|
2573
2582
|
*
|
|
2574
|
-
*
|
|
2583
|
+
* > [!NOTE] The alpha value is _not_ returned alongside the red, green, and blue
|
|
2575
2584
|
* values.
|
|
2576
2585
|
*/
|
|
2577
2586
|
getBackgroundColor(): string;
|
|
2578
2587
|
/**
|
|
2579
2588
|
* The `bounds` of the window as `Object`.
|
|
2580
2589
|
*
|
|
2581
|
-
*
|
|
2590
|
+
* > [!NOTE] On macOS, the y-coordinate value returned will be at minimum the Tray
|
|
2582
2591
|
* height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
|
|
2583
2592
|
* 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
|
|
2584
2593
|
* 25, y: 38, width: 800, height: 600 }`.
|
|
@@ -2628,7 +2637,7 @@ declare namespace Electron {
|
|
|
2628
2637
|
/**
|
|
2629
2638
|
* Contains the window bounds of the normal state
|
|
2630
2639
|
*
|
|
2631
|
-
*
|
|
2640
|
+
* > [!NOTE] Whatever the current state of the window : maximized, minimized or in
|
|
2632
2641
|
* fullscreen, this function always returns the position and size of the window in
|
|
2633
2642
|
* normal state. In normal state, getBounds and getNormalBounds returns the same
|
|
2634
2643
|
* `Rectangle`.
|
|
@@ -2660,7 +2669,7 @@ declare namespace Electron {
|
|
|
2660
2669
|
/**
|
|
2661
2670
|
* The title of the native window.
|
|
2662
2671
|
*
|
|
2663
|
-
*
|
|
2672
|
+
* > [!NOTE] The title of the web page can be different from the title of the
|
|
2664
2673
|
* native window.
|
|
2665
2674
|
*/
|
|
2666
2675
|
getTitle(): string;
|
|
@@ -2844,7 +2853,7 @@ declare namespace Electron {
|
|
|
2844
2853
|
/**
|
|
2845
2854
|
* Whether the window is visible on all workspaces.
|
|
2846
2855
|
*
|
|
2847
|
-
*
|
|
2856
|
+
* > [!NOTE] This API always returns false on Windows.
|
|
2848
2857
|
*
|
|
2849
2858
|
* @platform darwin,linux
|
|
2850
2859
|
*/
|
|
@@ -2928,7 +2937,7 @@ declare namespace Electron {
|
|
|
2928
2937
|
/**
|
|
2929
2938
|
* Sets the properties for the window's taskbar button.
|
|
2930
2939
|
*
|
|
2931
|
-
*
|
|
2940
|
+
* > [!NOTE] `relaunchCommand` and `relaunchDisplayName` must always be set
|
|
2932
2941
|
* together. If one of those properties is not set, then neither will be used.
|
|
2933
2942
|
*
|
|
2934
2943
|
* @platform win32
|
|
@@ -3006,7 +3015,7 @@ declare namespace Electron {
|
|
|
3006
3015
|
*
|
|
3007
3016
|
* See the Windows documentation for more details.
|
|
3008
3017
|
*
|
|
3009
|
-
*
|
|
3018
|
+
* > [!NOTE] This method is only supported on Windows 11 22H2 and up.
|
|
3010
3019
|
*
|
|
3011
3020
|
* @platform win32
|
|
3012
3021
|
*/
|
|
@@ -3015,7 +3024,7 @@ declare namespace Electron {
|
|
|
3015
3024
|
* Resizes and moves the window to the supplied bounds. Any properties that are not
|
|
3016
3025
|
* supplied will default to their current values.
|
|
3017
3026
|
*
|
|
3018
|
-
*
|
|
3027
|
+
* > [!NOTE] On macOS, the y-coordinate value cannot be smaller than the Tray
|
|
3019
3028
|
* height. The tray height has changed over time and depends on the operating
|
|
3020
3029
|
* system, but is between 20-40px. Passing a value lower than the tray height will
|
|
3021
3030
|
* result in a window that is flush to the tray.
|
|
@@ -3073,8 +3082,8 @@ declare namespace Electron {
|
|
|
3073
3082
|
/**
|
|
3074
3083
|
* Sets whether the window should be in fullscreen mode.
|
|
3075
3084
|
*
|
|
3076
|
-
*
|
|
3077
|
-
* actions depend on the fullscreen state, use the 'enter-full-screen' or
|
|
3085
|
+
* > [!NOTE] On macOS, fullscreen transitions take place asynchronously. If further
|
|
3086
|
+
* actions depend on the fullscreen state, use the 'enter-full-screen' or >
|
|
3078
3087
|
* 'leave-full-screen' events.
|
|
3079
3088
|
*/
|
|
3080
3089
|
setFullScreen(flag: boolean): void;
|
|
@@ -3312,7 +3321,7 @@ declare namespace Electron {
|
|
|
3312
3321
|
* `undefined` clears the touch bar. This method only has an effect if the machine
|
|
3313
3322
|
* has a touch bar.
|
|
3314
3323
|
*
|
|
3315
|
-
*
|
|
3324
|
+
* > [!NOTE] The TouchBar API is currently experimental and may change or be
|
|
3316
3325
|
* removed in future Electron releases.
|
|
3317
3326
|
*
|
|
3318
3327
|
* @platform darwin
|
|
@@ -3328,7 +3337,7 @@ declare namespace Electron {
|
|
|
3328
3337
|
/**
|
|
3329
3338
|
* Sets whether the window should be visible on all workspaces.
|
|
3330
3339
|
*
|
|
3331
|
-
*
|
|
3340
|
+
* > [!NOTE] This API does nothing on Windows.
|
|
3332
3341
|
*
|
|
3333
3342
|
* @platform darwin,linux
|
|
3334
3343
|
*/
|
|
@@ -3466,7 +3475,7 @@ declare namespace Electron {
|
|
|
3466
3475
|
/**
|
|
3467
3476
|
* A `boolean` property that determines whether the menu bar should be visible.
|
|
3468
3477
|
*
|
|
3469
|
-
*
|
|
3478
|
+
* > [!NOTE] If the menu bar is auto-hide, users can still bring up the menu bar by
|
|
3470
3479
|
* pressing the single `Alt` key.
|
|
3471
3480
|
*
|
|
3472
3481
|
* @platform win32,linux
|
|
@@ -3526,7 +3535,7 @@ declare namespace Electron {
|
|
|
3526
3535
|
/**
|
|
3527
3536
|
* A `string` property that determines the title of the native window.
|
|
3528
3537
|
*
|
|
3529
|
-
*
|
|
3538
|
+
* > [!NOTE] The title of the web page can be different from the title of the
|
|
3530
3539
|
* native window.
|
|
3531
3540
|
*/
|
|
3532
3541
|
title: string;
|
|
@@ -3534,7 +3543,7 @@ declare namespace Electron {
|
|
|
3534
3543
|
* A `boolean` property that determines whether the window is visible on all
|
|
3535
3544
|
* workspaces.
|
|
3536
3545
|
*
|
|
3537
|
-
*
|
|
3546
|
+
* > [!NOTE] Always returns false on Windows.
|
|
3538
3547
|
*
|
|
3539
3548
|
* @platform darwin,linux
|
|
3540
3549
|
*/
|
|
@@ -3880,7 +3889,7 @@ declare namespace Electron {
|
|
|
3880
3889
|
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
|
3881
3890
|
* * e.g. `blueviolet` or `red`
|
|
3882
3891
|
*
|
|
3883
|
-
*
|
|
3892
|
+
* > [!NOTE] Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
|
|
3884
3893
|
* `RGB`.
|
|
3885
3894
|
*
|
|
3886
3895
|
* @experimental
|
|
@@ -4035,11 +4044,11 @@ declare namespace Electron {
|
|
|
4035
4044
|
* In Electron, returning any value other than `undefined` would cancel the close.
|
|
4036
4045
|
* For example:
|
|
4037
4046
|
*
|
|
4038
|
-
*
|
|
4047
|
+
* > [!NOTE] There is a subtle difference between the behaviors of
|
|
4039
4048
|
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
|
4040
4049
|
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
|
4041
4050
|
* instead of only returning a value, as the former works more consistently within
|
|
4042
|
-
* Electron.
|
|
4051
|
+
* Electron.
|
|
4043
4052
|
*/
|
|
4044
4053
|
on(event: 'close', listener: (event: Event) => void): this;
|
|
4045
4054
|
off(event: 'close', listener: (event: Event) => void): this;
|
|
@@ -4056,11 +4065,11 @@ declare namespace Electron {
|
|
|
4056
4065
|
* In Electron, returning any value other than `undefined` would cancel the close.
|
|
4057
4066
|
* For example:
|
|
4058
4067
|
*
|
|
4059
|
-
*
|
|
4068
|
+
* > [!NOTE] There is a subtle difference between the behaviors of
|
|
4060
4069
|
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
|
4061
4070
|
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
|
4062
4071
|
* instead of only returning a value, as the former works more consistently within
|
|
4063
|
-
* Electron.
|
|
4072
|
+
* Electron.
|
|
4064
4073
|
*/
|
|
4065
4074
|
on(event: 'close', listener: (event: Event) => void): this;
|
|
4066
4075
|
off(event: 'close', listener: (event: Event) => void): this;
|
|
@@ -4216,7 +4225,7 @@ declare namespace Electron {
|
|
|
4216
4225
|
/**
|
|
4217
4226
|
* Emitted once when the window is moved to a new position.
|
|
4218
4227
|
*
|
|
4219
|
-
*
|
|
4228
|
+
* > [!NOTE] On macOS, this event is an alias of `move`.
|
|
4220
4229
|
*
|
|
4221
4230
|
* @platform darwin,win32
|
|
4222
4231
|
*/
|
|
@@ -4240,7 +4249,7 @@ declare namespace Electron {
|
|
|
4240
4249
|
/**
|
|
4241
4250
|
* Emitted once when the window is moved to a new position.
|
|
4242
4251
|
*
|
|
4243
|
-
*
|
|
4252
|
+
* > [!NOTE] On macOS, this event is an alias of `move`.
|
|
4244
4253
|
*
|
|
4245
4254
|
* @platform darwin,win32
|
|
4246
4255
|
*/
|
|
@@ -5105,7 +5114,7 @@ declare namespace Electron {
|
|
|
5105
5114
|
*/
|
|
5106
5115
|
constructor(options?: BrowserWindowConstructorOptions);
|
|
5107
5116
|
/**
|
|
5108
|
-
* >
|
|
5117
|
+
* > [!NOTE] The `BrowserView` class is deprecated, and replaced by the new
|
|
5109
5118
|
* `WebContentsView` class.
|
|
5110
5119
|
*
|
|
5111
5120
|
* The window that owns the given `browserView`. If the given view is not attached
|
|
@@ -5134,7 +5143,7 @@ declare namespace Electron {
|
|
|
5134
5143
|
/**
|
|
5135
5144
|
* Replacement API for setBrowserView supporting work with multi browser views.
|
|
5136
5145
|
*
|
|
5137
|
-
* >
|
|
5146
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5138
5147
|
* `WebContentsView` class.
|
|
5139
5148
|
*
|
|
5140
5149
|
* @experimental
|
|
@@ -5198,14 +5207,14 @@ declare namespace Electron {
|
|
|
5198
5207
|
*
|
|
5199
5208
|
* See Setting `backgroundColor`.
|
|
5200
5209
|
*
|
|
5201
|
-
*
|
|
5210
|
+
* > [!NOTE] The alpha value is _not_ returned alongside the red, green, and blue
|
|
5202
5211
|
* values.
|
|
5203
5212
|
*/
|
|
5204
5213
|
getBackgroundColor(): string;
|
|
5205
5214
|
/**
|
|
5206
5215
|
* The `bounds` of the window as `Object`.
|
|
5207
5216
|
*
|
|
5208
|
-
*
|
|
5217
|
+
* > [!NOTE] On macOS, the y-coordinate value returned will be at minimum the Tray
|
|
5209
5218
|
* height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
|
|
5210
5219
|
* 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
|
|
5211
5220
|
* 25, y: 38, width: 800, height: 600 }`.
|
|
@@ -5215,7 +5224,7 @@ declare namespace Electron {
|
|
|
5215
5224
|
* The `BrowserView` attached to `win`. Returns `null` if one is not attached.
|
|
5216
5225
|
* Throws an error if multiple `BrowserView`s are attached.
|
|
5217
5226
|
*
|
|
5218
|
-
* >
|
|
5227
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5219
5228
|
* `WebContentsView` class.
|
|
5220
5229
|
*
|
|
5221
5230
|
* @experimental
|
|
@@ -5227,7 +5236,7 @@ declare namespace Electron {
|
|
|
5227
5236
|
* `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
|
|
5228
5237
|
* element of the array.
|
|
5229
5238
|
*
|
|
5230
|
-
* >
|
|
5239
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5231
5240
|
* `WebContentsView` class.
|
|
5232
5241
|
*
|
|
5233
5242
|
* @experimental
|
|
@@ -5274,9 +5283,9 @@ declare namespace Electron {
|
|
|
5274
5283
|
/**
|
|
5275
5284
|
* Contains the window bounds of the normal state
|
|
5276
5285
|
*
|
|
5277
|
-
*
|
|
5278
|
-
* fullscreen, this function always returns the position and size of the window in
|
|
5279
|
-
* normal state. In normal state, getBounds and getNormalBounds
|
|
5286
|
+
* > [!NOTE] Whatever the current state of the window (maximized, minimized or in
|
|
5287
|
+
* fullscreen), this function always returns the position and size of the window in
|
|
5288
|
+
* normal state. In normal state, `getBounds` and `getNormalBounds` return the same
|
|
5280
5289
|
* `Rectangle`.
|
|
5281
5290
|
*/
|
|
5282
5291
|
getNormalBounds(): Rectangle;
|
|
@@ -5306,7 +5315,7 @@ declare namespace Electron {
|
|
|
5306
5315
|
/**
|
|
5307
5316
|
* The title of the native window.
|
|
5308
5317
|
*
|
|
5309
|
-
*
|
|
5318
|
+
* > [!NOTE] The title of the web page can be different from the title of the
|
|
5310
5319
|
* native window.
|
|
5311
5320
|
*/
|
|
5312
5321
|
getTitle(): string;
|
|
@@ -5382,7 +5391,7 @@ declare namespace Electron {
|
|
|
5382
5391
|
/**
|
|
5383
5392
|
* Whether the window is in fullscreen mode.
|
|
5384
5393
|
*
|
|
5385
|
-
*
|
|
5394
|
+
* > [!NOTE] On macOS, fullscreen transitions take place asynchronously. When
|
|
5386
5395
|
* querying for a BrowserWindow's fullscreen status, you should ensure that either
|
|
5387
5396
|
* the 'enter-full-screen' or 'leave-full-screen' events have been emitted.
|
|
5388
5397
|
*/
|
|
@@ -5494,7 +5503,7 @@ declare namespace Electron {
|
|
|
5494
5503
|
/**
|
|
5495
5504
|
* Whether the window is visible on all workspaces.
|
|
5496
5505
|
*
|
|
5497
|
-
*
|
|
5506
|
+
* > [!NOTE] This API always returns false on Windows.
|
|
5498
5507
|
*
|
|
5499
5508
|
* @platform darwin,linux
|
|
5500
5509
|
*/
|
|
@@ -5575,7 +5584,7 @@ declare namespace Electron {
|
|
|
5575
5584
|
*/
|
|
5576
5585
|
reload(): void;
|
|
5577
5586
|
/**
|
|
5578
|
-
* >
|
|
5587
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5579
5588
|
* `WebContentsView` class.
|
|
5580
5589
|
*
|
|
5581
5590
|
* @experimental
|
|
@@ -5615,7 +5624,7 @@ declare namespace Electron {
|
|
|
5615
5624
|
/**
|
|
5616
5625
|
* Sets the properties for the window's taskbar button.
|
|
5617
5626
|
*
|
|
5618
|
-
*
|
|
5627
|
+
* > [!NOTE] `relaunchCommand` and `relaunchDisplayName` must always be set
|
|
5619
5628
|
* together. If one of those properties is not set, then neither will be used.
|
|
5620
5629
|
*
|
|
5621
5630
|
* @platform win32
|
|
@@ -5693,7 +5702,7 @@ declare namespace Electron {
|
|
|
5693
5702
|
*
|
|
5694
5703
|
* See the Windows documentation for more details.
|
|
5695
5704
|
*
|
|
5696
|
-
*
|
|
5705
|
+
* > [!NOTE] This method is only supported on Windows 11 22H2 and up.
|
|
5697
5706
|
*
|
|
5698
5707
|
* @platform win32
|
|
5699
5708
|
*/
|
|
@@ -5702,14 +5711,14 @@ declare namespace Electron {
|
|
|
5702
5711
|
* Resizes and moves the window to the supplied bounds. Any properties that are not
|
|
5703
5712
|
* supplied will default to their current values.
|
|
5704
5713
|
*
|
|
5705
|
-
*
|
|
5714
|
+
* > [!NOTE] On macOS, the y-coordinate value cannot be smaller than the Tray
|
|
5706
5715
|
* height. The tray height has changed over time and depends on the operating
|
|
5707
5716
|
* system, but is between 20-40px. Passing a value lower than the tray height will
|
|
5708
5717
|
* result in a window that is flush to the tray.
|
|
5709
5718
|
*/
|
|
5710
5719
|
setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
|
|
5711
5720
|
/**
|
|
5712
|
-
* >
|
|
5721
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5713
5722
|
* `WebContentsView` class.
|
|
5714
5723
|
*
|
|
5715
5724
|
* @experimental
|
|
@@ -5764,7 +5773,7 @@ declare namespace Electron {
|
|
|
5764
5773
|
/**
|
|
5765
5774
|
* Sets whether the window should be in fullscreen mode.
|
|
5766
5775
|
*
|
|
5767
|
-
*
|
|
5776
|
+
* > [!NOTE] On macOS, fullscreen transitions take place asynchronously. If further
|
|
5768
5777
|
* actions depend on the fullscreen state, use the 'enter-full-screen' or
|
|
5769
5778
|
* 'leave-full-screen' events.
|
|
5770
5779
|
*/
|
|
@@ -6002,7 +6011,7 @@ declare namespace Electron {
|
|
|
6002
6011
|
* Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
|
|
6003
6012
|
* error if `browserView` is not attached to `win`.
|
|
6004
6013
|
*
|
|
6005
|
-
* >
|
|
6014
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
6006
6015
|
* `WebContentsView` class.
|
|
6007
6016
|
*
|
|
6008
6017
|
* @experimental
|
|
@@ -6014,7 +6023,7 @@ declare namespace Electron {
|
|
|
6014
6023
|
* `undefined` clears the touch bar. This method only has an effect if the machine
|
|
6015
6024
|
* has a touch bar.
|
|
6016
6025
|
*
|
|
6017
|
-
*
|
|
6026
|
+
* > [!NOTE] The TouchBar API is currently experimental and may change or be
|
|
6018
6027
|
* removed in future Electron releases.
|
|
6019
6028
|
*
|
|
6020
6029
|
* @platform darwin
|
|
@@ -6032,7 +6041,7 @@ declare namespace Electron {
|
|
|
6032
6041
|
/**
|
|
6033
6042
|
* Sets whether the window should be visible on all workspaces.
|
|
6034
6043
|
*
|
|
6035
|
-
*
|
|
6044
|
+
* > [!NOTE] This API does nothing on Windows.
|
|
6036
6045
|
*
|
|
6037
6046
|
* @platform darwin,linux
|
|
6038
6047
|
*/
|
|
@@ -6172,7 +6181,7 @@ declare namespace Electron {
|
|
|
6172
6181
|
/**
|
|
6173
6182
|
* A `boolean` property that determines whether the menu bar should be visible.
|
|
6174
6183
|
*
|
|
6175
|
-
*
|
|
6184
|
+
* > [!NOTE] If the menu bar is auto-hide, users can still bring up the menu bar by
|
|
6176
6185
|
* pressing the single `Alt` key.
|
|
6177
6186
|
*
|
|
6178
6187
|
* @platform win32,linux
|
|
@@ -6232,7 +6241,7 @@ declare namespace Electron {
|
|
|
6232
6241
|
/**
|
|
6233
6242
|
* A `string` property that determines the title of the native window.
|
|
6234
6243
|
*
|
|
6235
|
-
*
|
|
6244
|
+
* > [!NOTE] The title of the web page can be different from the title of the
|
|
6236
6245
|
* native window.
|
|
6237
6246
|
*/
|
|
6238
6247
|
title: string;
|
|
@@ -6240,7 +6249,7 @@ declare namespace Electron {
|
|
|
6240
6249
|
* A `boolean` property that determines whether the window is visible on all
|
|
6241
6250
|
* workspaces.
|
|
6242
6251
|
*
|
|
6243
|
-
*
|
|
6252
|
+
* > [!NOTE] Always returns false on Windows.
|
|
6244
6253
|
*
|
|
6245
6254
|
* @platform darwin,linux
|
|
6246
6255
|
*/
|
|
@@ -6650,7 +6659,7 @@ declare namespace Electron {
|
|
|
6650
6659
|
/**
|
|
6651
6660
|
* Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
|
|
6652
6661
|
*
|
|
6653
|
-
*
|
|
6662
|
+
* > [!NOTE] Most apps on Windows don't support pasting bookmarks into them so you
|
|
6654
6663
|
* can use `clipboard.write` to write both a bookmark and fallback text to the
|
|
6655
6664
|
* clipboard.
|
|
6656
6665
|
*
|
|
@@ -6701,14 +6710,14 @@ declare namespace Electron {
|
|
|
6701
6710
|
* If you're appending an argument like `--switch=value`, consider using
|
|
6702
6711
|
* `appendSwitch('switch', 'value')` instead.
|
|
6703
6712
|
*
|
|
6704
|
-
*
|
|
6713
|
+
* > [!NOTE] This will not affect `process.argv`. The intended usage of this
|
|
6705
6714
|
* function is to control Chromium's behavior.
|
|
6706
6715
|
*/
|
|
6707
6716
|
appendArgument(value: string): void;
|
|
6708
6717
|
/**
|
|
6709
6718
|
* Append a switch (with optional `value`) to Chromium's command line.
|
|
6710
6719
|
*
|
|
6711
|
-
*
|
|
6720
|
+
* > [!NOTE] This will not affect `process.argv`. The intended usage of this
|
|
6712
6721
|
* function is to control Chromium's behavior.
|
|
6713
6722
|
*/
|
|
6714
6723
|
appendSwitch(the_switch: string, value?: string): void;
|
|
@@ -6719,7 +6728,7 @@ declare namespace Electron {
|
|
|
6719
6728
|
* to be used for application-specific command line arguments. For the latter,
|
|
6720
6729
|
* please use `process.argv`.
|
|
6721
6730
|
*
|
|
6722
|
-
*
|
|
6731
|
+
* > [!NOTE] When the switch is not present or has no value, it returns empty
|
|
6723
6732
|
* string.
|
|
6724
6733
|
*/
|
|
6725
6734
|
getSwitchValue(the_switch: string): string;
|
|
@@ -6730,7 +6739,7 @@ declare namespace Electron {
|
|
|
6730
6739
|
/**
|
|
6731
6740
|
* Removes the specified switch from Chromium's command line.
|
|
6732
6741
|
*
|
|
6733
|
-
*
|
|
6742
|
+
* > [!NOTE] This will not affect `process.argv`. The intended usage of this
|
|
6734
6743
|
* function is to control Chromium's behavior.
|
|
6735
6744
|
*/
|
|
6736
6745
|
removeSwitch(the_switch: string): void;
|
|
@@ -7008,7 +7017,7 @@ declare namespace Electron {
|
|
|
7008
7017
|
* parameters in a renderer process will not result in those parameters being sent
|
|
7009
7018
|
* with crashes that occur in other renderer processes or in the main process.
|
|
7010
7019
|
*
|
|
7011
|
-
*
|
|
7020
|
+
* > [!NOTE] Parameters have limits on the length of the keys and values. Key names
|
|
7012
7021
|
* must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
|
|
7013
7022
|
* Keys with names longer than the maximum will be silently ignored. Key values
|
|
7014
7023
|
* longer than the maximum length will be truncated.
|
|
@@ -7020,7 +7029,7 @@ declare namespace Electron {
|
|
|
7020
7029
|
* be returned until it is uploaded. In the case that there are no uploaded
|
|
7021
7030
|
* reports, `null` is returned.
|
|
7022
7031
|
*
|
|
7023
|
-
*
|
|
7032
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7024
7033
|
*/
|
|
7025
7034
|
getLastCrashReport(): (CrashReport) | (null);
|
|
7026
7035
|
/**
|
|
@@ -7031,14 +7040,14 @@ declare namespace Electron {
|
|
|
7031
7040
|
* Returns all uploaded crash reports. Each report contains the date and uploaded
|
|
7032
7041
|
* ID.
|
|
7033
7042
|
*
|
|
7034
|
-
*
|
|
7043
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7035
7044
|
*/
|
|
7036
7045
|
getUploadedReports(): CrashReport[];
|
|
7037
7046
|
/**
|
|
7038
7047
|
* Whether reports should be submitted to the server. Set through the `start`
|
|
7039
7048
|
* method or `setUploadToServer`.
|
|
7040
7049
|
*
|
|
7041
|
-
*
|
|
7050
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7042
7051
|
*/
|
|
7043
7052
|
getUploadToServer(): boolean;
|
|
7044
7053
|
/**
|
|
@@ -7050,7 +7059,7 @@ declare namespace Electron {
|
|
|
7050
7059
|
* This would normally be controlled by user preferences. This has no effect if
|
|
7051
7060
|
* called before `start` is called.
|
|
7052
7061
|
*
|
|
7053
|
-
*
|
|
7062
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7054
7063
|
*/
|
|
7055
7064
|
setUploadToServer(uploadToServer: boolean): void;
|
|
7056
7065
|
/**
|
|
@@ -7064,19 +7073,19 @@ declare namespace Electron {
|
|
|
7064
7073
|
* renderer process is created, then that renderer process will not be monitored by
|
|
7065
7074
|
* the crash reporter.
|
|
7066
7075
|
*
|
|
7067
|
-
*
|
|
7076
|
+
* > [!NOTE] You can test out the crash reporter by generating a crash using
|
|
7068
7077
|
* `process.crash()`.
|
|
7069
7078
|
*
|
|
7070
|
-
*
|
|
7079
|
+
* > [!NOTE] If you need to send additional/updated `extra` parameters after your
|
|
7071
7080
|
* first call `start` you can call `addExtraParameter`.
|
|
7072
7081
|
*
|
|
7073
|
-
*
|
|
7082
|
+
* > [!NOTE] Parameters passed in `extra`, `globalExtra` or set with
|
|
7074
7083
|
* `addExtraParameter` have limits on the length of the keys and values. Key names
|
|
7075
7084
|
* must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
|
|
7076
7085
|
* with names longer than the maximum will be silently ignored. Key values longer
|
|
7077
7086
|
* than the maximum length will be truncated.
|
|
7078
7087
|
*
|
|
7079
|
-
*
|
|
7088
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7080
7089
|
*/
|
|
7081
7090
|
start(options: CrashReporterStartOptions): void;
|
|
7082
7091
|
}
|
|
@@ -7234,7 +7243,7 @@ declare namespace Electron {
|
|
|
7234
7243
|
* `DesktopCapturerSource` represents a screen or an individual window that can be
|
|
7235
7244
|
* captured.
|
|
7236
7245
|
*
|
|
7237
|
-
*
|
|
7246
|
+
* > [!NOTE] Capturing the screen contents requires user consent on macOS 10.15
|
|
7238
7247
|
* Catalina or higher, which can detected by
|
|
7239
7248
|
* `systemPreferences.getMediaAccessStatus`.
|
|
7240
7249
|
*/
|
|
@@ -7398,11 +7407,11 @@ declare namespace Electron {
|
|
|
7398
7407
|
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
7399
7408
|
* `'*'` wildcard (no other wildcard is supported).
|
|
7400
7409
|
*
|
|
7401
|
-
*
|
|
7410
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
7402
7411
|
* and a directory selector, so if you set `properties` to `['openFile',
|
|
7403
7412
|
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
7404
7413
|
*
|
|
7405
|
-
*
|
|
7414
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
7406
7415
|
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
7407
7416
|
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
7408
7417
|
*/
|
|
@@ -7428,11 +7437,11 @@ declare namespace Electron {
|
|
|
7428
7437
|
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
7429
7438
|
* `'*'` wildcard (no other wildcard is supported).
|
|
7430
7439
|
*
|
|
7431
|
-
*
|
|
7440
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
7432
7441
|
* and a directory selector, so if you set `properties` to `['openFile',
|
|
7433
7442
|
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
7434
7443
|
*
|
|
7435
|
-
*
|
|
7444
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
7436
7445
|
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
7437
7446
|
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
7438
7447
|
*/
|
|
@@ -7451,11 +7460,11 @@ declare namespace Electron {
|
|
|
7451
7460
|
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
7452
7461
|
* `'*'` wildcard (no other wildcard is supported).
|
|
7453
7462
|
*
|
|
7454
|
-
*
|
|
7463
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
7455
7464
|
* and a directory selector, so if you set `properties` to `['openFile',
|
|
7456
7465
|
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
7457
7466
|
*
|
|
7458
|
-
*
|
|
7467
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
7459
7468
|
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
7460
7469
|
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
7461
7470
|
*/
|
|
@@ -7474,11 +7483,11 @@ declare namespace Electron {
|
|
|
7474
7483
|
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
7475
7484
|
* `'*'` wildcard (no other wildcard is supported).
|
|
7476
7485
|
*
|
|
7477
|
-
*
|
|
7486
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
7478
7487
|
* and a directory selector, so if you set `properties` to `['openFile',
|
|
7479
7488
|
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
7480
7489
|
*
|
|
7481
|
-
*
|
|
7490
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
7482
7491
|
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
7483
7492
|
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
7484
7493
|
*/
|
|
@@ -7499,7 +7508,7 @@ declare namespace Electron {
|
|
|
7499
7508
|
* The `filters` specifies an array of file types that can be displayed, see
|
|
7500
7509
|
* `dialog.showOpenDialog` for an example.
|
|
7501
7510
|
*
|
|
7502
|
-
*
|
|
7511
|
+
* > [!NOTE] On macOS, using the asynchronous version is recommended to avoid
|
|
7503
7512
|
* issues when expanding and collapsing the dialog.
|
|
7504
7513
|
*/
|
|
7505
7514
|
showSaveDialog(window: BaseWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
|
@@ -7519,7 +7528,7 @@ declare namespace Electron {
|
|
|
7519
7528
|
* The `filters` specifies an array of file types that can be displayed, see
|
|
7520
7529
|
* `dialog.showOpenDialog` for an example.
|
|
7521
7530
|
*
|
|
7522
|
-
*
|
|
7531
|
+
* > [!NOTE] On macOS, using the asynchronous version is recommended to avoid
|
|
7523
7532
|
* issues when expanding and collapsing the dialog.
|
|
7524
7533
|
*/
|
|
7525
7534
|
showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
|
@@ -7644,7 +7653,7 @@ declare namespace Electron {
|
|
|
7644
7653
|
* However, the request remains active until either the application becomes active
|
|
7645
7654
|
* or the request is canceled.
|
|
7646
7655
|
*
|
|
7647
|
-
*
|
|
7656
|
+
* > [!NOTE] This method can only be used while the app is not focused; when the
|
|
7648
7657
|
* app is focused it will return -1.
|
|
7649
7658
|
*
|
|
7650
7659
|
* @platform darwin
|
|
@@ -7812,7 +7821,7 @@ declare namespace Electron {
|
|
|
7812
7821
|
/**
|
|
7813
7822
|
* The file name of the download item.
|
|
7814
7823
|
*
|
|
7815
|
-
*
|
|
7824
|
+
* > [!NOTE] The file name is not always the same as the actual one saved in local
|
|
7816
7825
|
* disk. If user changes the file name in a prompted download saving dialog, the
|
|
7817
7826
|
* actual name of saved file will be different.
|
|
7818
7827
|
*/
|
|
@@ -7852,7 +7861,7 @@ declare namespace Electron {
|
|
|
7852
7861
|
* The current state. Can be `progressing`, `completed`, `cancelled` or
|
|
7853
7862
|
* `interrupted`.
|
|
7854
7863
|
*
|
|
7855
|
-
*
|
|
7864
|
+
* > [!NOTE] The following methods are useful specifically to resume a `cancelled`
|
|
7856
7865
|
* item when session is restarted.
|
|
7857
7866
|
*/
|
|
7858
7867
|
getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
|
|
@@ -7885,7 +7894,7 @@ declare namespace Electron {
|
|
|
7885
7894
|
/**
|
|
7886
7895
|
* Resumes the download that has been paused.
|
|
7887
7896
|
*
|
|
7888
|
-
*
|
|
7897
|
+
* > [!NOTE] To enable resumable downloads the server you are downloading from must
|
|
7889
7898
|
* support range requests and provide both `Last-Modified` and `ETag` header
|
|
7890
7899
|
* values. Otherwise `resume()` will dismiss previously received bytes and restart
|
|
7891
7900
|
* the download from the beginning.
|
|
@@ -7997,14 +8006,14 @@ declare namespace Electron {
|
|
|
7997
8006
|
/**
|
|
7998
8007
|
* A list of all loaded extensions.
|
|
7999
8008
|
*
|
|
8000
|
-
*
|
|
8009
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
8001
8010
|
* is emitted.
|
|
8002
8011
|
*/
|
|
8003
8012
|
getAllExtensions(): Extension[];
|
|
8004
8013
|
/**
|
|
8005
8014
|
* The loaded extension with the given ID.
|
|
8006
8015
|
*
|
|
8007
|
-
*
|
|
8016
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
8008
8017
|
* is emitted.
|
|
8009
8018
|
*/
|
|
8010
8019
|
getExtension(extensionId: string): (Extension) | (null);
|
|
@@ -8025,17 +8034,17 @@ declare namespace Electron {
|
|
|
8025
8034
|
*
|
|
8026
8035
|
* This API does not support loading packed (.crx) extensions.
|
|
8027
8036
|
*
|
|
8028
|
-
*
|
|
8037
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
8029
8038
|
* is emitted.
|
|
8030
8039
|
*
|
|
8031
|
-
*
|
|
8040
|
+
* > [!NOTE] Loading extensions into in-memory (non-persistent) sessions is not
|
|
8032
8041
|
* supported and will throw an error.
|
|
8033
8042
|
*/
|
|
8034
8043
|
loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
|
|
8035
8044
|
/**
|
|
8036
8045
|
* Unloads an extension.
|
|
8037
8046
|
*
|
|
8038
|
-
*
|
|
8047
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
8039
8048
|
* is emitted.
|
|
8040
8049
|
*/
|
|
8041
8050
|
removeExtension(extensionId: string): void;
|
|
@@ -8707,7 +8716,7 @@ declare namespace Electron {
|
|
|
8707
8716
|
*
|
|
8708
8717
|
* If you do not need a response to the message, consider using `ipcRenderer.send`.
|
|
8709
8718
|
*
|
|
8710
|
-
* >
|
|
8719
|
+
* > [!NOTE] Sending non-standard JavaScript types such as DOM objects or special
|
|
8711
8720
|
* Electron objects will throw an exception.
|
|
8712
8721
|
*
|
|
8713
8722
|
* Since the main process does not have support for DOM objects such as
|
|
@@ -8715,7 +8724,7 @@ declare namespace Electron {
|
|
|
8715
8724
|
* Electron's IPC to the main process, as the main process would have no way to
|
|
8716
8725
|
* decode them. Attempting to send such objects over IPC will result in an error.
|
|
8717
8726
|
*
|
|
8718
|
-
* >
|
|
8727
|
+
* > [!NOTE] If the handler in the main process throws an error, the promise
|
|
8719
8728
|
* returned by `invoke` will reject. However, the `Error` object in the renderer
|
|
8720
8729
|
* process will not be the same as the one thrown in the main process.
|
|
8721
8730
|
*/
|
|
@@ -8810,9 +8819,9 @@ declare namespace Electron {
|
|
|
8810
8819
|
* The main process handles it by listening for `channel` with `ipcMain` module,
|
|
8811
8820
|
* and replies by setting `event.returnValue`.
|
|
8812
8821
|
*
|
|
8813
|
-
* >
|
|
8814
|
-
*
|
|
8815
|
-
*
|
|
8822
|
+
* > [!WARNING] Sending a synchronous message will block the whole renderer process
|
|
8823
|
+
* until the reply is received, so use this method only as a last resort. It's much
|
|
8824
|
+
* better to use the asynchronous version, `invoke()`.
|
|
8816
8825
|
*/
|
|
8817
8826
|
sendSync(channel: string, ...args: any[]): any;
|
|
8818
8827
|
/**
|
|
@@ -9027,7 +9036,7 @@ declare namespace Electron {
|
|
|
9027
9036
|
/**
|
|
9028
9037
|
* The application menu, if set, or `null`, if not set.
|
|
9029
9038
|
*
|
|
9030
|
-
*
|
|
9039
|
+
* > [!NOTE] The returned `Menu` instance doesn't support dynamic addition or
|
|
9031
9040
|
* removal of menu items. Instance properties can still be dynamically modified.
|
|
9032
9041
|
*/
|
|
9033
9042
|
static getApplicationMenu(): (Menu) | (null);
|
|
@@ -9058,7 +9067,7 @@ declare namespace Electron {
|
|
|
9058
9067
|
* Passing `null` will suppress the default menu. On Windows and Linux, this has
|
|
9059
9068
|
* the additional effect of removing the menu bar from the window.
|
|
9060
9069
|
*
|
|
9061
|
-
*
|
|
9070
|
+
* > [!NOTE] The default menu will be created automatically if the app does not set
|
|
9062
9071
|
* one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
|
|
9063
9072
|
* `Help`.
|
|
9064
9073
|
*/
|
|
@@ -9202,7 +9211,7 @@ declare namespace Electron {
|
|
|
9202
9211
|
* An `Accelerator | null` indicating the item's user-assigned accelerator for the
|
|
9203
9212
|
* menu item.
|
|
9204
9213
|
*
|
|
9205
|
-
*
|
|
9214
|
+
* > [!NOTE] This property is only initialized after the `MenuItem` has been added
|
|
9206
9215
|
* to a `Menu`. Either via `Menu.buildFromTemplate` or via
|
|
9207
9216
|
* `Menu.append()/insert()`. Accessing before initialization will just return
|
|
9208
9217
|
* `null`.
|
|
@@ -9387,7 +9396,7 @@ declare namespace Electron {
|
|
|
9387
9396
|
/**
|
|
9388
9397
|
* fulfilled with the file's thumbnail preview image, which is a NativeImage.
|
|
9389
9398
|
*
|
|
9390
|
-
*
|
|
9399
|
+
* > [!NOTE] Windows implementation will ignore `size.height` and scale the height
|
|
9391
9400
|
* according to `size.width`.
|
|
9392
9401
|
*
|
|
9393
9402
|
* @platform darwin,win32
|
|
@@ -9701,7 +9710,7 @@ declare namespace Electron {
|
|
|
9701
9710
|
* intercepted request to the built-in handler. webRequest handlers will still be
|
|
9702
9711
|
* triggered when bypassing custom protocols.
|
|
9703
9712
|
*
|
|
9704
|
-
*
|
|
9713
|
+
* > [!NOTE] In the utility process, custom protocols are not supported.
|
|
9705
9714
|
*/
|
|
9706
9715
|
fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
|
|
9707
9716
|
/**
|
|
@@ -10464,7 +10473,7 @@ declare namespace Electron {
|
|
|
10464
10473
|
* Starts preventing the system from entering lower-power mode. Returns an integer
|
|
10465
10474
|
* identifying the power save blocker.
|
|
10466
10475
|
*
|
|
10467
|
-
*
|
|
10476
|
+
* > [!NOTE] `prevent-display-sleep` has higher precedence over
|
|
10468
10477
|
* `prevent-app-suspension`. Only the highest precedence type takes effect. In
|
|
10469
10478
|
* other words, `prevent-display-sleep` always takes precedence over
|
|
10470
10479
|
* `prevent-app-suspension`.
|
|
@@ -10845,7 +10854,7 @@ declare namespace Electron {
|
|
|
10845
10854
|
*/
|
|
10846
10855
|
registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
|
|
10847
10856
|
/**
|
|
10848
|
-
*
|
|
10857
|
+
* > [!NOTE] This method can only be used before the `ready` event of the `app`
|
|
10849
10858
|
* module gets emitted and can be called only once.
|
|
10850
10859
|
*
|
|
10851
10860
|
* Registers the `scheme` as standard, secure, bypasses content security policy for
|
|
@@ -11305,7 +11314,7 @@ declare namespace Electron {
|
|
|
11305
11314
|
/**
|
|
11306
11315
|
* The current absolute position of the mouse pointer.
|
|
11307
11316
|
*
|
|
11308
|
-
*
|
|
11317
|
+
* > [!NOTE] The return value is a DIP point, not a screen physical point.
|
|
11309
11318
|
*/
|
|
11310
11319
|
getCursorScreenPoint(): Point;
|
|
11311
11320
|
/**
|
|
@@ -12152,8 +12161,8 @@ declare namespace Electron {
|
|
|
12152
12161
|
* Whether the word was successfully written to the custom dictionary. This API
|
|
12153
12162
|
* will not work on non-persistent (in-memory) sessions.
|
|
12154
12163
|
*
|
|
12155
|
-
*
|
|
12156
|
-
* dictionary as well
|
|
12164
|
+
* > [!NOTE] On macOS and Windows, this word will be written to the OS custom
|
|
12165
|
+
* dictionary as well.
|
|
12157
12166
|
*/
|
|
12158
12167
|
addWordToSpellCheckerDictionary(word: string): boolean;
|
|
12159
12168
|
/**
|
|
@@ -12183,7 +12192,7 @@ declare namespace Electron {
|
|
|
12183
12192
|
* This method clears more types of data and is more thorough than the
|
|
12184
12193
|
* `clearStorageData` method.
|
|
12185
12194
|
*
|
|
12186
|
-
*
|
|
12195
|
+
* > [!NOTE] Cookies are stored at a broader scope than origins. When removing
|
|
12187
12196
|
* cookies and filtering by `origins` (or `excludeOrigins`), the cookies will be
|
|
12188
12197
|
* removed at the registrable domain level. For example, clearing cookies for the
|
|
12189
12198
|
* origin `https://really.specific.origin.example.com/` will end up clearing all
|
|
@@ -12191,7 +12200,7 @@ declare namespace Electron {
|
|
|
12191
12200
|
* `https://my.website.example.co.uk/` will end up clearing all cookies for
|
|
12192
12201
|
* `example.co.uk`.
|
|
12193
12202
|
*
|
|
12194
|
-
*
|
|
12203
|
+
* > [!NOTE] Clearing cache data will also clear the shared dictionary cache. This
|
|
12195
12204
|
* means that any dictionaries used for compression may be reloaded after clearing
|
|
12196
12205
|
* the cache. If you wish to clear the shared dictionary cache but leave other
|
|
12197
12206
|
* cached data intact, you may want to use the `clearSharedDictionaryCache` method.
|
|
@@ -12221,7 +12230,7 @@ declare namespace Electron {
|
|
|
12221
12230
|
/**
|
|
12222
12231
|
* Resolves when all connections are closed.
|
|
12223
12232
|
*
|
|
12224
|
-
*
|
|
12233
|
+
* > [!NOTE] It will terminate / fail all requests currently in flight.
|
|
12225
12234
|
*/
|
|
12226
12235
|
closeAllConnections(): Promise<void>;
|
|
12227
12236
|
/**
|
|
@@ -12241,7 +12250,7 @@ declare namespace Electron {
|
|
|
12241
12250
|
* Initiates a download of the resource at `url`. The API will generate a
|
|
12242
12251
|
* DownloadItem that can be accessed with the will-download event.
|
|
12243
12252
|
*
|
|
12244
|
-
*
|
|
12253
|
+
* > [!NOTE] This does not perform any security checks that relate to a page's
|
|
12245
12254
|
* origin, unlike `webContents.downloadURL`.
|
|
12246
12255
|
*/
|
|
12247
12256
|
downloadURL(url: string, options?: DownloadURLOptions): void;
|
|
@@ -12290,7 +12299,7 @@ declare namespace Electron {
|
|
|
12290
12299
|
/**
|
|
12291
12300
|
* A list of all loaded extensions.
|
|
12292
12301
|
*
|
|
12293
|
-
*
|
|
12302
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
12294
12303
|
* is emitted.
|
|
12295
12304
|
*
|
|
12296
12305
|
* **Deprecated:** Use the new `ses.extensions.getAllExtensions` API.
|
|
@@ -12309,7 +12318,7 @@ declare namespace Electron {
|
|
|
12309
12318
|
/**
|
|
12310
12319
|
* The loaded extension with the given ID.
|
|
12311
12320
|
*
|
|
12312
|
-
*
|
|
12321
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
12313
12322
|
* is emitted.
|
|
12314
12323
|
*
|
|
12315
12324
|
* **Deprecated:** Use the new `ses.extensions.getExtension` API.
|
|
@@ -12358,7 +12367,7 @@ declare namespace Electron {
|
|
|
12358
12367
|
* this setting is an empty list Electron will try to populate this setting with
|
|
12359
12368
|
* the current OS locale. This setting is persisted across restarts.
|
|
12360
12369
|
*
|
|
12361
|
-
*
|
|
12370
|
+
* > [!NOTE] On macOS, the OS spellchecker is used and has its own list of
|
|
12362
12371
|
* languages. On macOS, this API will return whichever languages have been
|
|
12363
12372
|
* configured by the OS.
|
|
12364
12373
|
*/
|
|
@@ -12405,10 +12414,10 @@ declare namespace Electron {
|
|
|
12405
12414
|
*
|
|
12406
12415
|
* This API does not support loading packed (.crx) extensions.
|
|
12407
12416
|
*
|
|
12408
|
-
*
|
|
12417
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
12409
12418
|
* is emitted.
|
|
12410
12419
|
*
|
|
12411
|
-
*
|
|
12420
|
+
* > [!NOTE] Loading extensions into in-memory (non-persistent) sessions is not
|
|
12412
12421
|
* supported and will throw an error.
|
|
12413
12422
|
*
|
|
12414
12423
|
* **Deprecated:** Use the new `ses.extensions.loadExtension` API.
|
|
@@ -12431,7 +12440,7 @@ declare namespace Electron {
|
|
|
12431
12440
|
/**
|
|
12432
12441
|
* Unloads an extension.
|
|
12433
12442
|
*
|
|
12434
|
-
*
|
|
12443
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
12435
12444
|
* is emitted.
|
|
12436
12445
|
*
|
|
12437
12446
|
* **Deprecated:** Use the new `ses.extensions.removeExtension` API.
|
|
@@ -12443,8 +12452,8 @@ declare namespace Electron {
|
|
|
12443
12452
|
* Whether the word was successfully removed from the custom dictionary. This API
|
|
12444
12453
|
* will not work on non-persistent (in-memory) sessions.
|
|
12445
12454
|
*
|
|
12446
|
-
*
|
|
12447
|
-
* dictionary as well
|
|
12455
|
+
* > [!NOTE] On macOS and Windows, this word will be removed from the OS custom
|
|
12456
|
+
* dictionary as well.
|
|
12448
12457
|
*/
|
|
12449
12458
|
removeWordFromSpellCheckerDictionary(word: string): boolean;
|
|
12450
12459
|
/**
|
|
@@ -12584,8 +12593,8 @@ declare namespace Electron {
|
|
|
12584
12593
|
* Please note the trailing slash. The URL to the dictionaries is formed as
|
|
12585
12594
|
* `${url}${filename}`.
|
|
12586
12595
|
*
|
|
12587
|
-
*
|
|
12588
|
-
* any dictionary files.
|
|
12596
|
+
* > [!NOTE] On macOS, the OS spellchecker is used and therefore we do not download
|
|
12597
|
+
* any dictionary files. This API is a no-op on macOS.
|
|
12589
12598
|
*/
|
|
12590
12599
|
setSpellCheckerDictionaryDownloadURL(url: string): void;
|
|
12591
12600
|
/**
|
|
@@ -12598,8 +12607,8 @@ declare namespace Electron {
|
|
|
12598
12607
|
* must call this API with an array of language codes. You can get the list of
|
|
12599
12608
|
* supported language codes with the `ses.availableSpellCheckerLanguages` property.
|
|
12600
12609
|
*
|
|
12601
|
-
*
|
|
12602
|
-
* automatically.
|
|
12610
|
+
* > [!NOTE] On macOS, the OS spellchecker is used and will detect your language
|
|
12611
|
+
* automatically. This API is a no-op on macOS.
|
|
12603
12612
|
*/
|
|
12604
12613
|
setSpellCheckerLanguages(languages: string[]): void;
|
|
12605
12614
|
/**
|
|
@@ -14298,7 +14307,7 @@ declare namespace Electron {
|
|
|
14298
14307
|
/**
|
|
14299
14308
|
* Emitted when the mouse is released from clicking the tray icon.
|
|
14300
14309
|
*
|
|
14301
|
-
*
|
|
14310
|
+
* > [!NOTE] This will not be emitted if you have set a context menu for your Tray
|
|
14302
14311
|
* using `tray.setContextMenu`, as a result of macOS-level constraints.
|
|
14303
14312
|
*
|
|
14304
14313
|
* @platform darwin
|
|
@@ -14629,7 +14638,7 @@ declare namespace Electron {
|
|
|
14629
14638
|
// Docs: https://electronjs.org/docs/api/utility-process
|
|
14630
14639
|
|
|
14631
14640
|
/**
|
|
14632
|
-
*
|
|
14641
|
+
* > [!NOTE] `utilityProcess.fork` can only be called after the `ready` event has
|
|
14633
14642
|
* been emitted on `App`.
|
|
14634
14643
|
*/
|
|
14635
14644
|
static fork(modulePath: string, args?: string[], options?: ForkOptions): UtilityProcess;
|
|
@@ -14788,7 +14797,7 @@ declare namespace Electron {
|
|
|
14788
14797
|
* `undefined`. When the child process exits, then the value is `undefined` after
|
|
14789
14798
|
* the `exit` event is emitted.
|
|
14790
14799
|
*
|
|
14791
|
-
*
|
|
14800
|
+
* > [!NOTE] You can use the `pid` to determine if the process is currently
|
|
14792
14801
|
* running.
|
|
14793
14802
|
*/
|
|
14794
14803
|
pid: (number) | (undefined);
|
|
@@ -14869,12 +14878,12 @@ declare namespace Electron {
|
|
|
14869
14878
|
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
|
14870
14879
|
* * e.g. `blueviolet` or `red`
|
|
14871
14880
|
*
|
|
14872
|
-
*
|
|
14881
|
+
* > [!NOTE] Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
|
|
14873
14882
|
* `RGB`.
|
|
14874
14883
|
*/
|
|
14875
14884
|
setBackgroundColor(color: string): void;
|
|
14876
14885
|
/**
|
|
14877
|
-
*
|
|
14886
|
+
* > [!NOTE] The area cutout of the view's border still captures clicks.
|
|
14878
14887
|
*/
|
|
14879
14888
|
setBorderRadius(radius: number): void;
|
|
14880
14889
|
setBounds(bounds: Rectangle): void;
|
|
@@ -16599,7 +16608,7 @@ declare namespace Electron {
|
|
|
16599
16608
|
* Calling `event.preventDefault()` will ignore the `beforeunload` event handler
|
|
16600
16609
|
* and allow the page to be unloaded.
|
|
16601
16610
|
*
|
|
16602
|
-
*
|
|
16611
|
+
* > [!NOTE] This will be emitted for `BrowserViews` but will _not_ be respected -
|
|
16603
16612
|
* this is because we have chosen not to tie the `BrowserView` lifecycle to its
|
|
16604
16613
|
* owning BrowserWindow should one exist per the specification.
|
|
16605
16614
|
*/
|
|
@@ -17273,8 +17282,10 @@ declare namespace Electron {
|
|
|
17273
17282
|
*/
|
|
17274
17283
|
send(channel: string, ...args: any[]): void;
|
|
17275
17284
|
/**
|
|
17276
|
-
* Sends an input `event` to the page.
|
|
17277
|
-
*
|
|
17285
|
+
* Sends an input `event` to the page.
|
|
17286
|
+
*
|
|
17287
|
+
* > [!NOTE] The `BrowserWindow` containing the contents needs to be focused for
|
|
17288
|
+
* `sendInputEvent()` to work.
|
|
17278
17289
|
*/
|
|
17279
17290
|
sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
|
|
17280
17291
|
/**
|
|
@@ -17356,8 +17367,7 @@ declare namespace Electron {
|
|
|
17356
17367
|
/**
|
|
17357
17368
|
* Sets the maximum and minimum pinch-to-zoom level.
|
|
17358
17369
|
*
|
|
17359
|
-
* >
|
|
17360
|
-
* call:
|
|
17370
|
+
* > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
|
|
17361
17371
|
*/
|
|
17362
17372
|
setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
|
|
17363
17373
|
/**
|
|
@@ -17367,8 +17377,10 @@ declare namespace Electron {
|
|
|
17367
17377
|
setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
|
|
17368
17378
|
/**
|
|
17369
17379
|
* Setting the WebRTC UDP Port Range allows you to restrict the udp port range used
|
|
17370
|
-
* by WebRTC. By default the port range is unrestricted.
|
|
17371
|
-
*
|
|
17380
|
+
* by WebRTC. By default the port range is unrestricted.
|
|
17381
|
+
*
|
|
17382
|
+
* > [!NOTE] To reset to an unrestricted port range this value should be set to `{
|
|
17383
|
+
* min: 0, max: 0 }`.
|
|
17372
17384
|
*/
|
|
17373
17385
|
setWebRTCUDPPortRange(udpPortRange: UdpPortRange): void;
|
|
17374
17386
|
/**
|
|
@@ -17394,10 +17406,9 @@ declare namespace Electron {
|
|
|
17394
17406
|
* limits of 300% and 50% of original size, respectively. The formula for this is
|
|
17395
17407
|
* `scale := 1.2 ^ level`.
|
|
17396
17408
|
*
|
|
17397
|
-
* >
|
|
17398
|
-
*
|
|
17399
|
-
*
|
|
17400
|
-
* per-window.
|
|
17409
|
+
* > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
|
|
17410
|
+
* zoom level for a specific domain propagates across all instances of windows with
|
|
17411
|
+
* the same domain. Differentiating the window URLs will make zoom work per-window.
|
|
17401
17412
|
*/
|
|
17402
17413
|
setZoomLevel(level: number): void;
|
|
17403
17414
|
/**
|
|
@@ -17465,7 +17476,7 @@ declare namespace Electron {
|
|
|
17465
17476
|
* A `WebContents | null` property that represents the of DevTools `WebContents`
|
|
17466
17477
|
* associated with a given `WebContents`.
|
|
17467
17478
|
*
|
|
17468
|
-
*
|
|
17479
|
+
* > [!NOTE] Users should never store this object because it may become `null` when
|
|
17469
17480
|
* the DevTools has been closed.
|
|
17470
17481
|
*
|
|
17471
17482
|
*/
|
|
@@ -17695,7 +17706,8 @@ declare namespace Electron {
|
|
|
17695
17706
|
removeInsertedCSS(key: string): void;
|
|
17696
17707
|
/**
|
|
17697
17708
|
* Set the security origin, content security policy and name of the isolated world.
|
|
17698
|
-
*
|
|
17709
|
+
*
|
|
17710
|
+
* > [!NOTE] If the `csp` is specified, then the `securityOrigin` also has to be
|
|
17699
17711
|
* specified.
|
|
17700
17712
|
*/
|
|
17701
17713
|
setIsolatedWorldInfo(worldId: number, info: Info): void;
|
|
@@ -17716,10 +17728,9 @@ declare namespace Electron {
|
|
|
17716
17728
|
/**
|
|
17717
17729
|
* Sets the maximum and minimum pinch-to-zoom level.
|
|
17718
17730
|
*
|
|
17719
|
-
* >
|
|
17720
|
-
* call:
|
|
17731
|
+
* > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
|
|
17721
17732
|
*
|
|
17722
|
-
* >
|
|
17733
|
+
* > [!NOTE] Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
|
|
17723
17734
|
* shortcuts are controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem
|
|
17724
17735
|
* roles in the application Menu. To disable shortcuts, manually define the Menu
|
|
17725
17736
|
* and omit zoom roles from the definition.
|
|
@@ -17737,10 +17748,9 @@ declare namespace Electron {
|
|
|
17737
17748
|
* increment above or below represents zooming 20% larger or smaller to default
|
|
17738
17749
|
* limits of 300% and 50% of original size, respectively.
|
|
17739
17750
|
*
|
|
17740
|
-
* >
|
|
17741
|
-
*
|
|
17742
|
-
*
|
|
17743
|
-
* per-window.
|
|
17751
|
+
* > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
|
|
17752
|
+
* zoom level for a specific domain propagates across all instances of windows with
|
|
17753
|
+
* the same domain. Differentiating the window URLs will make zoom work per-window.
|
|
17744
17754
|
*/
|
|
17745
17755
|
setZoomLevel(level: number): void;
|
|
17746
17756
|
/**
|
|
@@ -18903,10 +18913,9 @@ declare namespace Electron {
|
|
|
18903
18913
|
* limits of 300% and 50% of original size, respectively. The formula for this is
|
|
18904
18914
|
* `scale := 1.2 ^ level`.
|
|
18905
18915
|
*
|
|
18906
|
-
* >
|
|
18907
|
-
*
|
|
18908
|
-
*
|
|
18909
|
-
* per-window.
|
|
18916
|
+
* > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
|
|
18917
|
+
* zoom level for a specific domain propagates across all instances of windows with
|
|
18918
|
+
* the same domain. Differentiating the window URLs will make zoom work per-window.
|
|
18910
18919
|
*/
|
|
18911
18920
|
setZoomLevel(level: number): void;
|
|
18912
18921
|
/**
|
|
@@ -25051,7 +25060,7 @@ declare namespace NodeJS {
|
|
|
25051
25060
|
*
|
|
25052
25061
|
* Example:
|
|
25053
25062
|
*
|
|
25054
|
-
*
|
|
25063
|
+
* > [!NOTE] It returns the actual operating system version instead of kernel
|
|
25055
25064
|
* version on macOS unlike `os.release()`.
|
|
25056
25065
|
*/
|
|
25057
25066
|
getSystemVersion(): string;
|