我正在使用 Event.js 来捕获滑动,https://github.com/mudcube/Event.js,如果我尝试declare var Event: any;
然后Event.add(test, "swipe", function() {}, { snap: 45 });
它会产生以下错误:
Error 1 The property 'add' does not exist on value of type '{ prototype: Event; CAPTURING_PHASE: number; AT_TARGET: number; BUBBLING_PHASE: number; new(): Event; }'
如果我尝试:
declare interface Event {
add: any;
};
我明白了Duplicate identifier 'add'
为什么它不覆盖该属性?