import type { DirentEntry, DirentStatEntry, FsStat, SqlClient, WalkEntry } from "../../types.js"; import type { InternalEntryShape } from "../internals/entry-shapes.js"; import type { BlobRow, DirChildRow, EntryRow, SubtreeRow } from "../internals/rows.js"; import { FsVersionBase } from "./version.js"; export declare class FsVisibilityBase extends FsVersionBase { /** Coalesces concurrent `lookupEntry` calls; see `Coalescer`. */ private readonly lookups; /** True when excludes or mounts make `posixPath` invisible to reads. */ protected isHiddenFromReads(posixPath: string): boolean; /** * `resolveEntry` for a public single-path read, with concurrent calls * answered by one `resolveEntries` query (a lone call still runs the * single-path query). Callers must reach this before their first `await`. * Inside `transaction()` lookups run directly against the open transaction. */ protected lookupEntry(posixPath: string): Promise; protected resolveEntry(tx: SqlClient, posixPath: string): Promise; /** * Visibility lookup for many paths in a single round-trip. Mirrors * `resolveEntry` but unrolls over an array of requested paths, evaluates * each one's nearest-ancestor row independently, and returns a Map keyed * by the original input path. Lets hot write paths fold parent-existence * + existing-entry checks into one query. * * Single-path callers should keep using `resolveEntry`: the planner * picks a tighter plan for a literal `path = $n::ltree` predicate than * for `path = req.p` over `unnest`, and we don't want to regress reads * for the savings on writes. */ protected resolveEntries(tx: SqlClient, posixPaths: string[]): Promise>; protected resolveEntryFollowSymlink(tx: SqlClient, posixPath: string, maxDepth?: number): Promise; /** * The rest of `resolveEntryFollowSymlink` for a row already fetched at * `posixPath` (e.g. by a coalesced lookup): ENOENT when missing, else follow * symlinks up to `maxDepth`, against `tx` when given. */ protected followSymlinkFrom(posixPath: string, node: EntryRow | null, maxDepth: number, tx?: SqlClient): Promise; protected getBlob(tx: SqlClient, hash: Uint8Array): Promise; protected listVisibleChildren(tx: SqlClient, parentPosix: string): Promise; /** * `resolveEntryFollowSymlink(dir)` + the ENOTDIR check + the listing in one * round-trip: the directory's own nearest-ancestor row comes back first * (`self = 0`), the listing after, gated on that row being a directory. * `scope` picks the listing: `listVisibleChildren` (default; readdir*, so * every `ls`/`find`/`grep -r` level) or `listVisibleSubtree` without the * root ("subtree"; walk). A symlinked directory falls back to the * two-step path, which follows the link chain. */ protected listDirectory(tx: SqlClient, dirPosix: string, userPath: string): Promise; protected listDirectory(tx: SqlClient, dirPosix: string, userPath: string, scope: "subtree"): Promise; /** * Fetch every visible (non-tombstone) entry under `scopeLtree` for * `versionId`, keyed by internal POSIX path. Used by batch primitives * (merge/cherryPick/revert) to do classification entirely in TypeScript * once each side's tree is in memory. */ protected fetchVisibleEntryMap(tx: SqlClient, versionId: number, scopeLtree: string): Promise>; protected listVisibleSubtree(tx: SqlClient, rootPosix: string, includeRoot?: boolean): Promise; protected resolveLinkTargetPath(linkPath: string, target: string): string; protected mapDirChildToDirent(row: DirChildRow): DirentEntry; protected mapDirChildToStatEntry(row: DirChildRow): DirentStatEntry; protected mapSubtreeToWalk(row: SubtreeRow): WalkEntry; protected statFromEntry(row: EntryRow): FsStat; } //# sourceMappingURL=visibility.d.ts.map