/** * Files in memory, with directory symlinks: enough of a disk for * TypeScript's module resolution to see `node_modules` as pnpm leaves it. * * Files are written at their real paths. A link maps a path to the directory * it points at, and every read goes through `realpath` first, so * `/project/node_modules/react/index.d.ts` reads the file written at * `/project/node_modules/.pnpm/react@19.3.0/node_modules/react/index.d.ts`. * * The directory index is what makes resolution work, and it needs two things * a list of files does not give: every directory a file is in (TypeScript * asks `directoryExists` before it looks inside), and every linked directory * -- a link's own name is listed in its parent, and the directory it points * at exists even before anything has been written into it. Without the * first, packages are reported missing; without the second, so are packages * whose files have not been fetched, and `node_modules/@types` cannot be * listed. * * Every lookup of a path is also reported to `onLookup`, with the real path * it resolved to, so that a caller can tell which packages TypeScript went * looking in. */ export declare class LinkedFileSystem { private readonly files; /** Real directory → the names of its entries, files and directories (links included). */ private readonly directories; private readonly links; /** The links never change, so neither does a path's real path. */ private readonly realpaths; onLookup: ((realPath: string) => void) | null; constructor(links: Map); private entriesOf; /** `dir` and every directory above it. */ private addDirectory; /** Lists `path` in its parent; the parent's real path, as `path` may sit under a link. */ private addEntry; /** Resolves every link along `path`, as `fs.realpathSync` does. */ realpath(path: string): string; private resolveLinks; writeFile(realPath: string, text: string): void; private lookup; readFile(path: string): string | undefined; fileExists(path: string): boolean; directoryExists(path: string): boolean; /** The directories in `path`, links to directories included. */ getDirectories(path: string): string[]; /** The files in `path`. */ getFiles(path: string): string[]; /** Every file written, by real path. */ allFiles(): IterableIterator; } export declare function parentOf(path: string): string; export declare function baseName(path: string): string;