UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

14 lines 648 B
/** * Calls `handler` when the Escape key is pressed while `enabled` is true. * * The listener is attached to `document`, so Escape is caught regardless of * where focus currently sits. The handler is held in a ref, so passing an * inline arrow does not re-subscribe the listener on every render — it only * re-subscribes when `enabled` flips. * * Focus management (e.g. returning focus to a trigger) is left to the caller's * handler, since which element to focus is component-specific. */ declare function useOnEscape(handler: () => void, enabled?: boolean): void; export default useOnEscape; //# sourceMappingURL=useOnEscape.d.ts.map