const func: (prm: Record<string, string | number>) => void = (prm) => {
return;
};
interface Obj {
key1: string;
}
func({ key1: 'value1' } as Obj); // Argument of type 'Obj' is not assignable to parameter of type 'Record<string, string | number>'. Index signature for type 'string' is missing in type 'Obj'.ts(2345)
How come the Obj object cannot feed into the fuction func while Obj can fulfill the prm required data shape?