UNPKG

flydrive

Version:

File storage library with unified API to manage files across multiple cloud storage providers like S3, GCS, R2 and so on

27 lines (26 loc) 991 B
import { Disk } from './disk.js'; import { FakeDisk } from './fake_disk.js'; import { DriveManagerOptions, DriverContract } from './types.js'; /** * Drive manager exposes the API to manage Disk instances for multiple * services. Also, it offers a fakes API for testing. */ export declare class DriveManager<Services extends Record<string, () => DriverContract>> { #private; constructor(config: DriveManagerOptions<Services>); /** * Returns an instance of a Disk for the given service. By default * use the "default" service from config */ use<K extends keyof Services>(service?: K): Disk; /** * Deploy fake for a given service. The "use" method for the same service * will now return an instance of the "FakeDisk" class and not the * real implementation. */ fake<K extends keyof Services>(service?: K): FakeDisk; /** * Restore fake for a given service */ restore<K extends keyof Services>(service?: K): void; }