Hello, I've encountered this type mentioned in the title {[id: string]: Details}|null
and the Details interface is defined as follows:
export interface Details
{
id: number;
name: string;
info: string;
}
I'm wondering how I can mock this. It's easy to mock the Details part like so:
getDetails(): Details {
const detailsOne = (): Details => {
return {
id: 300,
name: "Some Name",
info: "Some Info"
} as Details
}
return detailsOne();
}
However, I'm struggling to understand how to return it within the [id: string] constraint as well.