import type { Accessor } from '../../accessor/base.ts'; import type { IndexEntry } from '../../cache/index/config.ts'; import type { IndexCacheStore } from '../../cache/index/store.ts'; import { ContentType, FileStat, FileType, type PathSpec } from '../../types.ts'; import { type ReaddirFn } from './probe.ts'; import type { Guard } from './readdir.ts'; import { type DetectFn, type ScopeMatch } from './scope.ts'; export type ExtraFn = (match: ScopeMatch) => Record; export type StatHook = (accessor: A, match: ScopeMatch, path: PathSpec, index?: IndexCacheStore) => Promise; export type EntryStatFn = (match: ScopeMatch, path: PathSpec, entry: IndexEntry) => FileStat; /** * `kind` is the node's kind: a FileType for a non-regular node (a * directory), or a ContentType for a regular file, whose node kind is * then FILE. Mirrors `entry_stat` in `mirage/core/hierarchy/stat.py`. */ export declare function entryStat(idField: string, kind: FileType | ContentType): EntryStatFn; /** * Build a hierarchy stat: existence probes and shapes per scope. * * Directories answer as themselves once proven to exist; leaves prove * existence through their parent's listing and pick up any size that listing * recorded. A guard replaces the parent-listing probe for kinds whose * existence the API answers directly; an override replaces the whole shape * for kinds with bespoke stats. `extras` derives per-kind `FileStat.extra` * payloads from the slots. `entryStats` are per-kind shapes built from the * path's own index entry, for id-addressed backends whose listing already * carries the stat (Drive-item trees); the kit resolves the entry through the * parent readdir and an absent entry is ENOENT. */ export declare function makeStat(detect: DetectFn, readdir: ReaddirFn, options?: { guards?: Readonly>>; extras?: Readonly>; overrides?: Readonly>>; entryStats?: Readonly>; }): (accessor: A, path: PathSpec, index?: IndexCacheStore) => Promise; //# sourceMappingURL=stat.d.ts.map