/** * emulate tab keyboard events and default action (switch to next element) * * fist: * - dispatch tab keydown event at active element * * then emulate default action (if not prevented): * - blur on active element * - skip keypress action (it's between element switch so there is no target) * - find next element in selectable elemetns * - focus on next element * - tab keyup on next element * * or (if default action is prevented): * - tab keypress on active element * - tab keyup on active elment * * @returns true if switched elemenet and false if default action had been prevented */ export declare function emulateTab(): boolean; export declare namespace emulateTab { /** * emulate tab from a given element (default is active element) * * @returns methods to select tab target */ const from: typeof emulateTabFrom; /** * emulate tab from active element to a given target * * @param target element to switch to * @param sendKeyEventsWithShiftModifier like shift tab would do * @returns true if switched elemenet and false if default action had been prevented */ const to: (target: HTMLElement, sendKeyEventsWithShiftModifier?: boolean) => boolean; /** * emulate tab to previous element * * @returns true if switched elemenet and false if default action had been prevented */ const backwards: () => boolean; /** * alias for emulateTab() that is more precise about it's direction * * @returns true if switched elemenet and false if default action had been prevented */ const forwards: () => boolean; /** * find all elements that are selectable by tab */ const findSelectableElements: () => HTMLElement[]; } declare function emulateTabFrom(source?: HTMLElement): { /** * emulate tab to the element before the starting element (which is the active element by default) * * @returns true if switched elemenet and false if default action had been prevented */ toPreviousElement: () => boolean; /** * emulate tab to the element after the starting element (which is the active element by default) * * @returns true if switched elemenet and false if default action had been prevented */ toNextElement: () => boolean; /** * emulate tab to a custom given element * * @param target element after tab * @param sendKeyEventsWithShiftModifier like shift tab would do * @returns true if switched elemenet and false if default action had been prevented */ to: (target: HTMLElement, sendKeyEventsWithShiftModifier?: boolean) => boolean; }; export {};