TypeScript's DOM types accurately model the browser's DOM hierarchy. Understanding this hierarchy - Element extends Node, HTMLElement extends Element, etc. - helps you write correct DOM code. Use the most specific type possible for better autocompletion and type safety.
Use the most specific DOM type possible. HTMLElement for HTML elements, HTMLInputElement for inputs, etc.
Da utilizzare quando si lavora con le API DOM. Da utilizzare quando si digitano i riferimenti agli elementi. Da utilizzare durante la creazione di utilità DOM. Utilizzare durante la gestione degli eventi. Utilizzare durante la manipolazione del DOM. Fonte: marius-townhouse/effective-typescript-skills.
Apri il tuo terminale o strumento da riga di comando (Terminal, iTerm, Windows Terminal, ecc.) Copia ed esegui questo comando: npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill dom-hierarchy Dopo l'installazione, la skill verrà configurata automaticamente nel tuo ambiente AI di coding e sarà pronta all'uso in Claude Code, Cursor o OpenClaw