In my typing file, I currently have the following structure:
interface A {
anObject: {
data: string;
};
someOtherData: boolean;
}
My goal is to update the interface so that anObject now includes both data and data2. The desired final form should look like this:
interface A {
anObject: {
data: string;
data2: string;
};
someOtherData: boolean;
}
I attempted to make this change by modifying the original interface as follows, but it did not produce the expected result:
interface A {
anObject: {
data2: string;
}
}
Instead of having both data and data2 in the anObject, only data2 was present. Is there a way to retain the original keys while updating the interface?