import { Logger } from '@elliemae/pui-diagnostics'; export declare const APP_STYLE_ID_PREFIX = "ice-style-"; type LoadOptions = { name: string; hostUrl: string; documentEle: Document; }; /** * A utility class for dynamically loading, managing, and removing stylesheet elements in the DOM. * @remarks * This class provides methods to: * - Add stylesheet link elements dynamically to the document * - Remove stylesheet elements by ID * - Clean up dynamically imported stylesheets by host URL * @example * ```typescript * const logger = new Logger(); * const styleLoader = new StyleLoader(logger); * * // Add a stylesheet * await styleLoader.add({ * name: 'myApp', * hostUrl: 'https://example.com', * documentEle: document, * fileName: 'styles.css', * index: 0 * }); * * // Remove a stylesheet * await styleLoader.remove('ice-style-myapp-0', document); * ``` */ export declare class StyleLoader { #private; constructor(logger: Logger); /** * Loads multiple stylesheet assets in parallel. * @param assets - Array of stylesheet filenames (relative paths) * @param options - Configuration options for loading the stylesheets * @param options.name - The name of the application (used for generating stylesheet IDs) * @param options.hostUrl - The base URL for resolving stylesheet paths * @param options.documentEle - The document object where stylesheets should be added * @returns A promise that resolves with an array of stylesheet element IDs when all stylesheets are loaded * @remarks * This method loads all stylesheets in parallel using Promise.all for optimal performance. * Each stylesheet is assigned a unique ID based on the application name and its index. * Unlike scripts, stylesheets don't typically have execution order dependencies. * @example * ```typescript * const styleIds = await styleLoader.load( * ['main.css', 'theme.css', 'components.css'], * { * name: 'myApp', * hostUrl: 'https://example.com', * documentEle: document * } * ); * ``` */ load: (assets: string[], options: LoadOptions) => Promise; /** * Removes a stylesheet link element from the document by its ID. * @param elementId - The ID of the stylesheet element to remove (default: '') * @param documentEle - The document object from which to remove the stylesheet (default: document) * @returns A promise that resolves when the stylesheet element has been removed * @remarks * If the element with the specified ID is not found, a warning is logged but the promise still resolves. * @example * ```typescript * await styleLoader.remove('ice-style-myapp-0', document); * ``` */ remove: (elementId?: string, documentEle?: Document) => Promise; /** * Removes all stylesheet link elements from the document that match a specific host URL pattern. * @param hostUrl - The host URL pattern to match against stylesheet hrefs * @param documentEle - The document object from which to remove stylesheets * @remarks * This method queries all elements with `rel="stylesheet"` and removes any link whose `href` * attribute matches the provided host URL pattern (case-insensitive). This is useful for * cleaning up dynamically imported stylesheets from a specific host. * The iteration happens in reverse order to safely remove elements while iterating. * @example * ```typescript * styleLoader.removeDynamicImportedStyles('https://cdn.example.com', document); * ``` */ removeDynamicImportedStyles: (hostUrl: string, documentEle: Document) => void; } export {};