接口Guard
具有通用的类型保护方法isExecutable
。
interface Guard {
isExecutable<
U extends States<this> | X,
>(): this is Query<U> & Execute<U>
}
它被这样称呼:
declare let b: Guard;
if (b.isExecutable()) {}
我想使isExecutable
成为一种吸气剂,所以它被称为:
if (b.isExecutable) {}
有可能吗?