UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

37 lines (36 loc) 1.04 kB
import * as ts from "typescript"; import { Node, Identifier } from "./../common"; import { ImportDeclaration } from "./ImportDeclaration"; export declare class ImportSpecifier extends Node<ts.ImportSpecifier> { /** * Sets the identifier being imported. * @param name - Name being imported. */ setName(name: string): this; /** * Renames the identifier being imported. * @param name - New name. */ renameName(name: string): this; /** * Gets the name node of what's being imported. */ getNameNode(): Identifier; /** * Sets the alias for the name being imported. * @param alias - Alias to set. */ setAlias(alias: string): this; /** * Gets the alias identifier, if it exists. */ getAliasIdentifier(): Identifier | undefined; /** * Gets the import declaration associated with this import specifier. */ getImportDeclaration(): ImportDeclaration; /** * Remove the import specifier. */ remove(): void; }