using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using StellaOps.Vexer.Core;

namespace StellaOps.Vexer.Export;

public sealed record VexExportArtifact(
    VexContentAddress ContentAddress,
    VexExportFormat Format,
    ReadOnlyMemory<byte> Content,
    IReadOnlyDictionary<string, string> Metadata);

public sealed record VexStoredArtifact(
    VexContentAddress ContentAddress,
    string Location,
    long SizeBytes,
    IReadOnlyDictionary<string, string> Metadata);

public interface IVexArtifactStore
{
    ValueTask<VexStoredArtifact> SaveAsync(VexExportArtifact artifact, CancellationToken cancellationToken);

    ValueTask DeleteAsync(VexContentAddress contentAddress, CancellationToken cancellationToken);

    ValueTask<Stream?> OpenReadAsync(VexContentAddress contentAddress, CancellationToken cancellationToken);
}
