BareDOM includes TypeScript declarations for every component. Types are auto-generated from component metadata and ship alongside the ESM files — no additional setup required.
HTMLElement with all properties and methodsdetail payload typesHTMLElementTagNameMap augmentation so document.querySelector('x-button') returns XButtoncustom-elements.json) for IDE tooling and HTML intellisenseimport '@vanelsas/baredom/x-button';
import '@vanelsas/baredom/x-alert';
// querySelector returns typed XButton
const btn = document.querySelector('x-button')!;
btn.disabled = true; // type-checked
btn.loading = true; // autocomplete works
// Event listeners have typed detail payloads
btn.addEventListener('press', (e) => {
console.log(e.detail.source); // string — fully typed
});
// Custom events on other components
const alert = document.querySelector('x-alert')!;
alert.addEventListener('x-alert-dismiss', (e) => {
console.log(e.detail.reason); // string
console.log(e.detail.type); // string
});
// Components with methods
import '@vanelsas/baredom/x-modal';
const modal = document.querySelector('x-modal')!;
modal.show(); // typed method
modal.hide(); // typed method
The custom-elements.json manifest enables HTML intellisense in editors that support it. For VS Code, install the Lit Plugin or the Custom Elements Language Server to get attribute autocomplete and validation in HTML templates.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |