/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ export type AriaLivePoliteness = 'off' | 'polite' | 'assertive'; /** * Allows to announce messages to screen readers. * * Adapted from https://github.com/angular/components/blob/main/src/cdk/a11y/live-announcer/live-announcer.ts */ export declare class SbbLiveAnnouncer { private _liveElement; private _previousTimeout; private _currentPromise; private _currentResolve; constructor(); /** * Announces a message to screen readers. * @param message Message to be announced to the screen reader. * @returns Promise that will be resolved when the message is added to the DOM. */ announce(message: string): Promise; /** * Announces a message to screen readers. * @param message Message to be announced to the screen reader. * @param politeness The politeness of the announcer element. * @returns Promise that will be resolved when the message is added to the DOM. */ announce(message: string, politeness?: AriaLivePoliteness): Promise; /** * Announces a message to screen readers. * @param message Message to be announced to the screen reader. * @param duration Time in milliseconds after which to clear out the announcer element. Note * that this takes effect after the message has been added to the DOM, which can be up to * 100ms after `announce` has been called. * @returns Promise that will be resolved when the message is added to the DOM. */ announce(message: string, duration?: number): Promise; /** * Announces a message to screen readers. * @param message Message to be announced to the screen reader. * @param politeness The politeness of the announcer element. * @param duration Time in milliseconds after which to clear out the announcer element. Note * that this takes effect after the message has been added to the DOM, which can be up to * 100ms after `announce` has been called. * @returns Promise that will be resolved when the message is added to the DOM. */ announce(message: string, politeness?: AriaLivePoliteness, duration?: number): Promise; /** * Clears the current text from the announcer element. Can be used to prevent * screen readers from reading the text out again while the user is going * through the page landmarks. */ clear(): void; destroy(): void; private _createLiveElement; } export declare const sbbLiveAnnouncer: SbbLiveAnnouncer; //# sourceMappingURL=live-announcer.d.ts.map