UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

31 lines • 2 kB
import type { GDriveAccessor } from '../../accessor/gdrive.ts'; import { type FileStat, type PathSpec } from '../../types.ts'; import type { DriveFile } from '../google/drive.ts'; export declare const PARENTS_PER_QUERY = 40; export declare function iterTree(accessor: GDriveAccessor, path: PathSpec, folderId: string, driveId: string | null): AsyncIterable<[string, DriveFile, boolean]>; /** * The children of each folder of one level of a walk, by folder id. * * One query asks for the children of up to `PARENTS_PER_QUERY` folders of one * corpus, where a walk lists each folder on its own, and each child is filed * under every folder asked about that its `parents` name. A folder asked about * alone takes every child, so `root`, the alias Drive names My Drive by, lists * too. Once `limit` items are in hand no page or query more is asked, so the * level is then short. Mirrors Python's `list_level`. */ export declare function listLevel(accessor: GDriveAccessor, folders: readonly (readonly [string, string | null])[], limit?: number): Promise<Map<string, DriveFile[]>>; /** * Every item under a folder, each as its folder's listing renders it, read a * level at a time (`listLevel`): a query per level and corpus where a walk * sends a listing per folder. * * The folder's own children are its listing, so the mount root keeps its * Shared Drives and a folder that is not there raises what a listing raises. * Of two items with one name in a folder, the one its listing keeps, the last, * stands. Null when that listing is short (Shared Drives it could not list), * or when a level below it fails, so the walk lists what is there and reports, * or skips, each folder on its own; null too once it holds more than `limit` * items, which no level is paged past. Mirrors Python's `tree`. */ export declare function tree(accessor: GDriveAccessor, path: PathSpec, entry?: FileStat | null, limit?: number): Promise<Map<string, FileStat> | null>; //# sourceMappingURL=tree.d.ts.map