Repository: electron
Issue: [Bug]: Menu.getApplicationMenu() returns menu with invalid roles
Labels: platform/macOS,component/menu,bug :beetle:,31-x-y,32-x-y

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

31.0.1

### What operating system are you using?

macOS

### Operating System Version

macOS Sonoma 14.5

### What arch are you using?

arm64 (including Apple Silicon)

### Last Known Working Electron version

_No response_

### Expected Behavior

Menu.getApplicationMenu() returns menu with valid roles.

### Actual Behavior

As titled. Since this is TypeScript's type issue I created a Stackblitz project here for a reproduction.

https://stackblitz.com/~/github.com/takuyahara/electron-menu-issue?file=src/main.ts:L25

![image](https://github.com/electron/electron/assets/46240835/234f5e8a-89d2-4e77-b5d3-27f52e8dd67c)

<details>
<summary>console.log in L17 results the following; every role is entirely lower case if exists.</summary>

```
[
  {
    "role": "appmenu",
    "subItems": [
      {
        "role": "about"
      },
      {
        "role": null
      },
      {
        "role": "services"
      },
      {
        "role": null
      },
      {
        "role": "hide"
      },
      {
        "role": "hideothers"
      },
      {
        "role": "unhide"
      },
      {
        "role": null
      },
      {
        "role": "quit"
      }
    ]
  },
  {
    "role": "filemenu",
    "subItems": [
      {
        "role": "close"
      }
    ]
  },
  {
    "role": "editmenu",
    "subItems": [
      {
        "role": "undo"
      },
      {
        "role": "redo"
      },
      {
        "role": null
      },
      {
        "role": "cut"
      },
      {
        "role": "copy"
      },
      {
        "role": "paste"
      },
      {
        "role": "pasteandmatchstyle"
      },
      {
        "role": "delete"
      },
      {
        "role": "selectall"
      },
      {
        "role": null
      },
      {
        "role": null
      },
      {
        "role": null
      }
    ]
  },
  {
    "role": "viewmenu",
    "subItems": [
      {
        "role": "reload"
      },
      {
        "role": "forcereload"
      },
      {
        "role": "toggledevtools"
      },
      {
        "role": null
      },
      {
        "role": "resetzoom"
      },
      {
        "role": "zoomin"
      },
      {
        "role": "zoomout"
      },
      {
        "role": null
      },
      {
        "role": "togglefullscreen"
      }
    ]
  },
  {
    "role": "windowmenu",
    "subItems": [
      {
        "role": "minimize"
      },
      {
        "role": "zoom"
      },
      {
        "role": null
      },
      {
        "role": "front"
      }
    ]
  },
  {
    "role": "help",
    "subItems": [
      {
        "role": null
      },
      {
        "role": null
      },
      {
        "role": null
      },
      {
        "role": null
      }
    ]
  }
]
```
</details>

But comparing role with a lower cased string causes the following error.
```
This comparison appears to be unintentional because the types '"undo" | "redo" | "cut" | "copy" | "paste" | "pasteAndMatchStyle" | "delete" | "selectAll" | "reload" | "forceReload" | "toggleDevTools" | "resetZoom" | "zoomIn" | "zoomOut" | ... 29 more ... | "windowMenu"' and '"viewmenu"' have no overlap.
```

As defined in `electron.d.ts` role must be camel cased, so the returned menu by `Menu.getApplicationMenu()` seems wrong.

<img width="689" alt="image" src="https://github.com/electron/electron/assets/46240835/b048e07d-3808-420e-96ae-d3638b9f9127">



### Testcase Gist URL

_No response_

### Additional Information

_No response_