electron-types 45.0.0 → 46.0.0-alpha.2
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 +273 -58
- 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@
|
|
17
|
+
npm install -D electron-types@46.0.0-alpha.2
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@
|
|
19
|
+
yarn add -D electron-types@46.0.0-alpha.2
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@
|
|
21
|
+
pnpm add -D electron-types@46.0.0-alpha.2
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron
|
|
1
|
+
// Type definitions for Electron 46.0.0-alpha.2
|
|
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
|
|
@@ -1114,6 +1114,21 @@ declare namespace Electron {
|
|
|
1114
1114
|
* @platform darwin,win32
|
|
1115
1115
|
*/
|
|
1116
1116
|
addRecentDocument(path: string): void;
|
|
1117
|
+
/**
|
|
1118
|
+
* `true` when the app runs with a full administrator token while UAC is enabled
|
|
1119
|
+
* (for example because it was started with "Run as administrator", from an
|
|
1120
|
+
* elevated installer or from an elevated shell), so that a filtered, non-elevated
|
|
1121
|
+
* token exists to relaunch with. It is `false` when the app is not elevated, for
|
|
1122
|
+
* the built-in Administrator account, and when UAC is turned off.
|
|
1123
|
+
*
|
|
1124
|
+
* Chromium's sandbox cannot always launch child processes from an elevated browser
|
|
1125
|
+
* process, and code that was not written to run elevated should not. An app that
|
|
1126
|
+
* does not need elevation can restart itself with the user's normal token before
|
|
1127
|
+
* doing anything else:
|
|
1128
|
+
*
|
|
1129
|
+
* @platform win32
|
|
1130
|
+
*/
|
|
1131
|
+
canDeElevate(): boolean;
|
|
1117
1132
|
/**
|
|
1118
1133
|
* Clears the recent documents list.
|
|
1119
1134
|
*
|
|
@@ -5932,7 +5947,10 @@ declare namespace Electron {
|
|
|
5932
5947
|
* whole visible page. If the page is not visible, `rect` may be empty. The page is
|
|
5933
5948
|
* considered visible when its browser window is hidden and the capturer count is
|
|
5934
5949
|
* non-zero. If you would like the page to stay hidden, you should ensure that
|
|
5935
|
-
* `stayHidden` is set to true.
|
|
5950
|
+
* `stayHidden` is set to true. The image has the page's device scale factor (for
|
|
5951
|
+
* offscreen rendering, `webPreferences.offscreen.deviceScaleFactor`), so
|
|
5952
|
+
* `image.getSize()` is in DIPs and `image.toBitmap()` holds the full-resolution
|
|
5953
|
+
* pixels.
|
|
5936
5954
|
*/
|
|
5937
5955
|
capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
|
|
5938
5956
|
/**
|
|
@@ -8135,6 +8153,20 @@ declare namespace Electron {
|
|
|
8135
8153
|
|
|
8136
8154
|
// Docs: https://electronjs.org/docs/api/desktop-capturer
|
|
8137
8155
|
|
|
8156
|
+
/**
|
|
8157
|
+
* The current restore token for the source, or an empty string if it has none.
|
|
8158
|
+
*
|
|
8159
|
+
* The system may replace the token each time the source is opened, which happens
|
|
8160
|
+
* once in `desktopCapturer.getSources` and again when a stream is started from the
|
|
8161
|
+
* source, and then only the newest token works on the next launch. Read it with
|
|
8162
|
+
* this method once the stream is running, or before the app quits, and store that
|
|
8163
|
+
* value rather than the one `getSources` returned. See Restoring a source on
|
|
8164
|
+
* Wayland.
|
|
8165
|
+
*
|
|
8166
|
+
* @experimental
|
|
8167
|
+
* @platform linux
|
|
8168
|
+
*/
|
|
8169
|
+
getRestoreToken(sourceId: string): string;
|
|
8138
8170
|
/**
|
|
8139
8171
|
* Resolves with an array of `DesktopCapturerSource` objects, each
|
|
8140
8172
|
* `DesktopCapturerSource` represents a screen or an individual window that can be
|
|
@@ -8180,6 +8212,15 @@ declare namespace Electron {
|
|
|
8180
8212
|
* the name of a window source will match the window title.
|
|
8181
8213
|
*/
|
|
8182
8214
|
name: string;
|
|
8215
|
+
/**
|
|
8216
|
+
* A token that lets a later `desktopCapturer.getSources` call reopen this source
|
|
8217
|
+
* without showing the system picker, or an empty string if the system did not
|
|
8218
|
+
* issue one. See Restoring a source on Wayland.
|
|
8219
|
+
*
|
|
8220
|
+
* @experimental
|
|
8221
|
+
* @platform linux
|
|
8222
|
+
*/
|
|
8223
|
+
restoreToken: string;
|
|
8183
8224
|
/**
|
|
8184
8225
|
* A thumbnail image. **Note:** There is no guarantee that the size of the
|
|
8185
8226
|
* thumbnail is the same as the `thumbnailSize` specified in the `options` passed
|
|
@@ -9006,10 +9047,85 @@ declare namespace Electron {
|
|
|
9006
9047
|
isDirectory?: boolean;
|
|
9007
9048
|
}
|
|
9008
9049
|
|
|
9009
|
-
interface GlobalShortcut {
|
|
9050
|
+
interface GlobalShortcut extends NodeJS.EventEmitter {
|
|
9010
9051
|
|
|
9011
9052
|
// Docs: https://electronjs.org/docs/api/global-shortcut
|
|
9012
9053
|
|
|
9054
|
+
/**
|
|
9055
|
+
* Emitted on Linux Wayland when the `org.freedesktop.portal.GlobalShortcuts`
|
|
9056
|
+
* portal resolves a registration request. The bind on this path is asynchronous
|
|
9057
|
+
* and consent-gated, so the boolean returned by `register()` only refers to if the
|
|
9058
|
+
* request was successfully submitted; this event reports the real outcome. `bound`
|
|
9059
|
+
* is `false` when the portal denied the bind (for example an invalid app identity
|
|
9060
|
+
* — see `app.setDesktopName()` — or a dismissed consent dialog) or the portal is
|
|
9061
|
+
* unavailable.
|
|
9062
|
+
*
|
|
9063
|
+
* The event is always emitted asynchronously, and may be emitted more than once
|
|
9064
|
+
* for the same accelerator: registering an additional shortcut re-binds the whole
|
|
9065
|
+
* set, which re-resolves previously bound accelerators.
|
|
9066
|
+
*
|
|
9067
|
+
* This event is not emitted on X11 or on other platforms, where the return value
|
|
9068
|
+
* of `register()` is already authoritative.
|
|
9069
|
+
*
|
|
9070
|
+
* @platform linux
|
|
9071
|
+
*/
|
|
9072
|
+
on(event: 'registration-resolved', listener: (
|
|
9073
|
+
/**
|
|
9074
|
+
* The accelerator, as it was passed to `register()`.
|
|
9075
|
+
*/
|
|
9076
|
+
accelerator: string,
|
|
9077
|
+
/**
|
|
9078
|
+
* Whether the portal accepted the bind request.
|
|
9079
|
+
*/
|
|
9080
|
+
bound: boolean) => void): this;
|
|
9081
|
+
/**
|
|
9082
|
+
* @platform linux
|
|
9083
|
+
*/
|
|
9084
|
+
off(event: 'registration-resolved', listener: (
|
|
9085
|
+
/**
|
|
9086
|
+
* The accelerator, as it was passed to `register()`.
|
|
9087
|
+
*/
|
|
9088
|
+
accelerator: string,
|
|
9089
|
+
/**
|
|
9090
|
+
* Whether the portal accepted the bind request.
|
|
9091
|
+
*/
|
|
9092
|
+
bound: boolean) => void): this;
|
|
9093
|
+
/**
|
|
9094
|
+
* @platform linux
|
|
9095
|
+
*/
|
|
9096
|
+
once(event: 'registration-resolved', listener: (
|
|
9097
|
+
/**
|
|
9098
|
+
* The accelerator, as it was passed to `register()`.
|
|
9099
|
+
*/
|
|
9100
|
+
accelerator: string,
|
|
9101
|
+
/**
|
|
9102
|
+
* Whether the portal accepted the bind request.
|
|
9103
|
+
*/
|
|
9104
|
+
bound: boolean) => void): this;
|
|
9105
|
+
/**
|
|
9106
|
+
* @platform linux
|
|
9107
|
+
*/
|
|
9108
|
+
addListener(event: 'registration-resolved', listener: (
|
|
9109
|
+
/**
|
|
9110
|
+
* The accelerator, as it was passed to `register()`.
|
|
9111
|
+
*/
|
|
9112
|
+
accelerator: string,
|
|
9113
|
+
/**
|
|
9114
|
+
* Whether the portal accepted the bind request.
|
|
9115
|
+
*/
|
|
9116
|
+
bound: boolean) => void): this;
|
|
9117
|
+
/**
|
|
9118
|
+
* @platform linux
|
|
9119
|
+
*/
|
|
9120
|
+
removeListener(event: 'registration-resolved', listener: (
|
|
9121
|
+
/**
|
|
9122
|
+
* The accelerator, as it was passed to `register()`.
|
|
9123
|
+
*/
|
|
9124
|
+
accelerator: string,
|
|
9125
|
+
/**
|
|
9126
|
+
* Whether the portal accepted the bind request.
|
|
9127
|
+
*/
|
|
9128
|
+
bound: boolean) => void): this;
|
|
9013
9129
|
/**
|
|
9014
9130
|
* Whether this application has registered `accelerator`.
|
|
9015
9131
|
*
|
|
@@ -9032,6 +9148,10 @@ declare namespace Electron {
|
|
|
9032
9148
|
* silently fail. This behavior is intended by operating systems, since they don't
|
|
9033
9149
|
* want applications to fight for global shortcuts.
|
|
9034
9150
|
*
|
|
9151
|
+
* On Linux Wayland, the return value only indicates that the bind request was
|
|
9152
|
+
* submitted to the desktop portal; the portal resolves it asynchronously and the
|
|
9153
|
+
* actual outcome is reported by the `registration-resolved` event.
|
|
9154
|
+
*
|
|
9035
9155
|
* The following accelerators will not be registered successfully on macOS 10.14
|
|
9036
9156
|
* Mojave unless the app has been authorized as a trusted accessibility client:
|
|
9037
9157
|
*
|
|
@@ -11855,6 +11975,14 @@ declare namespace Electron {
|
|
|
11855
11975
|
|
|
11856
11976
|
// Docs: https://electronjs.org/docs/api/structures/preload-script
|
|
11857
11977
|
|
|
11978
|
+
/**
|
|
11979
|
+
* Glob patterns for URLs the script will not run in.
|
|
11980
|
+
*/
|
|
11981
|
+
excludeGlobs?: string[];
|
|
11982
|
+
/**
|
|
11983
|
+
* Match patterns for URLs the script will not run in.
|
|
11984
|
+
*/
|
|
11985
|
+
excludeMatches?: string[];
|
|
11858
11986
|
/**
|
|
11859
11987
|
* Path of the script file. Must be an absolute path.
|
|
11860
11988
|
*/
|
|
@@ -11863,6 +11991,29 @@ declare namespace Electron {
|
|
|
11863
11991
|
* Unique ID of preload script.
|
|
11864
11992
|
*/
|
|
11865
11993
|
id: string;
|
|
11994
|
+
/**
|
|
11995
|
+
* Glob patterns applied after `matches`. A URL must also match one of these globs.
|
|
11996
|
+
* `*` matches any sequence of characters and `?` matches any single character.
|
|
11997
|
+
*/
|
|
11998
|
+
includeGlobs?: string[];
|
|
11999
|
+
/**
|
|
12000
|
+
* Match patterns for URLs the script runs in. A custom protocol can be used if its
|
|
12001
|
+
* scheme is registered as `standard` with `protocol.registerSchemesAsPrivileged`.
|
|
12002
|
+
* To filter documents served from a non-standard scheme, use `includeGlobs` or
|
|
12003
|
+
* `excludeGlobs`, which match against the whole URL. If omitted, the script runs
|
|
12004
|
+
* for all URLs not excluded by other filters.
|
|
12005
|
+
*/
|
|
12006
|
+
matches?: string[];
|
|
12007
|
+
/**
|
|
12008
|
+
* Whether a document whose URL has no origin of its own (`about:`, `blob:`,
|
|
12009
|
+
* `data:` or `filesystem:`) is matched by the origin of the frame that created it
|
|
12010
|
+
* instead of by its URL. This includes documents with an opaque origin, such as a
|
|
12011
|
+
* `data:` frame or a sandboxed `<iframe srcdoc>`. For example, an `about:blank`
|
|
12012
|
+
* popup opened by `https://example.com/page` is matched as `https://example.com/`.
|
|
12013
|
+
* When set, every pattern in `matches` must have a path of `/*`. Only applies to
|
|
12014
|
+
* `frame` contexts. Default is `false`.
|
|
12015
|
+
*/
|
|
12016
|
+
matchOriginAsFallback?: boolean;
|
|
11866
12017
|
/**
|
|
11867
12018
|
* Context type where the preload script will be executed. Possible values include
|
|
11868
12019
|
* `frame` or `service-worker`.
|
|
@@ -11874,6 +12025,14 @@ declare namespace Electron {
|
|
|
11874
12025
|
|
|
11875
12026
|
// Docs: https://electronjs.org/docs/api/structures/preload-script-registration
|
|
11876
12027
|
|
|
12028
|
+
/**
|
|
12029
|
+
* Glob patterns for URLs the script will not run in.
|
|
12030
|
+
*/
|
|
12031
|
+
excludeGlobs?: string[];
|
|
12032
|
+
/**
|
|
12033
|
+
* Match patterns for URLs the script will not run in.
|
|
12034
|
+
*/
|
|
12035
|
+
excludeMatches?: string[];
|
|
11877
12036
|
/**
|
|
11878
12037
|
* Path of the script file. Must be an absolute path.
|
|
11879
12038
|
*/
|
|
@@ -11882,6 +12041,30 @@ declare namespace Electron {
|
|
|
11882
12041
|
* Unique ID of preload script. Defaults to a random UUID.
|
|
11883
12042
|
*/
|
|
11884
12043
|
id?: string;
|
|
12044
|
+
/**
|
|
12045
|
+
* Glob patterns applied after `matches`. A URL must also match one of these globs.
|
|
12046
|
+
* `*` matches any sequence of characters and `?` matches any single character.
|
|
12047
|
+
* Must not be empty.
|
|
12048
|
+
*/
|
|
12049
|
+
includeGlobs?: string[];
|
|
12050
|
+
/**
|
|
12051
|
+
* Match patterns for URLs the script runs in. A custom protocol can be used if its
|
|
12052
|
+
* scheme is registered as `standard` with `protocol.registerSchemesAsPrivileged`.
|
|
12053
|
+
* To filter documents served from a non-standard scheme, use `includeGlobs` or
|
|
12054
|
+
* `excludeGlobs`, which match against the whole URL. If omitted, the script runs
|
|
12055
|
+
* for all URLs not excluded by other filters. Must not be empty.
|
|
12056
|
+
*/
|
|
12057
|
+
matches?: string[];
|
|
12058
|
+
/**
|
|
12059
|
+
* Whether a document whose URL has no origin of its own (`about:`, `blob:`,
|
|
12060
|
+
* `data:` or `filesystem:`) is matched by the origin of the frame that created it
|
|
12061
|
+
* instead of by its URL. This includes documents with an opaque origin, such as a
|
|
12062
|
+
* `data:` frame or a sandboxed `<iframe srcdoc>`. For example, an `about:blank`
|
|
12063
|
+
* popup opened by `https://example.com/page` is matched as `https://example.com/`.
|
|
12064
|
+
* When set, every pattern in `matches` must have a path of `/*`. Only applies to
|
|
12065
|
+
* `frame` contexts. Default is `false`.
|
|
12066
|
+
*/
|
|
12067
|
+
matchOriginAsFallback?: boolean;
|
|
11885
12068
|
/**
|
|
11886
12069
|
* Context type where the preload script will be executed. Possible values include
|
|
11887
12070
|
* `frame` or `service-worker`.
|
|
@@ -12706,17 +12889,6 @@ declare namespace Electron {
|
|
|
12706
12889
|
|
|
12707
12890
|
// Docs: https://electronjs.org/docs/api/safe-storage
|
|
12708
12891
|
|
|
12709
|
-
/**
|
|
12710
|
-
* the decrypted string. Decrypts the encrypted buffer obtained with
|
|
12711
|
-
* `safeStorage.encryptString` back into a string.
|
|
12712
|
-
*
|
|
12713
|
-
* **Deprecated:** Use `safeStorage.decryptStringAsync(encrypted)` instead. Data
|
|
12714
|
-
* encrypted with `safeStorage.encryptString` can be decrypted with
|
|
12715
|
-
* `safeStorage.decryptStringAsync`.
|
|
12716
|
-
*
|
|
12717
|
-
* @deprecated
|
|
12718
|
-
*/
|
|
12719
|
-
decryptString(encrypted: Buffer): string;
|
|
12720
12892
|
/**
|
|
12721
12893
|
* Resolve with an object containing the following:
|
|
12722
12894
|
*
|
|
@@ -12727,16 +12899,6 @@ declare namespace Electron {
|
|
|
12727
12899
|
* * `result` string - the decrypted string.
|
|
12728
12900
|
*/
|
|
12729
12901
|
decryptStringAsync(encrypted: Buffer): Promise<Electron.DecryptStringAsyncReturnValue>;
|
|
12730
|
-
/**
|
|
12731
|
-
* An array of bytes representing the encrypted string.
|
|
12732
|
-
*
|
|
12733
|
-
* This function will throw an error if encryption fails.
|
|
12734
|
-
*
|
|
12735
|
-
* **Deprecated:** Use `safeStorage.encryptStringAsync(plainText)` instead.
|
|
12736
|
-
*
|
|
12737
|
-
* @deprecated
|
|
12738
|
-
*/
|
|
12739
|
-
encryptString(plainText: string): Buffer;
|
|
12740
12902
|
/**
|
|
12741
12903
|
* An array of bytes representing the encrypted string.
|
|
12742
12904
|
*/
|
|
@@ -12772,18 +12934,6 @@ declare namespace Electron {
|
|
|
12772
12934
|
* The returned promise resolves once initialization completes.
|
|
12773
12935
|
*/
|
|
12774
12936
|
isAsyncEncryptionAvailable(): Promise<boolean>;
|
|
12775
|
-
/**
|
|
12776
|
-
* Whether encryption is available.
|
|
12777
|
-
*
|
|
12778
|
-
* On Linux, returns true if the app has emitted the `ready` event and the secret
|
|
12779
|
-
* key is available. On MacOS, returns true if Keychain is available. On Windows,
|
|
12780
|
-
* returns true once the app has emitted the `ready` event.
|
|
12781
|
-
*
|
|
12782
|
-
* **Deprecated:** Use `safeStorage.isAsyncEncryptionAvailable()` instead.
|
|
12783
|
-
*
|
|
12784
|
-
* @deprecated
|
|
12785
|
-
*/
|
|
12786
|
-
isEncryptionAvailable(): boolean;
|
|
12787
12937
|
/**
|
|
12788
12938
|
* This function on Linux will force the module to use an in memory password for
|
|
12789
12939
|
* creating symmetric key that is used for encrypt/decrypt functions when a valid
|
|
@@ -14112,7 +14262,33 @@ declare namespace Electron {
|
|
|
14112
14262
|
/**
|
|
14113
14263
|
* Registers preload script that will be executed in its associated context type in
|
|
14114
14264
|
* this session. For `frame` contexts, this will run prior to any preload defined
|
|
14115
|
-
* in the web preferences of a WebContents.
|
|
14265
|
+
* in the web preferences of a WebContents. In-page navigations do not rerun the
|
|
14266
|
+
* preload script.
|
|
14267
|
+
*
|
|
14268
|
+
* URL filters can limit which documents or service workers a script runs in. They
|
|
14269
|
+
* behave like content script URL matching. A script runs for a URL that meets all
|
|
14270
|
+
* of these conditions:
|
|
14271
|
+
*
|
|
14272
|
+
* * It matches at least one pattern in `matches`, if set.
|
|
14273
|
+
* * It matches at least one glob in `includeGlobs`, if set.
|
|
14274
|
+
* * It does not match any pattern in `excludeMatches`.
|
|
14275
|
+
* * It does not match any glob in `excludeGlobs`.
|
|
14276
|
+
*
|
|
14277
|
+
* The URL that the filters are matched against depends on the context type:
|
|
14278
|
+
*
|
|
14279
|
+
* * For `service-worker` contexts, it is the service worker's scope.
|
|
14280
|
+
* * For `frame` contexts, it is the URL of the document being loaded, with these
|
|
14281
|
+
* special cases:
|
|
14282
|
+
* * The initial empty document of a frame or popup is matched as `about:blank`.
|
|
14283
|
+
* Set `matchOriginAsFallback` to match such documents by the origin of the frame
|
|
14284
|
+
* that created them instead, for example to keep a script out of the `about:blank`
|
|
14285
|
+
* popups of an excluded site.
|
|
14286
|
+
* * A `data:` URL loaded with `baseURLForDataURL` is matched by its base URL.
|
|
14287
|
+
* * The error page of a failed navigation is matched by the URL that failed to
|
|
14288
|
+
* load.
|
|
14289
|
+
*
|
|
14290
|
+
* Throws an error if any of the URL patterns are invalid, or if `matches` or
|
|
14291
|
+
* `includeGlobs` is an empty array.
|
|
14116
14292
|
*
|
|
14117
14293
|
* The ID of the registered preload script.
|
|
14118
14294
|
*/
|
|
@@ -16778,9 +16954,12 @@ declare namespace Electron {
|
|
|
16778
16954
|
addListener(event: 'spawn', listener: () => void): this;
|
|
16779
16955
|
removeListener(event: 'spawn', listener: () => void): this;
|
|
16780
16956
|
/**
|
|
16781
|
-
* Terminates the process gracefully. On POSIX, it
|
|
16782
|
-
*
|
|
16783
|
-
*
|
|
16957
|
+
* Terminates the process gracefully. On POSIX, it sends `SIGTERM`; on Windows, it
|
|
16958
|
+
* terminates the process. Like Node's `child_process.kill()`, this delivers the
|
|
16959
|
+
* signal but does not guarantee that the process exits: a child that handles
|
|
16960
|
+
* `SIGTERM` decides when, or whether, to exit. On POSIX, the child is reaped by
|
|
16961
|
+
* Electron once it exits. Returns `true` if the signal was delivered, and `false`
|
|
16962
|
+
* otherwise.
|
|
16784
16963
|
*/
|
|
16785
16964
|
kill(): boolean;
|
|
16786
16965
|
/**
|
|
@@ -18220,7 +18399,8 @@ declare namespace Electron {
|
|
|
18220
18399
|
explicitSet: boolean) => void): this;
|
|
18221
18400
|
/**
|
|
18222
18401
|
* Emitted when a new frame is generated. Only the dirty area is passed in the
|
|
18223
|
-
* buffer.
|
|
18402
|
+
* buffer. `image` has the view's device scale factor, so `image.getSize()` is in
|
|
18403
|
+
* DIPs, while `dirtyRect` is in the pixels of `image.toBitmap()`.
|
|
18224
18404
|
*
|
|
18225
18405
|
* When using shared texture (set `webPreferences.offscreen.useSharedTexture` to
|
|
18226
18406
|
* `true`) feature, you can pass the texture handle to external rendering pipeline
|
|
@@ -18816,7 +18996,9 @@ declare namespace Electron {
|
|
|
18816
18996
|
* will be called with `callback(image, dirtyRect)` when there is a presentation
|
|
18817
18997
|
* event.
|
|
18818
18998
|
*
|
|
18819
|
-
* The `image` is an instance of NativeImage that stores the captured frame.
|
|
18999
|
+
* The `image` is an instance of NativeImage that stores the captured frame. It has
|
|
19000
|
+
* the page's device scale factor, so `image.getSize()` is in DIPs, while
|
|
19001
|
+
* `dirtyRect` is in the pixels of `image.toBitmap()`.
|
|
18820
19002
|
*
|
|
18821
19003
|
* The `dirtyRect` is an object with `x, y, width, height` properties that
|
|
18822
19004
|
* describes which part of the page was repainted. If `onlyDirty` is set to `true`,
|
|
@@ -18828,7 +19010,9 @@ declare namespace Electron {
|
|
|
18828
19010
|
* will be called with `callback(image, dirtyRect)` when there is a presentation
|
|
18829
19011
|
* event.
|
|
18830
19012
|
*
|
|
18831
|
-
* The `image` is an instance of NativeImage that stores the captured frame.
|
|
19013
|
+
* The `image` is an instance of NativeImage that stores the captured frame. It has
|
|
19014
|
+
* the page's device scale factor, so `image.getSize()` is in DIPs, while
|
|
19015
|
+
* `dirtyRect` is in the pixels of `image.toBitmap()`.
|
|
18832
19016
|
*
|
|
18833
19017
|
* The `dirtyRect` is an object with `x, y, width, height` properties that
|
|
18834
19018
|
* describes which part of the page was repainted. If `onlyDirty` is set to `true`,
|
|
@@ -18867,7 +19051,10 @@ declare namespace Electron {
|
|
|
18867
19051
|
* Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
|
18868
19052
|
* whole visible page. The page is considered visible when its browser window is
|
|
18869
19053
|
* hidden and the capturer count is non-zero. If you would like the page to stay
|
|
18870
|
-
* hidden, you should ensure that `stayHidden` is set to true.
|
|
19054
|
+
* hidden, you should ensure that `stayHidden` is set to true. The image has the
|
|
19055
|
+
* page's device scale factor (for offscreen rendering,
|
|
19056
|
+
* `webPreferences.offscreen.deviceScaleFactor`), so `image.getSize()` is in DIPs
|
|
19057
|
+
* and `image.toBitmap()` holds the full-resolution pixels.
|
|
18871
19058
|
*/
|
|
18872
19059
|
capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
|
|
18873
19060
|
/**
|
|
@@ -20094,9 +20281,9 @@ declare namespace Electron {
|
|
|
20094
20281
|
send(channel: string, ...args: any[]): void;
|
|
20095
20282
|
/**
|
|
20096
20283
|
* A `Boolean` representing whether the frame is detached from the frame tree. If a
|
|
20097
|
-
* frame is accessed while the corresponding page is running any
|
|
20098
|
-
* it may become detached as the newly navigated page replaced
|
|
20099
|
-
* tree.
|
|
20284
|
+
* frame is accessed while the corresponding page is running any `pagehide` or
|
|
20285
|
+
* `unload` listeners, it may become detached as the newly navigated page replaced
|
|
20286
|
+
* it in the frame tree.
|
|
20100
20287
|
*
|
|
20101
20288
|
*/
|
|
20102
20289
|
readonly detached: boolean;
|
|
@@ -20321,10 +20508,6 @@ declare namespace Electron {
|
|
|
20321
20508
|
* `WebContents` when the preferred size changes. Default is `false`.
|
|
20322
20509
|
*/
|
|
20323
20510
|
enablePreferredSizeMode?: boolean;
|
|
20324
|
-
/**
|
|
20325
|
-
* Whether to enable the WebSQL api. Default is `true`.
|
|
20326
|
-
*/
|
|
20327
|
-
enableWebSQL?: boolean;
|
|
20328
20511
|
/**
|
|
20329
20512
|
* Enables Chromium's experimental features. Default is `false`.
|
|
20330
20513
|
*/
|
|
@@ -21037,7 +21220,9 @@ declare namespace Electron {
|
|
|
21037
21220
|
* Resolves with a NativeImage
|
|
21038
21221
|
*
|
|
21039
21222
|
* Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
|
21040
|
-
* whole visible page.
|
|
21223
|
+
* whole visible page. The image has the page's device scale factor (for offscreen
|
|
21224
|
+
* rendering, `webPreferences.offscreen.deviceScaleFactor`), so `image.getSize()`
|
|
21225
|
+
* is in DIPs and `image.toBitmap()` holds the full-resolution pixels.
|
|
21041
21226
|
*/
|
|
21042
21227
|
capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
|
|
21043
21228
|
/**
|
|
@@ -21361,7 +21546,7 @@ declare namespace Electron {
|
|
|
21361
21546
|
*/
|
|
21362
21547
|
nodeintegration: boolean;
|
|
21363
21548
|
/**
|
|
21364
|
-
* A `boolean` for the experimental option for enabling
|
|
21549
|
+
* A `boolean` for the experimental option for enabling Node.js support in
|
|
21365
21550
|
* sub-frames such as iframes inside the `webview`. All your preloads will load for
|
|
21366
21551
|
* every iframe, you can use `process.isMainFrame` to determine if you are in the
|
|
21367
21552
|
* main frame or not. This option is disabled by default in the guest page.
|
|
@@ -21425,10 +21610,9 @@ declare namespace Electron {
|
|
|
21425
21610
|
*
|
|
21426
21611
|
* Security-critical preferences cannot be used to make the guest less secure than
|
|
21427
21612
|
* its embedder. When the embedder has any of `contextIsolation`, `javascript`,
|
|
21428
|
-
* `nodeIntegration`, `nodeIntegrationInWorker`, `sandbox
|
|
21429
|
-
* `nodeIntegrationInSubFrames`
|
|
21430
|
-
*
|
|
21431
|
-
* ignored.
|
|
21613
|
+
* `nodeIntegration`, `nodeIntegrationInWorker`, `sandbox` or
|
|
21614
|
+
* `nodeIntegrationInSubFrames` set to its more secure value, the guest inherits
|
|
21615
|
+
* that value and the corresponding `webpreferences` entry is ignored.
|
|
21432
21616
|
*/
|
|
21433
21617
|
webpreferences: string;
|
|
21434
21618
|
}
|
|
@@ -21773,7 +21957,7 @@ declare namespace Electron {
|
|
|
21773
21957
|
* can potentially include data types not explicitly listed here. (See Chromium's
|
|
21774
21958
|
* `BrowsingDataRemover` for the full list.)
|
|
21775
21959
|
*/
|
|
21776
|
-
dataTypes?: Array<'backgroundFetch' | 'cache' | 'cookies' | 'downloads' | 'fileSystems' | 'indexedDB' | 'localStorage' | 'serviceWorkers'
|
|
21960
|
+
dataTypes?: Array<'backgroundFetch' | 'cache' | 'cookies' | 'downloads' | 'fileSystems' | 'indexedDB' | 'localStorage' | 'serviceWorkers'>;
|
|
21777
21961
|
/**
|
|
21778
21962
|
* Clear data for only these origins. Cannot be used with `excludeOrigins`.
|
|
21779
21963
|
*/
|
|
@@ -24439,6 +24623,13 @@ declare namespace Electron {
|
|
|
24439
24623
|
interface RelaunchOptions {
|
|
24440
24624
|
args?: string[];
|
|
24441
24625
|
execPath?: string;
|
|
24626
|
+
/**
|
|
24627
|
+
* Start the new instance with the user's normal token instead of the current
|
|
24628
|
+
* elevated one. See `app.canDeElevate()`.
|
|
24629
|
+
*
|
|
24630
|
+
* @platform win32
|
|
24631
|
+
*/
|
|
24632
|
+
deElevate?: boolean;
|
|
24442
24633
|
}
|
|
24443
24634
|
|
|
24444
24635
|
interface RenderProcessGoneEvent extends DOMEvent {
|
|
@@ -24871,6 +25062,30 @@ declare namespace Electron {
|
|
|
24871
25062
|
* type screen.
|
|
24872
25063
|
*/
|
|
24873
25064
|
fetchWindowIcons?: boolean;
|
|
25065
|
+
/**
|
|
25066
|
+
* Can be `transient` or `persistent`. How long the source the user picks in the
|
|
25067
|
+
* system picker can be reopened without showing the picker again. `transient`, the
|
|
25068
|
+
* default, lasts at most until the app exits. `persistent` lasts across launches
|
|
25069
|
+
* until the user revokes it; store the returned source's `restoreToken` to use it
|
|
25070
|
+
* on a later launch. See Restoring a source on Wayland.
|
|
25071
|
+
*
|
|
25072
|
+
* @experimental
|
|
25073
|
+
* @platform linux
|
|
25074
|
+
*/
|
|
25075
|
+
persistMode?: ('transient' | 'persistent');
|
|
25076
|
+
/**
|
|
25077
|
+
* A `restoreToken` from an earlier call; `persistMode` must be passed with it. If
|
|
25078
|
+
* the system still honors the token, the promise resolves with that source and no
|
|
25079
|
+
* picker is shown. A token that was revoked or names a source that no longer
|
|
25080
|
+
* exists is ignored and the picker is shown as if no token was passed; a value
|
|
25081
|
+
* that is not a token the system issued makes the promise reject. Pass
|
|
25082
|
+
* `persistMode: 'persistent'` with a persistent token every time: restoring it as
|
|
25083
|
+
* `transient` ends the persistent grant.
|
|
25084
|
+
*
|
|
25085
|
+
* @experimental
|
|
25086
|
+
* @platform linux
|
|
25087
|
+
*/
|
|
25088
|
+
restoreToken?: string;
|
|
24874
25089
|
}
|
|
24875
25090
|
|
|
24876
25091
|
interface StartAppShimServerOptions {
|
package/dist/version.json
CHANGED