import{LitElement,type CSSResultGroup,type PropertyDeclaration,type PropertyValues}from'lit';import type{LyraLocaleStrings}from'./localization.js';export interface LyraEmitOptions{ /** Set only for events whose listener may veto an operation before it runs. */ cancelable?:boolean;}export type LyraEventMap=Record; /** * Public event-detail view: collection paths and their containing records are recursively readonly. * Components may construct a mutable local value before `emit()`; listeners always receive the * detached, frozen runtime snapshot represented by this type. */ export type LyraEventDetailSnapshot =Value extends(...args:never[])=>unknown?Value:Value extends Element|Blob|AbortSignal|Error?Value:Value extends DOMRectReadOnly?Readonly<{x:number;y:number;width:number;height:number;top:number;right:number;bottom:number;left:number;}>:Value extends ReadonlyMap ?ReadonlyMap,LyraEventDetailSnapshot>:Value extends ReadonlySet ?ReadonlySet>:Value extends readonly unknown[]?{readonly[Key in keyof Value]:LyraEventDetailSnapshot;}:Value extends object?{readonly[Key in keyof Value]:LyraEventDetailSnapshot;}:Value; /** * The trailing `emit()` arguments for one entry of a component's event map. * * The map entry is the single source of truth: `CustomEvent<{ id: string }>` makes `detail` * **required** and typed, while `CustomEvent` (or an optional detail) makes it omittable. * The runtime normalizes an omitted detail to the platform's canonical `null`. Entries that are * not `CustomEvent` at all — the native re-emits some components list * as `input: Event` / `load: Event` — keep the permissive shape, since there is no declared detail * to check against. * * The tuple wrappers (`[Events[K]] extends [CustomEvent<…>]`) stop the conditional from * distributing over a union-typed map entry, which would otherwise turn one required `detail` into * a union of argument lists that no call site can satisfy. */ export type LyraEmitArgs =[Events[K]]extends[CustomEvent]?null extends Detail?[detail?:Detail,options?:LyraEmitOptions]:undefined extends Detail?[detail?:Detail,options?:LyraEmitOptions]:[detail:Detail,options?:LyraEmitOptions]:[detail?:unknown,options?:LyraEmitOptions]; /** The `CustomEvent` `emit()` returns for one entry of a component's event map. */ export type LyraEmittedEvent =[Events[K]]extends[CustomEvent]?CustomEvent:CustomEvent; /** * Internal controller seam for browser-derived state that must not change a hydrating element's * first render. A symbol keeps the hook out of the component API while allowing shared reactive * controllers to use the same hydration decision as their host. */ export declare const SEED_FIRST_RENDER_STATE:unique symbol; /** Internal query used by slot-presence controllers while SSR light DOM is unknowable. */ export declare const SLOT_PRESENCE_UNRESOLVED:unique symbol; /** * Shared base for every Lyra component. Supplies the design-token layer * (`--lr-theme-*` theme-input properties with hardcoded `--lr-*` fallbacks). * RTL is handled by components using CSS logical properties rather than a forced `dir`. */ export declare class LyraElementextends LitElement{static styles:CSSResultGroup; /** * Reactive public properties whose array/tuple assignments cross the shared immutable ownership * boundary. Subclasses list only their own collection properties; the descriptor consults the * concrete constructor at assignment time, after static initialization has completed. */ protected static readonly ownedCollectionProperties:readonly PropertyKey[]; /** * Explicit exceptions whose item identity is itself part of the public contract (for example a * generic virtual-list row or a command object returned to an imperative callback). The array * sequence is still bounded, detached, and frozen; only its item references are retained. */ protected static readonly identityCollectionProperties:readonly PropertyKey[]; /** Exact opaque-object exceptions; unlike item-identity lists, no sequence claim is made. */ protected static readonly identityCollectionObjectProperties:readonly PropertyKey[]; /** Events whose collection-bearing detail is detached and recursively frozen before dispatch. */ protected static readonly immutableEventDetails:readonly string[]; /** Explicit root detail fields whose object identity is part of an enrolled event contract. */ protected static readonly identityEventDetailProperties:Readonly>; /** Root event arrays whose sequence is owned while each generic/platform item retains identity. */ protected static readonly identityEventDetailCollectionItems:Readonly>; /** * Components commonly forward ARIA host attributes to an internal role and derive localization * from `lang`/`dir`. These global attributes are not reactive Lit properties, so observe them * centrally to keep post-render attribute changes in sync. * * `super.observedAttributes` is also what finalizes the class (Lit documents this getter as the * finalization trigger), so it is the first moment every reactive accessor exists — and the one * `customElements.define()` guarantees. The immutable-collection boundary is therefore installed * here, right after finalization and before any instance can exist. See * {@link installOwnedCollectionAccessors} for why it is no longer a `getPropertyDescriptor()` * override. */ static get observedAttributes():string[]; /** Optional locale override. Otherwise the nearest `locale`/`lang` ancestor is used. */ locale:string;private stringsValue; /** * Immutable, bounded per-instance message overrides, useful for application-specific wording. * Assignment snapshots own data-string/plural entries; malformed/accessor entries are omitted * and later caller mutation cannot alter rendered copy without a new assignment. */ get strings():LyraLocaleStrings;set strings(value:LyraLocaleStrings);private stopLocaleSubscription?;private localeSubscriptionNeeded;private lastLocalizedCatalogVersion?;private pendingLoadController?; /** Callbacks scheduled during the current update cycle, keyed so that two callers with * *different* purposes each keep a slot. A single boolean here meant the second caller in a * cycle was silently dropped. */ private afterUpdateCallbacks?; /** Callbacks that came due while detached, replayed on reconnect. */ private deferredAfterUpdate?;private stopInheritedContextObservation?; /** `undefined` until the first connect decides it, then true only between that connect and the * first update of an element whose shadow DOM a server already rendered. See * {@link seedFirstRenderState}. */ private hydratingServerShadow?; /** Browser-only first-render reads coalesced behind one completed hydration update. */ private deferredFirstRenderSeeds?;constructor(); /** * Lit caches one constructed `CSSStyleSheet` per class, built in this realm's global document. * A shadow root created in another document (an element adopted into an iframe, or a child an * adopted element renders later) cannot adopt those sheets: the engine rejects the assignment * with `NotAllowedError`. Such roots receive inline `