electron-types 37.10.2 → 38.2.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.
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 37.10.2
1
+ // Type definitions for Electron 38.2.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
@@ -1048,30 +1048,6 @@ declare namespace Electron {
1048
1048
  * You should seek to use the `steal` option as sparingly as possible.
1049
1049
  */
1050
1050
  focus(options?: FocusOptions): void;
1051
- /**
1052
- * Array of strings naming currently enabled accessibility support components.
1053
- * Possible values:
1054
- *
1055
- * * `nativeAPIs` - Native OS accessibility APIs integration enabled.
1056
- * * `webContents` - Web contents accessibility tree exposure enabled.
1057
- * * `inlineTextBoxes` - Inline text boxes (character bounding boxes) enabled.
1058
- * * `extendedProperties` - Extended accessibility properties enabled.
1059
- * * `screenReader` - Screen reader specific mode enabled.
1060
- * * `html` - HTML accessibility tree construction enabled.
1061
- * * `labelImages` - Accessibility support for automatic image annotations.
1062
- * * `pdfPrinting` - Accessibility support for PDF printing enabled.
1063
- *
1064
- * Notes:
1065
- *
1066
- * * The array may be empty if no accessibility modes are active.
1067
- * * Use `app.isAccessibilitySupportEnabled()` for the legacy boolean check; prefer
1068
- * this method for granular diagnostics or telemetry.
1069
- *
1070
- * Example:
1071
- *
1072
- * @platform darwin,win32
1073
- */
1074
- getAccessibilitySupportFeatures(): string[];
1075
1051
  /**
1076
1052
  * Resolve with an object containing the following:
1077
1053
  *
@@ -1369,13 +1345,6 @@ declare namespace Electron {
1369
1345
  * whether or not the current OS version allows for native emoji pickers.
1370
1346
  */
1371
1347
  isEmojiPanelSupported(): boolean;
1372
- /**
1373
- * whether hardware acceleration is currently disabled.
1374
- *
1375
- * > [!NOTE] This information is only usable after the `gpu-info-update` event is
1376
- * emitted.
1377
- */
1378
- isHardwareAccelerationEnabled(): boolean;
1379
1348
  /**
1380
1349
  * `true` if the application—including all of its windows—is hidden (e.g. with
1381
1350
  * `Command-H`), `false` otherwise.
@@ -1537,32 +1506,11 @@ declare namespace Electron {
1537
1506
  * This API must be called after the `ready` event is emitted.
1538
1507
  *
1539
1508
  * > [!NOTE] Rendering accessibility tree can significantly affect the performance
1540
- * of your app. It should not be enabled by default. Calling this method will
1541
- * enable the following accessibility support features: `nativeAPIs`,
1542
- * `webContents`, `inlineTextBoxes`, and `extendedProperties`.
1509
+ * of your app. It should not be enabled by default.
1543
1510
  *
1544
1511
  * @platform darwin,win32
1545
1512
  */
1546
1513
  setAccessibilitySupportEnabled(enabled: boolean): void;
1547
- /**
1548
- * Possible values are:
1549
- *
1550
- * * `nativeAPIs` - Native OS accessibility APIs integration enabled.
1551
- * * `webContents` - Web contents accessibility tree exposure enabled.
1552
- * * `inlineTextBoxes` - Inline text boxes (character bounding boxes) enabled.
1553
- * * `extendedProperties` - Extended accessibility properties enabled.
1554
- * * `screenReader` - Screen reader specific mode enabled.
1555
- * * `html` - HTML accessibility tree construction enabled.
1556
- * * `labelImages` - Accessibility support for automatic image annotations.
1557
- * * `pdfPrinting` - Accessibility support for PDF printing enabled.
1558
- *
1559
- * To disable all supported features, pass an empty array `[]`.
1560
- *
1561
- * Example:
1562
- *
1563
- * @platform darwin,win32
1564
- */
1565
- setAccessibilitySupportFeatures(features: string[]): void;
1566
1514
  /**
1567
1515
  * Sets the activation policy for a given app.
1568
1516
  *
@@ -5877,11 +5825,15 @@ declare namespace Electron {
5877
5825
  /**
5878
5826
  * Prevents the window contents from being captured by other apps.
5879
5827
  *
5880
- * On macOS it sets the NSWindow's `sharingType` to `NSWindowSharingNone`. On
5881
- * Windows it calls `SetWindowDisplayAffinity` with `WDA_EXCLUDEFROMCAPTURE`. For
5882
- * Windows 10 version 2004 and up the window will be removed from capture entirely,
5883
- * older Windows versions behave as if `WDA_MONITOR` is applied capturing a black
5884
- * window.
5828
+ * On Windows, it calls `SetWindowDisplayAffinity` with `WDA_EXCLUDEFROMCAPTURE`.
5829
+ * For Windows 10 version 2004 and up the window will be removed from capture
5830
+ * entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing
5831
+ * a black window.
5832
+ *
5833
+ * On macOS, it sets the `NSWindow`'s `sharingType` to `NSWindowSharingNone`.
5834
+ * Unfortunately, due to an intentional change in macOS, newer Mac applications
5835
+ * that use `ScreenCaptureKit` will capture your window despite
5836
+ * `win.setContentProtection(true)`. See here.
5885
5837
  *
5886
5838
  * @platform darwin,win32
5887
5839
  */
@@ -7837,6 +7789,9 @@ declare namespace Electron {
7837
7789
  /**
7838
7790
  * Sets the string to be displayed in the dock’s badging area.
7839
7791
  *
7792
+ * > [!IMPORTANT] You need to ensure that your application has the permission to
7793
+ * display notifications for this method to work.
7794
+ *
7840
7795
  * @platform darwin
7841
7796
  */
7842
7797
  setBadge(text: string): void;
@@ -8240,7 +8195,7 @@ declare namespace Electron {
8240
8195
  * still return `false`. This behavior is intended by operating systems, since they
8241
8196
  * don't want applications to fight for global shortcuts.
8242
8197
  */
8243
- isRegistered(accelerator: Accelerator): boolean;
8198
+ isRegistered(accelerator: string): boolean;
8244
8199
  /**
8245
8200
  * Whether or not the shortcut was registered successfully.
8246
8201
  *
@@ -8259,7 +8214,7 @@ declare namespace Electron {
8259
8214
  * * "Media Previous Track"
8260
8215
  * * "Media Stop"
8261
8216
  */
8262
- register(accelerator: Accelerator, callback: () => void): boolean;
8217
+ register(accelerator: string, callback: () => void): boolean;
8263
8218
  /**
8264
8219
  * Registers a global shortcut of all `accelerator` items in `accelerators`. The
8265
8220
  * `callback` is called when any of the registered shortcuts are pressed by the
@@ -8277,11 +8232,11 @@ declare namespace Electron {
8277
8232
  * * "Media Previous Track"
8278
8233
  * * "Media Stop"
8279
8234
  */
8280
- registerAll(accelerators: Accelerator[], callback: () => void): void;
8235
+ registerAll(accelerators: string[], callback: () => void): void;
8281
8236
  /**
8282
8237
  * Unregisters the global shortcut of `accelerator`.
8283
8238
  */
8284
- unregister(accelerator: Accelerator): void;
8239
+ unregister(accelerator: string): void;
8285
8240
  /**
8286
8241
  * Unregisters all of the global shortcuts.
8287
8242
  */
@@ -9116,8 +9071,8 @@ declare namespace Electron {
9116
9071
  // Docs: https://electronjs.org/docs/api/structures/keyboard-input-event
9117
9072
 
9118
9073
  /**
9119
- * The character that will be sent as the keyboard event. Should only use the valid
9120
- * key codes in Accelerator.
9074
+ * The character that will be sent as the keyboard event. Should only use valid
9075
+ * Accelerator key codes.
9121
9076
  */
9122
9077
  keyCode: string;
9123
9078
  /**
@@ -9259,13 +9214,15 @@ declare namespace Electron {
9259
9214
  insert(pos: number, menuItem: MenuItem): void;
9260
9215
  /**
9261
9216
  * Pops up this menu as a context menu in the `BaseWindow`.
9217
+ *
9218
+ * > [!TIP] For more details, see the Context Menu guide.
9262
9219
  */
9263
9220
  popup(options?: PopupOptions): void;
9264
9221
  /**
9265
9222
  * A `MenuItem[]` array containing the menu's items.
9266
9223
  *
9267
- * Each `Menu` consists of multiple `MenuItem`s and each `MenuItem` can have a
9268
- * submenu.
9224
+ * Each `Menu` consists of multiple `MenuItem` instances and each `MenuItem` can
9225
+ * nest a `Menu` into its `submenu` property.
9269
9226
  */
9270
9227
  items: MenuItem[];
9271
9228
  }
@@ -9283,7 +9240,7 @@ declare namespace Electron {
9283
9240
  */
9284
9241
  accelerator?: Accelerator;
9285
9242
  /**
9286
- * A `boolean` indicating whether the item is checked, this property can be
9243
+ * A `boolean` indicating whether the item is checked. This property can be
9287
9244
  * dynamically changed.
9288
9245
  *
9289
9246
  * A `checkbox` menu item will toggle the `checked` property on and off when
@@ -9309,7 +9266,7 @@ declare namespace Electron {
9309
9266
  */
9310
9267
  commandId: number;
9311
9268
  /**
9312
- * A `boolean` indicating whether the item is enabled, this property can be
9269
+ * A `boolean` indicating whether the item is enabled. This property can be
9313
9270
  * dynamically changed.
9314
9271
  */
9315
9272
  enabled: boolean;
@@ -9318,7 +9275,7 @@ declare namespace Electron {
9318
9275
  */
9319
9276
  icon?: (NativeImage) | (string);
9320
9277
  /**
9321
- * A `string` indicating the item's unique id, this property can be dynamically
9278
+ * A `string` indicating the item's unique id. This property can be dynamically
9322
9279
  * changed.
9323
9280
  */
9324
9281
  id: string;
@@ -9391,7 +9348,7 @@ declare namespace Electron {
9391
9348
  */
9392
9349
  readonly userAccelerator: (Accelerator) | (null);
9393
9350
  /**
9394
- * A `boolean` indicating whether the item is visible, this property can be
9351
+ * A `boolean` indicating whether the item is visible. This property can be
9395
9352
  * dynamically changed.
9396
9353
  */
9397
9354
  visible: boolean;
@@ -16422,24 +16379,6 @@ declare namespace Electron {
16422
16379
  * The image data of the whole frame.
16423
16380
  */
16424
16381
  image: NativeImage) => void): this;
16425
- /**
16426
- * Emitted when a plugin process has crashed.
16427
- */
16428
- on(event: 'plugin-crashed', listener: (event: Event,
16429
- name: string,
16430
- version: string) => void): this;
16431
- off(event: 'plugin-crashed', listener: (event: Event,
16432
- name: string,
16433
- version: string) => void): this;
16434
- once(event: 'plugin-crashed', listener: (event: Event,
16435
- name: string,
16436
- version: string) => void): this;
16437
- addListener(event: 'plugin-crashed', listener: (event: Event,
16438
- name: string,
16439
- version: string) => void): this;
16440
- removeListener(event: 'plugin-crashed', listener: (event: Event,
16441
- name: string,
16442
- version: string) => void): this;
16443
16382
  /**
16444
16383
  * Emitted when the `WebContents` preferred size has changed.
16445
16384
  *
@@ -17400,6 +17339,12 @@ declare namespace Electron {
17400
17339
  * system's default printer if `deviceName` is empty and the default settings for
17401
17340
  * printing.
17402
17341
  *
17342
+ * Some possible `failureReason`s for print failure include:
17343
+ *
17344
+ * * "Invalid printer settings"
17345
+ * * "Print job canceled"
17346
+ * * "Print job failed"
17347
+ *
17403
17348
  * Use `page-break-before: always;` CSS style to force to print to a new page.
17404
17349
  *
17405
17350
  * Example usage:
@@ -17843,17 +17788,25 @@ declare namespace Electron {
17843
17788
  * A child of `webFrame` with the supplied `name`, `null` would be returned if
17844
17789
  * there's no such frame or if the frame is not in the current renderer process.
17845
17790
  */
17846
- findFrameByName(name: string): WebFrame;
17791
+ findFrameByName(name: string): (WebFrame) | (null);
17847
17792
  /**
17848
17793
  * that has the supplied `routingId`, `null` if not found.
17794
+ *
17795
+ * **Deprecated:** Use the new `webFrame.findFrameByToken` API.
17796
+ *
17797
+ * @deprecated
17798
+ */
17799
+ findFrameByRoutingId(routingId: number): (WebFrame) | (null);
17800
+ /**
17801
+ * that has the supplied `frameToken`, `null` if not found.
17849
17802
  */
17850
- findFrameByRoutingId(routingId: number): WebFrame;
17803
+ findFrameByToken(frameToken: string): (WebFrame) | (null);
17851
17804
  /**
17852
17805
  * The frame element in `webFrame's` document selected by `selector`, `null` would
17853
17806
  * be returned if `selector` does not select a frame or if the frame is not in the
17854
17807
  * current renderer process.
17855
17808
  */
17856
- getFrameForSelector(selector: string): WebFrame;
17809
+ getFrameForSelector(selector: string): (WebFrame) | (null);
17857
17810
  /**
17858
17811
  * * `images` MemoryUsageDetails
17859
17812
  * * `scripts` MemoryUsageDetails
@@ -17959,6 +17912,13 @@ declare namespace Electron {
17959
17912
  *
17960
17913
  */
17961
17914
  readonly firstChild: (WebFrame) | (null);
17915
+ /**
17916
+ * A `string` representing the unique frame token in the current renderer process.
17917
+ * Distinct WebFrame instances that refer to the same underlying frame will have
17918
+ * the same `frameToken`.
17919
+ *
17920
+ */
17921
+ readonly frameToken: string;
17962
17922
  /**
17963
17923
  * A `WebFrame | null` representing next sibling frame, the property would be
17964
17924
  * `null` if `webFrame` is the last frame in its parent or if the next sibling is
@@ -17984,6 +17944,9 @@ declare namespace Electron {
17984
17944
  * Distinct WebFrame instances that refer to the same underlying frame will have
17985
17945
  * the same `routingId`.
17986
17946
  *
17947
+ * **Deprecated:** Use the new `webFrame.frameToken` API.
17948
+ *
17949
+ * @deprecated
17987
17950
  */
17988
17951
  readonly routingId: number;
17989
17952
  /**
@@ -17999,6 +17962,11 @@ declare namespace Electron {
17999
17962
 
18000
17963
  // Docs: https://electronjs.org/docs/api/web-frame-main
18001
17964
 
17965
+ /**
17966
+ * A frame with the given process and frame token, or `null` if there is no
17967
+ * WebFrameMain associated with the given IDs.
17968
+ */
17969
+ static fromFrameToken(processId: number, frameToken: string): (WebFrameMain) | (null);
18002
17970
  /**
18003
17971
  * A frame with the given process and routing IDs, or `undefined` if there is no
18004
17972
  * WebFrameMain associated with the given IDs.
@@ -18084,6 +18052,12 @@ declare namespace Electron {
18084
18052
  *
18085
18053
  */
18086
18054
  readonly framesInSubtree: WebFrameMain[];
18055
+ /**
18056
+ * A `string` which uniquely identifies the frame within its associated renderer
18057
+ * process. This is equivalent to `webFrame.frameToken`.
18058
+ *
18059
+ */
18060
+ readonly frameToken: string;
18087
18061
  /**
18088
18062
  * An `Integer` representing the id of the frame's internal FrameTreeNode instance.
18089
18063
  * This id is browser-global and uniquely identifies a frame that hosts content.
@@ -18370,9 +18344,7 @@ declare namespace Electron {
18370
18344
  * If set, this will sandbox the renderer associated with the window, making it
18371
18345
  * compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
18372
18346
  * This is not the same as the `nodeIntegration` option and the APIs available to
18373
- * the preload script are more limited. Default is `true` since Electron 20. The
18374
- * sandbox will automatically be disabled when `nodeIntegration` is set to `true`.
18375
- * Read more about the option here.
18347
+ * the preload script are more limited. Read more about the option here.
18376
18348
  */
18377
18349
  sandbox?: boolean;
18378
18350
  /**
@@ -18762,11 +18734,6 @@ declare namespace Electron {
18762
18734
  */
18763
18735
  addEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void, useCapture?: boolean): this;
18764
18736
  removeEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void): this;
18765
- /**
18766
- * Fired when a plugin process is crashed.
18767
- */
18768
- addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
18769
- removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
18770
18737
  /**
18771
18738
  * Fired when the WebContents is destroyed.
18772
18739
  */
@@ -20964,7 +20931,10 @@ declare namespace Electron {
20964
20931
  * @platform darwin
20965
20932
  */
20966
20933
  toolTip?: string;
20967
- accelerator?: Accelerator;
20934
+ /**
20935
+ * An Accelerator string.
20936
+ */
20937
+ accelerator?: string;
20968
20938
  icon?: (NativeImage) | (string);
20969
20939
  /**
20970
20940
  * If false, the menu item will be greyed out and unclickable.
@@ -21735,11 +21705,6 @@ declare namespace Electron {
21735
21705
  fileAccessType?: ('writable' | 'readable');
21736
21706
  }
21737
21707
 
21738
- interface PluginCrashedEvent extends DOMEvent {
21739
- name: string;
21740
- version: string;
21741
- }
21742
-
21743
21708
  interface PopupOptions {
21744
21709
  /**
21745
21710
  * Default is the focused window.
@@ -23640,7 +23605,6 @@ declare namespace Electron {
23640
23605
  type Parameters = Electron.Parameters;
23641
23606
  type Payment = Electron.Payment;
23642
23607
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
23643
- type PluginCrashedEvent = Electron.PluginCrashedEvent;
23644
23608
  type PopupOptions = Electron.PopupOptions;
23645
23609
  type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
23646
23610
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
@@ -24017,7 +23981,6 @@ declare namespace Electron {
24017
23981
  type Parameters = Electron.Parameters;
24018
23982
  type Payment = Electron.Payment;
24019
23983
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
24020
- type PluginCrashedEvent = Electron.PluginCrashedEvent;
24021
23984
  type PopupOptions = Electron.PopupOptions;
24022
23985
  type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
24023
23986
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
@@ -24322,7 +24285,6 @@ declare namespace Electron {
24322
24285
  type Parameters = Electron.Parameters;
24323
24286
  type Payment = Electron.Payment;
24324
24287
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
24325
- type PluginCrashedEvent = Electron.PluginCrashedEvent;
24326
24288
  type PopupOptions = Electron.PopupOptions;
24327
24289
  type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
24328
24290
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
@@ -24624,7 +24586,6 @@ declare namespace Electron {
24624
24586
  type Parameters = Electron.Parameters;
24625
24587
  type Payment = Electron.Payment;
24626
24588
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
24627
- type PluginCrashedEvent = Electron.PluginCrashedEvent;
24628
24589
  type PopupOptions = Electron.PopupOptions;
24629
24590
  type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
24630
24591
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
@@ -25018,7 +24979,6 @@ declare namespace Electron {
25018
24979
  type Parameters = Electron.Parameters;
25019
24980
  type Payment = Electron.Payment;
25020
24981
  type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
25021
- type PluginCrashedEvent = Electron.PluginCrashedEvent;
25022
24982
  type PopupOptions = Electron.PopupOptions;
25023
24983
  type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
25024
24984
  type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "electronVersion": "37.10.2",
3
- "extractedAt": "2025-12-24T03:19:42.331Z"
2
+ "electronVersion": "38.2.0",
3
+ "extractedAt": "2025-12-24T03:19:30.248Z"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-types",
3
- "version": "37.10.2",
3
+ "version": "38.2.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript type definitions extracted from the electron package",
6
6
  "types": "./dist/electron.d.ts",