/** * Options for {@link normalizeWorkspacePath} and {@link toNormalizedWorkspacePath}. */ export type NormalizeWorkspacePathOptions = { /** Names the generator in the error when the path is rejected. */ generatorId?: string; }; /** * Whether a path contains a `..` parent-reference segment. `..` is a parent * reference only as a whole segment — a directory name that merely contains * dots is not flagged. */ export declare const hasParentSegment: (path: string) => boolean; /** * Whether a path is absolute on either host: a POSIX root, a Windows drive * (`C:\`, `C:/`) or a UNC share. Checked on every host, so a client.json * written on Windows is rejected the same way on Linux. */ export declare const isAbsolutePath: (path: string) => boolean; /** * Whether `path` is spelled from the workspace root — `@/`, `./`, a bare * leading `/`, or their Windows forms. An artifact path, never a bare * module specifier such as `zod` or `@tanstack/query`. */ export declare const hasWorkspaceAnchor: (path: string) => boolean; /** * Whether `path` can name a file below `basePath`: not a Windows drive or * UNC path, no `..` segment, and not `basePath` itself. The non-throwing * form of {@link normalizeWorkspacePath}'s checks, for schema validation * and for comparing a module specifier against a file path. */ export declare const isValidWorkspacePath: (path: string) => boolean; /** * The path relative to `basePath`, normalized and with no anchor: * what {@link normalizeWorkspacePath} writes after `@/`, and what * {@link toResolvedArtifactPath} joins onto `basePath`. * * Throws when the path cannot name a file below `basePath`: a Windows * drive or UNC path, a `..` segment (checked as a whole segment before * normalization, so it is never resolved), or a path naming `basePath` * itself (`@/`, `@`, `./`, `.`, `/`, ``). */ export declare const toNormalizedWorkspacePath: (path: string, { generatorId }?: NormalizeWorkspacePathOptions) => string; /** * The one spelling of a workspace path — an export path or a destination * path: `@/` followed by a POSIX path relative to `basePath`. * * A workspace path is a logical path inside the workspace, never a * filesystem path, so it reads the same on every host. A generator may * return one as `@/types/User.ts`, `./types/User.ts`, `/types/User.ts`, * `types/User.ts`, or with Windows separators; the engine stores this form * and nothing else, so file-map keys, import modules and the ejected lookup * always agree. The result is a fixed point. * * Throws in the cases {@link toNormalizedWorkspacePath} throws. * * @example * ```typescript * normalizeWorkspacePath('@\\types\\User.ts') // '@/types/User.ts' * normalizeWorkspacePath('./types/User.ts') // '@/types/User.ts' * normalizeWorkspacePath('../User.ts') // throws * ``` */ export declare const normalizeWorkspacePath: (path: string, options?: NormalizeWorkspacePathOptions) => string;