using Microsoft.JSInterop;

namespace SelectPdf.Samples
{
    public static class PdfDownloadExtensions
    {
        public static ValueTask DownloadAsync(this IJSRuntime js, string filename, byte[] content, string contentType = "application/pdf")
        {
            return js.InvokeVoidAsync("selectpdfDownload", filename, contentType, Convert.ToBase64String(content));
        }
    }
}
