@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
27 lines • 1.19 kB
TypeScript
import type { DropboxAccessor } from '../../accessor/dropbox.ts';
import { type FileStat, type PathSpec } from '../../types.ts';
/**
* Read a file, optionally only a byte range of it.
*
* Args:
* accessor: Dropbox accessor.
* path: the path to read.
* options: `{offset, size}`, the byte window, or absent for the whole file.
* entry: what is at the path.
*/
export declare function read(accessor: DropboxAccessor, path: PathSpec, options?: {
offset?: number;
size?: number;
}, entry?: FileStat | null): Promise<Uint8Array>;
/**
* Read an exactly spelled path without requiring a listing entry. Rewrites
* use the same spelling guard as uploads, so an absent alias cannot turn
* a truncate into an overwrite of another name. Mirrors Python's `read_by_path`.
*/
export declare function readByPath(accessor: DropboxAccessor, path: PathSpec, options?: {
offset?: number;
size?: number;
}): Promise<Uint8Array>;
/** Stream a file, stamped with its content_hash. Mirrors Python's `read_stream`. */
export declare function readStream(accessor: DropboxAccessor, path: PathSpec, entry?: FileStat | null): AsyncIterable<Uint8Array>;
//# sourceMappingURL=read.d.ts.map