/** * Always set these properties as attributes on all elements * * @internal */ export const alwaysAttributes: Set; /** * Always set these properties as attributes on non-custom-elements * * @internal */ export const nativeAlwaysAttributes: Set; /** * These don't exist as a property, only as an attribute. * Or, the property is read-only, but the attribute is not. * * @internal */ export const htmlAlwaysAttributes: Record | undefined>; /** * The mappings between native DOM property and the equivalent attribute it * reflects to. * * This list was generated using the ./extractPropertyToAttributeMappings.js * script. * * @internal */ export interface PropertyToAttributeMappings { /** * Mappings that are common to all HTML elements * * @internal */ readonly common: Required; /** * Mappings that are specific to a given HTML element * * @internal */ readonly perElement: Record; } /** @internal */ export interface ElementPropertyToAttributeMappings { /** * This list is only used to apply an optional performance optimization. * If it gets out of date or is missing some properties, it's not a big deal. * * This list is used to convert JSX properties with static values to * an inlined HTML string that uses the equivalent attribute. * * Thus instead of `.property=${"1"}` final lit-html looks like `attribute=1`. * * Since static attributes are just part of the HTML string and not a special * binding, lit-html doesn't have to waste time diffing them on re-render. * * @internal */ reflected?: Readonly>; /** * Unfortunately, for many DOM **properties**, when set to undefined * (`el.autocapitalize = undefined`), rather than removing the attribute, they * set the attribute to an `"undefined"` string (this is never a desirable * outcome) or some other non-default value. This is the web platform * behavior. * * lit-html also has an anti-feature of rendering `undefined` **attribute** * values as `"undefined"` strings (they wanted to mirror the `.setAttribute()` * behavior). * * Thus, the only way to unset such attributes in lit-html is to use attribute * rather than property, and then add `?? nothing` to the attribute value. * `nothing` is a special magic value Lit had to invent to mean * "removeAttribute()" * * @internal * @see https://github.com/lit/lit/issues/4760 * @see https://x.com/maxpatiiuk/status/1840567140354798003 */ stringifiedReflected?: Readonly>; /** * Properties that when set to `undefined` value are actually set to * `"undefined"` string. * * We cannot use `?? nothing` as `nothing` in property bindings acts the same * as `undefined`. * * At the moment, all of these happen to be reset to default value when set * to empty string, thus we add `?? ''` on these if potentially nullish value * was provided. * * @internal */ stringifiedNonReflected?: Readonly>; } /** @internal */ export const propertyToAttributeMappings: PropertyToAttributeMappings; /** * List of all DOM events settable in JSX. These event names are converted to * lowercase. All others are left as authored as we can't make assumptions about * what was the intended casing. * * @internal */ export const nativeEvents: Set; /** * Elements for which the `svg` function needs to be used rather than `html`. * * @internal * @example * ```tsx * * * * ``` * * Is converted into: * ```ts * html`${svg``}` * ``` * * (foreign elements in HTML can be self-closing) */ export const svgElements: Set; /** * Elements for which the `math` function needs to be used rather than `html` * * @internal * @example * ```tsx * * 6 * * ``` * * Is converted into: * ```ts * html`${mathml`6`}` * ``` * * (foreign elements in HTML can be self-closing) */ export const mathMlElements: Set<(string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string)>;