-
Notifications
You must be signed in to change notification settings - Fork 93
fix(dialogs/spawnDialog): enhance spawnDialog
types
#6781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dialogs/spawnDialog): enhance spawnDialog
types
#6781
Conversation
Signed-off-by: mattersj <[email protected]>
Signed-off-by: mattersj <[email protected]>
Signed-off-by: mattersj <[email protected]>
…r `NoInfer` Signed-off-by: mattersj <[email protected]>
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 💙
src/functions/dialog/index.ts
Outdated
import { createApp } from 'vue' | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
import { createApp, type Component } from 'vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer to always separate type and non-type imports (not included in the old eslint config, using in this repo).
import { createApp, type Component } from 'vue' | |
import type { Component } from 'vue' | |
import { createApp } from 'vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, fixed.
type DialogComponent<T extends Component> = 'onClose' extends keyof ComponentProps<T> | ||
? T | ||
: 'Please provide a Dialog Component that supports `@close` event' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the best never
I've ever seen
spawnDialog
typesspawnDialog
types
Signed-off-by: mattersj <[email protected]>
2177ab4
to
b668872
Compare
Signed-off-by: mattersj <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
☑️ Resolves
spawnDialog
types:@close
event can be passed tospawnDialog
, otherwise an error is thrown on a type level suggesting what went wrong@close
event's payloadThe implementation passes all the test cases from #6770 (comment)
🖼️ Screenshots
🚧 Tasks
🏁 Checklist
stable8
for maintained Vue 2 version or not applicable