import type { StrictlyResolver } from '../locator/index.js'; import type { PostcssTransformerOptions } from './postcss-transformer.js'; /** * The value returned from the transformer. * `false` means to skip transpiling on that file. */ export type TransformResult = { /** The transformed code. */ css: string; /** The source map from the transformed code to the original code. */ map: string | object; dependencies: (string | URL)[]; } | false; export type TransformerOptions = { /** The path of the file to transform. */ from: string; /** The function to resolve the path of the imported file. */ resolver: StrictlyResolver; /** * Whether the specifier should be ignored. * For example, specifiers starting with `http://` or `https://` should be ignored. */ isIgnoredSpecifier: (specifier: string) => boolean; }; /** The function to transform source code. */ export type Transformer = (source: string, options: TransformerOptions) => TransformResult | Promise; export declare const handleImportError: (packageName: string) => (e: unknown) => never; export type DefaultTransformerOptions = PostcssTransformerOptions; export declare const createDefaultTransformer: (defaultTransformerOptions?: DefaultTransformerOptions) => Transformer;