added definitions for angular-hotkeys

This commit is contained in:
Jason Zhao
2014-06-27 17:58:58 -07:00
parent 7a485a1c6c
commit a001147307
2 changed files with 43 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="angular-hotkeys.d.ts" />
var hotkeyProvider: ng.hotkeys.HotkeysProvider;
var hotkeyObj: ng.hotkeys.Hotkey;
hotkeyProvider.add("mod+s", "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => {} );
hotkeyProvider.add(hotkeyObj);
hotkeyProvider.del("mod+s");
hotkeyProvider.get("mod+s");
hotkeyProvider.toggleCheatSheet();
hotkeyProvider.add(hotkeyObj.combo, hotkeyObj.description ,hotkeyObj.callback);
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for angular-hotkeys
// Project: https://github.com/chieffancypants/angular-hotkeys
// Definitions by: Jason Zhao <https://github.com/jlz27>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ng.hotkeys {
interface HotkeysProvider {
template: string;
includeCheatSheet: boolean;
cheatSheetHotkey: string;
cheatSheetDescription: string;
add(combo: string, description: string, callback: (event: Event, hotkeys: ng.hotkeys.Hotkey) => void): void;
add(hotkeyObj: ng.hotkeys.Hotkey): void;
del(combo: string): void;
get(combo: string): ng.hotkeys.Hotkey;
toggleCheatSheet(): void;
}
interface Hotkey {
combo: string;
description?: string;
callback: (event: Event, hotkey: ng.hotkeys.Hotkey) => void;
}
}