electron-types 43.6.0 → 43.7.1

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@43.6.0
17
+ npm install -D electron-types@43.7.1
18
18
  # or
19
- yarn add -D electron-types@43.6.0
19
+ yarn add -D electron-types@43.7.1
20
20
  # or
21
- pnpm add -D electron-types@43.6.0
21
+ pnpm add -D electron-types@43.7.1
22
22
  ```
23
23
 
24
24
  ## Usage
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 43.6.0
1
+ // Type definitions for Electron 43.7.1
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
@@ -8239,6 +8239,14 @@ declare namespace Electron {
8239
8239
  * actual name of saved file will be different.
8240
8240
  */
8241
8241
  getFilename(): string;
8242
+ /**
8243
+ * The origin that started the download (for example `https://example.com`, or
8244
+ * `null` for an opaque origin), or an empty string if the download was not started
8245
+ * by web content (for example `webContents.downloadURL()`). Use this rather than
8246
+ * `getURL()` or the `webContents` to decide whose download it is: the URL is
8247
+ * chosen by the initiator and the `webContents` is the whole tab.
8248
+ */
8249
+ getInitiatorOrigin(): string;
8242
8250
  /**
8243
8251
  * Last-Modified header value.
8244
8252
  */
@@ -11533,6 +11541,12 @@ declare namespace Electron {
11533
11541
  * Register a protocol handler for `scheme`. Requests made to URLs with this scheme
11534
11542
  * will delegate to this handler to determine what response should be sent.
11535
11543
  *
11544
+ * In addition to the standard `Request` fields, `request.initiatorOrigin` is set
11545
+ * to the origin that issued the request (for example `https://example.com`, or
11546
+ * `null` for an opaque origin) when web content made it; it is absent for requests
11547
+ * the browser started itself. Unlike `request.referrer` it is not controlled by
11548
+ * the requesting page, so prefer it when deciding whether to serve a request.
11549
+ *
11536
11550
  * Either a `Response` or a `Promise<Response>` can be returned.
11537
11551
  *
11538
11552
  * Example:
@@ -11737,6 +11751,12 @@ declare namespace Electron {
11737
11751
  // Docs: https://electronjs.org/docs/api/structures/protocol-request
11738
11752
 
11739
11753
  headers: Record<string, string>;
11754
+ /**
11755
+ * The origin that issued the request (for example `https://example.com`, or `null`
11756
+ * for an opaque origin). Absent for requests the browser started itself. Unlike
11757
+ * `referrer`, this is not controlled by the requesting page.
11758
+ */
11759
+ initiatorOrigin?: string;
11740
11760
  method: string;
11741
11761
  referrer: string;
11742
11762
  uploadData?: UploadData[];
@@ -12605,7 +12625,11 @@ declare namespace Electron {
12605
12625
  * True if the renderer is requesting that the connection include credentials (see
12606
12626
  * the spec for more details.)
12607
12627
  */
12608
- allowCredentials: boolean) => void): this;
12628
+ allowCredentials: boolean,
12629
+ /**
12630
+ * The frame that requested the preconnection, if it still exists.
12631
+ */
12632
+ frame: (WebFrameMain) | (null)) => void): this;
12609
12633
  off(event: 'preconnect', listener: (event: Event,
12610
12634
  /**
12611
12635
  * The URL being requested for preconnection by the renderer.
@@ -12615,7 +12639,11 @@ declare namespace Electron {
12615
12639
  * True if the renderer is requesting that the connection include credentials (see
12616
12640
  * the spec for more details.)
12617
12641
  */
12618
- allowCredentials: boolean) => void): this;
12642
+ allowCredentials: boolean,
12643
+ /**
12644
+ * The frame that requested the preconnection, if it still exists.
12645
+ */
12646
+ frame: (WebFrameMain) | (null)) => void): this;
12619
12647
  once(event: 'preconnect', listener: (event: Event,
12620
12648
  /**
12621
12649
  * The URL being requested for preconnection by the renderer.
@@ -12625,7 +12653,11 @@ declare namespace Electron {
12625
12653
  * True if the renderer is requesting that the connection include credentials (see
12626
12654
  * the spec for more details.)
12627
12655
  */
12628
- allowCredentials: boolean) => void): this;
12656
+ allowCredentials: boolean,
12657
+ /**
12658
+ * The frame that requested the preconnection, if it still exists.
12659
+ */
12660
+ frame: (WebFrameMain) | (null)) => void): this;
12629
12661
  addListener(event: 'preconnect', listener: (event: Event,
12630
12662
  /**
12631
12663
  * The URL being requested for preconnection by the renderer.
@@ -12635,7 +12667,11 @@ declare namespace Electron {
12635
12667
  * True if the renderer is requesting that the connection include credentials (see
12636
12668
  * the spec for more details.)
12637
12669
  */
12638
- allowCredentials: boolean) => void): this;
12670
+ allowCredentials: boolean,
12671
+ /**
12672
+ * The frame that requested the preconnection, if it still exists.
12673
+ */
12674
+ frame: (WebFrameMain) | (null)) => void): this;
12639
12675
  removeListener(event: 'preconnect', listener: (event: Event,
12640
12676
  /**
12641
12677
  * The URL being requested for preconnection by the renderer.
@@ -12645,7 +12681,11 @@ declare namespace Electron {
12645
12681
  * True if the renderer is requesting that the connection include credentials (see
12646
12682
  * the spec for more details.)
12647
12683
  */
12648
- allowCredentials: boolean) => void): this;
12684
+ allowCredentials: boolean,
12685
+ /**
12686
+ * The frame that requested the preconnection, if it still exists.
12687
+ */
12688
+ frame: (WebFrameMain) | (null)) => void): this;
12649
12689
  /**
12650
12690
  * Emitted when a HID device needs to be selected when a call to
12651
12691
  * `navigator.hid.requestDevice` is made. `callback` should be called with
@@ -12983,26 +13023,47 @@ declare namespace Electron {
12983
13023
  removeListener(event: 'usb-device-revoked', listener: (event: Event,
12984
13024
  details: UsbDeviceRevokedDetails) => void): this;
12985
13025
  /**
12986
- * Emitted when Electron is about to download `item` in `webContents`.
13026
+ * Emitted when Electron is about to download `item` in `webContents`. See also
13027
+ * `item.getInitiatorOrigin()`.
12987
13028
  *
12988
13029
  * Calling `event.preventDefault()` will cancel the download and `item` will not be
12989
13030
  * available from next tick of the process.
12990
13031
  */
