Skip to content

Commit

Permalink
fix(useKeyStroke): fix TS type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiboss committed Oct 29, 2024
1 parent c39ec03 commit a9b1a5f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/react-use/src/use-key-stroke/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export type UseKeyStrokeOptions = {
/**
* The target to add the event listener to.
*
* @defaultValue window
* @defaultValue () => window
*/
target?: ElementTarget
target?: ElementTarget | (() => Window) | (() => Document)
/**
* Set to `true` to use passive event listeners.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/react-use/src/use-key-stroke/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface UseKeyStrokeOptions {
*
* @defaultValue window
*/
target?: ElementTarget
target?: ElementTarget | (() => Window) | (() => Document)
/**
* Set to `true` to use passive event listeners.
*
Expand Down
4 changes: 2 additions & 2 deletions packages/react-use/src/use-key-stroke/index.zh-cn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export type UseKeyStrokeOptions = {
/**
* 添加事件监听器的目标。
*
* @defaultValue window
* @defaultValue () => window
*/
target?: ElementTarget
target?: ElementTarget | (() => Window) | (() => Document)
/**
* 设置为 `true` 以使用被动事件监听器。
*
Expand Down

0 comments on commit a9b1a5f

Please sign in to comment.