1
以下似乎是有效的:打字稿功能接口实现
interface IPredicate {
(s: Product): boolean
and(IPredicate): IPredicate
or(IPredicate): IPredicate
}
如果它是有效的,我怎么能实现它,以便大致有以下工作:
let a: IPredicate = (s: Something) => true
let b: IPredicate = (s: Something) => false
let c: IPredicate = a.and(b)