更新时间:2022-03-31 22:30:14
实现签名不可见.您需要声明 all 调用者应该看到的重载,然后编写实现主体.
The implementation signature is not visible. You need to declare all the overloads callers should see, then write the implementation body.
export interface Item {
time: number;
}
export class Foo implements Item {
public time: number;
public name: string;
constructor();
constructor(
time: number,
name: string
);
constructor(
time?: number,
name?: string
) {
this.time = id || -1
this.name = name || ""
};
}
您还可以阅读 查看全文