UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

23 lines (22 loc) 631 B
import * as ts from "typescript"; import { Constructor } from "./../../../Constructor"; import { Node, Identifier } from "./../../common"; export declare type NamedNodeExtensionType = Node<ts.Node & { name: ts.Identifier; }>; export interface NamedNode { /** * Gets the name node. */ getNameIdentifier(): Identifier; /** * Gets the name. */ getName(): string; /** * Renames the name. * @param newName - New name. */ rename(newName: string): this; } export declare function NamedNode<T extends Constructor<NamedNodeExtensionType>>(Base: T): Constructor<NamedNode> & T;