Repository: electron/electron (language: cpp)

Issue:
[Bug]: MessageBoxOptions type declaration mistake, string is not allowed in icon.
### 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

16.0.6

### What operating system are you using?

macOS

### Operating System Version

11.6.2

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

I think it's a type declaration mistake in MessageBox Options.
MessageBoxOptionsの型宣言ミスだと思います。

  interface MessageBoxOptions {
    icon?: (NativeImage) | (string);

I think it's a type declaration mistake in MessageBox Options.
With MessageBoxSyncOptions, icon allows strings, but MessageBoxOptions is only NativeImage.
MessageBoxSyncOptionsならiconはstringも許すのですが、MessageBoxOptionsはNativeImageのみになっています。

  interface MessageBoxSyncOptions {
    icon?: (NativeImage) | (string);


### Actual Behavior

  interface MessageBoxOptions {
:
    icon?: NativeImage;
:

### Testcase Gist URL

_No response_

### Additional Information

_No response_


Discussion / hints:
I forgot to write it, and I made a mistake in the manual.
書き忘れました、マニュアルもミスしています。

dialog | Electron https://www.electronjs.org/docs/latest/api/dialog#dialogshowmessageboxbrowserwindow-options
Hey @famibee, thanks for reporting this issue! You're right, I see the discrepancy between MessageBox and MessageBoxSync:

MessageBoxOptions.icon?: NativeImage ([docs link](https://www.electronjs.org/docs/latest/api/dialog#dialogshowmessageboxbrowserwindow-options))
MessageBoxSyncOptions.icon?: NativeImage | string ([docs link](https://www.electronjs.org/docs/latest/api/dialog#dialogshowmessageboxsyncbrowserwindow-options))

We'll see if we can sync these types so that icon takes the same options 🙇‍♀️  Thanks for spotting this!
you're welcome 😘
This goes back to https://github.com/electron/electron/pull/19782 which added `| string` for the sync variant but not for the async variant. Probably both should have them for the same reasons listed in 19782

Fix patch:
diff --git a/docs/api/dialog.md b/docs/api/dialog.md
index 90eed112c92df..bc536e15baee1 100644
--- a/docs/api/dialog.md
+++ b/docs/api/dialog.md
@@ -285,7 +285,7 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
     include a checkbox with the given label.
   * `checkboxChecked` boolean (optional) - Initial checked state of the
     checkbox. `false` by default.
-  * `icon` [NativeImage](native-image.md) (optional)
+  * `icon` ([NativeImage](native-image.md) | string) (optional)
   * `textWidth` Integer (optional) _macOS_ - Custom width of the text in the message box.
   * `cancelId` Integer (optional) - The index of the button to be used to cancel the dialog, via
     the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the


Test patch: