@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
19 lines (18 loc) • 846 B
TypeScript
import { CodeBlockWriter, SourceFile, WriterFunction } from 'ts-morph';
import { TypeImport } from './type-import';
export type WriteType = string | TypeImport | WriterFunction;
export interface WriteTypeOptions {
isArray?: boolean | null;
type: WriteType;
}
export declare function IsWriteTypeOptions(value: any): value is WriteTypeOptions;
/**
* Uses the CodeBlockWriter to write the type to the AST thereby the value of the property type is evaluated
* to determine the value that should be written to the AST
* @param type
* @param w
* @constructor
*/
export declare function WriteStringType(type: string, w: CodeBlockWriter): void;
export declare function WriteType(type: WriteType, sourceFile: SourceFile): WriterFunction;
export declare function WriteType(property: WriteTypeOptions, sourceFile: SourceFile): WriterFunction;