Files
DefinitelyTyped/mousetrap/mousetrap.d.ts
T
Andrew Bradley 1d556e1d7c Modified Mousetrap definition to allow Mousetrap to be loaded as an
external module.

- tests are also updated to test loading as an external module
- mousetrap exports itself as an AMD module when an AMD define function is
  present
2014-11-06 01:39:49 -05:00

26 lines
940 B
TypeScript

// Type definitions for Mousetrap 1.2.2
// Project: http://craig.is/killing/mice
// Definitions by: Dániel Tar <https://github.com/qcz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface ExtendedKeyboardEvent extends KeyboardEvent {
returnValue: boolean; // IE returnValue
}
interface MousetrapStatic {
stopCallback: (e: ExtendedKeyboardEvent, element: Element, combo: string) => boolean;
bind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void;
bind(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void;
unbind(keys: string, action?: string): void;
unbind(keyArray: string[], action?: string): void;
trigger(keys: string, action?: string): void;
reset(): void;
}
declare var Mousetrap: MousetrapStatic;
declare module "mousetrap" {
export = Mousetrap;
}