electron 13.5.0 → 13.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/electron.d.ts +134 -3
  2. package/package.json +1 -1
package/electron.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Electron 13.5.0
1
+ // Type definitions for Electron 13.6.1
2
2
  // Project: http://electronjs.org/
3
3
  // Definitions by: The Electron Team <https://github.com/electron/electron>
4
4
  // Definitions: https://github.com/electron/electron-typescript-definitions
@@ -2254,9 +2254,9 @@ Calling `event.preventDefault()` will prevent the menu from being displayed.
2254
2254
  */
2255
2255
  getOpacity(): number;
2256
2256
  /**
2257
- * The parent window.
2257
+ * The parent window or `null` if there is no parent.
2258
2258
  */
2259
- getParentWindow(): BrowserWindow;
2259
+ getParentWindow(): (BrowserWindow) | (null);
2260
2260
  /**
2261
2261
  * Contains the window's current position.
2262
2262
  */
@@ -11322,6 +11322,11 @@ Calling `event.preventDefault()` does __NOT__ have any effect.
11322
11322
  */
11323
11323
  addEventListener(event: 'devtools-focused', listener: (event: Event) => void, useCapture?: boolean): this;
11324
11324
  removeEventListener(event: 'devtools-focused', listener: (event: Event) => void): this;
11325
+ /**
11326
+ * Emitted when there is a new context menu that needs to be handled.
11327
+ */
11328
+ addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
11329
+ removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
11325
11330
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
11326
11331
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
11327
11332
  removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
@@ -12309,6 +12314,10 @@ See webContents.sendInputEvent for detailed description of `event` object.
12309
12314
  sourceId: string;
12310
12315
  }
12311
12316
 
12317
+ interface ContextMenuEvent extends Event {
12318
+ params: Params;
12319
+ }
12320
+
12312
12321
  interface ContextMenuParams {
12313
12322
  /**
12314
12323
  * x coordinate.
@@ -13823,6 +13832,10 @@ See webContents.sendInputEvent for detailed description of `event` object.
13823
13832
  * The url of the `openExternal` request.
13824
13833
  */
13825
13834
  externalURL?: string;
13835
+ /**
13836
+ * The security origin of the `media` request.
13837
+ */
13838
+ securityOrigin?: string;
13826
13839
  /**
13827
13840
  * The types of media access being requested, elements can be `video` or `audio`
13828
13841
  */
@@ -14868,6 +14881,118 @@ See webContents.sendInputEvent for detailed description of `event` object.
14868
14881
  to: number;
14869
14882
  }
14870
14883
 
