I want to define some type which is key of some other type. It is possible to do this
interface B {
x: something;
y: string;
z: something;
}
type keyOfB = keyof B;
export class A {
foo: keyOfB;
}
But at same time i want to foo be only some type eg string or something, how to combine it?
foo: keyOfB & type
doesnt work.
Theoretically it is job for Pick<> or Extract<> but i cant make it working
https://www.typescriptlang.org/docs/handbook/utility-types.html