F
F
faleaksey2019-04-04 18:22:52
JavaScript
faleaksey, 2019-04-04 18:22:52

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

1 answer(s)
A
Anton Spirin, 2019-04-04
@rockon404

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 question

Ask a Question

731 491 924 answers to any question