Module

x/ts_morph/mod.ts>ImportClause

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Go to Latest
class ImportClause
extends ImportClauseBase<ts.ImportClause>
import { ImportClause } from "https://dotland.deno.dev/x/ts_morph@17.0.0/mod.ts";

Methods

Gets the default import or returns undefined if it doesn't exist.

getDefaultImportOrThrow(message?: string | (() => string)): Identifier

Gets the default import or throws if it doesn't exit.

Gets the named bindings of the import clause or returns undefined if it doesn't exist.

getNamedBindingsOrThrow(message?: string | (() => string)): NamespaceImport | NamedImports

Gets the named bindings of the import clause or throws if it doesn't exist.

Gets the namespace import identifier, if it exists.

Gets the namespace import identifier, if it exists.

getNamespaceImportOrThrow(message?: string | (() => string)): Identifier

Gets the namespace import if it exists or throws.

getParent(): NodeParentType<ts.ImportClause>
getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportClause>>
isTypeOnly(): boolean

Gets if this import clause is type only.

setIsTypeOnly(value: boolean): this

Sets if this import declaration is type only.