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.
Next: Getting Started »