Reference
Automatic tag registration
import { … } from "@johnmorrisdotca/korokoro/element/define";
97.2 kB minified and gzipped, with everything it imports (measured with esbuild)
The custom element, registered by being imported:
<script type="module" src="…/dist/element-define.js"></script><korokoro-roller notation="2d20kh1+5"></korokoro-roller> <korokoro-die sides="20"></korokoro-die>
This is the one module of the package that does something when it is
imported, and package.json says so, so that a bundler keeps it.
./element exports the same class and defineRoller() with no effect of
its own, for a page that wants to choose when, or under what tag.
Exports
| Name | Kind | What it is |
|---|---|---|
defineDie | function | Register <korokoro-die>, as that tag unless another is asked for. |
defineRoller | function | Register the element, as <korokoro-roller> unless another tag is asked for. |
DIE_TAG | constant | The die's tag, unless another is asked for. |
KorokoroDie | class | ONE DIE ON ITS OWN, as a custom element: |
KorokoroRoller | class | The <korokoro-roller> element. |
ROLLER_TAG | constant | The element's tag, unless another is asked for. |