News for hackers. Stuff that matters.
Re:TypeScript’s quirks: How inconsistencies make the languag... by yawaramin on Saturday February 01, 2020 @01:39AM (#22209108)
At compile time? It's very simple–use an interface and provide constructor functions that upcast object instances to the interface. Now, only the interface-defined members i.e. the public members are accessible.

At runtime? You can't, it's JavaScript, everything is public (for now at least).

There are no comments on this comment yet.