UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

62 lines (61 loc) 1.55 kB
import * as ts from "typescript"; import { Node } from "./../common"; import { Type } from "./../type"; export declare class Symbol { /** * Gets the underlying compiler symbol. */ readonly compilerSymbol: ts.Symbol; /** * Gets the symbol name. */ getName(): string; /** * Gets the aliased symbol. */ getAliasedSymbol(): Symbol | undefined; /** * Gets if the symbol is an alias. */ isAlias(): boolean; /** * Gets the symbol flags. */ getFlags(): ts.SymbolFlags; /** * Gets if the symbol has the specified flags. * @param flags - Flags to check if the symbol has. */ hasFlags(flags: ts.SymbolFlags): boolean; /** * Gets if the symbols are equal. * @param symbol - Other symbol to check. */ equals(symbol: Symbol | undefined): boolean; /** * Gets the symbol declarations. */ getDeclarations(): Node[]; /** * Get the exports of the symbol. * @param name - Name of the export. */ getExportByName(name: string): Symbol | undefined; /** * Gets the exports from the symbol. */ getExports(): Symbol[]; /** * Gets the declared type of the symbol. */ getDeclaredType(): Type; /** * Gets the type of the symbol at a location. * @param node - Location to get the type at for this symbol. */ getTypeAtLocation(node: Node): Type<ts.Type>; /** * Gets the fully qualified name. */ getFullyQualifiedName(): string; }