Is there a way to create a new object type that includes only properties from another Object that match specific types, as opposed to property names?
For example:
interface A {
a: string;
b: number;
c: string[];
d: { [key: string]: never };
}
interface B extends PickPropertyTypes<A, string | number>{}
In this case, interface B should only contain properties a: string and b: number, resulting in an interface like:
{
a: string;
b: number;
}
Is this achievable? Thank you.