web-ui-pack
Version:
Web package with UI elements
15 lines (14 loc) • 510 B
TypeScript
export interface FocusOptions {
/** Focus last possible item (instead of 1st) */
isFocusLast?: boolean;
}
interface FocusFirstFunc {
(element: HTMLElement | Pick<HTMLElement, "focus">, options?: FocusOptions): boolean;
/** QuerySelector for all possible-focusable elements */
$selector: string;
}
/** Set focus on element or first possible nested element
* @param element
* @return {Boolean} true if focus is called */
declare const focusFirst: FocusFirstFunc;
export default focusFirst;