UNPKG

@nuvix/storage

Version:

S3-compatible storage library for Nuvix BaaS platform with support for AWS S3, Wasabi, MinIO, and local storage

57 lines 1.32 kB
import { Device } from "./device"; export declare class Storage { /** * Supported devices */ static readonly DEVICE_LOCAL = "local"; static readonly DEVICE_S3 = "s3"; static readonly DEVICE_WASABI = "wasabi"; static readonly DEVICE_MINIO = "minio"; /** * Devices. * * List of all available storage devices */ private static devices; /** * Set Device. * * Add device by name * * @param name * @param device * @throws Error */ static setDevice(name: string, device: Device): void; /** * Get Device. * * Get device by name * * @param name * @returns Device * @throws Error */ static getDevice(name: string): Device; /** * Exists. * * Checks if given storage name is registered or not * * @param name * @returns boolean */ static exists(name: string): boolean; /** * Human readable data size format from bytes input. * * Based on: https://stackoverflow.com/a/38659168/2299554 * * @param bytes * @param decimals * @param system * @returns string */ static human(bytes: number, decimals?: number, system?: "binary" | "metric"): string; } //# sourceMappingURL=storage.d.ts.map