electron-types 40.4.1 → 40.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 +155 -45
- package/dist/version.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,11 +11,11 @@ The official `electron` package is ~200MB because it includes the Electron binar
|
|
|
11
11
|
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)):
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install -D electron-types@40.
|
|
14
|
+
npm install -D electron-types@40.6.0
|
|
15
15
|
# or
|
|
16
|
-
yarn add -D electron-types@40.
|
|
16
|
+
yarn add -D electron-types@40.6.0
|
|
17
17
|
# or
|
|
18
|
-
pnpm add -D electron-types@40.
|
|
18
|
+
pnpm add -D electron-types@40.6.0
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 40.
|
|
1
|
+
// Type definitions for Electron 40.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
|
|
@@ -517,7 +517,10 @@ declare namespace Electron {
|
|
|
517
517
|
callback: (username?: string, password?: string) => void) => void): this;
|
|
518
518
|
/**
|
|
519
519
|
* Emitted when the user clicks the native macOS new tab button. The new tab button
|
|
520
|
-
* is only visible if the current `BrowserWindow` has a `tabbingIdentifier
|
|
520
|
+
* is only visible if the current `BrowserWindow` has a `tabbingIdentifier`.
|
|
521
|
+
*
|
|
522
|
+
* You must create a window in this handler in order for macOS tabbing to work as
|
|
523
|
+
* expected.
|
|
521
524
|
*
|
|
522
525
|
* @platform darwin
|
|
523
526
|
*/
|
|
@@ -1740,6 +1743,26 @@ declare namespace Electron {
|
|
|
1740
1743
|
* @platform darwin
|
|
1741
1744
|
*/
|
|
1742
1745
|
setSecureKeyboardEntryEnabled(enabled: boolean): void;
|
|
1746
|
+
/**
|
|
1747
|
+
* Changes the Toast Activator CLSID to `id`. If one is not set via this method, it
|
|
1748
|
+
* will be randomly generated for the app.
|
|
1749
|
+
*
|
|
1750
|
+
* * The value must be a valid GUID/CLSID in one of the following forms:
|
|
1751
|
+
* * Canonical brace-wrapped: `{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}`
|
|
1752
|
+
* (preferred)
|
|
1753
|
+
* * Canonical without braces: `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` (braces
|
|
1754
|
+
* will be added automatically)
|
|
1755
|
+
* * Hex digits are case-insensitive.
|
|
1756
|
+
*
|
|
1757
|
+
* This method should be called early (before showing notifications) so the value
|
|
1758
|
+
* is baked into the registration/shortcut. Supplying an empty string or an
|
|
1759
|
+
* unparsable value throws and leaves the existing (or generated) CLSID unchanged.
|
|
1760
|
+
* If this method is never called, a random CLSID is generated once per run and
|
|
1761
|
+
* exposed via `app.toastActivatorCLSID`.
|
|
1762
|
+
*
|
|
1763
|
+
* @platform win32
|
|
1764
|
+
*/
|
|
1765
|
+
setToastActivatorCLSID(id: string): void;
|
|
1743
1766
|
/**
|
|
1744
1767
|
* Creates an `NSUserActivity` and sets it as the current activity. The activity is
|
|
1745
1768
|
* eligible for Handoff to another device afterward.
|
|
@@ -1886,6 +1909,12 @@ declare namespace Electron {
|
|
|
1886
1909
|
* @platform darwin,win32
|
|
1887
1910
|
*/
|
|
1888
1911
|
readonly runningUnderARM64Translation: boolean;
|
|
1912
|
+
/**
|
|
1913
|
+
* A `string` property that returns the app's Toast Activator CLSID.
|
|
1914
|
+
*
|
|
1915
|
+
* @platform win32
|
|
1916
|
+
*/
|
|
1917
|
+
readonly toastActivatorCLSID: string;
|
|
1889
1918
|
/**
|
|
1890
1919
|
* A `string` which is the user agent string Electron will use as a global
|
|
1891
1920
|
* fallback.
|
|
@@ -2186,7 +2215,11 @@ declare namespace Electron {
|
|
|
2186
2215
|
*/
|
|
2187
2216
|
removeListener(event: 'moved', listener: () => void): this;
|
|
2188
2217
|
/**
|
|
2189
|
-
* Emitted when the native new tab button
|
|
2218
|
+
* Emitted when the user clicks the native macOS new tab button. The new tab button
|
|
2219
|
+
* is only visible if the current `BrowserWindow` has a `tabbingIdentifier`.
|
|
2220
|
+
*
|
|
2221
|
+
* You must create a window in this handler in order for macOS tabbing to work as
|
|
2222
|
+
* expected.
|
|
2190
2223
|
*
|
|
2191
2224
|
* @platform darwin
|
|
2192
2225
|
*/
|
|
@@ -4391,7 +4424,11 @@ declare namespace Electron {
|
|
|
4391
4424
|
*/
|
|
4392
4425
|
removeListener(event: 'moved', listener: () => void): this;
|
|
4393
4426
|
/**
|
|
4394
|
-
* Emitted when the native new tab button
|
|
4427
|
+
* Emitted when the user clicks the native macOS new tab button. The new tab button
|
|
4428
|
+
* is only visible if the current `BrowserWindow` has a `tabbingIdentifier`.
|
|
4429
|
+
*
|
|
4430
|
+
* You must create a window in this handler in order for macOS tabbing to work as
|
|
4431
|
+
* expected.
|
|
4395
4432
|
*
|
|
4396
4433
|
* @platform darwin
|
|
4397
4434
|
*/
|
|
@@ -4413,7 +4450,11 @@ declare namespace Electron {
|
|
|
4413
4450
|
*/
|
|
4414
4451
|
removeListener(event: 'new-window-for-tab', listener: () => void): this;
|
|
4415
4452
|
/**
|
|
4416
|
-
* Emitted when the native new tab button
|
|
4453
|
+
* Emitted when the user clicks the native macOS new tab button. The new tab button
|
|
4454
|
+
* is only visible if the current `BrowserWindow` has a `tabbingIdentifier`.
|
|
4455
|
+
*
|
|
4456
|
+
* You must create a window in this handler in order for macOS tabbing to work as
|
|
4457
|
+
* expected.
|
|
4417
4458
|
*
|
|
4418
4459
|
* @platform darwin
|
|
4419
4460
|
*/
|
|
@@ -7440,9 +7481,12 @@ declare namespace Electron {
|
|
|
7440
7481
|
* `DesktopCapturerSource` represents a screen or an individual window that can be
|
|
7441
7482
|
* captured.
|
|
7442
7483
|
*
|
|
7443
|
-
* > [!NOTE]
|
|
7444
|
-
*
|
|
7445
|
-
* `
|
|
7484
|
+
* > [!NOTE]
|
|
7485
|
+
*
|
|
7486
|
+
* > * Capturing audio requires `NSAudioCaptureUsageDescription` Info.plist key on
|
|
7487
|
+
* macOS 14.2 Sonoma and higher - read more.
|
|
7488
|
+
* * Capturing the screen contents requires user consent on macOS 10.15 Catalina or
|
|
7489
|
+
* higher, which can detected by `systemPreferences.getMediaAccessStatus`.
|
|
7446
7490
|
*/
|
|
7447
7491
|
getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
|
|
7448
7492
|
}
|
|
@@ -10016,45 +10060,70 @@ declare namespace Electron {
|
|
|
10016
10060
|
// Docs: https://electronjs.org/docs/api/notification
|
|
10017
10061
|
|
|
10018
10062
|
/**
|
|
10019
|
-
* @platform darwin
|
|
10063
|
+
* @platform darwin,win32
|
|
10020
10064
|
*/
|
|
10021
|
-
on(event: 'action', listener: (
|
|
10065
|
+
on(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10066
|
+
/**
|
|
10067
|
+
* @deprecated
|
|
10068
|
+
*/
|
|
10069
|
+
actionIndex: number,
|
|
10022
10070
|
/**
|
|
10023
|
-
*
|
|
10071
|
+
* @deprecated
|
|
10072
|
+
* @platform win32
|
|
10024
10073
|
*/
|
|
10025
|
-
|
|
10074
|
+
selectionIndex: number) => void): this;
|
|
10026
10075
|
/**
|
|
10027
|
-
* @platform darwin
|
|
10076
|
+
* @platform darwin,win32
|
|
10028
10077
|
*/
|
|
10029
|
-
off(event: 'action', listener: (
|
|
10078
|
+
off(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10079
|
+
/**
|
|
10080
|
+
* @deprecated
|
|
10081
|
+
*/
|
|
10082
|
+
actionIndex: number,
|
|
10030
10083
|
/**
|
|
10031
|
-
*
|
|
10084
|
+
* @deprecated
|
|
10085
|
+
* @platform win32
|
|
10032
10086
|
*/
|
|
10033
|
-
|
|
10087
|
+
selectionIndex: number) => void): this;
|
|
10034
10088
|
/**
|
|
10035
|
-
* @platform darwin
|
|
10089
|
+
* @platform darwin,win32
|
|
10036
10090
|
*/
|
|
10037
|
-
once(event: 'action', listener: (
|
|
10091
|
+
once(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10092
|
+
/**
|
|
10093
|
+
* @deprecated
|
|
10094
|
+
*/
|
|
10095
|
+
actionIndex: number,
|
|
10038
10096
|
/**
|
|
10039
|
-
*
|
|
10097
|
+
* @deprecated
|
|
10098
|
+
* @platform win32
|
|
10040
10099
|
*/
|
|
10041
|
-
|
|
10100
|
+
selectionIndex: number) => void): this;
|
|
10042
10101
|
/**
|
|
10043
|
-
* @platform darwin
|
|
10102
|
+
* @platform darwin,win32
|
|
10044
10103
|
*/
|
|
10045
|
-
addListener(event: 'action', listener: (
|
|
10104
|
+
addListener(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10105
|
+
/**
|
|
10106
|
+
* @deprecated
|
|
10107
|
+
*/
|
|
10108
|
+
actionIndex: number,
|
|
10046
10109
|
/**
|
|
10047
|
-
*
|
|
10110
|
+
* @deprecated
|
|
10111
|
+
* @platform win32
|
|
10048
10112
|
*/
|
|
10049
|
-
|
|
10113
|
+
selectionIndex: number) => void): this;
|
|
10050
10114
|
/**
|
|
10051
|
-
* @platform darwin
|
|
10115
|
+
* @platform darwin,win32
|
|
10052
10116
|
*/
|
|
10053
|
-
removeListener(event: 'action', listener: (
|
|
10117
|
+
removeListener(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10118
|
+
/**
|
|
10119
|
+
* @deprecated
|
|
10120
|
+
*/
|
|
10121
|
+
actionIndex: number,
|
|
10054
10122
|
/**
|
|
10055
|
-
*
|
|
10123
|
+
* @deprecated
|
|
10124
|
+
* @platform win32
|
|
10056
10125
|
*/
|
|
10057
|
-
|
|
10126
|
+
selectionIndex: number) => void): this;
|
|
10058
10127
|
/**
|
|
10059
10128
|
* Emitted when the notification is clicked by the user.
|
|
10060
10129
|
*/
|
|
@@ -10128,43 +10197,43 @@ declare namespace Electron {
|
|
|
10128
10197
|
* Emitted when the user clicks the "Reply" button on a notification with
|
|
10129
10198
|
* `hasReply: true`.
|
|
10130
10199
|
*
|
|
10131
|
-
* @platform darwin
|
|
10200
|
+
* @platform darwin,win32
|
|
10132
10201
|
*/
|
|
10133
|
-
on(event: 'reply', listener: (
|
|
10202
|
+
on(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
|
|
10134
10203
|
/**
|
|
10135
|
-
*
|
|
10204
|
+
* @deprecated
|
|
10136
10205
|
*/
|
|
10137
10206
|
reply: string) => void): this;
|
|
10138
10207
|
/**
|
|
10139
|
-
* @platform darwin
|
|
10208
|
+
* @platform darwin,win32
|
|
10140
10209
|
*/
|
|
10141
|
-
off(event: 'reply', listener: (
|
|
10210
|
+
off(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
|
|
10142
10211
|
/**
|
|
10143
|
-
*
|
|
10212
|
+
* @deprecated
|
|
10144
10213
|
*/
|
|
10145
10214
|
reply: string) => void): this;
|
|
10146
10215
|
/**
|
|
10147
|
-
* @platform darwin
|
|
10216
|
+
* @platform darwin,win32
|
|
10148
10217
|
*/
|
|
10149
|
-
once(event: 'reply', listener: (
|
|
10218
|
+
once(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
|
|
10150
10219
|
/**
|
|
10151
|
-
*
|
|
10220
|
+
* @deprecated
|
|
10152
10221
|
*/
|
|
10153
10222
|
reply: string) => void): this;
|
|
10154
10223
|
/**
|
|
10155
|
-
* @platform darwin
|
|
10224
|
+
* @platform darwin,win32
|
|
10156
10225
|
*/
|
|
10157
|
-
addListener(event: 'reply', listener: (
|
|
10226
|
+
addListener(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
|
|
10158
10227
|
/**
|
|
10159
|
-
*
|
|
10228
|
+
* @deprecated
|
|
10160
10229
|
*/
|
|
10161
10230
|
reply: string) => void): this;
|
|
10162
10231
|
/**
|
|
10163
|
-
* @platform darwin
|
|
10232
|
+
* @platform darwin,win32
|
|
10164
10233
|
*/
|
|
10165
|
-
removeListener(event: 'reply', listener: (
|
|
10234
|
+
removeListener(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
|
|
10166
10235
|
/**
|
|
10167
|
-
*
|
|
10236
|
+
* @deprecated
|
|
10168
10237
|
*/
|
|
10169
10238
|
reply: string) => void): this;
|
|
10170
10239
|
/**
|
|
@@ -10271,14 +10340,21 @@ declare namespace Electron {
|
|
|
10271
10340
|
|
|
10272
10341
|
// Docs: https://electronjs.org/docs/api/structures/notification-action
|
|
10273
10342
|
|
|
10343
|
+
/**
|
|
10344
|
+
* The list of items for the `selection` action `type`.
|
|
10345
|
+
*
|
|
10346
|
+
* @platform win32
|
|
10347
|
+
*/
|
|
10348
|
+
items?: string[];
|
|
10274
10349
|
/**
|
|
10275
10350
|
* The label for the given action.
|
|
10276
10351
|
*/
|
|
10277
10352
|
text?: string;
|
|
10278
10353
|
/**
|
|
10279
|
-
* The type of action, can be `button`.
|
|
10354
|
+
* The type of action, can be `button` or `selection`. `selection` is only
|
|
10355
|
+
* supported on Windows.
|
|
10280
10356
|
*/
|
|
10281
|
-
type: ('button');
|
|
10357
|
+
type: ('button' | 'selection');
|
|
10282
10358
|
}
|
|
10283
10359
|
|
|
10284
10360
|
interface NotificationResponse {
|
|
@@ -18617,6 +18693,10 @@ declare namespace Electron {
|
|
|
18617
18693
|
* Enables Chromium's experimental features. Default is `false`.
|
|
18618
18694
|
*/
|
|
18619
18695
|
experimentalFeatures?: boolean;
|
|
18696
|
+
/**
|
|
18697
|
+
* Whether to focus the WebContents when navigating. Default is `true`.
|
|
18698
|
+
*/
|
|
18699
|
+
focusOnNavigation?: boolean;
|
|
18620
18700
|
/**
|
|
18621
18701
|
* Specifies how to run image animations (E.g. GIFs). Can be `animate`,
|
|
18622
18702
|
* `animateOnce` or `noAnimation`. Default is `animate`.
|
|
@@ -21633,6 +21713,19 @@ declare namespace Electron {
|
|
|
21633
21713
|
supportsZeroCopyWebGpuImport: boolean;
|
|
21634
21714
|
}
|
|
21635
21715
|
|
|
21716
|
+
interface NotificationActionEventParams {
|
|
21717
|
+
/**
|
|
21718
|
+
* The index of the action that was activated.
|
|
21719
|
+
*/
|
|
21720
|
+
actionIndex: number;
|
|
21721
|
+
/**
|
|
21722
|
+
* The index of the selected item, if one was chosen. -1 if none was chosen.
|
|
21723
|
+
*
|
|
21724
|
+
* @platform win32
|
|
21725
|
+
*/
|
|
21726
|
+
selectionIndex: number;
|
|
21727
|
+
}
|
|
21728
|
+
|
|
21636
21729
|
interface NotificationConstructorOptions {
|
|
21637
21730
|
/**
|
|
21638
21731
|
* A title for the notification, which will be displayed at the top of the
|
|
@@ -21713,6 +21806,13 @@ declare namespace Electron {
|
|
|
21713
21806
|
toastXml?: string;
|
|
21714
21807
|
}
|
|
21715
21808
|
|
|
21809
|
+
interface NotificationReplyEventParams {
|
|
21810
|
+
/**
|
|
21811
|
+
* The string the user entered into the inline reply field.
|
|
21812
|
+
*/
|
|
21813
|
+
reply: string;
|
|
21814
|
+
}
|
|
21815
|
+
|
|
21716
21816
|
interface Offscreen {
|
|
21717
21817
|
/**
|
|
21718
21818
|
* Whether to use GPU shared texture for accelerated paint event. Defaults to
|
|
@@ -24117,7 +24217,9 @@ declare namespace Electron {
|
|
|
24117
24217
|
type MessageEvent = Electron.MessageEvent;
|
|
24118
24218
|
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
|
24119
24219
|
type NativePixmap = Electron.NativePixmap;
|
|
24220
|
+
type NotificationActionEventParams = Electron.NotificationActionEventParams;
|
|
24120
24221
|
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
|
24222
|
+
type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
|
|
24121
24223
|
type Offscreen = Electron.Offscreen;
|
|
24122
24224
|
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
|
24123
24225
|
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
|
@@ -24511,7 +24613,9 @@ declare namespace Electron {
|
|
|
24511
24613
|
type MessageEvent = Electron.MessageEvent;
|
|
24512
24614
|
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
|
24513
24615
|
type NativePixmap = Electron.NativePixmap;
|
|
24616
|
+
type NotificationActionEventParams = Electron.NotificationActionEventParams;
|
|
24514
24617
|
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
|
24618
|
+
type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
|
|
24515
24619
|
type Offscreen = Electron.Offscreen;
|
|
24516
24620
|
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
|
24517
24621
|
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
|
@@ -24833,7 +24937,9 @@ declare namespace Electron {
|
|
|
24833
24937
|
type MessageEvent = Electron.MessageEvent;
|
|
24834
24938
|
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
|
24835
24939
|
type NativePixmap = Electron.NativePixmap;
|
|
24940
|
+
type NotificationActionEventParams = Electron.NotificationActionEventParams;
|
|
24836
24941
|
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
|
24942
|
+
type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
|
|
24837
24943
|
type Offscreen = Electron.Offscreen;
|
|
24838
24944
|
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
|
24839
24945
|
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
|
@@ -25154,7 +25260,9 @@ declare namespace Electron {
|
|
|
25154
25260
|
type MessageEvent = Electron.MessageEvent;
|
|
25155
25261
|
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
|
25156
25262
|
type NativePixmap = Electron.NativePixmap;
|
|
25263
|
+
type NotificationActionEventParams = Electron.NotificationActionEventParams;
|
|
25157
25264
|
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
|
25265
|
+
type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
|
|
25158
25266
|
type Offscreen = Electron.Offscreen;
|
|
25159
25267
|
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
|
25160
25268
|
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
|
@@ -25569,7 +25677,9 @@ declare namespace Electron {
|
|
|
25569
25677
|
type MessageEvent = Electron.MessageEvent;
|
|
25570
25678
|
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
|
25571
25679
|
type NativePixmap = Electron.NativePixmap;
|
|
25680
|
+
type NotificationActionEventParams = Electron.NotificationActionEventParams;
|
|
25572
25681
|
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
|
25682
|
+
type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
|
|
25573
25683
|
type Offscreen = Electron.Offscreen;
|
|
25574
25684
|
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
|
25575
25685
|
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
package/dist/version.json
CHANGED