I have an object where all the keys are string, some of the values are string and the rest are objects in this form:
var object = {
\"fixedKey1\": \"some
As @Paleo explained, you can use union property to define an interface for your corresponding object.
I would say you should define an interface for object values and then you should define your original object.
Sample interface can be:
export interface IfcObjectValues {
param1: number[];
param2: string;
param3: string;
}
export interface IfcMainObject {
[key : string]: string | IfcObjectValues;
}
It's not exactly what you want, but you can use a union type:
interface IfcObject {
[key: string]: string | {
param1: number[];
param2: string;
param3: string;
}
}
The correct answer to this question is:
export interface IfcObjectValues {
param1: number[];
param2: string;
param3: string;
}
interface MyInterface {
fixedKey1: string,
fixedKey2: number,
[x: string]: IfcObjectValues,
}
Your code in action, see here.