import ts from 'typescript'; import type { Commands, KeysOf, SourceTemplateData, TemplateHelper } from './types'; export declare class TsWriter { readonly helpers?: H | undefined; /** * A simple map of all the sources that have been written. * * The string array represents the result of each write call, **not each written line**. */ readonly sources: Record; private outputs; readonly host: ts.CompilerHost; readonly compilerOptions: ts.CompilerOptions; /** * Constructs a new TsWriter instance. * * @param optionsOrTsconfigPath Either the compiler options or the path to a tsconfig * file. */ constructor(optionsOrTsconfigPath: ts.CompilerOptions | string, helpers?: H | undefined); /** * Collects all the written files and uses typescript to transpile them. * * @returns The result of the transpilation from typescript. */ transpile(): Record; /** * Generates the code to be written in the provided file. The first argument is an * object with the variables to be used in the template, as well the filename. The rest * of the arguments are the templates to be written in the file. */ write, P extends KeysOf>[]>(template: TemplateStringsArray, data: D, ...keys: Commands[]): void; /** * Generates the code to be written **ON TOP** in the provided file. The first argument * is an object with the variables to be used in the template, as well the filename. The * rest of the arguments are the templates to be written in the file. */ head, P extends KeysOf>[]>(template: TemplateStringsArray, data: D, ...keys: Commands[]): void; /** * Generates the code to be written in the provided file **ONLY IF NOT ALREADY * WRITTEN**. The first argument is an object with the variables to be used in the * template, as well the filename. The rest of the arguments are the templates to be * written in the file. */ writeUnique, P extends KeysOf>[]>(template: TemplateStringsArray, data: D, ...keys: Commands[]): void; /** * Generates the code to be written **ON TOP** in the provided file **ONLY IF NOT * ALREADY WRITTEN**. The first argument is an object with the variables to be used in * the template, as well the filename. The rest of the arguments are the templates to be * written in the file. */ headUnique, P extends KeysOf>[]>(template: TemplateStringsArray, data: D, ...keys: Commands[]): void; } //# sourceMappingURL=writer.d.ts.map