diff --git a/bau/bau.d.ts b/bau/bau.d.ts index 87be55ff..d4e5a97b 100644 --- a/bau/bau.d.ts +++ b/bau/bau.d.ts @@ -135,118 +135,12 @@ export type TagFunc = ( ...rest: readonly ChildDom[] ) => Result; -interface TagsBase { - readonly [key: string]: TagFunc; -} - -interface Tags extends TagsBase { - // Register known element types - // Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element - - // Main root - readonly html: TagFunc; - - // Document metadata - readonly base: TagFunc; - readonly head: TagFunc; - readonly link: TagFunc; - readonly meta: TagFunc; - readonly style: TagFunc; - readonly title: TagFunc; - - // Sectioning root - readonly body: TagFunc; - - // Content sectioning - readonly h1: TagFunc; - readonly h2: TagFunc; - readonly h3: TagFunc; - readonly h4: TagFunc; - readonly h5: TagFunc; - readonly h6: TagFunc; - - // Text content - readonly blockquote: TagFunc; - readonly div: TagFunc; - readonly dl: TagFunc; - readonly hr: TagFunc; - readonly li: TagFunc; - readonly menu: TagFunc; - readonly ol: TagFunc; - readonly p: TagFunc; - readonly pre: TagFunc; - readonly ul: TagFunc; - - // Inline text semantics - readonly a: TagFunc; - readonly br: TagFunc; - readonly data: TagFunc; - readonly q: TagFunc; - readonly span: TagFunc; - readonly time: TagFunc; - - // Image and multimedia - readonly area: TagFunc; - readonly audio: TagFunc; - readonly img: TagFunc; - readonly map: TagFunc; - readonly track: TagFunc; - readonly video: TagFunc; - - // Embedded content - readonly embed: TagFunc; - readonly iframe: TagFunc; - readonly object: TagFunc; - readonly picture: TagFunc; - readonly source: TagFunc; - - // Scripting - readonly canvas: TagFunc; - readonly script: TagFunc; - - // Demarcating edits - readonly del: TagFunc; - readonly ins: TagFunc; - - // Table content - readonly caption: TagFunc; - readonly col: TagFunc; - readonly colgroup: TagFunc; - readonly table: TagFunc; - readonly tbody: TagFunc; - readonly td: TagFunc; - readonly tfoot: TagFunc; - readonly th: TagFunc; - readonly thead: TagFunc; - readonly tr: TagFunc; - - // Forms - readonly button: TagFunc; - readonly datalist: TagFunc; - readonly fieldset: TagFunc; - readonly form: TagFunc; - readonly input: TagFunc; - readonly label: TagFunc; - readonly legend: TagFunc; - readonly meter: TagFunc; - readonly optgroup: TagFunc; - readonly option: TagFunc; - readonly output: TagFunc; - readonly progress: TagFunc; - readonly select: TagFunc; - readonly textarea: TagFunc; - - // Interactive elements - readonly details: TagFunc; - readonly dialog: TagFunc; - - // Web Components - readonly slot: TagFunc; - readonly template: TagFunc; -} +type Tags = Readonly>> & { + [K in keyof HTMLElementTagNameMap]: TagFunc; +}; declare function state(initVal: T): State; -declare function tagsNS(namespaceURI: string): TagsBase; +declare function tagsNS(namespaceURI: string): Tags; declare function bind(input: BindInput): HTMLElement; declare function derive(computed: () => T): ReadonlyState; declare function loop(