/** * @jorvel/ssr — best-effort critical-CSS inliner. * * Given rendered HTML + a stylesheet, keep only the rules whose selectors * reference a class / id / tag actually present in the HTML, inline those into * ``, and (optionally) defer the full sheet. Pure string work — edge-safe, * no DOM, no PostCSS. A heuristic, not a full CSS parser: it handles the common * `.class`, `#id`, `tag`, and comma-lists; it deliberately keeps `@media` / * `@keyframes` / `:root` blocks (cheap + usually needed above the fold). */ export interface CriticalCssResult { /** The rules kept as critical (joined CSS). */ critical: string; /** Rules dropped (not referenced in the HTML). */ rest: string; } /** Split CSS into critical (used) + rest, based on selectors present in `html`. */ export declare function extractCriticalCss(html: string, css: string): CriticalCssResult; export interface InlineCriticalOptions { /** URL of the full stylesheet to defer-load after paint. */ href?: string; } /** * Inline critical CSS into `` and, when `href` is given, defer the full * sheet with a `media=print → onload` swap. Returns the modified HTML. */ export declare function inlineCriticalCss(html: string, css: string, opts?: InlineCriticalOptions): string; //# sourceMappingURL=critical-css.d.ts.map