I have following code:
type Machine = {
id: string,
name: string,
tonnage?: number
}
const machines = {
"machine1": {id: "S01", name: "AnyMachine"} as Machine,
}
is possible to indicate that key is string and value is typeof Machine? Casting as Machine seems to work, but I would like to have less verbose alternative.