Files
DOSSIER/src/panels/downloadFile.ts
T
Claude c757eda756 [70] Flächentabelle (Flächenarten nach SIA 416) und IVHB-Kennziffern
Kern flaechen.rs (Abfragen areaTable/ivhb): GF = NGF + KF, KF aus Wandgrundrissen
und KGF-Räumen, AGF separat, GV; GFZ, AZ, BMZ, ÜZ, GZ, Gesamt-/Fassadenhöhe.
Bericht als CSV (mit Rückleser), SVG und Vektor-PDF, Abschnitt im
Flächenbilanz-Panel, CLI kennzahlen --sia416 --ivhb --format json|csv|svg|pdf.

Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
2026-10-28 20:29:57 +00:00

18 lines
601 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Stösst den Download einer Datei an (reiner Client, Blob-URL).
export function downloadFile(fileName: string, blob: Blob): void {
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
/** CSV mit BOM, damit Excel UTF-8 (Umlaute/„m²") korrekt liest. */
export function downloadCsv(fileName: string, content: string): void {
downloadFile(fileName, new Blob(["" + content], { type: "text/csv;charset=utf-8;" }));
}