Merge pull request #4648 from yiting/master

Update keypress.d.ts
This commit is contained in:
Masahiro Wakame 2015-06-23 01:46:13 +09:00
commit 703a5dd3da

View File

@ -16,12 +16,12 @@ declare module Keypress {
is_solitary: boolean;
is_sequence: boolean;
}
interface Combo {
keys: string;
on_keydown: () => any;
on_keyup: () => any;
on_release: () => any;
on_keydown: (event?: KeyboardEvent, count?: number) => any;
on_keyup: (event?: KeyboardEvent) => any;
on_release: (event?: KeyboardEvent) => any;
this: Element;
prevent_default: boolean;
prevent_repeat: boolean;
@ -31,14 +31,14 @@ declare module Keypress {
is_sequence: boolean;
is_solitary: boolean;
}
interface Listener {
new(element: Element, defaults: ListenerDefaults): Listener;
new(element: Element): Listener;
new(): Listener;
simple_combo(keys: string, on_keydown_callback: () => any): void;
counting_combo(keys: string, on_count_callback: () => any): void;
sequence_combo(keys: string, callback: () => any): void;
simple_combo(keys: string, on_keydown_callback: (event?: KeyboardEvent, count?: number) => any): void;
counting_combo(keys: string, on_count_callback: (event?: KeyboardEvent, count?: number) => any): void;
sequence_combo(keys: string, callback: (event?: KeyboardEvent, count?: number) => any): void;
register_combo(combo: Combo): void;
unregister_combo(combo: Combo): void;
unregister_combo(keys: string): void;
@ -50,7 +50,7 @@ declare module Keypress {
listen(): void;
stop_listening(): void;
}
interface Keypress {
Listener: Listener;
}