/** * Expand user-shorthand prefixes in a path string. Currently: * * - `~` alone → `$HOME` * - `~/foo` (or `~\foo` on Windows) → `$HOME/foo` * - `~user/...` throws (POSIX-only; the platform complexity isn't * worth the small payoff — also lets people write a literal * `~user-typed-name` dir at the project root by quoting `./~user...`). * - everything else returns unchanged. * * This is the single owner of path-shorthand policy for the stdlib. * Future rules (env-var expansion, NFC normalization, etc.) land * here, not at call sites. Anything in `lib/stdlib/` that resolves a * user-typed path string goes through `contained.ts` (`root`, * `resolveUnder`, `wholePath`) or `resolveDir`, which call this helper * first. Do not re-implement the policy locally. * * Layering: `expandPath` is a pure string transform with no async and * no base-directory awareness; the home directory is `homeDir`, which a * caller takes from `host.system.homeDir()`. Resolving against the cwd * and refusing symlinks live one layer up, in the file part of the host. * Keeping the layers split means `expandPath` is testable in isolation. * * Does NOT resolve to an absolute path. Callers pass the result to * `root`, `wholePath`, or `resolveDir`. * * `expandPath("")` returns `""` unchanged so empty-string sentinels * pass through (callers that disallow empty dir handle that * themselves with a clearer error). */ export declare function expandPath(p: string, homeDir: string): string;