nestjs-reverse-engineering
Version:
A powerful TypeScript/NestJS library for database reverse engineering, entity generation, and CRUD operations
113 lines • 2.78 kB
TypeScript
export interface FileGenerationOptions {
outputPath: string;
overwrite?: boolean;
createDirectories?: boolean;
indentation?: string;
lineEnding?: '\n' | '\r\n';
}
export declare class FileBuilder {
private readonly options;
private content;
private indentLevel;
private readonly indentSize;
private readonly lineEnding;
constructor(options?: FileGenerationOptions);
/**
* Add a line of content with proper indentation
*/
addLine(content?: string): this;
/**
* Add multiple lines of content
*/
addLines(lines: string[]): this;
/**
* Add raw content without indentation
*/
addRaw(content: string): this;
/**
* Add a comment block
*/
addComment(comment: string, style?: 'line' | 'block'): this;
/**
* Add an import statement
*/
addImport(imports: string | string[], from: string): this;
/**
* Add a default import
*/
addDefaultImport(name: string, from: string): this;
/**
* Add namespace import
*/
addNamespaceImport(name: string, from: string): this;
/**
* Start a block (class, function, interface, etc.)
*/
startBlock(declaration: string): this;
/**
* End a block
*/
endBlock(semicolon?: boolean): this;
/**
* Add a property declaration
*/
addProperty(name: string, type: string, options?: {
optional?: boolean;
readonly?: boolean;
static?: boolean;
private?: boolean;
protected?: boolean;
public?: boolean;
defaultValue?: string;
decorators?: string[];
comment?: string;
}): this;
/**
* Add a method declaration
*/
addMethod(name: string, parameters: Array<{
name: string;
type: string;
optional?: boolean;
defaultValue?: string;
}>, returnType: string, options?: {
async?: boolean;
static?: boolean;
private?: boolean;
protected?: boolean;
public?: boolean;
abstract?: boolean;
decorators?: string[];
comment?: string;
body?: string[];
}): this;
/**
* Increase indentation level
*/
increaseIndent(): this;
/**
* Decrease indentation level
*/
decreaseIndent(): this;
/**
* Add an empty line
*/
addEmptyLine(): this;
/**
* Get the current content as string
*/
getContent(): string;
/**
* Clear all content
*/
clear(): this;
/**
* Write content to file
*/
writeToFile(filePath?: string): Promise<void>;
/**
* Create a new FileBuilder with the same options
*/
clone(): FileBuilder;
}
//# sourceMappingURL=file-builder.d.ts.map