electron 36.2.0 → 36.3.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/checksums.json +75 -75
- package/electron.d.ts +190 -180
- package/package.json +1 -1
package/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 36.
|
|
1
|
+
// Type definitions for Electron 36.3.0
|
|
2
2
|
// Project: http://electronjs.org/
|
|
3
3
|
// Definitions by: The Electron Team <https://github.com/electron/electron>
|
|
4
4
|
// Definitions: https://github.com/electron/typescript-definitions
|
|
@@ -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;
|
|
@@ -1673,7 +1673,7 @@ declare namespace Electron {
|
|
|
1673
1673
|
*
|
|
1674
1674
|
* See Apple's documentation for more details.
|
|
1675
1675
|
*
|
|
1676
|
-
*
|
|
1676
|
+
* > [!NOTE] Enable `Secure Keyboard Entry` only when it is needed and disable it
|
|
1677
1677
|
* when it is no longer needed.
|
|
1678
1678
|
*
|
|
1679
1679
|
* @platform darwin
|
|
@@ -1693,7 +1693,7 @@ declare namespace Electron {
|
|
|
1693
1693
|
*
|
|
1694
1694
|
* Whether the call succeeded.
|
|
1695
1695
|
*
|
|
1696
|
-
*
|
|
1696
|
+
* > [!NOTE] If you'd like to customize the Jump List even more use
|
|
1697
1697
|
* `app.setJumpList(categories)` instead.
|
|
1698
1698
|
*
|
|
1699
1699
|
* @platform win32
|
|
@@ -1755,7 +1755,7 @@ declare namespace Electron {
|
|
|
1755
1755
|
*
|
|
1756
1756
|
* This API must be called after the `ready` event is emitted.
|
|
1757
1757
|
*
|
|
1758
|
-
*
|
|
1758
|
+
* > [!NOTE] Rendering accessibility tree can significantly affect the performance
|
|
1759
1759
|
* of your app. It should not be enabled by default.
|
|
1760
1760
|
*
|
|
1761
1761
|
* @platform darwin,win32
|
|
@@ -1773,10 +1773,10 @@ declare namespace Electron {
|
|
|
1773
1773
|
* On macOS, setting this with any nonzero integer shows on the dock icon. On
|
|
1774
1774
|
* Linux, this property only works for Unity launcher.
|
|
1775
1775
|
*
|
|
1776
|
-
*
|
|
1776
|
+
* > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
|
|
1777
1777
|
* information, please read the Unity integration documentation.
|
|
1778
1778
|
*
|
|
1779
|
-
*
|
|
1779
|
+
* > [!NOTE] On macOS, you need to ensure that your application has the permission
|
|
1780
1780
|
* to display notifications for this property to take effect.
|
|
1781
1781
|
*
|
|
1782
1782
|
* @platform linux,darwin
|
|
@@ -1884,7 +1884,7 @@ declare namespace Electron {
|
|
|
1884
1884
|
*
|
|
1885
1885
|
* On Windows only `releaseName` is available.
|
|
1886
1886
|
*
|
|
1887
|
-
*
|
|
1887
|
+
* > [!NOTE] It is not strictly necessary to handle this event. A successfully
|
|
1888
1888
|
* downloaded update will still be applied the next time the application starts.
|
|
1889
1889
|
*/
|
|
1890
1890
|
on(event: 'update-downloaded', listener: (event: Event,
|
|
@@ -1924,7 +1924,7 @@ declare namespace Electron {
|
|
|
1924
1924
|
* Asks the server whether there is an update. You must call `setFeedURL` before
|
|
1925
1925
|
* using this API.
|
|
1926
1926
|
*
|
|
1927
|
-
*
|
|
1927
|
+
* > [!NOTE] If an update is available it will be downloaded automatically. Calling
|
|
1928
1928
|
* `autoUpdater.checkForUpdates()` twice will download the update two times.
|
|
1929
1929
|
*/
|
|
1930
1930
|
checkForUpdates(): void;
|
|
@@ -1940,7 +1940,7 @@ declare namespace Electron {
|
|
|
1940
1940
|
* windows first, and automatically call `app.quit()` after all windows have been
|
|
1941
1941
|
* closed.
|
|
1942
1942
|
*
|
|
1943
|
-
*
|
|
1943
|
+
* > [!NOTE] It is not strictly necessary to call this function to apply an update,
|
|
1944
1944
|
* as a successfully downloaded update will always be applied the next time the
|
|
1945
1945
|
* application starts.
|
|
1946
1946
|
*/
|
|
@@ -2024,11 +2024,11 @@ declare namespace Electron {
|
|
|
2024
2024
|
* In Electron, returning any value other than `undefined` would cancel the close.
|
|
2025
2025
|
* For example:
|
|
2026
2026
|
*
|
|
2027
|
-
*
|
|
2027
|
+
* > [!NOTE] There is a subtle difference between the behaviors of
|
|
2028
2028
|
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
|
2029
2029
|
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
|
2030
2030
|
* instead of only returning a value, as the former works more consistently within
|
|
2031
|
-
* Electron.
|
|
2031
|
+
* Electron.
|
|
2032
2032
|
*/
|
|
2033
2033
|
on(event: 'close', listener: (event: Event) => void): this;
|
|
2034
2034
|
off(event: 'close', listener: (event: Event) => void): this;
|
|
@@ -2103,7 +2103,7 @@ declare namespace Electron {
|
|
|
2103
2103
|
/**
|
|
2104
2104
|
* Emitted once when the window is moved to a new position.
|
|
2105
2105
|
*
|
|
2106
|
-
*
|
|
2106
|
+
* > [!NOTE] On macOS, this event is an alias of `move`.
|
|
2107
2107
|
*
|
|
2108
2108
|
* @platform darwin,win32
|
|
2109
2109
|
*/
|
|
@@ -2580,14 +2580,14 @@ declare namespace Electron {
|
|
|
2580
2580
|
*
|
|
2581
2581
|
* See Setting `backgroundColor`.
|
|
2582
2582
|
*
|
|
2583
|
-
*
|
|
2583
|
+
* > [!NOTE] The alpha value is _not_ returned alongside the red, green, and blue
|
|
2584
2584
|
* values.
|
|
2585
2585
|
*/
|
|
2586
2586
|
getBackgroundColor(): string;
|
|
2587
2587
|
/**
|
|
2588
2588
|
* The `bounds` of the window as `Object`.
|
|
2589
2589
|
*
|
|
2590
|
-
*
|
|
2590
|
+
* > [!NOTE] On macOS, the y-coordinate value returned will be at minimum the Tray
|
|
2591
2591
|
* height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
|
|
2592
2592
|
* 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
|
|
2593
2593
|
* 25, y: 38, width: 800, height: 600 }`.
|
|
@@ -2637,7 +2637,7 @@ declare namespace Electron {
|
|
|
2637
2637
|
/**
|
|
2638
2638
|
* Contains the window bounds of the normal state
|
|
2639
2639
|
*
|
|
2640
|
-
*
|
|
2640
|
+
* > [!NOTE] Whatever the current state of the window : maximized, minimized or in
|
|
2641
2641
|
* fullscreen, this function always returns the position and size of the window in
|
|
2642
2642
|
* normal state. In normal state, getBounds and getNormalBounds returns the same
|
|
2643
2643
|
* `Rectangle`.
|
|
@@ -2669,7 +2669,7 @@ declare namespace Electron {
|
|
|
2669
2669
|
/**
|
|
2670
2670
|
* The title of the native window.
|
|
2671
2671
|
*
|
|
2672
|
-
*
|
|
2672
|
+
* > [!NOTE] The title of the web page can be different from the title of the
|
|
2673
2673
|
* native window.
|
|
2674
2674
|
*/
|
|
2675
2675
|
getTitle(): string;
|
|
@@ -2853,7 +2853,7 @@ declare namespace Electron {
|
|
|
2853
2853
|
/**
|
|
2854
2854
|
* Whether the window is visible on all workspaces.
|
|
2855
2855
|
*
|
|
2856
|
-
*
|
|
2856
|
+
* > [!NOTE] This API always returns false on Windows.
|
|
2857
2857
|
*
|
|
2858
2858
|
* @platform darwin,linux
|
|
2859
2859
|
*/
|
|
@@ -2937,7 +2937,7 @@ declare namespace Electron {
|
|
|
2937
2937
|
/**
|
|
2938
2938
|
* Sets the properties for the window's taskbar button.
|
|
2939
2939
|
*
|
|
2940
|
-
*
|
|
2940
|
+
* > [!NOTE] `relaunchCommand` and `relaunchDisplayName` must always be set
|
|
2941
2941
|
* together. If one of those properties is not set, then neither will be used.
|
|
2942
2942
|
*
|
|
2943
2943
|
* @platform win32
|
|
@@ -3015,7 +3015,7 @@ declare namespace Electron {
|
|
|
3015
3015
|
*
|
|
3016
3016
|
* See the Windows documentation for more details.
|
|
3017
3017
|
*
|
|
3018
|
-
*
|
|
3018
|
+
* > [!NOTE] This method is only supported on Windows 11 22H2 and up.
|
|
3019
3019
|
*
|
|
3020
3020
|
* @platform win32
|
|
3021
3021
|
*/
|
|
@@ -3024,7 +3024,7 @@ declare namespace Electron {
|
|
|
3024
3024
|
* Resizes and moves the window to the supplied bounds. Any properties that are not
|
|
3025
3025
|
* supplied will default to their current values.
|
|
3026
3026
|
*
|
|
3027
|
-
*
|
|
3027
|
+
* > [!NOTE] On macOS, the y-coordinate value cannot be smaller than the Tray
|
|
3028
3028
|
* height. The tray height has changed over time and depends on the operating
|
|
3029
3029
|
* system, but is between 20-40px. Passing a value lower than the tray height will
|
|
3030
3030
|
* result in a window that is flush to the tray.
|
|
@@ -3082,8 +3082,8 @@ declare namespace Electron {
|
|
|
3082
3082
|
/**
|
|
3083
3083
|
* Sets whether the window should be in fullscreen mode.
|
|
3084
3084
|
*
|
|
3085
|
-
*
|
|
3086
|
-
* 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 >
|
|
3087
3087
|
* 'leave-full-screen' events.
|
|
3088
3088
|
*/
|
|
3089
3089
|
setFullScreen(flag: boolean): void;
|
|
@@ -3321,7 +3321,7 @@ declare namespace Electron {
|
|
|
3321
3321
|
* `undefined` clears the touch bar. This method only has an effect if the machine
|
|
3322
3322
|
* has a touch bar.
|
|
3323
3323
|
*
|
|
3324
|
-
*
|
|
3324
|
+
* > [!NOTE] The TouchBar API is currently experimental and may change or be
|
|
3325
3325
|
* removed in future Electron releases.
|
|
3326
3326
|
*
|
|
3327
3327
|
* @platform darwin
|
|
@@ -3337,7 +3337,7 @@ declare namespace Electron {
|
|
|
3337
3337
|
/**
|
|
3338
3338
|
* Sets whether the window should be visible on all workspaces.
|
|
3339
3339
|
*
|
|
3340
|
-
*
|
|
3340
|
+
* > [!NOTE] This API does nothing on Windows.
|
|
3341
3341
|
*
|
|
3342
3342
|
* @platform darwin,linux
|
|
3343
3343
|
*/
|
|
@@ -3475,7 +3475,7 @@ declare namespace Electron {
|
|
|
3475
3475
|
/**
|
|
3476
3476
|
* A `boolean` property that determines whether the menu bar should be visible.
|
|
3477
3477
|
*
|
|
3478
|
-
*
|
|
3478
|
+
* > [!NOTE] If the menu bar is auto-hide, users can still bring up the menu bar by
|
|
3479
3479
|
* pressing the single `Alt` key.
|
|
3480
3480
|
*
|
|
3481
3481
|
* @platform win32,linux
|
|
@@ -3535,7 +3535,7 @@ declare namespace Electron {
|
|
|
3535
3535
|
/**
|
|
3536
3536
|
* A `string` property that determines the title of the native window.
|
|
3537
3537
|
*
|
|
3538
|
-
*
|
|
3538
|
+
* > [!NOTE] The title of the web page can be different from the title of the
|
|
3539
3539
|
* native window.
|
|
3540
3540
|
*/
|
|
3541
3541
|
title: string;
|
|
@@ -3543,7 +3543,7 @@ declare namespace Electron {
|
|
|
3543
3543
|
* A `boolean` property that determines whether the window is visible on all
|
|
3544
3544
|
* workspaces.
|
|
3545
3545
|
*
|
|
3546
|
-
*
|
|
3546
|
+
* > [!NOTE] Always returns false on Windows.
|
|
3547
3547
|
*
|
|
3548
3548
|
* @platform darwin,linux
|
|
3549
3549
|
*/
|
|
@@ -3889,7 +3889,7 @@ declare namespace Electron {
|
|
|
3889
3889
|
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
|
3890
3890
|
* * e.g. `blueviolet` or `red`
|
|
3891
3891
|
*
|
|
3892
|
-
*
|
|
3892
|
+
* > [!NOTE] Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
|
|
3893
3893
|
* `RGB`.
|
|
3894
3894
|
*
|
|
3895
3895
|
* @experimental
|
|
@@ -4044,11 +4044,11 @@ declare namespace Electron {
|
|
|
4044
4044
|
* In Electron, returning any value other than `undefined` would cancel the close.
|
|
4045
4045
|
* For example:
|
|
4046
4046
|
*
|
|
4047
|
-
*
|
|
4047
|
+
* > [!NOTE] There is a subtle difference between the behaviors of
|
|
4048
4048
|
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
|
4049
4049
|
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
|
4050
4050
|
* instead of only returning a value, as the former works more consistently within
|
|
4051
|
-
* Electron.
|
|
4051
|
+
* Electron.
|
|
4052
4052
|
*/
|
|
4053
4053
|
on(event: 'close', listener: (event: Event) => void): this;
|
|
4054
4054
|
off(event: 'close', listener: (event: Event) => void): this;
|
|
@@ -4065,11 +4065,11 @@ declare namespace Electron {
|
|
|
4065
4065
|
* In Electron, returning any value other than `undefined` would cancel the close.
|
|
4066
4066
|
* For example:
|
|
4067
4067
|
*
|
|
4068
|
-
*
|
|
4068
|
+
* > [!NOTE] There is a subtle difference between the behaviors of
|
|
4069
4069
|
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
|
4070
4070
|
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
|
4071
4071
|
* instead of only returning a value, as the former works more consistently within
|
|
4072
|
-
* Electron.
|
|
4072
|
+
* Electron.
|
|
4073
4073
|
*/
|
|
4074
4074
|
on(event: 'close', listener: (event: Event) => void): this;
|
|
4075
4075
|
off(event: 'close', listener: (event: Event) => void): this;
|
|
@@ -4225,7 +4225,7 @@ declare namespace Electron {
|
|
|
4225
4225
|
/**
|
|
4226
4226
|
* Emitted once when the window is moved to a new position.
|
|
4227
4227
|
*
|
|
4228
|
-
*
|
|
4228
|
+
* > [!NOTE] On macOS, this event is an alias of `move`.
|
|
4229
4229
|
*
|
|
4230
4230
|
* @platform darwin,win32
|
|
4231
4231
|
*/
|
|
@@ -4249,7 +4249,7 @@ declare namespace Electron {
|
|
|
4249
4249
|
/**
|
|
4250
4250
|
* Emitted once when the window is moved to a new position.
|
|
4251
4251
|
*
|
|
4252
|
-
*
|
|
4252
|
+
* > [!NOTE] On macOS, this event is an alias of `move`.
|
|
4253
4253
|
*
|
|
4254
4254
|
* @platform darwin,win32
|
|
4255
4255
|
*/
|
|
@@ -5114,7 +5114,7 @@ declare namespace Electron {
|
|
|
5114
5114
|
*/
|
|
5115
5115
|
constructor(options?: BrowserWindowConstructorOptions);
|
|
5116
5116
|
/**
|
|
5117
|
-
* >
|
|
5117
|
+
* > [!NOTE] The `BrowserView` class is deprecated, and replaced by the new
|
|
5118
5118
|
* `WebContentsView` class.
|
|
5119
5119
|
*
|
|
5120
5120
|
* The window that owns the given `browserView`. If the given view is not attached
|
|
@@ -5143,7 +5143,7 @@ declare namespace Electron {
|
|
|
5143
5143
|
/**
|
|
5144
5144
|
* Replacement API for setBrowserView supporting work with multi browser views.
|
|
5145
5145
|
*
|
|
5146
|
-
* >
|
|
5146
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5147
5147
|
* `WebContentsView` class.
|
|
5148
5148
|
*
|
|
5149
5149
|
* @experimental
|
|
@@ -5207,14 +5207,14 @@ declare namespace Electron {
|
|
|
5207
5207
|
*
|
|
5208
5208
|
* See Setting `backgroundColor`.
|
|
5209
5209
|
*
|
|
5210
|
-
*
|
|
5210
|
+
* > [!NOTE] The alpha value is _not_ returned alongside the red, green, and blue
|
|
5211
5211
|
* values.
|
|
5212
5212
|
*/
|
|
5213
5213
|
getBackgroundColor(): string;
|
|
5214
5214
|
/**
|
|
5215
5215
|
* The `bounds` of the window as `Object`.
|
|
5216
5216
|
*
|
|
5217
|
-
*
|
|
5217
|
+
* > [!NOTE] On macOS, the y-coordinate value returned will be at minimum the Tray
|
|
5218
5218
|
* height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
|
|
5219
5219
|
* 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
|
|
5220
5220
|
* 25, y: 38, width: 800, height: 600 }`.
|
|
@@ -5224,7 +5224,7 @@ declare namespace Electron {
|
|
|
5224
5224
|
* The `BrowserView` attached to `win`. Returns `null` if one is not attached.
|
|
5225
5225
|
* Throws an error if multiple `BrowserView`s are attached.
|
|
5226
5226
|
*
|
|
5227
|
-
* >
|
|
5227
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5228
5228
|
* `WebContentsView` class.
|
|
5229
5229
|
*
|
|
5230
5230
|
* @experimental
|
|
@@ -5236,7 +5236,7 @@ declare namespace Electron {
|
|
|
5236
5236
|
* `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
|
|
5237
5237
|
* element of the array.
|
|
5238
5238
|
*
|
|
5239
|
-
* >
|
|
5239
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5240
5240
|
* `WebContentsView` class.
|
|
5241
5241
|
*
|
|
5242
5242
|
* @experimental
|
|
@@ -5283,9 +5283,9 @@ declare namespace Electron {
|
|
|
5283
5283
|
/**
|
|
5284
5284
|
* Contains the window bounds of the normal state
|
|
5285
5285
|
*
|
|
5286
|
-
*
|
|
5287
|
-
* fullscreen, this function always returns the position and size of the window in
|
|
5288
|
-
* 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
|
|
5289
5289
|
* `Rectangle`.
|
|
5290
5290
|
*/
|
|
5291
5291
|
getNormalBounds(): Rectangle;
|
|
@@ -5315,7 +5315,7 @@ declare namespace Electron {
|
|
|
5315
5315
|
/**
|
|
5316
5316
|
* The title of the native window.
|
|
5317
5317
|
*
|
|
5318
|
-
*
|
|
5318
|
+
* > [!NOTE] The title of the web page can be different from the title of the
|
|
5319
5319
|
* native window.
|
|
5320
5320
|
*/
|
|
5321
5321
|
getTitle(): string;
|
|
@@ -5391,7 +5391,7 @@ declare namespace Electron {
|
|
|
5391
5391
|
/**
|
|
5392
5392
|
* Whether the window is in fullscreen mode.
|
|
5393
5393
|
*
|
|
5394
|
-
*
|
|
5394
|
+
* > [!NOTE] On macOS, fullscreen transitions take place asynchronously. When
|
|
5395
5395
|
* querying for a BrowserWindow's fullscreen status, you should ensure that either
|
|
5396
5396
|
* the 'enter-full-screen' or 'leave-full-screen' events have been emitted.
|
|
5397
5397
|
*/
|
|
@@ -5503,7 +5503,7 @@ declare namespace Electron {
|
|
|
5503
5503
|
/**
|
|
5504
5504
|
* Whether the window is visible on all workspaces.
|
|
5505
5505
|
*
|
|
5506
|
-
*
|
|
5506
|
+
* > [!NOTE] This API always returns false on Windows.
|
|
5507
5507
|
*
|
|
5508
5508
|
* @platform darwin,linux
|
|
5509
5509
|
*/
|
|
@@ -5584,7 +5584,7 @@ declare namespace Electron {
|
|
|
5584
5584
|
*/
|
|
5585
5585
|
reload(): void;
|
|
5586
5586
|
/**
|
|
5587
|
-
* >
|
|
5587
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5588
5588
|
* `WebContentsView` class.
|
|
5589
5589
|
*
|
|
5590
5590
|
* @experimental
|
|
@@ -5624,7 +5624,7 @@ declare namespace Electron {
|
|
|
5624
5624
|
/**
|
|
5625
5625
|
* Sets the properties for the window's taskbar button.
|
|
5626
5626
|
*
|
|
5627
|
-
*
|
|
5627
|
+
* > [!NOTE] `relaunchCommand` and `relaunchDisplayName` must always be set
|
|
5628
5628
|
* together. If one of those properties is not set, then neither will be used.
|
|
5629
5629
|
*
|
|
5630
5630
|
* @platform win32
|
|
@@ -5702,7 +5702,7 @@ declare namespace Electron {
|
|
|
5702
5702
|
*
|
|
5703
5703
|
* See the Windows documentation for more details.
|
|
5704
5704
|
*
|
|
5705
|
-
*
|
|
5705
|
+
* > [!NOTE] This method is only supported on Windows 11 22H2 and up.
|
|
5706
5706
|
*
|
|
5707
5707
|
* @platform win32
|
|
5708
5708
|
*/
|
|
@@ -5711,14 +5711,14 @@ declare namespace Electron {
|
|
|
5711
5711
|
* Resizes and moves the window to the supplied bounds. Any properties that are not
|
|
5712
5712
|
* supplied will default to their current values.
|
|
5713
5713
|
*
|
|
5714
|
-
*
|
|
5714
|
+
* > [!NOTE] On macOS, the y-coordinate value cannot be smaller than the Tray
|
|
5715
5715
|
* height. The tray height has changed over time and depends on the operating
|
|
5716
5716
|
* system, but is between 20-40px. Passing a value lower than the tray height will
|
|
5717
5717
|
* result in a window that is flush to the tray.
|
|
5718
5718
|
*/
|
|
5719
5719
|
setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
|
|
5720
5720
|
/**
|
|
5721
|
-
* >
|
|
5721
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
5722
5722
|
* `WebContentsView` class.
|
|
5723
5723
|
*
|
|
5724
5724
|
* @experimental
|
|
@@ -5773,7 +5773,7 @@ declare namespace Electron {
|
|
|
5773
5773
|
/**
|
|
5774
5774
|
* Sets whether the window should be in fullscreen mode.
|
|
5775
5775
|
*
|
|
5776
|
-
*
|
|
5776
|
+
* > [!NOTE] On macOS, fullscreen transitions take place asynchronously. If further
|
|
5777
5777
|
* actions depend on the fullscreen state, use the 'enter-full-screen' or
|
|
5778
5778
|
* 'leave-full-screen' events.
|
|
5779
5779
|
*/
|
|
@@ -6011,7 +6011,7 @@ declare namespace Electron {
|
|
|
6011
6011
|
* Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
|
|
6012
6012
|
* error if `browserView` is not attached to `win`.
|
|
6013
6013
|
*
|
|
6014
|
-
* >
|
|
6014
|
+
* > [!WARNING] The `BrowserView` class is deprecated, and replaced by the new
|
|
6015
6015
|
* `WebContentsView` class.
|
|
6016
6016
|
*
|
|
6017
6017
|
* @experimental
|
|
@@ -6023,7 +6023,7 @@ declare namespace Electron {
|
|
|
6023
6023
|
* `undefined` clears the touch bar. This method only has an effect if the machine
|
|
6024
6024
|
* has a touch bar.
|
|
6025
6025
|
*
|
|
6026
|
-
*
|
|
6026
|
+
* > [!NOTE] The TouchBar API is currently experimental and may change or be
|
|
6027
6027
|
* removed in future Electron releases.
|
|
6028
6028
|
*
|
|
6029
6029
|
* @platform darwin
|
|
@@ -6041,7 +6041,7 @@ declare namespace Electron {
|
|
|
6041
6041
|
/**
|
|
6042
6042
|
* Sets whether the window should be visible on all workspaces.
|
|
6043
6043
|
*
|
|
6044
|
-
*
|
|
6044
|
+
* > [!NOTE] This API does nothing on Windows.
|
|
6045
6045
|
*
|
|
6046
6046
|
* @platform darwin,linux
|
|
6047
6047
|
*/
|
|
@@ -6181,7 +6181,7 @@ declare namespace Electron {
|
|
|
6181
6181
|
/**
|
|
6182
6182
|
* A `boolean` property that determines whether the menu bar should be visible.
|
|
6183
6183
|
*
|
|
6184
|
-
*
|
|
6184
|
+
* > [!NOTE] If the menu bar is auto-hide, users can still bring up the menu bar by
|
|
6185
6185
|
* pressing the single `Alt` key.
|
|
6186
6186
|
*
|
|
6187
6187
|
* @platform win32,linux
|
|
@@ -6241,7 +6241,7 @@ declare namespace Electron {
|
|
|
6241
6241
|
/**
|
|
6242
6242
|
* A `string` property that determines the title of the native window.
|
|
6243
6243
|
*
|
|
6244
|
-
*
|
|
6244
|
+
* > [!NOTE] The title of the web page can be different from the title of the
|
|
6245
6245
|
* native window.
|
|
6246
6246
|
*/
|
|
6247
6247
|
title: string;
|
|
@@ -6249,7 +6249,7 @@ declare namespace Electron {
|
|
|
6249
6249
|
* A `boolean` property that determines whether the window is visible on all
|
|
6250
6250
|
* workspaces.
|
|
6251
6251
|
*
|
|
6252
|
-
*
|
|
6252
|
+
* > [!NOTE] Always returns false on Windows.
|
|
6253
6253
|
*
|
|
6254
6254
|
* @platform darwin,linux
|
|
6255
6255
|
*/
|
|
@@ -6659,7 +6659,7 @@ declare namespace Electron {
|
|
|
6659
6659
|
/**
|
|
6660
6660
|
* Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
|
|
6661
6661
|
*
|
|
6662
|
-
*
|
|
6662
|
+
* > [!NOTE] Most apps on Windows don't support pasting bookmarks into them so you
|
|
6663
6663
|
* can use `clipboard.write` to write both a bookmark and fallback text to the
|
|
6664
6664
|
* clipboard.
|
|
6665
6665
|
*
|
|
@@ -6710,14 +6710,14 @@ declare namespace Electron {
|
|
|
6710
6710
|
* If you're appending an argument like `--switch=value`, consider using
|
|
6711
6711
|
* `appendSwitch('switch', 'value')` instead.
|
|
6712
6712
|
*
|
|
6713
|
-
*
|
|
6713
|
+
* > [!NOTE] This will not affect `process.argv`. The intended usage of this
|
|
6714
6714
|
* function is to control Chromium's behavior.
|
|
6715
6715
|
*/
|
|
6716
6716
|
appendArgument(value: string): void;
|
|
6717
6717
|
/**
|
|
6718
6718
|
* Append a switch (with optional `value`) to Chromium's command line.
|
|
6719
6719
|
*
|
|
6720
|
-
*
|
|
6720
|
+
* > [!NOTE] This will not affect `process.argv`. The intended usage of this
|
|
6721
6721
|
* function is to control Chromium's behavior.
|
|
6722
6722
|
*/
|
|
6723
6723
|
appendSwitch(the_switch: string, value?: string): void;
|
|
@@ -6728,7 +6728,7 @@ declare namespace Electron {
|
|
|
6728
6728
|
* to be used for application-specific command line arguments. For the latter,
|
|
6729
6729
|
* please use `process.argv`.
|
|
6730
6730
|
*
|
|
6731
|
-
*
|
|
6731
|
+
* > [!NOTE] When the switch is not present or has no value, it returns empty
|
|
6732
6732
|
* string.
|
|
6733
6733
|
*/
|
|
6734
6734
|
getSwitchValue(the_switch: string): string;
|
|
@@ -6739,7 +6739,7 @@ declare namespace Electron {
|
|
|
6739
6739
|
/**
|
|
6740
6740
|
* Removes the specified switch from Chromium's command line.
|
|
6741
6741
|
*
|
|
6742
|
-
*
|
|
6742
|
+
* > [!NOTE] This will not affect `process.argv`. The intended usage of this
|
|
6743
6743
|
* function is to control Chromium's behavior.
|
|
6744
6744
|
*/
|
|
6745
6745
|
removeSwitch(the_switch: string): void;
|
|
@@ -7017,7 +7017,7 @@ declare namespace Electron {
|
|
|
7017
7017
|
* parameters in a renderer process will not result in those parameters being sent
|
|
7018
7018
|
* with crashes that occur in other renderer processes or in the main process.
|
|
7019
7019
|
*
|
|
7020
|
-
*
|
|
7020
|
+
* > [!NOTE] Parameters have limits on the length of the keys and values. Key names
|
|
7021
7021
|
* must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
|
|
7022
7022
|
* Keys with names longer than the maximum will be silently ignored. Key values
|
|
7023
7023
|
* longer than the maximum length will be truncated.
|
|
@@ -7029,7 +7029,7 @@ declare namespace Electron {
|
|
|
7029
7029
|
* be returned until it is uploaded. In the case that there are no uploaded
|
|
7030
7030
|
* reports, `null` is returned.
|
|
7031
7031
|
*
|
|
7032
|
-
*
|
|
7032
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7033
7033
|
*/
|
|
7034
7034
|
getLastCrashReport(): (CrashReport) | (null);
|
|
7035
7035
|
/**
|
|
@@ -7040,14 +7040,14 @@ declare namespace Electron {
|
|
|
7040
7040
|
* Returns all uploaded crash reports. Each report contains the date and uploaded
|
|
7041
7041
|
* ID.
|
|
7042
7042
|
*
|
|
7043
|
-
*
|
|
7043
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7044
7044
|
*/
|
|
7045
7045
|
getUploadedReports(): CrashReport[];
|
|
7046
7046
|
/**
|
|
7047
7047
|
* Whether reports should be submitted to the server. Set through the `start`
|
|
7048
7048
|
* method or `setUploadToServer`.
|
|
7049
7049
|
*
|
|
7050
|
-
*
|
|
7050
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7051
7051
|
*/
|
|
7052
7052
|
getUploadToServer(): boolean;
|
|
7053
7053
|
/**
|
|
@@ -7059,7 +7059,7 @@ declare namespace Electron {
|
|
|
7059
7059
|
* This would normally be controlled by user preferences. This has no effect if
|
|
7060
7060
|
* called before `start` is called.
|
|
7061
7061
|
*
|
|
7062
|
-
*
|
|
7062
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7063
7063
|
*/
|
|
7064
7064
|
setUploadToServer(uploadToServer: boolean): void;
|
|
7065
7065
|
/**
|
|
@@ -7073,19 +7073,19 @@ declare namespace Electron {
|
|
|
7073
7073
|
* renderer process is created, then that renderer process will not be monitored by
|
|
7074
7074
|
* the crash reporter.
|
|
7075
7075
|
*
|
|
7076
|
-
*
|
|
7076
|
+
* > [!NOTE] You can test out the crash reporter by generating a crash using
|
|
7077
7077
|
* `process.crash()`.
|
|
7078
7078
|
*
|
|
7079
|
-
*
|
|
7079
|
+
* > [!NOTE] If you need to send additional/updated `extra` parameters after your
|
|
7080
7080
|
* first call `start` you can call `addExtraParameter`.
|
|
7081
7081
|
*
|
|
7082
|
-
*
|
|
7082
|
+
* > [!NOTE] Parameters passed in `extra`, `globalExtra` or set with
|
|
7083
7083
|
* `addExtraParameter` have limits on the length of the keys and values. Key names
|
|
7084
7084
|
* must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
|
|
7085
7085
|
* with names longer than the maximum will be silently ignored. Key values longer
|
|
7086
7086
|
* than the maximum length will be truncated.
|
|
7087
7087
|
*
|
|
7088
|
-
*
|
|
7088
|
+
* > [!NOTE] This method is only available in the main process.
|
|
7089
7089
|
*/
|
|
7090
7090
|
start(options: CrashReporterStartOptions): void;
|
|
7091
7091
|
}
|
|
@@ -7243,7 +7243,7 @@ declare namespace Electron {
|
|
|
7243
7243
|
* `DesktopCapturerSource` represents a screen or an individual window that can be
|
|
7244
7244
|
* captured.
|
|
7245
7245
|
*
|
|
7246
|
-
*
|
|
7246
|
+
* > [!NOTE] Capturing the screen contents requires user consent on macOS 10.15
|
|
7247
7247
|
* Catalina or higher, which can detected by
|
|
7248
7248
|
* `systemPreferences.getMediaAccessStatus`.
|
|
7249
7249
|
*/
|
|
@@ -7407,11 +7407,11 @@ declare namespace Electron {
|
|
|
7407
7407
|
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
7408
7408
|
* `'*'` wildcard (no other wildcard is supported).
|
|
7409
7409
|
*
|
|
7410
|
-
*
|
|
7410
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
7411
7411
|
* and a directory selector, so if you set `properties` to `['openFile',
|
|
7412
7412
|
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
7413
7413
|
*
|
|
7414
|
-
*
|
|
7414
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
7415
7415
|
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
7416
7416
|
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
7417
7417
|
*/
|
|
@@ -7437,11 +7437,11 @@ declare namespace Electron {
|
|
|
7437
7437
|
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
7438
7438
|
* `'*'` wildcard (no other wildcard is supported).
|
|
7439
7439
|
*
|
|
7440
|
-
*
|
|
7440
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
7441
7441
|
* and a directory selector, so if you set `properties` to `['openFile',
|
|
7442
7442
|
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
7443
7443
|
*
|
|
7444
|
-
*
|
|
7444
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
7445
7445
|
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
7446
7446
|
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
7447
7447
|
*/
|
|
@@ -7460,11 +7460,11 @@ declare namespace Electron {
|
|
|
7460
7460
|
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
7461
7461
|
* `'*'` wildcard (no other wildcard is supported).
|
|
7462
7462
|
*
|
|
7463
|
-
*
|
|
7463
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
7464
7464
|
* and a directory selector, so if you set `properties` to `['openFile',
|
|
7465
7465
|
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
7466
7466
|
*
|
|
7467
|
-
*
|
|
7467
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
7468
7468
|
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
7469
7469
|
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
7470
7470
|
*/
|
|
@@ -7483,11 +7483,11 @@ declare namespace Electron {
|
|
|
7483
7483
|
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
7484
7484
|
* `'*'` wildcard (no other wildcard is supported).
|
|
7485
7485
|
*
|
|
7486
|
-
*
|
|
7486
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
7487
7487
|
* and a directory selector, so if you set `properties` to `['openFile',
|
|
7488
7488
|
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
7489
7489
|
*
|
|
7490
|
-
*
|
|
7490
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
7491
7491
|
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
7492
7492
|
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
7493
7493
|
*/
|
|
@@ -7508,7 +7508,7 @@ declare namespace Electron {
|
|
|
7508
7508
|
* The `filters` specifies an array of file types that can be displayed, see
|
|
7509
7509
|
* `dialog.showOpenDialog` for an example.
|
|
7510
7510
|
*
|
|
7511
|
-
*
|
|
7511
|
+
* > [!NOTE] On macOS, using the asynchronous version is recommended to avoid
|
|
7512
7512
|
* issues when expanding and collapsing the dialog.
|
|
7513
7513
|
*/
|
|
7514
7514
|
showSaveDialog(window: BaseWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
|
@@ -7528,7 +7528,7 @@ declare namespace Electron {
|
|
|
7528
7528
|
* The `filters` specifies an array of file types that can be displayed, see
|
|
7529
7529
|
* `dialog.showOpenDialog` for an example.
|
|
7530
7530
|
*
|
|
7531
|
-
*
|
|
7531
|
+
* > [!NOTE] On macOS, using the asynchronous version is recommended to avoid
|
|
7532
7532
|
* issues when expanding and collapsing the dialog.
|
|
7533
7533
|
*/
|
|
7534
7534
|
showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
|
@@ -7653,7 +7653,7 @@ declare namespace Electron {
|
|
|
7653
7653
|
* However, the request remains active until either the application becomes active
|
|
7654
7654
|
* or the request is canceled.
|
|
7655
7655
|
*
|
|
7656
|
-
*
|
|
7656
|
+
* > [!NOTE] This method can only be used while the app is not focused; when the
|
|
7657
7657
|
* app is focused it will return -1.
|
|
7658
7658
|
*
|
|
7659
7659
|
* @platform darwin
|
|
@@ -7821,7 +7821,7 @@ declare namespace Electron {
|
|
|
7821
7821
|
/**
|
|
7822
7822
|
* The file name of the download item.
|
|
7823
7823
|
*
|
|
7824
|
-
*
|
|
7824
|
+
* > [!NOTE] The file name is not always the same as the actual one saved in local
|
|
7825
7825
|
* disk. If user changes the file name in a prompted download saving dialog, the
|
|
7826
7826
|
* actual name of saved file will be different.
|
|
7827
7827
|
*/
|
|
@@ -7861,7 +7861,7 @@ declare namespace Electron {
|
|
|
7861
7861
|
* The current state. Can be `progressing`, `completed`, `cancelled` or
|
|
7862
7862
|
* `interrupted`.
|
|
7863
7863
|
*
|
|
7864
|
-
*
|
|
7864
|
+
* > [!NOTE] The following methods are useful specifically to resume a `cancelled`
|
|
7865
7865
|
* item when session is restarted.
|
|
7866
7866
|
*/
|
|
7867
7867
|
getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
|
|
@@ -7894,7 +7894,7 @@ declare namespace Electron {
|
|
|
7894
7894
|
/**
|
|
7895
7895
|
* Resumes the download that has been paused.
|
|
7896
7896
|
*
|
|
7897
|
-
*
|
|
7897
|
+
* > [!NOTE] To enable resumable downloads the server you are downloading from must
|
|
7898
7898
|
* support range requests and provide both `Last-Modified` and `ETag` header
|
|
7899
7899
|
* values. Otherwise `resume()` will dismiss previously received bytes and restart
|
|
7900
7900
|
* the download from the beginning.
|
|
@@ -8006,14 +8006,14 @@ declare namespace Electron {
|
|
|
8006
8006
|
/**
|
|
8007
8007
|
* A list of all loaded extensions.
|
|
8008
8008
|
*
|
|
8009
|
-
*
|
|
8009
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
8010
8010
|
* is emitted.
|
|
8011
8011
|
*/
|
|
8012
8012
|
getAllExtensions(): Extension[];
|
|
8013
8013
|
/**
|
|
8014
8014
|
* The loaded extension with the given ID.
|
|
8015
8015
|
*
|
|
8016
|
-
*
|
|
8016
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
8017
8017
|
* is emitted.
|
|
8018
8018
|
*/
|
|
8019
8019
|
getExtension(extensionId: string): (Extension) | (null);
|
|
@@ -8034,17 +8034,17 @@ declare namespace Electron {
|
|
|
8034
8034
|
*
|
|
8035
8035
|
* This API does not support loading packed (.crx) extensions.
|
|
8036
8036
|
*
|
|
8037
|
-
*
|
|
8037
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
8038
8038
|
* is emitted.
|
|
8039
8039
|
*
|
|
8040
|
-
*
|
|
8040
|
+
* > [!NOTE] Loading extensions into in-memory (non-persistent) sessions is not
|
|
8041
8041
|
* supported and will throw an error.
|
|
8042
8042
|
*/
|
|
8043
8043
|
loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
|
|
8044
8044
|
/**
|
|
8045
8045
|
* Unloads an extension.
|
|
8046
8046
|
*
|
|
8047
|
-
*
|
|
8047
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
8048
8048
|
* is emitted.
|
|
8049
8049
|
*/
|
|
8050
8050
|
removeExtension(extensionId: string): void;
|
|
@@ -8716,7 +8716,7 @@ declare namespace Electron {
|
|
|
8716
8716
|
*
|
|
8717
8717
|
* If you do not need a response to the message, consider using `ipcRenderer.send`.
|
|
8718
8718
|
*
|
|
8719
|
-
* >
|
|
8719
|
+
* > [!NOTE] Sending non-standard JavaScript types such as DOM objects or special
|
|
8720
8720
|
* Electron objects will throw an exception.
|
|
8721
8721
|
*
|
|
8722
8722
|
* Since the main process does not have support for DOM objects such as
|
|
@@ -8724,7 +8724,7 @@ declare namespace Electron {
|
|
|
8724
8724
|
* Electron's IPC to the main process, as the main process would have no way to
|
|
8725
8725
|
* decode them. Attempting to send such objects over IPC will result in an error.
|
|
8726
8726
|
*
|
|
8727
|
-
* >
|
|
8727
|
+
* > [!NOTE] If the handler in the main process throws an error, the promise
|
|
8728
8728
|
* returned by `invoke` will reject. However, the `Error` object in the renderer
|
|
8729
8729
|
* process will not be the same as the one thrown in the main process.
|
|
8730
8730
|
*/
|
|
@@ -8819,9 +8819,9 @@ declare namespace Electron {
|
|
|
8819
8819
|
* The main process handles it by listening for `channel` with `ipcMain` module,
|
|
8820
8820
|
* and replies by setting `event.returnValue`.
|
|
8821
8821
|
*
|
|
8822
|
-
* >
|
|
8823
|
-
*
|
|
8824
|
-
*
|
|
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()`.
|
|
8825
8825
|
*/
|
|
8826
8826
|
sendSync(channel: string, ...args: any[]): any;
|
|
8827
8827
|
/**
|
|
@@ -9036,7 +9036,7 @@ declare namespace Electron {
|
|
|
9036
9036
|
/**
|
|
9037
9037
|
* The application menu, if set, or `null`, if not set.
|
|
9038
9038
|
*
|
|
9039
|
-
*
|
|
9039
|
+
* > [!NOTE] The returned `Menu` instance doesn't support dynamic addition or
|
|
9040
9040
|
* removal of menu items. Instance properties can still be dynamically modified.
|
|
9041
9041
|
*/
|
|
9042
9042
|
static getApplicationMenu(): (Menu) | (null);
|
|
@@ -9067,7 +9067,7 @@ declare namespace Electron {
|
|
|
9067
9067
|
* Passing `null` will suppress the default menu. On Windows and Linux, this has
|
|
9068
9068
|
* the additional effect of removing the menu bar from the window.
|
|
9069
9069
|
*
|
|
9070
|
-
*
|
|
9070
|
+
* > [!NOTE] The default menu will be created automatically if the app does not set
|
|
9071
9071
|
* one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
|
|
9072
9072
|
* `Help`.
|
|
9073
9073
|
*/
|
|
@@ -9211,7 +9211,7 @@ declare namespace Electron {
|
|
|
9211
9211
|
* An `Accelerator | null` indicating the item's user-assigned accelerator for the
|
|
9212
9212
|
* menu item.
|
|
9213
9213
|
*
|
|
9214
|
-
*
|
|
9214
|
+
* > [!NOTE] This property is only initialized after the `MenuItem` has been added
|
|
9215
9215
|
* to a `Menu`. Either via `Menu.buildFromTemplate` or via
|
|
9216
9216
|
* `Menu.append()/insert()`. Accessing before initialization will just return
|
|
9217
9217
|
* `null`.
|
|
@@ -9396,7 +9396,7 @@ declare namespace Electron {
|
|
|
9396
9396
|
/**
|
|
9397
9397
|
* fulfilled with the file's thumbnail preview image, which is a NativeImage.
|
|
9398
9398
|
*
|
|
9399
|
-
*
|
|
9399
|
+
* > [!NOTE] Windows implementation will ignore `size.height` and scale the height
|
|
9400
9400
|
* according to `size.width`.
|
|
9401
9401
|
*
|
|
9402
9402
|
* @platform darwin,win32
|
|
@@ -9710,7 +9710,7 @@ declare namespace Electron {
|
|
|
9710
9710
|
* intercepted request to the built-in handler. webRequest handlers will still be
|
|
9711
9711
|
* triggered when bypassing custom protocols.
|
|
9712
9712
|
*
|
|
9713
|
-
*
|
|
9713
|
+
* > [!NOTE] In the utility process, custom protocols are not supported.
|
|
9714
9714
|
*/
|
|
9715
9715
|
fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
|
|
9716
9716
|
/**
|
|
@@ -10473,7 +10473,7 @@ declare namespace Electron {
|
|
|
10473
10473
|
* Starts preventing the system from entering lower-power mode. Returns an integer
|
|
10474
10474
|
* identifying the power save blocker.
|
|
10475
10475
|
*
|
|
10476
|
-
*
|
|
10476
|
+
* > [!NOTE] `prevent-display-sleep` has higher precedence over
|
|
10477
10477
|
* `prevent-app-suspension`. Only the highest precedence type takes effect. In
|
|
10478
10478
|
* other words, `prevent-display-sleep` always takes precedence over
|
|
10479
10479
|
* `prevent-app-suspension`.
|
|
@@ -10854,7 +10854,7 @@ declare namespace Electron {
|
|
|
10854
10854
|
*/
|
|
10855
10855
|
registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
|
|
10856
10856
|
/**
|
|
10857
|
-
*
|
|
10857
|
+
* > [!NOTE] This method can only be used before the `ready` event of the `app`
|
|
10858
10858
|
* module gets emitted and can be called only once.
|
|
10859
10859
|
*
|
|
10860
10860
|
* Registers the `scheme` as standard, secure, bypasses content security policy for
|
|
@@ -11295,7 +11295,9 @@ declare namespace Electron {
|
|
|
11295
11295
|
* Converts a screen DIP point to a screen physical point. The DPI scale is
|
|
11296
11296
|
* performed relative to the display containing the DIP point.
|
|
11297
11297
|
*
|
|
11298
|
-
*
|
|
11298
|
+
* Not currently supported on Wayland.
|
|
11299
|
+
*
|
|
11300
|
+
* @platform win32,linux
|
|
11299
11301
|
*/
|
|
11300
11302
|
dipToScreenPoint(point: Point): Point;
|
|
11301
11303
|
/**
|
|
@@ -11313,7 +11315,7 @@ declare namespace Electron {
|
|
|
11313
11315
|
/**
|
|
11314
11316
|
* The current absolute position of the mouse pointer.
|
|
11315
11317
|
*
|
|
11316
|
-
*
|
|
11318
|
+
* > [!NOTE] The return value is a DIP point, not a screen physical point.
|
|
11317
11319
|
*/
|
|
11318
11320
|
getCursorScreenPoint(): Point;
|
|
11319
11321
|
/**
|
|
@@ -11332,7 +11334,10 @@ declare namespace Electron {
|
|
|
11332
11334
|
* Converts a screen physical point to a screen DIP point. The DPI scale is
|
|
11333
11335
|
* performed relative to the display containing the physical point.
|
|
11334
11336
|
*
|
|
11335
|
-
*
|
|
11337
|
+
* Not currently supported on Wayland - if used there it will return the point
|
|
11338
|
+
* passed in with no changes.
|
|
11339
|
+
*
|
|
11340
|
+
* @platform win32,linux
|
|
11336
11341
|
*/
|
|
11337
11342
|
screenToDipPoint(point: Point): Point;
|
|
11338
11343
|
/**
|
|
@@ -12151,8 +12156,8 @@ declare namespace Electron {
|
|
|
12151
12156
|
* Whether the word was successfully written to the custom dictionary. This API
|
|
12152
12157
|
* will not work on non-persistent (in-memory) sessions.
|
|
12153
12158
|
*
|
|
12154
|
-
*
|
|
12155
|
-
* dictionary as well
|
|
12159
|
+
* > [!NOTE] On macOS and Windows, this word will be written to the OS custom
|
|
12160
|
+
* dictionary as well.
|
|
12156
12161
|
*/
|
|
12157
12162
|
addWordToSpellCheckerDictionary(word: string): boolean;
|
|
12158
12163
|
/**
|
|
@@ -12182,7 +12187,7 @@ declare namespace Electron {
|
|
|
12182
12187
|
* This method clears more types of data and is more thorough than the
|
|
12183
12188
|
* `clearStorageData` method.
|
|
12184
12189
|
*
|
|
12185
|
-
*
|
|
12190
|
+
* > [!NOTE] Cookies are stored at a broader scope than origins. When removing
|
|
12186
12191
|
* cookies and filtering by `origins` (or `excludeOrigins`), the cookies will be
|
|
12187
12192
|
* removed at the registrable domain level. For example, clearing cookies for the
|
|
12188
12193
|
* origin `https://really.specific.origin.example.com/` will end up clearing all
|
|
@@ -12190,7 +12195,7 @@ declare namespace Electron {
|
|
|
12190
12195
|
* `https://my.website.example.co.uk/` will end up clearing all cookies for
|
|
12191
12196
|
* `example.co.uk`.
|
|
12192
12197
|
*
|
|
12193
|
-
*
|
|
12198
|
+
* > [!NOTE] Clearing cache data will also clear the shared dictionary cache. This
|
|
12194
12199
|
* means that any dictionaries used for compression may be reloaded after clearing
|
|
12195
12200
|
* the cache. If you wish to clear the shared dictionary cache but leave other
|
|
12196
12201
|
* cached data intact, you may want to use the `clearSharedDictionaryCache` method.
|
|
@@ -12220,7 +12225,7 @@ declare namespace Electron {
|
|
|
12220
12225
|
/**
|
|
12221
12226
|
* Resolves when all connections are closed.
|
|
12222
12227
|
*
|
|
12223
|
-
*
|
|
12228
|
+
* > [!NOTE] It will terminate / fail all requests currently in flight.
|
|
12224
12229
|
*/
|
|
12225
12230
|
closeAllConnections(): Promise<void>;
|
|
12226
12231
|
/**
|
|
@@ -12240,7 +12245,7 @@ declare namespace Electron {
|
|
|
12240
12245
|
* Initiates a download of the resource at `url`. The API will generate a
|
|
12241
12246
|
* DownloadItem that can be accessed with the will-download event.
|
|
12242
12247
|
*
|
|
12243
|
-
*
|
|
12248
|
+
* > [!NOTE] This does not perform any security checks that relate to a page's
|
|
12244
12249
|
* origin, unlike `webContents.downloadURL`.
|
|
12245
12250
|
*/
|
|
12246
12251
|
downloadURL(url: string, options?: DownloadURLOptions): void;
|
|
@@ -12289,7 +12294,7 @@ declare namespace Electron {
|
|
|
12289
12294
|
/**
|
|
12290
12295
|
* A list of all loaded extensions.
|
|
12291
12296
|
*
|
|
12292
|
-
*
|
|
12297
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
12293
12298
|
* is emitted.
|
|
12294
12299
|
*
|
|
12295
12300
|
* **Deprecated:** Use the new `ses.extensions.getAllExtensions` API.
|
|
@@ -12308,7 +12313,7 @@ declare namespace Electron {
|
|
|
12308
12313
|
/**
|
|
12309
12314
|
* The loaded extension with the given ID.
|
|
12310
12315
|
*
|
|
12311
|
-
*
|
|
12316
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
12312
12317
|
* is emitted.
|
|
12313
12318
|
*
|
|
12314
12319
|
* **Deprecated:** Use the new `ses.extensions.getExtension` API.
|
|
@@ -12357,7 +12362,7 @@ declare namespace Electron {
|
|
|
12357
12362
|
* this setting is an empty list Electron will try to populate this setting with
|
|
12358
12363
|
* the current OS locale. This setting is persisted across restarts.
|
|
12359
12364
|
*
|
|
12360
|
-
*
|
|
12365
|
+
* > [!NOTE] On macOS, the OS spellchecker is used and has its own list of
|
|
12361
12366
|
* languages. On macOS, this API will return whichever languages have been
|
|
12362
12367
|
* configured by the OS.
|
|
12363
12368
|
*/
|
|
@@ -12404,10 +12409,10 @@ declare namespace Electron {
|
|
|
12404
12409
|
*
|
|
12405
12410
|
* This API does not support loading packed (.crx) extensions.
|
|
12406
12411
|
*
|
|
12407
|
-
*
|
|
12412
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
12408
12413
|
* is emitted.
|
|
12409
12414
|
*
|
|
12410
|
-
*
|
|
12415
|
+
* > [!NOTE] Loading extensions into in-memory (non-persistent) sessions is not
|
|
12411
12416
|
* supported and will throw an error.
|
|
12412
12417
|
*
|
|
12413
12418
|
* **Deprecated:** Use the new `ses.extensions.loadExtension` API.
|
|
@@ -12430,7 +12435,7 @@ declare namespace Electron {
|
|
|
12430
12435
|
/**
|
|
12431
12436
|
* Unloads an extension.
|
|
12432
12437
|
*
|
|
12433
|
-
*
|
|
12438
|
+
* > [!NOTE] This API cannot be called before the `ready` event of the `app` module
|
|
12434
12439
|
* is emitted.
|
|
12435
12440
|
*
|
|
12436
12441
|
* **Deprecated:** Use the new `ses.extensions.removeExtension` API.
|
|
@@ -12442,8 +12447,8 @@ declare namespace Electron {
|
|
|
12442
12447
|
* Whether the word was successfully removed from the custom dictionary. This API
|
|
12443
12448
|
* will not work on non-persistent (in-memory) sessions.
|
|
12444
12449
|
*
|
|
12445
|
-
*
|
|
12446
|
-
* dictionary as well
|
|
12450
|
+
* > [!NOTE] On macOS and Windows, this word will be removed from the OS custom
|
|
12451
|
+
* dictionary as well.
|
|
12447
12452
|
*/
|
|
12448
12453
|
removeWordFromSpellCheckerDictionary(word: string): boolean;
|
|
12449
12454
|
/**
|
|
@@ -12583,8 +12588,8 @@ declare namespace Electron {
|
|
|
12583
12588
|
* Please note the trailing slash. The URL to the dictionaries is formed as
|
|
12584
12589
|
* `${url}${filename}`.
|
|
12585
12590
|
*
|
|
12586
|
-
*
|
|
12587
|
-
* any dictionary files.
|
|
12591
|
+
* > [!NOTE] On macOS, the OS spellchecker is used and therefore we do not download
|
|
12592
|
+
* any dictionary files. This API is a no-op on macOS.
|
|
12588
12593
|
*/
|
|
12589
12594
|
setSpellCheckerDictionaryDownloadURL(url: string): void;
|
|
12590
12595
|
/**
|
|
@@ -12597,8 +12602,8 @@ declare namespace Electron {
|
|
|
12597
12602
|
* must call this API with an array of language codes. You can get the list of
|
|
12598
12603
|
* supported language codes with the `ses.availableSpellCheckerLanguages` property.
|
|
12599
12604
|
*
|
|
12600
|
-
*
|
|
12601
|
-
* automatically.
|
|
12605
|
+
* > [!NOTE] On macOS, the OS spellchecker is used and will detect your language
|
|
12606
|
+
* automatically. This API is a no-op on macOS.
|
|
12602
12607
|
*/
|
|
12603
12608
|
setSpellCheckerLanguages(languages: string[]): void;
|
|
12604
12609
|
/**
|
|
@@ -14297,7 +14302,7 @@ declare namespace Electron {
|
|
|
14297
14302
|
/**
|
|
14298
14303
|
* Emitted when the mouse is released from clicking the tray icon.
|
|
14299
14304
|
*
|
|
14300
|
-
*
|
|
14305
|
+
* > [!NOTE] This will not be emitted if you have set a context menu for your Tray
|
|
14301
14306
|
* using `tray.setContextMenu`, as a result of macOS-level constraints.
|
|
14302
14307
|
*
|
|
14303
14308
|
* @platform darwin
|
|
@@ -14628,7 +14633,7 @@ declare namespace Electron {
|
|
|
14628
14633
|
// Docs: https://electronjs.org/docs/api/utility-process
|
|
14629
14634
|
|
|
14630
14635
|
/**
|
|
14631
|
-
*
|
|
14636
|
+
* > [!NOTE] `utilityProcess.fork` can only be called after the `ready` event has
|
|
14632
14637
|
* been emitted on `App`.
|
|
14633
14638
|
*/
|
|
14634
14639
|
static fork(modulePath: string, args?: string[], options?: ForkOptions): UtilityProcess;
|
|
@@ -14787,7 +14792,7 @@ declare namespace Electron {
|
|
|
14787
14792
|
* `undefined`. When the child process exits, then the value is `undefined` after
|
|
14788
14793
|
* the `exit` event is emitted.
|
|
14789
14794
|
*
|
|
14790
|
-
*
|
|
14795
|
+
* > [!NOTE] You can use the `pid` to determine if the process is currently
|
|
14791
14796
|
* running.
|
|
14792
14797
|
*/
|
|
14793
14798
|
pid: (number) | (undefined);
|
|
@@ -14868,12 +14873,12 @@ declare namespace Electron {
|
|
|
14868
14873
|
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
|
14869
14874
|
* * e.g. `blueviolet` or `red`
|
|
14870
14875
|
*
|
|
14871
|
-
*
|
|
14876
|
+
* > [!NOTE] Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
|
|
14872
14877
|
* `RGB`.
|
|
14873
14878
|
*/
|
|
14874
14879
|
setBackgroundColor(color: string): void;
|
|
14875
14880
|
/**
|
|
14876
|
-
*
|
|
14881
|
+
* > [!NOTE] The area cutout of the view's border still captures clicks.
|
|
14877
14882
|
*/
|
|
14878
14883
|
setBorderRadius(radius: number): void;
|
|
14879
14884
|
setBounds(bounds: Rectangle): void;
|
|
@@ -16598,7 +16603,7 @@ declare namespace Electron {
|
|
|
16598
16603
|
* Calling `event.preventDefault()` will ignore the `beforeunload` event handler
|
|
16599
16604
|
* and allow the page to be unloaded.
|
|
16600
16605
|
*
|
|
16601
|
-
*
|
|
16606
|
+
* > [!NOTE] This will be emitted for `BrowserViews` but will _not_ be respected -
|
|
16602
16607
|
* this is because we have chosen not to tie the `BrowserView` lifecycle to its
|
|
16603
16608
|
* owning BrowserWindow should one exist per the specification.
|
|
16604
16609
|
*/
|
|
@@ -17272,8 +17277,10 @@ declare namespace Electron {
|
|
|
17272
17277
|
*/
|
|
17273
17278
|
send(channel: string, ...args: any[]): void;
|
|
17274
17279
|
/**
|
|
17275
|
-
* Sends an input `event` to the page.
|
|
17276
|
-
*
|
|
17280
|
+
* Sends an input `event` to the page.
|
|
17281
|
+
*
|
|
17282
|
+
* > [!NOTE] The `BrowserWindow` containing the contents needs to be focused for
|
|
17283
|
+
* `sendInputEvent()` to work.
|
|
17277
17284
|
*/
|
|
17278
17285
|
sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
|
|
17279
17286
|
/**
|
|
@@ -17355,8 +17362,7 @@ declare namespace Electron {
|
|
|
17355
17362
|
/**
|
|
17356
17363
|
* Sets the maximum and minimum pinch-to-zoom level.
|
|
17357
17364
|
*
|
|
17358
|
-
* >
|
|
17359
|
-
* call:
|
|
17365
|
+
* > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
|
|
17360
17366
|
*/
|
|
17361
17367
|
setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
|
|
17362
17368
|
/**
|
|
@@ -17366,8 +17372,10 @@ declare namespace Electron {
|
|
|
17366
17372
|
setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
|
|
17367
17373
|
/**
|
|
17368
17374
|
* Setting the WebRTC UDP Port Range allows you to restrict the udp port range used
|
|
17369
|
-
* by WebRTC. By default the port range is unrestricted.
|
|
17370
|
-
*
|
|
17375
|
+
* by WebRTC. By default the port range is unrestricted.
|
|
17376
|
+
*
|
|
17377
|
+
* > [!NOTE] To reset to an unrestricted port range this value should be set to `{
|
|
17378
|
+
* min: 0, max: 0 }`.
|
|
17371
17379
|
*/
|
|
17372
17380
|
setWebRTCUDPPortRange(udpPortRange: UdpPortRange): void;
|
|
17373
17381
|
/**
|
|
@@ -17393,10 +17401,9 @@ declare namespace Electron {
|
|
|
17393
17401
|
* limits of 300% and 50% of original size, respectively. The formula for this is
|
|
17394
17402
|
* `scale := 1.2 ^ level`.
|
|
17395
17403
|
*
|
|
17396
|
-
* >
|
|
17397
|
-
*
|
|
17398
|
-
*
|
|
17399
|
-
* per-window.
|
|
17404
|
+
* > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
|
|
17405
|
+
* zoom level for a specific domain propagates across all instances of windows with
|
|
17406
|
+
* the same domain. Differentiating the window URLs will make zoom work per-window.
|
|
17400
17407
|
*/
|
|
17401
17408
|
setZoomLevel(level: number): void;
|
|
17402
17409
|
/**
|
|
@@ -17464,7 +17471,7 @@ declare namespace Electron {
|
|
|
17464
17471
|
* A `WebContents | null` property that represents the of DevTools `WebContents`
|
|
17465
17472
|
* associated with a given `WebContents`.
|
|
17466
17473
|
*
|
|
17467
|
-
*
|
|
17474
|
+
* > [!NOTE] Users should never store this object because it may become `null` when
|
|
17468
17475
|
* the DevTools has been closed.
|
|
17469
17476
|
*
|
|
17470
17477
|
*/
|
|
@@ -17694,7 +17701,8 @@ declare namespace Electron {
|
|
|
17694
17701
|
removeInsertedCSS(key: string): void;
|
|
17695
17702
|
/**
|
|
17696
17703
|
* Set the security origin, content security policy and name of the isolated world.
|
|
17697
|
-
*
|
|
17704
|
+
*
|
|
17705
|
+
* > [!NOTE] If the `csp` is specified, then the `securityOrigin` also has to be
|
|
17698
17706
|
* specified.
|
|
17699
17707
|
*/
|
|
17700
17708
|
setIsolatedWorldInfo(worldId: number, info: Info): void;
|
|
@@ -17715,10 +17723,9 @@ declare namespace Electron {
|
|
|
17715
17723
|
/**
|
|
17716
17724
|
* Sets the maximum and minimum pinch-to-zoom level.
|
|
17717
17725
|
*
|
|
17718
|
-
* >
|
|
17719
|
-
* call:
|
|
17726
|
+
* > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
|
|
17720
17727
|
*
|
|
17721
|
-
* >
|
|
17728
|
+
* > [!NOTE] Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
|
|
17722
17729
|
* shortcuts are controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem
|
|
17723
17730
|
* roles in the application Menu. To disable shortcuts, manually define the Menu
|
|
17724
17731
|
* and omit zoom roles from the definition.
|
|
@@ -17736,10 +17743,9 @@ declare namespace Electron {
|
|
|
17736
17743
|
* increment above or below represents zooming 20% larger or smaller to default
|
|
17737
17744
|
* limits of 300% and 50% of original size, respectively.
|
|
17738
17745
|
*
|
|
17739
|
-
* >
|
|
17740
|
-
*
|
|
17741
|
-
*
|
|
17742
|
-
* per-window.
|
|
17746
|
+
* > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
|
|
17747
|
+
* zoom level for a specific domain propagates across all instances of windows with
|
|
17748
|
+
* the same domain. Differentiating the window URLs will make zoom work per-window.
|
|
17743
17749
|
*/
|
|
17744
17750
|
setZoomLevel(level: number): void;
|
|
17745
17751
|
/**
|
|
@@ -18902,10 +18908,9 @@ declare namespace Electron {
|
|
|
18902
18908
|
* limits of 300% and 50% of original size, respectively. The formula for this is
|
|
18903
18909
|
* `scale := 1.2 ^ level`.
|
|
18904
18910
|
*
|
|
18905
|
-
* >
|
|
18906
|
-
*
|
|
18907
|
-
*
|
|
18908
|
-
* per-window.
|
|
18911
|
+
* > [!NOTE] The zoom policy at the Chromium level is same-origin, meaning that the
|
|
18912
|
+
* zoom level for a specific domain propagates across all instances of windows with
|
|
18913
|
+
* the same domain. Differentiating the window URLs will make zoom work per-window.
|
|
18909
18914
|
*/
|
|
18910
18915
|
setZoomLevel(level: number): void;
|
|
18911
18916
|
/**
|
|
@@ -20702,6 +20707,11 @@ declare namespace Electron {
|
|
|
20702
20707
|
*/
|
|
20703
20708
|
type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
|
|
20704
20709
|
label?: string;
|
|
20710
|
+
/**
|
|
20711
|
+
* Available in macOS >= 14.4
|
|
20712
|
+
*
|
|
20713
|
+
* @platform darwin
|
|
20714
|
+
*/
|
|
20705
20715
|
sublabel?: string;
|
|
20706
20716
|
/**
|
|
20707
20717
|
* Hover text for this menu item.
|
|
@@ -25050,7 +25060,7 @@ declare namespace NodeJS {
|
|
|
25050
25060
|
*
|
|
25051
25061
|
* Example:
|
|
25052
25062
|
*
|
|
25053
|
-
*
|
|
25063
|
+
* > [!NOTE] It returns the actual operating system version instead of kernel
|
|
25054
25064
|
* version on macOS unlike `os.release()`.
|
|
25055
25065
|
*/
|
|
25056
25066
|
getSystemVersion(): string;
|