import { Readable } from "node:stream"; import { ChunkedUploadContext, Range, ReadOptions, Stat } from "@directus/types"; //#region src/index.d.ts declare class StorageManager { private drivers; private locations; registerDriver(name: string, driver: typeof Driver): void; registerLocation(name: string, config: DriverConfig): void; location(name: string): Driver; } declare class Driver { constructor(config: Record); read(filepath: string, options?: ReadOptions): Promise; write(filepath: string, content: Readable, type?: string): Promise; delete(filepath: string): Promise; stat(filepath: string): Promise; exists(filepath: string): Promise; move(src: string, dest: string): Promise; copy(src: string, dest: string): Promise; list(prefix?: string): AsyncIterable; } interface TusDriver extends Driver { get tusExtensions(): string[]; createChunkedUpload(filepath: string, context: ChunkedUploadContext): Promise; finishChunkedUpload(filepath: string, context: ChunkedUploadContext): Promise; deleteChunkedUpload(filepath: string, context: ChunkedUploadContext): Promise; writeChunk(filepath: string, content: Readable, offset: number, context: ChunkedUploadContext): Promise; } declare function supportsTus(driver: Driver): driver is TusDriver; type DriverConfig = { driver: string; options: Record; }; //#endregion export { type ChunkedUploadContext, Driver, DriverConfig, type Range, type ReadOptions, type Stat, StorageManager, TusDriver, supportsTus };