import type { Collection, Db, GridFSBucket, ObjectId } from 'mongodb'; import type { PathSpec } from '@struktoai/mirage-core/types'; import type { GridFSAccessor } from '../../accessor/gridfs.ts'; import type { GridFSConfig } from '../../resource/gridfs/config.ts'; export interface GridFSFileDoc { _id: ObjectId; filename: string; length: number; uploadDate: Date; } interface GridFSModule { GridFSBucket: new (db: Db, options?: { bucketName?: string; chunkSizeBytes?: number; }) => GridFSBucket; ObjectId: new (id?: string) => ObjectId; } export declare function loadGridFSModule(): Promise; export declare function gridfsKey(path: string, config: GridFSConfig): string; export declare function gridfsPrefix(path: string, config: GridFSConfig): string; export declare function stripKeyPrefix(key: string, config: GridFSConfig): string; export declare function rawPathOf(path: PathSpec): string; export declare function filesColl(accessor: GridFSAccessor): Promise; export declare function bucket(accessor: GridFSAccessor): Promise; export declare function escapeRegex(raw: string): string; export declare function prefixQuery(pfx: string): Record; export declare function latestFile(accessor: GridFSAccessor, key: string): Promise; export declare function fileById(accessor: GridFSAccessor, id: ObjectId): Promise; /** * Yield the newest revision of each filename matching a query, sorted by * filename. Mirrors Python's `iter_latest`. */ export declare function iterLatest(accessor: GridFSAccessor, query: Record): AsyncIterable; /** Delete every revision (file doc + chunks) matching a query. */ export declare function deleteAll(accessor: GridFSAccessor, query: Record): Promise; export {}; //# sourceMappingURL=client.d.ts.map