UNPKG

931 BTypeScriptView Raw
1import * as ts from 'typescript';
2import type { CustomTransformers, Diagnostic, Program } from 'typescript';
3export interface TypeScriptCompilationOptions {
4 outputPath: string;
5 projectName: string;
6 projectRoot: string;
7 tsConfig: string;
8 deleteOutputPath?: boolean;
9 rootDir?: string;
10 watch?: boolean;
11 getCustomTransformers?(program: Program): CustomTransformers;
12}
13export interface TypescriptWatchChangeEvent {
14 diagnostic: ts.Diagnostic;
15 newLine: string;
16 options: ts.CompilerOptions;
17 errorCount: number;
18}
19export declare function compileTypeScript(options: TypeScriptCompilationOptions): {
20 success: boolean;
21};
22export declare function compileTypeScriptWatcher(options: TypeScriptCompilationOptions, callback: (diagnostic: Diagnostic, newLine: string, options: ts.CompilerOptions, errorCount: number) => void | Promise<void>): ts.WatchOfFilesAndCompilerOptions<ts.BuilderProgram>;