export interface PutObjectInput {
  key: string;
  body: Buffer;
  contentType: string;
  fileName?: string;
}

export interface GetObjectInput {
  key: string;
}

export interface DeleteObjectInput {
  key: string;
}

export interface ObjectExistsInput {
  key: string;
}

export interface GetSignedUrlInput {
  key: string;
  expiresInSeconds?: number;
}

export interface StoredObject {
  provider: string;
  key: string;
  contentType: string;
  fileName?: string;
  size: number;
  checksum?: string | null;
}

export interface StoredObjectStream {
  provider: string;
  key: string;
  contentType: string;
  fileName?: string;
  size: number;
  checksum?: string | null;
  body: ReadableStream<Uint8Array>;
}

export interface StorageProvider {
  putObject(input: PutObjectInput): Promise<StoredObject>;
  getObject(input: GetObjectInput): Promise<StoredObjectStream>;
  deleteObject(input: DeleteObjectInput): Promise<void>;
  objectExists(input: ObjectExistsInput): Promise<boolean>;
  getSignedUrl?(input: GetSignedUrlInput): Promise<string>;
}
