/**
 * styleSheetRegistry — single source of truth for custom CSS/JS injection.
 *
 * APPROACH
 * --------
 * CSS  — One CSSStyleSheet object is constructed per URL (Constructable
 *        Stylesheets API).  Any shadow root that needs the styles calls
 *        adoptStyleSheet(url, shadowRoot); the same object is pushed onto
 *        adoptedStyleSheets so the browser parses the rules exactly once,
 *        regardless of how many roots adopt it.  The parent knowledge-box
 *        triggers the first fetch; child chat-message calls re-use the
 *        already-resolved Promise and adopt the cached sheet at zero cost.
 *
 * JS   — Scripts are injected into the caller's shadow root (or element)
 *        exactly once per root per URL via a two-level cache: a WeakMap
 *        tracks which URLs have been appended to each root, and a url →
 *        Promise map shares the single load event across all roots so the
 *        network request fires only once.  Concurrent callers await the same
 *        load event; subsequent callers for the same URL in the same root
 *        return immediately.
 *
 * SINGLE CODE PATH
 * ----------------
 * Both ai12z-knowledge-box and ai12z-chat-message import from this module.
 * The parent box makes the first call (triggering the fetch / DOM append).
 * Child calls get the cached result with no side-effects.
 * There is no third injection point; do not add one here.
 */
/**
 * Fetch `url` exactly once, build a CSSStyleSheet from its text, and adopt
 * it in `shadowRoot`.  Safe to call from multiple components / shadow roots —
 * repeated calls for the same URL share the cached sheet.
 */
export declare function adoptStyleSheet(url: string, shadowRoot: ShadowRoot | null): Promise<void>;
/**
 * Append `url` as a <script> into `el` (shadow root or element) exactly once
 * per root per URL.  The underlying network request is shared across all roots
 * via a url → Promise cache, so the script is only fetched once.
 */
export declare function loadScriptOnce(url: string, el: HTMLElement | ShadowRoot): Promise<void>;
