import { DOMTypes } from "@lilian1315/elements-writable-properties-types"; //#region src/types.d.ts type Child = Node | string | number | null | undefined; type Children = Child | Child[]; type DomElement = HTMLElement | SVGElement | MathMLElement; interface SpecialAttributes, DataAttribute = { [name: string]: string | boolean | undefined | null; }, ChildrenAttribute = Children, InnerHTMLAttribute = string> { /** * Add class to the element. Can be provided in multiple formats: * - A string with space-separated class names: `"class1 class2"` * - An array of class names: `["class1", "class2"]` * - An object where keys are class names and values are booleans indicating whether to include the class: `{ "class1": true, "class2": false }` */ class: ClassAttribute; style: StyleAttribute; data: DataAttribute; children: ChildrenAttribute | ChildrenAttribute[]; innerHTML: InnerHTMLAttribute; } type SVGElementPrefixedTagTagMap = { svg: 'svg'; } & { [T in keyof Omit as `svg:${T}`]: T }; type MathMLElementPrefixedTagTagMap = { math: 'math'; } & { [T in keyof Omit as `math:${T}`]: T }; type PrefixedElementTag = keyof HTMLElementTagNameMap | keyof HTMLElementDeprecatedTagNameMap | keyof SVGElementPrefixedTagTagMap | keyof MathMLElementPrefixedTagTagMap; type BaseElementAttributesTagNameMap = { [T in PrefixedElementTag]: T extends keyof SVGElementPrefixedTagTagMap ? DOMTypes.SVGElementTagNameMap[SVGElementPrefixedTagTagMap[T]] : T extends keyof MathMLElementPrefixedTagTagMap ? DOMTypes.MathMLElementTagNameMap[MathMLElementPrefixedTagTagMap[T]] : T extends keyof HTMLElementTagNameMap ? DOMTypes.HTMLElementTagNameMap[T] : T extends keyof HTMLElementDeprecatedTagNameMap ? DOMTypes.HTMLElementDeprecatedTagNameMap[T] : never }; type ElementAttributesTagNameMap = { [T in PrefixedElementTag]: Partial>> }; type ElementPrefixedTagNameMap = { [T in PrefixedElementTag]: T extends keyof SVGElementPrefixedTagTagMap ? SVGElementTagNameMap[SVGElementPrefixedTagTagMap[T]] : T extends keyof MathMLElementPrefixedTagTagMap ? MathMLElementTagNameMap[MathMLElementPrefixedTagTagMap[T]] : T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : T extends keyof HTMLElementDeprecatedTagNameMap ? HTMLElementDeprecatedTagNameMap[T] : never }; type WithChildren = T & { /** * Adds child nodes to the element. When this attribute is used, `innerHTML` must not be provided. */ children?: SpecialAttributes['children']; innerHTML?: never; }; type WithInnerHTML = T & { /** * Sets the innerHTML of the element. When this attribute is used, `children` must not be provided. * Attention: Using `innerHTML` can expose your application to security risks like Cross-Site Scripting (XSS) attacks if the content is not properly sanitized. */ innerHTML?: string; children?: never; }; type Prettify = { [K in keyof T]: T[K] } & {}; //#endregion export { BaseElementAttributesTagNameMap, Child, Children, DomElement, ElementAttributesTagNameMap, ElementPrefixedTagNameMap, PrefixedElementTag, Prettify, SpecialAttributes, WithChildren, WithInnerHTML }; //# sourceMappingURL=types.d.ts.map