ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
58 lines (57 loc) • 1.94 kB
TypeScript
import * as ts from "typescript";
import { ExportSpecifierStructure } from "./../../structures";
import { Node } from "./../common";
import { ExportSpecifier } from "./ExportSpecifier";
export declare class ExportDeclaration extends Node<ts.ExportDeclaration> {
/**
* Sets the import specifier.
* @param text - Text to set as the import specifier.
*/
setModuleSpecifier(text: string): this;
/**
* Gets the module specifier or undefined if it doesn't exist.
*/
getModuleSpecifier(): string | undefined;
/**
* Gets if the module specifier exists
*/
hasModuleSpecifier(): boolean;
/**
* Gets if this export declaration is a namespace export.
*/
isNamespaceExport(): boolean;
/**
* Gets if the export declaration has named exports.
*/
hasNamedExports(): boolean;
/**
* Add a named export.
* @param structure - Structure that represents the named export.
*/
addNamedExport(structure: ExportSpecifierStructure): ExportSpecifier;
/**
* Add named exports.
* @param structures - Structures that represent the named exports.
*/
addNamedExports(structures: ExportSpecifierStructure[]): ExportSpecifier[];
/**
* Insert a named export.
* @param index - Index to insert at.
* @param structure - Structure that represents the named export.
*/
insertNamedExport(index: number, structure: ExportSpecifierStructure): ExportSpecifier;
/**
* Inserts named exports into the export declaration.
* @param index - Index to insert at.
* @param structures - Structures that represent the named exports.
*/
insertNamedExports(index: number, structures: ExportSpecifierStructure[]): ExportSpecifier[];
/**
* Gets the named exports.
*/
getNamedExports(): ExportSpecifier[];
/**
* Removes this export declaration.
*/
remove(): void;
}