3 ms·
Agree. It would be awesome if TypeScript had some optional run-type information, maybe in the form of a decorator function @rtti function moo(foo: stri
by skrebbel 8y ago
Agree. It would be awesome if TypeScript had some optional run-type information, maybe in the form of a decorator function
@rtti
function moo(foo: string): number {
…
}
=>
function moo(foo: string): number {
…
}
moo.__type = {
parameters: [{name: "foo", type: "string"}]
returnType: "number"
}
or something like that.