I'm trying to do an extension of one of my interfaces, but keep getting the error "index signature is missing in type {dcs: Relationship} with the following snippet:
interface Relationship {
data: {
id: string;
type: string;
}
}
interface T {
relationships: {[key: string]: Relationship};
}
interface Test extends T {
relationships: {
dcs: Relationship;
};
}
The goal is for the relationships property in T to be an object with any number of keys that are all of the Relationship type. Test is supposed to be a specific implementation of type T.
Not sure what the correct way to approach this is. Thanks in advance!