= (instance: T) => void
export type PropsWithChildren = P & { children?: JSXChild | JSXChild[] }
interface VoidElement {
/**
* Void element cannot have any child nodes (i.e., nested elements or text nodes)
* @see https://developer.mozilla.org/en-US/docs/Glossary/Void_element
* @deprecated
*/
children?: never | void | null
}
type ExcludeKey =
| 'children'
| 'dataset'
| 'style'
| 'attributes'
| `on${string}`
| `prop:${string}`
| `attr:${string}`
export declare function jsx<
K extends keyof JSX.IntrinsicElements | AnyString,
R = K extends keyof HTMLElementTagNameMap
? HTMLElementTagNameMap[K]
: K extends keyof HTMLElementDeprecatedTagNameMap
? HTMLElementDeprecatedTagNameMap[K]
: K extends keyof SVGElementTagNameMap
? SVGElementTagNameMap[K]
: K extends keyof MathMLElementTagNameMap
? MathMLElementTagNameMap[K]
: Element
>(
tag: K,
props: OmitAttrs, ExcludeKey>,
children?: JSXChild | JSXChild[]
): R
export declare const svgNs: 'http://www.w3.org/2000/svg'
export declare const mathmlNs: 'http://www.w3.org/1998/Math/MathML'
export type SignalListener = (value: T) => void
export interface Signal {
get(): Readonly
set(val: T): void
on(fn: SignalListener): () => boolean
readonly [_s: symbol]: symbol
_a(name: string): Attr
_t(): Text
}
export type Signalish = T | Signal
export declare function signal(value?: T): Signal
export declare function useRef(current?: T): RefObject
export declare function useText(initContent?: T): readonly [
Text,
(content: T) => void
]
export declare function parseFromString(html: string): DocumentFragment
export declare function Template(props: { children: string }): DocumentFragment
/**
* Renders JSX content by appending it to the container with
* [`Node.append()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/append).
* Arrays are appended recursively and in order. `null`, `undefined`, and
* `false` values are ignored.
*
* Existing content in the container is preserved.
*/
export declare function render(element: JSXChild | JSXChild[], container: Element | DocumentFragment): void
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/CommandEvent) */
interface CommandEvent extends Event {
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/CommandEvent/source) */
readonly source: Element | null
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/CommandEvent/command) */
readonly command: CommandEventType
}
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/SnapEvent) */
interface SnapEvent extends Event {
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/SnapEvent/snapTargetBlock) */
readonly snapTargetBlock: Element | null
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/SnapEvent/snapTargetInline) */
readonly snapTargetInline: Element | null
}
interface CurrentTarget {
readonly currentTarget: EventTarget & T
}
export interface EventHandlerObject {
handleEvent(event: E & CurrentTarget): void
}
type EventHandlerFunction = (this: T, event: E & CurrentTarget) => void
type EventHandler = EventHandlerFunction | EventHandlerObject
export type AnimationEventHandler = EventHandlerFunction
export type ClipboardEventHandler = EventHandlerFunction
export type CompositionEventHandler = EventHandlerFunction
export type DragEventHandler = EventHandlerFunction
export type FocusEventHandler = EventHandlerFunction
export type FormDataEventHandler = EventHandlerFunction
export type GenericEventHandler = EventHandlerFunction
export type InputEventHandler = EventHandlerFunction
export type KeyboardEventHandler = EventHandlerFunction
export type MediaEncryptedEventHandler = EventHandlerFunction
export type MouseEventHandler = EventHandlerFunction
export type PictureInPictureEventHandler = EventHandlerFunction
export type PointerEventHandler = EventHandlerFunction
export type SubmitEventHandler = EventHandlerFunction
export type ToggleEventHandler = EventHandlerFunction
export type TouchEventHandler = EventHandlerFunction
export type TransitionEventHandler = EventHandlerFunction
export type UIEventHandler = EventHandlerFunction
export type WebGLContextEventHandler = EventHandlerFunction
export type WheelEventHandler = EventHandlerFunction
export type ContentVisibilityAutoStateChangeEventHandler = EventHandlerFunction
export type CommandEventHandler = EventHandlerFunction
export type SnapEventHandler = EventHandlerFunction
export interface CSSProperties extends Properties {
cssText?: string | null
[key: `--${string}`]: number | string | null
}
export type ControlsList =
| 'nodownload'
| 'nofullscreen'
| 'noremoteplayback'
| 'noplaybackrate'
| AnyString
export type Target = '_self' | '_parent' | '_top' | '_blank' | '_unfencedTop' | AnyString
export type CrossOrigin = boolean | '' | 'anonymous' | 'use-credentials'
export type FetchPriority = 'high' | 'low' | 'auto'
export type CommandEventType =
| 'show-modal'
| 'close'
| 'request-close'
| 'show-popover'
| 'hide-popover'
| 'toggle-popover'
| `--${string}`
export type FormEnctype =
| 'application/x-www-form-urlencoded'
| 'multipart/form-data'
| 'text/plain'
| AnyString
export type FormMethod = 'post' | 'get' | 'dialog' | AnyString
export type DirName = 'rtl' | 'ltr'
export type AriaRole =
| 'alert'
| 'alertdialog'
| 'application'
| 'article'
| 'banner'
| 'blockquote'
| 'button'
| 'caption'
| 'cell'
| 'checkbox'
| 'code'
| 'columnheader'
| 'combobox'
| 'command'
| 'complementary'
| 'composite'
| 'contentinfo'
| 'definition'
| 'deletion'
| 'dialog'
| 'directory'
| 'document'
| 'emphasis'
| 'feed'
| 'figure'
| 'form'
| 'generic'
| 'grid'
| 'gridcell'
| 'group'
| 'heading'
| 'img'
| 'input'
| 'insertion'
| 'landmark'
| 'link'
| 'list'
| 'listbox'
| 'listitem'
| 'log'
| 'main'
| 'marquee'
| 'math'
| 'meter'
| 'menu'
| 'menubar'
| 'menuitem'
| 'menuitemcheckbox'
| 'menuitemradio'
| 'navigation'
| 'none'
| 'note'
| 'option'
| 'paragraph'
| 'presentation'
| 'progressbar'
| 'radio'
| 'radiogroup'
| 'range'
| 'region'
| 'roletype'
| 'row'
| 'rowgroup'
| 'rowheader'
| 'scrollbar'
| 'search'
| 'searchbox'
| 'section'
| 'sectionhead'
| 'select'
| 'separator'
| 'slider'
| 'spinbutton'
| 'status'
| 'strong'
| 'structure'
| 'subscript'
| 'superscript'
| 'switch'
| 'tab'
| 'table'
| 'tablist'
| 'tabpanel'
| 'term'
| 'textbox'
| 'time'
| 'timer'
| 'toolbar'
| 'tooltip'
| 'tree'
| 'treegrid'
| 'treeitem'
| 'widget'
| 'window'
| 'none presentation'
// the Digital Publishing WAI-ARIA
| 'doc-abstract'
| 'doc-acknowledgments'
| 'doc-afterword'
| 'doc-appendix'
| 'doc-backlink'
| 'doc-biblioentry'
| 'doc-bibliography'
| 'doc-biblioref'
| 'doc-chapter'
| 'doc-colophon'
| 'doc-conclusion'
| 'doc-cover'
| 'doc-credit'
| 'doc-credits'
| 'doc-dedication'
| 'doc-endnote'
| 'doc-endnotes'
| 'doc-epigraph'
| 'doc-epilogue'
| 'doc-errata'
| 'doc-example'
| 'doc-footnote'
| 'doc-foreword'
| 'doc-glossary'
| 'doc-glossref'
| 'doc-index'
| 'doc-introduction'
| 'doc-noteref'
| 'doc-notice'
| 'doc-pagebreak'
| 'doc-pagelist'
| 'doc-part'
| 'doc-preface'
| 'doc-prologue'
| 'doc-pullquote'
| 'doc-qna'
| 'doc-subtitle'
| 'doc-tip'
| 'doc-toc'
export interface AriaAttributes {
/** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
'aria-activedescendant'?: Signalish
/** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */
'aria-atomic'?: Signalish
/**
* Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be
* presented if they are made.
*/
'aria-autocomplete'?: Signalish<'none' | 'inline' | 'list' | 'both'>
/**
* Defines a string value that labels the current element, which is intended to be converted into Braille.
* @see aria-label.
*/
'aria-braillelabel'?: Signalish
/**
* Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
* @see aria-roledescription.
*/
'aria-brailleroledescription'?: Signalish
/** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */
'aria-busy'?: Signalish
/**
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
* @see aria-pressed @see aria-selected.
*/
'aria-checked'?: Signalish
/**
* Defines the total number of columns in a table, grid, or treegrid.
* @see aria-colindex.
*/
'aria-colcount'?: Signalish
/**
* Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
* @see aria-colcount @see aria-colspan.
*/
'aria-colindex'?: Signalish
/**
* Defines a human readable text alternative of aria-colindex.
* @see aria-rowindextext.
*/
'aria-colindextext'?: Signalish
/**
* Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
* @see aria-colindex @see aria-rowspan.
*/
'aria-colspan'?: Signalish
/**
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
* @see aria-owns.
*/
'aria-controls'?: Signalish
/** Indicates the element that represents the current item within a container or set of related elements. */
'aria-current'?: Signalish
/**
* Identifies the element (or elements) that describes the object.
* @see aria-labelledby
*/
'aria-describedby'?: Signalish
/**
* Defines a string value that describes or annotates the current element.
* @see related aria-describedby.
*/
'aria-description'?: Signalish
/**
* Identifies the element that provides a detailed, extended description for the object.
* @see aria-describedby.
*/
'aria-details'?: Signalish
/**
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
* @see aria-hidden @see aria-readonly.
*/
'aria-disabled'?: Signalish
/**
* Indicates what functions can be performed when a dragged object is released on the drop target.
* @deprecated in ARIA 1.1
*/
'aria-dropeffect'?: Signalish<'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'>
/**
* Identifies the element that provides an error message for the object.
* @see aria-invalid @see aria-describedby.
*/
'aria-errormessage'?: Signalish
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
'aria-expanded'?: Signalish
/**
* Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
* allows assistive technology to override the general default of reading in document source order.
*/
'aria-flowto'?: Signalish
/**
* Indicates an element's "grabbed" state in a drag-and-drop operation.
* @deprecated in ARIA 1.1
*/
'aria-grabbed'?: Signalish
/** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
'aria-haspopup'?: Signalish
/**
* Indicates whether the element is exposed to an accessibility API.
* @see aria-disabled.
*/
'aria-hidden'?: Signalish
/**
* Indicates the entered value does not conform to the format expected by the application.
* @see aria-errormessage.
*/
'aria-invalid'?: Signalish
/** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */
'aria-keyshortcuts'?: Signalish
/**
* Defines a string value that labels the current element.
* @see aria-labelledby.
*/
'aria-label'?: Signalish
/**
* Identifies the element (or elements) that labels the current element.
* @see aria-describedby.
*/
'aria-labelledby'?: Signalish
/** Defines the hierarchical level of an element within a structure. */
'aria-level'?: Signalish
/** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */
'aria-live'?: Signalish<'off' | 'assertive' | 'polite'>
/** Indicates whether an element is modal when displayed. */
'aria-modal'?: Signalish
/** Indicates whether a text box accepts multiple lines of input or only a single line. */
'aria-multiline'?: Signalish
/** Indicates that the user may select more than one item from the current selectable descendants. */
'aria-multiselectable'?: Signalish
/** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
'aria-orientation'?: Signalish<'horizontal' | 'vertical'>
/**
* Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
* between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
* @see aria-controls.
*/
'aria-owns'?: Signalish
/**
* Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
* A hint could be a sample value or a brief description of the expected format.
*/
'aria-placeholder'?: Signalish
/**
* Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
* @see aria-setsize.
*/
'aria-posinset'?: Signalish
/**
* Indicates the current "pressed" state of toggle buttons.
* @see aria-checked @see aria-selected.
*/
'aria-pressed'?: Signalish
/**
* Indicates that the element is not editable, but is otherwise operable.
* @see aria-disabled.
*/
'aria-readonly'?: Signalish
/**
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
* @see aria-atomic.
*/
'aria-relevant'?: Signalish<
| 'additions'
| 'additions removals'
| 'additions text'
| 'all'
| 'removals'
| 'removals additions'
| 'removals text'
| 'text'
| 'text additions'
| 'text removals'
>
/** Indicates that user input is required on the element before a form may be submitted. */
'aria-required'?: Signalish
/** Defines a human-readable, author-localized description for the role of an element. */
'aria-roledescription'?: Signalish
/**
* Defines the total number of rows in a table, grid, or treegrid.
* @see aria-rowindex.
*/
'aria-rowcount'?: Signalish
/**
* Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
* @see aria-rowcount @see aria-rowspan.
*/
'aria-rowindex'?: Signalish
/**
* Defines a human readable text alternative of aria-rowindex.
* @see aria-colindextext.
*/
'aria-rowindextext'?: Signalish
/**
* Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
* @see aria-rowindex @see aria-colspan.
*/
'aria-rowspan'?: Signalish
/**
* Indicates the current "selected" state of various widgets.
* @see aria-checked @see aria-pressed.
*/
'aria-selected'?: Signalish
/**
* Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
* @see aria-posinset.
*/
'aria-setsize'?: Signalish
/** Indicates if items in a table or grid are sorted in ascending or descending order. */
'aria-sort'?: Signalish<'none' | 'ascending' | 'descending' | 'other'>
/** Defines the maximum allowed value for a range widget. */
'aria-valuemax'?: Signalish
/** Defines the minimum allowed value for a range widget. */
'aria-valuemin'?: Signalish
/**
* Defines the current value for a range widget.
* @see aria-valuetext.
*/
'aria-valuenow'?: Signalish
/** Defines the human readable text alternative of aria-valuenow for a range widget. */
'aria-valuetext'?: Signalish
/**
* All the WAI-ARIA 1.2 role attribute values
* @see https://www.w3.org/TR/wai-aria-1.2/#role_definitions
* All the Digital Publishing WAI-ARIA 1.0 role attribute values
* @see https://www.w3.org/TR/dpub-aria-1.0/#role_definitions
*/
role?: Signalish
'prop:ariaActivedescendant'?: Signalish
'prop:ariaAtomic'?: Signalish
'prop:ariaAutocomplete'?: Signalish<'none' | 'inline' | 'list' | 'both'>
'prop:ariaBraillelabel'?: Signalish
'prop:ariaBrailleroledescription'?: Signalish
'prop:ariaBusy'?: Signalish
'prop:ariaChecked'?: Signalish
'prop:ariaColcount'?: Signalish
'prop:ariaColindex'?: Signalish
'prop:ariaColindextext'?: Signalish
'prop:ariaColspan'?: Signalish
'prop:ariaControls'?: Signalish
'prop:ariaCurrent'?: Signalish
'prop:ariaDescribedby'?: Signalish
'prop:ariaDescription'?: Signalish
'prop:ariaDetails'?: Signalish
'prop:ariaDisabled'?: Signalish
'prop:ariaDropeffect'?: Signalish<'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'>
'prop:ariaErrormessage'?: Signalish
'prop:ariaExpanded'?: Signalish
'prop:ariaFlowto'?: Signalish
'prop:ariaGrabbed'?: Signalish
'prop:ariaHaspopup'?: Signalish
'prop:ariaHidden'?: Signalish
'prop:ariaInvalid'?: Signalish
'prop:ariaKeyshortcuts'?: Signalish
'prop:ariaLabel'?: Signalish
'prop:ariaLabelledby'?: Signalish
'prop:ariaLevel'?: Signalish
'prop:ariaLive'?: Signalish<'off' | 'assertive' | 'polite'>
'prop:ariaModal'?: Signalish
'prop:ariaMultiline'?: Signalish
'prop:ariaMultiselectable'?: Signalish
'prop:ariaOrientation'?: Signalish<'horizontal' | 'vertical'>
'prop:ariaOwns'?: Signalish
'prop:ariaPlaceholder'?: Signalish
'prop:ariaPosinset'?: Signalish
'prop:ariaPressed'?: Signalish
'prop:ariaReadonly'?: Signalish
'prop:ariaRelevant'?: Signalish<
| 'additions'
| 'additions removals'
| 'additions text'
| 'all'
| 'removals'
| 'removals additions'
| 'removals text'
| 'text'
| 'text additions'
| 'text removals'
>
'prop:ariaRequired'?: Signalish
'prop:ariaRoledescription'?: Signalish
'prop:ariaRowcount'?: Signalish
'prop:ariaRowindex'?: Signalish
'prop:ariaRowindextext'?: Signalish
'prop:ariaRowspan'?: Signalish
'prop:ariaSelected'?: Signalish
'prop:ariaSetsize'?: Signalish
'prop:ariaSort'?: Signalish<'none' | 'ascending' | 'descending' | 'other'>
'prop:ariaValuemax'?: Signalish
'prop:ariaValuemin'?: Signalish
'prop:ariaValuenow'?: Signalish
'prop:ariaValuetext'?: Signalish
'prop:role'?: Signalish
}
type RoleKey = 'role' | 'prop:role'
interface NoRolePermited {
/** No `role` permitted */
role?: never
'prop:role'?: never
}
declare global {
namespace JSX {
type Element = JSXElement
interface ElementChildrenAttribute { children: {} }
type FC = (props: PropsWithChildren
) => JSXElement | null
type Ref = RefCallback | RefObject
type AnimationEventListener = EventHandler
type ClipboardEventListener = EventHandler
type CompositionEventListener = EventHandler
type DragEventListener = EventHandler
type EventListener = EventHandler
type FocusEventListener = EventHandler
type FormDataEventListener = EventHandler
type InputEventListener = EventHandler
type KeyboardEventListener = EventHandler
type MediaEncryptedEventListener = EventHandler
type MouseEventListener = EventHandler
type PictureInPictureEventListener = EventHandler
type PointerEventListener = EventHandler
type SubmitEventListener = EventHandler
type ToggleEventListener = EventHandler
type TouchEventListener = EventHandler
type TransitionEventListener = EventHandler
type UIEventListener = EventHandler
type WebGLContextEventListener = EventHandler
type WheelEventListener = EventHandler
type CommandEventListener = EventHandler
type ContentVisibilityAutoStateChangeEventListener = EventHandler
type SnapEventListener = EventHandler
interface Attributes extends AriaAttributes {
accessKey?: Signalish
class?: Signalish
/**
* Making document regions editable
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable
*/
contentEditable?: Signalish<'' | 'plaintext-only' | Booleanish>
/**
* This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes
* @deprecated
*/
contextMenu?: Signalish
dir?: Signalish
/**
* This attribute is enumerated and not Boolean. A value of `true` or `false` is mandatory, and shorthand like `
` is forbidden. The correct usage is `
`
* @see https://developer.mozilla.org/en-US/docs/Glossary/Enumerated
*/
draggable?: Signalish<'true' | 'false'>
enterKeyHint?: Signalish<'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'>
hidden?: boolean | Signalish<'hidden' | 'until-found' | ''>
id?: Signalish
inert?: boolean | Signalish<'' | 'inert'>
lang?: Signalish
slot?: Signalish
/**
* This attribute is enumerated and not Boolean. A value of `true` or `false` is mandatory, and shorthand like `` is forbidden. The correct usage is ``
* @see https://developer.mozilla.org/en-US/docs/Glossary/Enumerated
*/
spellcheck?: Signalish<'true' | 'false'>
style?: Signalish
dataset?: DOMStringMap
attributes?: Attr | Attr[]
tabIndex?: Signalish
title?: Signalish
translate?: Signalish<'yes' | 'no'>
// Unknown
radioGroup?: Signalish // ,