fix: correct type definitions for ElMessageBox#23518
Conversation
📝 WalkthroughWalkthroughThis PR changes the exported type Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/components/message-box/src/message-box.type.ts`:
- Around line 213-226: The type ElMessageBoxShortcutMethod is currently a union
of two callable signatures which allows a function to match only one signature;
change it to an intersection of the two function types so a single function (as
implemented by messageBoxFactory and used by alert/confirm/prompt) exposes both
call signatures. Update the declaration of ElMessageBoxShortcutMethod to use &
between the two function signatures (keeping the same parameter lists and return
type) so the shortcut methods accept both (message, options?, appContext?) and
(message, title, options?, appContext?) forms.
|
🧪 Playground Preview: https://element-plus.run/?pr=23518 |
faca6df to
6806e62
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Dsaquel
left a comment
There was a problem hiding this comment.
Thanks, can you update only the line concerned please.
|
@Dsaquel done! Reverted other changes and updated MR description. |
|
@jaa134 Thanks for your contribution! ❤️ |

Please make sure these boxes are checked before submitting your PR, thank you!
devbranch.What was done?
ElMessageBoxShortcutMethod. Use union (|) instead of intersection (&) for type definition.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.