Quantcast
Channel: How to wrap an interface in an object while exporting it in TypeScript? - Stack Overflow
Browsing index pages (2 articles)
↧

How to wrap an interface in an object while exporting it in TypeScript?

I have a file called x.ts, here is what it holds:interface x { x: string;}interface y{ x: string;}interface z { x: string;}interface i{ x: string;}I want to export the interfaces like this:export = {...

View Article


Answer by Tomáš Wróbel for How to wrap an interface in an object while...

Objects (every value in JavaScript / TypeScript) can contain only values as properties (methods, constants, properties) which interfaces are not. But don't worry, there's the way! Its name is...

View Article

Browsing index pages (2 articles)


Latest Images