We have to do this a lot because we generate complex objects with detailed
type information. When exported, TS (as of 5.2) inlines the type of these
objects in declarations which makes our declarations massive. To avoid this
we create an interface from the type then cast to the interface for export.
An identity type.
You can't do:
But you can do:
Without this type you'd have to do:
We have to do this a lot because we generate complex objects with detailed type information. When exported, TS (as of 5.2) inlines the type of these objects in declarations which makes our declarations massive. To avoid this we create an interface from the type then cast to the interface for export.