1
- // Type definitions for Mousetrap 1.2.2
1
+ // Type definitions for Mousetrap 1.5.x
2
2
// Project: http://craig.is/killing/mice
3
3
// Definitions by: Dániel Tar <https://github.com/qcz>
4
4
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -8,8 +8,19 @@ interface ExtendedKeyboardEvent extends KeyboardEvent {
8
8
}
9
9
10
10
interface MousetrapStatic {
11
+ ( el : Element ) : MousetrapInstance ;
12
+ new ( el : Element ) : MousetrapInstance ;
11
13
stopCallback : ( e : ExtendedKeyboardEvent , element : Element , combo : string ) => boolean ;
14
+ bind ( keys : string , callback : ( e : ExtendedKeyboardEvent , combo : string ) => any , action ?: string ) : void ;
15
+ bind ( keyArray : string [ ] , callback : ( e : ExtendedKeyboardEvent , combo : string ) => any , action ?: string ) : void ;
16
+ unbind ( keys : string , action ?: string ) : void ;
17
+ unbind ( keyArray : string [ ] , action ?: string ) : void ;
18
+ trigger ( keys : string , action ?: string ) : void ;
19
+ reset ( ) : void ;
20
+ }
12
21
22
+ interface MousetrapInstance {
23
+ stopCallback : ( e : ExtendedKeyboardEvent , element : Element , combo : string ) => boolean ;
13
24
bind ( keys : string , callback : ( e : ExtendedKeyboardEvent , combo : string ) => any , action ?: string ) : void ;
14
25
bind ( keyArray : string [ ] , callback : ( e : ExtendedKeyboardEvent , combo : string ) => any , action ?: string ) : void ;
15
26
unbind ( keys : string , action ?: string ) : void ;
0 commit comments