interface FunctionWithAttributes {
attr: string,
// ???如果我想写一个固定的函数, 怎么写
// func:()=>{ };
(str:string):void; //这是一个函数声明
}
const test: FunctionWithAttributes = (str:string) => {
console.log("attributes");
}
test.attr = "12";
如果我想通过FunctionWithAttributes 定义的object都有一个固定的func函数应该怎么写