Skip to content

Commit

Permalink
#30 Fix module name issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 8, 2018
1 parent 2dc8f1a commit 1eef7e1
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
// Type definitions for hotkeys v3.3.3
// Project: https://github.com/jaywcjlove/hotkeys
// Definitions by: Eager Wei <https://github.com/weidapao>

interface HotkeysEvent {
key: string
method: KeyHandler
mods: number[]
scope: string
shortcut: string
}

interface KeyHandler {
(keyboardEvent: KeyboardEvent, hotkeysEvent: HotkeysEvent): void
}

interface FilterEvent {
target?: {
tagName?: string
}
srcElement?: {
tagName?: string
}
}

interface Hotkeys {
(key: string, callback: KeyHandler): void
(key: string, scope: string, callback: KeyHandler): void

shift: boolean
ctrl: boolean
alt: boolean
option: boolean
control: boolean
cmd: boolean
command: boolean

setScope(scopeName: string): void
getScope(): string
deleteScope(scopeName: string): void

noConflict(): void

unbind(key: string): void
unbind(key: string, scopeName: string): void

isPressed(keyCode: number): boolean
isPressed(keyCode: string): boolean
getPressedKeyCodes(): number[]

filter(event: FilterEvent): boolean
}

declare var hotkeys: Hotkeys

declare module 'hotkeys' {
export = hotkeys
}
// Type definitions for hotkeys v3.3.3
// Project: https://github.com/jaywcjlove/hotkeys
// Definitions by: Eager Wei <https://github.com/weidapao>

interface HotkeysEvent {
key: string
method: KeyHandler
mods: number[]
scope: string
shortcut: string
}

interface KeyHandler {
(keyboardEvent: KeyboardEvent, hotkeysEvent: HotkeysEvent): void
}

interface FilterEvent {
target?: {
tagName?: string
}
srcElement?: {
tagName?: string
}
}

interface Hotkeys {
(key: string, callback: KeyHandler): void
(key: string, scope: string, callback: KeyHandler): void

shift: boolean
ctrl: boolean
alt: boolean
option: boolean
control: boolean
cmd: boolean
command: boolean

setScope(scopeName: string): void
getScope(): string
deleteScope(scopeName: string): void

noConflict(): void

unbind(key: string): void
unbind(key: string, scopeName: string): void

isPressed(keyCode: number): boolean
isPressed(keyCode: string): boolean
getPressedKeyCodes(): number[]

filter(event: FilterEvent): boolean
}

declare var hotkeys: Hotkeys

declare module 'hotkeys-js' {
export = hotkeys
}

0 comments on commit 1eef7e1

Please sign in to comment.