Answer the question
In order to leave comments, you need to log in
How to import an interface in TypeScript?
Hello!
I import the interface by: export from a file and import in the file where I need to apply it!
if I write in the file itself (where you need to use it explicitly, then everything works, if through import from another file it gives an error: Module '"../Checkout/interface"' has no exported member 'Elements'.
What's wrong?
Answer the question
In order to leave comments, you need to log in
export interface Elements {}
In general, there is libdef.d.ts for reusable interfaces, the interfaces registered there do not need to be imported.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question