Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How to declare and import TypeScript interfaces in a separate file

$
0
0

I want to define several interfaces in their own files in my TypeScript project, from which I'll implement classes for production as well as mocks for testing.

However, I can't figure out the correct syntax. I've found plenty of tutorials on declaring interfaces and implementing them, but they all have a trivial implementation of both the interface and derived classes in the same file, which isn't very real-world.

What's the right way to export and import the interfaces?


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>