@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
25 lines • 1.61 kB
TypeScript
import { type PathSpec } from '../../types.ts';
import type { TreeEntry } from './driver.ts';
import type { Accessor } from '../../accessor/base.ts';
import type { ObjectStoreDriver, ReaddirFn, TreeFn } from './driver.ts';
/** Build a prefix listing over one driver. Mirrors Python's `make_readdir`. */
export declare function makeReaddir<A extends Accessor, C>(driver: ObjectStoreDriver<A, C>): ReaddirFn<A>;
/**
* Every key at and under a path, in one recursive listing: the key at the path
* itself and every key under it, as `listSubtree` gives them, markers
* included; null once the listing passes `limit` keys, before it pages
* further. Mirrors Python's `read_tree`.
*/
export declare function readTree<A extends Accessor, C>(driver: ObjectStoreDriver<A, C>, accessor: A, path: PathSpec, limit?: number): Promise<TreeEntry[] | null>;
/**
* Build `readTree` over one driver: one recursive listing, and the directory
* itself under `''`. A file stats as a listing gives it (its size, time and
* content type); a directory, a marker or a key prefix alike, carries nothing but its name. A
* marker for `path` itself names no entry. Null, so the walk's readdir and
* stat answer instead, when nothing is under the prefix, when a row has no
* size, when a key has an empty segment, and when one name is both a file and
* a prefix, which a readdir lists as a directory; and null for a subtree of
* more than `limit` keys. Mirrors Python's `make_tree`.
*/
export declare function makeTree<A extends Accessor, C>(driver: ObjectStoreDriver<A, C>): TreeFn<A>;
//# sourceMappingURL=readdir.d.ts.map