UNPKG

budgie-cli

Version:
60 lines (59 loc) 1.69 kB
import { Language } from "budgie"; import { ConversionStatus } from "../converters/converter"; import { IFileSystem } from "../fileSystem"; import { ILogger } from "../logger"; /** * Options to convert a set of files. */ export interface IRunDependencies { /** * Cache of contents of file paths to convert, keyed by unique file name. * * @remarks This may be added to by converters as they need more files. */ existingFileContents: Map<string, string>; /** * Base or root directory to ignore from the beginning of file paths, such as "src/", if not "". */ baseDirectory?: string; /** * Reads and writes files. */ fileSystem: IFileSystem; /** * File paths requested to be converted. */ budgieFilePaths: ReadonlySet<string>; /** * Languages to output to. */ languages: ReadonlyArray<Language>; /** * Logs information on significant events. */ logger: ILogger; /** * Namespace before path names, such as "Budgie", if not "". */ outputNamespace?: string; /** * TypeScript configuration project file path, if provided. */ typescriptConfig?: string; } /** * Results from converting a set of files. */ export interface IConversionResults { /** * Whether the results succeeded. */ status: ConversionStatus; } /** * Converts a set of files. * * @param dependencies Injected dependencies for converting files. * @returns Promise for converting the files. */ export declare const convertFiles: (dependencies: IRunDependencies) => Promise<IConversionResults>;