@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
20 lines • 1.14 kB
TypeScript
import type { BoxAccessor } from '../../accessor/box.ts';
import { DirListing, FileStat, type PathSpec } from '../../types.ts';
import { type BoxItem } from './api.ts';
export declare function resourceTypeFor(item: BoxItem): string;
/**
* The stat of one Box item, as a listing, `GET /files/{id}` or an upload's
* reply returns it. `extra` carries what the functions handed the stat act
* on: the item id, and for a file the sha1 a read checks and the etag a
* conditional write sends. Mirrors Python's `stat_from_item`.
*/
export declare function statFromItem(item: BoxItem): FileStat;
/**
* A folder's children, each as `stat` answers it. The mount root lists its
* root folder; any other folder is listed by the id its parent's listing
* named. Web links are bookmarks with no content endpoint and no size, so
* they are left out. Past a walk's `limit` Box is paged no further, and the
* listing is partial. Mirrors Python's `readdir`.
*/
export declare function readdir(accessor: BoxAccessor, path: PathSpec, entry?: FileStat | null, limit?: number): Promise<FileStat[] | DirListing>;
//# sourceMappingURL=readdir.d.ts.map