12991
13032
  on(event: 'will-download', listener: (event: Event,
12992
13033
  item: DownloadItem,
12993
- webContents: WebContents) => void): this;
13034
+ webContents: WebContents,
13035
+ /**
13036
+ * The frame that started the download, if it still exists.
13037
+ */
13038
+ frame: (WebFrameMain) | (null)) => void): this;
12994
13039
  off(event: 'will-download', listener: (event: Event,
12995
13040
  item: DownloadItem,
12996
- webContents: WebContents) => void): this;
13041
+ webContents: WebContents,
13042
+ /**
13043
+ * The frame that started the download, if it still exists.
13044
+ */
13045
+ frame: (WebFrameMain) | (null)) => void): this;
12997
13046
  once(event: 'will-download', listener: (event: Event,
12998
13047
  item: DownloadItem,
12999
- webContents: WebContents) => void): this;
13048
+ webContents: WebContents,
13049
+ /**
13050
+ * The frame that started the download, if it still exists.
13051
+ */
13052
+ frame: (WebFrameMain) | (null)) => void): this;
13000
13053
  addListener(event: 'will-download', listener: (event: Event,
13001
13054
  item: DownloadItem,
13002
- webContents: WebContents) => void): this;
13055
+ webContents: WebContents,
13056
+ /**
13057
+ * The frame that started the download, if it still exists.
13058
+ */
13059
+ frame: (WebFrameMain) | (null)) => void): this;
13003
13060
  removeListener(event: 'will-download', listener: (event: Event,
13004
13061
  item: DownloadItem,
13005
- webContents: WebContents) => void): this;
13062
+ webContents: WebContents,
13063
+ /**
13064
+ * The frame that started the download, if it still exists.
13065
+ */
13066
+ frame: (WebFrameMain) | (null)) => void): this;
13006
13067
  /**
13007
13068
  * Whether the word was successfully written to the custom dictionary. This API
13008
13069
  * will not work on non-persistent (in-memory) sessions.
@@ -13373,8 +13434,12 @@ declare namespace Electron {
13373
13434
  * is available and `useSystemPicker` is set to `true`, the handler will not be
13374
13435
  * invoked.
13375
13436
  *
13376
- * Passing a WebFrameMain object as a video or audio stream will capture the video
13377
- * or audio stream from that frame.
13437
+ * Passing a WebFrameMain object as a video or audio stream captures the whole
13438
+ * `webContents` that contains that frame (the tab), not just the frame:
13439
+ * `request.frame` from an `<iframe>` therefore grants that iframe a capture of the
13440
+ * page that embeds it. Check `request.frame` before using it this way, and note
13441
+ * that the callback throws if the frame has been destroyed by the time it is
13442
+ * called.
13378
13443
  *
13379
13444
  * Passing `null` instead of a function resets the handler to its default state.
13380
13445
  */
