import type { OpenMode } from '../../handles/mode.ts'; /** * The in-memory filesystem behind a monty guest's unmounted paths. * * The python binding hands monty an `OSAccess` subclass, and that base * class carries its own in-memory tree: a path no mount serves (a * guest temp file under `/tmp`, a scratch directory) is still a real * file to the guest. The JS binding is one bare callback with no tree * behind it — a declined call raises `PermissionError` — so this class * is that tree, host-side. Semantics and message spellings are pinned * to pydantic-monty's `os_access.py` (the exact strings a python-host * guest sees), with one deliberate improvement: renaming a file here * re-keys it fully, so the upstream rename-then-unlink KeyError the * python side works around (`MirageOSAccess._restamp`) cannot happen. * * One tree lives per `MirageOSAccess`, which is built per run: scratch * files last exactly one command, like python's. */ export declare class ScratchTree { private readonly root; private entryAt; private fileAt; private dirAt; private parentOf; exists(path: string): boolean; isFile(path: string): boolean; isDir(path: string): boolean; readText(path: string): string; readBytes(path: string): Uint8Array; write(path: string, data: string | Uint8Array): void; /** * Extend the file, keeping its storage type the way monty's tree * does: text appended to bytes decodes the base first, bytes onto * text encode it, so the stored shape tracks the most recent write. */ append(path: string, data: string | Uint8Array): void; /** * The open-time effect for `open(path, mode)`, monty's own rules: * 'r' verifies the file exists and is not a directory, 'w' truncates * or creates, 'a' creates what is missing, 'x' refuses what exists. */ open(path: string, mode: OpenMode): void; mkdir(path: string, parents: boolean, existOk: boolean): void; unlink(path: string): void; rmdir(path: string): void; /** The directory's entries as full paths, in insertion order. */ iterdir(path: string): string[]; rename(src: string, dst: string): void; } //# sourceMappingURL=tree.d.ts.map