fun
它接受一个已包装的指定对象。我把它包起来了
Example
export class Example {
private __ExampleFlag;
constructor (input) {
Object.assign(this, input);
}
}
下面是函数:
const fun = (e: Example): boolean => {
return true;
};
这不起作用,这很好:
fun({}); // no good
这很有效,这很好:
fun(new Example({})); // good
不
这很好:
const v:any = {};
fun(v); // not good