electron 4.0.0-nightly.20181010 → 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/cli.js +1 -1
- package/electron.d.ts +128 -20
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ var electron = require('./')
|
|
|
4
4
|
|
|
5
5
|
var proc = require('child_process')
|
|
6
6
|
|
|
7
|
-
var child = proc.spawn(electron, process.argv.slice(2), { stdio: 'inherit' })
|
|
7
|
+
var child = proc.spawn(electron, process.argv.slice(2), { stdio: 'inherit', windowsHide: false })
|
|
8
8
|
child.on('close', function (code) {
|
|
9
9
|
process.exit(code)
|
|
10
10
|
})
|
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
|
|
@@ -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()
|
|
@@ -946,6 +976,11 @@ declare namespace Electron {
|
|
|
946
976
|
* them.
|
|
947
977
|
*/
|
|
948
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;
|
|
949
984
|
/**
|
|
950
985
|
* Start accessing a security scoped resource. With this method Electron
|
|
951
986
|
* applications that are packaged for the Mac App Store may reach outside their
|
|
@@ -1674,7 +1709,8 @@ declare namespace Electron {
|
|
|
1674
1709
|
*/
|
|
1675
1710
|
setBackgroundColor(backgroundColor: string): void;
|
|
1676
1711
|
/**
|
|
1677
|
-
* Resizes and moves the window to the supplied bounds
|
|
1712
|
+
* Resizes and moves the window to the supplied bounds. Any properties that are not
|
|
1713
|
+
* supplied will default to their current values.
|
|
1678
1714
|
*/
|
|
1679
1715
|
setBounds(bounds: Rectangle, animate?: boolean): void;
|
|
1680
1716
|
setBrowserView(browserView: BrowserView): void;
|
|
@@ -3181,9 +3217,9 @@ declare namespace Electron {
|
|
|
3181
3217
|
*/
|
|
3182
3218
|
sendSync(channel: string, ...args: any[]): any;
|
|
3183
3219
|
/**
|
|
3184
|
-
* Sends a message to a window with
|
|
3220
|
+
* Sends a message to a window with webContentsId via channel.
|
|
3185
3221
|
*/
|
|
3186
|
-
sendTo(
|
|
3222
|
+
sendTo(webContentsId: number, channel: string, ...args: any[]): void;
|
|
3187
3223
|
/**
|
|
3188
3224
|
* Like ipcRenderer.send but the event will be sent to the <webview> element in the
|
|
3189
3225
|
* host page instead of the main process.
|
|
@@ -4388,6 +4424,17 @@ declare namespace Electron {
|
|
|
4388
4424
|
* used, `false` otherwise.
|
|
4389
4425
|
*/
|
|
4390
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>;
|
|
4391
4438
|
getAccentColor(): string;
|
|
4392
4439
|
/**
|
|
4393
4440
|
* Gets the macOS appearance setting that you have declared you want for your
|
|
@@ -4407,6 +4454,11 @@ declare namespace Electron {
|
|
|
4407
4454
|
* packager option to true. See the Electron Packager API for more details.
|
|
4408
4455
|
*/
|
|
4409
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');
|
|
4410
4462
|
/**
|
|
4411
4463
|
* Some popular key and types are:
|
|
4412
4464
|
*/
|
|
@@ -4457,7 +4509,7 @@ declare namespace Electron {
|
|
|
4457
4509
|
* Same as subscribeNotification, but uses NSNotificationCenter for local defaults.
|
|
4458
4510
|
* This is necessary for events such as NSUserDefaultsDidChangeNotification.
|
|
4459
4511
|
*/
|
|
4460
|
-
subscribeLocalNotification(event: string, callback: (event: string, userInfo: any) => void):
|
|
4512
|
+
subscribeLocalNotification(event: string, callback: (event: string, userInfo: any) => void): number;
|
|
4461
4513
|
/**
|
|
4462
4514
|
* Subscribes to native notifications of macOS, callback will be called with
|
|
4463
4515
|
* callback(event, userInfo) when the corresponding event happens. The userInfo is
|
|
@@ -4466,7 +4518,7 @@ declare namespace Electron {
|
|
|
4466
4518
|
* unsubscribe the event. Under the hood this API subscribes to
|
|
4467
4519
|
* NSDistributedNotificationCenter, example values of event are:
|
|
4468
4520
|
*/
|
|
4469
|
-
subscribeNotification(event: string, callback: (event: string, userInfo: any) => void):
|
|
4521
|
+
subscribeNotification(event: string, callback: (event: string, userInfo: any) => void): number;
|
|
4470
4522
|
/**
|
|
4471
4523
|
* Same as subscribeNotification, but uses
|
|
4472
4524
|
* NSWorkspace.sharedWorkspace.notificationCenter. This is necessary for events
|
|
@@ -5803,6 +5855,32 @@ declare namespace Electron {
|
|
|
5803
5855
|
removeListener(event: 'plugin-crashed', listener: (event: Event,
|
|
5804
5856
|
name: string,
|
|
5805
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;
|
|
5806
5884
|
/**
|
|
5807
5885
|
* Emitted when the unresponsive web page becomes responsive again.
|
|
5808
5886
|
*/
|
|
@@ -6236,6 +6314,11 @@ declare namespace Electron {
|
|
|
6236
6314
|
* Mute the audio on the current web page.
|
|
6237
6315
|
*/
|
|
6238
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;
|
|
6239
6322
|
/**
|
|
6240
6323
|
* Uses the devToolsWebContents as the target WebContents to show devtools. The
|
|
6241
6324
|
* devToolsWebContents must not have done any navigation, and it should not be used
|
|
@@ -6801,6 +6884,10 @@ declare namespace Electron {
|
|
|
6801
6884
|
getTitle(): string;
|
|
6802
6885
|
getURL(): string;
|
|
6803
6886
|
getUserAgent(): string;
|
|
6887
|
+
/**
|
|
6888
|
+
* It depends on the remote module, it is therefore not available when this module
|
|
6889
|
+
* is disabled.
|
|
6890
|
+
*/
|
|
6804
6891
|
getWebContents(): WebContents;
|
|
6805
6892
|
/**
|
|
6806
6893
|
* Sends a request to get current zoom factor, the callback will be called with
|
|
@@ -6992,6 +7079,11 @@ declare namespace Electron {
|
|
|
6992
7079
|
* RuntimeEnabledFeatures.json5 file.
|
|
6993
7080
|
*/
|
|
6994
7081
|
enableblinkfeatures?: string;
|
|
7082
|
+
/**
|
|
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.
|
|
7085
|
+
*/
|
|
7086
|
+
enableremotemodule?: string;
|
|
6995
7087
|
/**
|
|
6996
7088
|
* Sets the referrer URL for the guest page.
|
|
6997
7089
|
*/
|
|
@@ -7926,6 +8018,7 @@ declare namespace Electron {
|
|
|
7926
8018
|
|
|
7927
8019
|
interface InterceptHttpProtocolRequest {
|
|
7928
8020
|
url: string;
|
|
8021
|
+
headers: Headers;
|
|
7929
8022
|
referrer: string;
|
|
7930
8023
|
method: string;
|
|
7931
8024
|
uploadData: UploadData[];
|
|
@@ -8091,6 +8184,11 @@ declare namespace Electron {
|
|
|
8091
8184
|
* Should only be specified for checkbox or radio type menu items.
|
|
8092
8185
|
*/
|
|
8093
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;
|
|
8094
8192
|
/**
|
|
8095
8193
|
* Should be specified for submenu type menu items. If submenu is specified, the
|
|
8096
8194
|
* type: 'submenu' can be omitted. If the value is not a then it will be
|
|
@@ -8435,7 +8533,11 @@ declare namespace Electron {
|
|
|
8435
8533
|
/**
|
|
8436
8534
|
* true to bring the opened application to the foreground. The default is true.
|
|
8437
8535
|
*/
|
|
8438
|
-
activate
|
|
8536
|
+
activate?: boolean;
|
|
8537
|
+
/**
|
|
8538
|
+
* The working directory.
|
|
8539
|
+
*/
|
|
8540
|
+
workingDirectory?: string;
|
|
8439
8541
|
}
|
|
8440
8542
|
|
|
8441
8543
|
interface PageFaviconUpdatedEvent extends Event {
|
|
@@ -8567,7 +8669,7 @@ declare namespace Electron {
|
|
|
8567
8669
|
* Specify page size of the generated PDF. Can be A3, A4, A5, Legal, Letter,
|
|
8568
8670
|
* Tabloid or an Object containing height and width in microns.
|
|
8569
8671
|
*/
|
|
8570
|
-
pageSize?: string;
|
|
8672
|
+
pageSize?: (string) | (Size);
|
|
8571
8673
|
/**
|
|
8572
8674
|
* Whether to print CSS backgrounds.
|
|
8573
8675
|
*/
|
|
@@ -8624,6 +8726,7 @@ declare namespace Electron {
|
|
|
8624
8726
|
|
|
8625
8727
|
interface RegisterHttpProtocolRequest {
|
|
8626
8728
|
url: string;
|
|
8729
|
+
headers: Headers;
|
|
8627
8730
|
referrer: string;
|
|
8628
8731
|
method: string;
|
|
8629
8732
|
uploadData: UploadData[];
|
|
@@ -8779,7 +8882,7 @@ declare namespace Electron {
|
|
|
8779
8882
|
/**
|
|
8780
8883
|
* true to open the app as hidden. Defaults to false. The user can edit this
|
|
8781
8884
|
* setting from the System Preferences so
|
|
8782
|
-
* app.
|
|
8885
|
+
* app.getLoginItemSettings().wasOpenedAsHidden should be checked when the app is
|
|
8783
8886
|
* opened to know the current value. This setting is not available on .
|
|
8784
8887
|
*/
|
|
8785
8888
|
openAsHidden?: boolean;
|
|
@@ -9206,6 +9309,10 @@ declare namespace Electron {
|
|
|
9206
9309
|
* currently experimental and may change or be removed in future Electron releases.
|
|
9207
9310
|
*/
|
|
9208
9311
|
sandbox?: boolean;
|
|
9312
|
+
/**
|
|
9313
|
+
* Whether to enable the module. Default is true.
|
|
9314
|
+
*/
|
|
9315
|
+
enableRemoteModule?: boolean;
|
|
9209
9316
|
/**
|
|
9210
9317
|
* Sets the session used by the page. Instead of passing the Session object
|
|
9211
9318
|
* directly, you can also choose to use the partition option instead, which accepts
|
|
@@ -9329,12 +9436,13 @@ declare namespace Electron {
|
|
|
9329
9436
|
* content to ensure the loaded content cannot tamper with the preload script and
|
|
9330
9437
|
* any Electron APIs being used. This option uses the same technique used by . You
|
|
9331
9438
|
* can access this context in the dev tools by selecting the 'Electron Isolated
|
|
9332
|
-
* Context' entry in the combo box at the top of the Console tab.
|
|
9333
|
-
* 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.
|
|
9334
9440
|
*/
|
|
9335
9441
|
contextIsolation?: boolean;
|
|
9336
9442
|
/**
|
|
9337
|
-
* 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
|
|
9338
9446
|
* experimental.
|
|
9339
9447
|
*/
|
|
9340
9448
|
nativeWindowOpen?: boolean;
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"node": ">= 4.0"
|
|
28
28
|
},
|
|
29
29
|
"name": "electron",
|
|
30
|
-
"version": "4.0.0
|
|
30
|
+
"version": "4.0.0",
|
|
31
31
|
"repository": "https://github.com/electron/electron",
|
|
32
32
|
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
|
33
33
|
"license": "MIT",
|