import { Unsubscribe } from './integration.js'; /** Attribute whose value names the theme to prefetch on hover/focus. */ export declare const PREFETCH_TRIGGER_ATTRIBUTE = "data-theme-preview"; /** * Checks whether a theme's stylesheet is already present in the document. * * Recognises both links owned by the selector (`theme--css`) and the * blocking script's FOUC-prevention link when it points at the theme. * * @param documentObj - Document to inspect * @param themeId - Theme whose stylesheet to look for * @returns True when the theme's CSS is already linked */ export declare function isThemeCSSLoaded(documentObj: Document, themeId: string): boolean; /** * Decides whether a theme's CSS needs an on-demand load. * * @param documentObj - Document to inspect * @param themeId - Theme the page is about to switch to * @returns True when the theme is known and its CSS is not yet linked */ export declare function shouldLoadThemeCSS(documentObj: Document, themeId: string): boolean; /** * Loads a theme's CSS on demand through the selector's loader. * * Injects the stylesheet link at most once: repeat calls for a theme * whose CSS is already linked are no-ops that resolve to true. Unknown * or malformed theme IDs are rejected without touching the document. * * @param documentObj - Document to load the stylesheet into * @param themeId - Theme whose CSS to load * @returns True when the CSS is available (loaded now or previously) */ export declare function loadThemeCSSOnDemand(documentObj: Document, themeId: string): Promise; /** * Prefetches a theme's CSS so a later switch hits the browser cache. * * Injects a `` at most once per theme. * Skips themes whose stylesheet is already linked, themes already * prefetched, and unknown theme IDs. * * @param documentObj - Document to inject the prefetch link into * @param themeId - Theme whose CSS to prefetch * @returns True when a prefetch link was injected by this call */ export declare function prefetchThemeCSS(documentObj: Document, themeId: string): boolean; /** * Wires hover/focus-triggered CSS prefetch for marked elements. * * Listens for `mouseover` and `focusin` on the document and prefetches * the theme named by the nearest ancestor carrying the * `data-theme-preview` attribute. Delegation means marquee items added * after wiring are covered without re-wiring. * * @param documentObj - Document to listen on (defaults to global) * @returns Function that removes the listeners when called */ export declare function wireHoverPrefetch(documentObj?: Document): Unsubscribe; //# sourceMappingURL=lazy-css.d.ts.map