import { IStorageService } from './storage.protocol.js';

/**
 * Storage subsystem — in-memory backend
 *
 * Stores files as Buffers in a Map. Intended for unit tests only.
 * All state is lost when the process exits.
 *
 * - getUrl returns `memory://{key}` (not a real URL, useful for assertions)
 * - All methods throw on failure (missing keys, etc.)
 */

declare class MemoryStorageBackend implements IStorageService {
    private readonly store;
    upload(key: string, data: Buffer | ReadableStream, contentType?: string): Promise<string>;
    download(key: string): Promise<Buffer>;
    delete(key: string): Promise<void>;
    getUrl(key: string, _expiresInSeconds?: number): Promise<string>;
    exists(key: string): Promise<boolean>;
    list(prefix?: string): Promise<string[]>;
    downloadStream(key: string): Promise<ReadableStream>;
    /** Clear all stored files. Useful for test teardown. */
    clear(): void;
    /** Return number of stored files. Useful for test assertions. */
    size(): number;
}

export { MemoryStorageBackend };
