banira types

Generate a self-contained .d.ts from the manifest that augments HTMLElementTagNameMap so document.querySelector and document.createElement are typed for consumers.

Usage

$ banira types <files...> [options]

Arguments

ArgumentDescription
<files...>Component source files to analyze.

Options

OptionDescription
-o, --output <path>Write the .d.ts to a file instead of stdout.
--jsxAlso augment JSX.IntrinsicElements.

Examples

emit typings
$ banira types src/*.ts -o dist/elements.d.ts

Notes

No runtime import is required by consumers — shipping the .d.ts alongside your package is enough to type my-el in querySelector/createElement. With --jsx, JSX intrinsic elements are augmented too.