using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Elwig.Helpers.Export {
    public interface IExporter<T> : IDisposable, IAsyncDisposable {
        /// <summary>
        /// The default file extension of the exported files to be used (whithout a preceding ".")
        /// </summary>
        static abstract string FileExtension { get; }

        /// <summary>
        /// Export the given data to the given file.
        /// </summary>
        /// <param name="data">The data to be exported</param>
        /// <param name="progress">The progress object to report to</param>
        void Export(IEnumerable<T> data, IProgress<double>? progress = null);

        /// <summary>
        /// Asynchronosly export the given data to the given file.
        /// </summary>
        /// <param name="data">The data to be exported</param>
        /// <param name="progress">The progress object to report to</param>
        Task ExportAsync(IEnumerable<T> data, IProgress<double>? progress = null);
    }
}
