Types
Shared TypeScript interfaces and type definitions exported by @diffgazer/keys.
Shared type definitions exported by @diffgazer/keys.
HandlerOptions
Passed to register() in the keyboard context. You won't use this directly — it's the internal representation of UseKeyOptions fields.
UseKeyOptions
Options for useKey.
UseFocusTrapOptions
Options for useFocusTrap.
RestoreFocusOptions
Options for restoreFocus() and useFocusRestore.
UseFocusRestoreOptions
Options for useFocusRestore.
UseScrollLockOptions
Options for useScrollLock.
NavigationRole
Used by useNavigation and useScopedNavigation to determine which DOM elements are navigable.
VerticalDirection
Returned by getVerticalArrowDirection() and toVerticalBoundaryDirection().
BoundaryDirection
Accepted by toVerticalBoundaryDirection().
KeyHandler
Callback type for keyboard event handlers.
Only the exact return value false has special meaning: it declines the matched key and lets the next lower-priority matching handler in the active scope run. Other return values are ignored. When a handler with preventDefault enabled accepts the match (returns anything other than false), event.preventDefault() runs after that handler returns. A declining handler never prevents the default, so native behavior survives until a handler actually handles the key.
DECLINE and Decline
The named sentinel for that decline value, exported so handlers can spell the intent instead of a bare false. The library's own hooks use it.