Skip to content

Commit 25c4516

Browse files
committed
useKeyDownHandler: clean jsdoc formatting
1 parent 2d9cd7e commit 25c4516

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

client/common/useKeyDownHandlers.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@ import { mapKeys } from 'lodash';
22
import { useCallback, useEffect, useRef } from 'react';
33
import { isMac } from '../utils/device';
44

5-
/**
6-
* Function to call upon keydown
7-
*/
5+
/** Function to call upon keydown */
86
export type KeydownHandler = (e: KeyboardEvent) => void;
9-
/**
10-
* An object mapping from keys like 'ctrl-s' or 'ctrl-shift-1' to handlers.
11-
*/
7+
/** An object mapping from keys like 'ctrl-s' or 'ctrl-shift-1' to handlers. */
128
export type KeydownHandlerMap = Record<string, KeydownHandler>;
139

1410
/**
1511
* Attaches keydown handlers to the global document.
1612
* Handles Mac/PC switching of Ctrl to Cmd.
17-
*
18-
* @param keyHandlers - an object which maps from the key to its event handler. The object keys are a combination of the key and prefixes `ctrl-` `shift-` (ie. 'ctrl-f', 'ctrl-shift-f') and the values are the function to call when that specific key is pressed.
13+
* @param keyHandlers - an object which maps from the key to its event handler. The object keys are a combination of the key and prefixes `ctrl-` `shift-`
14+
* (ie. 'ctrl-f', 'ctrl-shift-f') and the values are the function to call when that specific key is pressed.
1915
*/
2016
export default function useKeyDownHandlers(keyHandlers: KeydownHandlerMap) {
2117
/**

0 commit comments

Comments
 (0)