electron-types 42.0.0 → 43.0.0-alpha.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
@@ -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@42.0.0
14
+ npm install -D electron-types@43.0.0-alpha.1
15
15
  # or
16
- yarn add -D electron-types@42.0.0
16
+ yarn add -D electron-types@43.0.0-alpha.1
17
17
  # or
18
- pnpm add -D electron-types@42.0.0
18
+ pnpm add -D electron-types@43.0.0-alpha.1
19
19
  ```
20
20
 
21
21
  ## Usage
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 42.0.0
1
+ // Type definitions for Electron 43.0.0-alpha.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
@@ -1133,8 +1133,6 @@ declare namespace Electron {
1133
1133
  *
1134
1134
  * This method returns a promise that contains the application name, icon and path
1135
1135
  * of the default handler for the protocol (aka URI scheme) of a URL.
1136
- *
1137
- * @platform darwin,win32
1138
1136
  */
1139
1137
  getApplicationInfoForProtocol(url: string): Promise<Electron.ApplicationInfoForProtocolReturnValue>;
1140
1138
  /**
@@ -8034,6 +8032,11 @@ declare namespace Electron {
8034
8032
  /**
8035
8033
  * Hides the dock icon.
8036
8034
  *
8035
+ * > [!IMPORTANT] **Known issue:** Calling `dock.hide()` within one second of a
8036
+ * previous call will have no effect. As a workaround, ensure at least one second
8037
+ * has elapsed between calls — for example, by deferring with a `setTimeout` of
8038
+ * 1100ms or more after a previous call.
8039
+ *
8037
8040
  * @platform darwin
8038
8041
  */
8039
8042
  hide(): void;
@@ -9536,6 +9539,15 @@ declare namespace Electron {
9536
9539
  * An `Accelerator | null` indicating the item's accelerator, if set.
9537
9540
  */
9538
9541
  accelerator: (Accelerator) | (null);
9542
+ /**
9543
+ * A `string` indicating the item's accessibility label (used by assistive
9544
+ * technology), if set.
9545
+ *
9546
+ * This property can be dynamically changed.
9547
+ *
9548
+ * @platform darwin
9549
+ */
9550
+ accessibilityLabel: string;
9539
9551
  /**
9540
9552
  * A `boolean` indicating whether the item is checked.
9541
9553
  *
@@ -9825,13 +9837,20 @@ declare namespace Electron {
9825
9837
  *
9826
9838
  * @platform darwin
9827
9839
  */
9828
- static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
9840
+ static createFromNamedImage(imageName: string, options?: (CreateFromNamedImageOptions) | (number[])): NativeImage;
9829
9841
  /**
9830
9842
  * Creates a new `NativeImage` instance from an image file (e.g., PNG or JPEG)
9831
9843
  * located at `path`. This method returns an empty image if the `path` does not
9832
9844
  * exist, cannot be read, or is not a valid image.
9833
9845
  */
9834
9846
  static createFromPath(path: string): NativeImage;
9847
+ /**
9848
+ * Creates a new `NativeImage` instance from an SF Symbol for use in a native Menu.
9849
+ * See SF Symbols for a list of possible values.
9850
+ *
9851
+ * @platform darwin
9852
+ */
9853
+ static createMenuSymbol(imageName: string): NativeImage;
9835
9854
  /**
9836
9855
  * fulfilled with the file's thumbnail preview image, which is a NativeImage.
9837
9856
  *
@@ -11799,7 +11818,12 @@ declare namespace Electron {
11799
11818
  */
11800
11819
  getSelectedStorageBackend(): ('basic_text' | 'gnome_libsecret' | 'kwallet' | 'kwallet5' | 'kwallet6' | 'unknown');
11801
11820
  /**
11802
- * Whether encryption is available for asynchronous safeStorage operations.
11821
+ * Resolves with whether encryption is available for asynchronous safeStorage
11822
+ * operations.
11823
+ *
11824
+ * The asynchronous encryptor is initialized lazily the first time this method,
11825
+ * `encryptStringAsync`, or `decryptStringAsync` is called after the app is ready.
11826
+ * The returned promise resolves once initialization completes.
11803
11827
  */
11804
11828
  isAsyncEncryptionAvailable(): Promise<boolean>;
11805
11829
  /**
@@ -15626,6 +15650,31 @@ declare namespace Electron {
15626
15650
  * GetExitCodeProcess on Windows.
15627
15651
  */
15628
15652
  code: number) => void): this;
15653
+ /**
15654
+ * Emitted when the utility process encounters an HTTP 401 or 407 authentication
15655
+ * challenge, if the process was created with both
15656
+ * `respondToAuthRequestsFromMainProcess: true` and a `session` option. The
15657
+ * `callback` should be called with credentials to respond to the challenge.
15658
+ * Calling `callback` without arguments will cancel the request.
15659
+ *
15660
+ * This behaves the same as the `login` event on `app` but is scoped to the
15661
+ * individual utility process instance.
15662
+ */
15663
+ on(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
15664
+ authInfo: AuthInfo,
15665
+ callback: (username?: string, password?: string) => void) => void): this;
15666
+ off(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
15667
+ authInfo: AuthInfo,
15668
+ callback: (username?: string, password?: string) => void) => void): this;
15669
+ once(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
15670
+ authInfo: AuthInfo,
15671
+ callback: (username?: string, password?: string) => void) => void): this;
15672
+ addListener(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
15673
+ authInfo: AuthInfo,
15674
+ callback: (username?: string, password?: string) => void) => void): this;
15675
+ removeListener(event: 'login', listener: (authenticationResponseDetails: AuthenticationResponseDetails,
15676
+ authInfo: AuthInfo,
15677
+ callback: (username?: string, password?: string) => void) => void): this;
15629
15678
  /**
15630
15679
  * Emitted when the child process sends a message using
15631
15680
  * `process.parentPort.postMessage()`.
@@ -15718,6 +15767,11 @@ declare namespace Electron {
15718
15767
  * no-op.
15719
15768
  */
15720
15769
  removeChildView(view: View): void;
15770
+ /**
15771
+ * > [!NOTE] You must set a background color with an alpha channel (e.g.
15772
+ * `#80ffffff`) in order for the blur effect to be visible.
15773
+ */
15774
+ setBackgroundBlur(blurRadius: number): void;
15721
15775
  /**
15722
15776
  * Examples of valid `color` values:
15723
15777
  *
@@ -17742,6 +17796,31 @@ declare namespace Electron {
17742
17796
  * @deprecated
17743
17797
  */
