export type SbbInputModality = 'touch' | 'mouse' | 'keyboard' | 'program' | null; /** * Service that detects the user's input modality. * * This service does not update the input modality when a user navigates with a screen reader * (e.g. linear navigation with VoiceOver, object navigation / browse mode with NVDA, virtual PC * cursor mode with JAWS). This is in part due to technical limitations (i.e. keyboard events do not * fire as expected in these modes) but is also arguably the correct behavior. Navigating with a * screen reader is akin to visually scanning a page, and should not be interpreted as actual user * input interaction. * * When a user is not navigating but *interacting* with a screen reader, this service attempts to * update the input modality to keyboard, but in general this service's behavior is largely * undefined. */ declare class SbbInputModalityDetector { /** The most recently detected input modality. */ get mostRecentModality(): SbbInputModality | null; reset(): void; /** * The most recent modality must be initialised with the value 'mouse' to cover the case where an action is * performed but no mouse or keyboard event has yet occurred on the page (e.g. `sbb-popover` with hover trigger). */ private _mostRecentModality; /** * The most recently detected input modality event target. Is null if no input modality has been * detected or if the associated event target is null for some unknown reason. */ get mostRecentTarget(): HTMLElement | null; private _mostRecentTarget; /** Options for this SbbInputModalityDetector. */ private readonly _options; /** * The timestamp of the last touch input modality. Used to determine whether mousedown events * should be attributed to mouse or touch. */ private _lastTouchMs; /** * Handles keydown events. Must be an arrow function in order to preserve the context when it gets * bound. */ private _onKeydown; /** * Handles mousedown events. Must be an arrow function in order to preserve the context when it * gets bound. */ private _onMousedown; /** * Handles touchstart events. Must be an arrow function in order to preserve the context when it * gets bound. */ private _onTouchstart; constructor(); } export declare const sbbInputModalityDetector: SbbInputModalityDetector; export declare function setModalityOnNextFocus(elementToFocus: HTMLElement | null | undefined): void; export {}; //# sourceMappingURL=input-modality-detector.d.ts.map