I have a working code snippet that I'm currently using:
export interface IReq {
timestamp: number;
};
export interface ITrack extends IReq {
id: number;
};
const track: Pick<ITrack, 'id'> = {
id: 1
}
While it's good to see that TypeScript gives us a compiler error if we rename the 'id' field in the ITrack interface, it would be even better if TypeScript could automatically update the reference to 'id' as well.
Is there a way for TypeScript to detect and reflect this type of change?