Skip to content

Commit

Permalink
Directly use KeyHandler type from hotkeys-js
Browse files Browse the repository at this point in the history
  • Loading branch information
jameschao committed Mar 27, 2020
1 parent bcb026d commit f6d2f7c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import hotkeys, { HotkeysEvent } from "hotkeys-js";
import hotkeys, { KeyHandler } from "hotkeys-js";
import { useCallback, useEffect } from "react";

type CallbackFn = (event: KeyboardEvent, handler: HotkeysEvent) => void;
type Options = {
filter?: typeof hotkeys.filter;
};

export function useHotkeys(
keys: string,
callback: CallbackFn,
callback: KeyHandler,
deps: any[] = [],
options: Options = {}
) {
Expand Down

0 comments on commit f6d2f7c

Please sign in to comment.