3 ms·
> And if you really want to avoid exporting your struct at all, you can always just return an interface. This is what I think most TypeScript libraries should
by eyelidlessness 5y ago
> And if you really want to avoid exporting your struct at all, you can always just return an interface.
This is what I think most TypeScript libraries should be doing, but every bit of inertia makes it unlikely. In all honesty I think type systems should be designed around contracts/protocols and make concrete types private by default. Sure it’s a lot of ceremony, but it’s less ceremony than human communication in emails and issue threads to clarify that undocumented features are undocumented on purpose.