@chtsinc/ch-uploader
Version:
A pluggable, cloud-agnostic file uploader for Azure, S3, and more.
17 lines (16 loc) • 868 B
TypeScript
import { ConfigProperties } from "./config-properties";
/**
* Generic interface for uploading files to a storage provider.
* @template T Optional type parameter for future extensions (e.g., upload response data)
*/
export interface FileUploader {
/**
* Uploads a file to the configured storage.
* @param filePath - Local file system path to the file.
* @param config - Configuration properties (e.g., SAS URL, container name, retry settings).
* @param blobName - Optional name to assign to the uploaded blob; defaults to the file's base name.
* @param metadata - Optional metadata to set on the blob.
* @returns The URL of the uploaded blob, or null if the file was missing or invalid.
*/
upload(filePath: string, config: ConfigProperties, blobName?: string, metadata?: Record<string, string>): Promise<string | null>;
}