UNPKG

902 BTypeScriptView Raw
1/**
2 * Initializes the logic which:
3 *
4 * 1. Subscribes keydown and mousedown events. (It will only do it once per window,
5 * so it's safe to call this method multiple times.)
6 * 2. When the user presses directional keyboard keys, adds the 'ms-Fabric--isFocusVisible' classname
7 * to the document body, removes the 'ms-Fabric-isFocusHidden' classname.
8 * 3. When the user clicks a mouse button, adds the 'ms-Fabric-isFocusHidden' classname to the
9 * document body, removes the 'ms-Fabric--isFocusVisible' classname.
10 *
11 * This logic allows components on the page to conditionally render focus treatments based on
12 * the existence of global classnames, which simplifies logic overall.
13 *
14 * @param window - the window used to add the event listeners
15 * @deprecated Use useFocusRects hook or FocusRects component instead.
16 */
17export declare function initializeFocusRects(window?: Window): void;