UNPKG

ziko

Version:

A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...

28 lines (24 loc) 804 B
import { UIElement } from "../constructors/UIElement.js"; import { UINode } from "../constructors/UINode.js"; /** * All valid DOM tag names (HTML + SVG + MathML) */ type NativeTagNames = | keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap | keyof MathMLElementTagNameMap; /** * Tags that should return UINode instead of UIElement */ type NodeTags = "html" | "head" | "body" | "style" | "title" | "meta" | "link" | "base"; /** * Map native tags: * - html | body | style → UINode * - everything else → UIElement */ export type Tags = { [K in NativeTagNames]: K extends NodeTags ? UINode : UIElement; } & { [key: `${string}-${string}` | `${string}_${string}`]: UIElement; // custom elements default to UIElement }; export declare const tags: Tags;