ts migration package.json

This commit is contained in:
Philippe Torrel
2026-08-03 09:04:28 +02:00
parent 56295802c0
commit 831644667e
11 changed files with 5976 additions and 103 deletions

View File

@@ -0,0 +1,11 @@
// Generische Helferfunktion zum Selektieren von Element mit Überprüfung, ob das Element existiert
export const querySelectorTyped = <T extends HTMLElement>(
selector: string,
parent: Element | Document = document,
): T => {
const element = parent.querySelector<T>(selector);
if (!element) {
throw new Error(`Element with selector "${selector}" not found.`);
}
return element;
};