UNPKG

@ducor/react

Version:

admin template ui interface

10 lines (9 loc) 465 B
type Handler<E extends string> = E extends keyof WindowEventMap ? (ev: WindowEventMap[E]) => void : (ev: CustomEvent) => void; type Options = AddEventListenerOptions | boolean; /** * `useWindowEvent` is a custom hook that assigns an event listener to `window`. * * @see Docs https://ui.ducor.net/hooks/use-window-event */ declare const useWindowEvent: <E extends string>(event: E, handler: Handler<E>, options?: Options) => void; export default useWindowEvent;