mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
Merge pull request #2560 from yellowiscool/master
Angular-hotkeys : Chaining when hotkeys is bound to a $scope object
This commit is contained in:
@@ -14,3 +14,12 @@ hotkeyProvider.toggleCheatSheet();
|
||||
|
||||
hotkeyProvider.add(hotkeyObj.combo, hotkeyObj.description ,hotkeyObj.callback);
|
||||
|
||||
hotkeyProvider.bindTo(scope)
|
||||
.add(hotkeyObj)
|
||||
.add(hotkeyObj)
|
||||
.add({
|
||||
combo: 'w',
|
||||
description: 'blah blah',
|
||||
callback: function() {}
|
||||
});
|
||||
|
||||
|
||||
Vendored
+7
-1
@@ -17,7 +17,7 @@ declare module ng.hotkeys {
|
||||
|
||||
add(hotkeyObj: ng.hotkeys.Hotkey): void;
|
||||
|
||||
bindTo(scope : ng.IScope): ng.hotkeys.HotkeysProvider;
|
||||
bindTo(scope : ng.IScope): ng.hotkeys.HotkeysProviderChained;
|
||||
|
||||
del(combo: string): void;
|
||||
|
||||
@@ -26,6 +26,12 @@ declare module ng.hotkeys {
|
||||
toggleCheatSheet(): void;
|
||||
}
|
||||
|
||||
interface HotkeysProviderChained {
|
||||
add(combo: string, description: string, callback: (event: Event, hotkeys: ng.hotkeys.Hotkey) => void): HotkeysProviderChained;
|
||||
|
||||
add(hotkeyObj: ng.hotkeys.Hotkey): HotkeysProviderChained;
|
||||
}
|
||||
|
||||
interface Hotkey {
|
||||
combo: string;
|
||||
description?: string;
|
||||
|
||||
Reference in New Issue
Block a user