1- // Type definitions for Electron 38.0.0-alpha.6 +wvcus
1+ // Type definitions for Electron 38.0.0-alpha.7 +wvcus
22// Project: http://electronjs.org/
33// Definitions by: The Electron Team <https://github.com/electron/electron>
44// Definitions: https://github.com/electron/typescript-definitions
@@ -5759,10 +5759,11 @@ declare namespace Electron {
57595759 /**
57605760 * Prevents the window contents from being captured by other apps.
57615761 *
5762- * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
5763- * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
5764- * version 2004 and up the window will be removed from capture entirely, older
5765- * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
5762+ * On macOS it sets the NSWindow's `sharingType` to `NSWindowSharingNone`. On
5763+ * Windows it calls `SetWindowDisplayAffinity` with `WDA_EXCLUDEFROMCAPTURE`. For
5764+ * Windows 10 version 2004 and up the window will be removed from capture entirely,
5765+ * older Windows versions behave as if `WDA_MONITOR` is applied capturing a black
5766+ * window.
57665767 *
57675768 * @platform darwin,win32
57685769 */
@@ -7830,6 +7831,9 @@ declare namespace Electron {
78307831 /**
78317832 * Sets the string to be displayed in the dock’s badging area.
78327833 *
7834+ * > [!IMPORTANT] You need to ensure that your application has the permission to
7835+ * display notifications for this method to work.
7836+ *
78337837 * @platform darwin
78347838 */
78357839 setBadge(text: string): void;
@@ -8233,7 +8237,7 @@ declare namespace Electron {
82338237 * still return `false`. This behavior is intended by operating systems, since they
82348238 * don't want applications to fight for global shortcuts.
82358239 */
8236- isRegistered(accelerator: Accelerator ): boolean;
8240+ isRegistered(accelerator: string ): boolean;
82378241 /**
82388242 * Whether or not the shortcut was registered successfully.
82398243 *
@@ -8252,7 +8256,7 @@ declare namespace Electron {
82528256 * * "Media Previous Track"
82538257 * * "Media Stop"
82548258 */
8255- register(accelerator: Accelerator , callback: () => void): boolean;
8259+ register(accelerator: string , callback: () => void): boolean;
82568260 /**
82578261 * Registers a global shortcut of all `accelerator` items in `accelerators`. The
82588262 * `callback` is called when any of the registered shortcuts are pressed by the
@@ -8270,11 +8274,11 @@ declare namespace Electron {
82708274 * * "Media Previous Track"
82718275 * * "Media Stop"
82728276 */
8273- registerAll(accelerators: Accelerator [], callback: () => void): void;
8277+ registerAll(accelerators: string [], callback: () => void): void;
82748278 /**
82758279 * Unregisters the global shortcut of `accelerator`.
82768280 */
8277- unregister(accelerator: Accelerator ): void;
8281+ unregister(accelerator: string ): void;
82788282 /**
82798283 * Unregisters all of the global shortcuts.
82808284 */
@@ -9109,8 +9113,8 @@ declare namespace Electron {
91099113 // Docs: https://electronjs.org/docs/api/structures/keyboard-input-event
91109114
91119115 /**
9112- * The character that will be sent as the keyboard event. Should only use the valid
9113- * key codes in Accelerator .
9116+ * The character that will be sent as the keyboard event. Should only use valid
9117+ * Accelerator key codes.
91149118 */
91159119 keyCode: string;
91169120 /**
@@ -9252,13 +9256,15 @@ declare namespace Electron {
92529256 insert(pos: number, menuItem: MenuItem): void;
92539257 /**
92549258 * Pops up this menu as a context menu in the `BaseWindow`.
9259+ *
9260+ * > [!TIP] For more details, see the Context Menu guide.
92559261 */
92569262 popup(options?: PopupOptions): void;
92579263 /**
92589264 * A `MenuItem[]` array containing the menu's items.
92599265 *
9260- * Each `Menu` consists of multiple `MenuItem`s and each `MenuItem` can have a
9261- * submenu.
9266+ * Each `Menu` consists of multiple `MenuItem` instances and each `MenuItem` can
9267+ * nest a `Menu` into its ` submenu` property .
92629268 */
92639269 items: MenuItem[];
92649270 }
@@ -9276,7 +9282,7 @@ declare namespace Electron {
92769282 */
92779283 accelerator?: Accelerator;
92789284 /**
9279- * A `boolean` indicating whether the item is checked, this property can be
9285+ * A `boolean` indicating whether the item is checked. This property can be
92809286 * dynamically changed.
92819287 *
92829288 * A `checkbox` menu item will toggle the `checked` property on and off when
@@ -9302,7 +9308,7 @@ declare namespace Electron {
93029308 */
93039309 commandId: number;
93049310 /**
9305- * A `boolean` indicating whether the item is enabled, this property can be
9311+ * A `boolean` indicating whether the item is enabled. This property can be
93069312 * dynamically changed.
93079313 */
93089314 enabled: boolean;
@@ -9311,7 +9317,7 @@ declare namespace Electron {
93119317 */
93129318 icon?: (NativeImage) | (string);
93139319 /**
9314- * A `string` indicating the item's unique id, this property can be dynamically
9320+ * A `string` indicating the item's unique id. This property can be dynamically
93159321 * changed.
93169322 */
93179323 id: string;
@@ -9384,7 +9390,7 @@ declare namespace Electron {
93849390 */
93859391 readonly userAccelerator: (Accelerator) | (null);
93869392 /**
9387- * A `boolean` indicating whether the item is visible, this property can be
9393+ * A `boolean` indicating whether the item is visible. This property can be
93889394 * dynamically changed.
93899395 */
93909396 visible: boolean;
@@ -16405,24 +16411,6 @@ declare namespace Electron {
1640516411 * The image data of the whole frame.
1640616412 */
1640716413 image: NativeImage) => void): this;
16408- /**
16409- * Emitted when a plugin process has crashed.
16410- */
16411- on(event: 'plugin-crashed', listener: (event: Event,
16412- name: string,
16413- version: string) => void): this;
16414- off(event: 'plugin-crashed', listener: (event: Event,
16415- name: string,
16416- version: string) => void): this;
16417- once(event: 'plugin-crashed', listener: (event: Event,
16418- name: string,
16419- version: string) => void): this;
16420- addListener(event: 'plugin-crashed', listener: (event: Event,
16421- name: string,
16422- version: string) => void): this;
16423- removeListener(event: 'plugin-crashed', listener: (event: Event,
16424- name: string,
16425- version: string) => void): this;
1642616414 /**
1642716415 * Emitted when the `WebContents` preferred size has changed.
1642816416 *
@@ -17835,8 +17823,14 @@ declare namespace Electron {
1783517823 findFrameByName(name: string): WebFrame;
1783617824 /**
1783717825 * that has the supplied `routingId`, `null` if not found.
17826+ *
17827+ * @deprecated
1783817828 */
1783917829 findFrameByRoutingId(routingId: number): WebFrame;
17830+ /**
17831+ * that has the supplied `frameToken`, `null` if not found.
17832+ */
17833+ findFrameByToken(frameToken: string): WebFrame;
1784017834 /**
1784117835 * The frame element in `webFrame's` document selected by `selector`, `null` would
1784217836 * be returned if `selector` does not select a frame or if the frame is not in the
@@ -17948,6 +17942,13 @@ declare namespace Electron {
1794817942 *
1794917943 */
1795017944 readonly firstChild: (WebFrame) | (null);
17945+ /**
17946+ * A `string` representing the unique frame token in the current renderer process.
17947+ * Distinct WebFrame instances that refer to the same underlying frame will have
17948+ * the same `frameToken`.
17949+ *
17950+ */
17951+ readonly frameToken: string;
1795117952 /**
1795217953 * A `WebFrame | null` representing next sibling frame, the property would be
1795317954 * `null` if `webFrame` is the last frame in its parent or if the next sibling is
@@ -17973,6 +17974,7 @@ declare namespace Electron {
1797317974 * Distinct WebFrame instances that refer to the same underlying frame will have
1797417975 * the same `routingId`.
1797517976 *
17977+ * @deprecated
1797617978 */
1797717979 readonly routingId: number;
1797817980 /**
@@ -18073,6 +18075,12 @@ declare namespace Electron {
1807318075 *
1807418076 */
1807518077 readonly framesInSubtree: WebFrameMain[];
18078+ /**
18079+ * A `string` which uniquely identifies the frame within its associated renderer
18080+ * process. This is equivalent to `webFrame.frameToken`.
18081+ *
18082+ */
18083+ readonly frameToken: string;
1807618084 /**
1807718085 * An `Integer` representing the id of the frame's internal FrameTreeNode instance.
1807818086 * This id is browser-global and uniquely identifies a frame that hosts content.
@@ -18260,12 +18268,6 @@ declare namespace Electron {
1826018268 * RuntimeEnabledFeatures.json5 file.
1826118269 */
1826218270 enableBlinkFeatures?: string;
18263- /**
18264- * Whether the `-electron-corner-smoothing` CSS rule is enabled. Default is `true`.
18265- *
18266- * @experimental
18267- */
18268- enableCornerSmoothingCSS?: boolean;
1826918271 /**
1827018272 * Whether to enable the `paste` execCommand. Default is `false`.
1827118273 *
@@ -18755,11 +18757,6 @@ declare namespace Electron {
1875518757 */
1875618758 addEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void, useCapture?: boolean): this;
1875718759 removeEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void): this;
18758- /**
18759- * Fired when a plugin process is crashed.
18760- */
18761- addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
18762- removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
1876318760 /**
1876418761 * Fired when the WebContents is destroyed.
1876518762 */
@@ -20072,9 +20069,9 @@ declare namespace Electron {
2007220069 /**
2007320070 * Extra string key/value annotations that will be sent along with crash reports
2007420071 * that are generated in the main process. Only string values are supported.
20075- * Crashes generated in child processes will not contain these extra parameters to
20076- * crash reports generated from child processes, call `addExtraParameter` from the
20077- * child process.
20072+ * Crashes generated in child processes will not include these extra parameters. To
20073+ * add extra parameters to crash reports generated from child processes, call
20074+ * `addExtraParameter` from the child process.
2007820075 */
2007920076 extra?: Record<string, string>;
2008020077 /**
@@ -20957,7 +20954,10 @@ declare namespace Electron {
2095720954 * @platform darwin
2095820955 */
2095920956 toolTip?: string;
20960- accelerator?: Accelerator;
20957+ /**
20958+ * An Accelerator string.
20959+ */
20960+ accelerator?: string;
2096120961 icon?: (NativeImage) | (string);
2096220962 /**
2096320963 * If false, the menu item will be greyed out and unclickable.
@@ -21716,11 +21716,6 @@ declare namespace Electron {
2171621716 isMainFrame: boolean;
2171721717 }
2171821718
21719- interface PluginCrashedEvent extends DOMEvent {
21720- name: string;
21721- version: string;
21722- }
21723-
2172421719 interface PopupOptions {
2172521720 /**
2172621721 * Default is the focused window.
@@ -23607,7 +23602,6 @@ declare namespace Electron {
2360723602 type Parameters = Electron.Parameters;
2360823603 type Payment = Electron.Payment;
2360923604 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
23610- type PluginCrashedEvent = Electron.PluginCrashedEvent;
2361123605 type PopupOptions = Electron.PopupOptions;
2361223606 type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
2361323607 type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
@@ -23990,7 +23984,6 @@ declare namespace Electron {
2399023984 type Parameters = Electron.Parameters;
2399123985 type Payment = Electron.Payment;
2399223986 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
23993- type PluginCrashedEvent = Electron.PluginCrashedEvent;
2399423987 type PopupOptions = Electron.PopupOptions;
2399523988 type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
2399623989 type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
@@ -24299,7 +24292,6 @@ declare namespace Electron {
2429924292 type Parameters = Electron.Parameters;
2430024293 type Payment = Electron.Payment;
2430124294 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
24302- type PluginCrashedEvent = Electron.PluginCrashedEvent;
2430324295 type PopupOptions = Electron.PopupOptions;
2430424296 type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
2430524297 type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
@@ -24605,7 +24597,6 @@ declare namespace Electron {
2460524597 type Parameters = Electron.Parameters;
2460624598 type Payment = Electron.Payment;
2460724599 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
24608- type PluginCrashedEvent = Electron.PluginCrashedEvent;
2460924600 type PopupOptions = Electron.PopupOptions;
2461024601 type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
2461124602 type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
@@ -25005,7 +24996,6 @@ declare namespace Electron {
2500524996 type Parameters = Electron.Parameters;
2500624997 type Payment = Electron.Payment;
2500724998 type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
25008- type PluginCrashedEvent = Electron.PluginCrashedEvent;
2500924999 type PopupOptions = Electron.PopupOptions;
2501025000 type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
2501125001 type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
0 commit comments