import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type AnnounceOptions}from'../../../internal/announcer.js';export type LyraLiveRegionMode='polite'|'assertive'; /** * `` — a visually-hidden ARIA live region that throttles * and coalesces announcements instead of relaying every call verbatim. * * The announced copy does **not** live in this element's shadow root: a live * region inside a shadow root is not reliably announced (JAWS with Firefox * ignores one outright), so `announce()` appends to a shared, ref-counted, * visually-hidden region in the host document — see * `acquireAnnouncementSink()` in `../../../internal/announcer.js`. Every * `` of the same `mode` in a document shares one such region, * and it is unmounted when the last one disconnects. The shadow * `part="region"` element remains as an `aria-hidden` mirror of the latest * text — a styling/inspection surface, never a second announcement. * * Naive live regions plus token-by-token streaming text (a chat response, a * progress readout, ...) equals screen-reader spam: every incremental chunk * gets announced. This component wraps `Announcer` * (`../../internal/announcer.js`) so callers can fire `announce()` as often * as they like — only the latest text within each `throttle-ms` window * actually reaches assistive tech, and a `{ force: true }` call (e.g. once a * stream ends) always lands immediately regardless of any window in * progress. * * A consumer typically mounts one `` per page/surface * (much like `` is one region per placement — see * `../toast/toaster.ts`) and keeps a reference to call `announce()` from * application code or a parent component: * * @example * ```html * * * ``` * ```ts * const live = document.getElementById('chat-live') as LyraLiveRegion; * * // streaming tokens: fine to call on every chunk, only the trailing state lands * live.announce(`${partialText} …`); * * // stream finished: always announced, even mid-throttle-window * live.announce('Response complete', { force: true }); * ``` * * A parent Lit component would instead hold the reference via `@query`: * ```ts * @query('lr-live-region') private liveRegion!: LyraLiveRegion; * ``` * and is exactly what later components in this family (a stream-status * indicator, a tool-call chip's status transitions, a chat message's * streaming state) are expected to do rather than hand-rolling their own * `aria-live` element. * * @customElement lr-live-region * @csspart region - The visually-hidden, `aria-hidden` mirror of the latest announced text. The * announcement itself lands in the shared light-DOM region, not here. * @status stable * @since 4.0.0 */ export declare class LyraLiveRegion extends LyraElement{static styles:import("lit").CSSResultGroup[]; /** `polite` (role="status") waits for the user to be idle; `assertive` * (role="alert") interrupts. Mirrors native `aria-live` semantics. * * Selects which shared light-DOM region announcements land in. `write()` * re-resolves that region at announce time (not only from this property's * own update cycle) so a caller that sets `mode` and immediately * force-announces in the same synchronous turn -- e.g. a stream-status * transition -- gets the new urgency and the new text landing together, * rather than the text beating Lit's re-render to the DOM. Unsupported values normalize to * reflected `polite`. */ private _mode;get mode():LyraLiveRegionMode;set mode(next:LyraLiveRegionMode); /** Throttle window in ms — see `Announcer` in `internal/announcer.ts`. */ throttleMs:number;private readonly announcer;private regionEl?;private sink?;private sinkPoliteness?;private pendingWrite?; /** `throttleMs` normalized to a finite timer duration before it reaches `Announcer`'s own * `setTimeout(..., throttleMs)` call -- an invalid attribute value would otherwise schedule a * same-tick flush (NaN/negative both clamp to 0 per the `setTimeout` spec) or hit browsers' * 32-bit `setTimeout` ceiling unpredictably (`Infinity`/an absurdly large value). */ private get safeThrottleMs();constructor();connectedCallback():void;protected updated(changed:PropertyValues):void;firstUpdated(changed:PropertyValues):void;disconnectedCallback():void; /** Point `this.sink` at the shared region for the current `mode` in the current owner document, * releasing whichever one it held before. Cheap and idempotent when nothing changed. */ private syncSink;private releaseSink; /** * Queue `text` for announcement. Calls arriving within `throttle-ms` of * the first call in a burst collapse to a single announcement of the * latest text; pass `{ force: true }` to bypass the window and flush * immediately (e.g. for a final/terminal message that must not be * dropped). */ announce(text:string,options?:AnnounceOptions):void;private write;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-live-region':LyraLiveRegion;}}