electron-types 44.0.0-alpha.2 → 44.0.0-alpha.4

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@44.0.0-alpha.2
17
+ npm install -D electron-types@44.0.0-alpha.4
18
18
  # or
19
- yarn add -D electron-types@44.0.0-alpha.2
19
+ yarn add -D electron-types@44.0.0-alpha.4
20
20
  # or
21
- pnpm add -D electron-types@44.0.0-alpha.2
21
+ pnpm add -D electron-types@44.0.0-alpha.4
22
22
  ```
23
23
 
24
24
  ## Usage
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 44.0.0-alpha.2
1
+ // Type definitions for Electron 44.0.0-alpha.4
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
@@ -1865,7 +1865,7 @@ declare namespace Electron {
1865
1865
  * resources will be leaked and your app will lose its ability to reach outside the
1866
1866
  * sandbox completely, until your app is restarted.
1867
1867
  *
1868
- * Start accessing a security scoped resource. With this method Electron
1868
+ * Start accessing a security scoped resource. With this method, Electron
1869
1869
  * applications that are packaged for the Mac App Store may reach outside their
1870
1870
  * sandbox to access files chosen by the user. See Apple's documentation for a
1871
1871
  * description of how this system works.
@@ -2297,6 +2297,20 @@ declare namespace Electron {
2297
2297
  * @platform darwin
2298
2298
  */
2299
2299
  removeListener(event: 'new-window-for-tab', listener: () => void): this;
2300
+ /**
2301
+ * Emitted after the persisted window state has been restored.
2302
+ *
2303
+ * Window state includes the window bounds (x, y, height, width) and display mode
2304
+ * (maximized, fullscreen, kiosk).
2305
+ *
2306
+ * > [!NOTE] This event is only emitted when windowStatePersistence is enabled in
2307
+ * BaseWindowConstructorOptions or in BrowserWindowConstructorOptions.
2308
+ */
2309
+ on(event: 'persisted-state-restored', listener: () => void): this;
2310
+ off(event: 'persisted-state-restored', listener: () => void): this;
2311
+ once(event: 'persisted-state-restored', listener: () => void): this;
2312
+ addListener(event: 'persisted-state-restored', listener: () => void): this;
2313
+ removeListener(event: 'persisted-state-restored', listener: () => void): this;
2300
2314
  /**
2301
2315
  * Emitted when a session is about to end due to a shutdown, machine restart, or
2302
2316
  * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
@@ -2674,6 +2688,15 @@ declare namespace Electron {
2674
2688
  * BaseWindow
2675
2689
  */
2676
2690
  constructor(options?: BaseWindowConstructorOptions);
2691
+ /**
2692
+ * Clears the saved state for a window with the given name. This removes all
2693
+ * persisted window bounds, display mode, and work area information that was
2694
+ * previously saved when `windowStatePersistence` was enabled.
2695
+ *
2696
+ * If the window `name` is empty or the window state doesn't exist, the method will
2697
+ * log a warning.
2698
+ */
2699
+ static clearPersistedState(name: string): void;
2677
2700
  /**
2678
2701
  * The window with the given `id`.
2679
2702
  */
@@ -3908,6 +3931,14 @@ declare namespace Electron {
3908
3931
  * @platform darwin,win32
3909
3932
  */
3910
3933
  movable?: boolean;
3934
+ /**
3935
+ * A unique identifier for the window, used internally by Electron to enable
3936
+ * features such as state persistence. Each window must have a distinct name. It
3937
+ * can only be reused after the corresponding window has been destroyed. An error
3938
+ * is thrown if the name is already in use. This is not the visible title shown to
3939
+ * users on the title bar.
3940
+ */
3941
+ name?: string;
3911
3942
  /**
3912
3943
  * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
3913
3944
  * (fully opaque). This is only implemented on Windows and macOS.
@@ -4025,6 +4056,13 @@ declare namespace Electron {
4025
4056
  * Window's width in pixels. Default is `800`.
4026
4057
  */
4027
4058
  width?: number;
4059
+ /**
4060
+ * Configures or enables the persistence of window state (position, size, maximized
4061
+ * state, etc.) across application restarts. Has no effect if window `name` is not
4062
+ * provided. Automatically disabled when there is no available display.
4063
+ * _Experimental_
4064
+ */
4065
+ windowStatePersistence?: (WindowStatePersistence) | (boolean);
4028
4066
  /**
4029
4067
  * (**required** if y is used) Window's left offset from screen. Default is to
4030
4068
  * center the window.
@@ -4561,6 +4599,20 @@ declare namespace Electron {
4561
4599
  removeListener(event: 'page-title-updated', listener: (event: Event,
4562
4600
  title: string,
4563
4601
  explicitSet: boolean) => void): this;
4602
+ /**
4603
+ * Emitted after the persisted window state has been restored.
4604
+ *
4605
+ * Window state includes the window bounds (x, y, height, width) and display mode
4606
+ * (maximized, fullscreen, kiosk).
4607
+ *
4608
+ * > [!NOTE] This event is only emitted when windowStatePersistence is enabled in
4609
+ * BaseWindowConstructorOptions or in BrowserWindowConstructorOptions.
4610
+ */
4611
+ on(event: 'persisted-state-restored', listener: () => void): this;
4612
+ off(event: 'persisted-state-restored', listener: () => void): this;
4613
+ once(event: 'persisted-state-restored', listener: () => void): this;
4614
+ addListener(event: 'persisted-state-restored', listener: () => void): this;
4615
+ removeListener(event: 'persisted-state-restored', listener: () => void): this;
4564
4616
  /**
4565
4617
  * Emitted when a session is about to end due to a shutdown, machine restart, or
4566
4618
  * user log-off. Calling `event.preventDefault()` can delay the system shutdown,
@@ -20327,6 +20379,22 @@ declare namespace Electron {
20327
20379
  reasons: Array<'shutdown' | 'close-app' | 'critical' | 'logoff'>;
20328
20380
  }
20329
20381
 
20382
+ interface WindowStatePersistence {
20383
+
20384
+ // Docs: https://electronjs.org/docs/api/structures/window-state-persistence
20385
+
20386
+ /**
20387
+ * Whether to persist window position and size across application restarts.
20388
+ * Defaults to `true` if not specified.
20389
+ */
20390
+ bounds?: boolean;
20391
+ /**
20392
+ * Whether to persist display modes (fullscreen, kiosk, maximized, etc.) across
20393
+ * application restarts. Defaults to `true` if not specified.
20394
+ */
20395
+ displayMode?: boolean;
20396
+ }
20397
+
20330
20398
  interface AboutPanelOptionsOptions {
20331
20399
  /**
20332
20400
  * The app's name.
@@ -25292,6 +25360,7 @@ declare namespace Electron {
25292
25360
  type WebSource = Electron.WebSource;
25293
25361
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
25294
25362
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
25363
+ type WindowStatePersistence = Electron.WindowStatePersistence;
25295
25364
  }
25296
25365
 
25297
25366
  namespace Main {
@@ -25701,6 +25770,7 @@ declare namespace Electron {
25701
25770
  type WebSource = Electron.WebSource;
25702
25771
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
25703
25772
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
25773
+ type WindowStatePersistence = Electron.WindowStatePersistence;
25704
25774
  }
25705
25775
 
25706
25776
  namespace Renderer {
@@ -26037,6 +26107,7 @@ declare namespace Electron {
26037
26107
  type WebSource = Electron.WebSource;
26038
26108
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26039
26109
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26110
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26040
26111
  }
26041
26112
 
26042
26113
  namespace Utility {
@@ -26372,6 +26443,7 @@ declare namespace Electron {
26372
26443
  type WebSource = Electron.WebSource;
26373
26444
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26374
26445
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26446
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26375
26447
  }
26376
26448
 
26377
26449
  namespace CrossProcessExports {
@@ -26802,6 +26874,7 @@ declare namespace Electron {
26802
26874
  type WebSource = Electron.WebSource;
26803
26875
  type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
26804
26876
  type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
26877
+ type WindowStatePersistence = Electron.WindowStatePersistence;
26805
26878
  }
26806
26879
 
26807
26880
  const app: App;
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "electronVersion": "44.0.0-alpha.2",
3
- "extractedAt": "2026-07-08T18:37:23.555Z"
2
+ "electronVersion": "44.0.0-alpha.4",
3
+ "extractedAt": "2026-07-17T08:22:13.899Z"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-types",
3
- "version": "44.0.0-alpha.2",
3
+ "version": "44.0.0-alpha.4",
4
4
  "type": "module",
5
5
  "description": "TypeScript type definitions extracted from the electron package",
6
6
  "types": "./dist/electron.d.ts",