import type { VoyantGraphRouteBundle, VoyantGraphRouteMethod } from "@voyant-travel/core/project"; import { type ProjectConventionApiRoute, type ProjectConventionDiscovery, type ProjectConventionRouteSurface } from "./project-conventions.js"; /** Path relative to the project's disposable `.voyant` artifact root. */ export declare const PROJECT_API_GENERATED_PATH = "runtime/project-api.generated.ts"; export declare const PROJECT_API_CONVENTION_DIAGNOSTIC_CODES: { readonly PROJECT_API_DEFAULT_EXPORT: "Route files cannot have a default export."; readonly PROJECT_API_DUPLICATE_ROUTE_METHOD: "Two route files cannot handle the same method and canonical route."; readonly PROJECT_API_IMPORT_ESCAPE: "Route file imports cannot escape the project root."; readonly PROJECT_API_MISSING_METHOD: "Route files must export at least one supported HTTP method."; readonly PROJECT_API_UNSUPPORTED_EXPORT: "Route files cannot have runtime exports other than supported HTTP methods."; }; export type ProjectApiConventionDiagnosticCode = keyof typeof PROJECT_API_CONVENTION_DIAGNOSTIC_CODES; export interface ProjectApiConventionDiagnostic { code: ProjectApiConventionDiagnosticCode; severity: "error"; message: string; sourcePaths: readonly string[]; exportName?: string; method?: VoyantGraphRouteMethod; route?: string; surface?: ProjectConventionRouteSurface; } export interface ProjectApiConventionRoute extends ProjectConventionApiRoute { methods: readonly VoyantGraphRouteMethod[]; } export interface ProjectApiConventionAnalysis { routes: readonly ProjectApiConventionRoute[]; diagnostics: readonly ProjectApiConventionDiagnostic[]; } export interface ProjectApiGeneratedFile { path: typeof PROJECT_API_GENERATED_PATH; contents: string; } export interface ProjectApiConventionCompilation { routes: readonly ProjectApiConventionRoute[]; graphRoutes: readonly VoyantGraphRouteBundle[]; generatedFile: ProjectApiGeneratedFile; } export interface ProjectApiConventionsOptions { projectRoot: string; /** Reuse an authoritative discovery snapshot instead of scanning the project again. */ discovery?: ProjectConventionDiscovery; } export declare class ProjectApiConventionError extends Error { readonly diagnostics: readonly ProjectApiConventionDiagnostic[]; constructor(diagnostics: readonly ProjectApiConventionDiagnostic[]); } export declare function analyzeProjectApiConventions(options: ProjectApiConventionsOptions): Promise; export declare function compileProjectApiConventions(options: ProjectApiConventionsOptions): Promise; export declare function generateProjectApiAdapterSource(routes: readonly ProjectApiConventionRoute[]): string;