Stronger JavaScript with Opaque Types
In Flow and TypeScript, types are transparent by default - if two types are structurally identical they are deemed to be compatible. For example, the following types are compatible: Username and Password are both strings, so they are equivalent as far as Flow and TypeScript are concerned, even though they represent entirely different concepts.
https://codemix.com/opaque-types-in-javascript/
Opaque data type - Wikipedia
In computer science, an opaque data type is a data type whose concrete data structure is not defined in an interface. This enforces information hiding, since its values can only be manipulated by calling subroutines that have access to the missing information.
https://en.wikipedia.org/wiki/Opaque_data_type
Opaque Types
Structural type system, workaround in TypeScript, unique symbol and code examples
https://blog.beraliv.dev/2021-05-07-opaque-type-in-typescript#choose-the-solution


Seonglae Cho