teraskill-be / src /modules /storage /storage-service.interface.ts
Farhan Dwi Hartanto
Add application file
545f89a
Raw
History Blame Contribute Delete
634 Bytes
/**
* Interface for storage service providers (e.g., Cloudinary, AWS S3, Local).
*/
export abstract class IStorageService {
/**
* Uploads a file to the storage provider.
* @param file - The file object from Multer.
* @param folder - The destination folder/directory name.
* @returns A promise that resolves to the public URL or path of the uploaded file.
*/
abstract upload(file: Express.Multer.File, folder: string): Promise<string>;
/**
* Deletes a file from the storage provider.
* @param path - The public ID or path of the file to be deleted.
*/
abstract delete(path: string): Promise<void>;
}