UNPKG

@weverson_na/prisma-generator-nestjs-dto

Version:

Advanced Prisma Generator with Smart Merge v2: Creates DTO and Entity classes with AST-based preservation, intelligent import management, and modular architecture for NestJS

48 lines (47 loc) 2.78 kB
import { ImportStatementGenerator } from '../template-helpers/import-generator'; import { TemplateUtilities } from '../template-helpers/template-utilities'; import type { TypeProvider, EntityNameProvider } from '../template-helpers/interfaces'; import type { ParsedField } from '../types'; export interface TemplateHelpersOptions { connectDtoPrefix: string; createDtoPrefix: string; updateDtoPrefix: string; dtoSuffix: string; entityPrefix: string; entitySuffix: string; decoratorConfigPath?: string; transformClassNameCase?: (input: string) => string; transformFileNameCase?: (input: string) => string; } export declare class TemplateHelpers implements TypeProvider, EntityNameProvider { private readonly options; private readonly namingStrategy; private readonly typeConverter; private readonly propertyRenderer; protected readonly templateUtilities: TemplateUtilities; constructor(options: TemplateHelpersOptions); entityName(name: string, ignorePrefixAndSufix?: boolean): string; connectDtoName(name: string): string; createDtoName(name: string): string; updateDtoName(name: string): string; connectDtoFilename(name: string, withExt?: boolean): string; createDtoFilename(name: string, withExt?: boolean): string; updateDtoFilename(name: string, withExt?: boolean): string; entityFilename(name: string, withExt?: boolean): string; fieldType(field: ParsedField, toInputType?: boolean, entityPrefix?: string, entitySuffix?: string): string; fieldsToDtoProps(fields: ParsedField[], useInputTypes?: boolean, forceOptional?: boolean, addExposePropertyDecorator?: boolean): string; fieldsToEntityProps(fields: ParsedField[], entityPrefix?: string, entitySuffix?: string): string; static echo(input: string): string; static when(condition: unknown, thenTpl: string, elseTpl?: string): string; static unless(condition: unknown, thenTpl: string, elseTpl?: string): string; static each<T>(arr: T[], fn: (item: T) => string, joinWith?: string): string; static hasSomeApiPropertyDoc(fields: ParsedField[], decoratorConfigPath?: string): boolean; static hasApiPropertyDoc(field: ParsedField, decoratorConfigPath?: string): boolean; static importStatement: typeof ImportStatementGenerator.importStatement; static importStatements: typeof ImportStatementGenerator.importStatements; static scalarToTS(scalar: string, useInputTypes?: boolean): string; apiExtraModels(names: string[], ignorePrefixAndSufix?: boolean): string; get transformClassNameCase(): (input: string) => string; get transformFileNameCase(): (input: string) => string; get config(): Omit<TemplateHelpersOptions, 'transformClassNameCase' | 'transformFileNameCase'>; }