import MenuItem = Electron . MenuItem ; export class Menus { /**
     * Find an id within a given subMenu item.  Electron has broken bindings so
     * we have to do this by ourselves for the most part.
     *
     */ public static find ( items , id ) { if ( ! items ) { return undefined ; } const filtered = items . filter ( ( current ) => current . id === id ) ; return filtered . pop ( ) ; } param menuItem public static submenu ( menuItem ) { if ( ! menuItem ) { return undefined ; } return ( < any > menuItem ) . submenu . items ; } public static setEnabled ( menuItem , enabled ) { ( < any > menuItem ) . enabled = enabled ; } public static setVisible ( menuItem , visible ) { ( < any > menuItem ) . visible = visible ; } }