Skip to content

getImportStatement

Emit the import statement for a documented export.

The subpath equals the type’s namespace (its source path relative to src), so src/string.ts of @mnaoumov/typescript-lib is @mnaoumov/typescript-lib/string.

Interfaces / type aliases / enums are imported with import type; classes / functions / variables with a value import.

Import:

import { getImportStatement } from '@mnaoumov/typescript-dev-toolkit/docs-site/api-doc-text-utils';

Signature:

function getImportStatement(info: TypeInfo): string

Parameters:

Parameter Type Description
info TypeInfo The documented type.

Returns: string — The import statement.