可以通过装饰器可以check 来达到你的目的
interface MyType {
instanceMethod(): void;
}
interface MyTypeStatic {
new (): MyType;
myFun(): void;
}
function staticImplements() {
return (constructor: U) => {
constructor;
};
}
@staticImplements()
class MyTypeClass {
public static myFun() {}
instanceMethod() {}
}