3 ms·
I'm not an expert on type systems, and maybe I'm misreading this gist, but doesn't Typescript work this way?
by maxfurman 7y ago
I'm not an expert on type systems, and maybe I'm misreading this gist, but doesn't Typescript work this way?
- _Codemonkeyism 7y agoAs a TS user I'd think there is a lot of TS in this post, e.g. structural typing, union types etc.
- phiresky 7y agoYep. The only thing missing is nominal aliases to primitive types, which is requested my many people [1] and even the TS compiler itself uses hacks to work around the lack of them. No idea why they don't add them already. Also of course any form of runtime type checking is missing. [1] https://github.com/Microsoft/Typescript/issues/202 https://github.com/Microsoft/Typescript/issues/202
- hateful 7y agoIf this wasn't here I was going to put it. When using Vuejs with TypeScript, I consistently create interfaces for just the part of the data being returned from an API that I care about.