17744
17798
  clearHistory(): void;
17799
+ /**
17800
+ * A cloned WebContents instance. This method creates a copy of the WebContents
17801
+ * with the following attributes:
17802
+ *
17803
+ * * **WebPreferences** - All preferences from the original WebContents are copied
17804
+ * * **SiteInstance** - Uses the same SiteInstance as the original. This means the
17805
+ * cloned WebContents will reuse the same render process as the original when
17806
+ * loading same-origin pages, and only spawn a new render process for cross-origin
17807
+ * navigations. This process allocation behavior is consistent with window.open and
17808
+ * tab duplication in Chromium. For more details, see Chromium's Site Isolation
17809
+ * design document.
17810
+ * * **Opener relationship** - Inherits the opener (window.opener) relationship
17811
+ * * **Navigation state** - Copies the navigation history and controller state
17812
+ *
17813
+ * The cloned WebContents is an independent instance with its own lifecycle that
17814
+ * can be destroyed separately and will not contain any open web pages.
17815
+ *
17816
+ * This API is useful for use cases where you want to create a new WebContents that
17817
+ * shares the same render process with the original for same-origin content, while
17818
+ * maintaining full lifecycle independence. Additionally, reusing the existing
17819
+ * render process can help optimize memory usage and page load speed to a certain
17820
+ * extent, as it eliminates the overhead of spawning and initializing a new render
17821
+ * process from scratch.
17822
+ */
17823
+ clone(): WebContents;
17745
17824
  /**
17746
17825
  * Closes the page, as if the web content had called `window.close()`.
17747
17826
  *
@@ -17762,6 +17841,11 @@ declare namespace Electron {
17762
17841
  * Copy the image at the given position to the clipboard.
17763
17842
  */
17764
17843
  copyImageAt(x: number, y: number): void;
17844
+ /**
17845
+ * When executed on a video media element, copies the frame at (x, y) to the
17846
+ * clipboard.
17847
+ */
17848
+ copyVideoFrameAt(x: number, y: number): void;
17765
17849
  /**
17766
17850
  * Executes the editing command `cut` in web page.
17767
17851
  */
