adds trail export

This commit is contained in:
Christian Beutel
2024-05-05 15:46:17 +02:00
parent 930feda4d6
commit 756a9fa79f
18 changed files with 310 additions and 31 deletions

View File

@@ -17,3 +17,14 @@ export function readAsDataURLAsync(file: File) {
fr.readAsDataURL(file);
});
}
export function saveAs(data: Blob, fileName: string) {
var a = document.createElement("a") as HTMLAnchorElement;
a.setAttribute("style", "display: none");
document.body.appendChild(a);
const url = window.URL.createObjectURL(data);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
};