I was writing some code and trying to figure out how to ensure that the generic type passed into a class satisfies "string keys to function records", and the only thing that would work and wouldn't cause tsc to complain was this:
type EventMap<T> = { [K in keyof T]: (...args: any) => any }
export class wRPC<In extends EventMap<In>, Out extends EventMap<Out>> {
//...
Why does this work? Whether it's in an extracted type or inlined, TypeScript lets me reference In
within the extends guard that it satisfies. How is this allowed?