Auto import types
How can I get types in my root types folder to be auto imported? I've tried both adding it to the nuxt imports.dirs config array as well as the nuxt config typescript.tsConfig.include array
4 Replies
Have you tried just adding a declaration file?
I have my common.d.ts which exports an interface. If I use declare interface instead is that the correct way?
You don’t declare interfaces. You just write them. Technically you don’t need to export either. They will be globally available (assuming you’re using vscode and Vue official extension)
So I have a file
./typess/common.d.ts
and in it I have type FooBar = { foo: string, bar: number }
but FooBar is not defined in any of my source files