export = S3; declare class S3 { /** * * @param {String} key The object * @param {Object} [options] Override options * @param {Number} [options.ttl=300] TTL in seconds from now when the signed URL should expire * @param {String} [options.bucket=ASSET_BUCKET] The name of the bucket the object exists in. Defaults to the ASSET_BUCKET environment variable. * @returns {Promise} Promise that will resolve to the signed get URL * @description Create a signed S3 URL to get a private object in storage. */ static signedGet(key: string, options?: { ttl?: number; bucket?: string; }): Promise; /** * * @param {String} key The object * @param {Object} [options] Override options * @param {String} [options.bucket=process.env.ASSET_BUCKET] Name of the asset bucket. Defaults to ASSET_BUCKET environment variable * @param {Number} [options.ttl=300] Number in seconds before the signed URL expires. * @param {Boolean} [options.useAccelerateEndpoint=true] Whether or not to use S3 Accelerate endpoint on uploads. * @returns {Promise} Promise that will resolve to the signed put URL * @description Create a signed URL to put a object in storage. */ static signedPut(key: string, options?: { bucket?: string; ttl?: number; useAccelerateEndpoint?: boolean; }): Promise; /** * * @param {String} key The object * @param {Object} [options] Override options * @param {String} [options.bucket=process.env.ASSET_BUCKET] Name of the asset bucket Defaults to ASSET_BUCKET environment variable * @param {Object} [options.conditions] The conditions used to validate the request * @param {Object} [options.fields] Fields returned that can be used within a form * @param {Number} [options.ttl=300] Number in seconds before the signed URL expires * @param {Boolean} [options.useAccelerateEndpoint=true] Whether or not to use S3 Accelerate endpoint on uploads * @returns {Promise} Promise that will resolve to the signed put URL * @description Create a signed URL to post a object in storage */ static signedPost(key: string, options?: { bucket?: string; conditions?: any; fields?: any; ttl?: number; useAccelerateEndpoint?: boolean; }): Promise; /** * @param {Object} [options] Object containing configuration options. * @param {String} [options.bucket=process.env.ASSET_BUCKET] The name of the storage bucket to list objects from * @param {Number} [options.maxKeys=100] The max number of keys to return from the list * @returns {Object} Object containing an array of contents of the bucket * @description List of the objects of a given storage bucket */ static list(options?: { bucket?: string; maxKeys?: number; }): any; /** * * @param {Buffer} body A String of buffer to write to storage * @param {String} key The object key to use when write to storage * @param {Object} [options] Optional configuration object. Supports the options of the s3.putObject method * @param {String} [options.bucket] The name of the asset bucket to write to. Uses the ASSET_BUCKET environment variable if not specified * @description Write content to storage */ static put(body: Buffer, key: string, options?: { bucket?: string; }): Promise; /** * * @param {Readable Stream} stream * @param {string} encoding String format to encode bytes. (ex, utf8, ascii, base64). Use 'raw' to get raw byte buffer. * @returns {String} A s tring from a readable string * @description Converts a readable stream to a string */ static streamToString(stream: any, encoding: string): string; /** * @param {String} key The object key to use when write to storage * @param {Object} [options] Optional configuration object. Supports the options of the s3.getObject method * @param {String} [options.bucket] The name of the asset bucket to write to. Uses the ASSET_BUCKET environment variable if not specified * @param {string} [options.contentEncoding] How to encode the returned object. Defaults to utf-8 (text). 'raw' will return the raw byte buffer. * @param {Boolean} [options.stream] Whether or not to return the raw stream from S3. Defaults to false. If true, the contentEncoding option is ignored. * @returns {Object} Object containing the object data and metadata * @description Retrieve an object from storage */ static get(key: string, options?: { bucket?: string; contentEncoding?: string; stream?: boolean; }): any; /** * * @param {String} key The object key to check the existence of. * @param {Object} [options] Optional configuration object. * @param {String} [options.bucket] The name of the asset bucket to check in. Uses the ASSET_BUCKET environment variable if not specified * @returns {Boolean} Returns true or false if the file exists. * @description Check if a file exists in storage. */ static exists(key: string, options?: { bucket?: string; }): boolean; /** * * @param {String} folder Folder to delete in storage. * @param {String} key The object key to check the existence of. * @param {Object} [options] Optional configuration object. * @param {String} [options.bucket] The name of the asset bucket to check in. Uses the ASSET_BUCKET environment variable if not specified * @description Delete a folder from storage * @returns {Boolean} True * @async * https://stackoverflow.com/a/48955582 */ static deleteFolder(folder: string, options?: { bucket?: string; }): boolean; /** * * @param {String|String[]} key Key or list of keys to delete from storage. * @param {Object} [options] Optional configuration object. Supports the options of the s3.deleteObjects method * @param {String} [options.bucket] The name of the asset bucket to check in. * @description Remove object(s) from storage. * @async * @returns {Boolean} True */ static deleteObject(key: string | string[], options?: { bucket?: string; }): boolean; /** * * @param {String} key Single key or array of keys representing a object or folder to delete * @param {Object} [options] Optional configuration object. * @param {String} [options.bucket] The name of the asset bucket to check in. Uses the ASSET_BUCKET environment variable if not specified * @returns {Boolean} True * @description Delete a folder or object from storage. */ static del(key: string, options?: { bucket?: string; }): boolean; /** * * @param {string} key - The key for which to retrieve the tag set. * @param {Object} [options] - Optional parameters. * @param {string} [options.bucket] - The bucket name. * @returns {Promise<{ TagSet: { Key: string, Value: string }[] }>} A promise that resolves to an object containing the tag set. * @description Retrieves the tag set for a given key. */ static getTagSet(key: string, options?: { bucket?: string; }): Promise<{ TagSet: { Key: string; Value: string; }[]; }>; /** * * @param {string} key - The key for which to add or update the tag set. * @param {Object} [options] - Optional parameters. * @param {{ Key: string, Value: string }[]} [options.tagSet] - The tag set to be added or updated. * @param {string} [options.bucket] - The bucket name. * @returns {Promise} A promise that resolves to the result of the put tagging command. * @description Adds or updates the tag set for a given key. */ static putTagSet(key: string, options?: { tagSet?: { Key: string; Value: string; }[]; bucket?: string; }): Promise; } //# sourceMappingURL=s3.d.ts.map