electron-types 45.0.0-alpha.3 → 45.0.0-alpha.4

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 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.3
17
+ npm install -D electron-types@45.0.0-alpha.4
18
18
  # or
19
- yarn add -D electron-types@45.0.0-alpha.3
19
+ yarn add -D electron-types@45.0.0-alpha.4
20
20
  # or
21
- pnpm add -D electron-types@45.0.0-alpha.3
21
+ pnpm add -D electron-types@45.0.0-alpha.4
22
22
  ```
23
23
 
24
24
  ## Usage
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 45.0.0-alpha.3
1
+ // Type definitions for Electron 45.0.0-alpha.4
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
- * getCPUUsage. First call returns 0. Will always return 0 on Windows.
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 getCPUUsage. First call returns 0.
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
  }
@@ -8411,32 +8389,6 @@ declare namespace Electron {
8411
8389
  savePath: string;
8412
8390
  }
8413
8391
 
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
8392
  interface Extension {
8441
8393
 
8442
8394
  // Docs: https://electronjs.org/docs/api/structures/extension
@@ -11614,7 +11566,8 @@ declare namespace Electron {
11614
11566
  // Docs: https://electronjs.org/docs/api/structures/process-metric
11615
11567
 
11616
11568
  /**
11617
- * CPU usage of the process.
11569
+ * CPU usage of the process. Its `percentCPUUsage` and `idleWakeupsPerSecond` are
11570
+ * averages over the time since the previous call to the API returning this object.
11618
11571
  */
11619
11572
  cpu: CPUUsage;
11620
11573
  /**
@@ -25750,7 +25703,6 @@ declare namespace Electron {
25750
25703
  type CustomScheme = Electron.CustomScheme;
25751
25704
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
25752
25705
  type Display = Electron.Display;
25753
- type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
25754
25706
  type Extension = Electron.Extension;
25755
25707
  type ExtensionInfo = Electron.ExtensionInfo;
25756
25708
  type FileFilter = Electron.FileFilter;
@@ -26175,7 +26127,6 @@ declare namespace Electron {
26175
26127
  type CustomScheme = Electron.CustomScheme;
26176
26128
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
26177
26129
  type Display = Electron.Display;
26178
- type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
26179
26130
  type Extension = Electron.Extension;
26180
26131
  type ExtensionInfo = Electron.ExtensionInfo;
26181
26132
  type FileFilter = Electron.FileFilter;
@@ -26524,7 +26475,6 @@ declare namespace Electron {
26524
26475
  type CustomScheme = Electron.CustomScheme;
26525
26476
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
26526
26477
  type Display = Electron.Display;
26527
- type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
26528
26478
  type Extension = Electron.Extension;
26529
26479
  type ExtensionInfo = Electron.ExtensionInfo;
26530
26480
  type FileFilter = Electron.FileFilter;
@@ -26875,7 +26825,6 @@ declare namespace Electron {
26875
26825
  type CustomScheme = Electron.CustomScheme;
26876
26826
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
26877
26827
  type Display = Electron.Display;
26878
- type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
26879
26828
  type Extension = Electron.Extension;
26880
26829
  type ExtensionInfo = Electron.ExtensionInfo;
26881
26830
  type FileFilter = Electron.FileFilter;
@@ -27322,7 +27271,6 @@ declare namespace Electron {
27322
27271
  type CustomScheme = Electron.CustomScheme;
27323
27272
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
27324
27273
  type Display = Electron.Display;
27325
- type EnableHeapProfilingOptions = Electron.EnableHeapProfilingOptions;
27326
27274
  type Extension = Electron.Extension;
27327
27275
  type ExtensionInfo = Electron.ExtensionInfo;
27328
27276
  type FileFilter = Electron.FileFilter;
@@ -27539,6 +27487,14 @@ declare namespace NodeJS {
27539
27487
  * Kilobytes.
27540
27488
  */
27541
27489
  getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
27490
+ /**
27491
+ * CPU usage of the process this is called in.
27492
+ *
27493
+ * > [!NOTE] `percentCPUUsage` and `idleWakeupsPerSecond` are averages over the
27494
+ * time since the previous call to `process.getCPUUsage()` in this process, and
27495
+ * each call starts a new measurement interval. Every caller in the process shares
27496
+ * that interval. See `CPUUsage` for details.
27497
+ */
27542
27498
  getCPUUsage(): Electron.CPUUsage;
27543
27499
  /**
27544
27500
  * The number of milliseconds since epoch, or `null` if the information is
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "electronVersion": "45.0.0-alpha.3",
3
- "extractedAt": "2026-09-01T02:20:02.877Z"
2
+ "electronVersion": "45.0.0-alpha.4",
3
+ "extractedAt": "2026-09-03T23:11:11.638Z"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-types",
3
- "version": "45.0.0-alpha.3",
3
+ "version": "45.0.0-alpha.4",
4
4
  "type": "module",
5
5
  "description": "TypeScript type definitions extracted from the electron package",
6
6
  "types": "./dist/electron.d.ts",