/** * Create / delete Visual Studio D365FO projects (.rnrproj) and keep the solution (.sln) in step. * Shapes follow projects VS itself wrote. Project dependencies live in the .sln * (`ProjectSection(ProjectDependencies)`), not the .rnrproj. Two solution layouts exist — * one shared `.sln`, or one `.sln` per project folder — and 'auto' detects which; * an undecidable repo is an error, never a guess. */ /** Project-type GUID VS assigns to a D365FO (.rnrproj) project. */ export declare const D365FO_PROJECT_TYPE_GUID = "{FC65038C-1B2F-41E1-A629-BED71D161FFF}"; export type SolutionMode = 'auto' | 'shared' | 'per-project' | 'none'; export interface ScaffoldProjectOptions { projectName: string; modelName: string; /** Folder that holds the project folders (`…/Projects/`). */ projectsRoot: string; solutionMode: SolutionMode; /** Shared mode only: the .sln to extend, when the folder holds more than one. */ solutionFile?: string; /** Text shown for the project in the solution. Default: the project name. */ displayName?: string; /** Names of projects in the SAME solution this one builds after. */ dependsOn?: string[]; /** An existing project of the model, to inherit the build-task version from. */ templateProject?: string; } export interface ScaffoldResult { projectPath: string; projectGuid: string; /** The solution the project was registered in; null when solutionMode is 'none'. */ solutionPath: string | null; /** The mode actually used ('auto' resolved). */ solutionMode: Exclude; /** Every file written, for the caller's report. */ written: string[]; /** Projects of the solution this one now depends on. */ dependsOn: string[]; } /** A refusal the caller can act on. Never thrown for a programming error. */ export declare class ScaffoldError extends Error { } /** A name becomes a folder, a file name and an XML text node — checked against all three. */ export declare function validateProjectName(name: string): string | null; /** The build-task targets file a sibling project imports, so the new one builds with the same VS. */ export declare function buildTasksTargetsOf(rnrprojXml: string): string | null; export declare function renderRnrproj(opts: { modelName: string; projectName: string; projectGuid: string; buildTasksTargets?: string | null; }): string; interface SlnProject { name: string; relPath: string; guid: string; typeGuid: string; } export declare function parseSolutionProjects(sln: string): SlnProject[]; /** Add a project to solution text. Pure — the caller reads and writes the file. */ export declare function addProjectToSolutionText(sln: string, opts: { displayName: string; relPath: string; guid: string; dependsOnGuids: string[]; }): string; export declare function renderNewSolution(opts: { displayName: string; relPath: string; guid: string; dependsOnGuids?: string[]; }): string; export interface SolutionLayout { mode: 'shared' | 'per-project' | 'unknown'; /** Shared: every .sln beside the project folders. */ sharedCandidates: string[]; } /** Decide which solution pattern `projectsRoot` follows — see the file header. */ export declare function detectSolutionLayout(projectsRoot: string): Promise; /** Where a model's project folders live: the most common `` of `//.rnrproj`. */ export declare function inferProjectsRoot(existingProjectPaths: string[]): string | null; /** A root is only accepted if it already holds a .sln/.rnrproj (beside or one folder down) — no files in arbitrary folders. */ export declare function looksLikeProjectsRoot(root: string): Promise; /** Create the folder and .rnrproj and register it in a solution. Validates before the first write; a later failure removes what this call created. */ export declare function scaffoldProject(opts: ScaffoldProjectOptions): Promise; /** Remove a project's block, configuration lines and dependency lines from solution text. Pure; null when not listed. */ export declare function removeProjectFromSolutionText(sln: string, relPath: string): { text: string; guid: string; } | null; export interface RemoveProjectResult { /** Solutions the project was taken out of. */ solutions: string[]; /** Files/folders removed from disk (only with removeFiles). */ removed: string[]; /** AOT elements the project listed that no other project of the model lists. */ orphanedElements: string[]; } /** `AxClass\Foo` includes of a project file — its element membership. */ export declare function elementIncludesOf(rnrprojXml: string): string[]; /** Solutions listing this project (shared: beside the folders; per-project: inside it). Being listed is what vouches for a path. */ export declare function solutionsListingProject(projectPath: string): Promise>; /** Other projects of the solution(s) listing this one, as absolute paths that exist. */ export declare function solutionMateProjects(projectPath: string): Promise; /** * Take a project out of its solution(s); with removeFiles also delete its own files. * Model metadata is never touched. Validated before the first write. */ export declare function removeProject(opts: { projectPath: string; removeFiles: boolean; /** Other projects of the model, to work out which elements the removal orphans. */ otherProjectPaths?: string[]; }): Promise; export {}; //# sourceMappingURL=projectScaffold.d.ts.map