electron 14.1.1 → 14.2.3
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 +141 -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.3
|
|
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
|
*/
|
|
@@ -10372,6 +10372,9 @@ declare namespace Electron {
|
|
|
10372
10372
|
* `webBluetooth` should be enabled. If `event.preventDefault` is not called, first
|
|
10373
10373
|
* available device will be selected. `callback` should be called with `deviceId`
|
|
10374
10374
|
* to be selected, passing empty string to `callback` will cancel the request.
|
|
10375
|
+
*
|
|
10376
|
+
* If no event listener is added for this event, all bluetooth requests will be
|
|
10377
|
+
* cancelled.
|
|
10375
10378
|
*/
|
|
10376
10379
|
on(event: 'select-bluetooth-device', listener: (event: Event,
|
|
10377
10380
|
devices: BluetoothDevice[],
|
|
@@ -11874,6 +11877,11 @@ declare namespace Electron {
|
|
|
11874
11877
|
*/
|
|
11875
11878
|
addEventListener(event: 'devtools-focused', listener: (event: Event) => void, useCapture?: boolean): this;
|
|
11876
11879
|
removeEventListener(event: 'devtools-focused', listener: (event: Event) => void): this;
|
|
11880
|
+
/**
|
|
11881
|
+
* Emitted when there is a new context menu that needs to be handled.
|
|
11882
|
+
*/
|
|
11883
|
+
addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
|
|
11884
|
+
removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
|
|
11877
11885
|
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
|
|
11878
11886
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
|
11879
11887
|
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
|
|
@@ -12856,6 +12864,10 @@ declare namespace Electron {
|
|
|
12856
12864
|
sourceId: string;
|
|
12857
12865
|
}
|
|
12858
12866
|
|
|
12867
|
+
interface ContextMenuEvent extends Event {
|
|
12868
|
+
params: Params;
|
|
12869
|
+
}
|
|
12870
|
+
|
|
12859
12871
|
interface ContextMenuParams {
|
|
12860
12872
|
/**
|
|
12861
12873
|
* x coordinate.
|
|
@@ -13191,9 +13203,10 @@ declare namespace Electron {
|
|
|
13191
13203
|
|
|
13192
13204
|
interface DevicePermissionHandlerHandlerDetails {
|
|
13193
13205
|
/**
|
|
13194
|
-
* The type of device that permission is being requested on, can be `hid
|
|
13206
|
+
* The type of device that permission is being requested on, can be `hid` or
|
|
13207
|
+
* `serial`.
|
|
13195
13208
|
*/
|
|
13196
|
-
deviceType: ('hid');
|
|
13209
|
+
deviceType: ('hid' | 'serial');
|
|
13197
13210
|
/**
|
|
13198
13211
|
* The origin URL of the device permission check.
|
|
13199
13212
|
*/
|
|
@@ -13201,7 +13214,7 @@ declare namespace Electron {
|
|
|
13201
13214
|
/**
|
|
13202
13215
|
* the device that permission is being requested for.
|
|
13203
13216
|
*/
|
|
13204
|
-
device: HIDDevice;
|
|
13217
|
+
device: (HIDDevice) | (SerialPort);
|
|
13205
13218
|
/**
|
|
13206
13219
|
* WebFrameMain checking the device permission.
|
|
13207
13220
|
*/
|
|
@@ -14422,6 +14435,10 @@ declare namespace Electron {
|
|
|
14422
14435
|
* The url of the `openExternal` request.
|
|
14423
14436
|
*/
|
|
14424
14437
|
externalURL?: string;
|
|
14438
|
+
/**
|
|
14439
|
+
* The security origin of the `media` request.
|
|
14440
|
+
*/
|
|
14441
|
+
securityOrigin?: string;
|
|
14425
14442
|
/**
|
|
14426
14443
|
* The types of media access being requested, elements can be `video` or `audio`
|
|
14427
14444
|
*/
|
|
@@ -15472,6 +15489,118 @@ declare namespace Electron {
|
|
|
15472
15489
|
to: number;
|
|
15473
15490
|
}
|
|
15474
15491
|
|
|
15492
|
+
interface Params {
|
|
15493
|
+
/**
|
|
15494
|
+
* x coordinate.
|
|
15495
|
+
*/
|
|
15496
|
+
x: number;
|
|
15497
|
+
/**
|
|
15498
|
+
* y coordinate.
|
|
15499
|
+
*/
|
|
15500
|
+
y: number;
|
|
15501
|
+
/**
|
|
15502
|
+
* URL of the link that encloses the node the context menu was invoked on.
|
|
15503
|
+
*/
|
|
15504
|
+
linkURL: string;
|
|
15505
|
+
/**
|
|
15506
|
+
* Text associated with the link. May be an empty string if the contents of the
|
|
15507
|
+
* link are an image.
|
|
15508
|
+
*/
|
|
15509
|
+
linkText: string;
|
|
15510
|
+
/**
|
|
15511
|
+
* URL of the top level page that the context menu was invoked on.
|
|
15512
|
+
*/
|
|
15513
|
+
pageURL: string;
|
|
15514
|
+
/**
|
|
15515
|
+
* URL of the subframe that the context menu was invoked on.
|
|
15516
|
+
*/
|
|
15517
|
+
frameURL: string;
|
|
15518
|
+
/**
|
|
15519
|
+
* Source URL for the element that the context menu was invoked on. Elements with
|
|
15520
|
+
* source URLs are images, audio and video.
|
|
15521
|
+
*/
|
|
15522
|
+
srcURL: string;
|
|
15523
|
+
/**
|
|
15524
|
+
* Type of the node the context menu was invoked on. Can be `none`, `image`,
|
|
15525
|
+
* `audio`, `video`, `canvas`, `file` or `plugin`.
|
|
15526
|
+
*/
|
|
15527
|
+
mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
|
|
15528
|
+
/**
|
|
15529
|
+
* Whether the context menu was invoked on an image which has non-empty contents.
|
|
15530
|
+
*/
|
|
15531
|
+
hasImageContents: boolean;
|
|
15532
|
+
/**
|
|
15533
|
+
* Whether the context is editable.
|
|
15534
|
+
*/
|
|
15535
|
+
isEditable: boolean;
|
|
15536
|
+
/**
|
|
15537
|
+
* Text of the selection that the context menu was invoked on.
|
|
15538
|
+
*/
|
|
15539
|
+
selectionText: string;
|
|
15540
|
+
/**
|
|
15541
|
+
* Title text of the selection that the context menu was invoked on.
|
|
15542
|
+
*/
|
|
15543
|
+
titleText: string;
|
|
15544
|
+
/**
|
|
15545
|
+
* Alt text of the selection that the context menu was invoked on.
|
|
15546
|
+
*/
|
|
15547
|
+
altText: string;
|
|
15548
|
+
/**
|
|
15549
|
+
* Suggested filename to be used when saving file through 'Save Link As' option of
|
|
15550
|
+
* context menu.
|
|
15551
|
+
*/
|
|
15552
|
+
suggestedFilename: string;
|
|
15553
|
+
/**
|
|
15554
|
+
* Rect representing the coordinates in the document space of the selection.
|
|
15555
|
+
*/
|
|
15556
|
+
selectionRect: Rectangle;
|
|
15557
|
+
/**
|
|
15558
|
+
* Start position of the selection text.
|
|
15559
|
+
*/
|
|
15560
|
+
selectionStartOffset: number;
|
|
15561
|
+
/**
|
|
15562
|
+
* The referrer policy of the frame on which the menu is invoked.
|
|
15563
|
+
*/
|
|
15564
|
+
referrerPolicy: Referrer;
|
|
15565
|
+
/**
|
|
15566
|
+
* The misspelled word under the cursor, if any.
|
|
15567
|
+
*/
|
|
15568
|
+
misspelledWord: string;
|
|
15569
|
+
/**
|
|
15570
|
+
* An array of suggested words to show the user to replace the `misspelledWord`.
|
|
15571
|
+
* Only available if there is a misspelled word and spellchecker is enabled.
|
|
15572
|
+
*/
|
|
15573
|
+
dictionarySuggestions: string[];
|
|
15574
|
+
/**
|
|
15575
|
+
* The character encoding of the frame on which the menu was invoked.
|
|
15576
|
+
*/
|
|
15577
|
+
frameCharset: string;
|
|
15578
|
+
/**
|
|
15579
|
+
* If the context menu was invoked on an input field, the type of that field.
|
|
15580
|
+
* Possible values are `none`, `plainText`, `password`, `other`.
|
|
15581
|
+
*/
|
|
15582
|
+
inputFieldType: string;
|
|
15583
|
+
/**
|
|
15584
|
+
* If the context is editable, whether or not spellchecking is enabled.
|
|
15585
|
+
*/
|
|
15586
|
+
spellcheckEnabled: boolean;
|
|
15587
|
+
/**
|
|
15588
|
+
* Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
|
|
15589
|
+
* `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
|
|
15590
|
+
* `adjustSelection`, or `adjustSelectionReset`.
|
|
15591
|
+
*/
|
|
15592
|
+
menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
|
|
15593
|
+
/**
|
|
15594
|
+
* The flags for the media element the context menu was invoked on.
|
|
15595
|
+
*/
|
|
15596
|
+
mediaFlags: MediaFlags;
|
|
15597
|
+
/**
|
|
15598
|
+
* These flags indicate whether the renderer believes it is able to perform the
|
|
15599
|
+
* corresponding action.
|
|
15600
|
+
*/
|
|
15601
|
+
editFlags: EditFlags;
|
|
15602
|
+
}
|
|
15603
|
+
|
|
15475
15604
|
interface WebPreferences {
|
|
15476
15605
|
/**
|
|
15477
15606
|
* Whether to enable DevTools. If it is set to `false`, can not use
|
|
@@ -15813,6 +15942,7 @@ declare namespace Electron {
|
|
|
15813
15942
|
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
|
15814
15943
|
type Config = Electron.Config;
|
|
15815
15944
|
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
|
15945
|
+
type ContextMenuEvent = Electron.ContextMenuEvent;
|
|
15816
15946
|
type ContextMenuParams = Electron.ContextMenuParams;
|
|
15817
15947
|
type CookiesGetFilter = Electron.CookiesGetFilter;
|
|
15818
15948
|
type CookiesSetDetails = Electron.CookiesSetDetails;
|
|
@@ -15940,6 +16070,7 @@ declare namespace Electron {
|
|
|
15940
16070
|
type Margins = Electron.Margins;
|
|
15941
16071
|
type MediaFlags = Electron.MediaFlags;
|
|
15942
16072
|
type PageRanges = Electron.PageRanges;
|
|
16073
|
+
type Params = Electron.Params;
|
|
15943
16074
|
type WebPreferences = Electron.WebPreferences;
|
|
15944
16075
|
type DefaultFontFamily = Electron.DefaultFontFamily;
|
|
15945
16076
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
@@ -16079,6 +16210,7 @@ declare namespace Electron {
|
|
|
16079
16210
|
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
|
16080
16211
|
type Config = Electron.Config;
|
|
16081
16212
|
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
|
16213
|
+
type ContextMenuEvent = Electron.ContextMenuEvent;
|
|
16082
16214
|
type ContextMenuParams = Electron.ContextMenuParams;
|
|
16083
16215
|
type CookiesGetFilter = Electron.CookiesGetFilter;
|
|
16084
16216
|
type CookiesSetDetails = Electron.CookiesSetDetails;
|
|
@@ -16206,6 +16338,7 @@ declare namespace Electron {
|
|
|
16206
16338
|
type Margins = Electron.Margins;
|
|
16207
16339
|
type MediaFlags = Electron.MediaFlags;
|
|
16208
16340
|
type PageRanges = Electron.PageRanges;
|
|
16341
|
+
type Params = Electron.Params;
|
|
16209
16342
|
type WebPreferences = Electron.WebPreferences;
|
|
16210
16343
|
type DefaultFontFamily = Electron.DefaultFontFamily;
|
|
16211
16344
|
type BluetoothDevice = Electron.BluetoothDevice;
|
|
@@ -16297,6 +16430,7 @@ declare namespace Electron {
|
|
|
16297
16430
|
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
|
16298
16431
|
type Config = Electron.Config;
|
|
16299
16432
|
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
|
16433
|
+
type ContextMenuEvent = Electron.ContextMenuEvent;
|
|
16300
16434
|
type ContextMenuParams = Electron.ContextMenuParams;
|
|
16301
16435
|
type CookiesGetFilter = Electron.CookiesGetFilter;
|
|
16302
16436
|
type CookiesSetDetails = Electron.CookiesSetDetails;
|
|
@@ -16424,6 +16558,7 @@ declare namespace Electron {
|
|
|
16424
16558
|
type Margins = Electron.Margins;
|
|
16425
16559
|
type MediaFlags = Electron.MediaFlags;
|
|
16426
16560
|
type PageRanges = Electron.PageRanges;
|
|
16561
|
+
type Params = Electron.Params;
|
|
16427
16562
|
type WebPreferences = Electron.WebPreferences;
|
|
16428
16563
|
type DefaultFontFamily = Electron.DefaultFontFamily;
|
|
16429
16564
|
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.3",
|
|
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",
|