From a001147307a688fe0f11ee0053b8e3321a167778 Mon Sep 17 00:00:00 2001 From: Jason Zhao Date: Fri, 27 Jun 2014 17:58:58 -0700 Subject: [PATCH 1/3] added definitions for angular-hotkeys --- angular-hotkeys/angular-hotkeys-tests.ts | 13 ++++++++++ angular-hotkeys/angular-hotkeys.d.ts | 30 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 angular-hotkeys/angular-hotkeys-tests.ts create mode 100644 angular-hotkeys/angular-hotkeys.d.ts diff --git a/angular-hotkeys/angular-hotkeys-tests.ts b/angular-hotkeys/angular-hotkeys-tests.ts new file mode 100644 index 000000000..4e63b32fa --- /dev/null +++ b/angular-hotkeys/angular-hotkeys-tests.ts @@ -0,0 +1,13 @@ +/// + +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); + diff --git a/angular-hotkeys/angular-hotkeys.d.ts b/angular-hotkeys/angular-hotkeys.d.ts new file mode 100644 index 000000000..8c2e1ff1c --- /dev/null +++ b/angular-hotkeys/angular-hotkeys.d.ts @@ -0,0 +1,30 @@ +// Type definitions for angular-hotkeys +// Project: https://github.com/chieffancypants/angular-hotkeys +// Definitions by: Jason Zhao +// 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; + } +} From 56a71f88b0db9a2cd63759e10ba3155a2fde2613 Mon Sep 17 00:00:00 2001 From: Jason Zhao Date: Mon, 14 Jul 2014 14:11:51 -0700 Subject: [PATCH 2/3] added contributos --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ae430f57d..d40176b54 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -13,6 +13,7 @@ All definitions files include a header with the author and editors, so at some p * [AngularJS](http://angularjs.org) (by [Diego Vilar](https://github.com/diegovilar)) ([wiki](https://github.com/borisyankov/DefinitelyTyped/wiki/AngularJS-Definitions-Usage-Notes)) * [angularLocalStorage](https://github.com/agrublev/angularLocalStorage) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) * [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib)) +* [Angular Hotkeys](https://github.com/chieffancypants/angular-hotkeys/) (by [Jason Zhao](https://github.com/jlz27)) * [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong)) * [Angular Translate](http://pascalprecht.github.io/angular-translate/) (by [Michel Salib](https://github.com/michelsalib)) * [Angular UI Bootstrap](http://angular-ui.github.io/bootstrap) (by [Brian Surowiec](https://github.com/xt0rted)) From e43fb420097712a9f3af2758da56e2dbaeab177b Mon Sep 17 00:00:00 2001 From: Jason Zhao Date: Mon, 14 Jul 2014 16:28:09 -0700 Subject: [PATCH 3/3] bumped version to 1.4.0 --- angular-hotkeys/angular-hotkeys-tests.ts | 3 +++ angular-hotkeys/angular-hotkeys.d.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/angular-hotkeys/angular-hotkeys-tests.ts b/angular-hotkeys/angular-hotkeys-tests.ts index 4e63b32fa..66f9e6072 100644 --- a/angular-hotkeys/angular-hotkeys-tests.ts +++ b/angular-hotkeys/angular-hotkeys-tests.ts @@ -1,10 +1,13 @@ +/// /// +var scope: ng.IScope; 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.bindTo(scope); hotkeyProvider.del("mod+s"); hotkeyProvider.get("mod+s"); hotkeyProvider.toggleCheatSheet(); diff --git a/angular-hotkeys/angular-hotkeys.d.ts b/angular-hotkeys/angular-hotkeys.d.ts index 8c2e1ff1c..cc4a3680c 100644 --- a/angular-hotkeys/angular-hotkeys.d.ts +++ b/angular-hotkeys/angular-hotkeys.d.ts @@ -3,6 +3,8 @@ // Definitions by: Jason Zhao // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module ng.hotkeys { interface HotkeysProvider { @@ -15,6 +17,8 @@ declare module ng.hotkeys { add(hotkeyObj: ng.hotkeys.Hotkey): void; + bindTo(scope : ng.IScope): ng.hotkeys.HotkeysProvider; + del(combo: string): void; get(combo: string): ng.hotkeys.Hotkey;