Closed wJoenn closed 1 year ago
Hi! Don't think that's possible globally :/
You mean it's not possible to declare types globally ? Nuxt does it a lot by doing
declare globally {
...
}
Wouldn't that suffise ?
No, I mean I would have to do it for every type manually, I can't make imports types global on the fly, and it will polute all the workspace.
But maybe you can do it by having a custom .d.ts
where you declare the type globally and importing it from typed router
Yeah that's what I started doing but I wondered if there wasn't a way. Thanks for the answers Victor ! Cheers
Is there a way to add some types to auto imports ? I wanna use
RoutePathSchema
as a prop type for a Link component because it'd be very helpful to have a TS error if I type a path wrong or something instead of just having the prop being a string And I'm able to use it by importing itBut ideally I'd like to have this type auto imported instead of having to import it everywhere 🤔 Is there a way to do that ?
I tried adding
.nuxt/typed-router
to the list or imported dirs in nuxt config but that's not working