@@ -18149,7 +18214,9 @@ declare namespace Electron {
18149
18214
  * The identifier of a WebContents stream. This identifier can be used with
18150
18215
  * `navigator.mediaDevices.getUserMedia` using a `chromeMediaSource` of `tab`. The
18151
18216
  * identifier is restricted to the web contents that it is registered to and is
18152
- * only valid for 10 seconds.
18217
+ * only valid for 10 seconds. The `desktop` source only accepts screen and window
18218
+ * identifiers from `desktopCapturer.getSources`; to capture a WebContents use this
18219
+ * identifier with the `tab` source, or `ses.setDisplayMediaRequestHandler`.
18153
18220
  */
18154
18221
  getMediaSourceId(requestWebContents: WebContents): string;
18155
18222
  /**
@@ -19419,8 +19486,10 @@ declare namespace Electron {
19419
19486
  */
19420
19487
  nodeIntegrationInSubFrames?: boolean;
19421
19488
  /**
19422
- * Whether node integration is enabled in web workers. Default is `false`. More
19423
- * about this can be found in Multithreading.
19489
+ * Whether node integration is enabled in web workers. Default is `false`. Only
19490
+ * workers created by a frame that itself has access to Node.js (the main frame, or
19491
+ * any frame when `nodeIntegrationInSubFrames` is enabled) get it. More about this
19492
+ * can be found in Multithreading.
19424
19493
  */
19425
19494
  nodeIntegrationInWorker?: boolean;
19426
19495
  /**
@@ -19985,6 +20054,10 @@ declare namespace Electron {
19985
20054
  removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
19986
20055
  /**
19987
20056
  * Fired when the guest page has sent an asynchronous message to embedder page.
20057
+ * `frameId` does not tell the embedder which document sent the message; when that
20058
+ * matters, have the guest use `ipcRenderer.send()` and handle the guest
20059
+ * `webContents`' `ipc-message` event in the main process, where
20060
+ * `event.senderFrame` identifies the sender.
19988
20061
  *
19989
20062
  * With `sendToHost` method and `ipc-message` event you can communicate between
19990
20063
  * guest page and embedder page:
@@ -20367,7 +20440,9 @@ declare namespace Electron {
20367
20440
  unselect(): void;
20368
20441
  /**
20369
20442
  * A `boolean`. When this attribute is present the guest page will be allowed to
20370
- * open new windows. Popups are disabled by default.
20443
+ * open new windows, whether through `window.open()` or a link opened into a new
20444
+ * window (for example a modifier-clicked or `target="_blank"` link). Popups are
20445
+ * disabled by default.
20371
20446
  */
20372
20447
  allowpopups: boolean;
20373
20448
  /**
@@ -21805,6 +21880,15 @@ declare namespace Electron {
21805
21880
  * The blocked path attempting to be accessed.
21806
21881
  */
21807
21882
  path: string;
21883
+ /**
21884
+ * The frame that initiated access. May be `null` if the frame has since been
21885
+ * destroyed.
21886
+ */
21887
+ frame: (WebFrameMain) | (null);
21888
+ /**
21889
+ * The WebContents that contains `frame`.
21890
+ */
21891
+ webContents: (WebContents) | (null);
21808
21892
  }
21809
21893
 
