@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
38 lines (37 loc) • 1.2 kB
TypeScript
import { RefObject } from "react";
//#region src/hooks/use-focus/index.d.ts
interface UseFocusOnShowProps {
focusTarget?: HTMLElement | null | RefObject<HTMLElement | null>;
preventScroll?: boolean;
shouldFocus?: boolean;
visible?: boolean;
}
/**
* `useFocusOnShow` is a custom hook that focuses on the target element when it is shown.
*
* @see https://yamada-ui.com/docs/hooks/use-focus-on-show
*/
declare const useFocusOnShow: <Y extends HTMLElement>(refOrEl: RefObject<null | Y> | Y, {
focusTarget: focusRefOrEl,
preventScroll,
shouldFocus,
visible
}?: UseFocusOnShowProps) => void;
interface UseFocusOnMouseDownProps {
ref: RefObject<HTMLElement | null>;
elements?: (HTMLElement | null | RefObject<HTMLElement | null>)[];
enabled?: boolean;
}
/**
* `useFocusOnPointerDown` is a custom hook that focuses on the target element when it is clicked.
*
* @see https://yamada-ui.com/docs/hooks/use-focus-on-pointer-down
*/
declare const useFocusOnPointerDown: ({
ref,
elements,
enabled
}: UseFocusOnMouseDownProps) => void;
//#endregion
export { UseFocusOnMouseDownProps, UseFocusOnShowProps, useFocusOnPointerDown, useFocusOnShow };
//# sourceMappingURL=index.d.ts.map