@tanstack/react-hotkeys
Version:
React adapter for TanStack Hotkeys
20 lines • 623 B
TypeScript
import { HotkeyScopesState } from "@tanstack/hotkeys";
//#region src/useHotkeyScopesState.d.ts
/**
* React hook that returns the hotkey manager's scope state: the active
* scopes, the exclusive scope that owns the keyboard, and the scopes it
* allows or suspends. Re-renders when scopes activate or release.
*
* @returns The current scope state
*
* @example
* ```tsx
* function KeyboardOwner() {
* const { exclusive } = useHotkeyScopesState()
*
* return exclusive ? <p>Shortcuts belong to {exclusive}</p> : null
* }
* ```
*/
export declare function useHotkeyScopesState(): HotkeyScopesState;
//#endregion