You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I was writing this, i found a solution that seems to be working:
In ~/utils/types.d.ts, instead of export interface IInterface { }, using declare seems to work. For example:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to create a typescript-file for interfaces and types. I have tried many options found online.
types.d.ts
file in~/utils/
, because this post said it auto-imports.types.d.ts
file in~/types/
and configuringnuxt.config.ts
to include it. This doesn't work though.declare global { ... }
.As I was writing this, i found a solution that seems to be working:
In
~/utils/types.d.ts
, instead ofexport interface IInterface { }
, usingdeclare
seems to work. For example:That is all that's need... No configuration or anything...
Beta Was this translation helpful? Give feedback.
All reactions