I am Typescript developer. I have a situation where I need to pass any keys from a interface as a function parameter. For that, I need to make a new type with the keys of a Interface.
Suppose I have following interface A.
interface A {
name: string;
email: number;
}
I want a new typescript type which will take the keys from the interface "A", combine them with or (|), so that the new type will looks like below:
type B = 'name' | 'email';
Is there any utility Types in Typescript or any suggestions how can I do this?