Initializing generic type inside generic class in Typescript
问题 I want to initialize a generic class variable inside a generic class using a generic type, but I can't figure out if there is a way to do this. Initializing with types works fine, it doesn't seem like it work with generics though. type EventCallback<I, O> = (event: I) => O; type ListenerList<K extends string | symbol | number, I, O, V extends EventCallback<I, O>> = { [T in K]: V[]; }; const test: ListenerList<string, string, string, (event: any) => any> = {}; // Works fine export default