electron 4.0.0-nightly.20180821 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/cli.js +1 -1
- package/electron.d.ts +563 -259
- package/install.js +1 -1
- package/package.json +1 -1
package/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 4.0.0
|
|
1
|
+
// Type definitions for Electron 4.0.0
|
|
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/electron-typescript-definitions
|
|
@@ -119,7 +119,7 @@ declare namespace Electron {
|
|
|
119
119
|
|
|
120
120
|
interface App extends EventEmitter {
|
|
121
121
|
|
|
122
|
-
// Docs: http://
|
|
122
|
+
// Docs: http://electronjs.org/docs/api/app
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Emitted when Chrome's accessibility support changes. This event fires when
|
|
@@ -472,6 +472,40 @@ declare namespace Electron {
|
|
|
472
472
|
once(event: 'ready', listener: (launchInfo: any) => void): this;
|
|
473
473
|
addListener(event: 'ready', listener: (launchInfo: any) => void): this;
|
|
474
474
|
removeListener(event: 'ready', listener: (launchInfo: any) => void): this;
|
|
475
|
+
/**
|
|
476
|
+
* Emitted when remote.getGlobal() is called in the renderer process of
|
|
477
|
+
* webContents. Calling event.preventDefault() will prevent the global from being
|
|
478
|
+
* returned. Custom value can be returned by setting event.returnValue.
|
|
479
|
+
*/
|
|
480
|
+
on(event: 'remote-get-global', listener: (event: Event,
|
|
481
|
+
webContents: WebContents,
|
|
482
|
+
globalName: string) => void): this;
|
|
483
|
+
once(event: 'remote-get-global', listener: (event: Event,
|
|
484
|
+
webContents: WebContents,
|
|
485
|
+
globalName: string) => void): this;
|
|
486
|
+
addListener(event: 'remote-get-global', listener: (event: Event,
|
|
487
|
+
webContents: WebContents,
|
|
488
|
+
globalName: string) => void): this;
|
|
489
|
+
removeListener(event: 'remote-get-global', listener: (event: Event,
|
|
490
|
+
webContents: WebContents,
|
|
491
|
+
globalName: string) => void): this;
|
|
492
|
+
/**
|
|
493
|
+
* Emitted when remote.require() is called in the renderer process of webContents.
|
|
494
|
+
* Calling event.preventDefault() will prevent the module from being returned.
|
|
495
|
+
* Custom value can be returned by setting event.returnValue.
|
|
496
|
+
*/
|
|
497
|
+
on(event: 'remote-require', listener: (event: Event,
|
|
498
|
+
webContents: WebContents,
|
|
499
|
+
moduleName: string) => void): this;
|
|
500
|
+
once(event: 'remote-require', listener: (event: Event,
|
|
501
|
+
webContents: WebContents,
|
|
502
|
+
moduleName: string) => void): this;
|
|
503
|
+
addListener(event: 'remote-require', listener: (event: Event,
|
|
504
|
+
webContents: WebContents,
|
|
505
|
+
moduleName: string) => void): this;
|
|
506
|
+
removeListener(event: 'remote-require', listener: (event: Event,
|
|
507
|
+
webContents: WebContents,
|
|
508
|
+
moduleName: string) => void): this;
|
|
475
509
|
/**
|
|
476
510
|
* This event will be emitted inside the primary instance of your application when
|
|
477
511
|
* a second instance has been executed. argv is an Array of the second instance's
|
|
@@ -545,14 +579,10 @@ declare namespace Electron {
|
|
|
545
579
|
/**
|
|
546
580
|
* Emitted when Electron has created a new session.
|
|
547
581
|
*/
|
|
548
|
-
on(event: 'session-created', listener: (
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
addListener(event: 'session-created', listener: (event: Event,
|
|
553
|
-
session: Session) => void): this;
|
|
554
|
-
removeListener(event: 'session-created', listener: (event: Event,
|
|
555
|
-
session: Session) => void): this;
|
|
582
|
+
on(event: 'session-created', listener: (session: Session) => void): this;
|
|
583
|
+
once(event: 'session-created', listener: (session: Session) => void): this;
|
|
584
|
+
addListener(event: 'session-created', listener: (session: Session) => void): this;
|
|
585
|
+
removeListener(event: 'session-created', listener: (session: Session) => void): this;
|
|
556
586
|
/**
|
|
557
587
|
* Emitted when Handoff is about to be resumed on another device. If you need to
|
|
558
588
|
* update the state to be transferred, you should call event.preventDefault()
|
|
@@ -694,6 +724,11 @@ declare namespace Electron {
|
|
|
694
724
|
* is ready.
|
|
695
725
|
*/
|
|
696
726
|
enableMixedSandbox(): void;
|
|
727
|
+
/**
|
|
728
|
+
* Enables full sandbox mode on the app. This method can only be called before app
|
|
729
|
+
* is ready.
|
|
730
|
+
*/
|
|
731
|
+
enableSandbox(): void;
|
|
697
732
|
/**
|
|
698
733
|
* Exits immediately with exitCode. exitCode defaults to 0. All windows will be
|
|
699
734
|
* closed immediately without asking user and the before-quit and will-quit events
|
|
@@ -713,13 +748,22 @@ declare namespace Electron {
|
|
|
713
748
|
* Fetches a path's associated icon. On Windows, there a 2 kinds of icons: On Linux
|
|
714
749
|
* and macOS, icons depend on the application associated with file mime type.
|
|
715
750
|
*/
|
|
716
|
-
getFileIcon(path: string,
|
|
751
|
+
getFileIcon(path: string, callback: (error: Error, icon: NativeImage) => void): void;
|
|
717
752
|
/**
|
|
718
753
|
* Fetches a path's associated icon. On Windows, there a 2 kinds of icons: On Linux
|
|
719
754
|
* and macOS, icons depend on the application associated with file mime type.
|
|
720
755
|
*/
|
|
721
|
-
getFileIcon(path: string, callback: (error: Error, icon: NativeImage) => void): void;
|
|
756
|
+
getFileIcon(path: string, options: FileIconOptions, callback: (error: Error, icon: NativeImage) => void): void;
|
|
722
757
|
getGPUFeatureStatus(): GPUFeatureStatus;
|
|
758
|
+
/**
|
|
759
|
+
* For infoType equal to complete: Promise is fulfilled with Object containing all
|
|
760
|
+
* the GPU Information as in chromium's GPUInfo object. This includes the version
|
|
761
|
+
* and driver information that's shown on chrome://gpu page. For infoType equal to
|
|
762
|
+
* basic: Promise is fulfilled with Object containing fewer attributes than when
|
|
763
|
+
* requested with complete. Here's an example of basic response: Using basic should
|
|
764
|
+
* be preferred if only basic information like vendorId or driverId is needed.
|
|
765
|
+
*/
|
|
766
|
+
getGPUInfo(infoType: string): Promise<any>;
|
|
723
767
|
getJumpListSettings(): JumpListSettings;
|
|
724
768
|
/**
|
|
725
769
|
* To set the locale, you'll want to use a command line switch at app startup,
|
|
@@ -932,6 +976,11 @@ declare namespace Electron {
|
|
|
932
976
|
* them.
|
|
933
977
|
*/
|
|
934
978
|
show(): void;
|
|
979
|
+
/**
|
|
980
|
+
* Show the about panel with the values defined in the app's .plist file or with
|
|
981
|
+
* the options set via app.setAboutPanelOptions(options).
|
|
982
|
+
*/
|
|
983
|
+
showAboutPanel(): void;
|
|
935
984
|
/**
|
|
936
985
|
* Start accessing a security scoped resource. With this method Electron
|
|
937
986
|
* applications that are packaged for the Mac App Store may reach outside their
|
|
@@ -944,7 +993,7 @@ declare namespace Electron {
|
|
|
944
993
|
* userInfo into its current userInfo dictionary.
|
|
945
994
|
*/
|
|
946
995
|
updateCurrentActivity(type: string, userInfo: any): void;
|
|
947
|
-
whenReady(): Promise<
|
|
996
|
+
whenReady(): Promise<void>;
|
|
948
997
|
commandLine: CommandLine;
|
|
949
998
|
dock: Dock;
|
|
950
999
|
/**
|
|
@@ -957,7 +1006,7 @@ declare namespace Electron {
|
|
|
957
1006
|
|
|
958
1007
|
interface AutoUpdater extends EventEmitter {
|
|
959
1008
|
|
|
960
|
-
// Docs: http://
|
|
1009
|
+
// Docs: http://electronjs.org/docs/api/auto-updater
|
|
961
1010
|
|
|
962
1011
|
/**
|
|
963
1012
|
* This event is emitted after a user calls quitAndInstall(). When this API is
|
|
@@ -1049,7 +1098,7 @@ declare namespace Electron {
|
|
|
1049
1098
|
|
|
1050
1099
|
interface BluetoothDevice {
|
|
1051
1100
|
|
|
1052
|
-
// Docs: http://
|
|
1101
|
+
// Docs: http://electronjs.org/docs/api/structures/bluetooth-device
|
|
1053
1102
|
|
|
1054
1103
|
deviceId: string;
|
|
1055
1104
|
deviceName: string;
|
|
@@ -1057,11 +1106,11 @@ declare namespace Electron {
|
|
|
1057
1106
|
|
|
1058
1107
|
class BrowserView extends EventEmitter {
|
|
1059
1108
|
|
|
1060
|
-
// Docs: http://
|
|
1109
|
+
// Docs: http://electronjs.org/docs/api/browser-view
|
|
1061
1110
|
|
|
1062
1111
|
constructor(options?: BrowserViewConstructorOptions);
|
|
1063
1112
|
static fromId(id: number): BrowserView;
|
|
1064
|
-
static fromWebContents(webContents: WebContents): BrowserView | null;
|
|
1113
|
+
static fromWebContents(webContents: WebContents): (BrowserView) | (null);
|
|
1065
1114
|
static getAllViews(): BrowserView[];
|
|
1066
1115
|
/**
|
|
1067
1116
|
* Force closing the view, the unload and beforeunload events won't be emitted for
|
|
@@ -1082,8 +1131,19 @@ declare namespace Electron {
|
|
|
1082
1131
|
|
|
1083
1132
|
class BrowserWindow extends EventEmitter {
|
|
1084
1133
|
|
|
1085
|
-
// Docs: http://
|
|
1134
|
+
// Docs: http://electronjs.org/docs/api/browser-window
|
|
1086
1135
|
|
|
1136
|
+
/**
|
|
1137
|
+
* Emitted when the window is set or unset to show always on top of other windows.
|
|
1138
|
+
*/
|
|
1139
|
+
on(event: 'always-on-top-changed', listener: (event: Event,
|
|
1140
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
1141
|
+
once(event: 'always-on-top-changed', listener: (event: Event,
|
|
1142
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
1143
|
+
addListener(event: 'always-on-top-changed', listener: (event: Event,
|
|
1144
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
1145
|
+
removeListener(event: 'always-on-top-changed', listener: (event: Event,
|
|
1146
|
+
isAlwaysOnTop: boolean) => void): this;
|
|
1087
1147
|
/**
|
|
1088
1148
|
* Emitted when an App Command is invoked. These are typically related to keyboard
|
|
1089
1149
|
* media keys or browser commands, as well as the "Back" button built into some
|
|
@@ -1324,6 +1384,32 @@ declare namespace Electron {
|
|
|
1324
1384
|
once(event: 'unresponsive', listener: Function): this;
|
|
1325
1385
|
addListener(event: 'unresponsive', listener: Function): this;
|
|
1326
1386
|
removeListener(event: 'unresponsive', listener: Function): this;
|
|
1387
|
+
/**
|
|
1388
|
+
* Emitted before the window is moved. Calling event.preventDefault() will prevent
|
|
1389
|
+
* the window from being moved. Note that this is only emitted when the window is
|
|
1390
|
+
* being resized manually. Resizing the window with setBounds/setSize will not emit
|
|
1391
|
+
* this event.
|
|
1392
|
+
*/
|
|
1393
|
+
on(event: 'will-move', listener: (event: Event,
|
|
1394
|
+
/**
|
|
1395
|
+
* ` Location the window is being moved to.
|
|
1396
|
+
*/
|
|
1397
|
+
newBounds: Rectangle) => void): this;
|
|
1398
|
+
once(event: 'will-move', listener: (event: Event,
|
|
1399
|
+
/**
|
|
1400
|
+
* ` Location the window is being moved to.
|
|
1401
|
+
*/
|
|
1402
|
+
newBounds: Rectangle) => void): this;
|
|
1403
|
+
addListener(event: 'will-move', listener: (event: Event,
|
|
1404
|
+
/**
|
|
1405
|
+
* ` Location the window is being moved to.
|
|
1406
|
+
*/
|
|
1407
|
+
newBounds: Rectangle) => void): this;
|
|
1408
|
+
removeListener(event: 'will-move', listener: (event: Event,
|
|
1409
|
+
/**
|
|
1410
|
+
* ` Location the window is being moved to.
|
|
1411
|
+
*/
|
|
1412
|
+
newBounds: Rectangle) => void): this;
|
|
1327
1413
|
/**
|
|
1328
1414
|
* Emitted before the window is resized. Calling event.preventDefault() will
|
|
1329
1415
|
* prevent the window from being resized. Note that this is only emitted when the
|
|
@@ -1367,7 +1453,7 @@ declare namespace Electron {
|
|
|
1367
1453
|
* This API cannot be called before the ready event of the app module is emitted.
|
|
1368
1454
|
*/
|
|
1369
1455
|
static addExtension(path: string): void;
|
|
1370
|
-
static fromBrowserView(browserView: BrowserView): BrowserWindow | null;
|
|
1456
|
+
static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
|
|
1371
1457
|
static fromId(id: number): BrowserWindow;
|
|
1372
1458
|
static fromWebContents(webContents: WebContents): BrowserWindow;
|
|
1373
1459
|
static getAllWindows(): BrowserWindow[];
|
|
@@ -1381,7 +1467,7 @@ declare namespace Electron {
|
|
|
1381
1467
|
* emitted.
|
|
1382
1468
|
*/
|
|
1383
1469
|
static getExtensions(): Extensions;
|
|
1384
|
-
static getFocusedWindow(): BrowserWindow | null;
|
|
1470
|
+
static getFocusedWindow(): (BrowserWindow) | (null);
|
|
1385
1471
|
/**
|
|
1386
1472
|
* Remove a DevTools extension by name. Note: This API cannot be called before the
|
|
1387
1473
|
* ready event of the app module is emitted.
|
|
@@ -1443,7 +1529,7 @@ declare namespace Electron {
|
|
|
1443
1529
|
* Note: The BrowserView API is currently experimental and may change or be removed
|
|
1444
1530
|
* in future Electron releases.
|
|
1445
1531
|
*/
|
|
1446
|
-
getBrowserView(): BrowserView | null;
|
|
1532
|
+
getBrowserView(): (BrowserView) | (null);
|
|
1447
1533
|
getChildWindows(): BrowserWindow[];
|
|
1448
1534
|
getContentBounds(): Rectangle;
|
|
1449
1535
|
getContentSize(): number[];
|
|
@@ -1454,6 +1540,13 @@ declare namespace Electron {
|
|
|
1454
1540
|
* (unsigned long) on Linux.
|
|
1455
1541
|
*/
|
|
1456
1542
|
getNativeWindowHandle(): Buffer;
|
|
1543
|
+
/**
|
|
1544
|
+
* Note: whatever the current state of the window : maximized, minimized or in
|
|
1545
|
+
* fullscreen, this function always returns the position and size of the window in
|
|
1546
|
+
* normal state. In normal state, getBounds and getNormalBounds returns the same
|
|
1547
|
+
* Rectangle.
|
|
1548
|
+
*/
|
|
1549
|
+
getNormalBounds(): Rectangle;
|
|
1457
1550
|
getOpacity(): number;
|
|
1458
1551
|
getParentWindow(): BrowserWindow;
|
|
1459
1552
|
getPosition(): number[];
|
|
@@ -1505,6 +1598,7 @@ declare namespace Electron {
|
|
|
1505
1598
|
* On Linux always returns true.
|
|
1506
1599
|
*/
|
|
1507
1600
|
isMovable(): boolean;
|
|
1601
|
+
isNormal(): boolean;
|
|
1508
1602
|
isResizable(): boolean;
|
|
1509
1603
|
isSimpleFullScreen(): boolean;
|
|
1510
1604
|
isVisible(): boolean;
|
|
@@ -1517,7 +1611,7 @@ declare namespace Electron {
|
|
|
1517
1611
|
* Same as webContents.loadFile, filePath should be a path to an HTML file relative
|
|
1518
1612
|
* to the root of your application. See the webContents docs for more information.
|
|
1519
1613
|
*/
|
|
1520
|
-
loadFile(filePath: string): void;
|
|
1614
|
+
loadFile(filePath: string, options?: LoadFileOptions): void;
|
|
1521
1615
|
/**
|
|
1522
1616
|
* Same as webContents.loadURL(url[, options]). The url can be a remote address
|
|
1523
1617
|
* (e.g. http://) or a path to a local HTML file using the file:// protocol. To
|
|
@@ -1611,7 +1705,12 @@ declare namespace Electron {
|
|
|
1611
1705
|
*/
|
|
1612
1706
|
setAutoHideMenuBar(hide: boolean): void;
|
|
1613
1707
|
/**
|
|
1614
|
-
*
|
|
1708
|
+
* Sets the background color of the window. See Setting backgroundColor.
|
|
1709
|
+
*/
|
|
1710
|
+
setBackgroundColor(backgroundColor: string): void;
|
|
1711
|
+
/**
|
|
1712
|
+
* Resizes and moves the window to the supplied bounds. Any properties that are not
|
|
1713
|
+
* supplied will default to their current values.
|
|
1615
1714
|
*/
|
|
1616
1715
|
setBounds(bounds: Rectangle, animate?: boolean): void;
|
|
1617
1716
|
setBrowserView(browserView: BrowserView): void;
|
|
@@ -1687,7 +1786,7 @@ declare namespace Electron {
|
|
|
1687
1786
|
* Sets the menu as the window's menu bar, setting it to null will remove the menu
|
|
1688
1787
|
* bar.
|
|
1689
1788
|
*/
|
|
1690
|
-
setMenu(menu: Menu | null): void;
|
|
1789
|
+
setMenu(menu: (Menu) | (null)): void;
|
|
1691
1790
|
/**
|
|
1692
1791
|
* Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
|
1693
1792
|
* can still bring up the menu bar by pressing the single Alt key.
|
|
@@ -1714,7 +1813,7 @@ declare namespace Electron {
|
|
|
1714
1813
|
* Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
|
|
1715
1814
|
* convey some sort of application status or to passively notify the user.
|
|
1716
1815
|
*/
|
|
1717
|
-
setOverlayIcon(overlay: NativeImage | null, description: string): void;
|
|
1816
|
+
setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
|
|
1718
1817
|
/**
|
|
1719
1818
|
* Sets parent as current window's parent window, passing null will turn current
|
|
1720
1819
|
* window into a top-level window.
|
|
@@ -1764,7 +1863,8 @@ declare namespace Electron {
|
|
|
1764
1863
|
*/
|
|
1765
1864
|
setSimpleFullScreen(flag: boolean): void;
|
|
1766
1865
|
/**
|
|
1767
|
-
* Resizes the window to width and height.
|
|
1866
|
+
* Resizes the window to width and height. If width or height are below any set
|
|
1867
|
+
* minimum size constraints the window will snap to its minimum size.
|
|
1768
1868
|
*/
|
|
1769
1869
|
setSize(width: number, height: number, animate?: boolean): void;
|
|
1770
1870
|
/**
|
|
@@ -1785,7 +1885,8 @@ declare namespace Electron {
|
|
|
1785
1885
|
/**
|
|
1786
1886
|
* Sets the region of the window to show as the thumbnail image displayed when
|
|
1787
1887
|
* hovering over the window in the taskbar. You can reset the thumbnail to be the
|
|
1788
|
-
* entire window by specifying an empty region: {x: 0, y: 0, width: 0, height: 0
|
|
1888
|
+
* entire window by specifying an empty region: { x: 0, y: 0, width: 0, height: 0
|
|
1889
|
+
* }.
|
|
1789
1890
|
*/
|
|
1790
1891
|
setThumbnailClip(region: Rectangle): void;
|
|
1791
1892
|
/**
|
|
@@ -1813,7 +1914,7 @@ declare namespace Electron {
|
|
|
1813
1914
|
* Sets whether the window should be visible on all workspaces. Note: This API does
|
|
1814
1915
|
* nothing on Windows.
|
|
1815
1916
|
*/
|
|
1816
|
-
setVisibleOnAllWorkspaces(visible: boolean): void;
|
|
1917
|
+
setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
|
|
1817
1918
|
/**
|
|
1818
1919
|
* Sets whether the window traffic light buttons should be visible. This cannot be
|
|
1819
1920
|
* called when titleBarStyle is set to customButtonsOnHover.
|
|
@@ -1854,7 +1955,7 @@ declare namespace Electron {
|
|
|
1854
1955
|
|
|
1855
1956
|
class BrowserWindowProxy extends EventEmitter {
|
|
1856
1957
|
|
|
1857
|
-
// Docs: http://
|
|
1958
|
+
// Docs: http://electronjs.org/docs/api/browser-window-proxy
|
|
1858
1959
|
|
|
1859
1960
|
/**
|
|
1860
1961
|
* Removes focus from the child window.
|
|
@@ -1887,7 +1988,7 @@ declare namespace Electron {
|
|
|
1887
1988
|
|
|
1888
1989
|
interface Certificate {
|
|
1889
1990
|
|
|
1890
|
-
// Docs: http://
|
|
1991
|
+
// Docs: http://electronjs.org/docs/api/structures/certificate
|
|
1891
1992
|
|
|
1892
1993
|
/**
|
|
1893
1994
|
* PEM encoded data
|
|
@@ -1933,7 +2034,7 @@ declare namespace Electron {
|
|
|
1933
2034
|
|
|
1934
2035
|
interface CertificatePrincipal {
|
|
1935
2036
|
|
|
1936
|
-
// Docs: http://
|
|
2037
|
+
// Docs: http://electronjs.org/docs/api/structures/certificate-principal
|
|
1937
2038
|
|
|
1938
2039
|
/**
|
|
1939
2040
|
* Common Name.
|
|
@@ -1963,7 +2064,7 @@ declare namespace Electron {
|
|
|
1963
2064
|
|
|
1964
2065
|
class ClientRequest extends EventEmitter {
|
|
1965
2066
|
|
|
1966
|
-
// Docs: http://
|
|
2067
|
+
// Docs: http://electronjs.org/docs/api/client-request
|
|
1967
2068
|
|
|
1968
2069
|
/**
|
|
1969
2070
|
* Emitted when the request is aborted. The abort event will not be fired if the
|
|
@@ -2081,7 +2182,7 @@ declare namespace Electron {
|
|
|
2081
2182
|
* Sends the last chunk of the request data. Subsequent write or end operations
|
|
2082
2183
|
* will not be allowed. The finish event is emitted just after the end operation.
|
|
2083
2184
|
*/
|
|
2084
|
-
end(chunk?: string | Buffer, encoding?: string, callback?: Function): void;
|
|
2185
|
+
end(chunk?: (string) | (Buffer), encoding?: string, callback?: Function): void;
|
|
2085
2186
|
/**
|
|
2086
2187
|
* Continues any deferred redirection request when the redirection mode is manual.
|
|
2087
2188
|
*/
|
|
@@ -2114,13 +2215,13 @@ declare namespace Electron {
|
|
|
2114
2215
|
* issued on the wire. After the first write operation, it is not allowed to add or
|
|
2115
2216
|
* remove a custom header.
|
|
2116
2217
|
*/
|
|
2117
|
-
write(chunk: string | Buffer, encoding?: string, callback?: Function): void;
|
|
2218
|
+
write(chunk: (string) | (Buffer), encoding?: string, callback?: Function): void;
|
|
2118
2219
|
chunkedEncoding: boolean;
|
|
2119
2220
|
}
|
|
2120
2221
|
|
|
2121
2222
|
interface Clipboard extends EventEmitter {
|
|
2122
2223
|
|
|
2123
|
-
// Docs: http://
|
|
2224
|
+
// Docs: http://electronjs.org/docs/api/clipboard
|
|
2124
2225
|
|
|
2125
2226
|
availableFormats(type?: string): string[];
|
|
2126
2227
|
/**
|
|
@@ -2180,7 +2281,7 @@ declare namespace Electron {
|
|
|
2180
2281
|
|
|
2181
2282
|
interface ContentTracing extends EventEmitter {
|
|
2182
2283
|
|
|
2183
|
-
// Docs: http://
|
|
2284
|
+
// Docs: http://electronjs.org/docs/api/content-tracing
|
|
2184
2285
|
|
|
2185
2286
|
/**
|
|
2186
2287
|
* Get the current monitoring traced data. Child processes typically cache trace
|
|
@@ -2250,7 +2351,7 @@ declare namespace Electron {
|
|
|
2250
2351
|
|
|
2251
2352
|
interface Cookie {
|
|
2252
2353
|
|
|
2253
|
-
// Docs: http://
|
|
2354
|
+
// Docs: http://electronjs.org/docs/api/structures/cookie
|
|
2254
2355
|
|
|
2255
2356
|
/**
|
|
2256
2357
|
* The domain of the cookie.
|
|
@@ -2294,7 +2395,7 @@ declare namespace Electron {
|
|
|
2294
2395
|
|
|
2295
2396
|
class Cookies extends EventEmitter {
|
|
2296
2397
|
|
|
2297
|
-
// Docs: http://
|
|
2398
|
+
// Docs: http://electronjs.org/docs/api/cookies
|
|
2298
2399
|
|
|
2299
2400
|
/**
|
|
2300
2401
|
* Emitted when a cookie is changed because it was added, edited, removed, or
|
|
@@ -2375,7 +2476,7 @@ declare namespace Electron {
|
|
|
2375
2476
|
|
|
2376
2477
|
interface CPUUsage {
|
|
2377
2478
|
|
|
2378
|
-
// Docs: http://
|
|
2479
|
+
// Docs: http://electronjs.org/docs/api/structures/cpu-usage
|
|
2379
2480
|
|
|
2380
2481
|
/**
|
|
2381
2482
|
* The number of average idle cpu wakeups per second since the last call to
|
|
@@ -2390,7 +2491,7 @@ declare namespace Electron {
|
|
|
2390
2491
|
|
|
2391
2492
|
interface CrashReport {
|
|
2392
2493
|
|
|
2393
|
-
// Docs: http://
|
|
2494
|
+
// Docs: http://electronjs.org/docs/api/structures/crash-report
|
|
2394
2495
|
|
|
2395
2496
|
date: Date;
|
|
2396
2497
|
id: string;
|
|
@@ -2398,7 +2499,7 @@ declare namespace Electron {
|
|
|
2398
2499
|
|
|
2399
2500
|
interface CrashReporter extends EventEmitter {
|
|
2400
2501
|
|
|
2401
|
-
// Docs: http://
|
|
2502
|
+
// Docs: http://electronjs.org/docs/api/crash-reporter
|
|
2402
2503
|
|
|
2403
2504
|
/**
|
|
2404
2505
|
* Set an extra parameter to be sent with the crash report. The values specified
|
|
@@ -2466,7 +2567,7 @@ declare namespace Electron {
|
|
|
2466
2567
|
|
|
2467
2568
|
class Debugger extends EventEmitter {
|
|
2468
2569
|
|
|
2469
|
-
// Docs: http://
|
|
2570
|
+
// Docs: http://electronjs.org/docs/api/debugger
|
|
2470
2571
|
|
|
2471
2572
|
/**
|
|
2472
2573
|
* Emitted when debugging session is terminated. This happens either when
|
|
@@ -2552,7 +2653,7 @@ declare namespace Electron {
|
|
|
2552
2653
|
|
|
2553
2654
|
interface DesktopCapturer extends EventEmitter {
|
|
2554
2655
|
|
|
2555
|
-
// Docs: http://
|
|
2656
|
+
// Docs: http://electronjs.org/docs/api/desktop-capturer
|
|
2556
2657
|
|
|
2557
2658
|
/**
|
|
2558
2659
|
* Starts gathering information about all available desktop media sources, and
|
|
@@ -2565,7 +2666,7 @@ declare namespace Electron {
|
|
|
2565
2666
|
|
|
2566
2667
|
interface DesktopCapturerSource {
|
|
2567
2668
|
|
|
2568
|
-
// Docs: http://
|
|
2669
|
+
// Docs: http://electronjs.org/docs/api/structures/desktop-capturer-source
|
|
2569
2670
|
|
|
2570
2671
|
/**
|
|
2571
2672
|
* A unique identifier that will correspond to the id of the matching returned by
|
|
@@ -2581,8 +2682,8 @@ declare namespace Electron {
|
|
|
2581
2682
|
*/
|
|
2582
2683
|
id: string;
|
|
2583
2684
|
/**
|
|
2584
|
-
* A screen source will be named either Entire Screen or Screen
|
|
2585
|
-
*
|
|
2685
|
+
* A screen source will be named either Entire Screen or Screen , while the name of
|
|
2686
|
+
* a window source will match the window title.
|
|
2586
2687
|
*/
|
|
2587
2688
|
name: string;
|
|
2588
2689
|
/**
|
|
@@ -2596,7 +2697,7 @@ declare namespace Electron {
|
|
|
2596
2697
|
|
|
2597
2698
|
interface Dialog extends EventEmitter {
|
|
2598
2699
|
|
|
2599
|
-
// Docs: http://
|
|
2700
|
+
// Docs: http://electronjs.org/docs/api/dialog
|
|
2600
2701
|
|
|
2601
2702
|
/**
|
|
2602
2703
|
* On macOS, this displays a modal dialog that shows a message and certificate
|
|
@@ -2691,7 +2792,7 @@ declare namespace Electron {
|
|
|
2691
2792
|
|
|
2692
2793
|
interface Display {
|
|
2693
2794
|
|
|
2694
|
-
// Docs: http://
|
|
2795
|
+
// Docs: http://electronjs.org/docs/api/structures/display
|
|
2695
2796
|
|
|
2696
2797
|
bounds: Rectangle;
|
|
2697
2798
|
/**
|
|
@@ -2717,7 +2818,7 @@ declare namespace Electron {
|
|
|
2717
2818
|
|
|
2718
2819
|
class DownloadItem extends EventEmitter {
|
|
2719
2820
|
|
|
2720
|
-
// Docs: http://
|
|
2821
|
+
// Docs: http://electronjs.org/docs/api/download-item
|
|
2721
2822
|
|
|
2722
2823
|
/**
|
|
2723
2824
|
* Emitted when the download is in a terminal state. This includes a completed
|
|
@@ -2820,7 +2921,7 @@ declare namespace Electron {
|
|
|
2820
2921
|
|
|
2821
2922
|
interface FileFilter {
|
|
2822
2923
|
|
|
2823
|
-
// Docs: http://
|
|
2924
|
+
// Docs: http://electronjs.org/docs/api/structures/file-filter
|
|
2824
2925
|
|
|
2825
2926
|
extensions: string[];
|
|
2826
2927
|
name: string;
|
|
@@ -2828,7 +2929,7 @@ declare namespace Electron {
|
|
|
2828
2929
|
|
|
2829
2930
|
interface GlobalShortcut extends EventEmitter {
|
|
2830
2931
|
|
|
2831
|
-
// Docs: http://
|
|
2932
|
+
// Docs: http://electronjs.org/docs/api/global-shortcut
|
|
2832
2933
|
|
|
2833
2934
|
/**
|
|
2834
2935
|
* When the accelerator is already taken by other applications, this call will
|
|
@@ -2856,7 +2957,7 @@ declare namespace Electron {
|
|
|
2856
2957
|
|
|
2857
2958
|
interface GPUFeatureStatus {
|
|
2858
2959
|
|
|
2859
|
-
// Docs: http://
|
|
2960
|
+
// Docs: http://electronjs.org/docs/api/structures/gpu-feature-status
|
|
2860
2961
|
|
|
2861
2962
|
/**
|
|
2862
2963
|
* Canvas.
|
|
@@ -2914,7 +3015,7 @@ declare namespace Electron {
|
|
|
2914
3015
|
|
|
2915
3016
|
interface InAppPurchase extends EventEmitter {
|
|
2916
3017
|
|
|
2917
|
-
// Docs: http://
|
|
3018
|
+
// Docs: http://electronjs.org/docs/api/in-app-purchase
|
|
2918
3019
|
|
|
2919
3020
|
/**
|
|
2920
3021
|
* Emitted when one or more transactions have been updated.
|
|
@@ -2962,7 +3063,7 @@ declare namespace Electron {
|
|
|
2962
3063
|
|
|
2963
3064
|
class IncomingMessage extends EventEmitter {
|
|
2964
3065
|
|
|
2965
|
-
// Docs: http://
|
|
3066
|
+
// Docs: http://electronjs.org/docs/api/incoming-message
|
|
2966
3067
|
|
|
2967
3068
|
/**
|
|
2968
3069
|
* Emitted when a request has been canceled during an ongoing HTTP transaction.
|
|
@@ -3023,7 +3124,7 @@ declare namespace Electron {
|
|
|
3023
3124
|
|
|
3024
3125
|
interface IOCounters {
|
|
3025
3126
|
|
|
3026
|
-
// Docs: http://
|
|
3127
|
+
// Docs: http://electronjs.org/docs/api/structures/io-counters
|
|
3027
3128
|
|
|
3028
3129
|
/**
|
|
3029
3130
|
* Then number of I/O other operations.
|
|
@@ -3053,7 +3154,7 @@ declare namespace Electron {
|
|
|
3053
3154
|
|
|
3054
3155
|
interface IpcMain extends EventEmitter {
|
|
3055
3156
|
|
|
3056
|
-
// Docs: http://
|
|
3157
|
+
// Docs: http://electronjs.org/docs/api/ipc-main
|
|
3057
3158
|
|
|
3058
3159
|
/**
|
|
3059
3160
|
* Listens to channel, when a new message arrives listener would be called with
|
|
@@ -3078,7 +3179,7 @@ declare namespace Electron {
|
|
|
3078
3179
|
|
|
3079
3180
|
interface IpcRenderer extends EventEmitter {
|
|
3080
3181
|
|
|
3081
|
-
// Docs: http://
|
|
3182
|
+
// Docs: http://electronjs.org/docs/api/ipc-renderer
|
|
3082
3183
|
|
|
3083
3184
|
/**
|
|
3084
3185
|
* Listens to channel, when a new message arrives listener would be called with
|
|
@@ -3116,9 +3217,9 @@ declare namespace Electron {
|
|
|
3116
3217
|
*/
|
|
3117
3218
|
sendSync(channel: string, ...args: any[]): any;
|
|
3118
3219
|
/**
|
|
3119
|
-
* Sends a message to a window with
|
|
3220
|
+
* Sends a message to a window with webContentsId via channel.
|
|
3120
3221
|
*/
|
|
3121
|
-
sendTo(
|
|
3222
|
+
sendTo(webContentsId: number, channel: string, ...args: any[]): void;
|
|
3122
3223
|
/**
|
|
3123
3224
|
* Like ipcRenderer.send but the event will be sent to the <webview> element in the
|
|
3124
3225
|
* host page instead of the main process.
|
|
@@ -3128,7 +3229,7 @@ declare namespace Electron {
|
|
|
3128
3229
|
|
|
3129
3230
|
interface JumpListCategory {
|
|
3130
3231
|
|
|
3131
|
-
// Docs: http://
|
|
3232
|
+
// Docs: http://electronjs.org/docs/api/structures/jump-list-category
|
|
3132
3233
|
|
|
3133
3234
|
/**
|
|
3134
3235
|
* Array of objects if type is tasks or custom, otherwise it should be omitted.
|
|
@@ -3146,7 +3247,7 @@ declare namespace Electron {
|
|
|
3146
3247
|
|
|
3147
3248
|
interface JumpListItem {
|
|
3148
3249
|
|
|
3149
|
-
// Docs: http://
|
|
3250
|
+
// Docs: http://electronjs.org/docs/api/structures/jump-list-item
|
|
3150
3251
|
|
|
3151
3252
|
/**
|
|
3152
3253
|
* The command line arguments when program is executed. Should only be set if type
|
|
@@ -3193,7 +3294,7 @@ declare namespace Electron {
|
|
|
3193
3294
|
|
|
3194
3295
|
interface MemoryInfo {
|
|
3195
3296
|
|
|
3196
|
-
// Docs: http://
|
|
3297
|
+
// Docs: http://electronjs.org/docs/api/structures/memory-info
|
|
3197
3298
|
|
|
3198
3299
|
/**
|
|
3199
3300
|
* The maximum amount of memory that has ever been pinned to actual physical RAM.
|
|
@@ -3222,7 +3323,7 @@ declare namespace Electron {
|
|
|
3222
3323
|
|
|
3223
3324
|
interface MemoryUsageDetails {
|
|
3224
3325
|
|
|
3225
|
-
// Docs: http://
|
|
3326
|
+
// Docs: http://electronjs.org/docs/api/structures/memory-usage-details
|
|
3226
3327
|
|
|
3227
3328
|
count: number;
|
|
3228
3329
|
liveSize: number;
|
|
@@ -3231,7 +3332,7 @@ declare namespace Electron {
|
|
|
3231
3332
|
|
|
3232
3333
|
class Menu {
|
|
3233
3334
|
|
|
3234
|
-
// Docs: http://
|
|
3335
|
+
// Docs: http://electronjs.org/docs/api/menu
|
|
3235
3336
|
|
|
3236
3337
|
/**
|
|
3237
3338
|
* Emitted when a popup is closed either manually or with menu.closePopup().
|
|
@@ -3258,7 +3359,7 @@ declare namespace Electron {
|
|
|
3258
3359
|
* Note: The returned Menu instance doesn't support dynamic addition or removal of
|
|
3259
3360
|
* menu items. Instance properties can still be dynamically modified.
|
|
3260
3361
|
*/
|
|
3261
|
-
static getApplicationMenu(): Menu | null;
|
|
3362
|
+
static getApplicationMenu(): (Menu) | (null);
|
|
3262
3363
|
/**
|
|
3263
3364
|
* Sends the action to the first responder of application. This is used for
|
|
3264
3365
|
* emulating default macOS menu behaviors. Usually you would use the role property
|
|
@@ -3272,7 +3373,7 @@ declare namespace Electron {
|
|
|
3272
3373
|
* Windows and Linux but has no effect on macOS. Note: This API has to be called
|
|
3273
3374
|
* after the ready event of app module.
|
|
3274
3375
|
*/
|
|
3275
|
-
static setApplicationMenu(menu: Menu | null): void;
|
|
3376
|
+
static setApplicationMenu(menu: (Menu) | (null)): void;
|
|
3276
3377
|
/**
|
|
3277
3378
|
* Appends the menuItem to the menu.
|
|
3278
3379
|
*/
|
|
@@ -3295,7 +3396,7 @@ declare namespace Electron {
|
|
|
3295
3396
|
|
|
3296
3397
|
class MenuItem {
|
|
3297
3398
|
|
|
3298
|
-
// Docs: http://
|
|
3399
|
+
// Docs: http://electronjs.org/docs/api/menu-item
|
|
3299
3400
|
|
|
3300
3401
|
constructor(options: MenuItemConstructorOptions);
|
|
3301
3402
|
checked: boolean;
|
|
@@ -3307,7 +3408,7 @@ declare namespace Electron {
|
|
|
3307
3408
|
|
|
3308
3409
|
interface MimeTypedBuffer {
|
|
3309
3410
|
|
|
3310
|
-
// Docs: http://
|
|
3411
|
+
// Docs: http://electronjs.org/docs/api/structures/mime-typed-buffer
|
|
3311
3412
|
|
|
3312
3413
|
/**
|
|
3313
3414
|
* The actual Buffer content.
|
|
@@ -3321,7 +3422,7 @@ declare namespace Electron {
|
|
|
3321
3422
|
|
|
3322
3423
|
class NativeImage {
|
|
3323
3424
|
|
|
3324
|
-
// Docs: http://
|
|
3425
|
+
// Docs: http://electronjs.org/docs/api/native-image
|
|
3325
3426
|
|
|
3326
3427
|
/**
|
|
3327
3428
|
* Creates an empty NativeImage instance.
|
|
@@ -3388,7 +3489,7 @@ declare namespace Electron {
|
|
|
3388
3489
|
|
|
3389
3490
|
interface Net extends EventEmitter {
|
|
3390
3491
|
|
|
3391
|
-
// Docs: http://
|
|
3492
|
+
// Docs: http://electronjs.org/docs/api/net
|
|
3392
3493
|
|
|
3393
3494
|
/**
|
|
3394
3495
|
* Creates a ClientRequest instance using the provided options which are directly
|
|
@@ -3396,12 +3497,12 @@ declare namespace Electron {
|
|
|
3396
3497
|
* to issue both secure and insecure HTTP requests according to the specified
|
|
3397
3498
|
* protocol scheme in the options object.
|
|
3398
3499
|
*/
|
|
3399
|
-
request(options: any | string): ClientRequest;
|
|
3500
|
+
request(options: (any) | (string)): ClientRequest;
|
|
3400
3501
|
}
|
|
3401
3502
|
|
|
3402
3503
|
interface NetLog extends EventEmitter {
|
|
3403
3504
|
|
|
3404
|
-
// Docs: http://
|
|
3505
|
+
// Docs: http://electronjs.org/docs/api/net-log
|
|
3405
3506
|
|
|
3406
3507
|
/**
|
|
3407
3508
|
* Starts recording network events to path.
|
|
@@ -3424,7 +3525,7 @@ declare namespace Electron {
|
|
|
3424
3525
|
|
|
3425
3526
|
class Notification extends EventEmitter {
|
|
3426
3527
|
|
|
3427
|
-
// Docs: http://
|
|
3528
|
+
// Docs: http://electronjs.org/docs/api/notification
|
|
3428
3529
|
|
|
3429
3530
|
on(event: 'action', listener: (event: Event,
|
|
3430
3531
|
/**
|
|
@@ -3514,7 +3615,7 @@ declare namespace Electron {
|
|
|
3514
3615
|
|
|
3515
3616
|
interface NotificationAction {
|
|
3516
3617
|
|
|
3517
|
-
// Docs: http://
|
|
3618
|
+
// Docs: http://electronjs.org/docs/api/structures/notification-action
|
|
3518
3619
|
|
|
3519
3620
|
/**
|
|
3520
3621
|
* The label for the given action.
|
|
@@ -3528,7 +3629,7 @@ declare namespace Electron {
|
|
|
3528
3629
|
|
|
3529
3630
|
interface Point {
|
|
3530
3631
|
|
|
3531
|
-
// Docs: http://
|
|
3632
|
+
// Docs: http://electronjs.org/docs/api/structures/point
|
|
3532
3633
|
|
|
3533
3634
|
x: number;
|
|
3534
3635
|
y: number;
|
|
@@ -3536,7 +3637,7 @@ declare namespace Electron {
|
|
|
3536
3637
|
|
|
3537
3638
|
interface PowerMonitor extends EventEmitter {
|
|
3538
3639
|
|
|
3539
|
-
// Docs: http://
|
|
3640
|
+
// Docs: http://electronjs.org/docs/api/power-monitor
|
|
3540
3641
|
|
|
3541
3642
|
/**
|
|
3542
3643
|
* Emitted when the system is about to lock the screen.
|
|
@@ -3594,7 +3695,7 @@ declare namespace Electron {
|
|
|
3594
3695
|
|
|
3595
3696
|
interface PowerSaveBlocker extends EventEmitter {
|
|
3596
3697
|
|
|
3597
|
-
// Docs: http://
|
|
3698
|
+
// Docs: http://electronjs.org/docs/api/power-save-blocker
|
|
3598
3699
|
|
|
3599
3700
|
isStarted(id: number): boolean;
|
|
3600
3701
|
/**
|
|
@@ -3616,7 +3717,7 @@ declare namespace Electron {
|
|
|
3616
3717
|
|
|
3617
3718
|
interface PrinterInfo {
|
|
3618
3719
|
|
|
3619
|
-
// Docs: http://
|
|
3720
|
+
// Docs: http://electronjs.org/docs/api/structures/printer-info
|
|
3620
3721
|
|
|
3621
3722
|
description: string;
|
|
3622
3723
|
isDefault: boolean;
|
|
@@ -3626,16 +3727,12 @@ declare namespace Electron {
|
|
|
3626
3727
|
|
|
3627
3728
|
interface ProcessMetric {
|
|
3628
3729
|
|
|
3629
|
-
// Docs: http://
|
|
3730
|
+
// Docs: http://electronjs.org/docs/api/structures/process-metric
|
|
3630
3731
|
|
|
3631
3732
|
/**
|
|
3632
3733
|
* CPU usage of the process.
|
|
3633
3734
|
*/
|
|
3634
3735
|
cpu: CPUUsage;
|
|
3635
|
-
/**
|
|
3636
|
-
* Memory information for the process.
|
|
3637
|
-
*/
|
|
3638
|
-
memory: MemoryInfo;
|
|
3639
3736
|
/**
|
|
3640
3737
|
* Process id of the process.
|
|
3641
3738
|
*/
|
|
@@ -3648,7 +3745,7 @@ declare namespace Electron {
|
|
|
3648
3745
|
|
|
3649
3746
|
interface Product {
|
|
3650
3747
|
|
|
3651
|
-
// Docs: http://
|
|
3748
|
+
// Docs: http://electronjs.org/docs/api/structures/product
|
|
3652
3749
|
|
|
3653
3750
|
/**
|
|
3654
3751
|
* The total size of the content, in bytes.
|
|
@@ -3687,7 +3784,7 @@ declare namespace Electron {
|
|
|
3687
3784
|
|
|
3688
3785
|
interface Protocol extends EventEmitter {
|
|
3689
3786
|
|
|
3690
|
-
// Docs: http://
|
|
3787
|
+
// Docs: http://electronjs.org/docs/api/protocol
|
|
3691
3788
|
|
|
3692
3789
|
/**
|
|
3693
3790
|
* Intercepts scheme protocol and uses handler as the protocol's new handler which
|
|
@@ -3708,7 +3805,7 @@ declare namespace Electron {
|
|
|
3708
3805
|
* Same as protocol.registerStreamProtocol, except that it replaces an existing
|
|
3709
3806
|
* protocol handler.
|
|
3710
3807
|
*/
|
|
3711
|
-
interceptStreamProtocol(scheme: string, handler: (request: InterceptStreamProtocolRequest, callback: (stream?: ReadableStream | StreamProtocolResponse) => void) => void, completion?: (error: Error) => void): void;
|
|
3808
|
+
interceptStreamProtocol(scheme: string, handler: (request: InterceptStreamProtocolRequest, callback: (stream?: (NodeJS.ReadableStream) | (StreamProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
|
|
3712
3809
|
/**
|
|
3713
3810
|
* Intercepts scheme protocol and uses handler as the protocol's new handler which
|
|
3714
3811
|
* sends a String as a response.
|
|
@@ -3725,15 +3822,15 @@ declare namespace Electron {
|
|
|
3725
3822
|
* with either a Buffer object or an object that has the data, mimeType, and
|
|
3726
3823
|
* charset properties. Example:
|
|
3727
3824
|
*/
|
|
3728
|
-
registerBufferProtocol(scheme: string, handler: (request: RegisterBufferProtocolRequest, callback: (buffer?: Buffer | MimeTypedBuffer) => void) => void, completion?: (error: Error) => void): void;
|
|
3825
|
+
registerBufferProtocol(scheme: string, handler: (request: RegisterBufferProtocolRequest, callback: (buffer?: (Buffer) | (MimeTypedBuffer)) => void) => void, completion?: (error: Error) => void): void;
|
|
3729
3826
|
/**
|
|
3730
3827
|
* Registers a protocol of scheme that will send the file as a response. The
|
|
3731
3828
|
* handler will be called with handler(request, callback) when a request is going
|
|
3732
3829
|
* to be created with scheme. completion will be called with completion(null) when
|
|
3733
3830
|
* scheme is successfully registered or completion(error) when failed. To handle
|
|
3734
3831
|
* the request, the callback should be called with either the file's path or an
|
|
3735
|
-
* object that has a path property, e.g. callback(filePath) or callback({path:
|
|
3736
|
-
* filePath}). When callback is called with nothing, a number, or an object that
|
|
3832
|
+
* object that has a path property, e.g. callback(filePath) or callback({ path:
|
|
3833
|
+
* filePath }). When callback is called with nothing, a number, or an object that
|
|
3737
3834
|
* has an error property, the request will fail with the error number you
|
|
3738
3835
|
* specified. For the available error numbers you can use, please see the net error
|
|
3739
3836
|
* list. By default the scheme is treated like http:, which is parsed differently
|
|
@@ -3777,7 +3874,7 @@ declare namespace Electron {
|
|
|
3777
3874
|
* that implements the readable stream API (emits data/end/error events). For
|
|
3778
3875
|
* example, here's how a file could be returned:
|
|
3779
3876
|
*/
|
|
3780
|
-
registerStreamProtocol(scheme: string, handler: (request: RegisterStreamProtocolRequest, callback: (stream?: ReadableStream | StreamProtocolResponse) => void) => void, completion?: (error: Error) => void): void;
|
|
3877
|
+
registerStreamProtocol(scheme: string, handler: (request: RegisterStreamProtocolRequest, callback: (stream?: (NodeJS.ReadableStream) | (StreamProtocolResponse)) => void) => void, completion?: (error: Error) => void): void;
|
|
3781
3878
|
/**
|
|
3782
3879
|
* Registers a protocol of scheme that will send a String as a response. The usage
|
|
3783
3880
|
* is the same with registerFileProtocol, except that the callback should be called
|
|
@@ -3797,7 +3894,7 @@ declare namespace Electron {
|
|
|
3797
3894
|
|
|
3798
3895
|
interface Rectangle {
|
|
3799
3896
|
|
|
3800
|
-
// Docs: http://
|
|
3897
|
+
// Docs: http://electronjs.org/docs/api/structures/rectangle
|
|
3801
3898
|
|
|
3802
3899
|
/**
|
|
3803
3900
|
* The height of the rectangle (must be an integer).
|
|
@@ -3819,7 +3916,7 @@ declare namespace Electron {
|
|
|
3819
3916
|
|
|
3820
3917
|
interface Referrer {
|
|
3821
3918
|
|
|
3822
|
-
// Docs: http://
|
|
3919
|
+
// Docs: http://electronjs.org/docs/api/structures/referrer
|
|
3823
3920
|
|
|
3824
3921
|
/**
|
|
3825
3922
|
* Can be default, unsafe-url, no-referrer-when-downgrade, no-referrer, origin,
|
|
@@ -3835,7 +3932,7 @@ declare namespace Electron {
|
|
|
3835
3932
|
|
|
3836
3933
|
interface Remote extends MainInterface {
|
|
3837
3934
|
|
|
3838
|
-
// Docs: http://
|
|
3935
|
+
// Docs: http://electronjs.org/docs/api/remote
|
|
3839
3936
|
|
|
3840
3937
|
getCurrentWebContents(): WebContents;
|
|
3841
3938
|
/**
|
|
@@ -3858,7 +3955,7 @@ declare namespace Electron {
|
|
|
3858
3955
|
|
|
3859
3956
|
interface RemoveClientCertificate {
|
|
3860
3957
|
|
|
3861
|
-
// Docs: http://
|
|
3958
|
+
// Docs: http://electronjs.org/docs/api/structures/remove-client-certificate
|
|
3862
3959
|
|
|
3863
3960
|
/**
|
|
3864
3961
|
* Origin of the server whose associated client certificate must be removed from
|
|
@@ -3873,7 +3970,7 @@ declare namespace Electron {
|
|
|
3873
3970
|
|
|
3874
3971
|
interface RemovePassword {
|
|
3875
3972
|
|
|
3876
|
-
// Docs: http://
|
|
3973
|
+
// Docs: http://electronjs.org/docs/api/structures/remove-password
|
|
3877
3974
|
|
|
3878
3975
|
/**
|
|
3879
3976
|
* When provided, the authentication info related to the origin will only be
|
|
@@ -3905,7 +4002,7 @@ declare namespace Electron {
|
|
|
3905
4002
|
|
|
3906
4003
|
interface Screen extends EventEmitter {
|
|
3907
4004
|
|
|
3908
|
-
// Docs: http://
|
|
4005
|
+
// Docs: http://electronjs.org/docs/api/screen
|
|
3909
4006
|
|
|
3910
4007
|
/**
|
|
3911
4008
|
* Emitted when newDisplay has been added.
|
|
@@ -3956,7 +4053,7 @@ declare namespace Electron {
|
|
|
3956
4053
|
* relative to the display nearest to window. If window is null, scaling will be
|
|
3957
4054
|
* performed to the display nearest to rect.
|
|
3958
4055
|
*/
|
|
3959
|
-
dipToScreenRect(window: BrowserWindow | null, rect: Rectangle): Rectangle;
|
|
4056
|
+
dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
|
|
3960
4057
|
getAllDisplays(): Display[];
|
|
3961
4058
|
/**
|
|
3962
4059
|
* The current absolute position of the mouse pointer.
|
|
@@ -3975,12 +4072,12 @@ declare namespace Electron {
|
|
|
3975
4072
|
* relative to the display nearest to window. If window is null, scaling will be
|
|
3976
4073
|
* performed to the display nearest to rect.
|
|
3977
4074
|
*/
|
|
3978
|
-
screenToDipRect(window: BrowserWindow | null, rect: Rectangle): Rectangle;
|
|
4075
|
+
screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
|
|
3979
4076
|
}
|
|
3980
4077
|
|
|
3981
4078
|
interface ScrubberItem {
|
|
3982
4079
|
|
|
3983
|
-
// Docs: http://
|
|
4080
|
+
// Docs: http://electronjs.org/docs/api/structures/scrubber-item
|
|
3984
4081
|
|
|
3985
4082
|
/**
|
|
3986
4083
|
* The image to appear in this item.
|
|
@@ -3994,7 +4091,7 @@ declare namespace Electron {
|
|
|
3994
4091
|
|
|
3995
4092
|
interface SegmentedControlSegment {
|
|
3996
4093
|
|
|
3997
|
-
// Docs: http://
|
|
4094
|
+
// Docs: http://electronjs.org/docs/api/structures/segmented-control-segment
|
|
3998
4095
|
|
|
3999
4096
|
/**
|
|
4000
4097
|
* Whether this segment is selectable. Default: true.
|
|
@@ -4012,7 +4109,7 @@ declare namespace Electron {
|
|
|
4012
4109
|
|
|
4013
4110
|
class Session extends EventEmitter {
|
|
4014
4111
|
|
|
4015
|
-
// Docs: http://
|
|
4112
|
+
// Docs: http://electronjs.org/docs/api/session
|
|
4016
4113
|
|
|
4017
4114
|
/**
|
|
4018
4115
|
* If partition starts with persist:, the page will use a persistent session
|
|
@@ -4052,7 +4149,7 @@ declare namespace Electron {
|
|
|
4052
4149
|
/**
|
|
4053
4150
|
* Clears the session’s HTTP authentication cache.
|
|
4054
4151
|
*/
|
|
4055
|
-
clearAuthCache(options: RemovePassword | RemoveClientCertificate, callback?: Function): void;
|
|
4152
|
+
clearAuthCache(options: (RemovePassword) | (RemoveClientCertificate), callback?: Function): void;
|
|
4056
4153
|
/**
|
|
4057
4154
|
* Clears the session’s HTTP cache.
|
|
4058
4155
|
*/
|
|
@@ -4111,12 +4208,18 @@ declare namespace Electron {
|
|
|
4111
4208
|
* Downloads under the respective app folder.
|
|
4112
4209
|
*/
|
|
4113
4210
|
setDownloadPath(path: string): void;
|
|
4211
|
+
/**
|
|
4212
|
+
* Sets the handler which can be used to respond to permission checks for the
|
|
4213
|
+
* session. Returning true will allow the permission and false will reject it. To
|
|
4214
|
+
* clear the handler, call setPermissionCheckHandler(null).
|
|
4215
|
+
*/
|
|
4216
|
+
setPermissionCheckHandler(handler: ((webContents: WebContents, permission: string, requestingOrigin: string, details: PermissionCheckHandlerDetails) => boolean) | (null)): void;
|
|
4114
4217
|
/**
|
|
4115
4218
|
* Sets the handler which can be used to respond to permission requests for the
|
|
4116
4219
|
* session. Calling callback(true) will allow the permission and callback(false)
|
|
4117
4220
|
* will reject it. To clear the handler, call setPermissionRequestHandler(null).
|
|
4118
4221
|
*/
|
|
4119
|
-
setPermissionRequestHandler(handler: (webContents: WebContents, permission: string, callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerDetails) => void | null): void;
|
|
4222
|
+
setPermissionRequestHandler(handler: ((webContents: WebContents, permission: string, callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerDetails) => void) | (null)): void;
|
|
4120
4223
|
/**
|
|
4121
4224
|
* Adds scripts that will be executed on ALL web contents that are associated with
|
|
4122
4225
|
* this session just before normal preload scripts run.
|
|
@@ -4138,13 +4241,14 @@ declare namespace Electron {
|
|
|
4138
4241
|
*/
|
|
4139
4242
|
setUserAgent(userAgent: string, acceptLanguages?: string): void;
|
|
4140
4243
|
cookies: Cookies;
|
|
4244
|
+
netLog: NetLog;
|
|
4141
4245
|
protocol: Protocol;
|
|
4142
4246
|
webRequest: WebRequest;
|
|
4143
4247
|
}
|
|
4144
4248
|
|
|
4145
4249
|
interface Shell {
|
|
4146
4250
|
|
|
4147
|
-
// Docs: http://
|
|
4251
|
+
// Docs: http://electronjs.org/docs/api/shell
|
|
4148
4252
|
|
|
4149
4253
|
/**
|
|
4150
4254
|
* Play the beep sound.
|
|
@@ -4184,7 +4288,7 @@ declare namespace Electron {
|
|
|
4184
4288
|
|
|
4185
4289
|
interface ShortcutDetails {
|
|
4186
4290
|
|
|
4187
|
-
// Docs: http://
|
|
4291
|
+
// Docs: http://electronjs.org/docs/api/structures/shortcut-details
|
|
4188
4292
|
|
|
4189
4293
|
/**
|
|
4190
4294
|
* The Application User Model ID. Default is empty.
|
|
@@ -4220,7 +4324,7 @@ declare namespace Electron {
|
|
|
4220
4324
|
|
|
4221
4325
|
interface Size {
|
|
4222
4326
|
|
|
4223
|
-
// Docs: http://
|
|
4327
|
+
// Docs: http://electronjs.org/docs/api/structures/size
|
|
4224
4328
|
|
|
4225
4329
|
height: number;
|
|
4226
4330
|
width: number;
|
|
@@ -4228,12 +4332,12 @@ declare namespace Electron {
|
|
|
4228
4332
|
|
|
4229
4333
|
interface StreamProtocolResponse {
|
|
4230
4334
|
|
|
4231
|
-
// Docs: http://
|
|
4335
|
+
// Docs: http://electronjs.org/docs/api/structures/stream-protocol-response
|
|
4232
4336
|
|
|
4233
4337
|
/**
|
|
4234
4338
|
* A Node.js readable stream representing the response body.
|
|
4235
4339
|
*/
|
|
4236
|
-
data: ReadableStream;
|
|
4340
|
+
data: NodeJS.ReadableStream;
|
|
4237
4341
|
/**
|
|
4238
4342
|
* An object containing the response headers.
|
|
4239
4343
|
*/
|
|
@@ -4246,7 +4350,7 @@ declare namespace Electron {
|
|
|
4246
4350
|
|
|
4247
4351
|
interface SystemPreferences extends EventEmitter {
|
|
4248
4352
|
|
|
4249
|
-
// Docs: http://
|
|
4353
|
+
// Docs: http://electronjs.org/docs/api/system-preferences
|
|
4250
4354
|
|
|
4251
4355
|
on(event: 'accent-color-changed', listener: (event: Event,
|
|
4252
4356
|
/**
|
|
@@ -4268,6 +4372,30 @@ declare namespace Electron {
|
|
|
4268
4372
|
* The new RGBA color the user assigned to be their system accent color.
|
|
4269
4373
|
*/
|
|
4270
4374
|
newColor: string) => void): this;
|
|
4375
|
+
/**
|
|
4376
|
+
* NOTE: This event is only emitted after you have called
|
|
4377
|
+
* startAppLevelAppearanceTrackingOS
|
|
4378
|
+
*/
|
|
4379
|
+
on(event: 'appearance-changed', listener: (
|
|
4380
|
+
/**
|
|
4381
|
+
* Can be `dark` or `light`
|
|
4382
|
+
*/
|
|
4383
|
+
newAppearance: ('dark' | 'light')) => void): this;
|
|
4384
|
+
once(event: 'appearance-changed', listener: (
|
|
4385
|
+
/**
|
|
4386
|
+
* Can be `dark` or `light`
|
|
4387
|
+
*/
|
|
4388
|
+
newAppearance: ('dark' | 'light')) => void): this;
|
|
4389
|
+
addListener(event: 'appearance-changed', listener: (
|
|
4390
|
+
/**
|
|
4391
|
+
* Can be `dark` or `light`
|
|
4392
|
+
*/
|
|
4393
|
+
newAppearance: ('dark' | 'light')) => void): this;
|
|
4394
|
+
removeListener(event: 'appearance-changed', listener: (
|
|
4395
|
+
/**
|
|
4396
|
+
* Can be `dark` or `light`
|
|
4397
|
+
*/
|
|
4398
|
+
newAppearance: ('dark' | 'light')) => void): this;
|
|
4271
4399
|
on(event: 'color-changed', listener: (event: Event) => void): this;
|
|
4272
4400
|
once(event: 'color-changed', listener: (event: Event) => void): this;
|
|
4273
4401
|
addListener(event: 'color-changed', listener: (event: Event) => void): this;
|
|
@@ -4296,8 +4424,41 @@ declare namespace Electron {
|
|
|
4296
4424
|
* used, `false` otherwise.
|
|
4297
4425
|
*/
|
|
4298
4426
|
invertedColorScheme: boolean) => void): this;
|
|
4427
|
+
/**
|
|
4428
|
+
* Important: In order to properly leverage this API, you must set the
|
|
4429
|
+
* NSMicrophoneUsageDescription and NSCameraUsageDescription strings in your app's
|
|
4430
|
+
* Info.plist file. The values for these keys will be used to populate the
|
|
4431
|
+
* permission dialogs so that the user will be properly informed as to the purpose
|
|
4432
|
+
* of the permission request. See Electron Application Distribution for more
|
|
4433
|
+
* information about how to set these in the context of Electron. This user consent
|
|
4434
|
+
* was not required until macOS 10.14 Mojave, so this method will always return
|
|
4435
|
+
* true if your system is running 10.13 High Sierra or lower.
|
|
4436
|
+
*/
|
|
4437
|
+
askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise<Boolean>;
|
|
4299
4438
|
getAccentColor(): string;
|
|
4439
|
+
/**
|
|
4440
|
+
* Gets the macOS appearance setting that you have declared you want for your
|
|
4441
|
+
* application, maps to NSApplication.appearance. You can use the
|
|
4442
|
+
* setAppLevelAppearance API to set this value.
|
|
4443
|
+
*/
|
|
4444
|
+
getAppLevelAppearance(): ('dark' | 'light' | 'unknown');
|
|
4300
4445
|
getColor(color: '3d-dark-shadow' | '3d-face' | '3d-highlight' | '3d-light' | '3d-shadow' | 'active-border' | 'active-caption' | 'active-caption-gradient' | 'app-workspace' | 'button-text' | 'caption-text' | 'desktop' | 'disabled-text' | 'highlight' | 'highlight-text' | 'hotlight' | 'inactive-border' | 'inactive-caption' | 'inactive-caption-gradient' | 'inactive-caption-text' | 'info-background' | 'info-text' | 'menu' | 'menu-highlight' | 'menubar' | 'menu-text' | 'scrollbar' | 'window' | 'window-frame' | 'window-text'): string;
|
|
4446
|
+
/**
|
|
4447
|
+
* Gets the macOS appearance setting that is currently applied to your application,
|
|
4448
|
+
* maps to NSApplication.effectiveAppearance Please note that until Electron is
|
|
4449
|
+
* built targeting the 10.14 SDK, your application's effectiveAppearance will
|
|
4450
|
+
* default to 'light' and won't inherit the OS preference. In the interim in order
|
|
4451
|
+
* for your application to inherit the OS preference you must set the
|
|
4452
|
+
* NSRequiresAquaSystemAppearance key in your apps Info.plist to false. If you are
|
|
4453
|
+
* using electron-packager or electron-forge just set the enableDarwinDarkMode
|
|
4454
|
+
* packager option to true. See the Electron Packager API for more details.
|
|
4455
|
+
*/
|
|
4456
|
+
getEffectiveAppearance(): ('dark' | 'light' | 'unknown');
|
|
4457
|
+
/**
|
|
4458
|
+
* This user consent was not required until macOS 10.14 Mojave, so this method will
|
|
4459
|
+
* always return granted if your system is running 10.13 High Sierra or lower.
|
|
4460
|
+
*/
|
|
4461
|
+
getMediaAccessStatus(mediaType: string): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown');
|
|
4301
4462
|
/**
|
|
4302
4463
|
* Some popular key and types are:
|
|
4303
4464
|
*/
|
|
@@ -4334,6 +4495,11 @@ declare namespace Electron {
|
|
|
4334
4495
|
* global value of a key previously set with setUserDefault.
|
|
4335
4496
|
*/
|
|
4336
4497
|
removeUserDefault(key: string): void;
|
|
4498
|
+
/**
|
|
4499
|
+
* Sets the appearance setting for your application, this should override the
|
|
4500
|
+
* system default and override the value of getEffectiveAppearance.
|
|
4501
|
+
*/
|
|
4502
|
+
setAppLevelAppearance(appearance: 'dark' | 'light'): void;
|
|
4337
4503
|
/**
|
|
4338
4504
|
* Set the value of key in NSUserDefaults. Note that type should match actual type
|
|
4339
4505
|
* of value. An exception is thrown if they don't. Some popular key and types are:
|
|
@@ -4343,7 +4509,7 @@ declare namespace Electron {
|
|
|
4343
4509
|
* Same as subscribeNotification, but uses NSNotificationCenter for local defaults.
|
|
4344
4510
|
* This is necessary for events such as NSUserDefaultsDidChangeNotification.
|
|
4345
4511
|
*/
|
|
4346
|
-
subscribeLocalNotification(event: string, callback: (event: string, userInfo: any) => void):
|
|
4512
|
+
subscribeLocalNotification(event: string, callback: (event: string, userInfo: any) => void): number;
|
|
4347
4513
|
/**
|
|
4348
4514
|
* Subscribes to native notifications of macOS, callback will be called with
|
|
4349
4515
|
* callback(event, userInfo) when the corresponding event happens. The userInfo is
|
|
@@ -4352,7 +4518,7 @@ declare namespace Electron {
|
|
|
4352
4518
|
* unsubscribe the event. Under the hood this API subscribes to
|
|
4353
4519
|
* NSDistributedNotificationCenter, example values of event are:
|
|
4354
4520
|
*/
|
|
4355
|
-
subscribeNotification(event: string, callback: (event: string, userInfo: any) => void):
|
|
4521
|
+
subscribeNotification(event: string, callback: (event: string, userInfo: any) => void): number;
|
|
4356
4522
|
/**
|
|
4357
4523
|
* Same as subscribeNotification, but uses
|
|
4358
4524
|
* NSWorkspace.sharedWorkspace.notificationCenter. This is necessary for events
|
|
@@ -4377,7 +4543,7 @@ declare namespace Electron {
|
|
|
4377
4543
|
|
|
4378
4544
|
interface Task {
|
|
4379
4545
|
|
|
4380
|
-
// Docs: http://
|
|
4546
|
+
// Docs: http://electronjs.org/docs/api/structures/task
|
|
4381
4547
|
|
|
4382
4548
|
/**
|
|
4383
4549
|
* The command line arguments when program is executed.
|
|
@@ -4412,7 +4578,7 @@ declare namespace Electron {
|
|
|
4412
4578
|
|
|
4413
4579
|
interface ThumbarButton {
|
|
4414
4580
|
|
|
4415
|
-
// Docs: http://
|
|
4581
|
+
// Docs: http://electronjs.org/docs/api/structures/thumbar-button
|
|
4416
4582
|
|
|
4417
4583
|
click: Function;
|
|
4418
4584
|
/**
|
|
@@ -4432,7 +4598,7 @@ declare namespace Electron {
|
|
|
4432
4598
|
|
|
4433
4599
|
class TouchBarButton extends EventEmitter {
|
|
4434
4600
|
|
|
4435
|
-
// Docs: http://
|
|
4601
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-button
|
|
4436
4602
|
|
|
4437
4603
|
constructor(options: TouchBarButtonConstructorOptions);
|
|
4438
4604
|
backgroundColor: string;
|
|
@@ -4442,7 +4608,7 @@ declare namespace Electron {
|
|
|
4442
4608
|
|
|
4443
4609
|
class TouchBarColorPicker extends EventEmitter {
|
|
4444
4610
|
|
|
4445
|
-
// Docs: http://
|
|
4611
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-color-picker
|
|
4446
4612
|
|
|
4447
4613
|
constructor(options: TouchBarColorPickerConstructorOptions);
|
|
4448
4614
|
availableColors: string[];
|
|
@@ -4451,14 +4617,14 @@ declare namespace Electron {
|
|
|
4451
4617
|
|
|
4452
4618
|
class TouchBarGroup extends EventEmitter {
|
|
4453
4619
|
|
|
4454
|
-
// Docs: http://
|
|
4620
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-group
|
|
4455
4621
|
|
|
4456
4622
|
constructor(options: TouchBarGroupConstructorOptions);
|
|
4457
4623
|
}
|
|
4458
4624
|
|
|
4459
4625
|
class TouchBarLabel extends EventEmitter {
|
|
4460
4626
|
|
|
4461
|
-
// Docs: http://
|
|
4627
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-label
|
|
4462
4628
|
|
|
4463
4629
|
constructor(options: TouchBarLabelConstructorOptions);
|
|
4464
4630
|
label: string;
|
|
@@ -4467,7 +4633,7 @@ declare namespace Electron {
|
|
|
4467
4633
|
|
|
4468
4634
|
class TouchBarPopover extends EventEmitter {
|
|
4469
4635
|
|
|
4470
|
-
// Docs: http://
|
|
4636
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-popover
|
|
4471
4637
|
|
|
4472
4638
|
constructor(options: TouchBarPopoverConstructorOptions);
|
|
4473
4639
|
icon: NativeImage;
|
|
@@ -4476,7 +4642,7 @@ declare namespace Electron {
|
|
|
4476
4642
|
|
|
4477
4643
|
class TouchBarScrubber extends EventEmitter {
|
|
4478
4644
|
|
|
4479
|
-
// Docs: http://
|
|
4645
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-scrubber
|
|
4480
4646
|
|
|
4481
4647
|
constructor(options: TouchBarScrubberConstructorOptions);
|
|
4482
4648
|
continuous: boolean;
|
|
@@ -4489,7 +4655,7 @@ declare namespace Electron {
|
|
|
4489
4655
|
|
|
4490
4656
|
class TouchBarSegmentedControl extends EventEmitter {
|
|
4491
4657
|
|
|
4492
|
-
// Docs: http://
|
|
4658
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-segmented-control
|
|
4493
4659
|
|
|
4494
4660
|
constructor(options: TouchBarSegmentedControlConstructorOptions);
|
|
4495
4661
|
segments: SegmentedControlSegment[];
|
|
@@ -4499,7 +4665,7 @@ declare namespace Electron {
|
|
|
4499
4665
|
|
|
4500
4666
|
class TouchBarSlider extends EventEmitter {
|
|
4501
4667
|
|
|
4502
|
-
// Docs: http://
|
|
4668
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-slider
|
|
4503
4669
|
|
|
4504
4670
|
constructor(options: TouchBarSliderConstructorOptions);
|
|
4505
4671
|
label: string;
|
|
@@ -4510,14 +4676,14 @@ declare namespace Electron {
|
|
|
4510
4676
|
|
|
4511
4677
|
class TouchBarSpacer extends EventEmitter {
|
|
4512
4678
|
|
|
4513
|
-
// Docs: http://
|
|
4679
|
+
// Docs: http://electronjs.org/docs/api/touch-bar-spacer
|
|
4514
4680
|
|
|
4515
4681
|
constructor(options: TouchBarSpacerConstructorOptions);
|
|
4516
4682
|
}
|
|
4517
4683
|
|
|
4518
4684
|
class TouchBar extends EventEmitter {
|
|
4519
4685
|
|
|
4520
|
-
// Docs: http://
|
|
4686
|
+
// Docs: http://electronjs.org/docs/api/touch-bar
|
|
4521
4687
|
|
|
4522
4688
|
constructor(options: TouchBarConstructorOptions);
|
|
4523
4689
|
escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null);
|
|
@@ -4534,7 +4700,7 @@ declare namespace Electron {
|
|
|
4534
4700
|
|
|
4535
4701
|
interface Transaction {
|
|
4536
4702
|
|
|
4537
|
-
// Docs: http://
|
|
4703
|
+
// Docs: http://electronjs.org/docs/api/structures/transaction
|
|
4538
4704
|
|
|
4539
4705
|
/**
|
|
4540
4706
|
* The error code if an error occurred while processing the transaction.
|
|
@@ -4566,7 +4732,7 @@ declare namespace Electron {
|
|
|
4566
4732
|
|
|
4567
4733
|
class Tray extends EventEmitter {
|
|
4568
4734
|
|
|
4569
|
-
// Docs: http://
|
|
4735
|
+
// Docs: http://electronjs.org/docs/api/tray
|
|
4570
4736
|
|
|
4571
4737
|
/**
|
|
4572
4738
|
* Emitted when the tray balloon is clicked.
|
|
@@ -4818,7 +4984,7 @@ declare namespace Electron {
|
|
|
4818
4984
|
* The bounds of tray icon.
|
|
4819
4985
|
*/
|
|
4820
4986
|
bounds: Rectangle) => void): this;
|
|
4821
|
-
constructor(image: NativeImage | string);
|
|
4987
|
+
constructor(image: (NativeImage) | (string));
|
|
4822
4988
|
/**
|
|
4823
4989
|
* Destroys the tray icon immediately.
|
|
4824
4990
|
*/
|
|
@@ -4842,7 +5008,7 @@ declare namespace Electron {
|
|
|
4842
5008
|
/**
|
|
4843
5009
|
* Sets the context menu for this icon.
|
|
4844
5010
|
*/
|
|
4845
|
-
setContextMenu(menu: Menu): void;
|
|
5011
|
+
setContextMenu(menu: (Menu) | (null)): void;
|
|
4846
5012
|
/**
|
|
4847
5013
|
* Sets when the tray's icon background becomes highlighted (in blue). Note: You
|
|
4848
5014
|
* can use highlightMode with a BrowserWindow by toggling between 'never' and
|
|
@@ -4858,11 +5024,11 @@ declare namespace Electron {
|
|
|
4858
5024
|
/**
|
|
4859
5025
|
* Sets the image associated with this tray icon.
|
|
4860
5026
|
*/
|
|
4861
|
-
setImage(image: NativeImage | string): void;
|
|
5027
|
+
setImage(image: (NativeImage) | (string)): void;
|
|
4862
5028
|
/**
|
|
4863
5029
|
* Sets the image associated with this tray icon when pressed on macOS.
|
|
4864
5030
|
*/
|
|
4865
|
-
setPressedImage(image: NativeImage | string): void;
|
|
5031
|
+
setPressedImage(image: (NativeImage) | (string)): void;
|
|
4866
5032
|
/**
|
|
4867
5033
|
* Sets the title displayed aside of the tray icon in the status bar (Support ANSI
|
|
4868
5034
|
* colors).
|
|
@@ -4876,7 +5042,7 @@ declare namespace Electron {
|
|
|
4876
5042
|
|
|
4877
5043
|
interface UploadBlob {
|
|
4878
5044
|
|
|
4879
|
-
// Docs: http://
|
|
5045
|
+
// Docs: http://electronjs.org/docs/api/structures/upload-blob
|
|
4880
5046
|
|
|
4881
5047
|
/**
|
|
4882
5048
|
* UUID of blob data to upload.
|
|
@@ -4890,7 +5056,7 @@ declare namespace Electron {
|
|
|
4890
5056
|
|
|
4891
5057
|
interface UploadData {
|
|
4892
5058
|
|
|
4893
|
-
// Docs: http://
|
|
5059
|
+
// Docs: http://electronjs.org/docs/api/structures/upload-data
|
|
4894
5060
|
|
|
4895
5061
|
/**
|
|
4896
5062
|
* UUID of blob data. Use method to retrieve the data.
|
|
@@ -4908,7 +5074,7 @@ declare namespace Electron {
|
|
|
4908
5074
|
|
|
4909
5075
|
interface UploadFile {
|
|
4910
5076
|
|
|
4911
|
-
// Docs: http://
|
|
5077
|
+
// Docs: http://electronjs.org/docs/api/structures/upload-file
|
|
4912
5078
|
|
|
4913
5079
|
/**
|
|
4914
5080
|
* Path of file to be uploaded.
|
|
@@ -4934,7 +5100,7 @@ declare namespace Electron {
|
|
|
4934
5100
|
|
|
4935
5101
|
interface UploadRawData {
|
|
4936
5102
|
|
|
4937
|
-
// Docs: http://
|
|
5103
|
+
// Docs: http://electronjs.org/docs/api/structures/upload-raw-data
|
|
4938
5104
|
|
|
4939
5105
|
/**
|
|
4940
5106
|
* Data to be uploaded.
|
|
@@ -4948,7 +5114,7 @@ declare namespace Electron {
|
|
|
4948
5114
|
|
|
4949
5115
|
class WebContents extends EventEmitter {
|
|
4950
5116
|
|
|
4951
|
-
// Docs: http://
|
|
5117
|
+
// Docs: http://electronjs.org/docs/api/web-contents
|
|
4952
5118
|
|
|
4953
5119
|
static fromId(id: number): WebContents;
|
|
4954
5120
|
static getAllWebContents(): WebContents[];
|
|
@@ -5172,22 +5338,22 @@ declare namespace Electron {
|
|
|
5172
5338
|
*/
|
|
5173
5339
|
on(event: 'did-attach-webview', listener: (event: Event,
|
|
5174
5340
|
/**
|
|
5175
|
-
* The guest web contents that is used by the
|
|
5341
|
+
* The guest web contents that is used by the `
|
|
5176
5342
|
*/
|
|
5177
5343
|
webContents: WebContents) => void): this;
|
|
5178
5344
|
once(event: 'did-attach-webview', listener: (event: Event,
|
|
5179
5345
|
/**
|
|
5180
|
-
* The guest web contents that is used by the
|
|
5346
|
+
* The guest web contents that is used by the `
|
|
5181
5347
|
*/
|
|
5182
5348
|
webContents: WebContents) => void): this;
|
|
5183
5349
|
addListener(event: 'did-attach-webview', listener: (event: Event,
|
|
5184
5350
|
/**
|
|
5185
|
-
* The guest web contents that is used by the
|
|
5351
|
+
* The guest web contents that is used by the `
|
|
5186
5352
|
*/
|
|
5187
5353
|
webContents: WebContents) => void): this;
|
|
5188
5354
|
removeListener(event: 'did-attach-webview', listener: (event: Event,
|
|
5189
5355
|
/**
|
|
5190
|
-
* The guest web contents that is used by the
|
|
5356
|
+
* The guest web contents that is used by the `
|
|
5191
5357
|
*/
|
|
5192
5358
|
webContents: WebContents) => void): this;
|
|
5193
5359
|
/**
|
|
@@ -5198,22 +5364,22 @@ declare namespace Electron {
|
|
|
5198
5364
|
/**
|
|
5199
5365
|
* Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
|
5200
5366
|
*/
|
|
5201
|
-
color: string | null) => void): this;
|
|
5367
|
+
color: (string) | (null)) => void): this;
|
|
5202
5368
|
once(event: 'did-change-theme-color', listener: (event: Event,
|
|
5203
5369
|
/**
|
|
5204
5370
|
* Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
|
5205
5371
|
*/
|
|
5206
|
-
color: string | null) => void): this;
|
|
5372
|
+
color: (string) | (null)) => void): this;
|
|
5207
5373
|
addListener(event: 'did-change-theme-color', listener: (event: Event,
|
|
5208
5374
|
/**
|
|
5209
5375
|
* Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
|
5210
5376
|
*/
|
|
5211
|
-
color: string | null) => void): this;
|
|
5377
|
+
color: (string) | (null)) => void): this;
|
|
5212
5378
|
removeListener(event: 'did-change-theme-color', listener: (event: Event,
|
|
5213
5379
|
/**
|
|
5214
5380
|
* Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
|
5215
5381
|
*/
|
|
5216
|
-
color: string | null) => void): this;
|
|
5382
|
+
color: (string) | (null)) => void): this;
|
|
5217
5383
|
/**
|
|
5218
5384
|
* This event is like did-finish-load but emitted when the load failed or was
|
|
5219
5385
|
* cancelled, e.g. window.stop() is invoked. The full list of error codes and their
|
|
@@ -5402,6 +5568,35 @@ declare namespace Electron {
|
|
|
5402
5568
|
isMainFrame: boolean,
|
|
5403
5569
|
frameProcessId: number,
|
|
5404
5570
|
frameRoutingId: number) => void): this;
|
|
5571
|
+
/**
|
|
5572
|
+
* Emitted after a server side redirect occurs during navigation. For example a
|
|
5573
|
+
* 302 redirect. This event can not be prevented, if you want to prevent redirects
|
|
5574
|
+
* you should checkout out the will-redirect event above.
|
|
5575
|
+
*/
|
|
5576
|
+
on(event: 'did-redirect-navigation', listener: (event: Event,
|
|
5577
|
+
url: string,
|
|
5578
|
+
isInPlace: boolean,
|
|
5579
|
+
isMainFrame: boolean,
|
|
5580
|
+
frameProcessId: number,
|
|
5581
|
+
frameRoutingId: number) => void): this;
|
|
5582
|
+
once(event: 'did-redirect-navigation', listener: (event: Event,
|
|
5583
|
+
url: string,
|
|
5584
|
+
isInPlace: boolean,
|
|
5585
|
+
isMainFrame: boolean,
|
|
5586
|
+
frameProcessId: number,
|
|
5587
|
+
frameRoutingId: number) => void): this;
|
|
5588
|
+
addListener(event: 'did-redirect-navigation', listener: (event: Event,
|
|
5589
|
+
url: string,
|
|
5590
|
+
isInPlace: boolean,
|
|
5591
|
+
isMainFrame: boolean,
|
|
5592
|
+
frameProcessId: number,
|
|
5593
|
+
frameRoutingId: number) => void): this;
|
|
5594
|
+
removeListener(event: 'did-redirect-navigation', listener: (event: Event,
|
|
5595
|
+
url: string,
|
|
5596
|
+
isInPlace: boolean,
|
|
5597
|
+
isMainFrame: boolean,
|
|
5598
|
+
frameProcessId: number,
|
|
5599
|
+
frameRoutingId: number) => void): this;
|
|
5405
5600
|
/**
|
|
5406
5601
|
* Corresponds to the points in time when the spinner of the tab started spinning.
|
|
5407
5602
|
*/
|
|
@@ -5413,22 +5608,26 @@ declare namespace Electron {
|
|
|
5413
5608
|
* Emitted when any frame (including main) starts navigating. isInplace will be
|
|
5414
5609
|
* true for in-page navigations.
|
|
5415
5610
|
*/
|
|
5416
|
-
on(event: 'did-start-navigation', listener: (
|
|
5611
|
+
on(event: 'did-start-navigation', listener: (event: Event,
|
|
5612
|
+
url: string,
|
|
5417
5613
|
isInPlace: boolean,
|
|
5418
5614
|
isMainFrame: boolean,
|
|
5419
5615
|
frameProcessId: number,
|
|
5420
5616
|
frameRoutingId: number) => void): this;
|
|
5421
|
-
once(event: 'did-start-navigation', listener: (
|
|
5617
|
+
once(event: 'did-start-navigation', listener: (event: Event,
|
|
5618
|
+
url: string,
|
|
5422
5619
|
isInPlace: boolean,
|
|
5423
5620
|
isMainFrame: boolean,
|
|
5424
5621
|
frameProcessId: number,
|
|
5425
5622
|
frameRoutingId: number) => void): this;
|
|
5426
|
-
addListener(event: 'did-start-navigation', listener: (
|
|
5623
|
+
addListener(event: 'did-start-navigation', listener: (event: Event,
|
|
5624
|
+
url: string,
|
|
5427
5625
|
isInPlace: boolean,
|
|
5428
5626
|
isMainFrame: boolean,
|
|
5429
5627
|
frameProcessId: number,
|
|
5430
5628
|
frameRoutingId: number) => void): this;
|
|
5431
|
-
removeListener(event: 'did-start-navigation', listener: (
|
|
5629
|
+
removeListener(event: 'did-start-navigation', listener: (event: Event,
|
|
5630
|
+
url: string,
|
|
5432
5631
|
isInPlace: boolean,
|
|
5433
5632
|
isMainFrame: boolean,
|
|
5434
5633
|
frameProcessId: number,
|
|
@@ -5656,6 +5855,32 @@ declare namespace Electron {
|
|
|
5656
5855
|
removeListener(event: 'plugin-crashed', listener: (event: Event,
|
|
5657
5856
|
name: string,
|
|
5658
5857
|
version: string) => void): this;
|
|
5858
|
+
/**
|
|
5859
|
+
* Emitted when remote.getGlobal() is called in the renderer process. Calling
|
|
5860
|
+
* event.preventDefault() will prevent the global from being returned. Custom value
|
|
5861
|
+
* can be returned by setting event.returnValue.
|
|
5862
|
+
*/
|
|
5863
|
+
on(event: 'remote-get-global', listener: (event: Event,
|
|
5864
|
+
globalName: string) => void): this;
|
|
5865
|
+
once(event: 'remote-get-global', listener: (event: Event,
|
|
5866
|
+
globalName: string) => void): this;
|
|
5867
|
+
addListener(event: 'remote-get-global', listener: (event: Event,
|
|
5868
|
+
globalName: string) => void): this;
|
|
5869
|
+
removeListener(event: 'remote-get-global', listener: (event: Event,
|
|
5870
|
+
globalName: string) => void): this;
|
|
5871
|
+
/**
|
|
5872
|
+
* Emitted when remote.require() is called in the renderer process. Calling
|
|
5873
|
+
* event.preventDefault() will prevent the module from being returned. Custom value
|
|
5874
|
+
* can be returned by setting event.returnValue.
|
|
5875
|
+
*/
|
|
5876
|
+
on(event: 'remote-require', listener: (event: Event,
|
|
5877
|
+
moduleName: string) => void): this;
|
|
5878
|
+
once(event: 'remote-require', listener: (event: Event,
|
|
5879
|
+
moduleName: string) => void): this;
|
|
5880
|
+
addListener(event: 'remote-require', listener: (event: Event,
|
|
5881
|
+
moduleName: string) => void): this;
|
|
5882
|
+
removeListener(event: 'remote-require', listener: (event: Event,
|
|
5883
|
+
moduleName: string) => void): this;
|
|
5659
5884
|
/**
|
|
5660
5885
|
* Emitted when the unresponsive web page becomes responsive again.
|
|
5661
5886
|
*/
|
|
@@ -5735,8 +5960,7 @@ declare namespace Electron {
|
|
|
5735
5960
|
*/
|
|
5736
5961
|
webPreferences: any,
|
|
5737
5962
|
/**
|
|
5738
|
-
* The other
|
|
5739
|
-
* modified to adjust the parameters of the guest page.
|
|
5963
|
+
* The other `
|
|
5740
5964
|
*/
|
|
5741
5965
|
params: any) => void): this;
|
|
5742
5966
|
once(event: 'will-attach-webview', listener: (event: Event,
|
|
@@ -5746,8 +5970,7 @@ declare namespace Electron {
|
|
|
5746
5970
|
*/
|
|
5747
5971
|
webPreferences: any,
|
|
5748
5972
|
/**
|
|
5749
|
-
* The other
|
|
5750
|
-
* modified to adjust the parameters of the guest page.
|
|
5973
|
+
* The other `
|
|
5751
5974
|
*/
|
|
5752
5975
|
params: any) => void): this;
|
|
5753
5976
|
addListener(event: 'will-attach-webview', listener: (event: Event,
|
|
@@ -5757,8 +5980,7 @@ declare namespace Electron {
|
|
|
5757
5980
|
*/
|
|
5758
5981
|
webPreferences: any,
|
|
5759
5982
|
/**
|
|
5760
|
-
* The other
|
|
5761
|
-
* modified to adjust the parameters of the guest page.
|
|
5983
|
+
* The other `
|
|
5762
5984
|
*/
|
|
5763
5985
|
params: any) => void): this;
|
|
5764
5986
|
removeListener(event: 'will-attach-webview', listener: (event: Event,
|
|
@@ -5768,8 +5990,7 @@ declare namespace Electron {
|
|
|
5768
5990
|
*/
|
|
5769
5991
|
webPreferences: any,
|
|
5770
5992
|
/**
|
|
5771
|
-
* The other
|
|
5772
|
-
* modified to adjust the parameters of the guest page.
|
|
5993
|
+
* The other `
|
|
5773
5994
|
*/
|
|
5774
5995
|
params: any) => void): this;
|
|
5775
5996
|
/**
|
|
@@ -5798,6 +6019,36 @@ declare namespace Electron {
|
|
|
5798
6019
|
once(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
|
5799
6020
|
addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
|
5800
6021
|
removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
|
6022
|
+
/**
|
|
6023
|
+
* Emitted as a server side redirect occurs during navigation. For example a 302
|
|
6024
|
+
* redirect. This event will be emitted after did-start-navigation and always
|
|
6025
|
+
* before the did-redirect-navigation event for the same navigation. Calling
|
|
6026
|
+
* event.preventDefault() will prevent the navigation (not just the redirect).
|
|
6027
|
+
*/
|
|
6028
|
+
on(event: 'will-redirect', listener: (event: Event,
|
|
6029
|
+
url: string,
|
|
6030
|
+
isInPlace: boolean,
|
|
6031
|
+
isMainFrame: boolean,
|
|
6032
|
+
frameProcessId: number,
|
|
6033
|
+
frameRoutingId: number) => void): this;
|
|
6034
|
+
once(event: 'will-redirect', listener: (event: Event,
|
|
6035
|
+
url: string,
|
|
6036
|
+
isInPlace: boolean,
|
|
6037
|
+
isMainFrame: boolean,
|
|
6038
|
+
frameProcessId: number,
|
|
6039
|
+
frameRoutingId: number) => void): this;
|
|
6040
|
+
addListener(event: 'will-redirect', listener: (event: Event,
|
|
6041
|
+
url: string,
|
|
6042
|
+
isInPlace: boolean,
|
|
6043
|
+
isMainFrame: boolean,
|
|
6044
|
+
frameProcessId: number,
|
|
6045
|
+
frameRoutingId: number) => void): this;
|
|
6046
|
+
removeListener(event: 'will-redirect', listener: (event: Event,
|
|
6047
|
+
url: string,
|
|
6048
|
+
isInPlace: boolean,
|
|
6049
|
+
isMainFrame: boolean,
|
|
6050
|
+
frameProcessId: number,
|
|
6051
|
+
frameRoutingId: number) => void): this;
|
|
5801
6052
|
/**
|
|
5802
6053
|
* Adds the specified path to DevTools workspace. Must be used after DevTools
|
|
5803
6054
|
* creation:
|
|
@@ -5976,7 +6227,7 @@ declare namespace Electron {
|
|
|
5976
6227
|
* relative to the root of your application. For instance an app structure like
|
|
5977
6228
|
* this: Would require code like this
|
|
5978
6229
|
*/
|
|
5979
|
-
loadFile(filePath: string): void;
|
|
6230
|
+
loadFile(filePath: string, options?: LoadFileOptions): void;
|
|
5980
6231
|
/**
|
|
5981
6232
|
* Loads the url in the window. The url must contain the protocol prefix, e.g. the
|
|
5982
6233
|
* http:// or file://. If the load should bypass http cache then use the pragma
|
|
@@ -6001,8 +6252,8 @@ declare namespace Electron {
|
|
|
6001
6252
|
* Prints window's web page. When silent is set to true, Electron will pick the
|
|
6002
6253
|
* system's default printer if deviceName is empty and the default settings for
|
|
6003
6254
|
* printing. Calling window.print() in web page is equivalent to calling
|
|
6004
|
-
* webContents.print({silent: false, printBackground: false, deviceName: ''}).
|
|
6005
|
-
* page-break-before: always; CSS style to force to print to a new page.
|
|
6255
|
+
* webContents.print({ silent: false, printBackground: false, deviceName: '' }).
|
|
6256
|
+
* Use page-break-before: always; CSS style to force to print to a new page.
|
|
6006
6257
|
*/
|
|
6007
6258
|
print(options?: PrintOptions, callback?: (success: boolean) => void): void;
|
|
6008
6259
|
/**
|
|
@@ -6063,6 +6314,11 @@ declare namespace Electron {
|
|
|
6063
6314
|
* Mute the audio on the current web page.
|
|
6064
6315
|
*/
|
|
6065
6316
|
setAudioMuted(muted: boolean): void;
|
|
6317
|
+
/**
|
|
6318
|
+
* Controls whether or not this WebContents will throttle animations and timers
|
|
6319
|
+
* when the page becomes backgrounded. This also affects the Page Visibility API.
|
|
6320
|
+
*/
|
|
6321
|
+
setBackgroundThrottling(allowed: boolean): void;
|
|
6066
6322
|
/**
|
|
6067
6323
|
* Uses the devToolsWebContents as the target WebContents to show devtools. The
|
|
6068
6324
|
* devToolsWebContents must not have done any navigation, and it should not be used
|
|
@@ -6089,10 +6345,6 @@ declare namespace Electron {
|
|
|
6089
6345
|
* Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
|
|
6090
6346
|
*/
|
|
6091
6347
|
setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
|
|
6092
|
-
/**
|
|
6093
|
-
* Set the size of the page. This is only supported for <webview> guest contents.
|
|
6094
|
-
*/
|
|
6095
|
-
setSize(options: SizeOptions): void;
|
|
6096
6348
|
/**
|
|
6097
6349
|
* Overrides the user agent for this web page.
|
|
6098
6350
|
*/
|
|
@@ -6144,6 +6396,10 @@ declare namespace Electron {
|
|
|
6144
6396
|
* If offscreen rendering is enabled and painting, stop painting.
|
|
6145
6397
|
*/
|
|
6146
6398
|
stopPainting(): void;
|
|
6399
|
+
/**
|
|
6400
|
+
* Takes a V8 heap snapshot and saves it to filePath.
|
|
6401
|
+
*/
|
|
6402
|
+
takeHeapSnapshot(filePath: string): Promise<void>;
|
|
6147
6403
|
/**
|
|
6148
6404
|
* Toggles the developer tools.
|
|
6149
6405
|
*/
|
|
@@ -6171,7 +6427,7 @@ declare namespace Electron {
|
|
|
6171
6427
|
|
|
6172
6428
|
interface WebFrame extends EventEmitter {
|
|
6173
6429
|
|
|
6174
|
-
// Docs: http://
|
|
6430
|
+
// Docs: http://electronjs.org/docs/api/web-frame
|
|
6175
6431
|
|
|
6176
6432
|
/**
|
|
6177
6433
|
* Attempts to free memory that is no longer being used (like images from a
|
|
@@ -6189,7 +6445,7 @@ declare namespace Electron {
|
|
|
6189
6445
|
*/
|
|
6190
6446
|
executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise<any>;
|
|
6191
6447
|
/**
|
|
6192
|
-
* Work like executeJavaScript but evaluates scripts in isolated context.
|
|
6448
|
+
* Work like executeJavaScript but evaluates scripts in an isolated context.
|
|
6193
6449
|
*/
|
|
6194
6450
|
executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean, callback?: (result: any) => void): void;
|
|
6195
6451
|
findFrameByName(name: string): WebFrame;
|
|
@@ -6292,7 +6548,7 @@ declare namespace Electron {
|
|
|
6292
6548
|
|
|
6293
6549
|
class WebRequest extends EventEmitter {
|
|
6294
6550
|
|
|
6295
|
-
// Docs: http://
|
|
6551
|
+
// Docs: http://electronjs.org/docs/api/web-request
|
|
6296
6552
|
|
|
6297
6553
|
/**
|
|
6298
6554
|
* The listener will be called with listener(details) when a server initiated
|
|
@@ -6386,7 +6642,7 @@ declare namespace Electron {
|
|
|
6386
6642
|
|
|
6387
6643
|
interface WebSource {
|
|
6388
6644
|
|
|
6389
|
-
// Docs: http://
|
|
6645
|
+
// Docs: http://electronjs.org/docs/api/structures/web-source
|
|
6390
6646
|
|
|
6391
6647
|
code: string;
|
|
6392
6648
|
/**
|
|
@@ -6398,7 +6654,7 @@ declare namespace Electron {
|
|
|
6398
6654
|
|
|
6399
6655
|
interface WebviewTag extends HTMLElement {
|
|
6400
6656
|
|
|
6401
|
-
// Docs: http://
|
|
6657
|
+
// Docs: http://electronjs.org/docs/api/webview-tag
|
|
6402
6658
|
|
|
6403
6659
|
/**
|
|
6404
6660
|
* Fired when a load has committed. This includes navigation within the current
|
|
@@ -6610,6 +6866,10 @@ declare namespace Electron {
|
|
|
6610
6866
|
* Executes editing command delete in page.
|
|
6611
6867
|
*/
|
|
6612
6868
|
delete(): void;
|
|
6869
|
+
/**
|
|
6870
|
+
* Initiates a download of the resource at url without navigating.
|
|
6871
|
+
*/
|
|
6872
|
+
downloadURL(url: string): void;
|
|
6613
6873
|
/**
|
|
6614
6874
|
* Evaluates code in page. If userGesture is set, it will create the user gesture
|
|
6615
6875
|
* context in the page. HTML APIs like requestFullScreen, which require user
|
|
@@ -6624,7 +6884,21 @@ declare namespace Electron {
|
|
|
6624
6884
|
getTitle(): string;
|
|
6625
6885
|
getURL(): string;
|
|
6626
6886
|
getUserAgent(): string;
|
|
6887
|
+
/**
|
|
6888
|
+
* It depends on the remote module, it is therefore not available when this module
|
|
6889
|
+
* is disabled.
|
|
6890
|
+
*/
|
|
6627
6891
|
getWebContents(): WebContents;
|
|
6892
|
+
/**
|
|
6893
|
+
* Sends a request to get current zoom factor, the callback will be called with
|
|
6894
|
+
* callback(zoomFactor).
|
|
6895
|
+
*/
|
|
6896
|
+
getZoomFactor(callback: (zoomFactor: number) => void): void;
|
|
6897
|
+
/**
|
|
6898
|
+
* Sends a request to get current zoom level, the callback will be called with
|
|
6899
|
+
* callback(zoomLevel).
|
|
6900
|
+
*/
|
|
6901
|
+
getZoomLevel(callback: (zoomLevel: number) => void): void;
|
|
6628
6902
|
/**
|
|
6629
6903
|
* Makes the guest page go back.
|
|
6630
6904
|
*/
|
|
@@ -6659,9 +6933,11 @@ declare namespace Electron {
|
|
|
6659
6933
|
inspectServiceWorker(): void;
|
|
6660
6934
|
isAudioMuted(): boolean;
|
|
6661
6935
|
isCrashed(): boolean;
|
|
6936
|
+
isCurrentlyAudible(): boolean;
|
|
6662
6937
|
isDevToolsFocused(): boolean;
|
|
6663
6938
|
isDevToolsOpened(): boolean;
|
|
6664
6939
|
isLoading(): boolean;
|
|
6940
|
+
isLoadingMainFrame(): boolean;
|
|
6665
6941
|
isWaitingForResponse(): boolean;
|
|
6666
6942
|
/**
|
|
6667
6943
|
* Loads the url in the webview, the url must contain the protocol prefix, e.g. the
|
|
@@ -6729,10 +7005,18 @@ declare namespace Electron {
|
|
|
6729
7005
|
* Set guest page muted.
|
|
6730
7006
|
*/
|
|
6731
7007
|
setAudioMuted(muted: boolean): void;
|
|
7008
|
+
/**
|
|
7009
|
+
* Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
|
|
7010
|
+
*/
|
|
7011
|
+
setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
|
|
6732
7012
|
/**
|
|
6733
7013
|
* Overrides the user agent for the guest page.
|
|
6734
7014
|
*/
|
|
6735
7015
|
setUserAgent(userAgent: string): void;
|
|
7016
|
+
/**
|
|
7017
|
+
* Sets the maximum and minimum pinch-to-zoom level.
|
|
7018
|
+
*/
|
|
7019
|
+
setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
|
|
6736
7020
|
/**
|
|
6737
7021
|
* Changes the zoom factor to the specified factor. Zoom factor is zoom percent
|
|
6738
7022
|
* divided by 100, so 300% = 3.0.
|
|
@@ -6741,7 +7025,8 @@ declare namespace Electron {
|
|
|
6741
7025
|
/**
|
|
6742
7026
|
* Changes the zoom level to the specified level. The original size is 0 and each
|
|
6743
7027
|
* increment above or below represents zooming 20% larger or smaller to default
|
|
6744
|
-
* limits of 300% and 50% of original size, respectively.
|
|
7028
|
+
* limits of 300% and 50% of original size, respectively. The formula for this is
|
|
7029
|
+
* scale := 1.2 ^ level.
|
|
6745
7030
|
*/
|
|
6746
7031
|
setZoomLevel(level: number): void;
|
|
6747
7032
|
/**
|
|
@@ -6783,14 +7068,6 @@ declare namespace Electron {
|
|
|
6783
7068
|
* RuntimeEnabledFeatures.json5 file.
|
|
6784
7069
|
*/
|
|
6785
7070
|
disableblinkfeatures?: string;
|
|
6786
|
-
/**
|
|
6787
|
-
* When this attribute is present the webview contents will be prevented from
|
|
6788
|
-
* resizing when the webview element itself is resized. This can be used in
|
|
6789
|
-
* combination with webContents.setSize to manually resize the webview contents in
|
|
6790
|
-
* reaction to a window size change. This can make resizing faster compared to
|
|
6791
|
-
* relying on the webview element bounds to automatically resize the contents.
|
|
6792
|
-
*/
|
|
6793
|
-
disableguestresize?: string;
|
|
6794
7071
|
/**
|
|
6795
7072
|
* When this attribute is present the guest page will have web security disabled.
|
|
6796
7073
|
* Web security is enabled by default.
|
|
@@ -6803,14 +7080,10 @@ declare namespace Electron {
|
|
|
6803
7080
|
*/
|
|
6804
7081
|
enableblinkfeatures?: string;
|
|
6805
7082
|
/**
|
|
6806
|
-
*
|
|
6807
|
-
*
|
|
6808
|
-
* identifier. Setting this attribute on a new or existing webview connects it to
|
|
6809
|
-
* the existing webContents that currently renders in a different webview. The
|
|
6810
|
-
* existing webview will see the destroy event and will then create a new
|
|
6811
|
-
* webContents when a new url is loaded.
|
|
7083
|
+
* When this attribute is false the guest page in webview will not have access to
|
|
7084
|
+
* the remote module. The remote module is avaiable by default.
|
|
6812
7085
|
*/
|
|
6813
|
-
|
|
7086
|
+
enableremotemodule?: string;
|
|
6814
7087
|
/**
|
|
6815
7088
|
* Sets the referrer URL for the guest page.
|
|
6816
7089
|
*/
|
|
@@ -7084,7 +7357,7 @@ declare namespace Electron {
|
|
|
7084
7357
|
* visual effects, you can also leave it undefined so the executable's icon will be
|
|
7085
7358
|
* used.
|
|
7086
7359
|
*/
|
|
7087
|
-
icon?: NativeImage | string;
|
|
7360
|
+
icon?: (NativeImage) | (string);
|
|
7088
7361
|
/**
|
|
7089
7362
|
* Whether window should be shown when created. Default is true.
|
|
7090
7363
|
*/
|
|
@@ -7121,7 +7394,8 @@ declare namespace Electron {
|
|
|
7121
7394
|
enableLargerThanScreen?: boolean;
|
|
7122
7395
|
/**
|
|
7123
7396
|
* Window's background color as a hexadecimal value, like #66CD00 or #FFF or
|
|
7124
|
-
* #80FFFFFF (alpha is supported). Default is #FFF
|
|
7397
|
+
* #80FFFFFF (alpha is supported if transparent is set to true). Default is #FFF
|
|
7398
|
+
* (white).
|
|
7125
7399
|
*/
|
|
7126
7400
|
backgroundColor?: string;
|
|
7127
7401
|
/**
|
|
@@ -7504,7 +7778,7 @@ declare namespace Electron {
|
|
|
7504
7778
|
/**
|
|
7505
7779
|
* -
|
|
7506
7780
|
*/
|
|
7507
|
-
icon?: NativeImage | string;
|
|
7781
|
+
icon?: (NativeImage) | (string);
|
|
7508
7782
|
title: string;
|
|
7509
7783
|
content: string;
|
|
7510
7784
|
}
|
|
@@ -7546,7 +7820,7 @@ declare namespace Electron {
|
|
|
7546
7820
|
/**
|
|
7547
7821
|
* Sets the image associated with this dock icon.
|
|
7548
7822
|
*/
|
|
7549
|
-
setIcon: (image: NativeImage | string) => void;
|
|
7823
|
+
setIcon: (image: (NativeImage) | (string)) => void;
|
|
7550
7824
|
}
|
|
7551
7825
|
|
|
7552
7826
|
interface EnableNetworkEmulationOptions {
|
|
@@ -7744,6 +8018,7 @@ declare namespace Electron {
|
|
|
7744
8018
|
|
|
7745
8019
|
interface InterceptHttpProtocolRequest {
|
|
7746
8020
|
url: string;
|
|
8021
|
+
headers: Headers;
|
|
7747
8022
|
referrer: string;
|
|
7748
8023
|
method: string;
|
|
7749
8024
|
uploadData: UploadData[];
|
|
@@ -7800,11 +8075,26 @@ declare namespace Electron {
|
|
|
7800
8075
|
isMainFrame: boolean;
|
|
7801
8076
|
}
|
|
7802
8077
|
|
|
8078
|
+
interface LoadFileOptions {
|
|
8079
|
+
/**
|
|
8080
|
+
* Passed to url.format().
|
|
8081
|
+
*/
|
|
8082
|
+
query?: Query;
|
|
8083
|
+
/**
|
|
8084
|
+
* Passed to url.format().
|
|
8085
|
+
*/
|
|
8086
|
+
search?: string;
|
|
8087
|
+
/**
|
|
8088
|
+
* Passed to url.format().
|
|
8089
|
+
*/
|
|
8090
|
+
hash?: string;
|
|
8091
|
+
}
|
|
8092
|
+
|
|
7803
8093
|
interface LoadURLOptions {
|
|
7804
8094
|
/**
|
|
7805
8095
|
* An HTTP Referrer url.
|
|
7806
8096
|
*/
|
|
7807
|
-
httpReferrer?: string | Referrer;
|
|
8097
|
+
httpReferrer?: (string) | (Referrer);
|
|
7808
8098
|
/**
|
|
7809
8099
|
* A user agent originating the request.
|
|
7810
8100
|
*/
|
|
@@ -7813,7 +8103,7 @@ declare namespace Electron {
|
|
|
7813
8103
|
* Extra headers separated by "\n"
|
|
7814
8104
|
*/
|
|
7815
8105
|
extraHeaders?: string;
|
|
7816
|
-
postData?: UploadRawData[] | UploadFile[] | UploadBlob[];
|
|
8106
|
+
postData?: (UploadRawData[]) | (UploadFile[]) | (UploadBlob[]);
|
|
7817
8107
|
/**
|
|
7818
8108
|
* Base url (with trailing path separator) for files to be loaded by the data url.
|
|
7819
8109
|
* This is needed only if the specified url is a data url and needs to load other
|
|
@@ -7881,7 +8171,7 @@ declare namespace Electron {
|
|
|
7881
8171
|
label?: string;
|
|
7882
8172
|
sublabel?: string;
|
|
7883
8173
|
accelerator?: Accelerator;
|
|
7884
|
-
icon?: NativeImage | string;
|
|
8174
|
+
icon?: (NativeImage) | (string);
|
|
7885
8175
|
/**
|
|
7886
8176
|
* If false, the menu item will be greyed out and unclickable.
|
|
7887
8177
|
*/
|
|
@@ -7894,22 +8184,46 @@ declare namespace Electron {
|
|
|
7894
8184
|
* Should only be specified for checkbox or radio type menu items.
|
|
7895
8185
|
*/
|
|
7896
8186
|
checked?: boolean;
|
|
8187
|
+
/**
|
|
8188
|
+
* If false, the accelerator won't be registered with the system, but it will still
|
|
8189
|
+
* be displayed. Defaults to true.
|
|
8190
|
+
*/
|
|
8191
|
+
registerAccelerator?: boolean;
|
|
7897
8192
|
/**
|
|
7898
8193
|
* Should be specified for submenu type menu items. If submenu is specified, the
|
|
7899
8194
|
* type: 'submenu' can be omitted. If the value is not a then it will be
|
|
7900
8195
|
* automatically converted to one using Menu.buildFromTemplate.
|
|
7901
8196
|
*/
|
|
7902
|
-
submenu?: MenuItemConstructorOptions[] | Menu;
|
|
8197
|
+
submenu?: (MenuItemConstructorOptions[]) | (Menu);
|
|
7903
8198
|
/**
|
|
7904
8199
|
* Unique within a single menu. If defined then it can be used as a reference to
|
|
7905
8200
|
* this item by the position attribute.
|
|
7906
8201
|
*/
|
|
7907
8202
|
id?: string;
|
|
7908
8203
|
/**
|
|
7909
|
-
*
|
|
7910
|
-
*
|
|
8204
|
+
* Inserts this item before the item with the specified label. If the referenced
|
|
8205
|
+
* item doesn't exist the item will be inserted at the end of the menu. Also
|
|
8206
|
+
* implies that the menu item in question should be placed in the same “group” as
|
|
8207
|
+
* the item.
|
|
7911
8208
|
*/
|
|
7912
|
-
|
|
8209
|
+
before?: string[];
|
|
8210
|
+
/**
|
|
8211
|
+
* Inserts this item after the item with the specified label. If the referenced
|
|
8212
|
+
* item doesn't exist the item will be inserted at the end of the menu.
|
|
8213
|
+
*/
|
|
8214
|
+
after?: string[];
|
|
8215
|
+
/**
|
|
8216
|
+
* Provides a means for a single context menu to declare the placement of their
|
|
8217
|
+
* containing group before the containing group of the item with the specified
|
|
8218
|
+
* label.
|
|
8219
|
+
*/
|
|
8220
|
+
beforeGroupContaining?: string[];
|
|
8221
|
+
/**
|
|
8222
|
+
* Provides a means for a single context menu to declare the placement of their
|
|
8223
|
+
* containing group after the containing group of the item with the specified
|
|
8224
|
+
* label.
|
|
8225
|
+
*/
|
|
8226
|
+
afterGroupContaining?: string[];
|
|
7913
8227
|
}
|
|
7914
8228
|
|
|
7915
8229
|
interface MessageBoxOptions {
|
|
@@ -8013,7 +8327,7 @@ declare namespace Electron {
|
|
|
8013
8327
|
/**
|
|
8014
8328
|
* An icon to use in the notification.
|
|
8015
8329
|
*/
|
|
8016
|
-
icon?: string | NativeImage;
|
|
8330
|
+
icon?: (string) | (NativeImage);
|
|
8017
8331
|
/**
|
|
8018
8332
|
* Whether or not to add an inline reply option to the notification.
|
|
8019
8333
|
*/
|
|
@@ -8219,7 +8533,11 @@ declare namespace Electron {
|
|
|
8219
8533
|
/**
|
|
8220
8534
|
* true to bring the opened application to the foreground. The default is true.
|
|
8221
8535
|
*/
|
|
8222
|
-
activate
|
|
8536
|
+
activate?: boolean;
|
|
8537
|
+
/**
|
|
8538
|
+
* The working directory.
|
|
8539
|
+
*/
|
|
8540
|
+
workingDirectory?: string;
|
|
8223
8541
|
}
|
|
8224
8542
|
|
|
8225
8543
|
interface PageFaviconUpdatedEvent extends Event {
|
|
@@ -8244,8 +8562,8 @@ declare namespace Electron {
|
|
|
8244
8562
|
*/
|
|
8245
8563
|
screenSize: Size;
|
|
8246
8564
|
/**
|
|
8247
|
-
* Position the view on the screen (screenPosition == mobile) (default: {x: 0, y:
|
|
8248
|
-
* 0}).
|
|
8565
|
+
* Position the view on the screen (screenPosition == mobile) (default: { x: 0, y:
|
|
8566
|
+
* 0 }).
|
|
8249
8567
|
*/
|
|
8250
8568
|
viewPosition: Point;
|
|
8251
8569
|
/**
|
|
@@ -8275,11 +8593,26 @@ declare namespace Electron {
|
|
|
8275
8593
|
quantity: number;
|
|
8276
8594
|
}
|
|
8277
8595
|
|
|
8596
|
+
interface PermissionCheckHandlerDetails {
|
|
8597
|
+
/**
|
|
8598
|
+
* The security orign of the media check.
|
|
8599
|
+
*/
|
|
8600
|
+
securityOrigin: string;
|
|
8601
|
+
/**
|
|
8602
|
+
* The type of media access being requested, can be video, audio or unknown
|
|
8603
|
+
*/
|
|
8604
|
+
mediaType: ('video' | 'audio' | 'unknown');
|
|
8605
|
+
}
|
|
8606
|
+
|
|
8278
8607
|
interface PermissionRequestHandlerDetails {
|
|
8279
8608
|
/**
|
|
8280
8609
|
* The url of the openExternal request.
|
|
8281
8610
|
*/
|
|
8282
8611
|
externalURL: string;
|
|
8612
|
+
/**
|
|
8613
|
+
* The types of media access being requested, elements can be video or audio
|
|
8614
|
+
*/
|
|
8615
|
+
mediaTypes: Array<'video' | 'audio'>;
|
|
8283
8616
|
}
|
|
8284
8617
|
|
|
8285
8618
|
interface PluginCrashedEvent extends Event {
|
|
@@ -8336,7 +8669,7 @@ declare namespace Electron {
|
|
|
8336
8669
|
* Specify page size of the generated PDF. Can be A3, A4, A5, Legal, Letter,
|
|
8337
8670
|
* Tabloid or an Object containing height and width in microns.
|
|
8338
8671
|
*/
|
|
8339
|
-
pageSize?: string;
|
|
8672
|
+
pageSize?: (string) | (Size);
|
|
8340
8673
|
/**
|
|
8341
8674
|
* Whether to print CSS backgrounds.
|
|
8342
8675
|
*/
|
|
@@ -8351,27 +8684,6 @@ declare namespace Electron {
|
|
|
8351
8684
|
landscape?: boolean;
|
|
8352
8685
|
}
|
|
8353
8686
|
|
|
8354
|
-
interface ProcessMemoryInfo {
|
|
8355
|
-
/**
|
|
8356
|
-
* The amount of memory currently pinned to actual physical RAM.
|
|
8357
|
-
*/
|
|
8358
|
-
workingSetSize: number;
|
|
8359
|
-
/**
|
|
8360
|
-
* The maximum amount of memory that has ever been pinned to actual physical RAM.
|
|
8361
|
-
*/
|
|
8362
|
-
peakWorkingSetSize: number;
|
|
8363
|
-
/**
|
|
8364
|
-
* The amount of memory not shared by other processes, such as JS heap or HTML
|
|
8365
|
-
* content.
|
|
8366
|
-
*/
|
|
8367
|
-
privateBytes: number;
|
|
8368
|
-
/**
|
|
8369
|
-
* The amount of memory shared between processes, typically memory consumed by the
|
|
8370
|
-
* Electron code itself.
|
|
8371
|
-
*/
|
|
8372
|
-
sharedBytes: number;
|
|
8373
|
-
}
|
|
8374
|
-
|
|
8375
8687
|
interface ProgressBarOptions {
|
|
8376
8688
|
/**
|
|
8377
8689
|
* Mode for the progress bar. Can be none, normal, indeterminate, error or paused.
|
|
@@ -8414,6 +8726,7 @@ declare namespace Electron {
|
|
|
8414
8726
|
|
|
8415
8727
|
interface RegisterHttpProtocolRequest {
|
|
8416
8728
|
url: string;
|
|
8729
|
+
headers: Headers;
|
|
8417
8730
|
referrer: string;
|
|
8418
8731
|
method: string;
|
|
8419
8732
|
uploadData: UploadData[];
|
|
@@ -8569,7 +8882,7 @@ declare namespace Electron {
|
|
|
8569
8882
|
/**
|
|
8570
8883
|
* true to open the app as hidden. Defaults to false. The user can edit this
|
|
8571
8884
|
* setting from the System Preferences so
|
|
8572
|
-
* app.
|
|
8885
|
+
* app.getLoginItemSettings().wasOpenedAsHidden should be checked when the app is
|
|
8573
8886
|
* opened to know the current value. This setting is not available on .
|
|
8574
8887
|
*/
|
|
8575
8888
|
openAsHidden?: boolean;
|
|
@@ -8584,29 +8897,6 @@ declare namespace Electron {
|
|
|
8584
8897
|
args?: string[];
|
|
8585
8898
|
}
|
|
8586
8899
|
|
|
8587
|
-
interface SizeOptions {
|
|
8588
|
-
/**
|
|
8589
|
-
* true to make the webview container automatically resize within the bounds
|
|
8590
|
-
* specified by the attributes normal, min and max.
|
|
8591
|
-
*/
|
|
8592
|
-
enableAutoSize?: boolean;
|
|
8593
|
-
/**
|
|
8594
|
-
* Normal size of the page. This can be used in combination with the attribute to
|
|
8595
|
-
* manually resize the webview guest contents.
|
|
8596
|
-
*/
|
|
8597
|
-
normal?: Size;
|
|
8598
|
-
/**
|
|
8599
|
-
* Minimum size of the page. This can be used in combination with the attribute to
|
|
8600
|
-
* manually resize the webview guest contents.
|
|
8601
|
-
*/
|
|
8602
|
-
min?: Size;
|
|
8603
|
-
/**
|
|
8604
|
-
* Maximium size of the page. This can be used in combination with the attribute to
|
|
8605
|
-
* manually resize the webview guest contents.
|
|
8606
|
-
*/
|
|
8607
|
-
max?: Size;
|
|
8608
|
-
}
|
|
8609
|
-
|
|
8610
8900
|
interface SourcesOptions {
|
|
8611
8901
|
/**
|
|
8612
8902
|
* An array of Strings that lists the types of desktop sources to be captured,
|
|
@@ -8709,8 +8999,8 @@ declare namespace Electron {
|
|
|
8709
8999
|
}
|
|
8710
9000
|
|
|
8711
9001
|
interface TouchBarConstructorOptions {
|
|
8712
|
-
items: Array<TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer>;
|
|
8713
|
-
escapeItem?: TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null;
|
|
9002
|
+
items: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>;
|
|
9003
|
+
escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null);
|
|
8714
9004
|
}
|
|
8715
9005
|
|
|
8716
9006
|
interface TouchBarGroupConstructorOptions {
|
|
@@ -8876,6 +9166,13 @@ declare namespace Electron {
|
|
|
8876
9166
|
electron?: string;
|
|
8877
9167
|
}
|
|
8878
9168
|
|
|
9169
|
+
interface VisibleOnAllWorkspacesOptions {
|
|
9170
|
+
/**
|
|
9171
|
+
* Sets whether the window should be visible above fullscreen windows
|
|
9172
|
+
*/
|
|
9173
|
+
visibleOnFullScreen?: boolean;
|
|
9174
|
+
}
|
|
9175
|
+
|
|
8879
9176
|
interface WillNavigateEvent extends Event {
|
|
8880
9177
|
url: string;
|
|
8881
9178
|
}
|
|
@@ -8969,6 +9266,9 @@ declare namespace Electron {
|
|
|
8969
9266
|
interface Options {
|
|
8970
9267
|
}
|
|
8971
9268
|
|
|
9269
|
+
interface Query {
|
|
9270
|
+
}
|
|
9271
|
+
|
|
8972
9272
|
interface RequestHeaders {
|
|
8973
9273
|
}
|
|
8974
9274
|
|
|
@@ -9009,6 +9309,10 @@ declare namespace Electron {
|
|
|
9009
9309
|
* currently experimental and may change or be removed in future Electron releases.
|
|
9010
9310
|
*/
|
|
9011
9311
|
sandbox?: boolean;
|
|
9312
|
+
/**
|
|
9313
|
+
* Whether to enable the module. Default is true.
|
|
9314
|
+
*/
|
|
9315
|
+
enableRemoteModule?: boolean;
|
|
9012
9316
|
/**
|
|
9013
9317
|
* Sets the session used by the page. Instead of passing the Session object
|
|
9014
9318
|
* directly, you can also choose to use the partition option instead, which accepts
|
|
@@ -9132,22 +9436,23 @@ declare namespace Electron {
|
|
|
9132
9436
|
* content to ensure the loaded content cannot tamper with the preload script and
|
|
9133
9437
|
* any Electron APIs being used. This option uses the same technique used by . You
|
|
9134
9438
|
* can access this context in the dev tools by selecting the 'Electron Isolated
|
|
9135
|
-
* Context' entry in the combo box at the top of the Console tab.
|
|
9136
|
-
* currently experimental and may change or be removed in future Electron releases.
|
|
9439
|
+
* Context' entry in the combo box at the top of the Console tab.
|
|
9137
9440
|
*/
|
|
9138
9441
|
contextIsolation?: boolean;
|
|
9139
9442
|
/**
|
|
9140
|
-
* Whether to use native window.open().
|
|
9443
|
+
* Whether to use native window.open(). If set to true, the webPreferences of child
|
|
9444
|
+
* window will always be the same with parent window, regardless of the parameters
|
|
9445
|
+
* passed to window.open(). Defaults to false. This option is currently
|
|
9141
9446
|
* experimental.
|
|
9142
9447
|
*/
|
|
9143
9448
|
nativeWindowOpen?: boolean;
|
|
9144
9449
|
/**
|
|
9145
9450
|
* Whether to enable the . Defaults to the value of the nodeIntegration option. The
|
|
9146
|
-
* preload script configured for the
|
|
9147
|
-
*
|
|
9148
|
-
*
|
|
9451
|
+
* preload script configured for the will have node integration enabled when it is
|
|
9452
|
+
* executed so you should ensure remote/untrusted content is not able to create a
|
|
9453
|
+
* tag with a possibly malicious preload script. You can use the
|
|
9149
9454
|
* will-attach-webview event on to strip away the preload script and to validate or
|
|
9150
|
-
* alter the
|
|
9455
|
+
* alter the 's initial settings.
|
|
9151
9456
|
*/
|
|
9152
9457
|
webviewTag?: boolean;
|
|
9153
9458
|
/**
|
|
@@ -9229,7 +9534,7 @@ interface Document {
|
|
|
9229
9534
|
declare namespace NodeJS {
|
|
9230
9535
|
interface Process extends EventEmitter {
|
|
9231
9536
|
|
|
9232
|
-
// Docs: http://
|
|
9537
|
+
// Docs: http://electronjs.org/docs/api/process
|
|
9233
9538
|
|
|
9234
9539
|
/**
|
|
9235
9540
|
* Emitted when Electron has loaded its internal initialization script and is
|
|
@@ -9251,18 +9556,13 @@ declare namespace NodeJS {
|
|
|
9251
9556
|
* number of milliseconds since epoch. It returns null if it is unable to get the
|
|
9252
9557
|
* process creation time.
|
|
9253
9558
|
*/
|
|
9254
|
-
getCreationTime(): number | null;
|
|
9559
|
+
getCreationTime(): (number) | (null);
|
|
9255
9560
|
/**
|
|
9256
9561
|
* Returns an object with V8 heap statistics. Note that all statistics are reported
|
|
9257
9562
|
* in Kilobytes.
|
|
9258
9563
|
*/
|
|
9259
9564
|
getHeapStatistics(): Electron.HeapStatistics;
|
|
9260
9565
|
getIOCounters(): Electron.IOCounters;
|
|
9261
|
-
/**
|
|
9262
|
-
* Returns an object giving memory usage statistics about the current process. Note
|
|
9263
|
-
* that all statistics are reported in Kilobytes.
|
|
9264
|
-
*/
|
|
9265
|
-
getProcessMemoryInfo(): Electron.ProcessMemoryInfo;
|
|
9266
9566
|
/**
|
|
9267
9567
|
* Returns an object giving memory usage statistics about the entire system. Note
|
|
9268
9568
|
* that all statistics are reported in Kilobytes.
|
|
@@ -9277,6 +9577,10 @@ declare namespace NodeJS {
|
|
|
9277
9577
|
* whichever is lower for the current process.
|
|
9278
9578
|
*/
|
|
9279
9579
|
setFdLimit(maxDescriptors: number): void;
|
|
9580
|
+
/**
|
|
9581
|
+
* Takes a V8 heap snapshot and saves it to filePath.
|
|
9582
|
+
*/
|
|
9583
|
+
takeHeapSnapshot(filePath: string): boolean;
|
|
9280
9584
|
/**
|
|
9281
9585
|
* A Boolean. When app is started by being passed as parameter to the default app,
|
|
9282
9586
|
* this property is true in the main process, otherwise it is undefined.
|