import type { GeneratedFile } from 'openapi-zod-ts'; import type { ServerConfig } from '../config.js'; /** * Emit `_shared/errors.ts`: the single shared module containing the HttpError class. * All generated routers (Fastify, Hono, Express) import HttpError from this shared file * instead of inlining the class. Emitting once per generation run guarantees that * `err instanceof HttpError` works across multiple routers mounted in the same server. */ export declare function emitSharedErrorsFile(): GeneratedFile; /** * Derive the absolute path to the shared `_shared/` directory given all project configs. * * Rules: * - If any config has `shared_output` set, that value (resolved against cwd) wins. * The first non-empty `shared_output` across all configs is used. * - Single project: commonParent = resolvedOutput (the output dir itself), * so shared = `/_shared`. * - Multiple projects: commonParent = longest common directory prefix of all resolved * output paths, so shared = `/_shared`. */ export declare function deriveSharedDir(cwd: string, configs: ServerConfig[]): string; /** * Compute the relative import path from a project's output directory to * the `_shared/errors.js` module in the shared directory. * * Result always ends in `/_shared/errors.js` relative to the outputDir. * It is normalized to use forward slashes and always starts with `./` or `../`. */ export declare function sharedErrorsImportPath(outputDir: string, sharedDir: string): string; /** * Find the longest common directory prefix of a list of absolute paths. * Each segment must match exactly; the first differing segment ends the prefix. * * Examples: * ['/gen/public', '/gen/admin'] → '/gen' * ['/a/b/c', '/a/b/d'] → '/a/b' * ['/a/x', '/b/y'] → '/' */ export declare function findCommonParent(paths: string[]): string; //# sourceMappingURL=errors-emitter.d.ts.map