electron 29.0.0 → 30.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/checksums.json +75 -75
- package/electron.d.ts +2625 -361
- package/package.json +1 -1
package/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron
|
|
1
|
+
// Type definitions for Electron 30.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
|
|
@@ -1924,80 +1924,9 @@ declare namespace Electron {
|
|
|
1924
1924
|
setFeedURL(options: FeedURLOptions): void;
|
|
1925
1925
|
}
|
|
1926
1926
|
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
// Docs: https://electronjs.org/docs/api/structures/bluetooth-device
|
|
1930
|
-
|
|
1931
|
-
deviceId: string;
|
|
1932
|
-
deviceName: string;
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
class BrowserView {
|
|
1936
|
-
|
|
1937
|
-
// Docs: https://electronjs.org/docs/api/browser-view
|
|
1938
|
-
|
|
1939
|
-
/**
|
|
1940
|
-
* BrowserView
|
|
1941
|
-
*/
|
|
1942
|
-
constructor(options?: BrowserViewConstructorOptions);
|
|
1943
|
-
/**
|
|
1944
|
-
* The `bounds` of this BrowserView instance as `Object`.
|
|
1945
|
-
*
|
|
1946
|
-
* @experimental
|
|
1947
|
-
*/
|
|
1948
|
-
getBounds(): Rectangle;
|
|
1949
|
-
/**
|
|
1950
|
-
* @experimental
|
|
1951
|
-
*/
|
|
1952
|
-
setAutoResize(options: AutoResizeOptions): void;
|
|
1953
|
-
/**
|
|
1954
|
-
* Examples of valid `color` values:
|
|
1955
|
-
*
|
|
1956
|
-
* * Hex
|
|
1957
|
-
* * #fff (RGB)
|
|
1958
|
-
* * #ffff (ARGB)
|
|
1959
|
-
* * #ffffff (RRGGBB)
|
|
1960
|
-
* * #ffffffff (AARRGGBB)
|
|
1961
|
-
* * RGB
|
|
1962
|
-
* * rgb(([\d]+),\s*([\d]+),\s*([\d]+))
|
|
1963
|
-
* * e.g. rgb(255, 255, 255)
|
|
1964
|
-
* * RGBA
|
|
1965
|
-
* * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))
|
|
1966
|
-
* * e.g. rgba(255, 255, 255, 1.0)
|
|
1967
|
-
* * HSL
|
|
1968
|
-
* * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%)
|
|
1969
|
-
* * e.g. hsl(200, 20%, 50%)
|
|
1970
|
-
* * HSLA
|
|
1971
|
-
* * hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+))
|
|
1972
|
-
* * e.g. hsla(200, 20%, 50%, 0.5)
|
|
1973
|
-
* * Color name
|
|
1974
|
-
* * Options are listed in SkParseColor.cpp
|
|
1975
|
-
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
|
1976
|
-
* * e.g. `blueviolet` or `red`
|
|
1977
|
-
*
|
|
1978
|
-
* **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBA` or
|
|
1979
|
-
* `RGA`.
|
|
1980
|
-
*
|
|
1981
|
-
* @experimental
|
|
1982
|
-
*/
|
|
1983
|
-
setBackgroundColor(color: string): void;
|
|
1984
|
-
/**
|
|
1985
|
-
* Resizes and moves the view to the supplied bounds relative to the window.
|
|
1986
|
-
*
|
|
1987
|
-
* @experimental
|
|
1988
|
-
*/
|
|
1989
|
-
setBounds(bounds: Rectangle): void;
|
|
1990
|
-
/**
|
|
1991
|
-
* A `WebContents` object owned by this view.
|
|
1992
|
-
*
|
|
1993
|
-
* @experimental
|
|
1994
|
-
*/
|
|
1995
|
-
webContents: WebContents;
|
|
1996
|
-
}
|
|
1927
|
+
class BaseWindow extends NodeEventEmitter {
|
|
1997
1928
|
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
// Docs: https://electronjs.org/docs/api/browser-window
|
|
1929
|
+
// Docs: https://electronjs.org/docs/api/base-window
|
|
2001
1930
|
|
|
2002
1931
|
/**
|
|
2003
1932
|
* Emitted when the window is set or unset to show always on top of other windows.
|
|
@@ -2096,14 +2025,6 @@ declare namespace Electron {
|
|
|
2096
2025
|
once(event: 'enter-full-screen', listener: Function): this;
|
|
2097
2026
|
addListener(event: 'enter-full-screen', listener: Function): this;
|
|
2098
2027
|
removeListener(event: 'enter-full-screen', listener: Function): this;
|
|
2099
|
-
/**
|
|
2100
|
-
* Emitted when the window enters a full-screen state triggered by HTML API.
|
|
2101
|
-
*/
|
|
2102
|
-
on(event: 'enter-html-full-screen', listener: Function): this;
|
|
2103
|
-
off(event: 'enter-html-full-screen', listener: Function): this;
|
|
2104
|
-
once(event: 'enter-html-full-screen', listener: Function): this;
|
|
2105
|
-
addListener(event: 'enter-html-full-screen', listener: Function): this;
|
|
2106
|
-
removeListener(event: 'enter-html-full-screen', listener: Function): this;
|
|
2107
2028
|
/**
|
|
2108
2029
|
* Emitted when the window gains focus.
|
|
2109
2030
|
*/
|
|
@@ -2128,14 +2049,6 @@ declare namespace Electron {
|
|
|
2128
2049
|
once(event: 'leave-full-screen', listener: Function): this;
|
|
2129
2050
|
addListener(event: 'leave-full-screen', listener: Function): this;
|
|
2130
2051
|
removeListener(event: 'leave-full-screen', listener: Function): this;
|
|
2131
|
-
/**
|
|
2132
|
-
* Emitted when the window leaves a full-screen state triggered by HTML API.
|
|
2133
|
-
*/
|
|
2134
|
-
on(event: 'leave-html-full-screen', listener: Function): this;
|
|
2135
|
-
off(event: 'leave-html-full-screen', listener: Function): this;
|
|
2136
|
-
once(event: 'leave-html-full-screen', listener: Function): this;
|
|
2137
|
-
addListener(event: 'leave-html-full-screen', listener: Function): this;
|
|
2138
|
-
removeListener(event: 'leave-html-full-screen', listener: Function): this;
|
|
2139
2052
|
/**
|
|
2140
2053
|
* Emitted when window is maximized.
|
|
2141
2054
|
*/
|
|
@@ -2206,39 +2119,6 @@ declare namespace Electron {
|
|
|
2206
2119
|
* @platform darwin
|
|
2207
2120
|
*/
|
|
2208
2121
|
removeListener(event: 'new-window-for-tab', listener: Function): this;
|
|
2209
|
-
/**
|
|
2210
|
-
* Emitted when the document changed its title, calling `event.preventDefault()`
|
|
2211
|
-
* will prevent the native window's title from changing. `explicitSet` is false
|
|
2212
|
-
* when title is synthesized from file URL.
|
|
2213
|
-
*/
|
|
2214
|
-
on(event: 'page-title-updated', listener: (event: Event,
|
|
2215
|
-
title: string,
|
|
2216
|
-
explicitSet: boolean) => void): this;
|
|
2217
|
-
off(event: 'page-title-updated', listener: (event: Event,
|
|
2218
|
-
title: string,
|
|
2219
|
-
explicitSet: boolean) => void): this;
|
|
2220
|
-
once(event: 'page-title-updated', listener: (event: Event,
|
|
2221
|
-
title: string,
|
|
2222
|
-
explicitSet: boolean) => void): this;
|
|
2223
|
-
addListener(event: 'page-title-updated', listener: (event: Event,
|
|
2224
|
-
title: string,
|
|
2225
|
-
explicitSet: boolean) => void): this;
|
|
2226
|
-
removeListener(event: 'page-title-updated', listener: (event: Event,
|
|
2227
|
-
title: string,
|
|
2228
|
-
explicitSet: boolean) => void): this;
|
|
2229
|
-
/**
|
|
2230
|
-
* Emitted when the web page has been rendered (while not being shown) and window
|
|
2231
|
-
* can be displayed without a visual flash.
|
|
2232
|
-
*
|
|
2233
|
-
* Please note that using this event implies that the renderer will be considered
|
|
2234
|
-
* "visible" and paint even though `show` is false. This event will never fire if
|
|
2235
|
-
* you use `paintWhenInitiallyHidden: false`
|
|
2236
|
-
*/
|
|
2237
|
-
on(event: 'ready-to-show', listener: Function): this;
|
|
2238
|
-
off(event: 'ready-to-show', listener: Function): this;
|
|
2239
|
-
once(event: 'ready-to-show', listener: Function): this;
|
|
2240
|
-
addListener(event: 'ready-to-show', listener: Function): this;
|
|
2241
|
-
removeListener(event: 'ready-to-show', listener: Function): this;
|
|
2242
2122
|
/**
|
|
2243
2123
|
* Emitted after the window has been resized.
|
|
2244
2124
|
*/
|
|
@@ -2273,14 +2153,6 @@ declare namespace Electron {
|
|
|
2273
2153
|
* @platform darwin,win32
|
|
2274
2154
|
*/
|
|
2275
2155
|
removeListener(event: 'resized', listener: Function): this;
|
|
2276
|
-
/**
|
|
2277
|
-
* Emitted when the unresponsive web page becomes responsive again.
|
|
2278
|
-
*/
|
|
2279
|
-
on(event: 'responsive', listener: Function): this;
|
|
2280
|
-
off(event: 'responsive', listener: Function): this;
|
|
2281
|
-
once(event: 'responsive', listener: Function): this;
|
|
2282
|
-
addListener(event: 'responsive', listener: Function): this;
|
|
2283
|
-
removeListener(event: 'responsive', listener: Function): this;
|
|
2284
2156
|
/**
|
|
2285
2157
|
* Emitted when the window is restored from a minimized state.
|
|
2286
2158
|
*/
|
|
@@ -2485,14 +2357,6 @@ declare namespace Electron {
|
|
|
2485
2357
|
once(event: 'unmaximize', listener: Function): this;
|
|
2486
2358
|
addListener(event: 'unmaximize', listener: Function): this;
|
|
2487
2359
|
removeListener(event: 'unmaximize', listener: Function): this;
|
|
2488
|
-
/**
|
|
2489
|
-
* Emitted when the web page becomes unresponsive.
|
|
2490
|
-
*/
|
|
2491
|
-
on(event: 'unresponsive', listener: Function): this;
|
|
2492
|
-
off(event: 'unresponsive', listener: Function): this;
|
|
2493
|
-
once(event: 'unresponsive', listener: Function): this;
|
|
2494
|
-
addListener(event: 'unresponsive', listener: Function): this;
|
|
2495
|
-
removeListener(event: 'unresponsive', listener: Function): this;
|
|
2496
2360
|
/**
|
|
2497
2361
|
* Emitted before the window is moved. On Windows, calling `event.preventDefault()`
|
|
2498
2362
|
* will prevent the window from being moved.
|
|
@@ -2600,58 +2464,31 @@ declare namespace Electron {
|
|
|
2600
2464
|
newBounds: Rectangle,
|
|
2601
2465
|
details: WillResizeDetails) => void): this;
|
|
2602
2466
|
/**
|
|
2603
|
-
*
|
|
2604
|
-
*/
|
|
2605
|
-
constructor(options?: BrowserWindowConstructorOptions);
|
|
2606
|
-
/**
|
|
2607
|
-
* The window that owns the given `browserView`. If the given view is not attached
|
|
2608
|
-
* to any window, returns `null`.
|
|
2467
|
+
* BaseWindow
|
|
2609
2468
|
*/
|
|
2610
|
-
|
|
2469
|
+
constructor(options?: BaseWindowConstructorOptions);
|
|
2611
2470
|
/**
|
|
2612
2471
|
* The window with the given `id`.
|
|
2613
2472
|
*/
|
|
2614
|
-
static fromId(id: number): (
|
|
2615
|
-
/**
|
|
2616
|
-
* The window that owns the given `webContents` or `null` if the contents are not
|
|
2617
|
-
* owned by a window.
|
|
2618
|
-
*/
|
|
2619
|
-
static fromWebContents(webContents: WebContents): (BrowserWindow) | (null);
|
|
2473
|
+
static fromId(id: number): (BaseWindow) | (null);
|
|
2620
2474
|
/**
|
|
2621
2475
|
* An array of all opened browser windows.
|
|
2622
2476
|
*/
|
|
2623
|
-
static getAllWindows():
|
|
2477
|
+
static getAllWindows(): BaseWindow[];
|
|
2624
2478
|
/**
|
|
2625
2479
|
* The window that is focused in this application, otherwise returns `null`.
|
|
2626
2480
|
*/
|
|
2627
|
-
static getFocusedWindow(): (
|
|
2628
|
-
/**
|
|
2629
|
-
* Replacement API for setBrowserView supporting work with multi browser views.
|
|
2630
|
-
*
|
|
2631
|
-
* @experimental
|
|
2632
|
-
*/
|
|
2633
|
-
addBrowserView(browserView: BrowserView): void;
|
|
2481
|
+
static getFocusedWindow(): (BaseWindow) | (null);
|
|
2634
2482
|
/**
|
|
2635
2483
|
* Adds a window as a tab on this window, after the tab for the window instance.
|
|
2636
2484
|
*
|
|
2637
2485
|
* @platform darwin
|
|
2638
2486
|
*/
|
|
2639
|
-
addTabbedWindow(
|
|
2487
|
+
addTabbedWindow(baseWindow: BaseWindow): void;
|
|
2640
2488
|
/**
|
|
2641
2489
|
* Removes focus from the window.
|
|
2642
2490
|
*/
|
|
2643
2491
|
blur(): void;
|
|
2644
|
-
blurWebView(): void;
|
|
2645
|
-
/**
|
|
2646
|
-
* Resolves with a NativeImage
|
|
2647
|
-
*
|
|
2648
|
-
* Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
|
2649
|
-
* whole visible page. If the page is not visible, `rect` may be empty. The page is
|
|
2650
|
-
* considered visible when its browser window is hidden and the capturer count is
|
|
2651
|
-
* non-zero. If you would like the page to stay hidden, you should ensure that
|
|
2652
|
-
* `stayHidden` is set to true.
|
|
2653
|
-
*/
|
|
2654
|
-
capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
|
|
2655
2492
|
/**
|
|
2656
2493
|
* Moves window to the center of the screen.
|
|
2657
2494
|
*/
|
|
@@ -2682,7 +2519,6 @@ declare namespace Electron {
|
|
|
2682
2519
|
* Focuses on the window.
|
|
2683
2520
|
*/
|
|
2684
2521
|
focus(): void;
|
|
2685
|
-
focusOnWebView(): void;
|
|
2686
2522
|
/**
|
|
2687
2523
|
* Gets the background color of the window in Hex (`#RRGGBB`) format.
|
|
2688
2524
|
*
|
|
@@ -2701,28 +2537,10 @@ declare namespace Electron {
|
|
|
2701
2537
|
* 25, y: 38, width: 800, height: 600 }`.
|
|
2702
2538
|
*/
|
|
2703
2539
|
getBounds(): Rectangle;
|
|
2704
|
-
/**
|
|
2705
|
-
* The `BrowserView` attached to `win`. Returns `null` if one is not attached.
|
|
2706
|
-
* Throws an error if multiple `BrowserView`s are attached.
|
|
2707
|
-
*
|
|
2708
|
-
* @experimental
|
|
2709
|
-
*/
|
|
2710
|
-
getBrowserView(): (BrowserView) | (null);
|
|
2711
|
-
/**
|
|
2712
|
-
* a sorted by z-index array of all BrowserViews that have been attached with
|
|
2713
|
-
* `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
|
|
2714
|
-
* element of the array.
|
|
2715
|
-
*
|
|
2716
|
-
* **Note:** The BrowserView API is currently experimental and may change or be
|
|
2717
|
-
* removed in future Electron releases.
|
|
2718
|
-
*
|
|
2719
|
-
* @experimental
|
|
2720
|
-
*/
|
|
2721
|
-
getBrowserViews(): BrowserView[];
|
|
2722
2540
|
/**
|
|
2723
2541
|
* All child windows.
|
|
2724
2542
|
*/
|
|
2725
|
-
getChildWindows():
|
|
2543
|
+
getChildWindows(): BaseWindow[];
|
|
2726
2544
|
/**
|
|
2727
2545
|
* The `bounds` of the window's client area as `Object`.
|
|
2728
2546
|
*/
|
|
@@ -2731,6 +2549,10 @@ declare namespace Electron {
|
|
|
2731
2549
|
* Contains the window's client area's width and height.
|
|
2732
2550
|
*/
|
|
2733
2551
|
getContentSize(): number[];
|
|
2552
|
+
/**
|
|
2553
|
+
* Returns View - The content view of the window.
|
|
2554
|
+
*/
|
|
2555
|
+
getContentView(): void;
|
|
2734
2556
|
/**
|
|
2735
2557
|
* Contains the window's maximum width and height.
|
|
2736
2558
|
*/
|
|
@@ -2773,7 +2595,7 @@ declare namespace Electron {
|
|
|
2773
2595
|
/**
|
|
2774
2596
|
* The parent window or `null` if there is no parent.
|
|
2775
2597
|
*/
|
|
2776
|
-
getParentWindow(): (
|
|
2598
|
+
getParentWindow(): (BaseWindow) | (null);
|
|
2777
2599
|
/**
|
|
2778
2600
|
* Contains the window's current position.
|
|
2779
2601
|
*/
|
|
@@ -2821,9 +2643,9 @@ declare namespace Electron {
|
|
|
2821
2643
|
* Invalidates the window shadow so that it is recomputed based on the current
|
|
2822
2644
|
* window shape.
|
|
2823
2645
|
*
|
|
2824
|
-
* `
|
|
2825
|
-
*
|
|
2826
|
-
*
|
|
2646
|
+
* `BaseWindow`s that are transparent can sometimes leave behind visual artifacts
|
|
2647
|
+
* on macOS. This method can be used to clear these artifacts when, for example,
|
|
2648
|
+
* performing an animation.
|
|
2827
2649
|
*
|
|
2828
2650
|
* @platform darwin
|
|
2829
2651
|
*/
|
|
@@ -2977,31 +2799,6 @@ declare namespace Electron {
|
|
|
2977
2799
|
* @platform win32
|
|
2978
2800
|
*/
|
|
2979
2801
|
isWindowMessageHooked(message: number): boolean;
|
|
2980
|
-
/**
|
|
2981
|
-
* the promise will resolve when the page has finished loading (see
|
|
2982
|
-
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
|
2983
|
-
*
|
|
2984
|
-
* Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
|
|
2985
|
-
* relative to the root of your application. See the `webContents` docs for more
|
|
2986
|
-
* information.
|
|
2987
|
-
*/
|
|
2988
|
-
loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
|
|
2989
|
-
/**
|
|
2990
|
-
* the promise will resolve when the page has finished loading (see
|
|
2991
|
-
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
|
2992
|
-
*
|
|
2993
|
-
* Same as `webContents.loadURL(url[, options])`.
|
|
2994
|
-
*
|
|
2995
|
-
* The `url` can be a remote address (e.g. `http://`) or a path to a local HTML
|
|
2996
|
-
* file using the `file://` protocol.
|
|
2997
|
-
*
|
|
2998
|
-
* To ensure that file URLs are properly formatted, it is recommended to use Node's
|
|
2999
|
-
* `url.format` method:
|
|
3000
|
-
*
|
|
3001
|
-
* You can load a URL using a `POST` request with URL-encoded data by doing the
|
|
3002
|
-
* following:
|
|
3003
|
-
*/
|
|
3004
|
-
loadURL(url: string, options?: LoadURLOptions): Promise<void>;
|
|
3005
2802
|
/**
|
|
3006
2803
|
* Maximizes the window. This will also show (but not focus) the window if it isn't
|
|
3007
2804
|
* being displayed already.
|
|
@@ -3042,14 +2839,6 @@ declare namespace Electron {
|
|
|
3042
2839
|
* @platform darwin
|
|
3043
2840
|
*/
|
|
3044
2841
|
previewFile(path: string, displayName?: string): void;
|
|
3045
|
-
/**
|
|
3046
|
-
* Same as `webContents.reload`.
|
|
3047
|
-
*/
|
|
3048
|
-
reload(): void;
|
|
3049
|
-
/**
|
|
3050
|
-
* @experimental
|
|
3051
|
-
*/
|
|
3052
|
-
removeBrowserView(browserView: BrowserView): void;
|
|
3053
2842
|
/**
|
|
3054
2843
|
* Remove the window's menu bar.
|
|
3055
2844
|
*
|
|
@@ -3136,16 +2925,16 @@ declare namespace Electron {
|
|
|
3136
2925
|
* * #ffffff (RGB)
|
|
3137
2926
|
* * #ffffffff (ARGB)
|
|
3138
2927
|
* * RGB
|
|
3139
|
-
* * rgb(([\d]+),\s*([\d]+),\s*([\d]+))
|
|
2928
|
+
* * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
|
3140
2929
|
* * e.g. rgb(255, 255, 255)
|
|
3141
2930
|
* * RGBA
|
|
3142
|
-
* * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))
|
|
2931
|
+
* * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
|
3143
2932
|
* * e.g. rgba(255, 255, 255, 1.0)
|
|
3144
2933
|
* * HSL
|
|
3145
|
-
* * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)
|
|
2934
|
+
* * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
|
3146
2935
|
* * e.g. hsl(200, 20%, 50%)
|
|
3147
2936
|
* * HSLA
|
|
3148
|
-
* * hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+))
|
|
2937
|
+
* * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
|
3149
2938
|
* * e.g. hsla(200, 20%, 50%, 0.5)
|
|
3150
2939
|
* * Color name
|
|
3151
2940
|
* * Options are listed in SkParseColor.cpp
|
|
@@ -3176,10 +2965,6 @@ declare namespace Electron {
|
|
|
3176
2965
|
* result in a window that is flush to the tray.
|
|
3177
2966
|
*/
|
|
3178
2967
|
setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
|
|
3179
|
-
/**
|
|
3180
|
-
* @experimental
|
|
3181
|
-
*/
|
|
3182
|
-
setBrowserView(browserView: (BrowserView) | (null)): void;
|
|
3183
2968
|
/**
|
|
3184
2969
|
* Sets whether the window can be manually closed by user. On Linux does nothing.
|
|
3185
2970
|
*
|
|
@@ -3206,6 +2991,10 @@ declare namespace Electron {
|
|
|
3206
2991
|
* Resizes the window's client area (e.g. the web page) to `width` and `height`.
|
|
3207
2992
|
*/
|
|
3208
2993
|
setContentSize(width: number, height: number, animate?: boolean): void;
|
|
2994
|
+
/**
|
|
2995
|
+
* Sets the content view of the window.
|
|
2996
|
+
*/
|
|
2997
|
+
setContentView(view: View): void;
|
|
3209
2998
|
/**
|
|
3210
2999
|
* Specifies whether the window’s document has been edited, and the icon in title
|
|
3211
3000
|
* bar will become gray when set to `true`.
|
|
@@ -3325,7 +3114,7 @@ declare namespace Electron {
|
|
|
3325
3114
|
* Sets `parent` as current window's parent window, passing `null` will turn
|
|
3326
3115
|
* current window into a top-level window.
|
|
3327
3116
|
*/
|
|
3328
|
-
setParentWindow(parent: (
|
|
3117
|
+
setParentWindow(parent: (BaseWindow) | (null)): void;
|
|
3329
3118
|
/**
|
|
3330
3119
|
* Moves window to `x` and `y`.
|
|
3331
3120
|
*/
|
|
@@ -3458,14 +3247,7 @@ declare namespace Electron {
|
|
|
3458
3247
|
*
|
|
3459
3248
|
* @platform win32
|
|
3460
3249
|
*/
|
|
3461
|
-
setTitleBarOverlay(options:
|
|
3462
|
-
/**
|
|
3463
|
-
* Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
|
|
3464
|
-
* error if `browserView` is not attached to `win`.
|
|
3465
|
-
*
|
|
3466
|
-
* @experimental
|
|
3467
|
-
*/
|
|
3468
|
-
setTopBrowserView(browserView: BrowserView): void;
|
|
3250
|
+
setTitleBarOverlay(options: TitleBarOverlayOptions): void;
|
|
3469
3251
|
/**
|
|
3470
3252
|
* Sets the touchBar layout for the current window. Specifying `null` or
|
|
3471
3253
|
* `undefined` clears the touch bar. This method only has an effect if the machine
|
|
@@ -3478,8 +3260,8 @@ declare namespace Electron {
|
|
|
3478
3260
|
*/
|
|
3479
3261
|
setTouchBar(touchBar: (TouchBar) | (null)): void;
|
|
3480
3262
|
/**
|
|
3481
|
-
* Adds a vibrancy effect to the
|
|
3482
|
-
*
|
|
3263
|
+
* Adds a vibrancy effect to the window. Passing `null` or an empty string will
|
|
3264
|
+
* remove the vibrancy effect on the window.
|
|
3483
3265
|
*
|
|
3484
3266
|
* @platform darwin
|
|
3485
3267
|
*/
|
|
@@ -3515,12 +3297,6 @@ declare namespace Electron {
|
|
|
3515
3297
|
* @platform darwin
|
|
3516
3298
|
*/
|
|
3517
3299
|
showAllTabs(): void;
|
|
3518
|
-
/**
|
|
3519
|
-
* Same as `webContents.showDefinitionForSelection()`.
|
|
3520
|
-
*
|
|
3521
|
-
* @platform darwin
|
|
3522
|
-
*/
|
|
3523
|
-
showDefinitionForSelection(): void;
|
|
3524
3300
|
/**
|
|
3525
3301
|
* Shows the window but doesn't focus on it.
|
|
3526
3302
|
*/
|
|
@@ -3572,6 +3348,10 @@ declare namespace Electron {
|
|
|
3572
3348
|
* @platform darwin,win32
|
|
3573
3349
|
*/
|
|
3574
3350
|
closable: boolean;
|
|
3351
|
+
/**
|
|
3352
|
+
* A `View` property for the content view of the window.
|
|
3353
|
+
*/
|
|
3354
|
+
contentView: View;
|
|
3575
3355
|
/**
|
|
3576
3356
|
* A `boolean` property that specifies whether the window’s document has been
|
|
3577
3357
|
* edited.
|
|
@@ -3605,7 +3385,7 @@ declare namespace Electron {
|
|
|
3605
3385
|
fullScreenable: boolean;
|
|
3606
3386
|
/**
|
|
3607
3387
|
* A `Integer` property representing the unique ID of the window. Each ID is unique
|
|
3608
|
-
* among all `
|
|
3388
|
+
* among all `BaseWindow` instances of the entire Electron application.
|
|
3609
3389
|
*
|
|
3610
3390
|
*/
|
|
3611
3391
|
readonly id: number;
|
|
@@ -3692,19 +3472,11 @@ declare namespace Electron {
|
|
|
3692
3472
|
* @platform darwin,linux
|
|
3693
3473
|
*/
|
|
3694
3474
|
visibleOnAllWorkspaces: boolean;
|
|
3695
|
-
/**
|
|
3696
|
-
* A `WebContents` object this window owns. All web page related events and
|
|
3697
|
-
* operations will be done via it.
|
|
3698
|
-
*
|
|
3699
|
-
* See the `webContents` documentation for its methods and events.
|
|
3700
|
-
*
|
|
3701
|
-
*/
|
|
3702
|
-
readonly webContents: WebContents;
|
|
3703
3475
|
}
|
|
3704
3476
|
|
|
3705
|
-
interface
|
|
3477
|
+
interface BaseWindowConstructorOptions {
|
|
3706
3478
|
|
|
3707
|
-
// Docs: https://electronjs.org/docs/api/structures/
|
|
3479
|
+
// Docs: https://electronjs.org/docs/api/structures/base-window-options
|
|
3708
3480
|
|
|
3709
3481
|
/**
|
|
3710
3482
|
* Whether clicking an inactive window will also click through to the web contents.
|
|
@@ -3845,157 +3617,2507 @@ declare namespace Electron {
|
|
|
3845
3617
|
*/
|
|
3846
3618
|
modal?: boolean;
|
|
3847
3619
|
/**
|
|
3848
|
-
* Whether window is movable. This is not implemented on Linux. Default is `true`.
|
|
3620
|
+
* Whether window is movable. This is not implemented on Linux. Default is `true`.
|
|
3621
|
+
*
|
|
3622
|
+
* @platform darwin,win32
|
|
3623
|
+
*/
|
|
3624
|
+
movable?: boolean;
|
|
3625
|
+
/**
|
|
3626
|
+
* Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
|
|
3627
|
+
* (fully opaque). This is only implemented on Windows and macOS.
|
|
3628
|
+
*
|
|
3629
|
+
* @platform darwin,win32
|
|
3630
|
+
*/
|
|
3631
|
+
opacity?: number;
|
|
3632
|
+
/**
|
|
3633
|
+
* Specify parent window. Default is `null`.
|
|
3634
|
+
*/
|
|
3635
|
+
parent?: BaseWindow;
|
|
3636
|
+
/**
|
|
3637
|
+
* Whether window is resizable. Default is `true`.
|
|
3638
|
+
*/
|
|
3639
|
+
resizable?: boolean;
|
|
3640
|
+
/**
|
|
3641
|
+
* Whether frameless window should have rounded corners on macOS. Default is
|
|
3642
|
+
* `true`. Setting this property to `false` will prevent the window from being
|
|
3643
|
+
* fullscreenable.
|
|
3644
|
+
*
|
|
3645
|
+
* @platform darwin
|
|
3646
|
+
*/
|
|
3647
|
+
roundedCorners?: boolean;
|
|
3648
|
+
/**
|
|
3649
|
+
* Whether window should be shown when created. Default is `true`.
|
|
3650
|
+
*/
|
|
3651
|
+
show?: boolean;
|
|
3652
|
+
/**
|
|
3653
|
+
* Use pre-Lion fullscreen on macOS. Default is `false`.
|
|
3654
|
+
*
|
|
3655
|
+
* @platform darwin
|
|
3656
|
+
*/
|
|
3657
|
+
simpleFullscreen?: boolean;
|
|
3658
|
+
/**
|
|
3659
|
+
* Whether to show the window in taskbar. Default is `false`.
|
|
3660
|
+
*
|
|
3661
|
+
* @platform darwin,win32
|
|
3662
|
+
*/
|
|
3663
|
+
skipTaskbar?: boolean;
|
|
3664
|
+
/**
|
|
3665
|
+
* Tab group name, allows opening the window as a native tab. Windows with the same
|
|
3666
|
+
* tabbing identifier will be grouped together. This also adds a native new tab
|
|
3667
|
+
* button to your window's tab bar and allows your `app` and window to receive the
|
|
3668
|
+
* `new-window-for-tab` event.
|
|
3669
|
+
*
|
|
3670
|
+
* @platform darwin
|
|
3671
|
+
*/
|
|
3672
|
+
tabbingIdentifier?: string;
|
|
3673
|
+
/**
|
|
3674
|
+
* Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
|
|
3675
|
+
* window frame. Setting it to `false` will remove window shadow and window
|
|
3676
|
+
* animations. Default is `true`.
|
|
3677
|
+
*/
|
|
3678
|
+
thickFrame?: boolean;
|
|
3679
|
+
/**
|
|
3680
|
+
* Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
|
|
3681
|
+
* defined in the HTML file loaded by `loadURL()`, this property will be ignored.
|
|
3682
|
+
*/
|
|
3683
|
+
title?: string;
|
|
3684
|
+
/**
|
|
3685
|
+
* The style of window title bar. Default is `default`. Possible values are:
|
|
3686
|
+
*
|
|
3687
|
+
* @platform darwin,win32
|
|
3688
|
+
*/
|
|
3689
|
+
titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
|
|
3690
|
+
/**
|
|
3691
|
+
* Set a custom position for the traffic light buttons in frameless windows.
|
|
3692
|
+
*
|
|
3693
|
+
* @platform darwin
|
|
3694
|
+
*/
|
|
3695
|
+
trafficLightPosition?: Point;
|
|
3696
|
+
/**
|
|
3697
|
+
* Makes the window transparent. Default is `false`. On Windows, does not work
|
|
3698
|
+
* unless the window is frameless.
|
|
3699
|
+
*/
|
|
3700
|
+
transparent?: boolean;
|
|
3701
|
+
/**
|
|
3702
|
+
* The type of window, default is normal window. See more about this below.
|
|
3703
|
+
*/
|
|
3704
|
+
type?: string;
|
|
3705
|
+
/**
|
|
3706
|
+
* The `width` and `height` would be used as web page's size, which means the
|
|
3707
|
+
* actual window's size will include window frame's size and be slightly larger.
|
|
3708
|
+
* Default is `false`.
|
|
3709
|
+
*/
|
|
3710
|
+
useContentSize?: boolean;
|
|
3711
|
+
/**
|
|
3712
|
+
* Add a type of vibrancy effect to the window, only on macOS. Can be
|
|
3713
|
+
* `appearance-based`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`,
|
|
3714
|
+
* `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`,
|
|
3715
|
+
* `under-window`, or `under-page`.
|
|
3716
|
+
*
|
|
3717
|
+
* @platform darwin
|
|
3718
|
+
*/
|
|
3719
|
+
vibrancy?: ('appearance-based' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
|
|
3720
|
+
/**
|
|
3721
|
+
* Specify how the material appearance should reflect window activity state on
|
|
3722
|
+
* macOS. Must be used with the `vibrancy` property. Possible values are:
|
|
3723
|
+
*
|
|
3724
|
+
* @platform darwin
|
|
3725
|
+
*/
|
|
3726
|
+
visualEffectState?: ('followWindow' | 'active' | 'inactive');
|
|
3727
|
+
/**
|
|
3728
|
+
* Window's width in pixels. Default is `800`.
|
|
3729
|
+
*/
|
|
3730
|
+
width?: number;
|
|
3731
|
+
/**
|
|
3732
|
+
* (**required** if y is used) Window's left offset from screen. Default is to
|
|
3733
|
+
* center the window.
|
|
3734
|
+
*/
|
|
3735
|
+
x?: number;
|
|
3736
|
+
/**
|
|
3737
|
+
* (**required** if x is used) Window's top offset from screen. Default is to
|
|
3738
|
+
* center the window.
|
|
3739
|
+
*/
|
|
3740
|
+
y?: number;
|
|
3741
|
+
/**
|
|
3742
|
+
* Controls the behavior on macOS when option-clicking the green stoplight button
|
|
3743
|
+
* on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
|
|
3744
|
+
* will grow to the preferred width of the web page when zoomed, `false` will cause
|
|
3745
|
+
* it to zoom to the width of the screen. This will also affect the behavior when
|
|
3746
|
+
* calling `maximize()` directly. Default is `false`.
|
|
3747
|
+
*
|
|
3748
|
+
* @platform darwin
|
|
3749
|
+
*/
|
|
3750
|
+
zoomToPageWidth?: boolean;
|
|
3751
|
+
}
|
|
3752
|
+
|
|
3753
|
+
interface BluetoothDevice {
|
|
3754
|
+
|
|
3755
|
+
// Docs: https://electronjs.org/docs/api/structures/bluetooth-device
|
|
3756
|
+
|
|
3757
|
+
deviceId: string;
|
|
3758
|
+
deviceName: string;
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
class BrowserView {
|
|
3762
|
+
|
|
3763
|
+
// Docs: https://electronjs.org/docs/api/browser-view
|
|
3764
|
+
|
|
3765
|
+
/**
|
|
3766
|
+
* BrowserView
|
|
3767
|
+
*/
|
|
3768
|
+
constructor(options?: BrowserViewConstructorOptions);
|
|
3769
|
+
/**
|
|
3770
|
+
* The `bounds` of this BrowserView instance as `Object`.
|
|
3771
|
+
*
|
|
3772
|
+
* @experimental
|
|
3773
|
+
* @deprecated
|
|
3774
|
+
*/
|
|
3775
|
+
getBounds(): Rectangle;
|
|
3776
|
+
/**
|
|
3777
|
+
* @experimental
|
|
3778
|
+
* @deprecated
|
|
3779
|
+
*/
|
|
3780
|
+
setAutoResize(options: AutoResizeOptions): void;
|
|
3781
|
+
/**
|
|
3782
|
+
* Examples of valid `color` values:
|
|
3783
|
+
*
|
|
3784
|
+
* * Hex
|
|
3785
|
+
* * `#fff` (RGB)
|
|
3786
|
+
* * `#ffff` (ARGB)
|
|
3787
|
+
* * `#ffffff` (RRGGBB)
|
|
3788
|
+
* * `#ffffffff` (AARRGGBB)
|
|
3789
|
+
* * RGB
|
|
3790
|
+
* * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
|
3791
|
+
* * e.g. `rgb(255, 255, 255)`
|
|
3792
|
+
* * RGBA
|
|
3793
|
+
* * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
|
3794
|
+
* * e.g. `rgba(255, 255, 255, 1.0)`
|
|
3795
|
+
* * HSL
|
|
3796
|
+
* * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
|
3797
|
+
* * e.g. `hsl(200, 20%, 50%)`
|
|
3798
|
+
* * HSLA
|
|
3799
|
+
* * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
|
3800
|
+
* * e.g. `hsla(200, 20%, 50%, 0.5)`
|
|
3801
|
+
* * Color name
|
|
3802
|
+
* * Options are listed in SkParseColor.cpp
|
|
3803
|
+
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
|
3804
|
+
* * e.g. `blueviolet` or `red`
|
|
3805
|
+
*
|
|
3806
|
+
* **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
|
|
3807
|
+
* `RGB`.
|
|
3808
|
+
*
|
|
3809
|
+
* @experimental
|
|
3810
|
+
* @deprecated
|
|
3811
|
+
*/
|
|
3812
|
+
setBackgroundColor(color: string): void;
|
|
3813
|
+
/**
|
|
3814
|
+
* Resizes and moves the view to the supplied bounds relative to the window.
|
|
3815
|
+
*
|
|
3816
|
+
* @experimental
|
|
3817
|
+
* @deprecated
|
|
3818
|
+
*/
|
|
3819
|
+
setBounds(bounds: Rectangle): void;
|
|
3820
|
+
/**
|
|
3821
|
+
* A `WebContents` object owned by this view.
|
|
3822
|
+
*
|
|
3823
|
+
* @experimental
|
|
3824
|
+
* @deprecated
|
|
3825
|
+
*/
|
|
3826
|
+
webContents: WebContents;
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
class BrowserWindow extends BaseWindow {
|
|
3830
|
+
|
|
3831
|
+
// Docs: https://electronjs.org/docs/api/browser-window
|
|
3832
|
+
|
|
3833
|
+
/**
|
|
3834
|
+
* Emitted when the window is set or unset to show always on top of other windows.
|
|
3835
|
+
*/
|
|
3836
|
+
on(event: 'always-on-top-changed', listener: (event: Event,
|
|
3837
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3838
|
+
off(event: 'always-on-top-changed', listener: (event: Event,
|
|
3839
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3840
|
+
once(event: 'always-on-top-changed', listener: (event: Event,
|
|
3841
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3842
|
+
addListener(event: 'always-on-top-changed', listener: (event: Event,
|
|
3843
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3844
|
+
removeListener(event: 'always-on-top-changed', listener: (event: Event,
|
|
3845
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3846
|
+
/**
|
|
3847
|
+
* Emitted when the window is set or unset to show always on top of other windows.
|
|
3848
|
+
*/
|
|
3849
|
+
on(event: 'always-on-top-changed', listener: (event: Event,
|
|
3850
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3851
|
+
off(event: 'always-on-top-changed', listener: (event: Event,
|
|
3852
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3853
|
+
once(event: 'always-on-top-changed', listener: (event: Event,
|
|
3854
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3855
|
+
addListener(event: 'always-on-top-changed', listener: (event: Event,
|
|
3856
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3857
|
+
removeListener(event: 'always-on-top-changed', listener: (event: Event,
|
|
3858
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
3859
|
+
/**
|
|
3860
|
+
* Emitted when an App Command is invoked. These are typically related to keyboard
|
|
3861
|
+
* media keys or browser commands, as well as the "Back" button built into some
|
|
3862
|
+
* mice on Windows.
|
|
3863
|
+
*
|
|
3864
|
+
* Commands are lowercased, underscores are replaced with hyphens, and the
|
|
3865
|
+
* `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
|
|
3866
|
+
* emitted as `browser-backward`.
|
|
3867
|
+
*
|
|
3868
|
+
* The following app commands are explicitly supported on Linux:
|
|
3869
|
+
*
|
|
3870
|
+
* * `browser-backward`
|
|
3871
|
+
* * `browser-forward`
|
|
3872
|
+
*
|
|
3873
|
+
* @platform win32,linux
|
|
3874
|
+
*/
|
|
3875
|
+
on(event: 'app-command', listener: (event: Event,
|
|
3876
|
+
command: string) => void): this;
|
|
3877
|
+
/**
|
|
3878
|
+
* @platform win32,linux
|
|
3879
|
+
*/
|
|
3880
|
+
off(event: 'app-command', listener: (event: Event,
|
|
3881
|
+
command: string) => void): this;
|
|
3882
|
+
/**
|
|
3883
|
+
* @platform win32,linux
|
|
3884
|
+
*/
|
|
3885
|
+
once(event: 'app-command', listener: (event: Event,
|
|
3886
|
+
command: string) => void): this;
|
|
3887
|
+
/**
|
|
3888
|
+
* @platform win32,linux
|
|
3889
|
+
*/
|
|
3890
|
+
addListener(event: 'app-command', listener: (event: Event,
|
|
3891
|
+
command: string) => void): this;
|
|
3892
|
+
/**
|
|
3893
|
+
* @platform win32,linux
|
|
3894
|
+
*/
|
|
3895
|
+
removeListener(event: 'app-command', listener: (event: Event,
|
|
3896
|
+
command: string) => void): this;
|
|
3897
|
+
/**
|
|
3898
|
+
* Emitted when an App Command is invoked. These are typically related to keyboard
|
|
3899
|
+
* media keys or browser commands, as well as the "Back" button built into some
|
|
3900
|
+
* mice on Windows.
|
|
3901
|
+
*
|
|
3902
|
+
* Commands are lowercased, underscores are replaced with hyphens, and the
|
|
3903
|
+
* `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
|
|
3904
|
+
* emitted as `browser-backward`.
|
|
3905
|
+
*
|
|
3906
|
+
* The following app commands are explicitly supported on Linux:
|
|
3907
|
+
*
|
|
3908
|
+
* * `browser-backward`
|
|
3909
|
+
* * `browser-forward`
|
|
3910
|
+
*
|
|
3911
|
+
* @platform win32,linux
|
|
3912
|
+
*/
|
|
3913
|
+
on(event: 'app-command', listener: (event: Event,
|
|
3914
|
+
command: string) => void): this;
|
|
3915
|
+
/**
|
|
3916
|
+
* @platform win32,linux
|
|
3917
|
+
*/
|
|
3918
|
+
off(event: 'app-command', listener: (event: Event,
|
|
3919
|
+
command: string) => void): this;
|
|
3920
|
+
/**
|
|
3921
|
+
* @platform win32,linux
|
|
3922
|
+
*/
|
|
3923
|
+
once(event: 'app-command', listener: (event: Event,
|
|
3924
|
+
command: string) => void): this;
|
|
3925
|
+
/**
|
|
3926
|
+
* @platform win32,linux
|
|
3927
|
+
*/
|
|
3928
|
+
addListener(event: 'app-command', listener: (event: Event,
|
|
3929
|
+
command: string) => void): this;
|
|
3930
|
+
/**
|
|
3931
|
+
* @platform win32,linux
|
|
3932
|
+
*/
|
|
3933
|
+
removeListener(event: 'app-command', listener: (event: Event,
|
|
3934
|
+
command: string) => void): this;
|
|
3935
|
+
/**
|
|
3936
|
+
* Emitted when the window loses focus.
|
|
3937
|
+
*/
|
|
3938
|
+
on(event: 'blur', listener: Function): this;
|
|
3939
|
+
off(event: 'blur', listener: Function): this;
|
|
3940
|
+
once(event: 'blur', listener: Function): this;
|
|
3941
|
+
addListener(event: 'blur', listener: Function): this;
|
|
3942
|
+
removeListener(event: 'blur', listener: Function): this;
|
|
3943
|
+
/**
|
|
3944
|
+
* Emitted when the window loses focus.
|
|
3945
|
+
*/
|
|
3946
|
+
on(event: 'blur', listener: Function): this;
|
|
3947
|
+
off(event: 'blur', listener: Function): this;
|
|
3948
|
+
once(event: 'blur', listener: Function): this;
|
|
3949
|
+
addListener(event: 'blur', listener: Function): this;
|
|
3950
|
+
removeListener(event: 'blur', listener: Function): this;
|
|
3951
|
+
/**
|
|
3952
|
+
* Emitted when the window is going to be closed. It's emitted before the
|
|
3953
|
+
* `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
|
|
3954
|
+
* will cancel the close.
|
|
3955
|
+
*
|
|
3956
|
+
* Usually you would want to use the `beforeunload` handler to decide whether the
|
|
3957
|
+
* window should be closed, which will also be called when the window is reloaded.
|
|
3958
|
+
* In Electron, returning any value other than `undefined` would cancel the close.
|
|
3959
|
+
* For example:
|
|
3960
|
+
*
|
|
3961
|
+
* _**Note**: There is a subtle difference between the behaviors of
|
|
3962
|
+
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
|
3963
|
+
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
|
3964
|
+
* instead of only returning a value, as the former works more consistently within
|
|
3965
|
+
* Electron._
|
|
3966
|
+
*/
|
|
3967
|
+
on(event: 'close', listener: (event: Event) => void): this;
|
|
3968
|
+
off(event: 'close', listener: (event: Event) => void): this;
|
|
3969
|
+
once(event: 'close', listener: (event: Event) => void): this;
|
|
3970
|
+
addListener(event: 'close', listener: (event: Event) => void): this;
|
|
3971
|
+
removeListener(event: 'close', listener: (event: Event) => void): this;
|
|
3972
|
+
/**
|
|
3973
|
+
* Emitted when the window is going to be closed. It's emitted before the
|
|
3974
|
+
* `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
|
|
3975
|
+
* will cancel the close.
|
|
3976
|
+
*
|
|
3977
|
+
* Usually you would want to use the `beforeunload` handler to decide whether the
|
|
3978
|
+
* window should be closed, which will also be called when the window is reloaded.
|
|
3979
|
+
* In Electron, returning any value other than `undefined` would cancel the close.
|
|
3980
|
+
* For example:
|
|
3981
|
+
*
|
|
3982
|
+
* _**Note**: There is a subtle difference between the behaviors of
|
|
3983
|
+
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
|
3984
|
+
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
|
3985
|
+
* instead of only returning a value, as the former works more consistently within
|
|
3986
|
+
* Electron._
|
|
3987
|
+
*/
|
|
3988
|
+
on(event: 'close', listener: (event: Event) => void): this;
|
|
3989
|
+
off(event: 'close', listener: (event: Event) => void): this;
|
|
3990
|
+
once(event: 'close', listener: (event: Event) => void): this;
|
|
3991
|
+
addListener(event: 'close', listener: (event: Event) => void): this;
|
|
3992
|
+
removeListener(event: 'close', listener: (event: Event) => void): this;
|
|
3993
|
+
/**
|
|
3994
|
+
* Emitted when the window is closed. After you have received this event you should
|
|
3995
|
+
* remove the reference to the window and avoid using it any more.
|
|
3996
|
+
*/
|
|
3997
|
+
on(event: 'closed', listener: Function): this;
|
|
3998
|
+
off(event: 'closed', listener: Function): this;
|
|
3999
|
+
once(event: 'closed', listener: Function): this;
|
|
4000
|
+
addListener(event: 'closed', listener: Function): this;
|
|
4001
|
+
removeListener(event: 'closed', listener: Function): this;
|
|
4002
|
+
/**
|
|
4003
|
+
* Emitted when the window is closed. After you have received this event you should
|
|
4004
|
+
* remove the reference to the window and avoid using it any more.
|
|
4005
|
+
*/
|
|
4006
|
+
on(event: 'closed', listener: Function): this;
|
|
4007
|
+
off(event: 'closed', listener: Function): this;
|
|
4008
|
+
once(event: 'closed', listener: Function): this;
|
|
4009
|
+
addListener(event: 'closed', listener: Function): this;
|
|
4010
|
+
removeListener(event: 'closed', listener: Function): this;
|
|
4011
|
+
/**
|
|
4012
|
+
* Emitted when the window enters a full-screen state.
|
|
4013
|
+
*/
|
|
4014
|
+
on(event: 'enter-full-screen', listener: Function): this;
|
|
4015
|
+
off(event: 'enter-full-screen', listener: Function): this;
|
|
4016
|
+
once(event: 'enter-full-screen', listener: Function): this;
|
|
4017
|
+
addListener(event: 'enter-full-screen', listener: Function): this;
|
|
4018
|
+
removeListener(event: 'enter-full-screen', listener: Function): this;
|
|
4019
|
+
/**
|
|
4020
|
+
* Emitted when the window enters a full-screen state.
|
|
4021
|
+
*/
|
|
4022
|
+
on(event: 'enter-full-screen', listener: Function): this;
|
|
4023
|
+
off(event: 'enter-full-screen', listener: Function): this;
|
|
4024
|
+
once(event: 'enter-full-screen', listener: Function): this;
|
|
4025
|
+
addListener(event: 'enter-full-screen', listener: Function): this;
|
|
4026
|
+
removeListener(event: 'enter-full-screen', listener: Function): this;
|
|
4027
|
+
/**
|
|
4028
|
+
* Emitted when the window enters a full-screen state triggered by HTML API.
|
|
4029
|
+
*/
|
|
4030
|
+
on(event: 'enter-html-full-screen', listener: Function): this;
|
|
4031
|
+
off(event: 'enter-html-full-screen', listener: Function): this;
|
|
4032
|
+
once(event: 'enter-html-full-screen', listener: Function): this;
|
|
4033
|
+
addListener(event: 'enter-html-full-screen', listener: Function): this;
|
|
4034
|
+
removeListener(event: 'enter-html-full-screen', listener: Function): this;
|
|
4035
|
+
/**
|
|
4036
|
+
* Emitted when the window gains focus.
|
|
4037
|
+
*/
|
|
4038
|
+
on(event: 'focus', listener: Function): this;
|
|
4039
|
+
off(event: 'focus', listener: Function): this;
|
|
4040
|
+
once(event: 'focus', listener: Function): this;
|
|
4041
|
+
addListener(event: 'focus', listener: Function): this;
|
|
4042
|
+
removeListener(event: 'focus', listener: Function): this;
|
|
4043
|
+
/**
|
|
4044
|
+
* Emitted when the window gains focus.
|
|
4045
|
+
*/
|
|
4046
|
+
on(event: 'focus', listener: Function): this;
|
|
4047
|
+
off(event: 'focus', listener: Function): this;
|
|
4048
|
+
once(event: 'focus', listener: Function): this;
|
|
4049
|
+
addListener(event: 'focus', listener: Function): this;
|
|
4050
|
+
removeListener(event: 'focus', listener: Function): this;
|
|
4051
|
+
/**
|
|
4052
|
+
* Emitted when the window is hidden.
|
|
4053
|
+
*/
|
|
4054
|
+
on(event: 'hide', listener: Function): this;
|
|
4055
|
+
off(event: 'hide', listener: Function): this;
|
|
4056
|
+
once(event: 'hide', listener: Function): this;
|
|
4057
|
+
addListener(event: 'hide', listener: Function): this;
|
|
4058
|
+
removeListener(event: 'hide', listener: Function): this;
|
|
4059
|
+
/**
|
|
4060
|
+
* Emitted when the window is hidden.
|
|
4061
|
+
*/
|
|
4062
|
+
on(event: 'hide', listener: Function): this;
|
|
4063
|
+
off(event: 'hide', listener: Function): this;
|
|
4064
|
+
once(event: 'hide', listener: Function): this;
|
|
4065
|
+
addListener(event: 'hide', listener: Function): this;
|
|
4066
|
+
removeListener(event: 'hide', listener: Function): this;
|
|
4067
|
+
/**
|
|
4068
|
+
* Emitted when the window leaves a full-screen state.
|
|
4069
|
+
*/
|
|
4070
|
+
on(event: 'leave-full-screen', listener: Function): this;
|
|
4071
|
+
off(event: 'leave-full-screen', listener: Function): this;
|
|
4072
|
+
once(event: 'leave-full-screen', listener: Function): this;
|
|
4073
|
+
addListener(event: 'leave-full-screen', listener: Function): this;
|
|
4074
|
+
removeListener(event: 'leave-full-screen', listener: Function): this;
|
|
4075
|
+
/**
|
|
4076
|
+
* Emitted when the window leaves a full-screen state.
|
|
4077
|
+
*/
|
|
4078
|
+
on(event: 'leave-full-screen', listener: Function): this;
|
|
4079
|
+
off(event: 'leave-full-screen', listener: Function): this;
|
|
4080
|
+
once(event: 'leave-full-screen', listener: Function): this;
|
|
4081
|
+
addListener(event: 'leave-full-screen', listener: Function): this;
|
|
4082
|
+
removeListener(event: 'leave-full-screen', listener: Function): this;
|
|
4083
|
+
/**
|
|
4084
|
+
* Emitted when the window leaves a full-screen state triggered by HTML API.
|
|
4085
|
+
*/
|
|
4086
|
+
on(event: 'leave-html-full-screen', listener: Function): this;
|
|
4087
|
+
off(event: 'leave-html-full-screen', listener: Function): this;
|
|
4088
|
+
once(event: 'leave-html-full-screen', listener: Function): this;
|
|
4089
|
+
addListener(event: 'leave-html-full-screen', listener: Function): this;
|
|
4090
|
+
removeListener(event: 'leave-html-full-screen', listener: Function): this;
|
|
4091
|
+
/**
|
|
4092
|
+
* Emitted when window is maximized.
|
|
4093
|
+
*/
|
|
4094
|
+
on(event: 'maximize', listener: Function): this;
|
|
4095
|
+
off(event: 'maximize', listener: Function): this;
|
|
4096
|
+
once(event: 'maximize', listener: Function): this;
|
|
4097
|
+
addListener(event: 'maximize', listener: Function): this;
|
|
4098
|
+
removeListener(event: 'maximize', listener: Function): this;
|
|
4099
|
+
/**
|
|
4100
|
+
* Emitted when window is maximized.
|
|
4101
|
+
*/
|
|
4102
|
+
on(event: 'maximize', listener: Function): this;
|
|
4103
|
+
off(event: 'maximize', listener: Function): this;
|
|
4104
|
+
once(event: 'maximize', listener: Function): this;
|
|
4105
|
+
addListener(event: 'maximize', listener: Function): this;
|
|
4106
|
+
removeListener(event: 'maximize', listener: Function): this;
|
|
4107
|
+
/**
|
|
4108
|
+
* Emitted when the window is minimized.
|
|
4109
|
+
*/
|
|
4110
|
+
on(event: 'minimize', listener: Function): this;
|
|
4111
|
+
off(event: 'minimize', listener: Function): this;
|
|
4112
|
+
once(event: 'minimize', listener: Function): this;
|
|
4113
|
+
addListener(event: 'minimize', listener: Function): this;
|
|
4114
|
+
removeListener(event: 'minimize', listener: Function): this;
|
|
4115
|
+
/**
|
|
4116
|
+
* Emitted when the window is minimized.
|
|
4117
|
+
*/
|
|
4118
|
+
on(event: 'minimize', listener: Function): this;
|
|
4119
|
+
off(event: 'minimize', listener: Function): this;
|
|
4120
|
+
once(event: 'minimize', listener: Function): this;
|
|
4121
|
+
addListener(event: 'minimize', listener: Function): this;
|
|
4122
|
+
removeListener(event: 'minimize', listener: Function): this;
|
|
4123
|
+
/**
|
|
4124
|
+
* Emitted when the window is being moved to a new position.
|
|
4125
|
+
*/
|
|
4126
|
+
on(event: 'move', listener: Function): this;
|
|
4127
|
+
off(event: 'move', listener: Function): this;
|
|
4128
|
+
once(event: 'move', listener: Function): this;
|
|
4129
|
+
addListener(event: 'move', listener: Function): this;
|
|
4130
|
+
removeListener(event: 'move', listener: Function): this;
|
|
4131
|
+
/**
|
|
4132
|
+
* Emitted when the window is being moved to a new position.
|
|
4133
|
+
*/
|
|
4134
|
+
on(event: 'move', listener: Function): this;
|
|
4135
|
+
off(event: 'move', listener: Function): this;
|
|
4136
|
+
once(event: 'move', listener: Function): this;
|
|
4137
|
+
addListener(event: 'move', listener: Function): this;
|
|
4138
|
+
removeListener(event: 'move', listener: Function): this;
|
|
4139
|
+
/**
|
|
4140
|
+
* Emitted once when the window is moved to a new position.
|
|
4141
|
+
*
|
|
4142
|
+
* **Note**: On macOS this event is an alias of `move`.
|
|
4143
|
+
*
|
|
4144
|
+
* @platform darwin,win32
|
|
4145
|
+
*/
|
|
4146
|
+
on(event: 'moved', listener: Function): this;
|
|
4147
|
+
/**
|
|
4148
|
+
* @platform darwin,win32
|
|
4149
|
+
*/
|
|
4150
|
+
off(event: 'moved', listener: Function): this;
|
|
4151
|
+
/**
|
|
4152
|
+
* @platform darwin,win32
|
|
4153
|
+
*/
|
|
4154
|
+
once(event: 'moved', listener: Function): this;
|
|
4155
|
+
/**
|
|
4156
|
+
* @platform darwin,win32
|
|
4157
|
+
*/
|
|
4158
|
+
addListener(event: 'moved', listener: Function): this;
|
|
4159
|
+
/**
|
|
4160
|
+
* @platform darwin,win32
|
|
4161
|
+
*/
|
|
4162
|
+
removeListener(event: 'moved', listener: Function): this;
|
|
4163
|
+
/**
|
|
4164
|
+
* Emitted once when the window is moved to a new position.
|
|
4165
|
+
*
|
|
4166
|
+
* **Note**: On macOS this event is an alias of `move`.
|
|
4167
|
+
*
|
|
4168
|
+
* @platform darwin,win32
|
|
4169
|
+
*/
|
|
4170
|
+
on(event: 'moved', listener: Function): this;
|
|
4171
|
+
/**
|
|
4172
|
+
* @platform darwin,win32
|
|
4173
|
+
*/
|
|
4174
|
+
off(event: 'moved', listener: Function): this;
|
|
4175
|
+
/**
|
|
4176
|
+
* @platform darwin,win32
|
|
4177
|
+
*/
|
|
4178
|
+
once(event: 'moved', listener: Function): this;
|
|
4179
|
+
/**
|
|
4180
|
+
* @platform darwin,win32
|
|
4181
|
+
*/
|
|
4182
|
+
addListener(event: 'moved', listener: Function): this;
|
|
4183
|
+
/**
|
|
4184
|
+
* @platform darwin,win32
|
|
4185
|
+
*/
|
|
4186
|
+
removeListener(event: 'moved', listener: Function): this;
|
|
4187
|
+
/**
|
|
4188
|
+
* Emitted when the native new tab button is clicked.
|
|
4189
|
+
*
|
|
4190
|
+
* @platform darwin
|
|
4191
|
+
*/
|
|
4192
|
+
on(event: 'new-window-for-tab', listener: Function): this;
|
|
4193
|
+
/**
|
|
4194
|
+
* @platform darwin
|
|
4195
|
+
*/
|
|
4196
|
+
off(event: 'new-window-for-tab', listener: Function): this;
|
|
4197
|
+
/**
|
|
4198
|
+
* @platform darwin
|
|
4199
|
+
*/
|
|
4200
|
+
once(event: 'new-window-for-tab', listener: Function): this;
|
|
4201
|
+
/**
|
|
4202
|
+
* @platform darwin
|
|
4203
|
+
*/
|
|
4204
|
+
addListener(event: 'new-window-for-tab', listener: Function): this;
|
|
4205
|
+
/**
|
|
4206
|
+
* @platform darwin
|
|
4207
|
+
*/
|
|
4208
|
+
removeListener(event: 'new-window-for-tab', listener: Function): this;
|
|
4209
|
+
/**
|
|
4210
|
+
* Emitted when the native new tab button is clicked.
|
|
4211
|
+
*
|
|
4212
|
+
* @platform darwin
|
|
4213
|
+
*/
|
|
4214
|
+
on(event: 'new-window-for-tab', listener: Function): this;
|
|
4215
|
+
/**
|
|
4216
|
+
* @platform darwin
|
|
4217
|
+
*/
|
|
4218
|
+
off(event: 'new-window-for-tab', listener: Function): this;
|
|
4219
|
+
/**
|
|
4220
|
+
* @platform darwin
|
|
4221
|
+
*/
|
|
4222
|
+
once(event: 'new-window-for-tab', listener: Function): this;
|
|
4223
|
+
/**
|
|
4224
|
+
* @platform darwin
|
|
4225
|
+
*/
|
|
4226
|
+
addListener(event: 'new-window-for-tab', listener: Function): this;
|
|
4227
|
+
/**
|
|
4228
|
+
* @platform darwin
|
|
4229
|
+
*/
|
|
4230
|
+
removeListener(event: 'new-window-for-tab', listener: Function): this;
|
|
4231
|
+
/**
|
|
4232
|
+
* Emitted when the document changed its title, calling `event.preventDefault()`
|
|
4233
|
+
* will prevent the native window's title from changing. `explicitSet` is false
|
|
4234
|
+
* when title is synthesized from file URL.
|
|
4235
|
+
*/
|
|
4236
|
+
on(event: 'page-title-updated', listener: (event: Event,
|
|
4237
|
+
title: string,
|
|
4238
|
+
explicitSet: boolean) => void): this;
|
|
4239
|
+
off(event: 'page-title-updated', listener: (event: Event,
|
|
4240
|
+
title: string,
|
|
4241
|
+
explicitSet: boolean) => void): this;
|
|
4242
|
+
once(event: 'page-title-updated', listener: (event: Event,
|
|
4243
|
+
title: string,
|
|
4244
|
+
explicitSet: boolean) => void): this;
|
|
4245
|
+
addListener(event: 'page-title-updated', listener: (event: Event,
|
|
4246
|
+
title: string,
|
|
4247
|
+
explicitSet: boolean) => void): this;
|
|
4248
|
+
removeListener(event: 'page-title-updated', listener: (event: Event,
|
|
4249
|
+
title: string,
|
|
4250
|
+
explicitSet: boolean) => void): this;
|
|
4251
|
+
/**
|
|
4252
|
+
* Emitted when the web page has been rendered (while not being shown) and window
|
|
4253
|
+
* can be displayed without a visual flash.
|
|
4254
|
+
*
|
|
4255
|
+
* Please note that using this event implies that the renderer will be considered
|
|
4256
|
+
* "visible" and paint even though `show` is false. This event will never fire if
|
|
4257
|
+
* you use `paintWhenInitiallyHidden: false`
|
|
4258
|
+
*/
|
|
4259
|
+
on(event: 'ready-to-show', listener: Function): this;
|
|
4260
|
+
off(event: 'ready-to-show', listener: Function): this;
|
|
4261
|
+
once(event: 'ready-to-show', listener: Function): this;
|
|
4262
|
+
addListener(event: 'ready-to-show', listener: Function): this;
|
|
4263
|
+
removeListener(event: 'ready-to-show', listener: Function): this;
|
|
4264
|
+
/**
|
|
4265
|
+
* Emitted after the window has been resized.
|
|
4266
|
+
*/
|
|
4267
|
+
on(event: 'resize', listener: Function): this;
|
|
4268
|
+
off(event: 'resize', listener: Function): this;
|
|
4269
|
+
once(event: 'resize', listener: Function): this;
|
|
4270
|
+
addListener(event: 'resize', listener: Function): this;
|
|
4271
|
+
removeListener(event: 'resize', listener: Function): this;
|
|
4272
|
+
/**
|
|
4273
|
+
* Emitted after the window has been resized.
|
|
4274
|
+
*/
|
|
4275
|
+
on(event: 'resize', listener: Function): this;
|
|
4276
|
+
off(event: 'resize', listener: Function): this;
|
|
4277
|
+
once(event: 'resize', listener: Function): this;
|
|
4278
|
+
addListener(event: 'resize', listener: Function): this;
|
|
4279
|
+
removeListener(event: 'resize', listener: Function): this;
|
|
4280
|
+
/**
|
|
4281
|
+
* Emitted once when the window has finished being resized.
|
|
4282
|
+
*
|
|
4283
|
+
* This is usually emitted when the window has been resized manually. On macOS,
|
|
4284
|
+
* resizing the window with `setBounds`/`setSize` and setting the `animate`
|
|
4285
|
+
* parameter to `true` will also emit this event once resizing has finished.
|
|
4286
|
+
*
|
|
4287
|
+
* @platform darwin,win32
|
|
4288
|
+
*/
|
|
4289
|
+
on(event: 'resized', listener: Function): this;
|
|
4290
|
+
/**
|
|
4291
|
+
* @platform darwin,win32
|
|
4292
|
+
*/
|
|
4293
|
+
off(event: 'resized', listener: Function): this;
|
|
4294
|
+
/**
|
|
4295
|
+
* @platform darwin,win32
|
|
4296
|
+
*/
|
|
4297
|
+
once(event: 'resized', listener: Function): this;
|
|
4298
|
+
/**
|
|
4299
|
+
* @platform darwin,win32
|
|
4300
|
+
*/
|
|
4301
|
+
addListener(event: 'resized', listener: Function): this;
|
|
4302
|
+
/**
|
|
4303
|
+
* @platform darwin,win32
|
|
4304
|
+
*/
|
|
4305
|
+
removeListener(event: 'resized', listener: Function): this;
|
|
4306
|
+
/**
|
|
4307
|
+
* Emitted once when the window has finished being resized.
|
|
4308
|
+
*
|
|
4309
|
+
* This is usually emitted when the window has been resized manually. On macOS,
|
|
4310
|
+
* resizing the window with `setBounds`/`setSize` and setting the `animate`
|
|
4311
|
+
* parameter to `true` will also emit this event once resizing has finished.
|
|
4312
|
+
*
|
|
4313
|
+
* @platform darwin,win32
|
|
4314
|
+
*/
|
|
4315
|
+
on(event: 'resized', listener: Function): this;
|
|
4316
|
+
/**
|
|
4317
|
+
* @platform darwin,win32
|
|
4318
|
+
*/
|
|
4319
|
+
off(event: 'resized', listener: Function): this;
|
|
4320
|
+
/**
|
|
4321
|
+
* @platform darwin,win32
|
|
4322
|
+
*/
|
|
4323
|
+
once(event: 'resized', listener: Function): this;
|
|
4324
|
+
/**
|
|
4325
|
+
* @platform darwin,win32
|
|
4326
|
+
*/
|
|
4327
|
+
addListener(event: 'resized', listener: Function): this;
|
|
4328
|
+
/**
|
|
4329
|
+
* @platform darwin,win32
|
|
4330
|
+
*/
|
|
4331
|
+
removeListener(event: 'resized', listener: Function): this;
|
|
4332
|
+
/**
|
|
4333
|
+
* Emitted when the unresponsive web page becomes responsive again.
|
|
4334
|
+
*/
|
|
4335
|
+
on(event: 'responsive', listener: Function): this;
|
|
4336
|
+
off(event: 'responsive', listener: Function): this;
|
|
4337
|
+
once(event: 'responsive', listener: Function): this;
|
|
4338
|
+
addListener(event: 'responsive', listener: Function): this;
|
|
4339
|
+
removeListener(event: 'responsive', listener: Function): this;
|
|
4340
|
+
/**
|
|
4341
|
+
* Emitted when the window is restored from a minimized state.
|
|
4342
|
+
*/
|
|
4343
|
+
on(event: 'restore', listener: Function): this;
|
|
4344
|
+
off(event: 'restore', listener: Function): this;
|
|
4345
|
+
once(event: 'restore', listener: Function): this;
|
|
4346
|
+
addListener(event: 'restore', listener: Function): this;
|
|
4347
|
+
removeListener(event: 'restore', listener: Function): this;
|
|
4348
|
+
/**
|
|
4349
|
+
* Emitted when the window is restored from a minimized state.
|
|
4350
|
+
*/
|
|
4351
|
+
on(event: 'restore', listener: Function): this;
|
|
4352
|
+
off(event: 'restore', listener: Function): this;
|
|
4353
|
+
once(event: 'restore', listener: Function): this;
|
|
4354
|
+
addListener(event: 'restore', listener: Function): this;
|
|
4355
|
+
removeListener(event: 'restore', listener: Function): this;
|
|
4356
|
+
/**
|
|
4357
|
+
* Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
|
|
4358
|
+
* is ended. The `rotation` value on each emission is the angle in degrees rotated
|
|
4359
|
+
* since the last emission. The last emitted event upon a rotation gesture will
|
|
4360
|
+
* always be of value `0`. Counter-clockwise rotation values are positive, while
|
|
4361
|
+
* clockwise ones are negative.
|
|
4362
|
+
*
|
|
4363
|
+
* @platform darwin
|
|
4364
|
+
*/
|
|
4365
|
+
on(event: 'rotate-gesture', listener: (event: Event,
|
|
4366
|
+
rotation: number) => void): this;
|
|
4367
|
+
/**
|
|
4368
|
+
* @platform darwin
|
|
4369
|
+
*/
|
|
4370
|
+
off(event: 'rotate-gesture', listener: (event: Event,
|
|
4371
|
+
rotation: number) => void): this;
|
|
4372
|
+
/**
|
|
4373
|
+
* @platform darwin
|
|
4374
|
+
*/
|
|
4375
|
+
once(event: 'rotate-gesture', listener: (event: Event,
|
|
4376
|
+
rotation: number) => void): this;
|
|
4377
|
+
/**
|
|
4378
|
+
* @platform darwin
|
|
4379
|
+
*/
|
|
4380
|
+
addListener(event: 'rotate-gesture', listener: (event: Event,
|
|
4381
|
+
rotation: number) => void): this;
|
|
4382
|
+
/**
|
|
4383
|
+
* @platform darwin
|
|
4384
|
+
*/
|
|
4385
|
+
removeListener(event: 'rotate-gesture', listener: (event: Event,
|
|
4386
|
+
rotation: number) => void): this;
|
|
4387
|
+
/**
|
|
4388
|
+
* Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
|
|
4389
|
+
* is ended. The `rotation` value on each emission is the angle in degrees rotated
|
|
4390
|
+
* since the last emission. The last emitted event upon a rotation gesture will
|
|
4391
|
+
* always be of value `0`. Counter-clockwise rotation values are positive, while
|
|
4392
|
+
* clockwise ones are negative.
|
|
4393
|
+
*
|
|
4394
|
+
* @platform darwin
|
|
4395
|
+
*/
|
|
4396
|
+
on(event: 'rotate-gesture', listener: (event: Event,
|
|
4397
|
+
rotation: number) => void): this;
|
|
4398
|
+
/**
|
|
4399
|
+
* @platform darwin
|
|
4400
|
+
*/
|
|
4401
|
+
off(event: 'rotate-gesture', listener: (event: Event,
|
|
4402
|
+
rotation: number) => void): this;
|
|
4403
|
+
/**
|
|
4404
|
+
* @platform darwin
|
|
4405
|
+
*/
|
|
4406
|
+
once(event: 'rotate-gesture', listener: (event: Event,
|
|
4407
|
+
rotation: number) => void): this;
|
|
4408
|
+
/**
|
|
4409
|
+
* @platform darwin
|
|
4410
|
+
*/
|
|
4411
|
+
addListener(event: 'rotate-gesture', listener: (event: Event,
|
|
4412
|
+
rotation: number) => void): this;
|
|
4413
|
+
/**
|
|
4414
|
+
* @platform darwin
|
|
4415
|
+
*/
|
|
4416
|
+
removeListener(event: 'rotate-gesture', listener: (event: Event,
|
|
4417
|
+
rotation: number) => void): this;
|
|
4418
|
+
/**
|
|
4419
|
+
* Emitted when window session is going to end due to force shutdown or machine
|
|
4420
|
+
* restart or session log off.
|
|
4421
|
+
*
|
|
4422
|
+
* @platform win32
|
|
4423
|
+
*/
|
|
4424
|
+
on(event: 'session-end', listener: Function): this;
|
|
4425
|
+
/**
|
|
4426
|
+
* @platform win32
|
|
4427
|
+
*/
|
|
4428
|
+
off(event: 'session-end', listener: Function): this;
|
|
4429
|
+
/**
|
|
4430
|
+
* @platform win32
|
|
4431
|
+
*/
|
|
4432
|
+
once(event: 'session-end', listener: Function): this;
|
|
4433
|
+
/**
|
|
4434
|
+
* @platform win32
|
|
4435
|
+
*/
|
|
4436
|
+
addListener(event: 'session-end', listener: Function): this;
|
|
4437
|
+
/**
|
|
4438
|
+
* @platform win32
|
|
4439
|
+
*/
|
|
4440
|
+
removeListener(event: 'session-end', listener: Function): this;
|
|
4441
|
+
/**
|
|
4442
|
+
* Emitted when window session is going to end due to force shutdown or machine
|
|
4443
|
+
* restart or session log off.
|
|
4444
|
+
*
|
|
4445
|
+
* @platform win32
|
|
4446
|
+
*/
|
|
4447
|
+
on(event: 'session-end', listener: Function): this;
|
|
4448
|
+
/**
|
|
4449
|
+
* @platform win32
|
|
4450
|
+
*/
|
|
4451
|
+
off(event: 'session-end', listener: Function): this;
|
|
4452
|
+
/**
|
|
4453
|
+
* @platform win32
|
|
4454
|
+
*/
|
|
4455
|
+
once(event: 'session-end', listener: Function): this;
|
|
4456
|
+
/**
|
|
4457
|
+
* @platform win32
|
|
4458
|
+
*/
|
|
4459
|
+
addListener(event: 'session-end', listener: Function): this;
|
|
4460
|
+
/**
|
|
4461
|
+
* @platform win32
|
|
4462
|
+
*/
|
|
4463
|
+
removeListener(event: 'session-end', listener: Function): this;
|
|
4464
|
+
/**
|
|
4465
|
+
* Emitted when the window opens a sheet.
|
|
4466
|
+
*
|
|
4467
|
+
* @platform darwin
|
|
4468
|
+
*/
|
|
4469
|
+
on(event: 'sheet-begin', listener: Function): this;
|
|
4470
|
+
/**
|
|
4471
|
+
* @platform darwin
|
|
4472
|
+
*/
|
|
4473
|
+
off(event: 'sheet-begin', listener: Function): this;
|
|
4474
|
+
/**
|
|
4475
|
+
* @platform darwin
|
|
4476
|
+
*/
|
|
4477
|
+
once(event: 'sheet-begin', listener: Function): this;
|
|
4478
|
+
/**
|
|
4479
|
+
* @platform darwin
|
|
4480
|
+
*/
|
|
4481
|
+
addListener(event: 'sheet-begin', listener: Function): this;
|
|
4482
|
+
/**
|
|
4483
|
+
* @platform darwin
|
|
4484
|
+
*/
|
|
4485
|
+
removeListener(event: 'sheet-begin', listener: Function): this;
|
|
4486
|
+
/**
|
|
4487
|
+
* Emitted when the window opens a sheet.
|
|
4488
|
+
*
|
|
4489
|
+
* @platform darwin
|
|
4490
|
+
*/
|
|
4491
|
+
on(event: 'sheet-begin', listener: Function): this;
|
|
4492
|
+
/**
|
|
4493
|
+
* @platform darwin
|
|
4494
|
+
*/
|
|
4495
|
+
off(event: 'sheet-begin', listener: Function): this;
|
|
4496
|
+
/**
|
|
4497
|
+
* @platform darwin
|
|
4498
|
+
*/
|
|
4499
|
+
once(event: 'sheet-begin', listener: Function): this;
|
|
4500
|
+
/**
|
|
4501
|
+
* @platform darwin
|
|
4502
|
+
*/
|
|
4503
|
+
addListener(event: 'sheet-begin', listener: Function): this;
|
|
4504
|
+
/**
|
|
4505
|
+
* @platform darwin
|
|
4506
|
+
*/
|
|
4507
|
+
removeListener(event: 'sheet-begin', listener: Function): this;
|
|
4508
|
+
/**
|
|
4509
|
+
* Emitted when the window has closed a sheet.
|
|
4510
|
+
*
|
|
4511
|
+
* @platform darwin
|
|
4512
|
+
*/
|
|
4513
|
+
on(event: 'sheet-end', listener: Function): this;
|
|
4514
|
+
/**
|
|
4515
|
+
* @platform darwin
|
|
4516
|
+
*/
|
|
4517
|
+
off(event: 'sheet-end', listener: Function): this;
|
|
4518
|
+
/**
|
|
4519
|
+
* @platform darwin
|
|
4520
|
+
*/
|
|
4521
|
+
once(event: 'sheet-end', listener: Function): this;
|
|
4522
|
+
/**
|
|
4523
|
+
* @platform darwin
|
|
4524
|
+
*/
|
|
4525
|
+
addListener(event: 'sheet-end', listener: Function): this;
|
|
4526
|
+
/**
|
|
4527
|
+
* @platform darwin
|
|
4528
|
+
*/
|
|
4529
|
+
removeListener(event: 'sheet-end', listener: Function): this;
|
|
4530
|
+
/**
|
|
4531
|
+
* Emitted when the window has closed a sheet.
|
|
4532
|
+
*
|
|
4533
|
+
* @platform darwin
|
|
4534
|
+
*/
|
|
4535
|
+
on(event: 'sheet-end', listener: Function): this;
|
|
4536
|
+
/**
|
|
4537
|
+
* @platform darwin
|
|
4538
|
+
*/
|
|
4539
|
+
off(event: 'sheet-end', listener: Function): this;
|
|
4540
|
+
/**
|
|
4541
|
+
* @platform darwin
|
|
4542
|
+
*/
|
|
4543
|
+
once(event: 'sheet-end', listener: Function): this;
|
|
4544
|
+
/**
|
|
4545
|
+
* @platform darwin
|
|
4546
|
+
*/
|
|
4547
|
+
addListener(event: 'sheet-end', listener: Function): this;
|
|
4548
|
+
/**
|
|
4549
|
+
* @platform darwin
|
|
4550
|
+
*/
|
|
4551
|
+
removeListener(event: 'sheet-end', listener: Function): this;
|
|
4552
|
+
/**
|
|
4553
|
+
* Emitted when the window is shown.
|
|
4554
|
+
*/
|
|
4555
|
+
on(event: 'show', listener: Function): this;
|
|
4556
|
+
off(event: 'show', listener: Function): this;
|
|
4557
|
+
once(event: 'show', listener: Function): this;
|
|
4558
|
+
addListener(event: 'show', listener: Function): this;
|
|
4559
|
+
removeListener(event: 'show', listener: Function): this;
|
|
4560
|
+
/**
|
|
4561
|
+
* Emitted when the window is shown.
|
|
4562
|
+
*/
|
|
4563
|
+
on(event: 'show', listener: Function): this;
|
|
4564
|
+
off(event: 'show', listener: Function): this;
|
|
4565
|
+
once(event: 'show', listener: Function): this;
|
|
4566
|
+
addListener(event: 'show', listener: Function): this;
|
|
4567
|
+
removeListener(event: 'show', listener: Function): this;
|
|
4568
|
+
/**
|
|
4569
|
+
* Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
|
|
4570
|
+
* `left`.
|
|
4571
|
+
*
|
|
4572
|
+
* The method underlying this event is built to handle older macOS-style trackpad
|
|
4573
|
+
* swiping, where the content on the screen doesn't move with the swipe. Most macOS
|
|
4574
|
+
* trackpads are not configured to allow this kind of swiping anymore, so in order
|
|
4575
|
+
* for it to emit properly the 'Swipe between pages' preference in `System
|
|
4576
|
+
* Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
|
|
4577
|
+
* fingers'.
|
|
4578
|
+
*
|
|
4579
|
+
* @platform darwin
|
|
4580
|
+
*/
|
|
4581
|
+
on(event: 'swipe', listener: (event: Event,
|
|
4582
|
+
direction: string) => void): this;
|
|
4583
|
+
/**
|
|
4584
|
+
* @platform darwin
|
|
4585
|
+
*/
|
|
4586
|
+
off(event: 'swipe', listener: (event: Event,
|
|
4587
|
+
direction: string) => void): this;
|
|
4588
|
+
/**
|
|
4589
|
+
* @platform darwin
|
|
4590
|
+
*/
|
|
4591
|
+
once(event: 'swipe', listener: (event: Event,
|
|
4592
|
+
direction: string) => void): this;
|
|
4593
|
+
/**
|
|
4594
|
+
* @platform darwin
|
|
4595
|
+
*/
|
|
4596
|
+
addListener(event: 'swipe', listener: (event: Event,
|
|
4597
|
+
direction: string) => void): this;
|
|
4598
|
+
/**
|
|
4599
|
+
* @platform darwin
|
|
4600
|
+
*/
|
|
4601
|
+
removeListener(event: 'swipe', listener: (event: Event,
|
|
4602
|
+
direction: string) => void): this;
|
|
4603
|
+
/**
|
|
4604
|
+
* Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
|
|
4605
|
+
* `left`.
|
|
4606
|
+
*
|
|
4607
|
+
* The method underlying this event is built to handle older macOS-style trackpad
|
|
4608
|
+
* swiping, where the content on the screen doesn't move with the swipe. Most macOS
|
|
4609
|
+
* trackpads are not configured to allow this kind of swiping anymore, so in order
|
|
4610
|
+
* for it to emit properly the 'Swipe between pages' preference in `System
|
|
4611
|
+
* Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
|
|
4612
|
+
* fingers'.
|
|
4613
|
+
*
|
|
4614
|
+
* @platform darwin
|
|
4615
|
+
*/
|
|
4616
|
+
on(event: 'swipe', listener: (event: Event,
|
|
4617
|
+
direction: string) => void): this;
|
|
4618
|
+
/**
|
|
4619
|
+
* @platform darwin
|
|
4620
|
+
*/
|
|
4621
|
+
off(event: 'swipe', listener: (event: Event,
|
|
4622
|
+
direction: string) => void): this;
|
|
4623
|
+
/**
|
|
4624
|
+
* @platform darwin
|
|
4625
|
+
*/
|
|
4626
|
+
once(event: 'swipe', listener: (event: Event,
|
|
4627
|
+
direction: string) => void): this;
|
|
4628
|
+
/**
|
|
4629
|
+
* @platform darwin
|
|
4630
|
+
*/
|
|
4631
|
+
addListener(event: 'swipe', listener: (event: Event,
|
|
4632
|
+
direction: string) => void): this;
|
|
4633
|
+
/**
|
|
4634
|
+
* @platform darwin
|
|
4635
|
+
*/
|
|
4636
|
+
removeListener(event: 'swipe', listener: (event: Event,
|
|
4637
|
+
direction: string) => void): this;
|
|
4638
|
+
/**
|
|
4639
|
+
* Emitted when the system context menu is triggered on the window, this is
|
|
4640
|
+
* normally only triggered when the user right clicks on the non-client area of
|
|
4641
|
+
* your window. This is the window titlebar or any area you have declared as
|
|
4642
|
+
* `-webkit-app-region: drag` in a frameless window.
|
|
4643
|
+
*
|
|
4644
|
+
* Calling `event.preventDefault()` will prevent the menu from being displayed.
|
|
4645
|
+
*
|
|
4646
|
+
* @platform win32
|
|
4647
|
+
*/
|
|
4648
|
+
on(event: 'system-context-menu', listener: (event: Event,
|
|
4649
|
+
/**
|
|
4650
|
+
* The screen coordinates the context menu was triggered at
|
|
4651
|
+
*/
|
|
4652
|
+
point: Point) => void): this;
|
|
4653
|
+
/**
|
|
4654
|
+
* @platform win32
|
|
4655
|
+
*/
|
|
4656
|
+
off(event: 'system-context-menu', listener: (event: Event,
|
|
4657
|
+
/**
|
|
4658
|
+
* The screen coordinates the context menu was triggered at
|
|
4659
|
+
*/
|
|
4660
|
+
point: Point) => void): this;
|
|
4661
|
+
/**
|
|
4662
|
+
* @platform win32
|
|
4663
|
+
*/
|
|
4664
|
+
once(event: 'system-context-menu', listener: (event: Event,
|
|
4665
|
+
/**
|
|
4666
|
+
* The screen coordinates the context menu was triggered at
|
|
4667
|
+
*/
|
|
4668
|
+
point: Point) => void): this;
|
|
4669
|
+
/**
|
|
4670
|
+
* @platform win32
|
|
4671
|
+
*/
|
|
4672
|
+
addListener(event: 'system-context-menu', listener: (event: Event,
|
|
4673
|
+
/**
|
|
4674
|
+
* The screen coordinates the context menu was triggered at
|
|
4675
|
+
*/
|
|
4676
|
+
point: Point) => void): this;
|
|
4677
|
+
/**
|
|
4678
|
+
* @platform win32
|
|
4679
|
+
*/
|
|
4680
|
+
removeListener(event: 'system-context-menu', listener: (event: Event,
|
|
4681
|
+
/**
|
|
4682
|
+
* The screen coordinates the context menu was triggered at
|
|
4683
|
+
*/
|
|
4684
|
+
point: Point) => void): this;
|
|
4685
|
+
/**
|
|
4686
|
+
* Emitted when the system context menu is triggered on the window, this is
|
|
4687
|
+
* normally only triggered when the user right clicks on the non-client area of
|
|
4688
|
+
* your window. This is the window titlebar or any area you have declared as
|
|
4689
|
+
* `-webkit-app-region: drag` in a frameless window.
|
|
4690
|
+
*
|
|
4691
|
+
* Calling `event.preventDefault()` will prevent the menu from being displayed.
|
|
4692
|
+
*
|
|
4693
|
+
* @platform win32
|
|
4694
|
+
*/
|
|
4695
|
+
on(event: 'system-context-menu', listener: (event: Event,
|
|
4696
|
+
/**
|
|
4697
|
+
* The screen coordinates the context menu was triggered at
|
|
4698
|
+
*/
|
|
4699
|
+
point: Point) => void): this;
|
|
4700
|
+
/**
|
|
4701
|
+
* @platform win32
|
|
4702
|
+
*/
|
|
4703
|
+
off(event: 'system-context-menu', listener: (event: Event,
|
|
4704
|
+
/**
|
|
4705
|
+
* The screen coordinates the context menu was triggered at
|
|
4706
|
+
*/
|
|
4707
|
+
point: Point) => void): this;
|
|
4708
|
+
/**
|
|
4709
|
+
* @platform win32
|
|
4710
|
+
*/
|
|
4711
|
+
once(event: 'system-context-menu', listener: (event: Event,
|
|
4712
|
+
/**
|
|
4713
|
+
* The screen coordinates the context menu was triggered at
|
|
4714
|
+
*/
|
|
4715
|
+
point: Point) => void): this;
|
|
4716
|
+
/**
|
|
4717
|
+
* @platform win32
|
|
4718
|
+
*/
|
|
4719
|
+
addListener(event: 'system-context-menu', listener: (event: Event,
|
|
4720
|
+
/**
|
|
4721
|
+
* The screen coordinates the context menu was triggered at
|
|
4722
|
+
*/
|
|
4723
|
+
point: Point) => void): this;
|
|
4724
|
+
/**
|
|
4725
|
+
* @platform win32
|
|
4726
|
+
*/
|
|
4727
|
+
removeListener(event: 'system-context-menu', listener: (event: Event,
|
|
4728
|
+
/**
|
|
4729
|
+
* The screen coordinates the context menu was triggered at
|
|
4730
|
+
*/
|
|
4731
|
+
point: Point) => void): this;
|
|
4732
|
+
/**
|
|
4733
|
+
* Emitted when the window exits from a maximized state.
|
|
4734
|
+
*/
|
|
4735
|
+
on(event: 'unmaximize', listener: Function): this;
|
|
4736
|
+
off(event: 'unmaximize', listener: Function): this;
|
|
4737
|
+
once(event: 'unmaximize', listener: Function): this;
|
|
4738
|
+
addListener(event: 'unmaximize', listener: Function): this;
|
|
4739
|
+
removeListener(event: 'unmaximize', listener: Function): this;
|
|
4740
|
+
/**
|
|
4741
|
+
* Emitted when the window exits from a maximized state.
|
|
4742
|
+
*/
|
|
4743
|
+
on(event: 'unmaximize', listener: Function): this;
|
|
4744
|
+
off(event: 'unmaximize', listener: Function): this;
|
|
4745
|
+
once(event: 'unmaximize', listener: Function): this;
|
|
4746
|
+
addListener(event: 'unmaximize', listener: Function): this;
|
|
4747
|
+
removeListener(event: 'unmaximize', listener: Function): this;
|
|
4748
|
+
/**
|
|
4749
|
+
* Emitted when the web page becomes unresponsive.
|
|
4750
|
+
*/
|
|
4751
|
+
on(event: 'unresponsive', listener: Function): this;
|
|
4752
|
+
off(event: 'unresponsive', listener: Function): this;
|
|
4753
|
+
once(event: 'unresponsive', listener: Function): this;
|
|
4754
|
+
addListener(event: 'unresponsive', listener: Function): this;
|
|
4755
|
+
removeListener(event: 'unresponsive', listener: Function): this;
|
|
4756
|
+
/**
|
|
4757
|
+
* Emitted before the window is moved. On Windows, calling `event.preventDefault()`
|
|
4758
|
+
* will prevent the window from being moved.
|
|
4759
|
+
*
|
|
4760
|
+
* Note that this is only emitted when the window is being moved manually. Moving
|
|
4761
|
+
* the window with `setPosition`/`setBounds`/`center` will not emit this event.
|
|
4762
|
+
*
|
|
4763
|
+
* @platform darwin,win32
|
|
4764
|
+
*/
|
|
4765
|
+
on(event: 'will-move', listener: (event: Event,
|
|
4766
|
+
/**
|
|
4767
|
+
* Location the window is being moved to.
|
|
4768
|
+
*/
|
|
4769
|
+
newBounds: Rectangle) => void): this;
|
|
4770
|
+
/**
|
|
4771
|
+
* @platform darwin,win32
|
|
4772
|
+
*/
|
|
4773
|
+
off(event: 'will-move', listener: (event: Event,
|
|
4774
|
+
/**
|
|
4775
|
+
* Location the window is being moved to.
|
|
4776
|
+
*/
|
|
4777
|
+
newBounds: Rectangle) => void): this;
|
|
4778
|
+
/**
|
|
4779
|
+
* @platform darwin,win32
|
|
4780
|
+
*/
|
|
4781
|
+
once(event: 'will-move', listener: (event: Event,
|
|
4782
|
+
/**
|
|
4783
|
+
* Location the window is being moved to.
|
|
4784
|
+
*/
|
|
4785
|
+
newBounds: Rectangle) => void): this;
|
|
4786
|
+
/**
|
|
4787
|
+
* @platform darwin,win32
|
|
4788
|
+
*/
|
|
4789
|
+
addListener(event: 'will-move', listener: (event: Event,
|
|
4790
|
+
/**
|
|
4791
|
+
* Location the window is being moved to.
|
|
4792
|
+
*/
|
|
4793
|
+
newBounds: Rectangle) => void): this;
|
|
4794
|
+
/**
|
|
4795
|
+
* @platform darwin,win32
|
|
4796
|
+
*/
|
|
4797
|
+
removeListener(event: 'will-move', listener: (event: Event,
|
|
4798
|
+
/**
|
|
4799
|
+
* Location the window is being moved to.
|
|
4800
|
+
*/
|
|
4801
|
+
newBounds: Rectangle) => void): this;
|
|
4802
|
+
/**
|
|
4803
|
+
* Emitted before the window is moved. On Windows, calling `event.preventDefault()`
|
|
4804
|
+
* will prevent the window from being moved.
|
|
4805
|
+
*
|
|
4806
|
+
* Note that this is only emitted when the window is being moved manually. Moving
|
|
4807
|
+
* the window with `setPosition`/`setBounds`/`center` will not emit this event.
|
|
4808
|
+
*
|
|
4809
|
+
* @platform darwin,win32
|
|
4810
|
+
*/
|
|
4811
|
+
on(event: 'will-move', listener: (event: Event,
|
|
4812
|
+
/**
|
|
4813
|
+
* Location the window is being moved to.
|
|
4814
|
+
*/
|
|
4815
|
+
newBounds: Rectangle) => void): this;
|
|
4816
|
+
/**
|
|
4817
|
+
* @platform darwin,win32
|
|
4818
|
+
*/
|
|
4819
|
+
off(event: 'will-move', listener: (event: Event,
|
|
4820
|
+
/**
|
|
4821
|
+
* Location the window is being moved to.
|
|
4822
|
+
*/
|
|
4823
|
+
newBounds: Rectangle) => void): this;
|
|
4824
|
+
/**
|
|
4825
|
+
* @platform darwin,win32
|
|
4826
|
+
*/
|
|
4827
|
+
once(event: 'will-move', listener: (event: Event,
|
|
4828
|
+
/**
|
|
4829
|
+
* Location the window is being moved to.
|
|
4830
|
+
*/
|
|
4831
|
+
newBounds: Rectangle) => void): this;
|
|
4832
|
+
/**
|
|
4833
|
+
* @platform darwin,win32
|
|
4834
|
+
*/
|
|
4835
|
+
addListener(event: 'will-move', listener: (event: Event,
|
|
4836
|
+
/**
|
|
4837
|
+
* Location the window is being moved to.
|
|
4838
|
+
*/
|
|
4839
|
+
newBounds: Rectangle) => void): this;
|
|
4840
|
+
/**
|
|
4841
|
+
* @platform darwin,win32
|
|
4842
|
+
*/
|
|
4843
|
+
removeListener(event: 'will-move', listener: (event: Event,
|
|
4844
|
+
/**
|
|
4845
|
+
* Location the window is being moved to.
|
|
4846
|
+
*/
|
|
4847
|
+
newBounds: Rectangle) => void): this;
|
|
4848
|
+
/**
|
|
4849
|
+
* Emitted before the window is resized. Calling `event.preventDefault()` will
|
|
4850
|
+
* prevent the window from being resized.
|
|
4851
|
+
*
|
|
4852
|
+
* Note that this is only emitted when the window is being resized manually.
|
|
4853
|
+
* Resizing the window with `setBounds`/`setSize` will not emit this event.
|
|
4854
|
+
*
|
|
4855
|
+
* The possible values and behaviors of the `edge` option are platform dependent.
|
|
4856
|
+
* Possible values are:
|
|
4857
|
+
*
|
|
4858
|
+
* * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
|
|
4859
|
+
* `top-right`, `bottom-left`, `bottom-right`.
|
|
4860
|
+
* * On macOS, possible values are `bottom` and `right`.
|
|
4861
|
+
* * The value `bottom` is used to denote vertical resizing.
|
|
4862
|
+
* * The value `right` is used to denote horizontal resizing.
|
|
4863
|
+
*
|
|
4864
|
+
* @platform darwin,win32
|
|
4865
|
+
*/
|
|
4866
|
+
on(event: 'will-resize', listener: (event: Event,
|
|
4867
|
+
/**
|
|
4868
|
+
* Size the window is being resized to.
|
|
4869
|
+
*/
|
|
4870
|
+
newBounds: Rectangle,
|
|
4871
|
+
details: WillResizeDetails) => void): this;
|
|
4872
|
+
/**
|
|
4873
|
+
* @platform darwin,win32
|
|
4874
|
+
*/
|
|
4875
|
+
off(event: 'will-resize', listener: (event: Event,
|
|
4876
|
+
/**
|
|
4877
|
+
* Size the window is being resized to.
|
|
4878
|
+
*/
|
|
4879
|
+
newBounds: Rectangle,
|
|
4880
|
+
details: WillResizeDetails) => void): this;
|
|
4881
|
+
/**
|
|
4882
|
+
* @platform darwin,win32
|
|
4883
|
+
*/
|
|
4884
|
+
once(event: 'will-resize', listener: (event: Event,
|
|
4885
|
+
/**
|
|
4886
|
+
* Size the window is being resized to.
|
|
4887
|
+
*/
|
|
4888
|
+
newBounds: Rectangle,
|
|
4889
|
+
details: WillResizeDetails) => void): this;
|
|
4890
|
+
/**
|
|
4891
|
+
* @platform darwin,win32
|
|
4892
|
+
*/
|
|
4893
|
+
addListener(event: 'will-resize', listener: (event: Event,
|
|
4894
|
+
/**
|
|
4895
|
+
* Size the window is being resized to.
|
|
4896
|
+
*/
|
|
4897
|
+
newBounds: Rectangle,
|
|
4898
|
+
details: WillResizeDetails) => void): this;
|
|
4899
|
+
/**
|
|
4900
|
+
* @platform darwin,win32
|
|
4901
|
+
*/
|
|
4902
|
+
removeListener(event: 'will-resize', listener: (event: Event,
|
|
4903
|
+
/**
|
|
4904
|
+
* Size the window is being resized to.
|
|
4905
|
+
*/
|
|
4906
|
+
newBounds: Rectangle,
|
|
4907
|
+
details: WillResizeDetails) => void): this;
|
|
4908
|
+
/**
|
|
4909
|
+
* Emitted before the window is resized. Calling `event.preventDefault()` will
|
|
4910
|
+
* prevent the window from being resized.
|
|
4911
|
+
*
|
|
4912
|
+
* Note that this is only emitted when the window is being resized manually.
|
|
4913
|
+
* Resizing the window with `setBounds`/`setSize` will not emit this event.
|
|
4914
|
+
*
|
|
4915
|
+
* The possible values and behaviors of the `edge` option are platform dependent.
|
|
4916
|
+
* Possible values are:
|
|
4917
|
+
*
|
|
4918
|
+
* * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
|
|
4919
|
+
* `top-right`, `bottom-left`, `bottom-right`.
|
|
4920
|
+
* * On macOS, possible values are `bottom` and `right`.
|
|
4921
|
+
* * The value `bottom` is used to denote vertical resizing.
|
|
4922
|
+
* * The value `right` is used to denote horizontal resizing.
|
|
4923
|
+
*
|
|
4924
|
+
* @platform darwin,win32
|
|
4925
|
+
*/
|
|
4926
|
+
on(event: 'will-resize', listener: (event: Event,
|
|
4927
|
+
/**
|
|
4928
|
+
* Size the window is being resized to.
|
|
4929
|
+
*/
|
|
4930
|
+
newBounds: Rectangle,
|
|
4931
|
+
details: WillResizeDetails) => void): this;
|
|
4932
|
+
/**
|
|
4933
|
+
* @platform darwin,win32
|
|
4934
|
+
*/
|
|
4935
|
+
off(event: 'will-resize', listener: (event: Event,
|
|
4936
|
+
/**
|
|
4937
|
+
* Size the window is being resized to.
|
|
4938
|
+
*/
|
|
4939
|
+
newBounds: Rectangle,
|
|
4940
|
+
details: WillResizeDetails) => void): this;
|
|
4941
|
+
/**
|
|
4942
|
+
* @platform darwin,win32
|
|
4943
|
+
*/
|
|
4944
|
+
once(event: 'will-resize', listener: (event: Event,
|
|
4945
|
+
/**
|
|
4946
|
+
* Size the window is being resized to.
|
|
4947
|
+
*/
|
|
4948
|
+
newBounds: Rectangle,
|
|
4949
|
+
details: WillResizeDetails) => void): this;
|
|
4950
|
+
/**
|
|
4951
|
+
* @platform darwin,win32
|
|
4952
|
+
*/
|
|
4953
|
+
addListener(event: 'will-resize', listener: (event: Event,
|
|
4954
|
+
/**
|
|
4955
|
+
* Size the window is being resized to.
|
|
4956
|
+
*/
|
|
4957
|
+
newBounds: Rectangle,
|
|
4958
|
+
details: WillResizeDetails) => void): this;
|
|
4959
|
+
/**
|
|
4960
|
+
* @platform darwin,win32
|
|
4961
|
+
*/
|
|
4962
|
+
removeListener(event: 'will-resize', listener: (event: Event,
|
|
4963
|
+
/**
|
|
4964
|
+
* Size the window is being resized to.
|
|
4965
|
+
*/
|
|
4966
|
+
newBounds: Rectangle,
|
|
4967
|
+
details: WillResizeDetails) => void): this;
|
|
4968
|
+
/**
|
|
4969
|
+
* BrowserWindow
|
|
4970
|
+
*/
|
|
4971
|
+
constructor(options?: BrowserWindowConstructorOptions);
|
|
4972
|
+
/**
|
|
4973
|
+
* > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
|
4974
|
+
* `WebContentsView` class.
|
|
4975
|
+
*
|
|
4976
|
+
* The window that owns the given `browserView`. If the given view is not attached
|
|
4977
|
+
* to any window, returns `null`.
|
|
4978
|
+
*
|
|
4979
|
+
* @deprecated
|
|
4980
|
+
*/
|
|
4981
|
+
static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
|
|
4982
|
+
/**
|
|
4983
|
+
* The window with the given `id`.
|
|
4984
|
+
*/
|
|
4985
|
+
static fromId(id: number): (BrowserWindow) | (null);
|
|
4986
|
+
/**
|
|
4987
|
+
* The window that owns the given `webContents` or `null` if the contents are not
|
|
4988
|
+
* owned by a window.
|
|
4989
|
+
*/
|
|
4990
|
+
static fromWebContents(webContents: WebContents): (BrowserWindow) | (null);
|
|
4991
|
+
/**
|
|
4992
|
+
* An array of all opened browser windows.
|
|
4993
|
+
*/
|
|
4994
|
+
static getAllWindows(): BrowserWindow[];
|
|
4995
|
+
/**
|
|
4996
|
+
* The window that is focused in this application, otherwise returns `null`.
|
|
4997
|
+
*/
|
|
4998
|
+
static getFocusedWindow(): (BrowserWindow) | (null);
|
|
4999
|
+
/**
|
|
5000
|
+
* Replacement API for setBrowserView supporting work with multi browser views.
|
|
5001
|
+
*
|
|
5002
|
+
* > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
|
5003
|
+
* `WebContentsView` class.
|
|
5004
|
+
*
|
|
5005
|
+
* @experimental
|
|
5006
|
+
* @deprecated
|
|
5007
|
+
*/
|
|
5008
|
+
addBrowserView(browserView: BrowserView): void;
|
|
5009
|
+
/**
|
|
5010
|
+
* Adds a window as a tab on this window, after the tab for the window instance.
|
|
5011
|
+
*
|
|
5012
|
+
* @platform darwin
|
|
5013
|
+
*/
|
|
5014
|
+
addTabbedWindow(browserWindow: BrowserWindow): void;
|
|
5015
|
+
/**
|
|
5016
|
+
* Removes focus from the window.
|
|
5017
|
+
*/
|
|
5018
|
+
blur(): void;
|
|
5019
|
+
blurWebView(): void;
|
|
5020
|
+
/**
|
|
5021
|
+
* Resolves with a NativeImage
|
|
5022
|
+
*
|
|
5023
|
+
* Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
|
5024
|
+
* whole visible page. If the page is not visible, `rect` may be empty. The page is
|
|
5025
|
+
* considered visible when its browser window is hidden and the capturer count is
|
|
5026
|
+
* non-zero. If you would like the page to stay hidden, you should ensure that
|
|
5027
|
+
* `stayHidden` is set to true.
|
|
5028
|
+
*/
|
|
5029
|
+
capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
|
|
5030
|
+
/**
|
|
5031
|
+
* Moves window to the center of the screen.
|
|
5032
|
+
*/
|
|
5033
|
+
center(): void;
|
|
5034
|
+
/**
|
|
5035
|
+
* Try to close the window. This has the same effect as a user manually clicking
|
|
5036
|
+
* the close button of the window. The web page may cancel the close though. See
|
|
5037
|
+
* the close event.
|
|
5038
|
+
*/
|
|
5039
|
+
close(): void;
|
|
5040
|
+
/**
|
|
5041
|
+
* Closes the currently open Quick Look panel.
|
|
5042
|
+
*
|
|
5043
|
+
* @platform darwin
|
|
5044
|
+
*/
|
|
5045
|
+
closeFilePreview(): void;
|
|
5046
|
+
/**
|
|
5047
|
+
* Force closing the window, the `unload` and `beforeunload` event won't be emitted
|
|
5048
|
+
* for the web page, and `close` event will also not be emitted for this window,
|
|
5049
|
+
* but it guarantees the `closed` event will be emitted.
|
|
5050
|
+
*/
|
|
5051
|
+
destroy(): void;
|
|
5052
|
+
/**
|
|
5053
|
+
* Starts or stops flashing the window to attract user's attention.
|
|
5054
|
+
*/
|
|
5055
|
+
flashFrame(flag: boolean): void;
|
|
5056
|
+
/**
|
|
5057
|
+
* Focuses on the window.
|
|
5058
|
+
*/
|
|
5059
|
+
focus(): void;
|
|
5060
|
+
focusOnWebView(): void;
|
|
5061
|
+
/**
|
|
5062
|
+
* Gets the background color of the window in Hex (`#RRGGBB`) format.
|
|
5063
|
+
*
|
|
5064
|
+
* See Setting `backgroundColor`.
|
|
5065
|
+
*
|
|
5066
|
+
* **Note:** The alpha value is _not_ returned alongside the red, green, and blue
|
|
5067
|
+
* values.
|
|
5068
|
+
*/
|
|
5069
|
+
getBackgroundColor(): string;
|
|
5070
|
+
/**
|
|
5071
|
+
* The `bounds` of the window as `Object`.
|
|
5072
|
+
*
|
|
5073
|
+
* **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
|
|
5074
|
+
* height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
|
|
5075
|
+
* 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
|
|
5076
|
+
* 25, y: 38, width: 800, height: 600 }`.
|
|
5077
|
+
*/
|
|
5078
|
+
getBounds(): Rectangle;
|
|
5079
|
+
/**
|
|
5080
|
+
* The `BrowserView` attached to `win`. Returns `null` if one is not attached.
|
|
5081
|
+
* Throws an error if multiple `BrowserView`s are attached.
|
|
5082
|
+
*
|
|
5083
|
+
* > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
|
5084
|
+
* `WebContentsView` class.
|
|
5085
|
+
*
|
|
5086
|
+
* @experimental
|
|
5087
|
+
* @deprecated
|
|
5088
|
+
*/
|
|
5089
|
+
getBrowserView(): (BrowserView) | (null);
|
|
5090
|
+
/**
|
|
5091
|
+
* a sorted by z-index array of all BrowserViews that have been attached with
|
|
5092
|
+
* `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
|
|
5093
|
+
* element of the array.
|
|
5094
|
+
*
|
|
5095
|
+
* > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
|
5096
|
+
* `WebContentsView` class.
|
|
5097
|
+
*
|
|
5098
|
+
* @experimental
|
|
5099
|
+
* @deprecated
|
|
5100
|
+
*/
|
|
5101
|
+
getBrowserViews(): BrowserView[];
|
|
5102
|
+
/**
|
|
5103
|
+
* All child windows.
|
|
5104
|
+
*/
|
|
5105
|
+
getChildWindows(): BrowserWindow[];
|
|
5106
|
+
/**
|
|
5107
|
+
* The `bounds` of the window's client area as `Object`.
|
|
5108
|
+
*/
|
|
5109
|
+
getContentBounds(): Rectangle;
|
|
5110
|
+
/**
|
|
5111
|
+
* Contains the window's client area's width and height.
|
|
5112
|
+
*/
|
|
5113
|
+
getContentSize(): number[];
|
|
5114
|
+
/**
|
|
5115
|
+
* Contains the window's maximum width and height.
|
|
5116
|
+
*/
|
|
5117
|
+
getMaximumSize(): number[];
|
|
5118
|
+
/**
|
|
5119
|
+
* Window id in the format of DesktopCapturerSource's id. For example
|
|
5120
|
+
* "window:1324:0".
|
|
5121
|
+
*
|
|
5122
|
+
* More precisely the format is `window:id:other_id` where `id` is `HWND` on
|
|
5123
|
+
* Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
|
|
5124
|
+
* Linux. `other_id` is used to identify web contents (tabs) so within the same top
|
|
5125
|
+
* level window.
|
|
5126
|
+
*/
|
|
5127
|
+
getMediaSourceId(): string;
|
|
5128
|
+
/**
|
|
5129
|
+
* Contains the window's minimum width and height.
|
|
5130
|
+
*/
|
|
5131
|
+
getMinimumSize(): number[];
|
|
5132
|
+
/**
|
|
5133
|
+
* The platform-specific handle of the window.
|
|
5134
|
+
*
|
|
5135
|
+
* The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
|
|
5136
|
+
* `Window` (`unsigned long`) on Linux.
|
|
5137
|
+
*/
|
|
5138
|
+
getNativeWindowHandle(): Buffer;
|
|
5139
|
+
/**
|
|
5140
|
+
* Contains the window bounds of the normal state
|
|
5141
|
+
*
|
|
5142
|
+
* **Note:** whatever the current state of the window : maximized, minimized or in
|
|
5143
|
+
* fullscreen, this function always returns the position and size of the window in
|
|
5144
|
+
* normal state. In normal state, getBounds and getNormalBounds returns the same
|
|
5145
|
+
* `Rectangle`.
|
|
5146
|
+
*/
|
|
5147
|
+
getNormalBounds(): Rectangle;
|
|
5148
|
+
/**
|
|
5149
|
+
* between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
|
|
5150
|
+
* 1.
|
|
5151
|
+
*/
|
|
5152
|
+
getOpacity(): number;
|
|
5153
|
+
/**
|
|
5154
|
+
* The parent window or `null` if there is no parent.
|
|
5155
|
+
*/
|
|
5156
|
+
getParentWindow(): (BrowserWindow) | (null);
|
|
5157
|
+
/**
|
|
5158
|
+
* Contains the window's current position.
|
|
5159
|
+
*/
|
|
5160
|
+
getPosition(): number[];
|
|
5161
|
+
/**
|
|
5162
|
+
* The pathname of the file the window represents.
|
|
5163
|
+
*
|
|
5164
|
+
* @platform darwin
|
|
5165
|
+
*/
|
|
5166
|
+
getRepresentedFilename(): string;
|
|
5167
|
+
/**
|
|
5168
|
+
* Contains the window's width and height.
|
|
5169
|
+
*/
|
|
5170
|
+
getSize(): number[];
|
|
5171
|
+
/**
|
|
5172
|
+
* The title of the native window.
|
|
5173
|
+
*
|
|
5174
|
+
* **Note:** The title of the web page can be different from the title of the
|
|
5175
|
+
* native window.
|
|
5176
|
+
*/
|
|
5177
|
+
getTitle(): string;
|
|
5178
|
+
/**
|
|
5179
|
+
* The custom position for the traffic light buttons in frameless window, `null`
|
|
5180
|
+
* will be returned when there is no custom position.
|
|
5181
|
+
*
|
|
5182
|
+
* @platform darwin
|
|
5183
|
+
*/
|
|
5184
|
+
getWindowButtonPosition(): (Point) | (null);
|
|
5185
|
+
/**
|
|
5186
|
+
* Whether the window has a shadow.
|
|
5187
|
+
*/
|
|
5188
|
+
hasShadow(): boolean;
|
|
5189
|
+
/**
|
|
5190
|
+
* Hides the window.
|
|
5191
|
+
*/
|
|
5192
|
+
hide(): void;
|
|
5193
|
+
/**
|
|
5194
|
+
* Hooks a windows message. The `callback` is called when the message is received
|
|
5195
|
+
* in the WndProc.
|
|
5196
|
+
*
|
|
5197
|
+
* @platform win32
|
|
5198
|
+
*/
|
|
5199
|
+
hookWindowMessage(message: number, callback: (wParam: Buffer, lParam: Buffer) => void): void;
|
|
5200
|
+
/**
|
|
5201
|
+
* Invalidates the window shadow so that it is recomputed based on the current
|
|
5202
|
+
* window shape.
|
|
5203
|
+
*
|
|
5204
|
+
* `BrowserWindows` that are transparent can sometimes leave behind visual
|
|
5205
|
+
* artifacts on macOS. This method can be used to clear these artifacts when, for
|
|
5206
|
+
* example, performing an animation.
|
|
5207
|
+
*
|
|
5208
|
+
* @platform darwin
|
|
5209
|
+
*/
|
|
5210
|
+
invalidateShadow(): void;
|
|
5211
|
+
/**
|
|
5212
|
+
* Whether the window is always on top of other windows.
|
|
5213
|
+
*/
|
|
5214
|
+
isAlwaysOnTop(): boolean;
|
|
5215
|
+
/**
|
|
5216
|
+
* Whether the window can be manually closed by user.
|
|
5217
|
+
*
|
|
5218
|
+
* On Linux always returns `true`.
|
|
5219
|
+
*
|
|
5220
|
+
* @platform darwin,win32
|
|
5221
|
+
*/
|
|
5222
|
+
isClosable(): boolean;
|
|
5223
|
+
/**
|
|
5224
|
+
* Whether the window is destroyed.
|
|
5225
|
+
*/
|
|
5226
|
+
isDestroyed(): boolean;
|
|
5227
|
+
/**
|
|
5228
|
+
* Whether the window's document has been edited.
|
|
5229
|
+
*
|
|
5230
|
+
* @platform darwin
|
|
5231
|
+
*/
|
|
5232
|
+
isDocumentEdited(): boolean;
|
|
5233
|
+
/**
|
|
5234
|
+
* whether the window is enabled.
|
|
5235
|
+
*/
|
|
5236
|
+
isEnabled(): boolean;
|
|
5237
|
+
/**
|
|
5238
|
+
* Whether the window can be focused.
|
|
5239
|
+
*
|
|
5240
|
+
* @platform darwin,win32
|
|
5241
|
+
*/
|
|
5242
|
+
isFocusable(): boolean;
|
|
5243
|
+
/**
|
|
5244
|
+
* Whether the window is focused.
|
|
5245
|
+
*/
|
|
5246
|
+
isFocused(): boolean;
|
|
5247
|
+
/**
|
|
5248
|
+
* Whether the window is in fullscreen mode.
|
|
5249
|
+
*/
|
|
5250
|
+
isFullScreen(): boolean;
|
|
5251
|
+
/**
|
|
5252
|
+
* Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
|
|
5253
|
+
* window.
|
|
5254
|
+
*/
|
|
5255
|
+
isFullScreenable(): boolean;
|
|
5256
|
+
/**
|
|
5257
|
+
* Whether the window will be hidden when the user toggles into mission control.
|
|
5258
|
+
*
|
|
5259
|
+
* @platform darwin
|
|
5260
|
+
*/
|
|
5261
|
+
isHiddenInMissionControl(): boolean;
|
|
5262
|
+
/**
|
|
5263
|
+
* Whether the window is in kiosk mode.
|
|
5264
|
+
*/
|
|
5265
|
+
isKiosk(): boolean;
|
|
5266
|
+
/**
|
|
5267
|
+
* Whether the window can be manually maximized by user.
|
|
5268
|
+
*
|
|
5269
|
+
* On Linux always returns `true`.
|
|
5270
|
+
*
|
|
5271
|
+
* @platform darwin,win32
|
|
5272
|
+
*/
|
|
5273
|
+
isMaximizable(): boolean;
|
|
5274
|
+
/**
|
|
5275
|
+
* Whether the window is maximized.
|
|
5276
|
+
*/
|
|
5277
|
+
isMaximized(): boolean;
|
|
5278
|
+
/**
|
|
5279
|
+
* Whether menu bar automatically hides itself.
|
|
5280
|
+
*
|
|
5281
|
+
* @platform win32,linux
|
|
5282
|
+
*/
|
|
5283
|
+
isMenuBarAutoHide(): boolean;
|
|
5284
|
+
/**
|
|
5285
|
+
* Whether the menu bar is visible.
|
|
5286
|
+
*
|
|
5287
|
+
* @platform win32,linux
|
|
5288
|
+
*/
|
|
5289
|
+
isMenuBarVisible(): boolean;
|
|
5290
|
+
/**
|
|
5291
|
+
* Whether the window can be manually minimized by the user.
|
|
5292
|
+
*
|
|
5293
|
+
* On Linux always returns `true`.
|
|
5294
|
+
*
|
|
5295
|
+
* @platform darwin,win32
|
|
5296
|
+
*/
|
|
5297
|
+
isMinimizable(): boolean;
|
|
5298
|
+
/**
|
|
5299
|
+
* Whether the window is minimized.
|
|
5300
|
+
*/
|
|
5301
|
+
isMinimized(): boolean;
|
|
5302
|
+
/**
|
|
5303
|
+
* Whether current window is a modal window.
|
|
5304
|
+
*/
|
|
5305
|
+
isModal(): boolean;
|
|
5306
|
+
/**
|
|
5307
|
+
* Whether the window can be moved by user.
|
|
5308
|
+
*
|
|
5309
|
+
* On Linux always returns `true`.
|
|
5310
|
+
*
|
|
5311
|
+
* @platform darwin,win32
|
|
5312
|
+
*/
|
|
5313
|
+
isMovable(): boolean;
|
|
5314
|
+
/**
|
|
5315
|
+
* Whether the window is in normal state (not maximized, not minimized, not in
|
|
5316
|
+
* fullscreen mode).
|
|
5317
|
+
*/
|
|
5318
|
+
isNormal(): boolean;
|
|
5319
|
+
/**
|
|
5320
|
+
* Whether the window can be manually resized by the user.
|
|
5321
|
+
*/
|
|
5322
|
+
isResizable(): boolean;
|
|
5323
|
+
/**
|
|
5324
|
+
* Whether the window is in simple (pre-Lion) fullscreen mode.
|
|
5325
|
+
*
|
|
5326
|
+
* @platform darwin
|
|
5327
|
+
*/
|
|
5328
|
+
isSimpleFullScreen(): boolean;
|
|
5329
|
+
/**
|
|
5330
|
+
* Whether the window is in Windows 10 tablet mode.
|
|
5331
|
+
*
|
|
5332
|
+
* Since Windows 10 users can use their PC as tablet, under this mode apps can
|
|
5333
|
+
* choose to optimize their UI for tablets, such as enlarging the titlebar and
|
|
5334
|
+
* hiding titlebar buttons.
|
|
5335
|
+
*
|
|
5336
|
+
* This API returns whether the window is in tablet mode, and the `resize` event
|
|
5337
|
+
* can be be used to listen to changes to tablet mode.
|
|
5338
|
+
*
|
|
5339
|
+
* @platform win32
|
|
5340
|
+
*/
|
|
5341
|
+
isTabletMode(): boolean;
|
|
5342
|
+
/**
|
|
5343
|
+
* Whether the window is visible to the user in the foreground of the app.
|
|
5344
|
+
*/
|
|
5345
|
+
isVisible(): boolean;
|
|
5346
|
+
/**
|
|
5347
|
+
* Whether the window is visible on all workspaces.
|
|
5348
|
+
*
|
|
5349
|
+
* **Note:** This API always returns false on Windows.
|
|
5350
|
+
*
|
|
5351
|
+
* @platform darwin,linux
|
|
5352
|
+
*/
|
|
5353
|
+
isVisibleOnAllWorkspaces(): boolean;
|
|
5354
|
+
/**
|
|
5355
|
+
* `true` or `false` depending on whether the message is hooked.
|
|
5356
|
+
*
|
|
5357
|
+
* @platform win32
|
|
5358
|
+
*/
|
|
5359
|
+
isWindowMessageHooked(message: number): boolean;
|
|
5360
|
+
/**
|
|
5361
|
+
* the promise will resolve when the page has finished loading (see
|
|
5362
|
+
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
|
5363
|
+
*
|
|
5364
|
+
* Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
|
|
5365
|
+
* relative to the root of your application. See the `webContents` docs for more
|
|
5366
|
+
* information.
|
|
5367
|
+
*/
|
|
5368
|
+
loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
|
|
5369
|
+
/**
|
|
5370
|
+
* the promise will resolve when the page has finished loading (see
|
|
5371
|
+
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
|
5372
|
+
*
|
|
5373
|
+
* Same as `webContents.loadURL(url[, options])`.
|
|
5374
|
+
*
|
|
5375
|
+
* The `url` can be a remote address (e.g. `http://`) or a path to a local HTML
|
|
5376
|
+
* file using the `file://` protocol.
|
|
5377
|
+
*
|
|
5378
|
+
* To ensure that file URLs are properly formatted, it is recommended to use Node's
|
|
5379
|
+
* `url.format` method:
|
|
5380
|
+
*
|
|
5381
|
+
* You can load a URL using a `POST` request with URL-encoded data by doing the
|
|
5382
|
+
* following:
|
|
5383
|
+
*/
|
|
5384
|
+
loadURL(url: string, options?: LoadURLOptions): Promise<void>;
|
|
5385
|
+
/**
|
|
5386
|
+
* Maximizes the window. This will also show (but not focus) the window if it isn't
|
|
5387
|
+
* being displayed already.
|
|
5388
|
+
*/
|
|
5389
|
+
maximize(): void;
|
|
5390
|
+
/**
|
|
5391
|
+
* Merges all windows into one window with multiple tabs when native tabs are
|
|
5392
|
+
* enabled and there is more than one open window.
|
|
5393
|
+
*
|
|
5394
|
+
* @platform darwin
|
|
5395
|
+
*/
|
|
5396
|
+
mergeAllWindows(): void;
|
|
5397
|
+
/**
|
|
5398
|
+
* Minimizes the window. On some platforms the minimized window will be shown in
|
|
5399
|
+
* the Dock.
|
|
5400
|
+
*/
|
|
5401
|
+
minimize(): void;
|
|
5402
|
+
/**
|
|
5403
|
+
* Moves window above the source window in the sense of z-order. If the
|
|
5404
|
+
* `mediaSourceId` is not of type window or if the window does not exist then this
|
|
5405
|
+
* method throws an error.
|
|
5406
|
+
*/
|
|
5407
|
+
moveAbove(mediaSourceId: string): void;
|
|
5408
|
+
/**
|
|
5409
|
+
* Moves the current tab into a new window if native tabs are enabled and there is
|
|
5410
|
+
* more than one tab in the current window.
|
|
5411
|
+
*
|
|
5412
|
+
* @platform darwin
|
|
5413
|
+
*/
|
|
5414
|
+
moveTabToNewWindow(): void;
|
|
5415
|
+
/**
|
|
5416
|
+
* Moves window to top(z-order) regardless of focus
|
|
5417
|
+
*/
|
|
5418
|
+
moveTop(): void;
|
|
5419
|
+
/**
|
|
5420
|
+
* Uses Quick Look to preview a file at a given path.
|
|
5421
|
+
*
|
|
5422
|
+
* @platform darwin
|
|
5423
|
+
*/
|
|
5424
|
+
previewFile(path: string, displayName?: string): void;
|
|
5425
|
+
/**
|
|
5426
|
+
* Same as `webContents.reload`.
|
|
5427
|
+
*/
|
|
5428
|
+
reload(): void;
|
|
5429
|
+
/**
|
|
5430
|
+
* > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
|
5431
|
+
* `WebContentsView` class.
|
|
5432
|
+
*
|
|
5433
|
+
* @experimental
|
|
5434
|
+
* @deprecated
|
|
5435
|
+
*/
|
|
5436
|
+
removeBrowserView(browserView: BrowserView): void;
|
|
5437
|
+
/**
|
|
5438
|
+
* Remove the window's menu bar.
|
|
5439
|
+
*
|
|
5440
|
+
* @platform linux,win32
|
|
5441
|
+
*/
|
|
5442
|
+
removeMenu(): void;
|
|
5443
|
+
/**
|
|
5444
|
+
* Restores the window from minimized state to its previous state.
|
|
5445
|
+
*/
|
|
5446
|
+
restore(): void;
|
|
5447
|
+
/**
|
|
5448
|
+
* Selects the next tab when native tabs are enabled and there are other tabs in
|
|
5449
|
+
* the window.
|
|
5450
|
+
*
|
|
5451
|
+
* @platform darwin
|
|
5452
|
+
*/
|
|
5453
|
+
selectNextTab(): void;
|
|
5454
|
+
/**
|
|
5455
|
+
* Selects the previous tab when native tabs are enabled and there are other tabs
|
|
5456
|
+
* in the window.
|
|
5457
|
+
*
|
|
5458
|
+
* @platform darwin
|
|
5459
|
+
*/
|
|
5460
|
+
selectPreviousTab(): void;
|
|
5461
|
+
/**
|
|
5462
|
+
* Sets whether the window should show always on top of other windows. After
|
|
5463
|
+
* setting this, the window is still a normal window, not a toolbox window which
|
|
5464
|
+
* can not be focused on.
|
|
5465
|
+
*/
|
|
5466
|
+
setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver', relativeLevel?: number): void;
|
|
5467
|
+
/**
|
|
5468
|
+
* Sets the properties for the window's taskbar button.
|
|
5469
|
+
*
|
|
5470
|
+
* **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
|
|
5471
|
+
* together. If one of those properties is not set, then neither will be used.
|
|
5472
|
+
*
|
|
5473
|
+
* @platform win32
|
|
5474
|
+
*/
|
|
5475
|
+
setAppDetails(options: AppDetailsOptions): void;
|
|
5476
|
+
/**
|
|
5477
|
+
* This will make a window maintain an aspect ratio. The extra size allows a
|
|
5478
|
+
* developer to have space, specified in pixels, not included within the aspect
|
|
5479
|
+
* ratio calculations. This API already takes into account the difference between a
|
|
5480
|
+
* window's size and its content size.
|
|
5481
|
+
*
|
|
5482
|
+
* Consider a normal window with an HD video player and associated controls.
|
|
5483
|
+
* Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
|
|
5484
|
+
* on the right edge and 50 pixels of controls below the player. In order to
|
|
5485
|
+
* maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
|
|
5486
|
+
* the player itself we would call this function with arguments of 16/9 and {
|
|
5487
|
+
* width: 40, height: 50 }. The second argument doesn't care where the extra width
|
|
5488
|
+
* and height are within the content view--only that they exist. Sum any extra
|
|
5489
|
+
* width and height areas you have within the overall content view.
|
|
5490
|
+
*
|
|
5491
|
+
* The aspect ratio is not respected when window is resized programmatically with
|
|
5492
|
+
* APIs like `win.setSize`.
|
|
5493
|
+
*
|
|
5494
|
+
* To reset an aspect ratio, pass 0 as the `aspectRatio` value:
|
|
5495
|
+
* `win.setAspectRatio(0)`.
|
|
5496
|
+
*/
|
|
5497
|
+
setAspectRatio(aspectRatio: number, extraSize?: Size): void;
|
|
5498
|
+
/**
|
|
5499
|
+
* Controls whether to hide cursor when typing.
|
|
5500
|
+
*
|
|
5501
|
+
* @platform darwin
|
|
5502
|
+
*/
|
|
5503
|
+
setAutoHideCursor(autoHide: boolean): void;
|
|
5504
|
+
/**
|
|
5505
|
+
* Sets whether the window menu bar should hide itself automatically. Once set the
|
|
5506
|
+
* menu bar will only show when users press the single `Alt` key.
|
|
5507
|
+
*
|
|
5508
|
+
* If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
|
|
5509
|
+
* hide it immediately.
|
|
5510
|
+
*
|
|
5511
|
+
* @platform win32,linux
|
|
5512
|
+
*/
|
|
5513
|
+
setAutoHideMenuBar(hide: boolean): void;
|
|
5514
|
+
/**
|
|
5515
|
+
* Examples of valid `backgroundColor` values:
|
|
5516
|
+
*
|
|
5517
|
+
* * Hex
|
|
5518
|
+
* * #fff (shorthand RGB)
|
|
5519
|
+
* * #ffff (shorthand ARGB)
|
|
5520
|
+
* * #ffffff (RGB)
|
|
5521
|
+
* * #ffffffff (ARGB)
|
|
5522
|
+
* * RGB
|
|
5523
|
+
* * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
|
5524
|
+
* * e.g. rgb(255, 255, 255)
|
|
5525
|
+
* * RGBA
|
|
5526
|
+
* * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
|
5527
|
+
* * e.g. rgba(255, 255, 255, 1.0)
|
|
5528
|
+
* * HSL
|
|
5529
|
+
* * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
|
5530
|
+
* * e.g. hsl(200, 20%, 50%)
|
|
5531
|
+
* * HSLA
|
|
5532
|
+
* * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
|
5533
|
+
* * e.g. hsla(200, 20%, 50%, 0.5)
|
|
5534
|
+
* * Color name
|
|
5535
|
+
* * Options are listed in SkParseColor.cpp
|
|
5536
|
+
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
|
5537
|
+
* * e.g. `blueviolet` or `red`
|
|
5538
|
+
*
|
|
5539
|
+
* Sets the background color of the window. See Setting `backgroundColor`.
|
|
5540
|
+
*/
|
|
5541
|
+
setBackgroundColor(backgroundColor: string): void;
|
|
5542
|
+
/**
|
|
5543
|
+
* This method sets the browser window's system-drawn background material,
|
|
5544
|
+
* including behind the non-client area.
|
|
5545
|
+
*
|
|
5546
|
+
* See the Windows documentation for more details.
|
|
5547
|
+
*
|
|
5548
|
+
* **Note:** This method is only supported on Windows 11 22H2 and up.
|
|
5549
|
+
*
|
|
5550
|
+
* @platform win32
|
|
5551
|
+
*/
|
|
5552
|
+
setBackgroundMaterial(material: 'auto' | 'none' | 'mica' | 'acrylic' | 'tabbed'): void;
|
|
5553
|
+
/**
|
|
5554
|
+
* Resizes and moves the window to the supplied bounds. Any properties that are not
|
|
5555
|
+
* supplied will default to their current values.
|
|
5556
|
+
*
|
|
5557
|
+
* **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
|
|
5558
|
+
* height. The tray height has changed over time and depends on the operating
|
|
5559
|
+
* system, but is between 20-40px. Passing a value lower than the tray height will
|
|
5560
|
+
* result in a window that is flush to the tray.
|
|
5561
|
+
*/
|
|
5562
|
+
setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
|
|
5563
|
+
/**
|
|
5564
|
+
* > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
|
5565
|
+
* `WebContentsView` class.
|
|
5566
|
+
*
|
|
5567
|
+
* @experimental
|
|
5568
|
+
* @deprecated
|
|
5569
|
+
*/
|
|
5570
|
+
setBrowserView(browserView: (BrowserView) | (null)): void;
|
|
5571
|
+
/**
|
|
5572
|
+
* Sets whether the window can be manually closed by user. On Linux does nothing.
|
|
5573
|
+
*
|
|
5574
|
+
* @platform darwin,win32
|
|
5575
|
+
*/
|
|
5576
|
+
setClosable(closable: boolean): void;
|
|
5577
|
+
/**
|
|
5578
|
+
* Resizes and moves the window's client area (e.g. the web page) to the supplied
|
|
5579
|
+
* bounds.
|
|
5580
|
+
*/
|
|
5581
|
+
setContentBounds(bounds: Rectangle, animate?: boolean): void;
|
|
5582
|
+
/**
|
|
5583
|
+
* Prevents the window contents from being captured by other apps.
|
|
5584
|
+
*
|
|
5585
|
+
* On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
|
|
5586
|
+
* it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
|
|
5587
|
+
* version 2004 and up the window will be removed from capture entirely, older
|
|
5588
|
+
* Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
|
|
5589
|
+
*
|
|
5590
|
+
* @platform darwin,win32
|
|
5591
|
+
*/
|
|
5592
|
+
setContentProtection(enable: boolean): void;
|
|
5593
|
+
/**
|
|
5594
|
+
* Resizes the window's client area (e.g. the web page) to `width` and `height`.
|
|
5595
|
+
*/
|
|
5596
|
+
setContentSize(width: number, height: number, animate?: boolean): void;
|
|
5597
|
+
/**
|
|
5598
|
+
* Specifies whether the window’s document has been edited, and the icon in title
|
|
5599
|
+
* bar will become gray when set to `true`.
|
|
5600
|
+
*
|
|
5601
|
+
* @platform darwin
|
|
5602
|
+
*/
|
|
5603
|
+
setDocumentEdited(edited: boolean): void;
|
|
5604
|
+
/**
|
|
5605
|
+
* Disable or enable the window.
|
|
5606
|
+
*/
|
|
5607
|
+
setEnabled(enable: boolean): void;
|
|
5608
|
+
/**
|
|
5609
|
+
* Changes whether the window can be focused.
|
|
5610
|
+
*
|
|
5611
|
+
* On macOS it does not remove the focus from the window.
|
|
5612
|
+
*
|
|
5613
|
+
* @platform darwin,win32
|
|
5614
|
+
*/
|
|
5615
|
+
setFocusable(focusable: boolean): void;
|
|
5616
|
+
/**
|
|
5617
|
+
* Sets whether the window should be in fullscreen mode.
|
|
5618
|
+
*
|
|
5619
|
+
* **Note:** On macOS, fullscreen transitions take place asynchronously. If further
|
|
5620
|
+
* actions depend on the fullscreen state, use the 'enter-full-screen' or
|
|
5621
|
+
* 'leave-full-screen' events.
|
|
5622
|
+
*/
|
|
5623
|
+
setFullScreen(flag: boolean): void;
|
|
5624
|
+
/**
|
|
5625
|
+
* Sets whether the maximize/zoom window button toggles fullscreen mode or
|
|
5626
|
+
* maximizes the window.
|
|
5627
|
+
*/
|
|
5628
|
+
setFullScreenable(fullscreenable: boolean): void;
|
|
5629
|
+
/**
|
|
5630
|
+
* Sets whether the window should have a shadow.
|
|
5631
|
+
*/
|
|
5632
|
+
setHasShadow(hasShadow: boolean): void;
|
|
5633
|
+
/**
|
|
5634
|
+
* Sets whether the window will be hidden when the user toggles into mission
|
|
5635
|
+
* control.
|
|
5636
|
+
*
|
|
5637
|
+
* @platform darwin
|
|
5638
|
+
*/
|
|
5639
|
+
setHiddenInMissionControl(hidden: boolean): void;
|
|
5640
|
+
/**
|
|
5641
|
+
* Changes window icon.
|
|
5642
|
+
*
|
|
5643
|
+
* @platform win32,linux
|
|
5644
|
+
*/
|
|
5645
|
+
setIcon(icon: (NativeImage) | (string)): void;
|
|
5646
|
+
/**
|
|
5647
|
+
* Makes the window ignore all mouse events.
|
|
5648
|
+
*
|
|
5649
|
+
* All mouse events happened in this window will be passed to the window below this
|
|
5650
|
+
* window, but if this window has focus, it will still receive keyboard events.
|
|
5651
|
+
*/
|
|
5652
|
+
setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
|
|
5653
|
+
/**
|
|
5654
|
+
* Enters or leaves kiosk mode.
|
|
5655
|
+
*/
|
|
5656
|
+
setKiosk(flag: boolean): void;
|
|
5657
|
+
/**
|
|
5658
|
+
* Sets whether the window can be manually maximized by user. On Linux does
|
|
5659
|
+
* nothing.
|
|
5660
|
+
*
|
|
5661
|
+
* @platform darwin,win32
|
|
5662
|
+
*/
|
|
5663
|
+
setMaximizable(maximizable: boolean): void;
|
|
5664
|
+
/**
|
|
5665
|
+
* Sets the maximum size of window to `width` and `height`.
|
|
5666
|
+
*/
|
|
5667
|
+
setMaximumSize(width: number, height: number): void;
|
|
5668
|
+
/**
|
|
5669
|
+
* Sets the `menu` as the window's menu bar.
|
|
5670
|
+
*
|
|
5671
|
+
* @platform linux,win32
|
|
5672
|
+
*/
|
|
5673
|
+
setMenu(menu: (Menu) | (null)): void;
|
|
5674
|
+
/**
|
|
5675
|
+
* Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
|
5676
|
+
* can still bring up the menu bar by pressing the single `Alt` key.
|
|
5677
|
+
*
|
|
5678
|
+
* @platform win32,linux
|
|
5679
|
+
*/
|
|
5680
|
+
setMenuBarVisibility(visible: boolean): void;
|
|
5681
|
+
/**
|
|
5682
|
+
* Sets whether the window can be manually minimized by user. On Linux does
|
|
5683
|
+
* nothing.
|
|
5684
|
+
*
|
|
5685
|
+
* @platform darwin,win32
|
|
5686
|
+
*/
|
|
5687
|
+
setMinimizable(minimizable: boolean): void;
|
|
5688
|
+
/**
|
|
5689
|
+
* Sets the minimum size of window to `width` and `height`.
|
|
5690
|
+
*/
|
|
5691
|
+
setMinimumSize(width: number, height: number): void;
|
|
5692
|
+
/**
|
|
5693
|
+
* Sets whether the window can be moved by user. On Linux does nothing.
|
|
5694
|
+
*
|
|
5695
|
+
* @platform darwin,win32
|
|
5696
|
+
*/
|
|
5697
|
+
setMovable(movable: boolean): void;
|
|
5698
|
+
/**
|
|
5699
|
+
* Sets the opacity of the window. On Linux, does nothing. Out of bound number
|
|
5700
|
+
* values are clamped to the [0, 1] range.
|
|
5701
|
+
*
|
|
5702
|
+
* @platform win32,darwin
|
|
5703
|
+
*/
|
|
5704
|
+
setOpacity(opacity: number): void;
|
|
5705
|
+
/**
|
|
5706
|
+
* Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
|
|
5707
|
+
* convey some sort of application status or to passively notify the user.
|
|
5708
|
+
*
|
|
5709
|
+
* @platform win32
|
|
5710
|
+
*/
|
|
5711
|
+
setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
|
|
5712
|
+
/**
|
|
5713
|
+
* Sets `parent` as current window's parent window, passing `null` will turn
|
|
5714
|
+
* current window into a top-level window.
|
|
5715
|
+
*/
|
|
5716
|
+
setParentWindow(parent: (BrowserWindow) | (null)): void;
|
|
5717
|
+
/**
|
|
5718
|
+
* Moves window to `x` and `y`.
|
|
5719
|
+
*/
|
|
5720
|
+
setPosition(x: number, y: number, animate?: boolean): void;
|
|
5721
|
+
/**
|
|
5722
|
+
* Sets progress value in progress bar. Valid range is [0, 1.0].
|
|
5723
|
+
*
|
|
5724
|
+
* Remove progress bar when progress < 0; Change to indeterminate mode when
|
|
5725
|
+
* progress > 1.
|
|
5726
|
+
*
|
|
5727
|
+
* On Linux platform, only supports Unity desktop environment, you need to specify
|
|
5728
|
+
* the `*.desktop` file name to `desktopName` field in `package.json`. By default,
|
|
5729
|
+
* it will assume `{app.name}.desktop`.
|
|
5730
|
+
*
|
|
5731
|
+
* On Windows, a mode can be passed. Accepted values are `none`, `normal`,
|
|
5732
|
+
* `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
|
|
5733
|
+
* mode set (but with a value within the valid range), `normal` will be assumed.
|
|
5734
|
+
*/
|
|
5735
|
+
setProgressBar(progress: number, options?: ProgressBarOptions): void;
|
|
5736
|
+
/**
|
|
5737
|
+
* Sets the pathname of the file the window represents, and the icon of the file
|
|
5738
|
+
* will show in window's title bar.
|
|
5739
|
+
*
|
|
5740
|
+
* @platform darwin
|
|
5741
|
+
*/
|
|
5742
|
+
setRepresentedFilename(filename: string): void;
|
|
5743
|
+
/**
|
|
5744
|
+
* Sets whether the window can be manually resized by the user.
|
|
5745
|
+
*/
|
|
5746
|
+
setResizable(resizable: boolean): void;
|
|
5747
|
+
/**
|
|
5748
|
+
* Setting a window shape determines the area within the window where the system
|
|
5749
|
+
* permits drawing and user interaction. Outside of the given region, no pixels
|
|
5750
|
+
* will be drawn and no mouse events will be registered. Mouse events outside of
|
|
5751
|
+
* the region will not be received by that window, but will fall through to
|
|
5752
|
+
* whatever is behind the window.
|
|
5753
|
+
*
|
|
5754
|
+
* @experimental
|
|
5755
|
+
* @platform win32,linux
|
|
5756
|
+
*/
|
|
5757
|
+
setShape(rects: Rectangle[]): void;
|
|
5758
|
+
/**
|
|
5759
|
+
* Changes the attachment point for sheets on macOS. By default, sheets are
|
|
5760
|
+
* attached just below the window frame, but you may want to display them beneath a
|
|
5761
|
+
* HTML-rendered toolbar. For example:
|
|
5762
|
+
*
|
|
5763
|
+
* @platform darwin
|
|
5764
|
+
*/
|
|
5765
|
+
setSheetOffset(offsetY: number, offsetX?: number): void;
|
|
5766
|
+
/**
|
|
5767
|
+
* Enters or leaves simple fullscreen mode.
|
|
5768
|
+
*
|
|
5769
|
+
* Simple fullscreen mode emulates the native fullscreen behavior found in versions
|
|
5770
|
+
* of macOS prior to Lion (10.7).
|
|
5771
|
+
*
|
|
5772
|
+
* @platform darwin
|
|
5773
|
+
*/
|
|
5774
|
+
setSimpleFullScreen(flag: boolean): void;
|
|
5775
|
+
/**
|
|
5776
|
+
* Resizes the window to `width` and `height`. If `width` or `height` are below any
|
|
5777
|
+
* set minimum size constraints the window will snap to its minimum size.
|
|
5778
|
+
*/
|
|
5779
|
+
setSize(width: number, height: number, animate?: boolean): void;
|
|
5780
|
+
/**
|
|
5781
|
+
* Makes the window not show in the taskbar.
|
|
5782
|
+
*
|
|
5783
|
+
* @platform darwin,win32
|
|
5784
|
+
*/
|
|
5785
|
+
setSkipTaskbar(skip: boolean): void;
|
|
5786
|
+
/**
|
|
5787
|
+
* Whether the buttons were added successfully
|
|
5788
|
+
*
|
|
5789
|
+
* Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
|
|
5790
|
+
* of a window in a taskbar button layout. Returns a `boolean` object indicates
|
|
5791
|
+
* whether the thumbnail has been added successfully.
|
|
5792
|
+
*
|
|
5793
|
+
* The number of buttons in thumbnail toolbar should be no greater than 7 due to
|
|
5794
|
+
* the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
|
|
5795
|
+
* removed due to the platform's limitation. But you can call the API with an empty
|
|
5796
|
+
* array to clean the buttons.
|
|
5797
|
+
*
|
|
5798
|
+
* The `buttons` is an array of `Button` objects:
|
|
5799
|
+
*
|
|
5800
|
+
* * `Button` Object
|
|
5801
|
+
* * `icon` NativeImage - The icon showing in thumbnail toolbar.
|
|
5802
|
+
* * `click` Function
|
|
5803
|
+
* * `tooltip` string (optional) - The text of the button's tooltip.
|
|
5804
|
+
* * `flags` string[] (optional) - Control specific states and behaviors of the
|
|
5805
|
+
* button. By default, it is `['enabled']`.
|
|
5806
|
+
*
|
|
5807
|
+
* The `flags` is an array that can include following `string`s:
|
|
5808
|
+
*
|
|
5809
|
+
* * `enabled` - The button is active and available to the user.
|
|
5810
|
+
* * `disabled` - The button is disabled. It is present, but has a visual state
|
|
5811
|
+
* indicating it will not respond to user action.
|
|
5812
|
+
* * `dismissonclick` - When the button is clicked, the thumbnail window closes
|
|
5813
|
+
* immediately.
|
|
5814
|
+
* * `nobackground` - Do not draw a button border, use only the image.
|
|
5815
|
+
* * `hidden` - The button is not shown to the user.
|
|
5816
|
+
* * `noninteractive` - The button is enabled but not interactive; no pressed
|
|
5817
|
+
* button state is drawn. This value is intended for instances where the button is
|
|
5818
|
+
* used in a notification.
|
|
5819
|
+
*
|
|
5820
|
+
* @platform win32
|
|
5821
|
+
*/
|
|
5822
|
+
setThumbarButtons(buttons: ThumbarButton[]): boolean;
|
|
5823
|
+
/**
|
|
5824
|
+
* Sets the region of the window to show as the thumbnail image displayed when
|
|
5825
|
+
* hovering over the window in the taskbar. You can reset the thumbnail to be the
|
|
5826
|
+
* entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
|
|
5827
|
+
* }`.
|
|
5828
|
+
*
|
|
5829
|
+
* @platform win32
|
|
5830
|
+
*/
|
|
5831
|
+
setThumbnailClip(region: Rectangle): void;
|
|
5832
|
+
/**
|
|
5833
|
+
* Sets the toolTip that is displayed when hovering over the window thumbnail in
|
|
5834
|
+
* the taskbar.
|
|
5835
|
+
*
|
|
5836
|
+
* @platform win32
|
|
5837
|
+
*/
|
|
5838
|
+
setThumbnailToolTip(toolTip: string): void;
|
|
5839
|
+
/**
|
|
5840
|
+
* Changes the title of native window to `title`.
|
|
5841
|
+
*/
|
|
5842
|
+
setTitle(title: string): void;
|
|
5843
|
+
/**
|
|
5844
|
+
* On a Window with Window Controls Overlay already enabled, this method updates
|
|
5845
|
+
* the style of the title bar overlay.
|
|
5846
|
+
*
|
|
5847
|
+
* @platform win32
|
|
5848
|
+
*/
|
|
5849
|
+
setTitleBarOverlay(options: TitleBarOverlay): void;
|
|
5850
|
+
/**
|
|
5851
|
+
* Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
|
|
5852
|
+
* error if `browserView` is not attached to `win`.
|
|
5853
|
+
*
|
|
5854
|
+
* > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
|
5855
|
+
* `WebContentsView` class.
|
|
5856
|
+
*
|
|
5857
|
+
* @experimental
|
|
5858
|
+
* @deprecated
|
|
5859
|
+
*/
|
|
5860
|
+
setTopBrowserView(browserView: BrowserView): void;
|
|
5861
|
+
/**
|
|
5862
|
+
* Sets the touchBar layout for the current window. Specifying `null` or
|
|
5863
|
+
* `undefined` clears the touch bar. This method only has an effect if the machine
|
|
5864
|
+
* has a touch bar.
|
|
5865
|
+
*
|
|
5866
|
+
* **Note:** The TouchBar API is currently experimental and may change or be
|
|
5867
|
+
* removed in future Electron releases.
|
|
5868
|
+
*
|
|
5869
|
+
* @platform darwin
|
|
5870
|
+
*/
|
|
5871
|
+
setTouchBar(touchBar: (TouchBar) | (null)): void;
|
|
5872
|
+
/**
|
|
5873
|
+
* Adds a vibrancy effect to the browser window. Passing `null` or an empty string
|
|
5874
|
+
* will remove the vibrancy effect on the window.
|
|
5875
|
+
*
|
|
5876
|
+
* @platform darwin
|
|
5877
|
+
*/
|
|
5878
|
+
setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
|
|
5879
|
+
/**
|
|
5880
|
+
* Sets whether the window should be visible on all workspaces.
|
|
5881
|
+
*
|
|
5882
|
+
* **Note:** This API does nothing on Windows.
|
|
5883
|
+
*
|
|
5884
|
+
* @platform darwin,linux
|
|
5885
|
+
*/
|
|
5886
|
+
setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
|
|
5887
|
+
/**
|
|
5888
|
+
* Set a custom position for the traffic light buttons in frameless window. Passing
|
|
5889
|
+
* `null` will reset the position to default.
|
|
5890
|
+
*
|
|
5891
|
+
* @platform darwin
|
|
5892
|
+
*/
|
|
5893
|
+
setWindowButtonPosition(position: (Point) | (null)): void;
|
|
5894
|
+
/**
|
|
5895
|
+
* Sets whether the window traffic light buttons should be visible.
|
|
5896
|
+
*
|
|
5897
|
+
* @platform darwin
|
|
5898
|
+
*/
|
|
5899
|
+
setWindowButtonVisibility(visible: boolean): void;
|
|
5900
|
+
/**
|
|
5901
|
+
* Shows and gives focus to the window.
|
|
5902
|
+
*/
|
|
5903
|
+
show(): void;
|
|
5904
|
+
/**
|
|
5905
|
+
* Shows or hides the tab overview when native tabs are enabled.
|
|
5906
|
+
*
|
|
5907
|
+
* @platform darwin
|
|
5908
|
+
*/
|
|
5909
|
+
showAllTabs(): void;
|
|
5910
|
+
/**
|
|
5911
|
+
* Same as `webContents.showDefinitionForSelection()`.
|
|
5912
|
+
*
|
|
5913
|
+
* @platform darwin
|
|
5914
|
+
*/
|
|
5915
|
+
showDefinitionForSelection(): void;
|
|
5916
|
+
/**
|
|
5917
|
+
* Shows the window but doesn't focus on it.
|
|
5918
|
+
*/
|
|
5919
|
+
showInactive(): void;
|
|
5920
|
+
/**
|
|
5921
|
+
* Toggles the visibility of the tab bar if native tabs are enabled and there is
|
|
5922
|
+
* only one tab in the current window.
|
|
5923
|
+
*
|
|
5924
|
+
* @platform darwin
|
|
5925
|
+
*/
|
|
5926
|
+
toggleTabBar(): void;
|
|
5927
|
+
/**
|
|
5928
|
+
* Unhooks all of the window messages.
|
|
5929
|
+
*
|
|
5930
|
+
* @platform win32
|
|
5931
|
+
*/
|
|
5932
|
+
unhookAllWindowMessages(): void;
|
|
5933
|
+
/**
|
|
5934
|
+
* Unhook the window message.
|
|
5935
|
+
*
|
|
5936
|
+
* @platform win32
|
|
5937
|
+
*/
|
|
5938
|
+
unhookWindowMessage(message: number): void;
|
|
5939
|
+
/**
|
|
5940
|
+
* Unmaximizes the window.
|
|
5941
|
+
*/
|
|
5942
|
+
unmaximize(): void;
|
|
5943
|
+
/**
|
|
5944
|
+
* A `string` property that defines an alternative title provided only to
|
|
5945
|
+
* accessibility tools such as screen readers. This string is not directly visible
|
|
5946
|
+
* to users.
|
|
5947
|
+
*/
|
|
5948
|
+
accessibleTitle: string;
|
|
5949
|
+
/**
|
|
5950
|
+
* A `boolean` property that determines whether the window menu bar should hide
|
|
5951
|
+
* itself automatically. Once set, the menu bar will only show when users press the
|
|
5952
|
+
* single `Alt` key.
|
|
5953
|
+
*
|
|
5954
|
+
* If the menu bar is already visible, setting this property to `true` won't hide
|
|
5955
|
+
* it immediately.
|
|
5956
|
+
*/
|
|
5957
|
+
autoHideMenuBar: boolean;
|
|
5958
|
+
/**
|
|
5959
|
+
* A `boolean` property that determines whether the window can be manually closed
|
|
5960
|
+
* by user.
|
|
5961
|
+
*
|
|
5962
|
+
* On Linux the setter is a no-op, although the getter returns `true`.
|
|
5963
|
+
*
|
|
5964
|
+
* @platform darwin,win32
|
|
5965
|
+
*/
|
|
5966
|
+
closable: boolean;
|
|
5967
|
+
/**
|
|
5968
|
+
* A `boolean` property that specifies whether the window’s document has been
|
|
5969
|
+
* edited.
|
|
3849
5970
|
*
|
|
3850
|
-
*
|
|
5971
|
+
* The icon in title bar will become gray when set to `true`.
|
|
5972
|
+
*
|
|
5973
|
+
* @platform darwin
|
|
3851
5974
|
*/
|
|
3852
|
-
|
|
5975
|
+
documentEdited: boolean;
|
|
3853
5976
|
/**
|
|
3854
|
-
*
|
|
3855
|
-
*
|
|
5977
|
+
* A `boolean` property that determines whether the window is excluded from the
|
|
5978
|
+
* application’s Windows menu. `false` by default.
|
|
3856
5979
|
*
|
|
3857
|
-
* @platform darwin
|
|
5980
|
+
* @platform darwin
|
|
3858
5981
|
*/
|
|
3859
|
-
|
|
5982
|
+
excludedFromShownWindowsMenu: boolean;
|
|
3860
5983
|
/**
|
|
3861
|
-
*
|
|
3862
|
-
*
|
|
3863
|
-
*
|
|
3864
|
-
* `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
|
5984
|
+
* A `boolean` property that determines whether the window is focusable.
|
|
5985
|
+
*
|
|
5986
|
+
* @platform win32,darwin
|
|
3865
5987
|
*/
|
|
3866
|
-
|
|
5988
|
+
focusable: boolean;
|
|
3867
5989
|
/**
|
|
3868
|
-
*
|
|
5990
|
+
* A `boolean` property that determines whether the window is in fullscreen mode.
|
|
3869
5991
|
*/
|
|
3870
|
-
|
|
5992
|
+
fullScreen: boolean;
|
|
3871
5993
|
/**
|
|
3872
|
-
*
|
|
5994
|
+
* A `boolean` property that determines whether the maximize/zoom window button
|
|
5995
|
+
* toggles fullscreen mode or maximizes the window.
|
|
3873
5996
|
*/
|
|
3874
|
-
|
|
5997
|
+
fullScreenable: boolean;
|
|
3875
5998
|
/**
|
|
3876
|
-
*
|
|
3877
|
-
*
|
|
3878
|
-
* fullscreenable.
|
|
5999
|
+
* A `Integer` property representing the unique ID of the window. Each ID is unique
|
|
6000
|
+
* among all `BrowserWindow` instances of the entire Electron application.
|
|
3879
6001
|
*
|
|
3880
|
-
* @platform darwin
|
|
3881
6002
|
*/
|
|
3882
|
-
|
|
6003
|
+
readonly id: number;
|
|
3883
6004
|
/**
|
|
3884
|
-
*
|
|
6005
|
+
* A `boolean` property that determines whether the window is in kiosk mode.
|
|
3885
6006
|
*/
|
|
3886
|
-
|
|
6007
|
+
kiosk: boolean;
|
|
3887
6008
|
/**
|
|
3888
|
-
*
|
|
6009
|
+
* A `boolean` property that determines whether the window can be manually
|
|
6010
|
+
* maximized by user.
|
|
3889
6011
|
*
|
|
3890
|
-
*
|
|
3891
|
-
*/
|
|
3892
|
-
simpleFullscreen?: boolean;
|
|
3893
|
-
/**
|
|
3894
|
-
* Whether to show the window in taskbar. Default is `false`.
|
|
6012
|
+
* On Linux the setter is a no-op, although the getter returns `true`.
|
|
3895
6013
|
*
|
|
3896
6014
|
* @platform darwin,win32
|
|
3897
6015
|
*/
|
|
3898
|
-
|
|
6016
|
+
maximizable: boolean;
|
|
3899
6017
|
/**
|
|
3900
|
-
*
|
|
3901
|
-
* tabbing identifier will be grouped together. This also adds a native new tab
|
|
3902
|
-
* button to your window's tab bar and allows your `app` and window to receive the
|
|
3903
|
-
* `new-window-for-tab` event.
|
|
6018
|
+
* A `boolean` property that determines whether the menu bar should be visible.
|
|
3904
6019
|
*
|
|
3905
|
-
*
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
* Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
|
|
3910
|
-
* window frame. Setting it to `false` will remove window shadow and window
|
|
3911
|
-
* animations. Default is `true`.
|
|
3912
|
-
*/
|
|
3913
|
-
thickFrame?: boolean;
|
|
3914
|
-
/**
|
|
3915
|
-
* Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
|
|
3916
|
-
* defined in the HTML file loaded by `loadURL()`, this property will be ignored.
|
|
6020
|
+
* **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
|
|
6021
|
+
* pressing the single `Alt` key.
|
|
6022
|
+
*
|
|
6023
|
+
* @platform win32,linux
|
|
3917
6024
|
*/
|
|
3918
|
-
|
|
6025
|
+
menuBarVisible: boolean;
|
|
3919
6026
|
/**
|
|
3920
|
-
*
|
|
3921
|
-
*
|
|
3922
|
-
*
|
|
3923
|
-
*
|
|
3924
|
-
*
|
|
3925
|
-
*
|
|
6027
|
+
* A `boolean` property that determines whether the window can be manually
|
|
6028
|
+
* minimized by user.
|
|
6029
|
+
*
|
|
6030
|
+
* On Linux the setter is a no-op, although the getter returns `true`.
|
|
6031
|
+
*
|
|
6032
|
+
* @platform darwin,win32
|
|
3926
6033
|
*/
|
|
3927
|
-
|
|
6034
|
+
minimizable: boolean;
|
|
3928
6035
|
/**
|
|
3929
|
-
*
|
|
6036
|
+
* A `boolean` property that determines Whether the window can be moved by user.
|
|
6037
|
+
*
|
|
6038
|
+
* On Linux the setter is a no-op, although the getter returns `true`.
|
|
3930
6039
|
*
|
|
3931
6040
|
* @platform darwin,win32
|
|
3932
6041
|
*/
|
|
3933
|
-
|
|
6042
|
+
movable: boolean;
|
|
3934
6043
|
/**
|
|
3935
|
-
*
|
|
6044
|
+
* A `string` property that determines the pathname of the file the window
|
|
6045
|
+
* represents, and the icon of the file will show in window's title bar.
|
|
3936
6046
|
*
|
|
3937
6047
|
* @platform darwin
|
|
3938
6048
|
*/
|
|
3939
|
-
|
|
6049
|
+
representedFilename: string;
|
|
3940
6050
|
/**
|
|
3941
|
-
*
|
|
3942
|
-
*
|
|
6051
|
+
* A `boolean` property that determines whether the window can be manually resized
|
|
6052
|
+
* by user.
|
|
3943
6053
|
*/
|
|
3944
|
-
|
|
6054
|
+
resizable: boolean;
|
|
3945
6055
|
/**
|
|
3946
|
-
*
|
|
6056
|
+
* A `boolean` property that determines whether the window has a shadow.
|
|
3947
6057
|
*/
|
|
3948
|
-
|
|
6058
|
+
shadow: boolean;
|
|
3949
6059
|
/**
|
|
3950
|
-
*
|
|
3951
|
-
*
|
|
3952
|
-
* Default is `false`.
|
|
6060
|
+
* A `boolean` property that determines whether the window is in simple (pre-Lion)
|
|
6061
|
+
* fullscreen mode.
|
|
3953
6062
|
*/
|
|
3954
|
-
|
|
6063
|
+
simpleFullScreen: boolean;
|
|
3955
6064
|
/**
|
|
3956
|
-
*
|
|
3957
|
-
*
|
|
3958
|
-
* `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`,
|
|
3959
|
-
* `under-window`, or `under-page`.
|
|
6065
|
+
* A `string` (optional) property that is equal to the `tabbingIdentifier` passed
|
|
6066
|
+
* to the `BrowserWindow` constructor or `undefined` if none was set.
|
|
3960
6067
|
*
|
|
3961
6068
|
* @platform darwin
|
|
3962
6069
|
*/
|
|
3963
|
-
|
|
6070
|
+
readonly tabbingIdentifier?: string;
|
|
3964
6071
|
/**
|
|
3965
|
-
*
|
|
3966
|
-
* macOS. Must be used with the `vibrancy` property. Possible values are:
|
|
6072
|
+
* A `string` property that determines the title of the native window.
|
|
3967
6073
|
*
|
|
3968
|
-
*
|
|
6074
|
+
* **Note:** The title of the web page can be different from the title of the
|
|
6075
|
+
* native window.
|
|
3969
6076
|
*/
|
|
3970
|
-
|
|
6077
|
+
title: string;
|
|
3971
6078
|
/**
|
|
3972
|
-
*
|
|
6079
|
+
* A `boolean` property that determines whether the window is visible on all
|
|
6080
|
+
* workspaces.
|
|
6081
|
+
*
|
|
6082
|
+
* **Note:** Always returns false on Windows.
|
|
6083
|
+
*
|
|
6084
|
+
* @platform darwin,linux
|
|
3973
6085
|
*/
|
|
3974
|
-
|
|
6086
|
+
visibleOnAllWorkspaces: boolean;
|
|
3975
6087
|
/**
|
|
3976
|
-
*
|
|
6088
|
+
* A `WebContents` object this window owns. All web page related events and
|
|
6089
|
+
* operations will be done via it.
|
|
6090
|
+
*
|
|
6091
|
+
* See the `webContents` documentation for its methods and events.
|
|
6092
|
+
*
|
|
3977
6093
|
*/
|
|
3978
|
-
|
|
6094
|
+
readonly webContents: WebContents;
|
|
6095
|
+
}
|
|
6096
|
+
|
|
6097
|
+
interface BrowserWindowConstructorOptions extends BaseWindowConstructorOptions {
|
|
6098
|
+
|
|
6099
|
+
// Docs: https://electronjs.org/docs/api/structures/browser-window-options
|
|
6100
|
+
|
|
3979
6101
|
/**
|
|
3980
|
-
*
|
|
3981
|
-
*
|
|
6102
|
+
* Whether the renderer should be active when `show` is `false` and it has just
|
|
6103
|
+
* been created. In order for `document.visibilityState` to work correctly on
|
|
6104
|
+
* first load with `show: false` you should set this to `false`. Setting this to
|
|
6105
|
+
* `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
|
3982
6106
|
*/
|
|
3983
|
-
|
|
6107
|
+
paintWhenInitiallyHidden?: boolean;
|
|
3984
6108
|
/**
|
|
3985
|
-
*
|
|
3986
|
-
*
|
|
6109
|
+
* When using a frameless window in conjunction with
|
|
6110
|
+
* `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so
|
|
6111
|
+
* that the standard window controls ("traffic lights" on macOS) are visible, this
|
|
6112
|
+
* property enables the Window Controls Overlay JavaScript APIs and CSS Environment
|
|
6113
|
+
* Variables. Specifying `true` will result in an overlay with default system
|
|
6114
|
+
* colors. Default is `false`.
|
|
3987
6115
|
*/
|
|
3988
|
-
|
|
6116
|
+
titleBarOverlay?: (TitleBarOverlay) | (boolean);
|
|
3989
6117
|
/**
|
|
3990
|
-
*
|
|
3991
|
-
* on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
|
|
3992
|
-
* will grow to the preferred width of the web page when zoomed, `false` will cause
|
|
3993
|
-
* it to zoom to the width of the screen. This will also affect the behavior when
|
|
3994
|
-
* calling `maximize()` directly. Default is `false`.
|
|
3995
|
-
*
|
|
3996
|
-
* @platform darwin
|
|
6118
|
+
* Settings of web page's features.
|
|
3997
6119
|
*/
|
|
3998
|
-
|
|
6120
|
+
webPreferences?: WebPreferences;
|
|
3999
6121
|
}
|
|
4000
6122
|
|
|
4001
6123
|
interface Certificate {
|
|
@@ -11679,6 +13801,67 @@ declare namespace Electron {
|
|
|
11679
13801
|
stdout: (NodeJS.ReadableStream) | (null);
|
|
11680
13802
|
}
|
|
11681
13803
|
|
|
13804
|
+
class View extends NodeEventEmitter {
|
|
13805
|
+
|
|
13806
|
+
// Docs: https://electronjs.org/docs/api/view
|
|
13807
|
+
|
|
13808
|
+
/**
|
|
13809
|
+
* Emitted when the view's bounds have changed in response to being laid out. The
|
|
13810
|
+
* new bounds can be retrieved with `view.getBounds()`.
|
|
13811
|
+
*/
|
|
13812
|
+
on(event: 'bounds-changed', listener: Function): this;
|
|
13813
|
+
off(event: 'bounds-changed', listener: Function): this;
|
|
13814
|
+
once(event: 'bounds-changed', listener: Function): this;
|
|
13815
|
+
addListener(event: 'bounds-changed', listener: Function): this;
|
|
13816
|
+
removeListener(event: 'bounds-changed', listener: Function): this;
|
|
13817
|
+
/**
|
|
13818
|
+
* View
|
|
13819
|
+
*/
|
|
13820
|
+
constructor();
|
|
13821
|
+
addChildView(view: View, index?: number): void;
|
|
13822
|
+
/**
|
|
13823
|
+
* The bounds of this View, relative to its parent.
|
|
13824
|
+
*/
|
|
13825
|
+
getBounds(): Rectangle;
|
|
13826
|
+
removeChildView(view: View): void;
|
|
13827
|
+
/**
|
|
13828
|
+
* Examples of valid `color` values:
|
|
13829
|
+
*
|
|
13830
|
+
* * Hex
|
|
13831
|
+
* * `#fff` (RGB)
|
|
13832
|
+
* * `#ffff` (ARGB)
|
|
13833
|
+
* * `#ffffff` (RRGGBB)
|
|
13834
|
+
* * `#ffffffff` (AARRGGBB)
|
|
13835
|
+
* * RGB
|
|
13836
|
+
* * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
|
13837
|
+
* * e.g. `rgb(255, 255, 255)`
|
|
13838
|
+
* * RGBA
|
|
13839
|
+
* * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
|
13840
|
+
* * e.g. `rgba(255, 255, 255, 1.0)`
|
|
13841
|
+
* * HSL
|
|
13842
|
+
* * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
|
13843
|
+
* * e.g. `hsl(200, 20%, 50%)`
|
|
13844
|
+
* * HSLA
|
|
13845
|
+
* * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
|
13846
|
+
* * e.g. `hsla(200, 20%, 50%, 0.5)`
|
|
13847
|
+
* * Color name
|
|
13848
|
+
* * Options are listed in SkParseColor.cpp
|
|
13849
|
+
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
|
13850
|
+
* * e.g. `blueviolet` or `red`
|
|
13851
|
+
*
|
|
13852
|
+
* **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
|
|
13853
|
+
* `RGB`.
|
|
13854
|
+
*/
|
|
13855
|
+
setBackgroundColor(color: string): void;
|
|
13856
|
+
setBounds(bounds: Rectangle): void;
|
|
13857
|
+
setVisible(visible: boolean): void;
|
|
13858
|
+
/**
|
|
13859
|
+
* A `View[]` property representing the child views of this view.
|
|
13860
|
+
*
|
|
13861
|
+
*/
|
|
13862
|
+
readonly children: View[];
|
|
13863
|
+
}
|
|
13864
|
+
|
|
11682
13865
|
class WebContents extends NodeEventEmitter {
|
|
11683
13866
|
|
|
11684
13867
|
// Docs: https://electronjs.org/docs/api/web-contents
|
|
@@ -14229,6 +16412,31 @@ declare namespace Electron {
|
|
|
14229
16412
|
zoomLevel: number;
|
|
14230
16413
|
}
|
|
14231
16414
|
|
|
16415
|
+
class WebContentsView extends View {
|
|
16416
|
+
|
|
16417
|
+
// Docs: https://electronjs.org/docs/api/web-contents-view
|
|
16418
|
+
|
|
16419
|
+
/**
|
|
16420
|
+
* Emitted when the view's bounds have changed in response to being laid out. The
|
|
16421
|
+
* new bounds can be retrieved with `view.getBounds()`.
|
|
16422
|
+
*/
|
|
16423
|
+
on(event: 'bounds-changed', listener: Function): this;
|
|
16424
|
+
off(event: 'bounds-changed', listener: Function): this;
|
|
16425
|
+
once(event: 'bounds-changed', listener: Function): this;
|
|
16426
|
+
addListener(event: 'bounds-changed', listener: Function): this;
|
|
16427
|
+
removeListener(event: 'bounds-changed', listener: Function): this;
|
|
16428
|
+
/**
|
|
16429
|
+
* WebContentsView
|
|
16430
|
+
*/
|
|
16431
|
+
constructor(options?: WebContentsViewConstructorOptions);
|
|
16432
|
+
/**
|
|
16433
|
+
* A `WebContents` property containing a reference to the displayed `WebContents`.
|
|
16434
|
+
* Use this to interact with the `WebContents`, for instance to load a URL.
|
|
16435
|
+
*
|
|
16436
|
+
*/
|
|
16437
|
+
readonly webContents: WebContents;
|
|
16438
|
+
}
|
|
16439
|
+
|
|
14232
16440
|
interface WebFrame {
|
|
14233
16441
|
|
|
14234
16442
|
// Docs: https://electronjs.org/docs/api/web-frame
|
|
@@ -15610,7 +17818,14 @@ declare namespace Electron {
|
|
|
15610
17818
|
/**
|
|
15611
17819
|
* A `string` which is a comma separated list of strings which specifies the web
|
|
15612
17820
|
* preferences to be set on the webview. The full list of supported preference
|
|
15613
|
-
* strings can be found in BrowserWindow.
|
|
17821
|
+
* strings can be found in BrowserWindow. In addition, webview supports the
|
|
17822
|
+
* following preferences:
|
|
17823
|
+
*
|
|
17824
|
+
* * `transparent` boolean (optional) - Whether to enable background transparency
|
|
17825
|
+
* for the guest page. Default is `true`. **Note:** The guest page's text and
|
|
17826
|
+
* background colors are derived from the color scheme of its root element. When
|
|
17827
|
+
* transparency is enabled, the text color will still change accordingly but the
|
|
17828
|
+
* background will remain transparent.
|
|
15614
17829
|
*
|
|
15615
17830
|
* The string follows the same format as the features string in `window.open`. A
|
|
15616
17831
|
* name by itself is given a `true` boolean value. A preference can be set to
|
|
@@ -15618,7 +17833,7 @@ declare namespace Electron {
|
|
|
15618
17833
|
* and `1` are interpreted as `true`, while `no` and `0` are interpreted as
|
|
15619
17834
|
* `false`.
|
|
15620
17835
|
*/
|
|
15621
|
-
webpreferences
|
|
17836
|
+
webpreferences?: ('transparent');
|
|
15622
17837
|
}
|
|
15623
17838
|
|
|
15624
17839
|
interface AboutPanelOptionsOptions {
|
|
@@ -18483,6 +20698,27 @@ declare namespace Electron {
|
|
|
18483
20698
|
height?: number;
|
|
18484
20699
|
}
|
|
18485
20700
|
|
|
20701
|
+
interface TitleBarOverlayOptions {
|
|
20702
|
+
/**
|
|
20703
|
+
* The CSS color of the Window Controls Overlay when enabled.
|
|
20704
|
+
*
|
|
20705
|
+
* @platform win32
|
|
20706
|
+
*/
|
|
20707
|
+
color?: string;
|
|
20708
|
+
/**
|
|
20709
|
+
* The CSS color of the symbols on the Window Controls Overlay when enabled.
|
|
20710
|
+
*
|
|
20711
|
+
* @platform win32
|
|
20712
|
+
*/
|
|
20713
|
+
symbolColor?: string;
|
|
20714
|
+
/**
|
|
20715
|
+
* The height of the title bar and Window Controls Overlay in pixels.
|
|
20716
|
+
*
|
|
20717
|
+
* @platform win32
|
|
20718
|
+
*/
|
|
20719
|
+
height?: number;
|
|
20720
|
+
}
|
|
20721
|
+
|
|
18486
20722
|
interface TitleOptions {
|
|
18487
20723
|
/**
|
|
18488
20724
|
* The font family variant to display, can be `monospaced` or `monospacedDigit`.
|
|
@@ -18902,6 +21138,13 @@ declare namespace Electron {
|
|
|
18902
21138
|
pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
|
|
18903
21139
|
}
|
|
18904
21140
|
|
|
21141
|
+
interface WebContentsViewConstructorOptions {
|
|
21142
|
+
/**
|
|
21143
|
+
* Settings of web page's features.
|
|
21144
|
+
*/
|
|
21145
|
+
webPreferences?: WebPreferences;
|
|
21146
|
+
}
|
|
21147
|
+
|
|
18905
21148
|
interface WebContentsWillFrameNavigateEventParams {
|
|
18906
21149
|
/**
|
|
18907
21150
|
* The URL the frame is navigating to.
|
|
@@ -19550,6 +21793,7 @@ declare namespace Electron {
|
|
|
19550
21793
|
type Streams = Electron.Streams;
|
|
19551
21794
|
type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
|
19552
21795
|
type TitleBarOverlay = Electron.TitleBarOverlay;
|
|
21796
|
+
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
|
19553
21797
|
type TitleOptions = Electron.TitleOptions;
|
|
19554
21798
|
type ToBitmapOptions = Electron.ToBitmapOptions;
|
|
19555
21799
|
type ToDataURLOptions = Electron.ToDataURLOptions;
|
|
@@ -19575,6 +21819,7 @@ declare namespace Electron {
|
|
|
19575
21819
|
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
|
19576
21820
|
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
|
19577
21821
|
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
|
21822
|
+
type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
|
19578
21823
|
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
|
19579
21824
|
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
|
19580
21825
|
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
|
@@ -19592,6 +21837,7 @@ declare namespace Electron {
|
|
|
19592
21837
|
type PageRanges = Electron.PageRanges;
|
|
19593
21838
|
type Params = Electron.Params;
|
|
19594
21839
|
type Video = Electron.Video;
|
|
21840
|
+
type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
|
19595
21841
|
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
|
19596
21842
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
19597
21843
|
type Certificate = Electron.Certificate;
|
|
@@ -19670,6 +21916,7 @@ declare namespace Electron {
|
|
|
19670
21916
|
type App = Electron.App;
|
|
19671
21917
|
const autoUpdater: AutoUpdater;
|
|
19672
21918
|
type AutoUpdater = Electron.AutoUpdater;
|
|
21919
|
+
class BaseWindow extends Electron.BaseWindow {}
|
|
19673
21920
|
class BrowserView extends Electron.BrowserView {}
|
|
19674
21921
|
class BrowserWindow extends Electron.BrowserWindow {}
|
|
19675
21922
|
type ClientRequest = Electron.ClientRequest;
|
|
@@ -19734,8 +21981,10 @@ declare namespace Electron {
|
|
|
19734
21981
|
class Tray extends Electron.Tray {}
|
|
19735
21982
|
const utilityProcess: typeof UtilityProcess;
|
|
19736
21983
|
type UtilityProcess = Electron.UtilityProcess;
|
|
21984
|
+
class View extends Electron.View {}
|
|
19737
21985
|
const webContents: typeof WebContents;
|
|
19738
21986
|
type WebContents = Electron.WebContents;
|
|
21987
|
+
class WebContentsView extends Electron.WebContentsView {}
|
|
19739
21988
|
const webFrameMain: typeof WebFrameMain;
|
|
19740
21989
|
type WebFrameMain = Electron.WebFrameMain;
|
|
19741
21990
|
type WebRequest = Electron.WebRequest;
|
|
@@ -19878,6 +22127,7 @@ declare namespace Electron {
|
|
|
19878
22127
|
type Streams = Electron.Streams;
|
|
19879
22128
|
type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
|
19880
22129
|
type TitleBarOverlay = Electron.TitleBarOverlay;
|
|
22130
|
+
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
|
19881
22131
|
type TitleOptions = Electron.TitleOptions;
|
|
19882
22132
|
type ToBitmapOptions = Electron.ToBitmapOptions;
|
|
19883
22133
|
type ToDataURLOptions = Electron.ToDataURLOptions;
|
|
@@ -19903,6 +22153,7 @@ declare namespace Electron {
|
|
|
19903
22153
|
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
|
19904
22154
|
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
|
19905
22155
|
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
|
22156
|
+
type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
|
19906
22157
|
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
|
19907
22158
|
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
|
19908
22159
|
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
|
@@ -19920,6 +22171,7 @@ declare namespace Electron {
|
|
|
19920
22171
|
type PageRanges = Electron.PageRanges;
|
|
19921
22172
|
type Params = Electron.Params;
|
|
19922
22173
|
type Video = Electron.Video;
|
|
22174
|
+
type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
|
19923
22175
|
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
|
19924
22176
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
19925
22177
|
type Certificate = Electron.Certificate;
|
|
@@ -20142,6 +22394,7 @@ declare namespace Electron {
|
|
|
20142
22394
|
type Streams = Electron.Streams;
|
|
20143
22395
|
type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
|
20144
22396
|
type TitleBarOverlay = Electron.TitleBarOverlay;
|
|
22397
|
+
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
|
20145
22398
|
type TitleOptions = Electron.TitleOptions;
|
|
20146
22399
|
type ToBitmapOptions = Electron.ToBitmapOptions;
|
|
20147
22400
|
type ToDataURLOptions = Electron.ToDataURLOptions;
|
|
@@ -20167,6 +22420,7 @@ declare namespace Electron {
|
|
|
20167
22420
|
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
|
20168
22421
|
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
|
20169
22422
|
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
|
22423
|
+
type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
|
20170
22424
|
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
|
20171
22425
|
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
|
20172
22426
|
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
|
@@ -20184,6 +22438,7 @@ declare namespace Electron {
|
|
|
20184
22438
|
type PageRanges = Electron.PageRanges;
|
|
20185
22439
|
type Params = Electron.Params;
|
|
20186
22440
|
type Video = Electron.Video;
|
|
22441
|
+
type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
|
20187
22442
|
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
|
20188
22443
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
20189
22444
|
type Certificate = Electron.Certificate;
|
|
@@ -20401,6 +22656,7 @@ declare namespace Electron {
|
|
|
20401
22656
|
type Streams = Electron.Streams;
|
|
20402
22657
|
type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
|
20403
22658
|
type TitleBarOverlay = Electron.TitleBarOverlay;
|
|
22659
|
+
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
|
20404
22660
|
type TitleOptions = Electron.TitleOptions;
|
|
20405
22661
|
type ToBitmapOptions = Electron.ToBitmapOptions;
|
|
20406
22662
|
type ToDataURLOptions = Electron.ToDataURLOptions;
|
|
@@ -20426,6 +22682,7 @@ declare namespace Electron {
|
|
|
20426
22682
|
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
|
20427
22683
|
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
|
20428
22684
|
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
|
22685
|
+
type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
|
20429
22686
|
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
|
20430
22687
|
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
|
20431
22688
|
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
|
@@ -20443,6 +22700,7 @@ declare namespace Electron {
|
|
|
20443
22700
|
type PageRanges = Electron.PageRanges;
|
|
20444
22701
|
type Params = Electron.Params;
|
|
20445
22702
|
type Video = Electron.Video;
|
|
22703
|
+
type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
|
20446
22704
|
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
|
20447
22705
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
20448
22706
|
type Certificate = Electron.Certificate;
|
|
@@ -20521,6 +22779,7 @@ declare namespace Electron {
|
|
|
20521
22779
|
type App = Electron.App;
|
|
20522
22780
|
const autoUpdater: AutoUpdater;
|
|
20523
22781
|
type AutoUpdater = Electron.AutoUpdater;
|
|
22782
|
+
class BaseWindow extends Electron.BaseWindow {}
|
|
20524
22783
|
class BrowserView extends Electron.BrowserView {}
|
|
20525
22784
|
class BrowserWindow extends Electron.BrowserWindow {}
|
|
20526
22785
|
type ClientRequest = Electron.ClientRequest;
|
|
@@ -20597,8 +22856,10 @@ declare namespace Electron {
|
|
|
20597
22856
|
class Tray extends Electron.Tray {}
|
|
20598
22857
|
const utilityProcess: typeof UtilityProcess;
|
|
20599
22858
|
type UtilityProcess = Electron.UtilityProcess;
|
|
22859
|
+
class View extends Electron.View {}
|
|
20600
22860
|
const webContents: typeof WebContents;
|
|
20601
22861
|
type WebContents = Electron.WebContents;
|
|
22862
|
+
class WebContentsView extends Electron.WebContentsView {}
|
|
20602
22863
|
const webFrame: WebFrame;
|
|
20603
22864
|
type WebFrame = Electron.WebFrame;
|
|
20604
22865
|
const webFrameMain: typeof WebFrameMain;
|
|
@@ -20746,6 +23007,7 @@ declare namespace Electron {
|
|
|
20746
23007
|
type Streams = Electron.Streams;
|
|
20747
23008
|
type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
|
20748
23009
|
type TitleBarOverlay = Electron.TitleBarOverlay;
|
|
23010
|
+
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
|
20749
23011
|
type TitleOptions = Electron.TitleOptions;
|
|
20750
23012
|
type ToBitmapOptions = Electron.ToBitmapOptions;
|
|
20751
23013
|
type ToDataURLOptions = Electron.ToDataURLOptions;
|
|
@@ -20771,6 +23033,7 @@ declare namespace Electron {
|
|
|
20771
23033
|
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
|
20772
23034
|
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
|
20773
23035
|
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
|
23036
|
+
type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
|
20774
23037
|
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
|
20775
23038
|
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
|
20776
23039
|
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
|
@@ -20788,6 +23051,7 @@ declare namespace Electron {
|
|
|
20788
23051
|
type PageRanges = Electron.PageRanges;
|
|
20789
23052
|
type Params = Electron.Params;
|
|
20790
23053
|
type Video = Electron.Video;
|
|
23054
|
+
type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
|
20791
23055
|
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
|
20792
23056
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
20793
23057
|
type Certificate = Electron.Certificate;
|