private async Task DownloadFile(DownloadOption option) { if (JSRuntime is IJSUnmarshalledRuntime webAssemblyJsRuntime) { webAssemblyJsRuntime.InvokeUnmarshalled <string?, string, byte[], bool>("$.bb_download_wasm", option.FileName, option.Mime, option.FileContent); } else { await JSRuntime.InvokeVoidAsync(identifier : "$.bb_download", option.FileName, option.Mime, option.FileContent); } }
private async Task <string> CreateUrl(DownloadOption option) { if (JSRuntime is IJSUnmarshalledRuntime webAssemblyJsRuntime) { return(webAssemblyJsRuntime.InvokeUnmarshalled <string?, string, byte[], string>("$.bb_create_url_wasm", option.FileName, option.Mime, option.FileContent)); } else { return(await JSRuntime.InvokeAsync <string>(identifier : "$.bb_create_url", option.FileName, option.Mime, option.FileContent)); } }