21810
21894
  interface FindInPageOptions {
@@ -22811,6 +22895,12 @@ declare namespace Electron {
22811
22895
  * or been destroyed.
22812
22896
  */
22813
22897
  frame?: (WebFrameMain) | (null);
22898
+ /**
22899
+ * The origin that issued the request (for example `https://example.com`, or `null`
22900
+ * for an opaque origin). Kept from the original request across redirects; absent
22901
+ * for requests the browser started itself.
22902
+ */
22903
+ initiatorOrigin?: string;
22814
22904
  /**
22815
22905
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22816
22906
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22840,6 +22930,12 @@ declare namespace Electron {
22840
22930
  * or been destroyed.
22841
22931
  */
22842
22932
  frame?: (WebFrameMain) | (null);
22933
+ /**
22934
+ * The origin that issued the request (for example `https://example.com`, or `null`
22935
+ * for an opaque origin). Kept from the original request across redirects; absent
22936
+ * for requests the browser started itself.
22937
+ */
22938
+ initiatorOrigin?: string;
22843
22939
  /**
22844
22940
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22845
22941
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22861,6 +22957,12 @@ declare namespace Electron {
22861
22957
  * or been destroyed.
22862
22958
  */
22863
22959
  frame?: (WebFrameMain) | (null);
22960
+ /**
22961
+ * The origin that issued the request (for example `https://example.com`, or `null`
22962
+ * for an opaque origin). Kept from the original request across redirects; absent
22963
+ * for requests the browser started itself.
22964
+ */
22965
+ initiatorOrigin?: string;
22864
22966
  /**
22865
22967
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22866
22968
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22883,6 +22985,12 @@ declare namespace Electron {
22883
22985
  * or been destroyed.
22884
22986
  */
22885
22987
  frame?: (WebFrameMain) | (null);
22988
+ /**
22989
+ * The origin that issued the request (for example `https://example.com`, or `null`
22990
+ * for an opaque origin). Kept from the original request across redirects; absent
22991
+ * for requests the browser started itself.
22992
+ */
22993
+ initiatorOrigin?: string;
22886
22994
  /**
22887
22995
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22888
22996
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22908,6 +23016,12 @@ declare namespace Electron {
22908
23016
  * or been destroyed.
22909
23017
  */
22910
23018
  frame?: (WebFrameMain) | (null);
23019
+ /**
23020
+ * The origin that issued the request (for example `https://example.com`, or `null`
23021
+ * for an opaque origin). Kept from the original request across redirects; absent
23022
+ * for requests the browser started itself.
23023
+ */
23024
+ initiatorOrigin?: string;
22911
23025
  /**
22912
23026
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22913
23027
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22933,6 +23047,12 @@ declare namespace Electron {
22933
23047
  * or been destroyed.
22934
23048
  */
22935
23049
  frame?: (WebFrameMain) | (null);
23050
+ /**
23051
+ * The origin that issued the request (for example `https://example.com`, or `null`
23052
+ * for an opaque origin). Kept from the original request across redirects; absent
23053
+ * for requests the browser started itself.
23054
+ */
23055
+ initiatorOrigin?: string;
22936
23056
  /**
22937
23057
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22938
23058
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22956,6 +23076,12 @@ declare namespace Electron {
22956
23076
  * or been destroyed.
22957
23077
  */
22958
23078
  frame?: (WebFrameMain) | (null);
23079
+ /**
23080
+ * The origin that issued the request (for example `https://example.com`, or `null`
23081
+ * for an opaque origin). Kept from the original request across redirects; absent
23082
+ * for requests the browser started itself.
23083
+ */
23084
+ initiatorOrigin?: string;
22959
23085
  /**
22960
23086
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22961
23087
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -22983,6 +23109,12 @@ declare namespace Electron {
22983
23109
  * or been destroyed.
22984
23110
  */
22985
23111
  frame?: (WebFrameMain) | (null);
23112
+ /**
23113
+ * The origin that issued the request (for example `https://example.com`, or `null`
23114
+ * for an opaque origin). Kept from the original request across redirects; absent
23115
+ * for requests the browser started itself.
23116
+ */
23117
+ initiatorOrigin?: string;
22986
23118
  /**
22987
23119
  * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
22988
23120
  * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
@@ -23201,7 +23333,8 @@ declare namespace Electron {
23201
23333
  */
23202
23334
  embeddingOrigin?: string;
23203
23335
  /**
23204
- * The security origin of the `media` check.
23336
+ * The origin of the requesting frame, for `media`, `hid`, `usb` and `serial`
23337
+ * checks.
23205
23338
  */
23206
23339
  securityOrigin?: string;
23207
23340
  /**
@@ -23209,8 +23342,8 @@ declare namespace Electron {
23209
23342
  */
23210
23343
  mediaType?: ('video' | 'audio' | 'unknown');
23211
23344
  /**
23212
- * The last URL the requesting frame loaded. This is not provided for cross-origin
23213
- * sub frames making permission checks.
23345
+ * The last URL the requesting frame loaded. Not provided when the check is not
23346
+ * made on behalf of a document (for example for a service worker).
23214
23347
  */
23215
23348
  requestingUrl?: string;
23216
23349
  /**
@@ -23822,7 +23955,8 @@ declare namespace Electron {
23822
23955
  /**
23823
23956
  * If a string is specified, can be `loopback` or `loopbackWithMute`. Specifying a
23824
23957
  * loopback device will capture system audio, and is currently only supported on
23825
- * Windows. If a WebFrameMain is specified, will capture audio from that frame.
23958
+ * Windows. If a WebFrameMain is specified, will capture audio from the
23959
+ * `webContents` that contains that frame.
23826
23960
  */
23827
23961
  audio?: (('loopback' | 'loopbackWithMute')) | (WebFrameMain);
23828
23962
  /**
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "electronVersion": "43.6.0",
3
- "extractedAt": "2026-09-04T03:26:52.279Z"
2
+ "electronVersion": "43.7.1",
3
+ "extractedAt": "2026-09-15T18:14:38.145Z"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-types",
3
- "version": "43.6.0",
3
+ "version": "43.7.1",
4
4
  "type": "module",
5
5
  "description": "TypeScript type definitions extracted from the electron package",
6
6
  "types": "./dist/electron.d.ts",