UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

23 lines (22 loc) 760 B
import * as ts from "typescript"; import CodeBlockWriter from "code-block-writer"; import { Constructor } from "./../../Constructor"; import { Node } from "./../common"; export declare type BodiedNodeExtensionType = Node<ts.Node>; export interface BodiedNode { /** * Gets the body. */ getBody(): Node; /** * Sets the body text. * @param writerFunction - Write the text using the provided writer. */ setBodyText(writerFunction: (writer: CodeBlockWriter) => void): this; /** * Sets the body text. * @param text - Text to set as the body. */ setBodyText(text: string): this; } export declare function BodiedNode<T extends Constructor<BodiedNodeExtensionType>>(Base: T): Constructor<BodiedNode> & T;