/// import type * as Aria from "./aria.d.ts"; import type * as CSS from "./css.d.ts"; import type * as Mono from "./mono.d.ts"; export interface BaseCSSProperties extends CSS.Properties { /** * The field-sizing CSS property enables you to control the sizing behavior of elements that are given a default preferred size, such as form control elements. This property enables you to override the default sizing behavior, allowing form controls to adjust in size to fit their contents. * @see https://developer.mozilla.org/docs/Web/CSS/field-sizing */ fieldSizing?: "fixed" | "content" | (string & {}); /** * The view-transition-class CSS property provides the selected elements with an identifying class (a ), providing an additional method of styling the view transitions for those elements. * @see https://developer.mozilla.org/docs/Web/CSS/view-transition-class */ viewTransitionClass?: string; /** * The view-transition-name CSS property specifies the view transition snapshot that selected elements will participate in, which enables an element to be animated separately from the rest of the page during a view transition. * @see https://developer.mozilla.org/docs/Web/CSS/view-transition-name */ viewTransitionName?: string; } export interface AtRuleCSSProperties { [key: `@container${" " | "("}${string}`]: BaseCSSProperties; [key: `@media${" " | "("}${string}`]: BaseCSSProperties; [key: `@supports${" " | "("}${string}`]: BaseCSSProperties; [key: `@keyframes ${string}`]: { [key in "from" | "to" | `${number}%`]?: BaseCSSProperties; }; "@view-transition"?: { /** * Specifies the effect this at-rule will have on the document's view transition behavior. */ navigation?: "auto" | "none" | (string & {}); }; } export interface PseudoCSSProperties { ":active"?: BaseCSSProperties; ":link"?: BaseCSSProperties; ":visited"?: BaseCSSProperties; ":checked"?: BaseCSSProperties; ":disabled"?: BaseCSSProperties; ":enable"?: BaseCSSProperties; ":empty"?: BaseCSSProperties; ":first"?: BaseCSSProperties; ":first-child"?: BaseCSSProperties; ":first-of-type"?: BaseCSSProperties; ":focus"?: BaseCSSProperties; ":focus-visible"?: BaseCSSProperties; ":focus-within"?: BaseCSSProperties; ":fullscreen"?: BaseCSSProperties; ":hover"?: BaseCSSProperties; ":in-range"?: BaseCSSProperties; ":out-of-range"?: BaseCSSProperties; ":indeterminate"?: BaseCSSProperties; ":invalid"?: BaseCSSProperties; ":last-child"?: BaseCSSProperties; ":last-of-type"?: BaseCSSProperties; ":only-child"?: BaseCSSProperties; ":only-of-type"?: BaseCSSProperties; ":optional"?: BaseCSSProperties; "::after"?: BaseCSSProperties; "::backdrop"?: BaseCSSProperties; "::before"?: BaseCSSProperties; "::first-letter"?: BaseCSSProperties; "::first-line"?: BaseCSSProperties; "::placeholder"?: BaseCSSProperties; "::selection"?: BaseCSSProperties; "::view-transition"?: BaseCSSProperties; [key: `:has(${string})`]: BaseCSSProperties; [key: `:is(${string})`]: BaseCSSProperties; [key: `:lang(${string})`]: BaseCSSProperties; [key: `:not(${string})`]: BaseCSSProperties; [key: `:nth-child(${string})`]: BaseCSSProperties; [key: `:nth-last-child(${string})`]: BaseCSSProperties; [key: `:nth-of-type(${string})`]: BaseCSSProperties; [key: `::view-transition-group(${string})`]: BaseCSSProperties; [key: `::view-transition-image-pair(${string})`]: BaseCSSProperties; [key: `::view-transition-new(${string})`]: BaseCSSProperties; [key: `::view-transition-old(${string})`]: BaseCSSProperties; } export interface CSSProperties extends BaseCSSProperties, AtRuleCSSProperties, PseudoCSSProperties { [key: `--${string}`]: string | number; [key: `&${" " | "." | "[" | ">"}${string}`]: CSSProperties; } export namespace HTML { type HTMLClass = string | boolean | undefined | null | Record; type CrossOrigin = "anonymous" | "use-credentials"; type Target = "_blank" | "_self" | "_parent" | "_top"; type ReferrerPolicy = | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"; type InputType = | "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week"; /** Global HTML attributes from https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes */ interface GlobalAttributes extends EventAttributes, Aria.Attributes, Mono.BaseAttributes, JSX.CustomAttributes { /** * A reference to the element. * @mono-jsx */ ref?: HTMLElement | ((el: T) => unknown); /** Defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS). */ id?: string; /** Contains a space-separated list of the classes of the element. Classes are used by CSS and JavaScript to select and access specific elements. */ class?: HTMLClass | HTMLClass[]; /** Contains [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) styling declarations to be applied to the element. */ style?: string | CSSProperties; /** An enumerated attribute indicating that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements. This attribute must not be used to hide content that could legitimately be shown. */ hidden?: boolean | "hidden" | "until-found"; /** An enumerated attribute indicating whether the element can be dragged, using the Drag and Drop API. */ draggable?: boolean; /** * An enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies its widget to allow editing. The attribute must take one of the following values: * - `true` or the empty string, which indicates that the element must be editable; * - `false`, which indicates that the element must not be editable. */ contentEditable?: boolean; /** Indicates that an element is to be focused on page load, or as soon as the `` it is part of is displayed. **/ autoFocus?: boolean; /** Helps define the language of an element: the language that non-editable elements are in, or the language that editable elements should be written in by the user. The attribute contains one "language tag" (made of hyphen-separated "language subtags") in the format defined in [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646). */ lang?: string; /** Roles define the semantic meaning of content, allowing screen readers and other tools to present and support interaction with an object in a way that is consistent with user expectations of that type of object. */ role?: Aria.Role; /** Provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a space-separated list of characters. The browser should use the first one that exists on the computer keyboard layout. */ accesskey?: string; /** * An enumerated attribute indicating the directionality of the element's text. It can have the following values: * - `ltr`, which means left to right and is to be used for languages that are written from the left to the right (like English); * - `rtl`, which means right to left and is to be used for languages that are written from the right to the left (like Arabic); * - `auto`, which lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then it applies that directionality to the whole element. */ dir?: "auto" | "rtl" | "ltr"; /** * An integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position. It can take several values: * - a negative value means that the element should be focusable, but should not be reachable via sequential keyboard navigation; * - `0` means that the element should be focusable and reachable via sequential keyboard navigation, but its relative order is defined by the platform convention; * - a positive value which means should be focusable and reachable via sequential keyboard navigation; its relative order is defined by the value of the attribute: the sequential follow the increasing number of the `tabindex`. If several elements share the same tabindex, their relative order follows their relative position in the document). */ tabIndex?: number; /** Contains a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip. */ title?: string; /** * An enumerated attribute that is used to specify whether an element's attribute values and the values of its Text node children are to be translated when the page is localized, or whether to leave them unchanged. It can have the following values: * - empty string or yes, which indicates that the element will be translated. * - `no`, which indicates that the element will not be translated. */ translate?: "yes" | "no"; /** * Turns an element into a popover element; takes a popover state ("auto" or "manual") as its value. * @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API */ popover?: boolean | "auto" | "manual"; /** A space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the [`::part`](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) pseudo-element. */ part?: string; /** Allows you to specify that a standard HTML element should behave like a registered custom built-in element (see [Using custom elements](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements) for more details). */ is?: string; /** A boolean value that makes the browser disregard user input events for the element. Useful when click events are present. */ inert?: boolean; /** * Enables view transition for the element. * @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API * @mono-jsx */ viewTransition?: string | boolean; } interface HtmlAttributes extends GlobalAttributes, JSX.HtmlCustomAttributes {} interface AnchorAttributes extends GlobalAttributes { download?: string | true; href?: string; hrefLang?: string; media?: string; ping?: string; referrerPolicy?: ReferrerPolicy; rel?: string; target?: Target; type?: string; } interface NavAttributes extends GlobalAttributes { /** * This attribute is used to specify the class name for the active link. * @mono-jsx */ "data-active-class"?: string; } interface ImgAttributes extends GlobalAttributes, LoaderElementAttributes { alt?: string; crossOrigin?: CrossOrigin; decoding?: "async" | "auto" | "sync"; height?: number | string; isMap?: boolean; loading?: "lazy"; referRerpolicy?: ReferrerPolicy; sizes?: string; src?: string; srcSet?: string; useMap?: string; width?: number | string; } interface FormAttributes extends GlobalAttributes { "accept-charset"?: string; action?: string | (/* @mono-jsx */ (data: FormData, event: SubmitEvent) => unknown | Promise); autoComplete?: "on" | "off"; encType?: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain"; method?: "GET" | "POST" | "dialog"; name?: string; noValidate?: boolean; target?: Target; onSubmit?: EventHandler; onReset?: EventHandler; onFormData?: EventHandler; /** * Delegate to the router to handle the form submission * @mono-jsx */ route?: boolean; } interface InputAttributes extends GlobalAttributes, InputElementAttributes { accept?: string; alt?: string; autoComplete?: string; capture?: boolean | "user" | "environment"; checked?: boolean; disabled?: boolean; enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send"; form?: string; formAction?: FormAttributes["action"]; formEncType?: FormAttributes["encType"]; formMethod?: FormAttributes["method"]; formNoValidate?: boolean; formTarget?: Target; height?: number | string; list?: string; max?: number | string; maxLength?: number; min?: number | string; minLength?: number; multiple?: boolean; name?: string; pattern?: string; placeholder?: string; readOnly?: boolean; required?: boolean; size?: number; src?: string; step?: number | string; type?: InputType; value?: string | number; width?: number | string; /** * Turns a