import type { IndexCacheStore } from '../cache/index/store.ts'; import { PathSpec, type FileStat, type ReaddirFn, type StatFn, type WalkEntry } from '../types.ts'; export type WalkReaddirFn = ReaddirFn<[path: PathSpec, index: IndexCacheStore]>; export type WalkStatFn = StatFn<[path: PathSpec, index: IndexCacheStore]>; /** * Directory rows a prefix store implies but does not store. * * An object store has no directories: `ls` shows them because readdir * synthesizes them from the common prefixes of the keys, and a walk feeding * change detection has to synthesize the same ones, or a consumer would see a * file appear inside a directory that never appeared. * * `dirs` carries prefixes the store does name explicitly (a zero-byte marker * key, which mirage's own `mkdir` writes), so an empty directory is still * reported. A prefix backed by both a marker and children is reported once. * * `root` itself is never emitted; find's start-point rule applies here too, * the generic owns that row. */ export declare function synthDirs(root: string, files: Iterable, dirs: Iterable): Generator; /** One walk row built from a backend's own stat. */ export declare function entryOf(virtual: string, stat: FileStat): WalkEntry; /** * Recursive readdir descent for a backend with no recursive listing. * * Box, Google Drive and Microsoft Graph key their trees by opaque id, so a * child cannot be addressed without having listed its parent, and none of them * offers a whole-subtree listing. This walks them the way `find` does, one * readdir per directory. * * Each pull builds its own index and throws it away afterwards. That is what * keeps the DeltaHook contract: the index is not mirage's read cache, so the * walk cannot compare the cache to itself, and it starts empty every time, so * nothing carries over between pulls. It still has to exist, because these * backends resolve a path's id through the index their parent's readdir * populated; handing them a null index makes every path below the root read as * absent. */ export declare class ReaddirWalk { private readonly readdir; private readonly stat; constructor(readdir: WalkReaddirFn, stat: WalkStatFn); walk(root: PathSpec): AsyncGenerator; } //# sourceMappingURL=walk.d.ts.map