@@ -18159,6 +18243,11 @@ declare namespace Electron {
18159
18243
  * resolves if the page is saved.
18160
18244
  */
18161
18245
  savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
18246
+ /**
18247
+ * When executed on a video media element, shows a save dialog and saves the frame
18248
+ * at (x, y) to disk.
18249
+ */
18250
+ saveVideoFrameAs(x: number, y: number): void;
18162
18251
  /**
18163
18252
  * Scrolls to the bottom of the current `webContents`.
18164
18253
  */
@@ -18753,6 +18842,11 @@ declare namespace Electron {
18753
18842
  * @experimental
18754
18843
  */
18755
18844
  collectJavaScriptCallStack(): (Promise<string>) | (Promise<void>);
18845
+ /**
18846
+ * When executed on a video media element, copies the frame at (x, y) to the
18847
+ * clipboard.
18848
+ */
18849
+ copyVideoFrameAt(x: number, y: number): void;
18756
18850
  /**
18757
18851
  * A promise that resolves with the result of the executed code or is rejected if
18758
18852
  * execution throws or results in a rejected promise.
@@ -18784,6 +18878,11 @@ declare namespace Electron {
18784
18878
  * frame has no history.
18785
18879
  */
18786
18880
  reload(): boolean;
18881
+ /**
18882
+ * When executed on a video media element, shows a save dialog and saves the frame
18883
+ * at (x, y) to disk.
18884
+ */
18885
+ saveVideoFrameAs(x: number, y: number): void;
18787
18886
  /**
18788
18887
  * Send an asynchronous message to the renderer process via `channel`, along with
18789
18888
  * arguments. Arguments will be serialized with the Structured Clone Algorithm,
@@ -20318,10 +20417,10 @@ declare namespace Electron {
20318
20417
  origin?: string;
20319
20418
  /**
20320
20419
  * The types of storages to clear, can be `cookies`, `filesystem`, `indexdb`,
20321
- * `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If
20322
- * not specified, clear all storage types.
20420
+ * `localstorage`, `shadercache`, `serviceworkers`, `cachestorage`. If not
20421
+ * specified, clear all storage types.
20323
20422
  */
20324
- storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers' | 'cachestorage'>;
20423
+ storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'serviceworkers' | 'cachestorage'>;
20325
20424
  }
20326
20425
 
20327
20426
  interface ClientCertRequestParams {
@@ -20890,6 +20989,22 @@ declare namespace Electron {
20890
20989
  scaleFactor?: number;
20891
20990
  }
20892
20991
 
20992
+ interface CreateFromNamedImageOptions {
20993
+ hslShift?: number[];
20994
+ /**
20995
+ * Defaults to `30.0`.
20996
+ */
20997
+ pointSize?: number;
20998
+ /**
20999
+ * Defaults to `regular`.
21000
+ */
21001
+ weight?: ('ultralight') | ('thin') | ('light') | ('regular') | ('medium') | ('semibold') | ('bold') | ('heavy') | ('black');
21002
+ /**
21003
+ * Defaults to `medium`.
21004
+ */
21005
+ scale?: ('small') | ('medium') | ('large');
21006
+ }
21007
+
20893
21008
  interface CreateInterruptedDownloadOptions {
20894
21009
  /**
20895
21010
  * Absolute path of the download.
@@ -21308,6 +21423,22 @@ declare namespace Electron {
21308
21423
  * Current working directory of the child process.
21309
21424
  */
21310
21425
  cwd?: string;
21426
+ /**
21427
+ * Sets the session used by the process for network requests. By default, network
21428
+ * requests from the utility process will use the system network context which does
21429
+ * not have HTTP cache support. Setting a session enables HTTP caching and other
21430
+ * session-specific network features. See session for more information.
21431
+ */
21432
+ session?: Session;
21433
+ /**
21434
+ * Sets the session used by the process according to the session's partition
21435
+ * string. If `partition` starts with `persist:`, the process will use a persistent
21436
+ * session available to all pages in the app with the same `partition`. If there is
21437
+ * no `persist:` prefix, the process will use an in-memory session. By assigning
21438
+ * the same `partition`, multiple processes can share the same session. If the
21439
+ * `session` option is set, this option is ignored.
21440
+ */
21441
+ partition?: string;
21311
21442
  /**
21312
21443
  * Allows configuring the mode for `stdout` and `stderr` of the child process.
21313
21444
  * Default is `inherit`. String value can be one of `pipe`, `ignore`, `inherit`,
@@ -21349,9 +21480,11 @@ declare namespace Electron {
21349
21480
  disclaim?: boolean;
21350
21481
  /**
21351
21482
  * With this flag, all HTTP 401 and 407 network requests created via the net module
21352
- * will allow responding to them via the `app#login` event in the main process
21353
- * instead of the default `login` event on the `ClientRequest` object. Default is
21354
- * `false`.
21483
+ * will allow responding to them via the `login` event on the `UtilityProcess`
21484
+ * instance when a `session` is provided, or via the `app#login` event in the main
21485
+ * process when using the default system network context. Without this flag, auth
21486
+ * challenges are handled by the default `login` event on the `ClientRequest`
21487
+ * object. Default is `false`.
21355
21488
  */
21356
21489
  respondToAuthRequestsFromMainProcess?: boolean;
21357
21490
  }
@@ -21777,6 +21910,7 @@ declare namespace Electron {
21777
21910
  role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleSpellChecker' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'showSubstitutions' | 'toggleSmartQuotes' | 'toggleSmartDashes' | 'toggleTextReplacement' | 'startSpeaking' | 'stopSpeaking' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'shareMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'showAllTabs' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
21778
21911
  type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio' | 'header' | 'palette');
21779
21912
  label?: string;
21913
+ accessibilityLabel?: string;
21780
21914
  /**
21781
21915
  * Available in macOS >= 14.4
21782
21916
  *
@@ -22229,7 +22363,7 @@ declare namespace Electron {
22229
22363
  *
22230
22364
  * @experimental
22231
22365
  */
22232
- sharedTexturePixelFormat?: ('argb' | 'rgbaf16');
22366
+ sharedTexturePixelFormat?: ('argb' | 'rgbaf16' | 'nv12');
22233
22367
  /**
22234
22368
  * The device scale factor of the offscreen rendering output. If not set, will use
22235
22369
  * `1` as default.
@@ -22452,6 +22586,11 @@ declare namespace Electron {
22452
22586
 
22453
22587
  interface OpenDialogOptions {
22454
22588
  title?: string;
22589
+ /**
22590
+ * Absolute directory path, absolute file path, or file name to use by default. If
22591
+ * not provided, the dialog will default to the user's Downloads folder, or their
22592
+ * home directory if Downloads doesn't exist.
22593
+ */
22455
22594
  defaultPath?: string;
22456
22595
  /**
22457
22596
  * Custom label for the confirmation button, when left empty the default label will
@@ -22500,6 +22639,11 @@ declare namespace Electron {
22500
22639
 
22501
22640
  interface OpenDialogSyncOptions {
22502
22641
  title?: string;
22642
+ /**
22643
+ * Absolute directory path, absolute file path, or file name to use by default. If
22644
+ * not provided, the dialog will default to the user's Downloads folder, or their
22645
+ * home directory if Downloads doesn't exist.
22646
+ */
22503
22647
  defaultPath?: string;
22504
22648
  /**
22505
22649
  * Custom label for the confirmation button, when left empty the default label will
@@ -23017,7 +23161,9 @@ declare namespace Electron {
23017
23161
  */
23018
23162
  title?: string;
23019
23163
  /**
23020
- * Absolute directory path, absolute file path, or file name to use by default.
23164
+ * Absolute directory path, absolute file path, or file name to use by default. If
23165
+ * not provided, the dialog will default to the user's Downloads folder, or their
23166
+ * home directory if Downloads doesn't exist.
23021
23167
  */
23022
23168
  defaultPath?: string;
23023
23169
  /**
@@ -23080,7 +23226,9 @@ declare namespace Electron {
23080
23226
  */
23081
23227
  title?: string;
23082
23228
  /**
23083
- * Absolute directory path, absolute file path, or file name to use by default.
23229
+ * Absolute directory path, absolute file path, or file name to use by default. If
23230
+ * not provided, the dialog will default to the user's Downloads folder, or their
23231
+ * home directory if Downloads doesn't exist.
23084
23232
  */
23085
23233
  defaultPath?: string;
23086
23234
  /**
@@ -24618,6 +24766,7 @@ declare namespace Electron {
24618
24766
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
24619
24767
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
24620
24768
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
24769
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
24621
24770
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
24622
24771
  type Data = Electron.Data;
24623
24772
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
@@ -25024,6 +25173,7 @@ declare namespace Electron {
25024
25173
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
25025
25174
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
25026
25175
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
25176
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
25027
25177
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
25028
25178
  type Data = Electron.Data;
25029
25179
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
@@ -25358,6 +25508,7 @@ declare namespace Electron {
25358
25508
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
25359
25509
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
25360
25510
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
25511
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
25361
25512
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
25362
25513
  type Data = Electron.Data;
25363
25514
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
@@ -25691,6 +25842,7 @@ declare namespace Electron {
25691
25842
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
25692
25843
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
25693
25844
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
25845
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
25694
25846
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
25695
25847
  type Data = Electron.Data;
25696
25848
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
@@ -26118,6 +26270,7 @@ declare namespace Electron {
26118
26270
  type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
26119
26271
  type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
26120
26272
  type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
26273
+ type CreateFromNamedImageOptions = Electron.CreateFromNamedImageOptions;
26121
26274
  type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
26122
26275
  type Data = Electron.Data;
26123
26276
  type DecryptStringAsyncReturnValue = Electron.DecryptStringAsyncReturnValue;
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "electronVersion": "42.0.0",
3
- "extractedAt": "2026-05-06T07:09:19.029Z"
2
+ "electronVersion": "43.0.0-alpha.1",
3
+ "extractedAt": "2026-05-07T01:04:05.678Z"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-types",
3
- "version": "42.0.0",
3
+ "version": "43.0.0-alpha.1",
4
4
  "type": "module",
5
5
  "description": "TypeScript type definitions extracted from the electron package",
6
6
  "types": "./dist/electron.d.ts",