Commit Graph

26 Commits (master)

Author SHA1 Message Date
Leonid Fedorov 478ee66989
type: fix getAllKeyCodes return type (#466) 1 year ago
jaywcjlove 9268f8da33 revert: "fix types under node16 moduleResolution" #441 #464 1 year ago
Maddy Miller 2767829cc7
fix: fix types under node16 moduleResolution (#441)
The types of this library do not match the actual JS code, leading to a situation where using ESM under the `node16` moduleResolution method in TypeScript, the default export types will fail to resolve. TypeScript is more strict around type compliance with these settings enabled, and therefore requires the types to match.

The JS code does not use a default import, as `export default` in ESM is not identical to `module.exports = `. `export =` can be used in the `index.d.ts` to match the behaviour within the JS file.

More information on this specific issue is available here, https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md
1 year ago
AllenLee 7bf34e9dfa
feat: add single option. (#463)
* feat: single callback

* type: Option.single
1 year ago
jaywcjlove 6193fd8a26 doc: Update document. (#439) 2 years ago
jaywcjlove f26f95c63b clean: Optimize `getAllKeyCodes` method & compatible with older browers. (#439) 2 years ago
jaywcjlove edfd3ef372 type: add getAllKeyCodes method type. (#439) 2 years ago
jaywcjlove 42c82b9ea1 feat: add `keys` data to the callback function HotkeysEvent. (#436) 2 years ago
Selphine bb7481ec21
type: add `getPressedKeyString` to `index.d.ts` for #399 (#424) 2 years ago
Ilya Suhodolskiy 56af32dccb
feat: add capture option (#368) 3 years ago
Ilya Suhodolskiy 791cc61db7
feat: export hotkeys interface (#366) 3 years ago
Valentin Kruglikov 0dc845bac4
type: Fix index.d.ts deleteScope declaration, fix README deleteScope (#362) 3 years ago
jaywcjlove e404a0d444 type: update type (#354). 3 years ago
jaywcjlove 45d4f54dd0 type: fix eslint warnings. 4 years ago
Jessica McElroy 22c39bfae2 [types] fix hotkeys.noConflict() return type 4 years ago
xiejiahe 9334891313 fix: 修复 unbind 解绑所有类型错误
hotkeys.unbind() 抛出异常。
4 years ago
James Chao d3c0d4830b
Allow boolean return value from KeyHandler (#164) 5 years ago
Sebastian Kreft 08fbd1c948 Change filter to accept a KeyboardEvent (#118)
`hotkeys.filter` filter `KeyboardEvent`s and as such the signature should reflect so. The change is specially important if one want to override the default filtering strategy.
5 years ago
jaywcjlove 00a8b67c4a type: Modify Hotkeys Option type. 6 years ago
Mason Bourgeois 134075bbee Make 'scope' an optional option (#95)
The documentation doesn't mention this as a required option, and in use the library works fine passing an options object without `scope`.
6 years ago
jaywcjlove da94c8bae3 Fix the issue of keyup don't exist in typings file. #59 6 years ago
JounQin f21cfd8272 feat: rename param according to source code 6 years ago
JounQin e32f1e9ed3 feat: add new declaration for unbind handler 6 years ago
jaywcjlove cbccf516b9 Fix: index.d.ts exports custom object. #38 6 years ago
jaywcjlove 1eef7e18d1 #30 Fix module name issue. 7 years ago
Eager Wei 3f9ff1e957 add Type definitions 7 years ago