electron/lib/browser/api/share-menu.ts
Samuel Attard 122685194a
build: add import/order eslint rule (#44085)
* build: add import/order eslint rule

* chore: run lint:js --fix
2024-10-02 19:10:44 -07:00

22 lines
517 B
TypeScript

import { BrowserWindow, Menu, SharingItem, PopupOptions } from 'electron/main';
import { EventEmitter } from 'events';
class ShareMenu extends EventEmitter implements Electron.ShareMenu {
private menu: Menu;
constructor (sharingItem: SharingItem) {
super();
this.menu = new (Menu as any)({ sharingItem });
}
popup (options?: PopupOptions) {
this.menu.popup(options);
}
closePopup (browserWindow?: BrowserWindow) {
this.menu.closePopup(browserWindow);
}
}
export default ShareMenu;