Hacker News new | ask | show | jobs
by mikojan 1608 days ago
This is not about trusting the information your users provide. It is about making your APIs accessible to users. If you hide some information, your API is less accessible.
1 comments

But it's just as hidden either way. The API consumer does not know there's an enum that's supposed to go in there. The only way to get that information is to read the documentation.
I have no idea where you are coming from unfortunately.

Generally speaking, a Javascript user has access to the same type script language features (including hints, auto-completion,...) as a typescript user.

Even the most primitive text editor supports language server protocol nowadays.

The library your interoperating with does not even have to be written in typescript if the author provided @typedef JSDocs.

const enums break this because no value of this type exists