1 | import { Props } from '../components/FocusContext';
|
2 | interface Output {
|
3 | /**
|
4 | * Enable focus management for all components.
|
5 | */
|
6 | enableFocus: Props['enableFocus'];
|
7 | /**
|
8 | * Disable focus management for all components. Currently active component (if there's one) will lose its focus.
|
9 | */
|
10 | disableFocus: Props['disableFocus'];
|
11 | /**
|
12 | * Switch focus to the next focusable component.
|
13 | * If there's no active component right now, focus will be given to the first focusable component.
|
14 | * If active component is the last in the list of focusable components, focus will be switched to the first component.
|
15 | */
|
16 | focusNext: Props['focusNext'];
|
17 | /**
|
18 | * Switch focus to the previous focusable component.
|
19 | * If there's no active component right now, focus will be given to the first focusable component.
|
20 | * If active component is the first in the list of focusable components, focus will be switched to the last component.
|
21 | */
|
22 | focusPrevious: Props['focusPrevious'];
|
23 | }
|
24 | /**
|
25 | * This hook exposes methods to enable or disable focus management for all
|
26 | * components or manually switch focus to next or previous components.
|
27 | */
|
28 | declare const useFocusManager: () => Output;
|
29 | export default useFocusManager;
|