/** Clears the cached src-layout roots. Exported for test isolation. */ export declare function clearPythonSrcLayoutCache(): void; /** * Detect (or retrieve from cache) whether `workspaceRoot` is a Python * src-layout project. * * Returns `'src'` (the detected root directory, relative to `workspaceRoot`) * when a `src/` directory exists there and contains at least one real * Python package; `undefined` otherwise — callers can treat that as "no * resolution" with zero behavior change, exactly like `resolveGoModulePrefix`. * * @param workspaceRoot - Absolute path to the project root. */ export declare function detectPythonSrcLayoutRoot(workspaceRoot: string): string | undefined; /** * Resolve a raw, absolute Python import specifier (e.g. `flask`, * `flask.globals`) to a repo-relative path (e.g. `src/flask`, * `src/flask/globals`), by prepending the project's detected src-layout * root — but only when that exact candidate path is confirmed to exist on * disk (see this module's doc comment for why: a repo can hold more than one * Python project, and an unrelated nested package must not be misresolved * against an outer, unrelated `src/` root just because both happen to be * named `src/`). * * No-op (returns `specifier` unchanged) when `srcLayoutRoot` is `undefined`, * `specifier` is already a resolved path rather than a raw absolute * specifier (contains `/`, or starts with `.`), or the candidate path * doesn't exist. A relative import (`from .foo import X`) is resolved * against the *importing file's own* directory in * `resolveImportSpecifier`'s earlier relative-import step (`ast/symbols.ts`), * which already lands under `src/` because that's where the importing file * itself lives — running this step on it too would double-prefix an * already-correct path. Only bare/dotted absolute specifiers (`import * flask`, `from flask.globals import g`) reach this step unresolved. * * @param specifier - The raw (or already relative-resolved) Python import specifier. * @param srcLayoutRoot - The project's detected src-layout root, or `undefined`. * @param workspaceRoot - Absolute path to the project root (for the existence check). */ export declare function resolvePythonSrcLayoutImport(specifier: string, srcLayoutRoot: string | undefined, workspaceRoot: string | undefined): string; //# sourceMappingURL=python-src-layout.d.ts.map