TypeScript

InDom ships with ES2022-compatible type definitions in dist/indom.d.ts and the original TypeScript source in src/indom.ts.

Option 1 — Editor hints in plain JavaScript (no TS compile)
Use a triple-slash reference to enable IntelliSense/JSDoc in your editor:
/// <reference path="./dist/indom.d.ts" />
This is for editor tooling only. For runtime, include the JS build as shown in Plain JavaScript.
If you are compiling TypeScript, prefer imports (see Option 2), as the type definitions themselves use named exports, not global variables.

Option 2 — TypeScript projects (tsc / bundlers)
Import the named exports from the ESM build (or from the TypeScript source):
// from the package ESM build
import { InDom, InDomArray, $1, $a, $id, $n, $v } from 'indom/dist/indom.esm.js';

// or from a local copy of the ESM build
// import { InDom, InDomArray, $1, $a, $id, $n, $v } from './dist/indom.esm.js';

// or compile directly from the TypeScript source
// import { InDom, InDomArray, $1, $a, $id, $n, $v } from './src/indom.ts';
All exports are named — import only what you need, or import the full library as InDom.
Tree-shaking works naturally in modern bundlers.

Modern DOM Power
for TypeScript, ESM & Plain JS
3.8KB JavaScript library that simplifies DOM manipulation
with a clean, chainable API for events, data, inputs harvesting, and more.
Automatic Cleanup,
Leak-Proof by Design
Events and state are cleared when elements leave the DOM,
even if removal happens outside InDom.
Cleaner Code,
Better Ergonomics
Get the InDom object directly in callbacks.
One element, one instance.
Works With Your Existing Stack
Use InDom on its own or alongside any library or framework,
its architecture ensures a seamless integration.