electron-types 45.0.0-alpha.3 → 45.0.0-alpha.5
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 +55 -72
- 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.5
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@45.0.0-alpha.
|
|
19
|
+
yarn add -D electron-types@45.0.0-alpha.5
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@45.0.0-alpha.
|
|
21
|
+
pnpm add -D electron-types@45.0.0-alpha.5
|
|
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.5
|
|
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
|
/**
|
|
@@ -7196,36 +7202,6 @@ declare namespace Electron {
|
|
|
7196
7202
|
|
|
7197
7203
|
// Docs: https://electronjs.org/docs/api/content-tracing
|
|
7198
7204
|
|
|
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
7205
|
/**
|
|
7230
7206
|
* resolves with an array of category groups once all child processes have
|
|
7231
7207
|
* acknowledged the `getCategories` request
|
|
@@ -7460,12 +7436,14 @@ declare namespace Electron {
|
|
|
7460
7436
|
*/
|
|
7461
7437
|
cumulativeCPUUsage?: number;
|
|
7462
7438
|
/**
|
|
7463
|
-
* The number of average idle CPU wakeups per second since the last call to
|
|
7464
|
-
*
|
|
7439
|
+
* The number of average idle CPU wakeups per second since the last call to the API
|
|
7440
|
+
* that returned this object. First call returns 0. Will always return 0 on
|
|
7441
|
+
* Windows.
|
|
7465
7442
|
*/
|
|
7466
7443
|
idleWakeupsPerSecond: number;
|
|
7467
7444
|
/**
|
|
7468
|
-
* Percentage of CPU used since the last call to
|
|
7445
|
+
* Percentage of CPU used since the last call to the API that returned this object.
|
|
7446
|
+
* First call returns 0.
|
|
7469
7447
|
*/
|
|
7470
7448
|
percentCPUUsage: number;
|
|
7471
7449
|
}
|
|
@@ -7707,6 +7685,14 @@ declare namespace Electron {
|
|
|
7707
7685
|
* indicating the failure of the command.
|
|
7708
7686
|
*
|
|
7709
7687
|
* Send given command to the debugging target.
|
|
7688
|
+
*
|
|
7689
|
+
* > [!NOTE]
|
|
7690
|
+
*
|
|
7691
|
+
* * If `sendCommand` is called before the target has navigated (e.g. immediately
|
|
7692
|
+
* after `attach()`), the returned promise may not resolve until navigation occurs.
|
|
7693
|
+
* * If the command's response has no `result` data, as defined by that command's
|
|
7694
|
+
* entry in the remote debugging protocol, the promise resolves with an empty
|
|
7695
|
+
* object (`{}`), not `null` or `undefined`.
|
|
7710
7696
|
*/
|
|
7711
7697
|
sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
|
|
7712
7698
|
}
|
|
@@ -8411,32 +8397,6 @@ declare namespace Electron {
|
|
|
8411
8397
|
savePath: string;
|
|
8412
8398
|
}
|
|
8413
8399
|
|
|
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
8400
|
interface Extension {
|
|
8441
8401
|
|
|
8442
8402
|
// Docs: https://electronjs.org/docs/api/structures/extension
|
|
@@ -9860,6 +9820,9 @@ declare namespace Electron {
|
|
|
9860
9820
|
* This property can be dynamically changed; setting it to `undefined` removes the
|
|
9861
9821
|
* badge. Only available on macOS 14 and up.
|
|
9862
9822
|
*
|
|
9823
|
+
* Badges are not displayed in Dock menus, though the same item shows its badge in
|
|
9824
|
+
* an application menu.
|
|
9825
|
+
*
|
|
9863
9826
|
* @platform darwin
|
|
9864
9827
|
*/
|
|
9865
9828
|
badge?: MenuItemBadge;
|
|
@@ -11614,7 +11577,8 @@ declare namespace Electron {
|
|
|
11614
11577
|
// Docs: https://electronjs.org/docs/api/structures/process-metric
|
|
11615
11578
|
|
|
11616
11579
|
/**
|
|
11617
|
-
* CPU usage of the process.
|
|
11580
|
+
* CPU usage of the process. Its `percentCPUUsage` and `idleWakeupsPerSecond` are
|
|
11581
|
+
* averages over the time since the previous call to the API returning this object.
|
|
11618
11582
|
*/
|
|
11619
11583
|
cpu: CPUUsage;
|
|
11620
11584
|
/**
|
|
@@ -13671,8 +13635,12 @@ declare namespace Electron {
|
|
|
13671
13635
|
* is available and `useSystemPicker` is set to `true`, the handler will not be
|
|
13672
13636
|
* invoked.
|
|
13673
13637
|
*
|
|
13674
|
-
* Passing a WebFrameMain object as a video or audio stream
|
|
13675
|
-
*
|
|
13638
|
+
* Passing a WebFrameMain object as a video or audio stream captures the whole
|
|
13639
|
+
* `webContents` that contains that frame (the tab), not just the frame:
|
|
13640
|
+
* `request.frame` from an `<iframe>` therefore grants that iframe a capture of the
|
|
13641
|
+
* page that embeds it. Check `request.frame` before using it this way, and note
|
|
13642
|
+
* that the callback throws if the frame has been destroyed by the time it is
|
|
13643
|
+
* called.
|
|
13676
13644
|
*
|
|
13677
13645
|
* Passing `null` instead of a function resets the handler to its default state.
|
|
13678
13646
|
*/
|
|
@@ -22199,6 +22167,15 @@ declare namespace Electron {
|
|
|
22199
22167
|
* The blocked path attempting to be accessed.
|
|
22200
22168
|
*/
|
|
22201
22169
|
path: string;
|
|
22170
|
+
/**
|
|
22171
|
+
* The frame that initiated access. May be `null` if the frame has since been
|
|
22172
|
+
* destroyed.
|
|
22173
|
+
*/
|
|
22174
|
+
frame: (WebFrameMain) | (null);
|
|
22175
|
+
/**
|
|
22176
|
+
* The WebContents that contains `frame`.
|
|
22177
|
+
*/
|
|
22178
|
+
webContents: (WebContents) | (null);
|
|
22202
22179
|
}
|
|
22203
22180
|
|
|
22204
22181
|
interface FindInPageOptions {
|
|
@@ -22789,6 +22766,7 @@ declare namespace Electron {
|
|
|
22789
22766
|
/**
|
|
22790
22767
|
* A badge shown alongside the label, either a system-styled count (`alerts`,
|
|
22791
22768
|
* `updates`, `new-items`) or a custom string. Only available on macOS 14 and up.
|
|
22769
|
+
* Not displayed in Dock menus.
|
|
22792
22770
|
*
|
|
22793
22771
|
* @platform darwin
|
|
22794
22772
|
*/
|
|
@@ -23574,7 +23552,8 @@ declare namespace Electron {
|
|
|
23574
23552
|
*/
|
|
23575
23553
|
embeddingOrigin?: string;
|
|
23576
23554
|
/**
|
|
23577
|
-
* The
|
|
23555
|
+
* The origin of the requesting frame, for `media`, `hid`, `usb` and `serial`
|
|
23556
|
+
* checks.
|
|
23578
23557
|
*/
|
|
23579
23558
|
securityOrigin?: string;
|
|
23580
23559
|
/**
|
|
@@ -23582,8 +23561,8 @@ declare namespace Electron {
|
|
|
23582
23561
|
*/
|
|
23583
23562
|
mediaType?: ('video' | 'audio' | 'unknown');
|
|
23584
23563
|
/**
|
|
23585
|
-
* The last URL the requesting frame loaded.
|
|
23586
|
-
*
|
|
23564
|
+
* The last URL the requesting frame loaded. Not provided when the check is not
|
|
23565
|
+
* made on behalf of a document (for example for a service worker).
|
|
23587
23566
|
*/
|
|
23588
23567
|
requestingUrl?: string;
|
|
23589
23568
|
/**
|
|
@@ -24216,7 +24195,8 @@ declare namespace Electron {
|
|
|
24216
24195
|
/**
|
|
24217
24196
|
* If a string is specified, can be `loopback` or `loopbackWithMute`. Specifying a
|
|
24218
24197
|
* loopback device will capture system audio, and is currently only supported on
|
|
24219
|
-
* Windows. If a WebFrameMain is specified, will capture audio from
|
|
24198
|
+
* Windows. If a WebFrameMain is specified, will capture audio from the
|
|
24199
|
+
* `webContents` that contains that frame.
|
|
24220
24200
|
*/
|
|
24221
24201
|
audio?: (('loopback' | 'loopbackWithMute')) | (WebFrameMain);
|
|
24222
24202
|
/**
|
|
@@ -25750,7 +25730,6 @@ declare namespace Electron {
|
|
|
25750
25730
|
type CustomScheme = Electron.CustomScheme;
|
|
25751
25731
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
25752
25732
|
type Display = Electron.Display;
|
|
25753
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
25754
25733
|
type Extension = Electron.Extension;
|
|
25755
25734
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
25756
25735
|
type FileFilter = Electron.FileFilter;
|
|
@@ -26175,7 +26154,6 @@ declare namespace Electron {
|
|
|
26175
26154
|
type CustomScheme = Electron.CustomScheme;
|
|
26176
26155
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
26177
26156
|
type Display = Electron.Display;
|
|
26178
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
26179
26157
|
type Extension = Electron.Extension;
|
|
26180
26158
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
26181
26159
|
type FileFilter = Electron.FileFilter;
|
|
@@ -26524,7 +26502,6 @@ declare namespace Electron {
|
|
|
26524
26502
|
type CustomScheme = Electron.CustomScheme;
|
|
26525
26503
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
26526
26504
|
type Display = Electron.Display;
|
|
26527
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
26528
26505
|
type Extension = Electron.Extension;
|
|
26529
26506
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
26530
26507
|
type FileFilter = Electron.FileFilter;
|
|
@@ -26875,7 +26852,6 @@ declare namespace Electron {
|
|
|
26875
26852
|
type CustomScheme = Electron.CustomScheme;
|
|
26876
26853
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
26877
26854
|
type Display = Electron.Display;
|
|
26878
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
26879
26855
|
type Extension = Electron.Extension;
|
|
26880
26856
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
26881
26857
|
type FileFilter = Electron.FileFilter;
|
|
@@ -27322,7 +27298,6 @@ declare namespace Electron {
|
|
|
27322
27298
|
type CustomScheme = Electron.CustomScheme;
|
|
27323
27299
|
type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
|
27324
27300
|
type Display = Electron.Display;
|
|
27325
|
-
type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
|
|
27326
27301
|
type Extension = Electron.Extension;
|
|
27327
27302
|
type ExtensionInfo = Electron.ExtensionInfo;
|
|
27328
27303
|
type FileFilter = Electron.FileFilter;
|
|
@@ -27539,6 +27514,14 @@ declare namespace NodeJS {
|
|
|
27539
27514
|
* Kilobytes.
|
|
27540
27515
|
*/
|
|
27541
27516
|
getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
|
|
27517
|
+
/**
|
|
27518
|
+
* CPU usage of the process this is called in.
|
|
27519
|
+
*
|
|
27520
|
+
* > [!NOTE] `percentCPUUsage` and `idleWakeupsPerSecond` are averages over the
|
|
27521
|
+
* time since the previous call to `process.getCPUUsage()` in this process, and
|
|
27522
|
+
* each call starts a new measurement interval. Every caller in the process shares
|
|
27523
|
+
* that interval. See `CPUUsage` for details.
|
|
27524
|
+
*/
|
|
27542
27525
|
getCPUUsage(): Electron.CPUUsage;
|
|
27543
27526
|
/**
|
|
27544
27527
|
* The number of milliseconds since epoch, or `null` if the information is
|
package/dist/version.json
CHANGED