/** * Theme CSS loading utilities */ export interface ThemeInfo { id: string; cssFile: string; icon?: string | undefined; } /** * Resolves an asset path relative to the site's base URL. */ export declare function resolveAssetPath(assetPath: string, baseUrl: string): string; /** * Gets the base URL from the document's data-baseurl attribute. * Validates the URL to prevent injection attacks: * - Rejects protocol-relative URLs (//example.com) * - Rejects non-HTTPS absolute URLs (except localhost) * - Only allows same-origin or relative paths */ export declare function getBaseUrl(doc: Document): string; /** * Builds the element ID of a theme's stylesheet link. * * Single source of truth for the `theme--css` convention shared by * the loader and the lazy-CSS helpers. * * @param themeId - Theme whose stylesheet link ID to build * @returns The stylesheet link element ID */ export declare function themeLinkId(themeId: string): string; /** * Loads a CSS file with a timeout, returning a promise that resolves when loaded. */ export declare function loadCSSWithTimeout(link: HTMLLinkElement, themeId: string, timeoutMs?: number): Promise; /** * Gets the current theme from document element classes */ export declare function getCurrentThemeFromClasses(element: HTMLElement): string | null; /** * Applies theme class and root data attributes to the document element. */ export declare function applyThemeClass(doc: Document, themeId: string): void; /** * Loads theme CSS file if not already loaded. * * @returns true when the theme's stylesheet is present and confirmed * loaded (or was already linked), false when path resolution or the * network fetch failed */ export declare function loadThemeCSS(doc: Document, theme: ThemeInfo, baseUrl: string): Promise; //# sourceMappingURL=theme-loader.d.ts.map