14884
+ interface Params {
14885
+ /**
14886
+ * x coordinate.
14887
+ */
14888
+ x: number;
14889
+ /**
14890
+ * y coordinate.
14891
+ */
14892
+ y: number;
14893
+ /**
14894
+ * URL of the link that encloses the node the context menu was invoked on.
14895
+ */
14896
+ linkURL: string;
14897
+ /**
14898
+ * Text associated with the link. May be an empty string if the contents of the
14899
+ * link are an image.
14900
+ */
14901
+ linkText: string;
14902
+ /**
14903
+ * URL of the top level page that the context menu was invoked on.
14904
+ */
14905
+ pageURL: string;
14906
+ /**
14907
+ * URL of the subframe that the context menu was invoked on.
14908
+ */
14909
+ frameURL: string;
14910
+ /**
14911
+ * Source URL for the element that the context menu was invoked on. Elements with
14912
+ * source URLs are images, audio and video.
14913
+ */
14914
+ srcURL: string;
14915
+ /**
14916
+ * Type of the node the context menu was invoked on. Can be `none`, `image`,
14917
+ * `audio`, `video`, `canvas`, `file` or `plugin`.
14918
+ */
14919
+ mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
14920
+ /**
14921
+ * Whether the context menu was invoked on an image which has non-empty contents.
14922
+ */
14923
+ hasImageContents: boolean;
14924
+ /**
14925
+ * Whether the context is editable.
14926
+ */
14927
+ isEditable: boolean;
14928
+ /**
14929
+ * Text of the selection that the context menu was invoked on.
14930
+ */
14931
+ selectionText: string;
14932
+ /**
14933
+ * Title text of the selection that the context menu was invoked on.
14934
+ */
14935
+ titleText: string;
14936
+ /**
14937
+ * Alt text of the selection that the context menu was invoked on.
14938
+ */
14939
+ altText: string;
14940
+ /**
14941
+ * Suggested filename to be used when saving file through 'Save Link As' option of
14942
+ * context menu.
14943
+ */
14944
+ suggestedFilename: string;
14945
+ /**
14946
+ * Rect representing the coordinates in the document space of the selection.
14947
+ */
14948
+ selectionRect: Rectangle;
14949
+ /**
14950
+ * Start position of the selection text.
14951
+ */
14952
+ selectionStartOffset: number;
14953
+ /**
14954
+ * The referrer policy of the frame on which the menu is invoked.
14955
+ */
14956
+ referrerPolicy: Referrer;
14957
+ /**
14958
+ * The misspelled word under the cursor, if any.
14959
+ */
14960
+ misspelledWord: string;
14961
+ /**
14962
+ * An array of suggested words to show the user to replace the `misspelledWord`.
14963
+ * Only available if there is a misspelled word and spellchecker is enabled.
14964
+ */
14965
+ dictionarySuggestions: string[];
14966
+ /**
14967
+ * The character encoding of the frame on which the menu was invoked.
14968
+ */
14969
+ frameCharset: string;
14970
+ /**
14971
+ * If the context menu was invoked on an input field, the type of that field.
14972
+ * Possible values are `none`, `plainText`, `password`, `other`.
14973
+ */
14974
+ inputFieldType: string;
14975
+ /**
14976
+ * If the context is editable, whether or not spellchecking is enabled.
14977
+ */
14978
+ spellcheckEnabled: boolean;
14979
+ /**
14980
+ * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
14981
+ * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
14982
+ * `adjustSelection`, or `adjustSelectionReset`.
14983
+ */
14984
+ menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
14985
+ /**
14986
+ * The flags for the media element the context menu was invoked on.
14987
+ */
14988
+ mediaFlags: MediaFlags;
14989
+ /**
14990
+ * These flags indicate whether the renderer believes it is able to perform the
14991
+ * corresponding action.
14992
+ */
14993
+ editFlags: EditFlags;
14994
+ }
14995
+
14871
14996
  interface WebPreferences {
14872
14997
  /**
14873
14998
  * Whether to enable DevTools. If it is set to `false`, can not use
@@ -15228,6 +15353,7 @@ See webContents.sendInputEvent for detailed description of `event` object.
15228
15353
  type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
15229
15354
  type Config = Electron.Config;
15230
15355
  type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
15356
+ type ContextMenuEvent = Electron.ContextMenuEvent;
15231
15357
  type ContextMenuParams = Electron.ContextMenuParams;
15232
15358
  type CookiesGetFilter = Electron.CookiesGetFilter;
15233
15359
  type CookiesSetDetails = Electron.CookiesSetDetails;
@@ -15351,6 +15477,7 @@ See webContents.sendInputEvent for detailed description of `event` object.
15351
15477
  type Margins = Electron.Margins;
15352
15478
  type MediaFlags = Electron.MediaFlags;
15353
15479
  type PageRanges = Electron.PageRanges;
15480
+ type Params = Electron.Params;
15354
15481
  type WebPreferences = Electron.WebPreferences;
15355
15482
  type DefaultFontFamily = Electron.DefaultFontFamily;
15356
15483
  type BluetoothDevice = Electron.BluetoothDevice;
@@ -15488,6 +15615,7 @@ See webContents.sendInputEvent for detailed description of `event` object.
15488
15615
  type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
15489
15616
  type Config = Electron.Config;
15490
15617
  type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
15618
+ type ContextMenuEvent = Electron.ContextMenuEvent;
15491
15619
  type ContextMenuParams = Electron.ContextMenuParams;
15492
15620
  type CookiesGetFilter = Electron.CookiesGetFilter;
15493
15621
  type CookiesSetDetails = Electron.CookiesSetDetails;
@@ -15611,6 +15739,7 @@ See webContents.sendInputEvent for detailed description of `event` object.
15611
15739
  type Margins = Electron.Margins;
15612
15740
  type MediaFlags = Electron.MediaFlags;
15613
15741
  type PageRanges = Electron.PageRanges;
15742
+ type Params = Electron.Params;
15614
15743
  type WebPreferences = Electron.WebPreferences;
15615
15744
  type DefaultFontFamily = Electron.DefaultFontFamily;
15616
15745
  type BluetoothDevice = Electron.BluetoothDevice;
@@ -15701,6 +15830,7 @@ See webContents.sendInputEvent for detailed description of `event` object.
15701
15830
  type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
15702
15831
  type Config = Electron.Config;
15703
15832
  type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
15833
+ type ContextMenuEvent = Electron.ContextMenuEvent;
15704
15834
  type ContextMenuParams = Electron.ContextMenuParams;
15705
15835
  type CookiesGetFilter = Electron.CookiesGetFilter;
15706
15836
  type CookiesSetDetails = Electron.CookiesSetDetails;
@@ -15824,6 +15954,7 @@ See webContents.sendInputEvent for detailed description of `event` object.
15824
15954
  type Margins = Electron.Margins;
15825
15955
  type MediaFlags = Electron.MediaFlags;
15826
15956
  type PageRanges = Electron.PageRanges;
15957
+ type Params = Electron.Params;
15827
15958
  type WebPreferences = Electron.WebPreferences;
15828
15959
  type DefaultFontFamily = Electron.DefaultFontFamily;
15829
15960
  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": "13.5.0",
19
+ "version": "13.6.1",
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",