electron-types 45.0.0-alpha.1 → 45.0.0-alpha.10
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 +210 -87
- 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.10
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@45.0.0-alpha.
|
|
19
|
+
yarn add -D electron-types@45.0.0-alpha.10
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@45.0.0-alpha.
|
|
21
|
+
pnpm add -D electron-types@45.0.0-alpha.10
|
|
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.10
|
|
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
|
|
@@ -1220,6 +1220,12 @@ declare namespace Electron {
|
|
|
1220
1220
|
/**
|
|
1221
1221
|
* Array of `ProcessMetric` objects that correspond to memory and CPU usage
|
|
1222
1222
|
* statistics of all the processes associated with the app.
|
|
1223
|
+
*
|
|
1224
|
+
* > [!NOTE] `cpu.percentCPUUsage` and `cpu.idleWakeupsPerSecond` are averages over
|
|
1225
|
+
* the time since the last call to `app.getAppMetrics()`, and each call starts a
|
|
1226
|
+
* new measurement interval for every process at once. Other code in the main
|
|
1227
|
+
* process, including dependencies, shares those intervals. See `CPUUsage` for more
|
|
1228
|
+
* details.
|
|
1223
1229
|
*/
|
|
1224
1230
|
getAppMetrics(): ProcessMetric[];
|
|
1225
1231
|
/**
|
|
@@ -3011,6 +3017,10 @@ declare namespace Electron {
|
|
|
3011
3017
|
isContentProtected(): boolean;
|
|
3012
3018
|
/**
|
|
3013
3019
|
* Whether the window is destroyed.
|
|
3020
|
+
*
|
|
3021
|
+
* > [!NOTE] Once a window is destroyed, accessing most of its other properties and
|
|
3022
|
+
* methods throws `Object has been destroyed`, so callbacks that may run after the
|
|
3023
|
+
* window is gone should guard with `isDestroyed()`.
|
|
3014
3024
|
*/
|
|
3015
3025
|
isDestroyed(): boolean;
|
|
3016
3026
|
/**
|
|
@@ -6712,6 +6722,9 @@ declare namespace Electron {
|
|
|
6712
6722
|
*
|
|
6713
6723
|
* See the `webContents` documentation for its methods and events.
|
|
6714
6724
|
*
|
|
6725
|
+
* > [!NOTE] Reading this property throws `Object has been destroyed` once the
|
|
6726
|
+
* window has been destroyed; see `win.isDestroyed()`.
|
|
6727
|
+
*
|
|
6715
6728
|
*/
|
|
6716
6729
|
readonly webContents: WebContents;
|
|
6717
6730
|
}
|
|
@@ -7196,36 +7209,6 @@ declare namespace Electron {
|
|
|
7196
7209
|
|
|
7197
7210
|
// Docs: https://electronjs.org/docs/api/content-tracing
|
|
7198
7211
|
|
|
7199
|
-
/**
|
|
7200
|
-
* Resolves once heap profiling has been enabled.
|
|
7201
|
-
*
|
|
7202
|
-
* Enable heap profiling for MemoryInfra traces. Equivalent to the `--memlog`
|
|
7203
|
-
* switch in Chrome.
|
|
7204
|
-
*
|
|
7205
|
-
* Only takes effect if the `disabled-by-default-memory-infra` category is
|
|
7206
|
-
* included.
|
|
7207
|
-
*
|
|
7208
|
-
* Needs to be called before `contentTracing.startRecording()`.
|
|
7209
|
-
*
|
|
7210
|
-
* Usage:
|
|
7211
|
-
*
|
|
7212
|
-
* To view the recorded heap dumps:
|
|
7213
|
-
*
|
|
7214
|
-
* * Download the breakpad symbols for your Electron version from the Electron
|
|
7215
|
-
* GitHub releases
|
|
7216
|
-
* * Clone the Electron source code
|
|
7217
|
-
* * In your Chromium checkout for Electron, run this command to symbolicate the
|
|
7218
|
-
* heap dump:
|
|
7219
|
-
* * Open the symbolicated trace in `chrome://tracing` (the Perfetto UI does not
|
|
7220
|
-
* support memory dumps yet)
|
|
7221
|
-
* * Click on one of the `M` symbols
|
|
7222
|
-
* * Click on a `☰` triple bar icon (e.g., in the `malloc` column)
|
|
7223
|
-
*
|
|
7224
|
-
* [Image: Screenshot showing how to view a heapdump in Chromium's tracing view]
|
|
7225
|
-
*
|
|
7226
|
-
* @experimental
|
|
7227
|
-
*/
|
|
7228
|
-
enableHeapProfiling(options?: EnableHeapProfilingOptions): Promise<void>;
|
|
7229
7212
|
/**
|
|
7230
7213
|
* resolves with an array of category groups once all child processes have
|
|
7231
7214
|
* acknowledged the `getCategories` request
|
|
@@ -7460,12 +7443,14 @@ declare namespace Electron {
|
|
|
7460
7443
|
*/
|
|
7461
7444
|
cumulativeCPUUsage?: number;
|
|
7462
7445
|
/**
|
|
7463
|
-
* The number of average idle CPU wakeups per second since the last call to
|
|
7464
|
-
*
|
|
7446
|
+
* The number of average idle CPU wakeups per second since the last call to the API
|
|
7447
|
+
* that returned this object. First call returns 0. Will always return 0 on
|
|
7448
|
+
* Windows.
|
|
7465
7449
|
*/
|
|
7466
7450
|
idleWakeupsPerSecond: number;
|
|
7467
7451
|
/**
|
|
7468
|
-
* Percentage of CPU used since the last call to
|
|
7452
|
+
* Percentage of CPU used since the last call to the API that returned this object.
|
|
7453
|
+
* First call returns 0.
|
|
7469
7454
|
*/
|
|
7470
7455
|
percentCPUUsage: number;
|
|
7471
7456
|
}
|
|
@@ -7707,6 +7692,14 @@ declare namespace Electron {
|
|
|
7707
7692
|
* indicating the failure of the command.
|
|
7708
7693
|
*
|
|
7709
7694
|
* Send given command to the debugging target.
|
|
7695
|
+
*
|
|
7696
|
+
* > [!NOTE]
|
|
7697
|
+
*
|
|
7698
|
+
* * If `sendCommand` is called before the target has navigated (e.g. immediately
|
|
7699
|
+
* after `attach()`), the returned promise may not resolve until navigation occurs.
|
|
7700
|
+
* * If the command's response has no `result` data, as defined by that command's
|
|
7701
|
+
* entry in the remote debugging protocol, the promise resolves with an empty
|
|
7702
|
+
* object (`{}`), not `null` or `undefined`.
|
|
7710
7703
|
*/
|
|
7711
7704
|
sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
|
|
7712
7705
|
}
|
|
@@ -8314,6 +8307,14 @@ declare namespace Electron {
|
|
|
8314
8307
|
* actual name of saved file will be different.
|
|
8315
8308
|
*/
|
|
8316
8309
|
getFilename(): string;
|
|
8310
|
+
/**
|
|
8311
|
+
* The origin that started the download (for example `https://example.com`, or
|
|
8312
|
+
* `null` for an opaque origin), or an empty string if the download was not started
|
|
8313
|
+
* by web content (for example `webContents.downloadURL()`). Use this rather than
|
|
8314
|
+
* `getURL()` or the `webContents` to decide whose download it is: the URL is
|
|
8315
|
+
* chosen by the initiator and the `webContents` is the whole tab.
|
|
8316
|
+
*/
|
|
8317
|
+
getInitiatorOrigin(): string;
|
|
8317
8318
|
/**
|
|
8318
8319
|
* Last-Modified header value.
|
|
8319
8320
|
*/
|
|
@@ -8411,32 +8412,6 @@ declare namespace Electron {
|
|
|
8411
8412
|
savePath: string;
|
|
8412
8413
|
}
|
|
8413
8414
|
|
|
8414
|
-
interface EnableHeapProfilingOptions {
|
|
8415
|
-
|
|
8416
|
-
// Docs: https://electronjs.org/docs/api/structures/enable-heap-profiling-options
|
|
8417
|
-
|
|
8418
|
-
/**
|
|
8419
|
-
* Controls which processes are profiled. Equivalent to `--memlog` in Chrome.
|
|
8420
|
-
* Default is `all`.
|
|
8421
|
-
*/
|
|
8422
|
-
mode?: ('all' | 'browser' | 'gpu' | 'minimal' | 'renderer-sampling' | 'all-renderers' | 'utility-sampling' | 'all-utilities' | 'utility-and-browser');
|
|
8423
|
-
/**
|
|
8424
|
-
* Controls the sampling interval in bytes. The lower the interval, the more
|
|
8425
|
-
* precise the profile is. However it comes at the cost of performance. Default is
|
|
8426
|
-
* `100000` (100KB). That is enough to observe allocation sites that make
|
|
8427
|
-
* allocations >500KB total, where total equals to a single allocation size times
|
|
8428
|
-
* the number of such allocations at the same call site. Equivalent to
|
|
8429
|
-
* `--memlog-sampling-rate` in Chrome. Must be an integer between `1000` and
|
|
8430
|
-
* `10000000`.
|
|
8431
|
-
*/
|
|
8432
|
-
samplingRate?: number;
|
|
8433
|
-
/**
|
|
8434
|
-
* Controls the type of metadata recorded for each allocation. Equivalent to
|
|
8435
|
-
* `--memlog-stack-mode` in Chrome. Default is `native`.
|
|
8436
|
-
*/
|
|
8437
|
-
stackMode?: ('native' | 'native-with-thread-names');
|
|
8438
|
-
}
|
|
8439
|
-
|
|
8440
8415
|
interface Extension {
|
|
8441
8416
|
|
|
8442
8417
|
// Docs: https://electronjs.org/docs/api/structures/extension
|
|
@@ -9860,6 +9835,9 @@ declare namespace Electron {
|
|
|
9860
9835
|
* This property can be dynamically changed; setting it to `undefined` removes the
|
|
9861
9836
|
* badge. Only available on macOS 14 and up.
|
|
9862
9837
|
*
|
|
9838
|
+
* Badges are not displayed in Dock menus, though the same item shows its badge in
|
|
9839
|
+
* an application menu.
|
|
9840
|
+
*
|
|
9863
9841
|
* @platform darwin
|
|
9864
9842
|
*/
|
|
9865
9843
|
badge?: MenuItemBadge;
|
|
@@ -11614,7 +11592,8 @@ declare namespace Electron {
|
|
|
11614
11592
|
// Docs: https://electronjs.org/docs/api/structures/process-metric
|
|
11615
11593
|
|
|
11616
11594
|
/**
|
|
11617
|
-
* CPU usage of the process.
|
|
11595
|
+
* CPU usage of the process. Its `percentCPUUsage` and `idleWakeupsPerSecond` are
|
|
11596
|
+
* averages over the time since the previous call to the API returning this object.
|
|
11618
11597
|
*/
|
|
11619
11598
|
cpu: CPUUsage;
|
|
11620
11599
|
/**
|
|
@@ -11779,6 +11758,12 @@ declare namespace Electron {
|
|
|
11779
11758
|
* Register a protocol handler for `scheme`. Requests made to URLs with this scheme
|
|
11780
11759
|
* will delegate to this handler to determine what response should be sent.
|
|
11781
11760
|
*
|
|
11761
|
+
* In addition to the standard `Request` fields, `request.initiatorOrigin` is set
|
|
11762
|
+
* to the origin that issued the request (for example `https://example.com`, or
|
|
11763
|
+
* `null` for an opaque origin) when web content made it; it is absent for requests
|
|
11764
|
+
* the browser started itself. Unlike `request.referrer` it is not controlled by
|
|
11765
|
+
* the requesting page, so prefer it when deciding whether to serve a request.
|
|
11766
|
+
*
|
|
11782
11767
|
* Either a `Response` or a `Promise<Response>` can be returned.
|
|
11783
11768
|
*
|
|
11784
11769
|
* Example:
|
|
@@ -11983,6 +11968,12 @@ declare namespace Electron {
|
|
|
11983
11968
|
// Docs: https://electronjs.org/docs/api/structures/protocol-request
|
|
11984
11969
|
|
|
11985
11970
|
headers: Record<string, string>;
|
|
11971
|
+
/**
|
|
11972
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
11973
|
+
* for an opaque origin). Absent for requests the browser started itself. Unlike
|
|
11974
|
+
* `referrer`, this is not controlled by the requesting page.
|
|
11975
|
+
*/
|
|
11976
|
+
initiatorOrigin?: string;
|
|
11986
11977
|
method: string;
|
|
11987
11978
|
referrer: string;
|
|
11988
11979
|
uploadData?: UploadData[];
|
|
@@ -12228,6 +12219,12 @@ declare namespace Electron {
|
|
|
12228
12219
|
/**
|
|
12229
12220
|
* the decrypted string. Decrypts the encrypted buffer obtained with
|
|
12230
12221
|
* `safeStorage.encryptString` back into a string.
|
|
12222
|
+
*
|
|
12223
|
+
* **Deprecated:** Use `safeStorage.decryptStringAsync(encrypted)` instead. Data
|
|
12224
|
+
* encrypted with `safeStorage.encryptString` can be decrypted with
|
|
12225
|
+
* `safeStorage.decryptStringAsync`.
|
|
12226
|
+
*
|
|
12227
|
+
* @deprecated
|
|
12231
12228
|
*/
|
|
12232
12229
|
decryptString(encrypted: Buffer): string;
|
|
12233
12230
|
/**
|
|
@@ -12244,6 +12241,10 @@ declare namespace Electron {
|
|
|
12244
12241
|
* An array of bytes representing the encrypted string.
|
|
12245
12242
|
*
|
|
12246
12243
|
* This function will throw an error if encryption fails.
|
|
12244
|
+
*
|
|
12245
|
+
* **Deprecated:** Use `safeStorage.encryptStringAsync(plainText)` instead.
|
|
12246
|
+
*
|
|
12247
|
+
* @deprecated
|
|
12247
12248
|
*/
|
|
12248
12249
|
encryptString(plainText: string): Buffer;
|
|
12249
12250
|
/**
|
|
@@ -12287,6 +12288,10 @@ declare namespace Electron {
|
|
|
12287
12288
|
* On Linux, returns true if the app has emitted the `ready` event and the secret
|
|
12288
12289
|
* key is available. On MacOS, returns true if Keychain is available. On Windows,
|
|
12289
12290
|
* returns true once the app has emitted the `ready` event.
|
|
12291
|
+
*
|
|
12292
|
+
* **Deprecated:** Use `safeStorage.isAsyncEncryptionAvailable()` instead.
|
|
12293
|
+
*
|
|
12294
|
+
* @deprecated
|
|
12290
12295
|
*/
|
|
12291
12296
|
isEncryptionAvailable(): boolean;
|
|
12292
12297
|
/**
|
|
@@ -12851,7 +12856,11 @@ declare namespace Electron {
|
|
|
12851
12856
|
* True if the renderer is requesting that the connection include credentials (see
|
|
12852
12857
|
* the spec for more details.)
|
|
12853
12858
|
*/
|
|
12854
|
-
allowCredentials: boolean
|
|
12859
|
+
allowCredentials: boolean,
|
|
12860
|
+
/**
|
|
12861
|
+
* The frame that requested the preconnection, if it still exists.
|
|
12862
|
+
*/
|
|
12863
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
12855
12864
|
off(event: 'preconnect', listener: (event: Event,
|
|
12856
12865
|
/**
|
|
12857
12866
|
* The URL being requested for preconnection by the renderer.
|
|
@@ -12861,7 +12870,11 @@ declare namespace Electron {
|
|
|
12861
12870
|
* True if the renderer is requesting that the connection include credentials (see
|
|
12862
12871
|
* the spec for more details.)
|
|
12863
12872
|
*/
|
|
12864
|
-
allowCredentials: boolean
|
|
12873
|
+
allowCredentials: boolean,
|
|
12874
|
+
/**
|
|
12875
|
+
* The frame that requested the preconnection, if it still exists.
|
|
12876
|
+
*/
|
|
12877
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
12865
12878
|
once(event: 'preconnect', listener: (event: Event,
|
|
12866
12879
|
/**
|
|
12867
12880
|
* The URL being requested for preconnection by the renderer.
|
|
@@ -12871,7 +12884,11 @@ declare namespace Electron {
|
|
|
12871
12884
|
* True if the renderer is requesting that the connection include credentials (see
|
|
12872
12885
|
* the spec for more details.)
|
|
12873
12886
|
*/
|
|
12874
|
-
allowCredentials: boolean
|
|
12887
|
+
allowCredentials: boolean,
|
|
12888
|
+
/**
|
|
12889
|
+
* The frame that requested the preconnection, if it still exists.
|
|
12890
|
+
*/
|
|
12891
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
12875
12892
|
addListener(event: 'preconnect', listener: (event: Event,
|
|
12876
12893
|
/**
|
|
12877
12894
|
* The URL being requested for preconnection by the renderer.
|
|
@@ -12881,7 +12898,11 @@ declare namespace Electron {
|
|
|
12881
12898
|
* True if the renderer is requesting that the connection include credentials (see
|
|
12882
12899
|
* the spec for more details.)
|
|
12883
12900
|
*/
|
|
12884
|
-
allowCredentials: boolean
|
|
12901
|
+
allowCredentials: boolean,
|
|
12902
|
+
/**
|
|
12903
|
+
* The frame that requested the preconnection, if it still exists.
|
|
12904
|
+
*/
|
|
12905
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
12885
12906
|
removeListener(event: 'preconnect', listener: (event: Event,
|
|
12886
12907
|
/**
|
|
12887
12908
|
* The URL being requested for preconnection by the renderer.
|
|
@@ -12891,7 +12912,11 @@ declare namespace Electron {
|
|
|
12891
12912
|
* True if the renderer is requesting that the connection include credentials (see
|
|
12892
12913
|
* the spec for more details.)
|
|
12893
12914
|
*/
|
|
12894
|
-
allowCredentials: boolean
|
|
12915
|
+
allowCredentials: boolean,
|
|
12916
|
+
/**
|
|
12917
|
+
* The frame that requested the preconnection, if it still exists.
|
|
12918
|
+
*/
|
|
12919
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
12895
12920
|
/**
|
|
12896
12921
|
* Emitted when a HID device needs to be selected when a call to
|
|
12897
12922
|
* `navigator.hid.requestDevice` is made. `callback` should be called with
|
|
@@ -13273,26 +13298,47 @@ declare namespace Electron {
|
|
|
13273
13298
|
removeListener(event: 'usb-device-revoked', listener: (event: Event,
|
|
13274
13299
|
details: UsbDeviceRevokedDetails) => void): this;
|
|
13275
13300
|
/**
|
|
13276
|
-
* Emitted when Electron is about to download `item` in `webContents`.
|
|
13301
|
+
* Emitted when Electron is about to download `item` in `webContents`. See also
|
|
13302
|
+
* `item.getInitiatorOrigin()`.
|
|
13277
13303
|
*
|
|
13278
13304
|
* Calling `event.preventDefault()` will cancel the download and `item` will not be
|
|
13279
13305
|
* available from next tick of the process.
|
|
13280
13306
|
*/
|
|
13281
13307
|
on(event: 'will-download', listener: (event: Event,
|
|
13282
13308
|
item: DownloadItem,
|
|
13283
|
-
webContents: WebContents
|
|
13309
|
+
webContents: WebContents,
|
|
13310
|
+
/**
|
|
13311
|
+
* The frame that started the download, if it still exists.
|
|
13312
|
+
*/
|
|
13313
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
13284
13314
|
off(event: 'will-download', listener: (event: Event,
|
|
13285
13315
|
item: DownloadItem,
|
|
13286
|
-
webContents: WebContents
|
|
13316
|
+
webContents: WebContents,
|
|
13317
|
+
/**
|
|
13318
|
+
* The frame that started the download, if it still exists.
|
|
13319
|
+
*/
|
|
13320
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
13287
13321
|
once(event: 'will-download', listener: (event: Event,
|
|
13288
13322
|
item: DownloadItem,
|
|
13289
|
-
webContents: WebContents
|
|
13323
|
+
webContents: WebContents,
|
|
13324
|
+
/**
|
|
13325
|
+
* The frame that started the download, if it still exists.
|
|
13326
|
+
*/
|
|
13327
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
13290
13328
|
addListener(event: 'will-download', listener: (event: Event,
|
|
13291
13329
|
item: DownloadItem,
|
|
13292
|
-
webContents: WebContents
|
|
13330
|
+
webContents: WebContents,
|
|
13331
|
+
/**
|
|
13332
|
+
* The frame that started the download, if it still exists.
|
|
13333
|
+
*/
|
|
13334
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
13293
13335
|
removeListener(event: 'will-download', listener: (event: Event,
|
|
13294
13336
|
item: DownloadItem,
|
|
13295
|
-
webContents: WebContents
|
|
13337
|
+
webContents: WebContents,
|
|
13338
|
+
/**
|
|
13339
|
+
* The frame that started the download, if it still exists.
|
|
13340
|
+
*/
|
|
13341
|
+
frame: (WebFrameMain) | (null)) => void): this;
|
|
13296
13342
|
/**
|
|
13297
13343
|
* Whether the word was successfully written to the custom dictionary. This API
|
|
13298
13344
|
* will not work on non-persistent (in-memory) sessions.
|
|
@@ -13671,8 +13717,12 @@ declare namespace Electron {
|
|
|
13671
13717
|
* is available and `useSystemPicker` is set to `true`, the handler will not be
|
|
13672
13718
|
* invoked.
|
|
13673
13719
|
*
|
|
13674
|
-
* Passing a WebFrameMain object as a video or audio stream
|
|
13675
|
-
*
|
|
13720
|
+
* Passing a WebFrameMain object as a video or audio stream captures the whole
|
|
13721
|
+
* `webContents` that contains that frame (the tab), not just the frame:
|
|
13722
|
+
* `request.frame` from an `<iframe>` therefore grants that iframe a capture of the
|
|
13723
|
+
* page that embeds it. Check `request.frame` before using it this way, and note
|
|
13724
|
+
* that the callback throws if the frame has been destroyed by the time it is
|
|
13725
|
+
* called.
|
|
13676
13726
|
*
|
|
13677
13727
|
* Passing `null` instead of a function resets the handler to its default state.
|
|
13678
13728
|
*/
|
|
@@ -18455,7 +18505,9 @@ declare namespace Electron {
|
|
|
18455
18505
|
* The identifier of a WebContents stream. This identifier can be used with
|
|
18456
18506
|
* `navigator.mediaDevices.getUserMedia` using a `chromeMediaSource` of `tab`. The
|
|
18457
18507
|
* identifier is restricted to the web contents that it is registered to and is
|
|
18458
|
-
* only valid for 10 seconds.
|
|
18508
|
+
* only valid for 10 seconds. The `desktop` source only accepts screen and window
|
|
18509
|
+
* identifiers from `desktopCapturer.getSources`; to capture a WebContents use this
|
|
18510
|
+
* identifier with the `tab` source, or `ses.setDisplayMediaRequestHandler`.
|
|
18459
18511
|
*/
|
|
18460
18512
|
getMediaSourceId(requestWebContents: WebContents): string;
|
|
18461
18513
|
/**
|
|
@@ -19795,8 +19847,10 @@ declare namespace Electron {
|
|
|
19795
19847
|
*/
|
|
19796
19848
|
nodeIntegrationInSubFrames?: boolean;
|
|
19797
19849
|
/**
|
|
19798
|
-
* Whether node integration is enabled in web workers. Default is `false`.
|
|
19799
|
-
*
|
|
19850
|
+
* Whether node integration is enabled in web workers. Default is `false`. Only
|
|
19851
|
+
* workers created by a frame that itself has access to Node.js (the main frame, or
|
|
19852
|
+
* any frame when `nodeIntegrationInSubFrames` is enabled) get it. More about this
|
|
19853
|
+
* can be found in Multithreading.
|
|
19800
19854
|
*/
|
|
19801
19855
|
nodeIntegrationInWorker?: boolean;
|
|
19802
19856
|
/**
|
|
@@ -20366,6 +20420,10 @@ declare namespace Electron {
|
|
|
20366
20420
|
removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
|
|
20367
20421
|
/**
|
|
20368
20422
|
* Fired when the guest page has sent an asynchronous message to embedder page.
|
|
20423
|
+
* `frameId` does not tell the embedder which document sent the message; when that
|
|
20424
|
+
* matters, have the guest use `ipcRenderer.send()` and handle the guest
|
|
20425
|
+
* `webContents`' `ipc-message` event in the main process, where
|
|
20426
|
+
* `event.senderFrame` identifies the sender.
|
|
20369
20427
|
*
|
|
20370
20428
|
* With `sendToHost` method and `ipc-message` event you can communicate between
|
|
20371
20429
|
* guest page and embedder page:
|
|
@@ -20748,7 +20806,9 @@ declare namespace Electron {
|
|
|
20748
20806
|
unselect(): void;
|
|
20749
20807
|
/**
|
|
20750
20808
|
* A `boolean`. When this attribute is present the guest page will be allowed to
|
|
20751
|
-
* open new windows.
|
|
20809
|
+
* open new windows, whether through `window.open()` or a link opened into a new
|
|
20810
|
+
* window (for example a modifier-clicked or `target="_blank"` link). Popups are
|
|
20811
|
+
* disabled by default.
|
|
20752
20812
|
*/
|
|
20753
20813
|
allowpopups: boolean;
|
|
20754
20814
|
/**
|
|
@@ -22199,6 +22259,15 @@ declare namespace Electron {
|
|
|
22199
22259
|
* The blocked path attempting to be accessed.
|
|
22200
22260
|
*/
|
|
22201
22261
|
path: string;
|
|
22262
|
+
/**
|
|
22263
|
+
* The frame that initiated access. May be `null` if the frame has since been
|
|
22264
|
+
* destroyed.
|
|
22265
|
+
*/
|
|
22266
|
+
frame: (WebFrameMain) | (null);
|
|
22267
|
+
/**
|
|
22268
|
+
* The WebContents that contains `frame`.
|
|
22269
|
+
*/
|
|
22270
|
+
webContents: (WebContents) | (null);
|
|
22202
22271
|
}
|
|
22203
22272
|
|
|
22204
22273
|
interface FindInPageOptions {
|
|
@@ -22789,6 +22858,7 @@ declare namespace Electron {
|
|
|
22789
22858
|
/**
|
|
22790
22859
|
* A badge shown alongside the label, either a system-styled count (`alerts`,
|
|
22791
22860
|
* `updates`, `new-items`) or a custom string. Only available on macOS 14 and up.
|
|
22861
|
+
* Not displayed in Dock menus.
|
|
22792
22862
|
*
|
|
22793
22863
|
* @platform darwin
|
|
22794
22864
|
*/
|
|
@@ -23184,6 +23254,12 @@ declare namespace Electron {
|
|
|
23184
23254
|
* or been destroyed.
|
|
23185
23255
|
*/
|
|
23186
23256
|
frame?: (WebFrameMain) | (null);
|
|
23257
|
+
/**
|
|
23258
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
23259
|
+
* for an opaque origin). Kept from the original request across redirects; absent
|
|
23260
|
+
* for requests the browser started itself.
|
|
23261
|
+
*/
|
|
23262
|
+
initiatorOrigin?: string;
|
|
23187
23263
|
/**
|
|
23188
23264
|
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
|
23189
23265
|
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
|
@@ -23213,6 +23289,12 @@ declare namespace Electron {
|
|
|
23213
23289
|
* or been destroyed.
|
|
23214
23290
|
*/
|
|
23215
23291
|
frame?: (WebFrameMain) | (null);
|
|
23292
|
+
/**
|
|
23293
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
23294
|
+
* for an opaque origin). Kept from the original request across redirects; absent
|
|
23295
|
+
* for requests the browser started itself.
|
|
23296
|
+
*/
|
|
23297
|
+
initiatorOrigin?: string;
|
|
23216
23298
|
/**
|
|
23217
23299
|
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
|
23218
23300
|
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
|
@@ -23234,6 +23316,12 @@ declare namespace Electron {
|
|
|
23234
23316
|
* or been destroyed.
|
|
23235
23317
|
*/
|
|
23236
23318
|
frame?: (WebFrameMain) | (null);
|
|
23319
|
+
/**
|
|
23320
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
23321
|
+
* for an opaque origin). Kept from the original request across redirects; absent
|
|
23322
|
+
* for requests the browser started itself.
|
|
23323
|
+
*/
|
|
23324
|
+
initiatorOrigin?: string;
|
|
23237
23325
|
/**
|
|
23238
23326
|
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
|
23239
23327
|
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
|
@@ -23256,6 +23344,12 @@ declare namespace Electron {
|
|
|
23256
23344
|
* or been destroyed.
|
|
23257
23345
|
*/
|
|
23258
23346
|
frame?: (WebFrameMain) | (null);
|
|
23347
|
+
/**
|
|
23348
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
23349
|
+
* for an opaque origin). Kept from the original request across redirects; absent
|
|
23350
|
+
* for requests the browser started itself.
|
|
23351
|
+
*/
|
|
23352
|
+
initiatorOrigin?: string;
|
|
23259
23353
|
/**
|
|
23260
23354
|
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
|
23261
23355
|
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
|
@@ -23281,6 +23375,12 @@ declare namespace Electron {
|
|
|
23281
23375
|
* or been destroyed.
|
|
23282
23376
|
*/
|
|
23283
23377
|
frame?: (WebFrameMain) | (null);
|
|
23378
|
+
/**
|
|
23379
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
23380
|
+
* for an opaque origin). Kept from the original request across redirects; absent
|
|
23381
|
+
* for requests the browser started itself.
|
|
23382
|
+
*/
|
|
23383
|
+
initiatorOrigin?: string;
|
|
23284
23384
|
/**
|
|
23285
23385
|
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
|
23286
23386
|
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
|
@@ -23306,6 +23406,12 @@ declare namespace Electron {
|
|
|
23306
23406
|
* or been destroyed.
|
|
23307
23407
|
*/
|
|
23308
23408
|
frame?: (WebFrameMain) | (null);
|
|
23409
|
+
/**
|
|
23410
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
23411
|
+
* for an opaque origin). Kept from the original request across redirects; absent
|
|
23412
|
+
* for requests the browser started itself.
|
|
23413
|
+
*/
|
|
23414
|
+
initiatorOrigin?: string;
|
|
23309
23415
|
/**
|
|
23310
23416
|
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
|
23311
23417
|
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
|
@@ -23329,6 +23435,12 @@ declare namespace Electron {
|
|
|
23329
23435
|
* or been destroyed.
|
|
23330
23436
|
*/
|
|
23331
23437
|
frame?: (WebFrameMain) | (null);
|
|
23438
|
+
/**
|
|
23439
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
23440
|
+
* for an opaque origin). Kept from the original request across redirects; absent
|
|
23441
|
+
* for requests the browser started itself.
|
|
23442
|
+
*/
|
|
23443
|
+
initiatorOrigin?: string;
|
|
23332
23444
|
/**
|
|
23333
23445
|
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
|
23334
23446
|
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
|
@@ -23356,6 +23468,12 @@ declare namespace Electron {
|
|
|
23356
23468
|
* or been destroyed.
|
|
23357
23469
|
*/
|
|
23358
23470
|
frame?: (WebFrameMain) | (null);
|
|
23471
|
+
/**
|
|
23472
|
+
* The origin that issued the request (for example `https://example.com`, or `null`
|
|
23473
|
+
* for an opaque origin). Kept from the original request across redirects; absent
|
|
23474
|
+
* for requests the browser started itself.
|
|
23475
|
+
*/
|
|
23476
|
+
initiatorOrigin?: string;
|
|
23359
23477
|
/**
|
|
23360
23478
|
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
|
23361
23479
|
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
|
@@ -23574,7 +23692,8 @@ declare namespace Electron {
|
|
|
23574
23692
|
*/
|
|
23575
23693
|
embeddingOrigin?: string;
|
|
23576
23694
|
/**
|
|
23577
|
-
* The
|
|
23695
|
+
* The origin of the requesting frame, for `media`, `hid`, `usb` and `serial`
|
|
23696
|
+
* checks.
|
|
23578
23697
|
*/
|
|
23579
23698
|
securityOrigin?: string;
|
|
23580
23699
|
/**
|
|
@@ -23582,8 +23701,8 @@ declare namespace Electron {
|
|
|
23582
23701
|
*/
|
|
23583
23702
|
mediaType?: ('video' | 'audio' | 'unknown');
|
|
23584
23703
|
/**
|
|
23585
|
-
* The last URL the requesting frame loaded.
|
|
23586
|
-
*
|
|
23704
|
+
* The last URL the requesting frame loaded. Not provided when the check is not
|
|
23705
|
+
* made on behalf of a document (for example for a service worker).
|
|
23587
23706
|
*/
|
|
23588
23707
|
requestingUrl?: string;
|
|
23589
23708
|
/**
|
|
@@ -24216,7 +24335,8 @@ declare namespace Electron {
|
|
|
24216
24335
|
/**
|
|
24217
24336
|
* If a string is specified, can be `loopback` or `loopbackWithMute`. Specifying a
|
|
24218
24337
|
* loopback device will capture system audio, and is currently only supported on
|
|
24219
|
-
* Windows. If a WebFrameMain is specified, will capture audio from
|
|
24338
|
+
* Windows. If a WebFrameMain is specified, will capture audio from the
|
|
24339
|
+
* `webContents` that contains that frame.
|
|
24220
24340
|
*/
|
|
24221
24341
|
audio?: (('loopback' | 'loopbackWithMute')) | (WebFrameMain);
|
|
24222
24342
|
/**
|
|
@@ -25750,7 +25870,6 @@ declare namespace Electron {
|
|
|
25750
25870
|
type CustomScheme = Electron.CustomScheme;
|
|
25751
25871
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
25752
25872
|
type Display = Electron.Display;
|
|
25753
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
25754
25873
|
type Extension = Electron.Extension;
|
|
25755
25874
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
25756
25875
|
type FileFilter = Electron.FileFilter;
|
|
@@ -26175,7 +26294,6 @@ declare namespace Electron {
|
|
|
26175
26294
|
type CustomScheme = Electron.CustomScheme;
|
|
26176
26295
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
26177
26296
|
type Display = Electron.Display;
|
|
26178
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
26179
26297
|
type Extension = Electron.Extension;
|
|
26180
26298
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
26181
26299
|
type FileFilter = Electron.FileFilter;
|
|
@@ -26524,7 +26642,6 @@ declare namespace Electron {
|
|
|
26524
26642
|
type CustomScheme = Electron.CustomScheme;
|
|
26525
26643
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
26526
26644
|
type Display = Electron.Display;
|
|
26527
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
26528
26645
|
type Extension = Electron.Extension;
|
|
26529
26646
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
26530
26647
|
type FileFilter = Electron.FileFilter;
|
|
@@ -26875,7 +26992,6 @@ declare namespace Electron {
|
|
|
26875
26992
|
type CustomScheme = Electron.CustomScheme;
|
|
26876
26993
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
26877
26994
|
type Display = Electron.Display;
|
|
26878
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
26879
26995
|
type Extension = Electron.Extension;
|
|
26880
26996
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
26881
26997
|
type FileFilter = Electron.FileFilter;
|
|
@@ -27322,7 +27438,6 @@ declare namespace Electron {
|
|
|
27322
27438
|
type CustomScheme = Electron.CustomScheme;
|
|
27323
27439
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
27324
27440
|
type Display = Electron.Display;
|
|
27325
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
27326
27441
|
type Extension = Electron.Extension;
|
|
27327
27442
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
27328
27443
|
type FileFilter = Electron.FileFilter;
|
|
@@ -27539,6 +27654,14 @@ declare namespace NodeJS {
|
|
|
27539
27654
|
* Kilobytes.
|
|
27540
27655
|
*/
|
|
27541
27656
|
getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
|
|
27657
|
+
/**
|
|
27658
|
+
* CPU usage of the process this is called in.
|
|
27659
|
+
*
|
|
27660
|
+
* > [!NOTE] `percentCPUUsage` and `idleWakeupsPerSecond` are averages over the
|
|
27661
|
+
* time since the previous call to `process.getCPUUsage()` in this process, and
|
|
27662
|
+
* each call starts a new measurement interval. Every caller in the process shares
|
|
27663
|
+
* that interval. See `CPUUsage` for details.
|
|
27664
|
+
*/
|
|
27542
27665
|
getCPUUsage(): Electron.CPUUsage;
|
|
27543
27666
|
/**
|
|
27544
27667
|
* The number of milliseconds since epoch, or `null` if the information is
|
package/dist/version.json
CHANGED