import type ts from "typescript/lib/tsserverlibrary"; import { Extracted } from "../util/extractor"; export type ProcessorExtension = `.${string}`; export interface ProcessorConfig { extension: 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; export declare function has(fileName: string): boolean;