export type HTagHeadName = keyof HTMLElementTagNameMap | `${string}${"-"}${string}`; export type HTagHeadAttr = "." | "#" | "~"; export type HTagHead = `${HTagHeadName}` | `${HTagHeadName}${HTagHeadAttr}${T}`; export type HAttrClasses = Array; export type HAttrStyles = Partial; export type HDataValue = string | String | number | Number | boolean | Boolean | Date | Array | Object; export type HAttrData = { [key: string]: HDataValue; }; export type HAttrOnDataFnc = (e: Event) => any; export type HAttrOnData = HDataValue | HAttrOnDataFnc | null; export type HAttrOnCb = [keyof HTMLElementEventMap, EventListener]; export type HAttrOnAct = [ keyof HTMLElementEventMap | string, HAttrOnActType, HAttrOnData? ]; export type HAttrOn = HAttrOnCb | HAttrOnAct | Array>; export interface HTagAttrs { readonly _id?: string; readonly _classes?: string[]; readonly _ref?: string; readonly _hObj?: HObj; readonly key?: string; readonly skip?: boolean; readonly id?: string; readonly ref?: string; readonly classes?: HAttrClasses; readonly class?: string; readonly data?: HAttrData; readonly styles?: HAttrStyles; readonly style?: string; readonly on?: HAttrOn; readonly validation?: { badInput?: string; patternMismatch?: string; rangeOverflow?: string; rangeUnderflow?: string; stepMismatch?: string; tooLong?: string; tooShort?: string; typeMismatch?: string; valueMissing?: string; }; readonly title?: string; readonly lang?: string; readonly accessKey?: string; readonly href?: string; readonly target?: "_blank" | "_self" | "_parent" | "_top"; readonly novalidate?: boolean | Boolean; readonly type?: "text" | "hidden" | "password" | "email" | "number" | "search" | "url" | "tel" | "color" | "date" | "datetime-local" | "month" | "range" | "time" | "week" | "submit" | "button" | "radio" | "checkbox" | "file" | "image" | "reset" | "text/plain" | "text/html" | "text/css" | "text/javascript" | "text/csv" | "text/xml" | "image/png" | "image/jpeg" | "image/svg+xml" | "audio/mp3" | "audio/ogg" | "video/mp4" | "video/ogg" | "application/json" | "application/pdf" | "application/x-www-form-urlencoded" | "application/xml" | "multipart/form-data"; readonly name?: string; readonly value?: string | number | Number | String | null; readonly autocomplete?: string; readonly checked?: boolean | Boolean; readonly disabled?: boolean | Boolean; readonly list?: string; readonly max?: number | string; readonly maxlength?: number | string; readonly min?: number | string; readonly minlength?: number | string; readonly multiple?: boolean | Boolean; readonly pattern?: string; readonly placeholder?: string; readonly readonly?: boolean | Boolean; readonly required?: boolean | Boolean; readonly size?: number | string; readonly step?: number | string; readonly src?: string; readonly alt?: string; readonly height?: number | string; readonly width?: number | string; readonly maxsize?: number; readonly convert?: "text" | "json" | "base64" | "object" | "dataurl" | "arraybuffer" | "stream"; readonly [key: string]: string | String | string[] | String[] | number | Number | boolean | Boolean | Date | HAttrClasses | HAttrStyles | HAttrOn | EventListener | HObj | null | undefined; } export type HFnc = (e: Element) => boolean | void; export interface HObj { toHsml?(): HElement; } export interface HElements extends Array> { } export type HTagChildren = HElements | HFnc | HObj | string | String | boolean | Boolean | number | Number | Date | undefined | null; export type HTagNoAttr = [HTagHead, HTagChildren?]; export type HTagWithAttr = [HTagHead, HTagAttrs, HTagChildren?]; export type HTag = HTagNoAttr | HTagWithAttr; export type HElement = HFnc | HObj | HTag | string | String | boolean | Boolean | number | Number | Date | undefined | null; export interface HHandlerCtx extends HObj { refs: { [name: string]: Element; }; actionCb(action: HAttrOnActType, data: HAttrOnData, e: Event): void; } export interface HHandler> { open(tag: HTagHeadName, attrs: HTagAttrs, children: HElements, ctx?: C): boolean; close(tag: HTagHeadName, children: HElements, ctx?: C): void; text(text: string, ctx?: C): void; fnc(fnc: HFnc, ctx?: C): void; obj(obj: HObj, ctx?: C): void; } export declare const NBSP = "\u00A0"; export declare const NNBSP = "\u202F"; export declare const THSP = "\u2009"; export declare const NUMSP = "\u2007"; export declare function hsml>(hml: HElement, handler: HHandler, ctx?: C): void; export declare function hjoin(hsmls: HElements, sep: string | HElement): HElements;