mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Renamed files, fixed methods in KeyboardJSStatic.
This commit is contained in:
parent
44153df2f5
commit
e7ec2d7f22
47
keyboardjs/keyboardjs-0.4.1.d.ts
vendored
47
keyboardjs/keyboardjs-0.4.1.d.ts
vendored
@ -1,47 +0,0 @@
|
||||
// Type definitions for KeyboardJS 0.4.1
|
||||
// A JavaScript library for binding keyboard combos without the pain of key codes and key combo conflicts.
|
||||
// Project: https://github.com/RobertWHurst/KeyboardJS
|
||||
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface KeyboardJSSubBinding {
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
interface KeyboardJSBinding {
|
||||
clear(): void;
|
||||
on(eventName: string, callbacks?: any): KeyboardJSSubBinding;
|
||||
}
|
||||
|
||||
interface KeyboardJSKey {
|
||||
name(keyCode: number): string[];
|
||||
code(keyName: string): any;
|
||||
}
|
||||
|
||||
interface KeyboardJSCombo {
|
||||
active(keyCombo: string): bool;
|
||||
parse(keyCombo: any): any[];
|
||||
stringify(keyComboArray: any): string;
|
||||
}
|
||||
|
||||
interface KeyboardJSLocale {
|
||||
map: any;
|
||||
macros: any[];
|
||||
}
|
||||
|
||||
interface KeyboardJSStatic {
|
||||
enable(): void;
|
||||
disable(): void;
|
||||
activeKeys(): string[];
|
||||
on(keyCombo:string, onDownCallback?: (keyEvent: Event, keysPressed: string[], keyCombo: string) => {}, onUpCallback?: (keyEvent: Event, keysPressed: string[], keyCombo: string) => {}): KeyboardJSBinding;
|
||||
clear(keyCombo: string): void;
|
||||
clear.key(keyName: string): void;
|
||||
locale(localeName: string): KeyboardJSLocale;
|
||||
locale.register(localeName: string, localeDefinition: KeyboardJSLocale): void;
|
||||
macro(keyCombo:string , keyNames: string[]): void;
|
||||
macro.remove(keyCombo: string): void;
|
||||
key: KeyboardJSKey;
|
||||
combo: KeyboardJSCombo;
|
||||
}
|
||||
|
||||
declare var KeyboardJS: KeyboardJSStatic;
|
||||
49
keyboardjs/keyboardjs.d.ts
vendored
Normal file
49
keyboardjs/keyboardjs.d.ts
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
// Type definitions for KeyboardJS
|
||||
// A JavaScript library for binding keyboard combos without the pain of key codes and key combo conflicts.
|
||||
// Project: https://github.com/RobertWHurst/KeyboardJS
|
||||
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface KeyboardJSSubBinding {
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
interface KeyboardJSBinding {
|
||||
clear(): void;
|
||||
on(eventName: string, callbacks?: any): KeyboardJSSubBinding;
|
||||
}
|
||||
|
||||
interface KeyboardJSLocale {
|
||||
map: any;
|
||||
macros: any[];
|
||||
}
|
||||
|
||||
interface KeyboardJSStatic {
|
||||
enable(): void;
|
||||
disable(): void;
|
||||
activeKeys(): string[];
|
||||
on(keyCombo:string, onDownCallback?: (keyEvent: Event, keysPressed: string[], keyCombo: string) => void, onUpCallback?: (keyEvent: Event, keysPressed: string[], keyCombo: string) => void): KeyboardJSBinding;
|
||||
clear: {
|
||||
(keyCombo: string): void; // Call signature
|
||||
key(keyName: string): void; // Method
|
||||
};
|
||||
locale: {
|
||||
(localeName: string): KeyboardJSLocale; // Call signature
|
||||
register(localeName: string, localeDefinition: KeyboardJSLocale): void; // Method
|
||||
};
|
||||
macro: {
|
||||
(keyCombo:string , keyNames: string[]): void; // Call signature
|
||||
remove(keyCombo: string): void; // Method
|
||||
};
|
||||
key: {
|
||||
name(keyCode: number): string[];
|
||||
code(keyName: string): any;
|
||||
};
|
||||
combo: {
|
||||
active(keyCombo: string): bool;
|
||||
parse(keyCombo: any): any[];
|
||||
stringify(keyComboArray: any): string;
|
||||
};
|
||||
}
|
||||
|
||||
declare var KeyboardJS: KeyboardJSStatic;
|
||||
Loading…
Reference in New Issue
Block a user