有属性的函数类型如何定义? Laoniu_Andy 2023-06-08 47 阅读1分钟 interface FnWithAttrs { attr: string; (str: string): void; } const test: FnWithAttrs = (str: string) => { console.log(str); } test.attr = 'attr'