Suppose I have a Typescript Interface as follows
export interface IMyObj {
id: string;
type: 'AA' | 'AZ' | 'XY';
...
}
Now I need an other interface which also has that type field
export interface IMyOtherObj {
...
type: 'AA' | 'AZ' | 'XY';
...
}
As you can see I have duplicated the values of type. So my question is, how can I reuse IMyObj.type in my IMyOtherObj interface? I tried this
export interface IMyOtherObj {
...
type: IMyObj.type; // -> error
...
}
I think I'm close but so far no luck, any suggestions?