Given a type like this:
type X = {
a: string;
b: number;
[prop: string]: any;
};
Is there a way to filter out the "catch-all" prop property and extract just the "known" types so you get something like this:
type Known<T> = /* Magic goes here... */
type K = Known<X>; // Equals { a: string; b: number; }
I know I can do this by explicitly extracting the types:
type K = {a:X['a'], b:X['b'] }
But I need a general purpose option...