a11y-basepackage.src.focus-restoration-controller.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-webcomponents Show documentation
Show all versions of vaadin-webcomponents Show documentation
Mvnpm composite: Vaadin webcomponents
The newest version!
/**
* @license
* Copyright (c) 2021 - 2024 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import type { Constructor } from '@open-wc/dedupe-mixin';
/**
* A controller for saving a focused node and restoring focus to it later.
*/
export declare function FocusRestorationController>(
base: T,
): Constructor & T;
export declare class FocusRestorationControllerClass {
/**
* Saves the given node as a target for restoring focus to
* when `restoreFocus()` is called. If no node is provided,
* the currently focused node in the DOM is saved as a target.
*/
saveFocus(node: Node | null | undefined): void;
/**
* Restores focus to the target node that was saved previously with `saveFocus()`.
*/
restoreFocus(): void;
}