import type ts from "typescript/lib/tsserverlibrary"; import { Extracted } from "../util/extractor"; export type ProcessorExtension = `.${string}`; export interface ProcessorConfig { extensions: ProcessorExtension[]; create(options: CreateProcessorOptions): Processor; } export interface CreateProcessorOptions { ts: typeof ts; host: ts.ModuleResolutionHost; configFile: string | undefined; } export interface Processor { getRootNames?(): string[]; getScriptExtension(fileName: string): ts.Extension; getScriptKind(fileName: string): ts.ScriptKind; extract(fileName: string, code: string): Extracted; print(context: PrintContext): { code: string; map?: any; }; printTypes(context: PrintContext): { code: string; map?: any; }; } export interface PrintContext { extracted: Extracted; printer: ts.Printer; sourceFile: ts.SourceFile; typeChecker: ts.TypeChecker; formatSettings: Required; } export declare const extensions: ProcessorExtension[]; export declare function create(options: CreateProcessorOptions): Record<`.${string}`, Processor>; /** Resolve a file's processor extension, including compound `.module.css`. */ export declare function getProcessorExtension(fileName: string): ProcessorExtension | undefined; export declare function has(fileName: string): boolean; /** Whether a file is a CSS module (`.module.css`, `.module.scss`, `.module.less`). */ export declare function isCSSModule(fileName: string): boolean;