-
Notifications
You must be signed in to change notification settings - Fork 244
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
Expose typings for Plugins #269
Comments
Oh cool, this is a good idea. I will give this one at try. If you want to make a PR before I do, go for it 👍 |
Just to confirm @posva, are you referring to
We should probably support both with correct types where possible. |
Edit: Seems VTU plugins was not actually working properly in the first place, fixed: #276 Are you using this for the mock router? Sorry I did not have time to work on that lately... :( |
Yes! function myPlugin(wrapper: Instance, options: { n: number }) {}
// @ts-error
config.plugins.VueWrapper.install(myPlugin, {n: true}) That's why I was referring to https://github.com/vuejs/vue-next/pull/2758/files I haven't had much time for the router mock, no worries. I was trying to release an initial version soon to get some feedback from the community and add features |
Cool, I can update the typings on top of #276. No problem, I will try test the mock router soon (or have a hack on it if it's not ready yet). |
Sorry for the delay! I submitted a PR |
I think it would be helpful to expose the
Instance
type so plugins can type the argument (https://vue-test-utils.vuejs.org/v2/guide/plugins.html#writing-a-plugin) as well as adapting theinstall
function to infer the options parameter:Similar to vuejs/core#2758
The text was updated successfully, but these errors were encountered: