Creating an Opaque Type from a Schema in TypeScript
Shouldn't it be as simple as that to create an opaque type out of a schema ? The following does not compile:
I guess I'm missing something ?
I guess I'm missing something ?
class MyId extends Schema.UUID {}
const id: MyId = Schema.decodeSync(MyId)('ff'); // Type 'string' is not assignable to type 'MyId'