Pick
already works with multiple fields you just need to provide them as a union, not a tuple/array type:
interface MyInterface {
a: number,
b: number,
c: number
}
type AB = Pick<MyInterface, 'a' | 'b'>;
Playground Link
Pick
already works with multiple fields you just need to provide them as a union, not a tuple/array type:
interface MyInterface {
a: number,
b: number,
c: number
}
type AB = Pick<MyInterface, 'a' | 'b'>;
Playground Link