export type PutObjectInput = {
  key: string;
  body: string | Uint8Array;
  contentType?: string;
};

export type StorageObjectSummary = {
  key: string;
  size: number;
  lastModified?: string;
  etag?: string;
};

export type StorageObject = {
  body: Uint8Array;
  contentType?: string;
};

export interface StorageProvider {
  ensureReady(): Promise<void>;
  putObject(input: PutObjectInput): Promise<void>;
  getObject(key: string): Promise<StorageObject>;
  getObjectText(key: string): Promise<string>;
  listPrefix(prefix: string): Promise<StorageObjectSummary[]>;
  copyPrefix(sourcePrefix: string, destinationPrefix: string): Promise<number>;
  deletePrefix(prefix: string): Promise<void>;
}
