electron-types 45.0.0-alpha.11 → 45.0.0-alpha.13
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/README.md +3 -3
- package/dist/electron.d.ts +85 -31
- package/dist/version.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ The official `electron` package is ~200MB because it includes the Electron binar
|
|
|
14
14
|
Since this package only provides TypeScript types, install it as a dev dependency. **Install the version that matches your Electron version** (see [Version Matching](#version-matching)):
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install -D electron-types@45.0.0-alpha.
|
|
17
|
+
npm install -D electron-types@45.0.0-alpha.13
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@45.0.0-alpha.
|
|
19
|
+
yarn add -D electron-types@45.0.0-alpha.13
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@45.0.0-alpha.
|
|
21
|
+
pnpm add -D electron-types@45.0.0-alpha.13
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 45.0.0-alpha.
|
|
1
|
+
// Type definitions for Electron 45.0.0-alpha.13
|
|
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
|
|
@@ -300,7 +300,8 @@ declare namespace Electron {
|
|
|
300
300
|
isMainFrame: boolean) => void): this;
|
|
301
301
|
/**
|
|
302
302
|
* Emitted when the child process unexpectedly disappears. This is normally because
|
|
303
|
-
* it was crashed or killed. It does not include
|
|
303
|
+
* it was crashed or killed, or because it failed to launch. It does not include
|
|
304
|
+
* renderer processes.
|
|
304
305
|
*/
|
|
305
306
|
on(event: 'child-process-gone', listener: (event: Event,
|
|
306
307
|
details: Details) => void): this;
|
|
@@ -3372,6 +3373,16 @@ declare namespace Electron {
|
|
|
3372
3373
|
* it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
|
|
3373
3374
|
* version 2004 and up the window will be removed from capture entirely, older
|
|
3374
3375
|
* Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
|
|
3376
|
+
* The change takes effect with the next desktop composition, not when the call
|
|
3377
|
+
* returns, so a capture started immediately afterwards can still contain the
|
|
3378
|
+
* window.
|
|
3379
|
+
*
|
|
3380
|
+
* Protection also applies in a Windows remote session. A Remote Desktop client
|
|
3381
|
+
* still shows the window to the remote user, but remote access software that works
|
|
3382
|
+
* by capturing the desktop cannot. To leave windows unprotected in remote sessions
|
|
3383
|
+
* instead, disable the `AllowWindowCaptureExclusionInRemoteSessions` Chromium
|
|
3384
|
+
* feature at the start of your main script. `win.isContentProtected()` still
|
|
3385
|
+
* returns `true` in that case.
|
|
3375
3386
|
*
|
|
3376
3387
|
* @platform darwin,win32
|
|
3377
3388
|
*/
|
|
@@ -3437,7 +3448,10 @@ declare namespace Electron {
|
|
|
3437
3448
|
* Makes the window ignore all mouse events.
|
|
3438
3449
|
*
|
|
3439
3450
|
* All mouse events happened in this window will be passed to the window below this
|
|
3440
|
-
* window, but if this window has focus, it will still receive keyboard events.
|
|
3451
|
+
* window, but if this window has focus, it will still receive keyboard events. On
|
|
3452
|
+
* Linux this is supported on both X11 and Wayland. On X11 the X server has applied
|
|
3453
|
+
* the window's new input shape when the call returns; on Wayland the new input
|
|
3454
|
+
* region is applied with the window's next frame.
|
|
3441
3455
|
*/
|
|
3442
3456
|
setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
|
|
3443
3457
|
/**
|
|
@@ -6190,7 +6204,16 @@ declare namespace Electron {
|
|
|
6190
6204
|
* On Windows, it calls `SetWindowDisplayAffinity` with `WDA_EXCLUDEFROMCAPTURE`.
|
|
6191
6205
|
* For Windows 10 version 2004 and up the window will be removed from capture
|
|
6192
6206
|
* entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing
|
|
6193
|
-
* a black window.
|
|
6207
|
+
* a black window. The change takes effect with the next desktop composition, not
|
|
6208
|
+
* when the call returns, so a capture started immediately afterwards can still
|
|
6209
|
+
* contain the window.
|
|
6210
|
+
*
|
|
6211
|
+
* Protection also applies in a Windows remote session. A Remote Desktop client
|
|
6212
|
+
* still shows the window to the remote user, but remote access software that works
|
|
6213
|
+
* by capturing the desktop cannot. To leave windows unprotected in remote sessions
|
|
6214
|
+
* instead, disable the `AllowWindowCaptureExclusionInRemoteSessions` Chromium
|
|
6215
|
+
* feature at the start of your main script. `win.isContentProtected()` still
|
|
6216
|
+
* returns `true` in that case.
|
|
6194
6217
|
*
|
|
6195
6218
|
* On macOS, it sets the `NSWindow`'s `sharingType` to `NSWindowSharingNone`.
|
|
6196
6219
|
* Unfortunately, due to an intentional change in macOS, newer Mac applications
|
|
@@ -6260,7 +6283,10 @@ declare namespace Electron {
|
|
|
6260
6283
|
* Makes the window ignore all mouse events.
|
|
6261
6284
|
*
|
|
6262
6285
|
* All mouse events happened in this window will be passed to the window below this
|
|
6263
|
-
* window, but if this window has focus, it will still receive keyboard events.
|
|
6286
|
+
* window, but if this window has focus, it will still receive keyboard events. On
|
|
6287
|
+
* Linux this is supported on both X11 and Wayland. On X11 the X server has applied
|
|
6288
|
+
* the window's new input shape when the call returns; on Wayland the new input
|
|
6289
|
+
* region is applied with the window's next frame.
|
|
6264
6290
|
*/
|
|
6265
6291
|
setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
|
|
6266
6292
|
/**
|
|
@@ -7121,7 +7147,7 @@ declare namespace Electron {
|
|
|
7121
7147
|
* resolves to a ClipboardBookmark object instead. Rejects when `type` is not
|
|
7122
7148
|
* present in `clipboardItem.types`.
|
|
7123
7149
|
*/
|
|
7124
|
-
getType(type:
|
|
7150
|
+
getType<T extends string>(type: T): Promise<string extends T ? (Blob | ClipboardBookmark) : T extends 'electron application/bookmark' ? ClipboardBookmark : Blob>;
|
|
7125
7151
|
/**
|
|
7126
7152
|
* Resolves with a ClipboardBookmark when a bookmark is available in the clipboard.
|
|
7127
7153
|
* Rejects when a bookmark is not available in the clipboard.
|
|
@@ -7470,7 +7496,9 @@ declare namespace Electron {
|
|
|
7470
7496
|
/**
|
|
7471
7497
|
* Set an extra parameter to be sent with the crash report. The values specified
|
|
7472
7498
|
* here will be sent in addition to any values set via the `extra` option when
|
|
7473
|
-
* `start` was called.
|
|
7499
|
+
* `start` was called. Calling this again with the same key replaces the value. The
|
|
7500
|
+
* value is read when a crash happens, so you can update it as your app's state
|
|
7501
|
+
* changes.
|
|
7474
7502
|
*
|
|
7475
7503
|
* Parameters added in this fashion (or via the `extra` parameter to
|
|
7476
7504
|
* `crashReporter.start`) are specific to the calling process. Adding extra
|
|
@@ -7478,29 +7506,42 @@ declare namespace Electron {
|
|
|
7478
7506
|
* with crashes from renderer or other child processes. Similarly, adding extra
|
|
7479
7507
|
* parameters in a renderer process will not result in those parameters being sent
|
|
7480
7508
|
* with crashes that occur in other renderer processes or in the main process.
|
|
7509
|
+
* Processes created with `utilityProcess` have no API for setting extra
|
|
7510
|
+
* parameters, so only `globalExtra` values are sent with their crashes.
|
|
7481
7511
|
*
|
|
7482
7512
|
* > [!NOTE] Parameters have limits on the length of the keys and values. Key names
|
|
7483
7513
|
* must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
|
|
7484
|
-
* Keys with names longer than the maximum
|
|
7485
|
-
* longer than the maximum length
|
|
7514
|
+
* Keys with names longer than the maximum are ignored, and a warning is emitted.
|
|
7515
|
+
* Values longer than the maximum length are truncated.
|
|
7486
7516
|
*/
|
|
7487
7517
|
addExtraParameter(key: string, value: string): void;
|
|
7488
7518
|
/**
|
|
7489
|
-
* The date and ID of the
|
|
7490
|
-
*
|
|
7491
|
-
*
|
|
7492
|
-
*
|
|
7519
|
+
* The date and ID of the crash report with the most recent upload time, from the
|
|
7520
|
+
* list returned by `getUploadedReports()`. If there are no crash reports at all,
|
|
7521
|
+
* `null` is returned.
|
|
7522
|
+
*
|
|
7523
|
+
* If no report has been uploaded yet but some are stored on disk, a report that
|
|
7524
|
+
* has not been uploaded may be returned. Check that its `id` is not empty before
|
|
7525
|
+
* treating it as uploaded.
|
|
7493
7526
|
*
|
|
7494
7527
|
* > [!NOTE] This method is only available in the main process.
|
|
7495
7528
|
*/
|
|
7496
7529
|
getLastCrashReport(): (CrashReport) | (null);
|
|
7497
7530
|
/**
|
|
7498
|
-
* The current 'extra' parameters of the crash reporter
|
|
7531
|
+
* The current 'extra' parameters of the crash reporter in the calling process, as
|
|
7532
|
+
* set with the `extra` option and `addExtraParameter`. Parameters set with the
|
|
7533
|
+
* `globalExtra` option are not included.
|
|
7499
7534
|
*/
|
|
7500
7535
|
getParameters(): Record<string, string>;
|
|
7501
7536
|
/**
|
|
7502
|
-
* Returns
|
|
7503
|
-
* ID.
|
|
7537
|
+
* Returns the crash reports stored on disk. Each report contains the date it was
|
|
7538
|
+
* uploaded and the ID that the crash server returned for it.
|
|
7539
|
+
*
|
|
7540
|
+
* Despite the method's name, reports that have not been uploaded (for example
|
|
7541
|
+
* because `uploadToServer` is `false`, the upload failed, or the report was rate
|
|
7542
|
+
* limited) are included too. For those reports, `id` is an empty string and `date`
|
|
7543
|
+
* is not meaningful. To list only uploaded reports, filter out reports with an
|
|
7544
|
+
* empty `id`.
|
|
7504
7545
|
*
|
|
7505
7546
|
* > [!NOTE] This method is only available in the main process.
|
|
7506
7547
|
*/
|
|
@@ -7543,9 +7584,9 @@ declare namespace Electron {
|
|
|
7543
7584
|
*
|
|
7544
7585
|
* > [!NOTE] Parameters passed in `extra`, `globalExtra` or set with
|
|
7545
7586
|
* `addExtraParameter` have limits on the length of the keys and values. Key names
|
|
7546
|
-
* must be at most 39 bytes long, and values must be no longer than
|
|
7547
|
-
* with names longer than the maximum
|
|
7548
|
-
* than the maximum length
|
|
7587
|
+
* must be at most 39 bytes long, and values must be no longer than 20320 bytes.
|
|
7588
|
+
* Keys with names longer than the maximum are ignored, and a warning is emitted.
|
|
7589
|
+
* Values longer than the maximum length are truncated.
|
|
7549
7590
|
*
|
|
7550
7591
|
* > [!NOTE] This method is only available in the main process.
|
|
7551
7592
|
*/
|
|
@@ -18941,7 +18982,8 @@ declare namespace Electron {
|
|
|
18941
18982
|
*/
|
|
18942
18983
|
setUserAgent(userAgent: string): void;
|
|
18943
18984
|
/**
|
|
18944
|
-
* Sets the maximum and minimum pinch-to-zoom level.
|
|
18985
|
+
* Sets the maximum and minimum pinch-to-zoom level. The page keeps its normal
|
|
18986
|
+
* scale until the user pinches; a `minimumLevel` below 1 only allows zooming out.
|
|
18945
18987
|
*
|
|
18946
18988
|
* > [!NOTE] Visual zoom is disabled by default in Electron. To re-enable it, call:
|
|
18947
18989
|
*/
|
|
@@ -18973,14 +19015,15 @@ declare namespace Electron {
|
|
|
18973
19015
|
* Changes the zoom factor to the specified factor. Zoom factor is zoom percent
|
|
18974
19016
|
* divided by 100, so 300% = 3.0.
|
|
18975
19017
|
*
|
|
18976
|
-
* The factor must be greater than 0.0.
|
|
19018
|
+
* The factor must be greater than 0.0. Values outside the range Chromium can
|
|
19019
|
+
* display (0.25 to 5.0) are clamped to it.
|
|
18977
19020
|
*/
|
|
18978
19021
|
setZoomFactor(factor: number): void;
|
|
18979
19022
|
/**
|
|
18980
19023
|
* Changes the zoom level to the specified level. The original size is 0 and each
|
|
18981
|
-
* increment above or below represents zooming 20% larger or smaller
|
|
18982
|
-
*
|
|
18983
|
-
*
|
|
19024
|
+
* increment above or below represents zooming 20% larger or smaller. The formula
|
|
19025
|
+
* for this is `scale := 1.2 ^ level`, and the level is clamped to the range
|
|
19026
|
+
* Chromium can display (25% to 500%, about -7.6 to 8.8).
|
|
18984
19027
|
*
|
|
18985
19028
|
* > [!NOTE] The zoom policy at the Chromium level is same-origin by default,
|
|
18986
19029
|
* meaning that the zoom level for a specific domain propagates across all
|
|
@@ -21819,18 +21862,20 @@ declare namespace Electron {
|
|
|
21819
21862
|
uploadToServer?: boolean;
|
|
21820
21863
|
/**
|
|
21821
21864
|
* If true, crashes generated in the main process will not be forwarded to the
|
|
21822
|
-
* system crash handler. Default is `false`.
|
|
21865
|
+
* system crash handler. This option has no effect on Windows. Default is `false`.
|
|
21866
|
+
*
|
|
21867
|
+
* @platform darwin,linux
|
|
21823
21868
|
*/
|
|
21824
21869
|
ignoreSystemCrashHandler?: boolean;
|
|
21825
21870
|
/**
|
|
21826
|
-
* If true, limit the number of crashes uploaded to 1/hour.
|
|
21827
|
-
*
|
|
21828
|
-
* @platform darwin,win32
|
|
21871
|
+
* If true, limit the number of crashes uploaded to 1/hour. Crash reports over the
|
|
21872
|
+
* limit are not uploaded, but are still stored on disk. Default is `false`.
|
|
21829
21873
|
*/
|
|
21830
21874
|
rateLimit?: boolean;
|
|
21831
21875
|
/**
|
|
21832
21876
|
* If true, crash reports will be compressed and uploaded with `Content-Encoding:
|
|
21833
|
-
* gzip`.
|
|
21877
|
+
* gzip`. Setting this to `false` while `uploadToServer` is `true` is deprecated
|
|
21878
|
+
* and logs a deprecation warning. Default is `true`.
|
|
21834
21879
|
*/
|
|
21835
21880
|
compress?: boolean;
|
|
21836
21881
|
/**
|
|
@@ -21847,7 +21892,8 @@ declare namespace Electron {
|
|
|
21847
21892
|
* crash reporter has been started. If a key is present in both the global extra
|
|
21848
21893
|
* parameters and the process-specific extra parameters, then the global one will
|
|
21849
21894
|
* take precedence. By default, `productName` and the app version are included, as
|
|
21850
|
-
* well as the Electron version.
|
|
21895
|
+
* well as the Electron version. Global extra parameters are not returned by
|
|
21896
|
+
* `getParameters()`.
|
|
21851
21897
|
*/
|
|
21852
21898
|
globalExtra?: Record<string, string>;
|
|
21853
21899
|
}
|
|
@@ -21980,9 +22026,17 @@ declare namespace Electron {
|
|
|
21980
22026
|
reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure' | 'memory-eviction');
|
|
21981
22027
|
/**
|
|
21982
22028
|
* The exit code for the process (e.g. status from waitpid if on POSIX, from
|
|
21983
|
-
* GetExitCodeProcess on Windows)
|
|
22029
|
+
* GetExitCodeProcess on Windows), unless `reason` is `launch-failed`, in which
|
|
22030
|
+
* case `exitCode` will be a platform-specific launch failure error code.
|
|
21984
22031
|
*/
|
|
21985
22032
|
exitCode: number;
|
|
22033
|
+
/**
|
|
22034
|
+
* The Windows system error code (`GetLastError()`) of the failed launch. Only set
|
|
22035
|
+
* when `reason` is `launch-failed`.
|
|
22036
|
+
*
|
|
22037
|
+
* @platform win32
|
|
22038
|
+
*/
|
|
22039
|
+
systemErrorCode?: number;
|
|
21986
22040
|
/**
|
|
21987
22041
|
* The non-localized name of the process.
|
|
21988
22042
|
*/
|
package/dist/version.json
CHANGED