import { GeneratorCallback, Tree } from '@nx/devkit'; import { AddToModulesOptions, GenerateTemplateOptions, ModelType } from './generator-types'; export declare function removeWorkspacesFromPackageJson(tree: Tree): void; export declare function addScriptToPackageJson(tree: Tree, scriptName: string, scriptCommand: string): void; export declare function deleteFiles(tree: Tree, filesToDelete: string[]): void; export declare function deleteDirectory(tree: Tree, dirPath: string): void; export declare function endsWithQuestionMark(str: string): boolean; export declare function removeQuestionMarkAtEnd(str: string): string; export declare function getPrismaSchemaPath(tree: Tree): any; export declare function readPrismaSchema(tree: Tree, prismaPath: string): string; export declare function mapPrismaTypeToNestJsType(prismaType: string): string; export declare function parsePrismaSchema(schemaContent: string, modelName: string): Promise<{ name: string; type: string; optional: boolean; }[]>; export declare function getNpmScope(tree: Tree): string; export declare function generateTemplateFiles({ tree, schema, libraryRoot, templatePath, npmScope, }: GenerateTemplateOptions & { schema: T; }): void; /** * Installs dependencies and devDependencies in the package.json file * and configures Nx project graph plugins when appropriate. * * @param tree - The Nx Tree object (virtual filesystem). * @param dependencies - An object containing the dependencies to be added. * @param devDependencies - An object containing the devDependencies to be added. */ export declare function installPlugins(tree: Tree, dependencies?: Record, devDependencies?: Record): Promise<() => any>; /** * Updates tsconfig.base.json to include a new library path * @param tree The file system tree * @param importPath The import path for the library (e.g., @org/my-lib) * @param libraryRoot The root path of the library (e.g., libs/my-lib) */ export declare function updateTsConfigPaths(tree: Tree, importPath: string, libraryRoot: string): void; /** * Shared `@skipCrud` model/relation filtering — the single source of truth used by * every Prisma-driven generator (crud, custom, sdk, models) so they can never * disagree about which models exist or which relation fields survive. */ export declare function isSkipCrudModel(model: { documentation?: string; }): boolean; export declare function filterSkippedRelationFields(fields: readonly T[], skippedModelNames: Set): T[]; export declare function getSkippedModelNames(models: ReadonlyArray<{ name: string; documentation?: string; }>): Set; export declare function getAllPrismaModels(tree: Tree): Promise; export declare function updatePnpmWorkspaceConfig(tree: Tree, options: { packages?: string[]; onlyBuiltDependencies?: string[]; }): void; export declare function pnpmInstallCallback(): GeneratorCallback; export declare function addToModules({ tree, modulePath, moduleArrayName, moduleToAdd, importPath }: AddToModulesOptions): void; export declare function apiLibraryGenerator(tree: Tree, schema: T, templateRootPath: string, type?: string, addModuleImport?: boolean): Promise<() => void>; /** * Pluralizes a word using the pluralize library, with special handling for words * where the singular and plural forms are the same (like "data", "sheep"). * In those cases, appends "List" to make it clear it's a collection. * Also includes overrides for known uncountable nouns that the pluralize library * incorrectly pluralizes. * * @param name - The word to pluralize * @returns The pluralized form, or the word + "List" if singular equals plural or is uncountable * * @example * ```typescript * getPluralName('user') // 'users' * getPluralName('category') // 'categories' * getPluralName('data') // 'dataList' (because 'data' plural is also 'data') * getPluralName('sheep') // 'sheepList' (because 'sheep' plural is also 'sheep') * getPluralName('luggage') // 'luggageList' (override: pluralize incorrectly returns 'luggages') * getPluralName('furniture') // 'furnitureList' (override: pluralize incorrectly returns 'furnitures') * ``` */ export declare function getPluralName(name: string): string; /** * Adds a line to .gitignore if it does not already exist. * @param tree The Nx Tree (virtual filesystem) * @param entry The line to add to .gitignore */ export declare function addToGitignore(tree: Tree, entry: string): void; /** * Generates TypeScript content for database model information. * This creates a file with interfaces, constants, and helper functions * for accessing Prisma model metadata in a type-safe way. */ export declare function generateDatabaseModelContent(models: ModelType[]): string;