ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
29 lines (28 loc) • 913 B
TypeScript
import * as ts from "typescript";
import { Constructor } from "./../../../Constructor";
import { Node, Identifier } from "./../../common";
export declare type DeclarationNamedNodeExtensionType = Node<ts.NamedDeclaration>;
export interface DeclarationNamedNode {
/**
* Gets the name node.
*/
getNameNode(): Identifier | undefined;
/**
* Gets the name node or throws an error if it doesn't exists.
*/
getNameNodeOrThrow(): Identifier;
/**
* Gets the name.
*/
getName(): string | undefined;
/**
* Gets the name or throws if it doens't exist.
*/
getNameOrThrow(): string;
/**
* Renames the name.
* @param text - Text to set as the name.
*/
rename(text: string): this;
}
export declare function DeclarationNamedNode<T extends Constructor<DeclarationNamedNodeExtensionType>>(Base: T): Constructor<DeclarationNamedNode> & T;