Let's say I have function which takes this object as one of the arguments:
{
section: "main",
sectionColor: "#0072c6",
favIcon: "default",
libraries: {
value: "librariesFiles",
type: "jsIncludes"
},
components: {
value: "comoponentFiles",
type: "jsIncludes"
}
}
Here is interface I came up to define this property in function:
interface IgenerateFileArgumentObjectItem {
value: string;
type: string;
}
export interface IgenerateFileArgument {
[key: string]: (string | IgenerateFileArgumentObjectItem);
}
Shortly, I'm trying define object with dynamic number of properties which can be equal either to string value either to another object with two properties...
But compiler is complaining, and I think issue is in this line: (string | IgenerateFileArgumentObjectItem)
Is there any obvious mistake or am I trying to do impossible thing?


librariesFilesandcomoponentFilesare they strings?librariesFilesandcomoponentFilesare not strings, they arestring[], am I right? Are there any more things that you can add/fix about the question?