Skip to content

Commit

Permalink
Update types to reflect BrowserView support (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeq committed Feb 22, 2021
1 parent 88febae commit 3b7fbb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/// <reference types="node"/>
import {
BrowserWindow,
BrowserView,
WebviewTag,
ContextMenuParams,
MenuItemConstructorOptions,
Expand Down Expand Up @@ -114,7 +115,7 @@ declare namespace contextMenu {
Window or WebView to add the context menu to.
When not specified, the context menu will be added to all existing and new windows.
*/
readonly window?: BrowserWindow | WebviewTag | WebContents;
readonly window?: BrowserWindow | BrowserView | WebviewTag | WebContents;

/**
Should return an array of [menu items](https://electronjs.org/docs/api/menu-item) to be prepended to the context menu.
Expand All @@ -124,7 +125,7 @@ declare namespace contextMenu {
readonly prepend?: (
defaultActions: Actions,
params: ContextMenuParams,
browserWindow: BrowserWindow | WebviewTag | WebContents
browserWindow: BrowserWindow | BrowserView | WebviewTag | WebContents
) => MenuItemConstructorOptions[];

/**
Expand All @@ -135,7 +136,7 @@ declare namespace contextMenu {
readonly append?: (
defaultActions: Actions,
param: ContextMenuParams,
browserWindow: BrowserWindow | WebviewTag | WebContents
browserWindow: BrowserWindow | BrowserView | WebviewTag | WebContents
) => MenuItemConstructorOptions[];

/**
Expand Down Expand Up @@ -269,7 +270,7 @@ declare namespace contextMenu {
readonly menu?: (
defaultActions: Actions,
params: ContextMenuParams,
browserWindow: BrowserWindow | WebviewTag | WebContents,
browserWindow: BrowserWindow | BrowserView | WebviewTag | WebContents,
dictionarySuggestions: MenuItemConstructorOptions[] // eslint-disable-line @typescript-eslint/prefer-readonly-parameter-types
) => MenuItemConstructorOptions[];
}
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Type: `object`

#### window

Type: `BrowserWindow | WebViewTag | WebContents`
Type: `BrowserWindow | BrowserView | WebViewTag | WebContents`

Window or WebView to add the context menu to.

Expand Down

0 comments on commit 3b7fbb9

Please sign in to comment.