N
Nuxt3mo ago
bnason

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
Cue
Cue3mo ago
Have you tried just adding a declaration file?
bnason
bnasonOP3mo ago
I have my common.d.ts which exports an interface. If I use declare interface instead is that the correct way?
Cue
Cue3mo ago
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)
bnason
bnasonOP3mo ago
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
Want results from more Discord servers?
Add your server