import type { Result } from "./types.js"; export declare function resolveWithin(root: string, ...segs: string[]): Result; /** * Recursively copy `src` → `dest` (copy mode). The CALLER is responsible for having * containment-checked `dest` via resolveWithin first (REQ-SEC-02). * * @returns ok(undefined) on success; err(WRITE_DENIED) on EACCES/EPERM, naming `dest`. */ export declare function copyDir(src: string, dest: string): Promise>; /** * Link the whole namespace dir `linkPath` → `target` (REQ-FLAG-03). On Windows, OR if the symlink * syscall fails for any reason, FALL BACK to copyDir and report it via the `mode` so apply records * the truthful mode. * * @returns ok({ mode }) where mode is "symlink" (link created) or "copy" (fallback fired); * err(WRITE_DENIED) if even the copy fallback fails. */ export declare function symlinkDir(target: string, linkPath: string): Promise>; /** * Remove `p` safely (REQ-SEC-03/REQ-SAFE-02). NEVER follows a symlink to delete its target — uses * `lstat` (which does not dereference) to distinguish a symbolic link (unlink the link only), a real * directory (recursive rm), and a real file (unlink). ENOENT → ok (idempotent removal). * * The CALLER must have containment-checked `p` via resolveWithin first (REQ-SEC-02). * * @returns ok(undefined) on success or already-absent; err(WRITE_DENIED) on EACCES/EPERM. */ export declare function removePath(p: string): Promise>; /** * Prune now-empty directories from `startDir` UPWARD, stopping before `stopRoot` (exclusive). Used by * `apply`'s copy-mode uninstall (§5.3) after the recorded files are removed. NEVER removes a * non-empty dir nor `stopRoot` itself (REQ-SAFE-01). A non-existent `cur` is treated as * already-removed and the ascent continues. * * @param startDir - the deepest dir to consider pruning (e.g. the namespace dir). * @param stopRoot - the boundary; pruning never removes `stopRoot` itself nor anything outside it. * @returns ok(undefined) when the upward prune completes (or halts on a non-empty dir); * err(PATH_ESCAPE) if `startDir` is not within `stopRoot`; err(WRITE_DENIED) on EACCES/EPERM. */ export declare function removeEmptyDirsWithin(startDir: string, stopRoot: string): Promise>; /** Platform check (REQ-FLAG-03, C-6). Centralized so resolveMode/symlinkDir share one decision. */ export declare function isWindows(): boolean;