-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Export Component interface #162
Comments
What version of Nuxt Components do you use? |
I was specifying ^2.1.2 and using 2.2.1 in
but I want to be able to type my hook function like this:
So right now I've copied this interface into my local file so I can use it like that. A while back, this was exported straight from this module's dist files. I hope I'm being clear enough and as I say, perhaps this is a non-issue or I'm doing something wrong, but it would certainly be nice to be able to type the function parameter. |
I'm thinking I should just be able to add to my tsconfig something like this right to import the types?
Where you see I've added |
Now I see your situation. As for hooks defined with So, you are right and Nuxt Component still doesn't export types of hook functions. I guess this is due to some configuration of siroc which builds the module. Lines 39 to 40 in f8667b6
|
Hi @nozomuikuta - yes you're correct in every comment here. In a previous version (a while back) these were exported so perhaps it was just Siroc that had an update. If what I'm doing is the only solution then I'll roll with that. Thanks for your time helping with this. If there's no better solution in the Siroc config should I close this issue now? |
I've found that @pi0 has already raised this issue with Siroc here danielroe/siroc#203 thanks for your help! |
You used to export the Component interface in the dist index.d.ts - this is useful when using typestript to hook into the
compoents:extend
event so we know what the objects will consist of.This may be a really basic issue and perhaps there's a way to just use the same types from a node_module's type definition files - is this the case or could you export this interface again?
Sorry for this basic question, hopefully for someone with more knowledge of TS than me, this will be really obvious.
The text was updated successfully, but these errors were encountered: