import { Readable } from "stream" ; export type UploadOptions = { gzip ? : boolean ; contentType ? : string ; metadata ? : { [ key ] : string ; } ; } ; export interface IStorage { /**
     * Initializes the storage. Some storage types don't need any initialization, others
     * may require async actions such as an initial authorization. Because you can't (and don't
     * want to) handle async action in the constructor all storage types have an init() method
     * that needs to be called before any other API method call
     */ init ( ) : Promise < boolean > ; /**
     * Returns the storage type, e.g. 'gcs', 'b2', 'local' etc.
     */ getType ( ) : string ; /**
     * Returns configuration settings that you've provided when instantiating as an object.
     * Use this only for debugging and with great care as it may expose sensitive information.
     *
     * The object contains the key `bucketName` which is the initial value that you've set during
     * initialization; if you have selected another bucket after initialization it will still show
     * the original value. Use `getSelectedBucket()` to retrieve the current value.
     *
     * The object also contains the key `options` which are only the options passed in during
     * initialization; if you want all options, including the default options use `getOptions()`
     */ getConfiguration ( ) : AdapterConfig ; /**
     * Returns an object that contains both the options passed with the configuration and the
     * default options of the storage type if not overruled by the options you passed in.
     */ /**
     * Runs a simple test to test the storage configuration: calls `listBuckets` only to check
     * if it fails and if so, it throws an error.
     */ test ( ) : Promise < string > ; param name createBucket ( name ) : Promise < string > ; param name selectBucket ( name ? ) : Promise < string > ; param name clearBucket ( name ? ) : Promise < string > ; param name deleteBucket ( name ? ) : Promise < string > ; /**
     * Retrieves a list of the names of the buckets in this storage
     */ listBuckets ( ) : Promise < string [ ] > ; /**
     * Returns the name of the currently selected bucket or an empty string ("") if no bucket has been selected yet
     */ getSelectedBucket ( ) : string ; param origPath param targetPath addFileFromPath ( origPath , targetPath ) : Promise < void > ; param buffer param targetPath addFileFromBuffer ( buffer , targetPath ) : Promise < void > ; param stream param targetPath addFileFromReadable ( stream , targetPath , options ? ) : Promise < void > ; param name param start param end getFileAsReadable ( name , options ? ) : Promise < Readable > ; param name removeFile ( name ) : Promise < string > ; /**
     * Returns an array of tuples containing the file path and the file size of all files in the currently
     * selected bucket. If no bucket is selected an error will be thrown.
     */ listFiles ( numFiles ? ) : Promise < [ string , number ] [ ] > ; param name sizeOf ( name ) : Promise < number > ; param name fileExists ( name ) : Promise < boolean > ; } export enum StorageType { LOCAL = "local" , GCS = "gcs" , S3 = "s3" , B2 = "b2" } export type JSON = { [ id ] : string | number | boolean | string [ ] | number [ ] | boolean [ ] | { [ id ] : JSON ; } ; } ; export interface IAdapterConfig { type : string ; slug ? : boolean ; bucketName ? : string ; } export type GenericKey = number | string | boolean | number [ ] | string [ ] | boolean [ ] ; export interface ConfigAmazonS3 extends IAdapterConfig { accessKeyId : string ; secretAccessKey : string ; region ? : string ; endpoint ? : string ; useDualstack ? : boolean ; maxRetries ? : number ; maxRedirects ? : number ; sslEnabled ? : boolean ; [ id ] : GenericKey ; } export interface ConfigBackblazeB2 extends IAdapterConfig { applicationKeyId : string ; applicationKey : string ; } export interface ConfigGoogleCloud extends IAdapterConfig { keyFilename ? : string ; projectId ? : string ; } export interface ConfigLocal extends IAdapterConfig { directory : string ; mode ? : number | string ; } export interface ConfigTemplate extends IAdapterConfig { someKey : string ; someOtherKey : string ; } export type AdapterConfig = ConfigLocal | ConfigAmazonS3 | ConfigGoogleCloud | ConfigBackblazeB2 | ConfigTemplate ; export type BackblazeB2Bucket = { accountId : "string" ; bucketId : "string" ; bucketInfo : "object" ; bucketName : "string" ; bucketType : "string" ; corsRules : string [ ] ; lifecycleRules : string [ ] ; options : string [ ] ; revision : number ; } ; export type BackblazeB2File = { accountId : string ; action : string ; bucketId : string ; contentLength : number ; contentMd5 : string ; contentSha1 : string ; contentType : string ; fileId : string ; fileInfo : [ object ] ; fileName : string ; uploadTimestamp : number ; } ;