ystal
ystal

Reputation: 688

Exporting multiple types

I have lots of types defined throughout my file. I want to put a single line at the bottom of my file that does all the exports. So I can easily see what all is exported. Is this possible?

type foo = ...;

type bar = ...;


export types { foo, bar }

For instance this is how I export multiple in ES6:

function work(name) {
    ...
}
class Person {
    ...
}

export { work, Person }
export default Person

Upvotes: 0

Views: 184

Answers (1)

Nat Mote
Nat Mote

Reputation: 4086

Yes, the syntax is simply

export type {foo, bar}

Upvotes: 1

Related Questions