import type { GitHubAccessor } from '../../accessor/github.ts'; import type { IndexCacheStore } from '../../cache/index/store.ts'; import type { GitHubTreeItem } from './client.ts'; import { type TreeEntry } from './tree_entry.ts'; export declare function buildTreeMap(tree: GitHubTreeItem[]): Record; export declare function populateIndex(index: IndexCacheStore, tree: Record, prefix: string): Promise; /** * Refetch the recursive tree and re-seed the index from it. * * The mount fetches the whole tree once and seeds the index with it, so * the index is the listing rather than a cache in front of one. That makes * a cleared or expired index indistinguishable from an empty repository -- * `ls` reported the mount root missing after an invalidation, and reported * nothing at all once the day-long TTL lapsed. This is the refill that * makes dropping the index mean "refetch", which is what invalidating it * was always supposed to mean. * * Args: * accessor (GitHubAccessor): the mount's accessor, holding the transport * and the ref to refetch. * index (IndexCacheStore | undefined): the index to re-seed. * * Returns: * boolean: whether a refill happened; false when there is no index to * seed, so a caller does not retry a lookup that cannot change. */ export declare function refillIndex(accessor: GitHubAccessor, index: IndexCacheStore | undefined, prefix: string): Promise; /** * Refetch when the index holds no listing at all. * * Every reader here treats a missing listing as a real absence, which is * right against a *live* index and wrong against one that was never filled * or has been dropped, and invalidation drops rather than expires: * `invalidateDir` removes the directory's row outright, so the EXPIRED * probe each reader already runs never fires. An external change (a watch * event is the only thing that invalidates a mount with no write ops) * therefore left the whole mount answering ENOENT permanently, since the * seeded expiry is a year out. * * The root listing is what tells live from not, in one lookup and no * request: the tree is written whole, so while the index is live every * directory has a row and the mount root always does. One refill makes it * live again, so this cannot cost a fetch per miss, which is what kept the * readers from probing on absence in the first place. * * Not live always **refetches**, and never re-seeds the tree the mount was * built with. That tree is only true at build time: the first read of a * mount can come long after it, and reusing it then served an index built * from a repository five external writes ago. It is still what * `accessor.tree` starts as, so find and du have something to read before * any listing happens, and every refill reseats it. * * Mirrors Python's `ensure_live_index`. * * Args: * accessor (GitHubAccessor): the mount's accessor. * index (IndexCacheStore | undefined): the index to check and fill. * prefix (string): the mount prefix the index keys are built against. * * Returns: * boolean: whether the index was filled. */ export declare function ensureLiveIndex(accessor: GitHubAccessor, index: IndexCacheStore | undefined, prefix: string): Promise; //# sourceMappingURL=tree.d.ts.map