import { app , Menu , MenuItemConstructorOptions } from "electron" ; export function createAppMenu ( ) { if ( process . platform !== "darwin" ) { return null ; } const macAppMenuItem = { label : app . getName ( ) , submenu : [ { label : "About" , role : "about" } , { type : "separator" } , { label : "Quit" , role : "quit" } ] } ; const appMenu = Menu . buildFromTemplate ( [ macAppMenuItem , { label : "Edit" , submenu : [ { role : "undo" } , { role : "redo" } , { type : "separator" } , { role : "cut" } , { role : "copy" } , { role : "paste" } , { role : "selectAll" } ] } ] ) ; return appMenu ; }