electron 14.1.0 → 14.2.2
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/electron.d.ts +138 -6
- package/package.json +1 -1
package/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 14.
|
|
1
|
+
// Type definitions for Electron 14.2.2
|
|
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
|
|
@@ -2163,9 +2163,9 @@ declare namespace Electron {
|
|
|
2163
2163
|
*/
|
|
2164
2164
|
getOpacity(): number;
|
|
2165
2165
|
/**
|
|
2166
|
-
* The parent window.
|
|
2166
|
+
* The parent window or `null` if there is no parent.
|
|
2167
2167
|
*/
|
|
2168
|
-
getParentWindow(): BrowserWindow;
|
|
2168
|
+
getParentWindow(): (BrowserWindow) | (null);
|
|
2169
2169
|
/**
|
|
2170
2170
|
* Contains the window's current position.
|
|
2171
2171
|
*/
|
|
@@ -11874,6 +11874,11 @@ declare namespace Electron {
|
|
|
11874
11874
|
*/
|
|
11875
11875
|
addEventListener(event: 'devtools-focused', listener: (event: Event) => void, useCapture?: boolean): this;
|
|
11876
11876
|
removeEventListener(event: 'devtools-focused', listener: (event: Event) => void): this;
|
|
11877
|
+
/**
|
|
11878
|
+
* Emitted when there is a new context menu that needs to be handled.
|
|
11879
|
+
*/
|
|
11880
|
+
addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
|
|
11881
|
+
removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
|
|
11877
11882
|
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
|
|
11878
11883
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
|
11879
11884
|
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
|
|
@@ -12856,6 +12861,10 @@ declare namespace Electron {
|
|
|
12856
12861
|
sourceId: string;
|
|
12857
12862
|
}
|
|
12858
12863
|
|
|
12864
|
+
interface ContextMenuEvent extends Event {
|
|
12865
|
+
params: Params;
|
|
12866
|
+
}
|
|
12867
|
+
|
|
12859
12868
|
interface ContextMenuParams {
|
|
12860
12869
|
/**
|
|
12861
12870
|
* x coordinate.
|
|
@@ -13191,9 +13200,10 @@ declare namespace Electron {
|
|
|
13191
13200
|
|
|
13192
13201
|
interface DevicePermissionHandlerHandlerDetails {
|
|
13193
13202
|
/**
|
|
13194
|
-
* The type of device that permission is being requested on, can be `hid
|
|
13203
|
+
* The type of device that permission is being requested on, can be `hid` or
|
|
13204
|
+
* `serial`.
|
|
13195
13205
|
*/
|
|
13196
|
-
deviceType: ('hid');
|
|
13206
|
+
deviceType: ('hid' | 'serial');
|
|
13197
13207
|
/**
|
|
13198
13208
|
* The origin URL of the device permission check.
|
|
13199
13209
|
*/
|
|
@@ -13201,7 +13211,7 @@ declare namespace Electron {
|
|
|
13201
13211
|
/**
|
|
13202
13212
|
* the device that permission is being requested for.
|
|
13203
13213
|
*/
|
|
13204
|
-
device: HIDDevice;
|
|
13214
|
+
device: (HIDDevice) | (SerialPort);
|
|
13205
13215
|
/**
|
|
13206
13216
|
* WebFrameMain checking the device permission.
|
|
13207
13217
|
*/
|
|
@@ -14422,6 +14432,10 @@ declare namespace Electron {
|
|
|
14422
14432
|
* The url of the `openExternal` request.
|
|
14423
14433
|
*/
|
|
14424
14434
|
externalURL?: string;
|
|
14435
|
+
/**
|
|
14436
|
+
* The security origin of the `media` request.
|
|
14437
|
+
*/
|
|
14438
|
+
securityOrigin?: string;
|
|
14425
14439
|
/**
|
|
14426
14440
|
* The types of media access being requested, elements can be `video` or `audio`
|
|
14427
14441
|
*/
|
|
@@ -15472,6 +15486,118 @@ declare namespace Electron {
|
|
|
15472
15486
|
to: number;
|
|
15473
15487
|
}
|
|
15474
15488
|
|
|
15489
|
+
interface Params {
|
|
15490
|
+
/**
|
|
15491
|
+
* x coordinate.
|
|
15492
|
+
*/
|
|
15493
|
+
x: number;
|
|
15494
|
+
/**
|
|
15495
|
+
* y coordinate.
|
|
15496
|
+
*/
|
|
15497
|
+
y: number;
|
|
15498
|
+
/**
|
|
15499
|
+
* URL of the link that encloses the node the context menu was invoked on.
|
|
15500
|
+
*/
|
|
15501
|
+
linkURL: string;
|
|
15502
|
+
/**
|
|
15503
|
+
* Text associated with the link. May be an empty string if the contents of the
|
|
15504
|
+
* link are an image.
|
|
15505
|
+
*/
|
|
15506
|
+
linkText: string;
|
|
15507
|
+
/**
|
|
15508
|
+
* URL of the top level page that the context menu was invoked on.
|
|
15509
|
+
*/
|
|
15510
|
+
pageURL: string;
|
|
15511
|
+
/**
|
|
15512
|
+
* URL of the subframe that the context menu was invoked on.
|
|
15513
|
+
*/
|
|
15514
|
+
frameURL: string;
|
|
15515
|
+
/**
|
|
15516
|
+
* Source URL for the element that the context menu was invoked on. Elements with
|
|
15517
|
+
* source URLs are images, audio and video.
|
|
15518
|
+
*/
|
|
15519
|
+
srcURL: string;
|
|
15520
|
+
/**
|
|
15521
|
+
* Type of the node the context menu was invoked on. Can be `none`, `image`,
|
|
15522
|
+
* `audio`, `video`, `canvas`, `file` or `plugin`.
|
|
15523
|
+
*/
|
|
15524
|
+
mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
|
|
15525
|
+
/**
|
|
15526
|
+
* Whether the context menu was invoked on an image which has non-empty contents.
|
|
15527
|
+
*/
|
|
15528
|
+
hasImageContents: boolean;
|
|
15529
|
+
/**
|
|
15530
|
+
* Whether the context is editable.
|
|
15531
|
+
*/
|
|
15532
|
+
isEditable: boolean;
|
|
15533
|
+
/**
|
|
15534
|
+
* Text of the selection that the context menu was invoked on.
|
|
15535
|
+
*/
|
|
15536
|
+
selectionText: string;
|
|
15537
|
+
/**
|
|
15538
|
+
* Title text of the selection that the context menu was invoked on.
|
|
15539
|
+
*/
|
|
15540
|
+
titleText: string;
|
|
15541
|
+
/**
|
|
15542
|
+
* Alt text of the selection that the context menu was invoked on.
|
|
15543
|
+
*/
|
|
15544
|
+
altText: string;
|
|
15545
|
+
/**
|
|
15546
|
+
* Suggested filename to be used when saving file through 'Save Link As' option of
|
|
15547
|
+
* context menu.
|
|
15548
|
+
*/
|
|
15549
|
+
suggestedFilename: string;
|
|
15550
|
+
/**
|
|
15551
|
+
* Rect representing the coordinates in the document space of the selection.
|
|
15552
|
+
*/
|
|
15553
|
+
selectionRect: Rectangle;
|
|
15554
|
+
/**
|
|
15555
|
+
* Start position of the selection text.
|
|
15556
|
+
*/
|
|
15557
|
+
selectionStartOffset: number;
|
|
15558
|
+
/**
|
|
15559
|
+
* The referrer policy of the frame on which the menu is invoked.
|
|
15560
|
+
*/
|
|
15561
|
+
referrerPolicy: Referrer;
|
|
15562
|
+
/**
|
|
15563
|
+
* The misspelled word under the cursor, if any.
|
|
15564
|
+
*/
|
|
15565
|
+
misspelledWord: string;
|
|
15566
|
+
/**
|
|
15567
|
+
* An array of suggested words to show the user to replace the `misspelledWord`.
|
|
15568
|
+
* Only available if there is a misspelled word and spellchecker is enabled.
|
|
15569
|
+
*/
|
|
15570
|
+
dictionarySuggestions: string[];
|
|
15571
|
+
/**
|
|
15572
|
+
* The character encoding of the frame on which the menu was invoked.
|
|
15573
|
+
*/
|
|
15574
|
+
frameCharset: string;
|
|
15575
|
+
/**
|
|
15576
|
+
* If the context menu was invoked on an input field, the type of that field.
|
|
15577
|
+
* Possible values are `none`, `plainText`, `password`, `other`.
|
|
15578
|
+
*/
|
|
15579
|
+
inputFieldType: string;
|
|
15580
|
+
/**
|
|
15581
|
+
* If the context is editable, whether or not spellchecking is enabled.
|
|
15582
|
+
*/
|
|
15583
|
+
spellcheckEnabled: boolean;
|
|
15584
|
+
/**
|
|
15585
|
+
* Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
|
|
15586
|
+
* `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
|
|
15587
|
+
* `adjustSelection`, or `adjustSelectionReset`.
|
|
15588
|
+
*/
|
|
15589
|
+
menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
|
|
15590
|
+
/**
|
|
15591
|
+
* The flags for the media element the context menu was invoked on.
|
|
15592
|
+
*/
|
|
15593
|
+
mediaFlags: MediaFlags;
|
|
15594
|
+
/**
|
|
15595
|
+
* These flags indicate whether the renderer believes it is able to perform the
|
|
15596
|
+
* corresponding action.
|
|
15597
|
+
*/
|
|
15598
|
+
editFlags: EditFlags;
|
|
15599
|
+
}
|
|
15600
|
+
|
|
15475
15601
|
interface WebPreferences {
|
|
15476
15602
|
/**
|
|
15477
15603
|
* Whether to enable DevTools. If it is set to `false`, can not use
|
|
@@ -15813,6 +15939,7 @@ declare namespace Electron {
|
|
|
15813
15939
|
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
|
15814
15940
|
type Config = Electron.Config;
|
|
15815
15941
|
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
|
15942
|
+
type ContextMenuEvent = Electron.ContextMenuEvent;
|
|
15816
15943
|
type ContextMenuParams = Electron.ContextMenuParams;
|
|
15817
15944
|
type CookiesGetFilter = Electron.CookiesGetFilter;
|
|
15818
15945
|
type CookiesSetDetails = Electron.CookiesSetDetails;
|
|
@@ -15940,6 +16067,7 @@ declare namespace Electron {
|
|
|
15940
16067
|
type Margins = Electron.Margins;
|
|
15941
16068
|
type MediaFlags = Electron.MediaFlags;
|
|
15942
16069
|
type PageRanges = Electron.PageRanges;
|
|
16070
|
+
type Params = Electron.Params;
|
|
15943
16071
|
type WebPreferences = Electron.WebPreferences;
|
|
15944
16072
|
type DefaultFontFamily = Electron.DefaultFontFamily;
|
|
15945
16073
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
@@ -16079,6 +16207,7 @@ declare namespace Electron {
|
|
|
16079
16207
|
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
|
16080
16208
|
type Config = Electron.Config;
|
|
16081
16209
|
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
|
16210
|
+
type ContextMenuEvent = Electron.ContextMenuEvent;
|
|
16082
16211
|
type ContextMenuParams = Electron.ContextMenuParams;
|
|
16083
16212
|
type CookiesGetFilter = Electron.CookiesGetFilter;
|
|
16084
16213
|
type CookiesSetDetails = Electron.CookiesSetDetails;
|
|
@@ -16206,6 +16335,7 @@ declare namespace Electron {
|
|
|
16206
16335
|
type Margins = Electron.Margins;
|
|
16207
16336
|
type MediaFlags = Electron.MediaFlags;
|
|
16208
16337
|
type PageRanges = Electron.PageRanges;
|
|
16338
|
+
type Params = Electron.Params;
|
|
16209
16339
|
type WebPreferences = Electron.WebPreferences;
|
|
16210
16340
|
type DefaultFontFamily = Electron.DefaultFontFamily;
|
|
16211
16341
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
@@ -16297,6 +16427,7 @@ declare namespace Electron {
|
|
|
16297
16427
|
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
|
16298
16428
|
type Config = Electron.Config;
|
|
16299
16429
|
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
|
16430
|
+
type ContextMenuEvent = Electron.ContextMenuEvent;
|
|
16300
16431
|
type ContextMenuParams = Electron.ContextMenuParams;
|
|
16301
16432
|
type CookiesGetFilter = Electron.CookiesGetFilter;
|
|
16302
16433
|
type CookiesSetDetails = Electron.CookiesSetDetails;
|
|
@@ -16424,6 +16555,7 @@ declare namespace Electron {
|
|
|
16424
16555
|
type Margins = Electron.Margins;
|
|
16425
16556
|
type MediaFlags = Electron.MediaFlags;
|
|
16426
16557
|
type PageRanges = Electron.PageRanges;
|
|
16558
|
+
type Params = Electron.Params;
|
|
16427
16559
|
type WebPreferences = Electron.WebPreferences;
|
|
16428
16560
|
type DefaultFontFamily = Electron.DefaultFontFamily;
|
|
16429
16561
|
type BluetoothDevice = Electron.BluetoothDevice;
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"node": ">= 8.6"
|
|
17
17
|
},
|
|
18
18
|
"name": "electron",
|
|
19
|
-
"version": "14.
|
|
19
|
+
"version": "14.2.2",
|
|
20
20
|
"repository": "https://github.com/electron/electron",
|
|
21
21
|
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
|
22
22
|
"license": "MIT",
|