Comment on Adding type safety to object IDs in TypeScriptparentComments−jeroenhd2ySomething like this, maybe?https://www.typescriptlang.org/play?#code/C4TwDgpgBAkgIlAvFA...Alternatively, with generics: https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgA...I don't think these are better, to be honest. The string types suffice and are easier to exchange with servers and other APIs.
Comments
Something like this, maybe?
https://www.typescriptlang.org/play?#code/C4TwDgpgBAkgIlAvFA...
Alternatively, with generics: https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgA...
I don't think these are better, to be honest. The string types suffice and are easier to exchange with servers and other APIs.