UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

23 lines (22 loc) 710 B
import * as ts from "typescript"; import { Node } from "./compiler"; export interface CreateWrappedNodeOptions { /** * Compiler options. */ compilerOptions?: ts.CompilerOptions; /** * Optional source file of the node. Will make it not bother going up the tree to find the source file. */ sourceFile?: ts.SourceFile; /** * Type checker. */ typeChecker?: ts.TypeChecker; } /** * Creates a wrapped node from a compiler node. * @param node - Node to create a wrapped node from. * @param info - Info for creating the wrapped node. */ export declare function createWrappedNode<T extends ts.Node = ts.Node>(node: T, opts?: CreateWrappedNodeOptions): Node<T>;