import Ts from "typescript"; import { Project } from "@ts-morph/bootstrap"; /** * @alpha */ export interface ModuleDescriptor { name: string; content: string; } /** * @alpha */ export interface File { path: string; contents: string; } /** * @alpha */ export interface TransformFileOptions { project?: Project; sources?: ReadonlyArray; mocks?: ReadonlyArray; compilerOptions?: Partial; transforms: ((program: Ts.Program) => Ts.TransformerFactory)[]; } /** * Transform a TypeScript file given a project context and transform function * in a virtual filesystem * * @example * ```ts * const file = { * path: '/index.ts', * contents: ` * import { world } from "./world"; * console.log("Hello,", world); * ` * }; * * const sources = [ * { * path: '/world.ts', * contents: `export const world = 'World'` * } * ]; * * transformFile(file, { * sources, * transform() { ... } * }) * ``` * * @alpha * @param file - File to use as project root * @param options - Options providing context to the transformation */ export declare const transformFile: (file: File, options: TransformFileOptions) => string; export declare function getCompilerOptions(options?: Partial): Ts.CompilerOptions; //# sourceMappingURL=transform-file.d.ts.map