UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

35 lines (34 loc) 797 B
import * as ts from "typescript"; import { TypeChecker } from "./TypeChecker"; import { SourceFile } from "./../file"; import { EmitResult } from "./results"; /** * Options for emitting. */ export interface EmitOptions { /** * Optional source file to only emit. */ targetSourceFile?: SourceFile; /** * Whether only .d.ts files should be emitted. */ emitOnlyDtsFiles?: boolean; } /** * Wrapper around Program. */ export declare class Program { /** * Gets the underlying compiler program. */ readonly compilerObject: ts.Program; /** * Get the program's type checker. */ getTypeChecker(): TypeChecker; /** * Emits the TypeScript files to the specified target. */ emit(options?: EmitOptions): EmitResult; }