Typescript interface for objects with some known and some unknown property names

It’s not exactly what you want, but you can use a union type:

interface IfcObject {
    fixedKey1: string
    fixedKey2: string
    [key: string]: string | {
        param1: number[];
        param2: string; 
        param3: string;
    }
}

It covers your case. But the unknown properties could be of type string.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)