export interface ProjectFileContent { Name?: string; ProjectType?: string; designOptions?: { outputType?: string; }; functions?: Record; } export interface SolutionProject { Type: string; ProjectRelativePath: string; Id: string; } export interface SolutionFileContent { Projects?: SolutionProject[]; } export interface ProjectFileInfo { filePath: string; fileName: string; useProjectJson: boolean; } export interface ParsedProjectFile { content: ProjectFileContent; projectType: string; } export interface ParsedSolutionFile { solution: SolutionFileContent; rawContent: string; } /** * Finds the project manifest inside a directory, in priority order: * project.uiproj, project.json, then uipath.json (code-first JS/TS Functions). */ export declare function findProjectFile(projectDir: string): Promise<[Error, null] | [null, ProjectFileInfo]>; /** * Which way the manifest was unusable. `invalid-json` is a syntax error in the * file; `no-project-type` is a file that parsed but declares no type. Callers * that add guidance need the difference — advice about the wrong manifest * makes no sense for a file that is merely mistyped. */ export type ProjectManifestErrorReason = "invalid-json" | "no-project-type"; /** * The manifest was read but is not usable: bad JSON, or no `ProjectType` to * act on. Distinct from the raw `fs.readFile` failure `readProjectFile` also * returns (EACCES on a file that exists, say) — that one is a local * filesystem problem, not bad input, and callers must not classify the two * the same way. `__projectManifestError` lets callers duck-type across bundle * boundaries where `instanceof` fails. */ export declare class ProjectManifestError extends Error { readonly __projectManifestError = true; readonly reason: ProjectManifestErrorReason; constructor(message: string, reason: ProjectManifestErrorReason); } /** True when `error` is a {@link ProjectManifestError}, duck-typed. */ export declare function isProjectManifestError(error: unknown): boolean; /** * True when the manifest parsed but names no `ProjectType`. Callers gate * "this may be the wrong manifest" guidance on this rather than on the file * name alone: a `uipath.json` with a JSON typo is a different problem and * must keep the parse error as its only advice. */ export declare function isMissingProjectTypeError(error: unknown): boolean; /** * Reads and parses a project manifest, extracting the project type. */ export declare function readProjectFile(filePath: string, useProjectJson: boolean): Promise<[Error, null] | [null, ParsedProjectFile]>; /** * Reads and parses a solution .uipx file. * Returns both the parsed object and the raw content (for rollback). */ export declare function readSolutionFile(filePath: string): Promise<[Error, null] | [null, ParsedSolutionFile]>; /** * Resolves the solution file path — either from an explicit option or by searching upward. */ export declare function resolveSolutionFilePath(solutionFileOption: string | undefined, searchStartDir: string): Promise<[Error, null] | [null, string]>; /** * Writes the solution object back to disk as formatted JSON. */ export declare function writeSolutionFile(filePath: string, solution: SolutionFileContent): Promise; /** * Restores the exact solution file content captured before a write. */ export declare function restoreSolutionFile(filePath: string, rawContent: string): Promise; /** * Creates a project in the solution builder (resource builder services). * Handles service init, builder creation, createProjectAsync, and dispose. * * `subType` is forwarded to the SDK's project template picker. For AppV2 * projects: pass `"Coded"` for a regular coded app or `"CodedAction"` for a * coded action app; leave undefined for other project types. * * Spec-level patches to the emitted artefact resources (App→Package wire, * `isOverridable: true` round-trip default) live in the registered * `ArtefactPairBindingProvider` and fire at write time — this function * stays as thin as before that concern existed. */ export declare function createProjectInSolutionBuilder(solutionDir: string, projectId: string, projectName: string, projectType: string, subType?: string): Promise;