import { ExportDeclaration } from "https://dotland.deno.dev/x/ts_morph@15.1.0/mod.ts";
Methods
addNamedExport(namedExport: OptionalKind<ExportSpecifierStructure> | string | WriterFunction): ExportSpecifier
Adds a named export.
addNamedExports(namedExports: ReadonlyArray<OptionalKind<ExportSpecifierStructure> | string | WriterFunction> | WriterFunction): ExportSpecifier[]
Adds named exports.
getAssertClause(): AssertClause | undefined
Gets the assert clause or returns undefined if it doesn't exist.
getModuleSpecifier(): StringLiteral | undefined
Gets the module specifier or undefined if it doesn't exist.
getModuleSpecifierSourceFile(): SourceFile | undefined
Gets the source file referenced in the module specifier.
Gets the source file referenced in the module specifier or throws if it can't find it or it doesn't exist.
getModuleSpecifierValue(): string | undefined
Gets the module specifier value or undefined if it doesn't exist.
getNamespaceExport(): NamespaceExport | undefined
Gets the namespace export or returns undefined if it doesn't exist. (ex. * as ns
, but not *
).
getParent(): NodeParentType<ts.ExportDeclaration>
getParentOrThrow(): NonNullable<NodeParentType<ts.ExportDeclaration>>
insertNamedExport(index: number, namedExport: OptionalKind<ExportSpecifierStructure> | string | WriterFunction): ExportSpecifier
Inserts a named export.
insertNamedExports(index: number, namedExports: ReadonlyArray<OptionalKind<ExportSpecifierStructure> | string | WriterFunction> | WriterFunction): ExportSpecifier[]
Inserts named exports into the export declaration.
setAssertElements(elements: ReadonlyArray<OptionalKind<AssertEntryStructure>> | undefined): this
Sets the elements in an assert clause.
toNamespaceExport(): this
Changes the export declaration to namespace export. Removes all the named exports.