I am trying to add some types to some old code.
There is a transitionData object, that might have objects added by index like this:
this.transitionData[id] = transition
where id is a number and transition is a Transition type.
Or it might be:
transitions[t].timer.stop()
Where t is a string and timer is of type Timer.
I would like this interface:
export interface TransitionData {
[index: number]: Transition
[key: string]: {timer: Timer}
}
but typescript complains:
Numeric index type 'Transition' is not assignable to string index type '{ timer: Timer; }