electron-types 43.5.0 → 43.6.0
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 +91 -5
- 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@43.
|
|
17
|
+
npm install -D electron-types@43.6.0
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@43.
|
|
19
|
+
yarn add -D electron-types@43.6.0
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@43.
|
|
21
|
+
pnpm add -D electron-types@43.6.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 43.
|
|
1
|
+
// Type definitions for Electron 43.6.0
|
|
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
|
|
@@ -1149,6 +1149,12 @@ declare namespace Electron {
|
|
|
1149
1149
|
/**
|
|
1150
1150
|
* Array of `ProcessMetric` objects that correspond to memory and CPU usage
|
|
1151
1151
|
* statistics of all the processes associated with the app.
|
|
1152
|
+
*
|
|
1153
|
+
* > [!NOTE] `cpu.percentCPUUsage` and `cpu.idleWakeupsPerSecond` are averages over
|
|
1154
|
+
* the time since the last call to `app.getAppMetrics()`, and each call starts a
|
|
1155
|
+
* new measurement interval for every process at once. Other code in the main
|
|
1156
|
+
* process, including dependencies, shares those intervals. See `CPUUsage` for more
|
|
1157
|
+
* details.
|
|
1152
1158
|
*/
|
|
1153
1159
|
getAppMetrics(): ProcessMetric[];
|
|
1154
1160
|
/**
|
|
@@ -7377,12 +7383,14 @@ declare namespace Electron {
|
|
|
7377
7383
|
*/
|
|
7378
7384
|
cumulativeCPUUsage?: number;
|
|
7379
7385
|
/**
|
|
7380
|
-
* The number of average idle CPU wakeups per second since the last call to
|
|
7381
|
-
*
|
|
7386
|
+
* The number of average idle CPU wakeups per second since the last call to the API
|
|
7387
|
+
* that returned this object. First call returns 0. Will always return 0 on
|
|
7388
|
+
* Windows.
|
|
7382
7389
|
*/
|
|
7383
7390
|
idleWakeupsPerSecond: number;
|
|
7384
7391
|
/**
|
|
7385
|
-
* Percentage of CPU used since the last call to
|
|
7392
|
+
* Percentage of CPU used since the last call to the API that returned this object.
|
|
7393
|
+
* First call returns 0.
|
|
7386
7394
|
*/
|
|
7387
7395
|
percentCPUUsage: number;
|
|
7388
7396
|
}
|
|
@@ -9599,6 +9607,15 @@ declare namespace Electron {
|
|
|
9599
9607
|
* @platform darwin
|
|
9600
9608
|
*/
|
|
9601
9609
|
accessibilityLabel: string;
|
|
9610
|
+
/**
|
|
9611
|
+
* A `MenuItemBadge` (optional) indicating the badge for the menu item.
|
|
9612
|
+
*
|
|
9613
|
+
* This property can be dynamically changed; setting it to `undefined` removes the
|
|
9614
|
+
* badge. Only available on macOS 14 and up.
|
|
9615
|
+
*
|
|
9616
|
+
* @platform darwin
|
|
9617
|
+
*/
|
|
9618
|
+
badge?: MenuItemBadge;
|
|
9602
9619
|
/**
|
|
9603
9620
|
* A `boolean` indicating whether the item is checked.
|
|
9604
9621
|
*
|
|
@@ -9726,6 +9743,27 @@ declare namespace Electron {
|
|
|
9726
9743
|
visible: boolean;
|
|
9727
9744
|
}
|
|
9728
9745
|
|
|
9746
|
+
interface MenuItemBadge {
|
|
9747
|
+
|
|
9748
|
+
// Docs: https://electronjs.org/docs/api/structures/menu-item-badge
|
|
9749
|
+
|
|
9750
|
+
/**
|
|
9751
|
+
* A custom string to display in the badge. Required for, and only usable with, the
|
|
9752
|
+
* `none` type.
|
|
9753
|
+
*/
|
|
9754
|
+
content?: string;
|
|
9755
|
+
/**
|
|
9756
|
+
* The number of items the badge displays. Required for the `alerts`, `updates` and
|
|
9757
|
+
* `new-items` types; cannot be used with `none`.
|
|
9758
|
+
*/
|
|
9759
|
+
count?: number;
|
|
9760
|
+
/**
|
|
9761
|
+
* Can be `alerts`, `updates`, `new-items` or `none`. Default is `none`. See
|
|
9762
|
+
* Creating badges of a specific type for further explanation of these types.
|
|
9763
|
+
*/
|
|
9764
|
+
type?: ('alerts' | 'updates' | 'new-items' | 'none');
|
|
9765
|
+
}
|
|
9766
|
+
|
|
9729
9767
|
class MessageChannelMain {
|
|
9730
9768
|
|
|
9731
9769
|
// Docs: https://electronjs.org/docs/api/message-channel-main
|
|
@@ -11329,7 +11367,8 @@ declare namespace Electron {
|
|
|
11329
11367
|
// Docs: https://electronjs.org/docs/api/structures/process-metric
|
|
11330
11368
|
|
|
11331
11369
|
/**
|
|
11332
|
-
* CPU usage of the process.
|
|
11370
|
+
* CPU usage of the process. Its `percentCPUUsage` and `idleWakeupsPerSecond` are
|
|
11371
|
+
* averages over the time since the previous call to the API returning this object.
|
|
11333
11372
|
*/
|
|
11334
11373
|
cpu: CPUUsage;
|
|
11335
11374
|
/**
|
|
@@ -18250,6 +18289,10 @@ declare namespace Electron {
|
|
|
18250
18289
|
* greater than 0.
|
|
18251
18290
|
*/
|
|
18252
18291
|
isBeingCaptured(): boolean;
|
|
18292
|
+
/**
|
|
18293
|
+
* Whether caret browsing is enabled for this page.
|
|
18294
|
+
*/
|
|
18295
|
+
isCaretBrowsingEnabled(): boolean;
|
|
18253
18296
|
/**
|
|
18254
18297
|
* Whether the renderer process has crashed.
|
|
18255
18298
|
*/
|
|
@@ -18485,6 +18528,10 @@ declare namespace Electron {
|
|
|
18485
18528
|
* when the page becomes backgrounded. This also affects the Page Visibility API.
|
|
18486
18529
|
*/
|
|
18487
18530
|
setBackgroundThrottling(allowed: boolean): void;
|
|
18531
|
+
/**
|
|
18532
|
+
* Sets whether caret browsing is enabled on the current web page.
|
|
18533
|
+
*/
|
|
18534
|
+
setCaretBrowsingEnabled(enabled: boolean): void;
|
|
18488
18535
|
/**
|
|
18489
18536
|
* Changes the title of the DevTools window to `title`. This will only be visible
|
|
18490
18537
|
* if DevTools is opened in `undocked` or `detach` mode.
|
|
@@ -18634,6 +18681,25 @@ declare namespace Electron {
|
|
|
18634
18681
|
* affects the Page Visibility API.
|
|
18635
18682
|
*/
|
|
18636
18683
|
backgroundThrottling: boolean;
|
|
18684
|
+
/**
|
|
18685
|
+
* A `boolean` property that determines whether caret browsing is enabled for this
|
|
18686
|
+
* page.
|
|
18687
|
+
*
|
|
18688
|
+
* When enabled, a movable cursor is placed in the page's text, allowing the user
|
|
18689
|
+
* to navigate and select content with the keyboard. Changes apply to the live page
|
|
18690
|
+
* without reloading it.
|
|
18691
|
+
*
|
|
18692
|
+
* A `<webview>` guest inherits this value from its embedder when it is created and
|
|
18693
|
+
* then tracks it independently, so disabling caret browsing on the embedder leaves
|
|
18694
|
+
* an existing guest enabled.
|
|
18695
|
+
*
|
|
18696
|
+
* While any `WebContents` in the process has caret browsing enabled, assistive
|
|
18697
|
+
* technology is notified process-wide that caret browsing is active, so that
|
|
18698
|
+
* screen readers report the caret's position as it moves. That notification is
|
|
18699
|
+
* only withdrawn once every `WebContents` that enabled caret browsing has either
|
|
18700
|
+
* disabled it or been destroyed.
|
|
18701
|
+
*/
|
|
18702
|
+
caretBrowsingEnabled: boolean;
|
|
18637
18703
|
/**
|
|
18638
18704
|
* A `Debugger` instance for this webContents.
|
|
18639
18705
|
*
|
|
@@ -22347,6 +22413,13 @@ declare namespace Electron {
|
|
|
22347
22413
|
* containing group after the containing group of the item with the specified id.
|
|
22348
22414
|
*/
|
|
22349
22415
|
afterGroupContaining?: string[];
|
|
22416
|
+
/**
|
|
22417
|
+
* A badge shown alongside the label, either a system-styled count (`alerts`,
|
|
22418
|
+
* `updates`, `new-items`) or a custom string. Only available on macOS 14 and up.
|
|
22419
|
+
*
|
|
22420
|
+
* @platform darwin
|
|
22421
|
+
*/
|
|
22422
|
+
badge?: MenuItemBadge;
|
|
22350
22423
|
}
|
|
22351
22424
|
|
|
22352
22425
|
interface MessageBoxOptions {
|
|
@@ -25298,6 +25371,7 @@ declare namespace Electron {
|
|
|
25298
25371
|
type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
|
25299
25372
|
type MemoryInfo = Electron.MemoryInfo;
|
|
25300
25373
|
type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
|
25374
|
+
type MenuItemBadge = Electron.MenuItemBadge;
|
|
25301
25375
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
25302
25376
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
25303
25377
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
@@ -25707,6 +25781,7 @@ declare namespace Electron {
|
|
|
25707
25781
|
type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
|
25708
25782
|
type MemoryInfo = Electron.MemoryInfo;
|
|
25709
25783
|
type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
|
25784
|
+
type MenuItemBadge = Electron.MenuItemBadge;
|
|
25710
25785
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
25711
25786
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
25712
25787
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
@@ -26043,6 +26118,7 @@ declare namespace Electron {
|
|
|
26043
26118
|
type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
|
26044
26119
|
type MemoryInfo = Electron.MemoryInfo;
|
|
26045
26120
|
type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
|
26121
|
+
type MenuItemBadge = Electron.MenuItemBadge;
|
|
26046
26122
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
26047
26123
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
26048
26124
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
@@ -26378,6 +26454,7 @@ declare namespace Electron {
|
|
|
26378
26454
|
type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
|
26379
26455
|
type MemoryInfo = Electron.MemoryInfo;
|
|
26380
26456
|
type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
|
26457
|
+
type MenuItemBadge = Electron.MenuItemBadge;
|
|
26381
26458
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
26382
26459
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
26383
26460
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
@@ -26808,6 +26885,7 @@ declare namespace Electron {
|
|
|
26808
26885
|
type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
|
26809
26886
|
type MemoryInfo = Electron.MemoryInfo;
|
|
26810
26887
|
type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
|
26888
|
+
type MenuItemBadge = Electron.MenuItemBadge;
|
|
26811
26889
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
26812
26890
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
26813
26891
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
@@ -26993,6 +27071,14 @@ declare namespace NodeJS {
|
|
|
26993
27071
|
* Kilobytes.
|
|
26994
27072
|
*/
|
|
26995
27073
|
getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
|
|
27074
|
+
/**
|
|
27075
|
+
* CPU usage of the process this is called in.
|
|
27076
|
+
*
|
|
27077
|
+
* > [!NOTE] `percentCPUUsage` and `idleWakeupsPerSecond` are averages over the
|
|
27078
|
+
* time since the previous call to `process.getCPUUsage()` in this process, and
|
|
27079
|
+
* each call starts a new measurement interval. Every caller in the process shares
|
|
27080
|
+
* that interval. See `CPUUsage` for details.
|
|
27081
|
+
*/
|
|
26996
27082
|
getCPUUsage(): Electron.CPUUsage;
|
|
26997
27083
|
/**
|
|
26998
27084
|
* The number of milliseconds since epoch, or `null` if the information is
|
package/dist/version.json
CHANGED