Here is the code snippet I am working with:
interface Model<T extends Type> {
type: T
get?: (value: ToNodeType<T>) => any
}
I am expecting that the parameter type of 'get' will be inferred automatically from the 'type' attribute.
const model: Model = {
type: 'int',
get: (v) => 0
}
However, I am encountering an error message saying:
Generic type 'Model ' requires 1 type argument(s).