import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraTimestamp}from'../timestamp.js';export interface LyraTranscriptEntry{id:string;speaker?:string; /** Required caption text. Runtime records without a string value are omitted. */ text:string;interim?:boolean;timestamp?:LyraTimestamp;}export interface LyraTranscriptFeedEventMap{'lr-follow-change':CustomEvent<{following:boolean;}>;} /** * `` — live captions for an in-progress voice session: speaker-grouped * entries, interim-vs-final styling with in-place upgrades keyed by `id`, and a stick-to-bottom * auto-scroll with release, the same `follow`/`lr-follow-change` contract `lr-terminal` uses. * * Rendering reconciles `entries` keyed by `id` via Lit's `repeat()`. Ids must be nonempty, * nonblank, and unique within a session, and `text` must be a string; invalid and later duplicate * rows are omitted with the first valid occurrence winning. A same-`id` entry with new `text` * replaces in place; a same-`id` entry whose * `interim` flips from `true` to unset/`false` * moves from the interim area into the `role="log"` region and announces exactly once. Interim * entries render *after* the log container, visible but structurally outside it, so per-token * mutations are never spoken by assistive tech. * * That announcement does **not** come from the shadow `role="log"` region, which is explicitly * `aria-live="off"`: a live region rendered inside a component's own shadow root is not reliably * announced (JAWS with Firefox ignores one outright). Each newly final entry's `text` is announced * once through the shared light-DOM `polite` sink instead (`internal/announcer.ts`), the same route * `` and `` take. The entries a feed is *mounted* with are existing * transcript rather than newly spoken captions, so the first render only records them; a caption is * announced when it becomes final on a later update, and never re-announced afterwards. * * Live captions only: recorded-media transcript sync — clickable cues, seek-on-select — is a * separate concern from this component. * * Public collection properties take bounded, clone-owned readonly snapshots. Create a new * collection and reassign it after changes; mutating the assigned array does not update the view. * * Activating the focused jump action resumes follow and transfers focus to the scroll base when the action disappears, unless a newer outside focus move takes precedence. * * @customElement lr-transcript-feed * @slot empty - Custom empty state. Default: the localized "No transcript yet". * @event lr-follow-change - `detail: { following: boolean }` — a user scroll or jump-button click * changed stick-to-bottom. Direct `follow` assignments and calling `scrollToBottom()` directly * are controlled input and do not echo an event, matching `lr-terminal`'s identical contract. * @csspart base - The scroll container. * @csspart log - The `role="log"` region wrapping final entries only. * @csspart interim-area - The wrapper around the interim (not-yet-final) entries, rendered as a sibling of `log`. Only rendered while at least one interim entry exists. * @csspart entry - One entry row (final or interim). * @csspart speaker - An entry's speaker label (omitted for a row that repeats the previous row's speaker). * @csspart text - An entry's text (`dir="auto"`, for mixed-language captions). * @csspart timestamp - An entry's timestamp, shown only when `show-timestamps` is set. * @csspart interim - Present (alongside `entry`) on an interim row. * @csspart jump-button - The "jump to latest" affordance, shown only while `follow` is `false`. * @csspart empty - The empty-state wrapper. * @status stable * @since 4.0.0 */ export declare class LyraTranscriptFeed extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];entries:readonly LyraTranscriptEntry[];follow:boolean;showTimestamps:boolean; /** Overrides the default `Intl.DateTimeFormat` short-time rendering. */ formatTimestamp?:(date:Date)=>string; /** `> 0` renders only the newest N rows (host `entries` data is untouched); `0` explicitly * opts into rendering the full history. */ maxRenderedEntries:number; /** Session identity. Changing it resets final-announcement history and treats * the new session's current entries as a silent baseline. */ sessionId:string; /** Accessible name for the `role="log"` region. Optional. Omitting it localizes the default * `transcriptFeedLabel` message; an explicit empty string renders no visible/accessible label, * unless `accessibleLabel` is also set (it wins over both). */ label?:string; /** Overrides the log region's computed accessible name. Wins over `label` and the localized * default. Attribute-reflects from a host-level `aria-label` so a plain-markup consumer gets * ARIA-name forwarding without setting a JS property. */ accessibleLabel:string|null;private _isFirstUpdate; /** Handle on the shared light-DOM `polite` region every announcement is written to. */ private announcementSink?; /** Ids already spoken (or recorded on the first render), so a caption announces exactly once * however many later updates keep re-rendering the same row. */ private announcedFinalIds;private sessionChanged;private pendingSessionBaseline; /** `maxRenderedEntries`, normalized to a finite non-negative integer (falling back to the * property's own default of `500`) -- a raw `NaN` (e.g. an invalid * `max-rendered-entries` attribute) would otherwise make `maxRenderedEntries > 0` always * false, which happens to already match the "render all" fallback, but only by the same * accidental-`NaN`-comparison quirk this guard exists to remove. */ private get effectiveMaxRenderedEntries();private get normalizedEntries();private get renderedEntries();connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private releaseAnnouncementSink; /** Mounts (or remounts) the shared region *ahead of* any text -- assistive tech has to have been * observing a live region before content arrives, so acquiring it lazily at announce time is * unreliable. Mirrors ``'s identically-shaped helper. */ private syncAnnouncementSink;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void; /** Speaks every entry that has become final since the previous update. The very first update * only records what is already there: a feed mounted with existing transcript must not read * the whole backlog aloud. `entries` is the full host-owned list (not `renderedEntries`), so a * `max-rendered-entries` cap scrolling a row out of the DOM neither suppresses its * announcement nor lets it be announced a second time on the way back in. */ private announceFinalizedEntries; /** Re-engages `follow` and scrolls the feed to its current bottom, instantly -- matching the * shared stick-to-bottom contract. New entries can arrive in rapid succession while streaming; * an animated scroll on every single one would fight itself rather than settle cleanly, so this * is a plain jump rather than a CSS-smoothed transition. Imperative navigation, like a direct * `follow` assignment: does not itself emit `lr-follow-change` (see `onJumpClick`, the * user-driven wrapper that does, mirroring `lr-terminal`'s `scrollToBottom()`/`jumpToLatest()` * split). */ scrollToBottom():void; /** The sole source of a user-driven `follow` transition from scrolling: this handler runs only * in response to a real `scroll` event on `[part="base"]`, so setting `follow` here -- unlike a * generic `updated()` diff of the property, which cannot tell a user scroll from a host * assignment or this component's own `scrollToBottom()` -- is unambiguously the user's own * action, and is the only path that emits `lr-follow-change`. */ private onScroll; /** The jump-button's click handler: the other user-driven source of an `lr-follow-change` * transition. Delegates the actual re-engage/scroll to `scrollToBottom()` (which does not * itself emit) and emits only when clicking it actually changed `follow` -- identical shape to * `lr-terminal`'s `jumpToLatest()`. */ private onJumpClick;private showSpeakerFor;private formatTs;private renderEntry;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-transcript-feed':LyraTranscriptFeed;}}