/** * @license * Julian Cataldo * SPDX-License-Identifier: ISC */ import type { ImportAttribute, ImportDeclaration } from '@oxc-project/types'; import type { parseSync } from 'rolldown/utils'; type ParseSync = typeof parseSync; /** Resolve the OXC parser — bundled in Rolldown (Vite 8) or standalone. */ export declare function resolveParser(): Promise; export type ImportAttributeType = 'css' | 'css-lit'; export interface Options { /** Glob patterns for JS/TS files to transform (default: all JS/TS). */ include?: string[]; /** Glob patterns to exclude from transformation. */ exclude?: string[]; /** * Force every CSS import to produce a specific output, regardless of * the per-import `type` attribute or SSR auto-detection. * * - `'CSSStyleSheet'` — always emit a constructable `CSSStyleSheet` * (even during SSR — make sure a polyfill is available). * - `'CSSResult'` — always emit a Lit `CSSResult` via `unsafeCSS()`. * * When unset (default), the output is determined per-import: * `type: 'css'` → `CSSStyleSheet` on the client, `CSSResult` in SSR; * `type: 'css-lit'` → `CSSResult` everywhere. */ outputMode?: 'CSSStyleSheet' | 'CSSResult'; /** Enable verbose logging. */ log?: boolean; /** **Experimental**. Enable HMR (Hot Module Replacement) for CSS modules. */ hmr?: boolean; } export declare const defaultOptions: Required>; export interface CssImportMatch { node: ImportDeclaration; type: ImportAttributeType; } /** * Returns the import-attribute `type` value if the attribute list * contains `type: 'css'` or `type: 'css-lit'`, otherwise `null`. */ export declare function getCssAttributeType(attributes: ImportAttribute[]): ImportAttributeType | null; /** * Scan the top-level body for CSS import declarations that carry a * recognised `with { type: … }` attribute. */ export declare function findCssImports(body: readonly ImportDeclaration[]): CssImportMatch[]; /** * Build the replacement source text for a single CSS import. * * When `dev` is provided (dev-server mode): * - A CSS comment marker (`/* __csm:ID *\/`) is prepended to the CSS content * for DSD `