interface SquareConfig { color?: string; width?: number; [propName: string]: any; } function asd(opt: SquareConfig): any { } asd({color: 'red', 2, name: 'asd', age: 14}) // 只关心 color和width的类型是否正确,其它属性不错检测