UNPKG

@rxap/ts-morph

Version:

Provides utilities for manipulating TypeScript code using the ts-morph library. It offers a fluent API to add, modify, and remove code elements such as classes, decorators, imports, and properties in both Angular and NestJS projects. This package simplifi

12 lines (11 loc) 795 B
import { ClassDeclaration, ObjectLiteralExpression, SourceFile } from 'ts-morph'; import { TypeImport } from '../type-import'; /** * Coerces the component import by adding it to the imports array of the component decorator object. * If a module specifier is provided, the import is also coerced at the file level. * * @param sourceFileOrClassDeclaration - The source file or class declaration that contains the component import. * @param componentImport - The name or TypeImport of the import to coerce. * @returns - The updated imports array after coercing the import. */ export declare function CoerceComponentImport(sourceFileOrClassDeclaration: SourceFile | ClassDeclaration | ObjectLiteralExpression, componentImport: string | TypeImport): import("ts-morph").ArrayLiteralExpression;