Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn't this a branded type / newtype / opaque type / nominal type?

Edit: Ah I see, this only affects tooltips/autocomplete, doesn't actually change the behaviour of the type.

If you want to do that you need to do something like:

  type UserId = number & { __type: 'UserId' };


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: