/**
* Generic used as value?
* I can have an "Input" where field 'type' is either 'number' or
* 'text', and it works no problem.
*/
const GoodScopeThing = scope({
InputType: '"number" | "text"',
"Input<T extends InputType>": {
type: "T",
value: "string",
},
});
const GoodThing = GoodScopeThing.type({
field: "Input<InputType>",
});
GoodThing({
field: {
type: "number",
value: "Hi",
},
}); // { field: { type: 'number', value: 'Hi' } }
/**
* Generic used as value?
* I can have an "Input" where field 'type' is either 'number' or
* 'text', and it works no problem.
*/
const GoodScopeThing = scope({
InputType: '"number" | "text"',
"Input<T extends InputType>": {
type: "T",
value: "string",
},
});
const GoodThing = GoodScopeThing.type({
field: "Input<InputType>",
});
GoodThing({
field: {
type: "number",
value: "Hi",
},
}); // { field: { type: 'number', value: 'Hi' } }