1- // Type definitions for Electron 39.0 .0+wvcus.2
1+ // Type definitions for Electron 39.1 .0+wvcus
22// Project: http://electronjs.org/
33// Definitions by: The Electron Team <https://github.com/electron/electron>
44// Definitions: https://github.com/electron/typescript-definitions
@@ -1042,8 +1042,10 @@ declare namespace Electron {
10421042 */
10431043 exit(exitCode?: number): void;
10441044 /**
1045- * On Linux, focuses on the first visible window. On macOS, makes the application
1046- * the active app. On Windows, focuses on the application's first window.
1045+ * On macOS, makes the application the active app. On Windows, focuses on the
1046+ * application's first window. On Linux, either focuses on the first visible window
1047+ * (X11) or requests focus but may instead show a notification or flash the app
1048+ * icon (Wayland).
10471049 *
10481050 * You should seek to use the `steal` option as sparingly as possible.
10491051 */
@@ -5256,6 +5258,8 @@ declare namespace Electron {
52565258 addTabbedWindow(browserWindow: BrowserWindow): void;
52575259 /**
52585260 * Removes focus from the window.
5261+ *
5262+ * Not supported on Wayland (Linux).
52595263 */
52605264 blur(): void;
52615265 blurWebView(): void;
@@ -5271,6 +5275,8 @@ declare namespace Electron {
52715275 capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
52725276 /**
52735277 * Moves window to the center of the screen.
5278+ *
5279+ * Not supported on Wayland (Linux).
52745280 */
52755281 center(): void;
52765282 /**
@@ -5297,6 +5303,9 @@ declare namespace Electron {
52975303 flashFrame(flag: boolean): void;
52985304 /**
52995305 * Focuses on the window.
5306+ *
5307+ * On Wayland (Linux), the desktop environment may show a notification or flash the
5308+ * app icon if the window or app is not already focused.
53005309 */
53015310 focus(): void;
53025311 focusOnWebView(): void;
@@ -5687,7 +5696,9 @@ declare namespace Electron {
56875696 */
56885697 moveTabToNewWindow(): void;
56895698 /**
5690- * Moves window to top(z-order) regardless of focus
5699+ * Moves window to top(z-order) regardless of focus.
5700+ *
5701+ * Not supported on Wayland (Linux).
56915702 */
56925703 moveTop(): void;
56935704 /**
@@ -5845,6 +5856,8 @@ declare namespace Electron {
58455856 * Resizes and moves the window to the supplied bounds. Any properties that are not
58465857 * supplied will default to their current values.
58475858 *
5859+ * On Wayland (Linux), has the same limitations as `setSize` and `setPosition`.
5860+ *
58485861 * > [!NOTE] On macOS, the y-coordinate value cannot be smaller than the Tray
58495862 * height. The tray height has changed over time and depends on the operating
58505863 * system, but is between 20-40px. Passing a value lower than the tray height will
@@ -5868,6 +5881,9 @@ declare namespace Electron {
58685881 /**
58695882 * Resizes and moves the window's client area (e.g. the web page) to the supplied
58705883 * bounds.
5884+ *
5885+ * On Wayland (Linux), has the same limitations as `setContentSize` and
5886+ * `setPosition`.
58715887 */
58725888 setContentBounds(bounds: Rectangle, animate?: boolean): void;
58735889 /**
@@ -5888,6 +5904,9 @@ declare namespace Electron {
58885904 setContentProtection(enable: boolean): void;
58895905 /**
58905906 * Resizes the window's client area (e.g. the web page) to `width` and `height`.
5907+ *
5908+ * On Wayland (Linux), may not work as some window managers restrict programmatic
5909+ * window resizing.
58915910 */
58925911 setContentSize(width: number, height: number, animate?: boolean): void;
58935912 /**
@@ -6012,6 +6031,8 @@ declare namespace Electron {
60126031 setParentWindow(parent: (BrowserWindow) | (null)): void;
60136032 /**
60146033 * Moves window to `x` and `y`.
6034+ *
6035+ * Not supported on Wayland (Linux).
60156036 */
60166037 setPosition(x: number, y: number, animate?: boolean): void;
60176038 /**
@@ -6071,6 +6092,9 @@ declare namespace Electron {
60716092 /**
60726093 * Resizes the window to `width` and `height`. If `width` or `height` are below any
60736094 * set minimum size constraints the window will snap to its minimum size.
6095+ *
6096+ * On Wayland (Linux), may not work as some window managers restrict programmatic
6097+ * window resizing.
60746098 */
60756099 setSize(width: number, height: number, animate?: boolean): void;
60766100 /**
@@ -6216,6 +6240,8 @@ declare namespace Electron {
62166240 showDefinitionForSelection(): void;
62176241 /**
62186242 * Shows the window but doesn't focus on it.
6243+ *
6244+ * Not supported on Wayland (Linux).
62196245 */
62206246 showInactive(): void;
62216247 /**
0 commit comments