electron-types 40.4.1 → 40.5.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 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.4.1
14
+ npm install -D electron-types@40.5.0
15
15
  # or
16
- yarn add -D electron-types@40.4.1
16
+ yarn add -D electron-types@40.5.0
17
17
  # or
18
- pnpm add -D electron-types@40.4.1
18
+ pnpm add -D electron-types@40.5.0
19
19
  ```
20
20
 
21
21
  ## Usage
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 40.4.1
1
+ // Type definitions for Electron 40.5.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
@@ -1740,6 +1740,26 @@ declare namespace Electron {
1740
1740
  * @platform darwin
1741
1741
  */
1742
1742
  setSecureKeyboardEntryEnabled(enabled: boolean): void;
1743
+ /**
1744
+ * Changes the Toast Activator CLSID to `id`. If one is not set via this method, it
1745
+ * will be randomly generated for the app.
1746
+ *
1747
+ * * The value must be a valid GUID/CLSID in one of the following forms:
1748
+ * * Canonical brace-wrapped: `{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}`
1749
+ * (preferred)
1750
+ * * Canonical without braces: `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` (braces
1751
+ * will be added automatically)
1752
+ * * Hex digits are case-insensitive.
1753
+ *
1754
+ * This method should be called early (before showing notifications) so the value
1755
+ * is baked into the registration/shortcut. Supplying an empty string or an
1756
+ * unparsable value throws and leaves the existing (or generated) CLSID unchanged.
1757
+ * If this method is never called, a random CLSID is generated once per run and
1758
+ * exposed via `app.toastActivatorCLSID`.
1759
+ *
1760
+ * @platform win32
1761
+ */
1762
+ setToastActivatorCLSID(id: string): void;
1743
1763
  /**
1744
1764
  * Creates an `NSUserActivity` and sets it as the current activity. The activity is
1745
1765
  * eligible for Handoff to another device afterward.
@@ -1886,6 +1906,12 @@ declare namespace Electron {
1886
1906
  * @platform darwin,win32
1887
1907
  */
1888
1908
  readonly runningUnderARM64Translation: boolean;
1909
+ /**
1910
+ * A `string` property that returns the app's Toast Activator CLSID.
1911
+ *
1912
+ * @platform win32
1913
+ */
1914
+ readonly toastActivatorCLSID: string;
1889
1915
  /**
1890
1916
  * A `string` which is the user agent string Electron will use as a global
1891
1917
  * fallback.
@@ -7440,9 +7466,12 @@ declare namespace Electron {
7440
7466
  * `DesktopCapturerSource` represents a screen or an individual window that can be
7441
7467
  * captured.
7442
7468
  *
7443
- * > [!NOTE] Capturing the screen contents requires user consent on macOS 10.15
7444
- * Catalina or higher, which can detected by
7445
- * `systemPreferences.getMediaAccessStatus`.
7469
+ * > [!NOTE]
7470
+ *
7471
+ * > * Capturing audio requires `NSAudioCaptureUsageDescription` Info.plist key on
7472
+ * macOS 14.2 Sonoma and higher - read more.
7473
+ * * Capturing the screen contents requires user consent on macOS 10.15 Catalina or
7474
+ * higher, which can detected by `systemPreferences.getMediaAccessStatus`.
7446
7475
  */
7447
7476
  getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
7448
7477
  }
@@ -10016,45 +10045,70 @@ declare namespace Electron {
10016
10045
  // Docs: https://electronjs.org/docs/api/notification
10017
10046
 
10018
10047
  /**
10019
- * @platform darwin
10048
+ * @platform darwin,win32
10020
10049
  */
10021
- on(event: 'action', listener: (event: Event,
10050
+ on(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10051
+ /**
10052
+ * @deprecated
10053
+ */
10054
+ actionIndex: number,
10022
10055
  /**
10023
- * The index of the action that was activated.
10056
+ * @deprecated
10057
+ * @platform win32
10024
10058
  */
10025
- index: number) => void): this;
10059
+ selectionIndex: number) => void): this;
10026
10060
  /**
10027
- * @platform darwin
10061
+ * @platform darwin,win32
10028
10062
  */
10029
- off(event: 'action', listener: (event: Event,
10063
+ off(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10064
+ /**
10065
+ * @deprecated
10066
+ */
10067
+ actionIndex: number,
10030
10068
  /**
10031
- * The index of the action that was activated.
10069
+ * @deprecated
10070
+ * @platform win32
10032
10071
  */
10033
- index: number) => void): this;
10072
+ selectionIndex: number) => void): this;
10034
10073
  /**
10035
- * @platform darwin
10074
+ * @platform darwin,win32
10036
10075
  */
10037
- once(event: 'action', listener: (event: Event,
10076
+ once(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10077
+ /**
10078
+ * @deprecated
10079
+ */
10080
+ actionIndex: number,
10038
10081
  /**
10039
- * The index of the action that was activated.
10082
+ * @deprecated
10083
+ * @platform win32
10040
10084
  */
10041
- index: number) => void): this;
10085
+ selectionIndex: number) => void): this;
10042
10086
  /**
10043
- * @platform darwin
10087
+ * @platform darwin,win32
10044
10088
  */
10045
- addListener(event: 'action', listener: (event: Event,
10089
+ addListener(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10046
10090
  /**
10047
- * The index of the action that was activated.
10091
+ * @deprecated
10048
10092
  */
10049
- index: number) => void): this;
10093
+ actionIndex: number,
10094
+ /**
10095
+ * @deprecated
10096
+ * @platform win32
10097
+ */
10098
+ selectionIndex: number) => void): this;
10050
10099
  /**
10051
- * @platform darwin
10100
+ * @platform darwin,win32
10052
10101
  */
10053
- removeListener(event: 'action', listener: (event: Event,
10102
+ removeListener(event: 'action', listener: (details: Event<NotificationActionEventParams>,
10054
10103
  /**
10055
- * The index of the action that was activated.
10104
+ * @deprecated
10056
10105
  */
10057
- index: number) => void): this;
10106
+ actionIndex: number,
10107
+ /**
10108
+ * @deprecated
10109
+ * @platform win32
10110
+ */
10111
+ selectionIndex: number) => void): this;
10058
10112
  /**
10059
10113
  * Emitted when the notification is clicked by the user.
10060
10114
  */
@@ -10128,43 +10182,43 @@ declare namespace Electron {
10128
10182
  * Emitted when the user clicks the "Reply" button on a notification with
10129
10183
  * `hasReply: true`.
10130
10184
  *
10131
- * @platform darwin
10185
+ * @platform darwin,win32
10132
10186
  */
10133
- on(event: 'reply', listener: (event: Event,
10187
+ on(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
10134
10188
  /**
10135
- * The string the user entered into the inline reply field.
10189
+ * @deprecated
10136
10190
  */
10137
10191
  reply: string) => void): this;
10138
10192
  /**
10139
- * @platform darwin
10193
+ * @platform darwin,win32
10140
10194
  */
10141
- off(event: 'reply', listener: (event: Event,
10195
+ off(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
10142
10196
  /**
10143
- * The string the user entered into the inline reply field.
10197
+ * @deprecated
10144
10198
  */
10145
10199
  reply: string) => void): this;
10146
10200
  /**
10147
- * @platform darwin
10201
+ * @platform darwin,win32
10148
10202
  */
10149
- once(event: 'reply', listener: (event: Event,
10203
+ once(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
10150
10204
  /**
10151
- * The string the user entered into the inline reply field.
10205
+ * @deprecated
10152
10206
  */
10153
10207
  reply: string) => void): this;
10154
10208
  /**
10155
- * @platform darwin
10209
+ * @platform darwin,win32
10156
10210
  */
10157
- addListener(event: 'reply', listener: (event: Event,
10211
+ addListener(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
10158
10212
  /**
10159
- * The string the user entered into the inline reply field.
10213
+ * @deprecated
10160
10214
  */
10161
10215
  reply: string) => void): this;
10162
10216
  /**
10163
- * @platform darwin
10217
+ * @platform darwin,win32
10164
10218
  */
10165
- removeListener(event: 'reply', listener: (event: Event,
10219
+ removeListener(event: 'reply', listener: (details: Event<NotificationReplyEventParams>,
10166
10220
  /**
10167
- * The string the user entered into the inline reply field.
10221
+ * @deprecated
10168
10222
  */
10169
10223
  reply: string) => void): this;
10170
10224
  /**
@@ -10271,14 +10325,21 @@ declare namespace Electron {
10271
10325
 
10272
10326
  // Docs: https://electronjs.org/docs/api/structures/notification-action
10273
10327
 
10328
+ /**
10329
+ * The list of items for the `selection` action `type`.
10330
+ *
10331
+ * @platform win32
10332
+ */
10333
+ items?: string[];
10274
10334
  /**
10275
10335
  * The label for the given action.
10276
10336
  */
10277
10337
  text?: string;
10278
10338
  /**
10279
- * The type of action, can be `button`.
10339
+ * The type of action, can be `button` or `selection`. `selection` is only
10340
+ * supported on Windows.
10280
10341
  */
10281
- type: ('button');
10342
+ type: ('button' | 'selection');
10282
10343
  }
10283
10344
 
10284
10345
  interface NotificationResponse {
@@ -21633,6 +21694,19 @@ declare namespace Electron {
21633
21694
  supportsZeroCopyWebGpuImport: boolean;
21634
21695
  }
21635
21696
 
21697
+ interface NotificationActionEventParams {
21698
+ /**
21699
+ * The index of the action that was activated.
21700
+ */
21701
+ actionIndex: number;
21702
+ /**
21703
+ * The index of the selected item, if one was chosen. -1 if none was chosen.
21704
+ *
21705
+ * @platform win32
21706
+ */
21707
+ selectionIndex: number;
21708
+ }
21709
+
21636
21710
  interface NotificationConstructorOptions {
21637
21711
  /**
21638
21712
  * A title for the notification, which will be displayed at the top of the
@@ -21713,6 +21787,13 @@ declare namespace Electron {
21713
21787
  toastXml?: string;
21714
21788
  }
21715
21789
 
21790
+ interface NotificationReplyEventParams {
21791
+ /**
21792
+ * The string the user entered into the inline reply field.
21793
+ */
21794
+ reply: string;
21795
+ }
21796
+
21716
21797
  interface Offscreen {
21717
21798
  /**
21718
21799
  * Whether to use GPU shared texture for accelerated paint event. Defaults to
@@ -24117,7 +24198,9 @@ declare namespace Electron {
24117
24198
  type MessageEvent = Electron.MessageEvent;
24118
24199
  type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
24119
24200
  type NativePixmap = Electron.NativePixmap;
24201
+ type NotificationActionEventParams = Electron.NotificationActionEventParams;
24120
24202
  type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
24203
+ type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
24121
24204
  type Offscreen = Electron.Offscreen;
24122
24205
  type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
24123
24206
  type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
@@ -24511,7 +24594,9 @@ declare namespace Electron {
24511
24594
  type MessageEvent = Electron.MessageEvent;
24512
24595
  type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
24513
24596
  type NativePixmap = Electron.NativePixmap;
24597
+ type NotificationActionEventParams = Electron.NotificationActionEventParams;
24514
24598
  type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
24599
+ type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
24515
24600
  type Offscreen = Electron.Offscreen;
24516
24601
  type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
24517
24602
  type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
@@ -24833,7 +24918,9 @@ declare namespace Electron {
24833
24918
  type MessageEvent = Electron.MessageEvent;
24834
24919
  type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
24835
24920
  type NativePixmap = Electron.NativePixmap;
24921
+ type NotificationActionEventParams = Electron.NotificationActionEventParams;
24836
24922
  type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
24923
+ type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
24837
24924
  type Offscreen = Electron.Offscreen;
24838
24925
  type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
24839
24926
  type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
@@ -25154,7 +25241,9 @@ declare namespace Electron {
25154
25241
  type MessageEvent = Electron.MessageEvent;
25155
25242
  type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
25156
25243
  type NativePixmap = Electron.NativePixmap;
25244
+ type NotificationActionEventParams = Electron.NotificationActionEventParams;
25157
25245
  type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
25246
+ type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
25158
25247
  type Offscreen = Electron.Offscreen;
25159
25248
  type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
25160
25249
  type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
@@ -25569,7 +25658,9 @@ declare namespace Electron {
25569
25658
  type MessageEvent = Electron.MessageEvent;
25570
25659
  type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
25571
25660
  type NativePixmap = Electron.NativePixmap;
25661
+ type NotificationActionEventParams = Electron.NotificationActionEventParams;
25572
25662
  type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
25663
+ type NotificationReplyEventParams = Electron.NotificationReplyEventParams;
25573
25664
  type Offscreen = Electron.Offscreen;
25574
25665
  type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
25575
25666
  type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "electronVersion": "40.4.1",
3
- "extractedAt": "2026-02-13T18:22:08.507Z"
2
+ "electronVersion": "40.5.0",
3
+ "extractedAt": "2026-02-19T06:32:02.272Z"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-types",
3
- "version": "40.4.1",
3
+ "version": "40.5.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript type definitions extracted from the electron package",
6
6
  "types": "./dist/electron.d.ts",