From 5bd2b71709a3e8d28a83c193fb70d7363b65dc85 Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Sun, 12 May 2024 17:29:12 +0900 Subject: [PATCH] don't put `JSX` on `global` --- deno_dist/jsx/base.ts | 19 +- deno_dist/jsx/dom/index.ts | 3 +- deno_dist/jsx/hooks/index.ts | 1 + deno_dist/jsx/intrinsic-elements.ts | 1328 ++++++++++---------- deno_dist/jsx/jsx-dev-runtime.ts | 1 + deno_dist/jsx/jsx-runtime.ts | 1 + deno_dist/jsx/types.ts | 1 + src/helper/css/common.case.test.tsx | 3 +- src/helper/css/index.test.tsx | 4 +- src/helper/ssg/ssg.test.tsx | 3 +- src/jsx/base.ts | 19 +- src/jsx/components.test.tsx | 3 +- src/jsx/dom/components.test.tsx | 3 +- src/jsx/dom/context.test.tsx | 3 +- src/jsx/dom/css.test.tsx | 2 +- src/jsx/dom/index.test.tsx | 4 +- src/jsx/dom/index.ts | 3 +- src/jsx/hooks/dom.test.tsx | 3 +- src/jsx/hooks/index.ts | 1 + src/jsx/hooks/string.test.tsx | 4 +- src/jsx/index.test.tsx | 4 +- src/jsx/intrinsic-elements.ts | 1328 ++++++++++---------- src/jsx/jsx-dev-runtime.ts | 1 + src/jsx/jsx-runtime.ts | 1 + src/jsx/streaming.test.tsx | 3 +- src/jsx/types.ts | 1 + src/middleware/jsx-renderer/index.test.tsx | 3 +- vitest.config.ts | 4 + 28 files changed, 1377 insertions(+), 1377 deletions(-) diff --git a/deno_dist/jsx/base.ts b/deno_dist/jsx/base.ts index 01afff680..a2a31b379 100644 --- a/deno_dist/jsx/base.ts +++ b/deno_dist/jsx/base.ts @@ -4,6 +4,7 @@ import type { StringBuffer, HtmlEscaped, HtmlEscapedString } from '../utils/html import type { Context } from './context.ts' import { globalContexts } from './context.ts' import type { IntrinsicElements as IntrinsicElementsDefined } from './intrinsic-elements.ts' +import type { Hono } from './intrinsic-elements.ts' import { normalizeIntrinsicElementProps, styleObjectForEach } from './utils.ts' // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -15,16 +16,14 @@ export type FC

= { } export type DOMAttributes = Hono.HTMLAttributes -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace JSX { - type Element = HtmlEscapedString | Promise - interface ElementChildrenAttribute { - children: Child - } - interface IntrinsicElements extends IntrinsicElementsDefined { - [tagName: string]: Props - } +// eslint-disable-next-line @typescript-eslint/no-namespace +export namespace JSX { + export type Element = HtmlEscapedString | Promise + export interface ElementChildrenAttribute { + children: Child + } + export interface IntrinsicElements extends IntrinsicElementsDefined { + [tagName: string]: Props } } diff --git a/deno_dist/jsx/dom/index.ts b/deno_dist/jsx/dom/index.ts index 05a829486..5a0f9f3f9 100644 --- a/deno_dist/jsx/dom/index.ts +++ b/deno_dist/jsx/dom/index.ts @@ -1,5 +1,6 @@ -import type { Props, Child, DOMAttributes, JSXNode } from '../base.ts' import { memo, isValidElement } from '../base.ts' +import type { Props, Child, DOMAttributes, JSXNode } from '../base.ts' +import type { JSX } from '../base.ts' import { Children } from '../children.ts' import { useContext } from '../context.ts' import { diff --git a/deno_dist/jsx/hooks/index.ts b/deno_dist/jsx/hooks/index.ts index 93e63b22e..6cece8317 100644 --- a/deno_dist/jsx/hooks/index.ts +++ b/deno_dist/jsx/hooks/index.ts @@ -1,3 +1,4 @@ +import type { JSX } from '../base.ts' import { DOM_STASH } from '../constants.ts' import { buildDataStack, update, build } from '../dom/render.ts' import type { Node, NodeObject, Context, PendingType, UpdateHook } from '../dom/render.ts' diff --git a/deno_dist/jsx/intrinsic-elements.ts b/deno_dist/jsx/intrinsic-elements.ts index 0d3b01525..67caba334 100644 --- a/deno_dist/jsx/intrinsic-elements.ts +++ b/deno_dist/jsx/intrinsic-elements.ts @@ -7,724 +7,722 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. */ -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace Hono { - type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined - type CSSProperties = {} - type AnyAttributes = { [attributeName: string]: any } - - interface JSXAttributes { - dangerouslySetInnerHTML?: { - __html: string - } - } +// eslint-disable-next-line @typescript-eslint/no-namespace +export namespace Hono { + export type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined + export type CSSProperties = {} + type AnyAttributes = { [attributeName: string]: any } - interface EventAttributes { - onScroll?: (event: Event) => void - onScrollCapture?: (event: Event) => void - onScrollEnd?: (event: Event) => void - onScrollEndCapture?: (event: Event) => void - onWheel?: (event: WheelEvent) => void - onWheelCapture?: (event: WheelEvent) => void - onAnimationCancel?: (event: AnimationEvent) => void - onAnimationCancelCapture?: (event: AnimationEvent) => void - onAnimationEnd?: (event: AnimationEvent) => void - onAnimationEndCapture?: (event: AnimationEvent) => void - onAnimationIteration?: (event: AnimationEvent) => void - onAnimationIterationCapture?: (event: AnimationEvent) => void - onAnimationStart?: (event: AnimationEvent) => void - onAnimationStartCapture?: (event: AnimationEvent) => void - onCopy?: (event: ClipboardEvent) => void - onCopyCapture?: (event: ClipboardEvent) => void - onCut?: (event: ClipboardEvent) => void - onCutCapture?: (event: ClipboardEvent) => void - onPaste?: (event: ClipboardEvent) => void - onPasteCapture?: (event: ClipboardEvent) => void - onCompositionEnd?: (event: CompositionEvent) => void - onCompositionEndCapture?: (event: CompositionEvent) => void - onCompositionStart?: (event: CompositionEvent) => void - onCompositionStartCapture?: (event: CompositionEvent) => void - onCompositionUpdate?: (event: CompositionEvent) => void - onCompositionUpdateCapture?: (event: CompositionEvent) => void - onBlur?: (event: FocusEvent) => void - onBlurCapture?: (event: FocusEvent) => void - onFocus?: (event: FocusEvent) => void - onFocusCapture?: (event: FocusEvent) => void - onFocusIn?: (event: FocusEvent) => void - onFocusInCapture?: (event: FocusEvent) => void - onFocusOut?: (event: FocusEvent) => void - onFocusOutCapture?: (event: FocusEvent) => void - onFullscreenChange?: (event: Event) => void - onFullscreenChangeCapture?: (event: Event) => void - onFullscreenError?: (event: Event) => void - onFullscreenErrorCapture?: (event: Event) => void - onKeyDown?: (event: KeyboardEvent) => void - onKeyDownCapture?: (event: KeyboardEvent) => void - onKeyPress?: (event: KeyboardEvent) => void - onKeyPressCapture?: (event: KeyboardEvent) => void - onKeyUp?: (event: KeyboardEvent) => void - onKeyUpCapture?: (event: KeyboardEvent) => void - onAuxClick?: (event: MouseEvent) => void - onAuxClickCapture?: (event: MouseEvent) => void - onClick?: (event: MouseEvent) => void - onClickCapture?: (event: MouseEvent) => void - onContextMenu?: (event: MouseEvent) => void - onContextMenuCapture?: (event: MouseEvent) => void - onDoubleClick?: (event: MouseEvent) => void - onDoubleClickCapture?: (event: MouseEvent) => void - onMouseDown?: (event: MouseEvent) => void - onMouseDownCapture?: (event: MouseEvent) => void - onMouseEnter?: (event: MouseEvent) => void - onMouseEnterCapture?: (event: MouseEvent) => void - onMouseLeave?: (event: MouseEvent) => void - onMouseLeaveCapture?: (event: MouseEvent) => void - onMouseMove?: (event: MouseEvent) => void - onMouseMoveCapture?: (event: MouseEvent) => void - onMouseOut?: (event: MouseEvent) => void - onMouseOutCapture?: (event: MouseEvent) => void - onMouseOver?: (event: MouseEvent) => void - onMouseOverCapture?: (event: MouseEvent) => void - onMouseUp?: (event: MouseEvent) => void - onMouseUpCapture?: (event: MouseEvent) => void - onMouseWheel?: (event: WheelEvent) => void - onMouseWheelCapture?: (event: WheelEvent) => void - onGotPointerCapture?: (event: PointerEvent) => void - onGotPointerCaptureCapture?: (event: PointerEvent) => void - onLostPointerCapture?: (event: PointerEvent) => void - onLostPointerCaptureCapture?: (event: PointerEvent) => void - onPointerCancel?: (event: PointerEvent) => void - onPointerCancelCapture?: (event: PointerEvent) => void - onPointerDown?: (event: PointerEvent) => void - onPointerDownCapture?: (event: PointerEvent) => void - onPointerEnter?: (event: PointerEvent) => void - onPointerEnterCapture?: (event: PointerEvent) => void - onPointerLeave?: (event: PointerEvent) => void - onPointerLeaveCapture?: (event: PointerEvent) => void - onPointerMove?: (event: PointerEvent) => void - onPointerMoveCapture?: (event: PointerEvent) => void - onPointerOut?: (event: PointerEvent) => void - onPointerOutCapture?: (event: PointerEvent) => void - onPointerOver?: (event: PointerEvent) => void - onPointerOverCapture?: (event: PointerEvent) => void - onPointerUp?: (event: PointerEvent) => void - onPointerUpCapture?: (event: PointerEvent) => void - onTouchCancel?: (event: TouchEvent) => void - onTouchCancelCapture?: (event: TouchEvent) => void - onTouchEnd?: (event: TouchEvent) => void - onTouchEndCapture?: (event: TouchEvent) => void - onTouchMove?: (event: TouchEvent) => void - onTouchMoveCapture?: (event: TouchEvent) => void - onTouchStart?: (event: TouchEvent) => void - onTouchStartCapture?: (event: TouchEvent) => void - onTransitionCancel?: (event: TransitionEvent) => void - onTransitionCancelCapture?: (event: TransitionEvent) => void - onTransitionEnd?: (event: TransitionEvent) => void - onTransitionEndCapture?: (event: TransitionEvent) => void - onTransitionRun?: (event: TransitionEvent) => void - onTransitionRunCapture?: (event: TransitionEvent) => void - onTransitionStart?: (event: TransitionEvent) => void - onTransitionStartCapture?: (event: TransitionEvent) => void - onFormData?: (event: FormDataEvent) => void - onFormDataCapture?: (event: FormDataEvent) => void - onReset?: (event: Event) => void - onResetCapture?: (event: Event) => void - onSubmit?: (event: Event) => void - onSubmitCapture?: (event: Event) => void - onInvalid?: (event: Event) => void - onInvalidCapture?: (event: Event) => void - onSelect?: (event: Event) => void - onSelectCapture?: (event: Event) => void - onSelectChange?: (event: Event) => void - onSelectChangeCapture?: (event: Event) => void - onInput?: (event: InputEvent) => void - onInputCapture?: (event: InputEvent) => void - onBeforeInput?: (event: InputEvent) => void - onBeforeInputCapture?: (event: InputEvent) => void - onChange?: (event: Event) => void - onChangeCapture?: (event: Event) => void + interface JSXAttributes { + dangerouslySetInnerHTML?: { + __html: string } + } - interface HTMLAttributes extends JSXAttributes, EventAttributes, AnyAttributes { - accesskey?: string | undefined - autofocus?: boolean | undefined - class?: string | Promise | undefined - contenteditable?: boolean | 'inherit' | undefined - contextmenu?: string | undefined - dir?: string | undefined - draggable?: boolean | undefined - hidden?: boolean | undefined - id?: string | undefined - lang?: string | undefined - nonce?: string | undefined - placeholder?: string | undefined - slot?: string | undefined - spellcheck?: boolean | undefined - style?: CSSProperties | undefined - tabindex?: number | undefined - title?: string | undefined - translate?: 'yes' | 'no' | undefined - } + interface EventAttributes { + onScroll?: (event: Event) => void + onScrollCapture?: (event: Event) => void + onScrollEnd?: (event: Event) => void + onScrollEndCapture?: (event: Event) => void + onWheel?: (event: WheelEvent) => void + onWheelCapture?: (event: WheelEvent) => void + onAnimationCancel?: (event: AnimationEvent) => void + onAnimationCancelCapture?: (event: AnimationEvent) => void + onAnimationEnd?: (event: AnimationEvent) => void + onAnimationEndCapture?: (event: AnimationEvent) => void + onAnimationIteration?: (event: AnimationEvent) => void + onAnimationIterationCapture?: (event: AnimationEvent) => void + onAnimationStart?: (event: AnimationEvent) => void + onAnimationStartCapture?: (event: AnimationEvent) => void + onCopy?: (event: ClipboardEvent) => void + onCopyCapture?: (event: ClipboardEvent) => void + onCut?: (event: ClipboardEvent) => void + onCutCapture?: (event: ClipboardEvent) => void + onPaste?: (event: ClipboardEvent) => void + onPasteCapture?: (event: ClipboardEvent) => void + onCompositionEnd?: (event: CompositionEvent) => void + onCompositionEndCapture?: (event: CompositionEvent) => void + onCompositionStart?: (event: CompositionEvent) => void + onCompositionStartCapture?: (event: CompositionEvent) => void + onCompositionUpdate?: (event: CompositionEvent) => void + onCompositionUpdateCapture?: (event: CompositionEvent) => void + onBlur?: (event: FocusEvent) => void + onBlurCapture?: (event: FocusEvent) => void + onFocus?: (event: FocusEvent) => void + onFocusCapture?: (event: FocusEvent) => void + onFocusIn?: (event: FocusEvent) => void + onFocusInCapture?: (event: FocusEvent) => void + onFocusOut?: (event: FocusEvent) => void + onFocusOutCapture?: (event: FocusEvent) => void + onFullscreenChange?: (event: Event) => void + onFullscreenChangeCapture?: (event: Event) => void + onFullscreenError?: (event: Event) => void + onFullscreenErrorCapture?: (event: Event) => void + onKeyDown?: (event: KeyboardEvent) => void + onKeyDownCapture?: (event: KeyboardEvent) => void + onKeyPress?: (event: KeyboardEvent) => void + onKeyPressCapture?: (event: KeyboardEvent) => void + onKeyUp?: (event: KeyboardEvent) => void + onKeyUpCapture?: (event: KeyboardEvent) => void + onAuxClick?: (event: MouseEvent) => void + onAuxClickCapture?: (event: MouseEvent) => void + onClick?: (event: MouseEvent) => void + onClickCapture?: (event: MouseEvent) => void + onContextMenu?: (event: MouseEvent) => void + onContextMenuCapture?: (event: MouseEvent) => void + onDoubleClick?: (event: MouseEvent) => void + onDoubleClickCapture?: (event: MouseEvent) => void + onMouseDown?: (event: MouseEvent) => void + onMouseDownCapture?: (event: MouseEvent) => void + onMouseEnter?: (event: MouseEvent) => void + onMouseEnterCapture?: (event: MouseEvent) => void + onMouseLeave?: (event: MouseEvent) => void + onMouseLeaveCapture?: (event: MouseEvent) => void + onMouseMove?: (event: MouseEvent) => void + onMouseMoveCapture?: (event: MouseEvent) => void + onMouseOut?: (event: MouseEvent) => void + onMouseOutCapture?: (event: MouseEvent) => void + onMouseOver?: (event: MouseEvent) => void + onMouseOverCapture?: (event: MouseEvent) => void + onMouseUp?: (event: MouseEvent) => void + onMouseUpCapture?: (event: MouseEvent) => void + onMouseWheel?: (event: WheelEvent) => void + onMouseWheelCapture?: (event: WheelEvent) => void + onGotPointerCapture?: (event: PointerEvent) => void + onGotPointerCaptureCapture?: (event: PointerEvent) => void + onLostPointerCapture?: (event: PointerEvent) => void + onLostPointerCaptureCapture?: (event: PointerEvent) => void + onPointerCancel?: (event: PointerEvent) => void + onPointerCancelCapture?: (event: PointerEvent) => void + onPointerDown?: (event: PointerEvent) => void + onPointerDownCapture?: (event: PointerEvent) => void + onPointerEnter?: (event: PointerEvent) => void + onPointerEnterCapture?: (event: PointerEvent) => void + onPointerLeave?: (event: PointerEvent) => void + onPointerLeaveCapture?: (event: PointerEvent) => void + onPointerMove?: (event: PointerEvent) => void + onPointerMoveCapture?: (event: PointerEvent) => void + onPointerOut?: (event: PointerEvent) => void + onPointerOutCapture?: (event: PointerEvent) => void + onPointerOver?: (event: PointerEvent) => void + onPointerOverCapture?: (event: PointerEvent) => void + onPointerUp?: (event: PointerEvent) => void + onPointerUpCapture?: (event: PointerEvent) => void + onTouchCancel?: (event: TouchEvent) => void + onTouchCancelCapture?: (event: TouchEvent) => void + onTouchEnd?: (event: TouchEvent) => void + onTouchEndCapture?: (event: TouchEvent) => void + onTouchMove?: (event: TouchEvent) => void + onTouchMoveCapture?: (event: TouchEvent) => void + onTouchStart?: (event: TouchEvent) => void + onTouchStartCapture?: (event: TouchEvent) => void + onTransitionCancel?: (event: TransitionEvent) => void + onTransitionCancelCapture?: (event: TransitionEvent) => void + onTransitionEnd?: (event: TransitionEvent) => void + onTransitionEndCapture?: (event: TransitionEvent) => void + onTransitionRun?: (event: TransitionEvent) => void + onTransitionRunCapture?: (event: TransitionEvent) => void + onTransitionStart?: (event: TransitionEvent) => void + onTransitionStartCapture?: (event: TransitionEvent) => void + onFormData?: (event: FormDataEvent) => void + onFormDataCapture?: (event: FormDataEvent) => void + onReset?: (event: Event) => void + onResetCapture?: (event: Event) => void + onSubmit?: (event: Event) => void + onSubmitCapture?: (event: Event) => void + onInvalid?: (event: Event) => void + onInvalidCapture?: (event: Event) => void + onSelect?: (event: Event) => void + onSelectCapture?: (event: Event) => void + onSelectChange?: (event: Event) => void + onSelectChangeCapture?: (event: Event) => void + onInput?: (event: InputEvent) => void + onInputCapture?: (event: InputEvent) => void + onBeforeInput?: (event: InputEvent) => void + onBeforeInputCapture?: (event: InputEvent) => void + onChange?: (event: Event) => void + onChangeCapture?: (event: Event) => void + } - type HTMLAttributeReferrerPolicy = - | '' - | 'no-referrer' - | 'no-referrer-when-downgrade' - | 'origin' - | 'origin-when-cross-origin' - | 'same-origin' - | 'strict-origin' - | 'strict-origin-when-cross-origin' - | 'unsafe-url' - - type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | string - - interface AnchorHTMLAttributes extends HTMLAttributes { - download?: any - href?: string | undefined - hreflang?: string | undefined - media?: string | undefined - ping?: string | undefined - target?: HTMLAttributeAnchorTarget | undefined - type?: string | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - } + export interface HTMLAttributes extends JSXAttributes, EventAttributes, AnyAttributes { + accesskey?: string | undefined + autofocus?: boolean | undefined + class?: string | Promise | undefined + contenteditable?: boolean | 'inherit' | undefined + contextmenu?: string | undefined + dir?: string | undefined + draggable?: boolean | undefined + hidden?: boolean | undefined + id?: string | undefined + lang?: string | undefined + nonce?: string | undefined + placeholder?: string | undefined + slot?: string | undefined + spellcheck?: boolean | undefined + style?: CSSProperties | undefined + tabindex?: number | undefined + title?: string | undefined + translate?: 'yes' | 'no' | undefined + } - interface AudioHTMLAttributes extends MediaHTMLAttributes {} - - interface AreaHTMLAttributes extends HTMLAttributes { - alt?: string | undefined - coords?: string | undefined - download?: any - href?: string | undefined - hreflang?: string | undefined - media?: string | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - shape?: string | undefined - target?: string | undefined - } + type HTMLAttributeReferrerPolicy = + | '' + | 'no-referrer' + | 'no-referrer-when-downgrade' + | 'origin' + | 'origin-when-cross-origin' + | 'same-origin' + | 'strict-origin' + | 'strict-origin-when-cross-origin' + | 'unsafe-url' + + type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | string + + interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any + href?: string | undefined + hreflang?: string | undefined + media?: string | undefined + ping?: string | undefined + target?: HTMLAttributeAnchorTarget | undefined + type?: string | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + } - interface BaseHTMLAttributes extends HTMLAttributes { - href?: string | undefined - target?: string | undefined - } + interface AudioHTMLAttributes extends MediaHTMLAttributes {} + + interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string | undefined + coords?: string | undefined + download?: any + href?: string | undefined + hreflang?: string | undefined + media?: string | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + shape?: string | undefined + target?: string | undefined + } - interface BlockquoteHTMLAttributes extends HTMLAttributes { - cite?: string | undefined - } + interface BaseHTMLAttributes extends HTMLAttributes { + href?: string | undefined + target?: string | undefined + } - interface ButtonHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined - form?: string | undefined - formenctype?: string | undefined - formmethod?: string | undefined - formnovalidate?: boolean | undefined - formtarget?: string | undefined - name?: string | undefined - type?: 'submit' | 'reset' | 'button' | undefined - value?: string | ReadonlyArray | number | undefined - } + interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined + } - interface CanvasHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined - width?: number | string | undefined - } + interface ButtonHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined + form?: string | undefined + formenctype?: string | undefined + formmethod?: string | undefined + formnovalidate?: boolean | undefined + formtarget?: string | undefined + name?: string | undefined + type?: 'submit' | 'reset' | 'button' | undefined + value?: string | ReadonlyArray | number | undefined + } - interface ColHTMLAttributes extends HTMLAttributes { - span?: number | undefined - width?: number | string | undefined - } + interface CanvasHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined + width?: number | string | undefined + } - interface ColgroupHTMLAttributes extends HTMLAttributes { - span?: number | undefined - } + interface ColHTMLAttributes extends HTMLAttributes { + span?: number | undefined + width?: number | string | undefined + } - interface DataHTMLAttributes extends HTMLAttributes { - value?: string | ReadonlyArray | number | undefined - } + interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: number | undefined + } - interface DetailsHTMLAttributes extends HTMLAttributes { - open?: boolean | undefined - } + interface DataHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined + } - interface DelHTMLAttributes extends HTMLAttributes { - cite?: string | undefined - dateTime?: string | undefined - } + interface DetailsHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined + } - interface DialogHTMLAttributes extends HTMLAttributes { - open?: boolean | undefined - } + interface DelHTMLAttributes extends HTMLAttributes { + cite?: string | undefined + dateTime?: string | undefined + } - interface EmbedHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined - src?: string | undefined - type?: string | undefined - width?: number | string | undefined - } + interface DialogHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined + } - interface FieldsetHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined - form?: string | undefined - name?: string | undefined - } + interface EmbedHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined + src?: string | undefined + type?: string | undefined + width?: number | string | undefined + } - interface FormHTMLAttributes extends HTMLAttributes { - 'accept-charset'?: string | undefined - autocomplete?: string | undefined - enctype?: string | undefined - method?: string | undefined - name?: string | undefined - novalidate?: boolean | undefined - target?: string | undefined - } + interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined + form?: string | undefined + name?: string | undefined + } - interface HtmlHTMLAttributes extends HTMLAttributes { - manifest?: string | undefined - } + interface FormHTMLAttributes extends HTMLAttributes { + 'accept-charset'?: string | undefined + autocomplete?: string | undefined + enctype?: string | undefined + method?: string | undefined + name?: string | undefined + novalidate?: boolean | undefined + target?: string | undefined + } - interface IframeHTMLAttributes extends HTMLAttributes { - allow?: string | undefined - allowfullscreen?: boolean | undefined - height?: number | string | undefined - loading?: 'eager' | 'lazy' | undefined - name?: string | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - sandbox?: string | undefined - seamless?: boolean | undefined - src?: string | undefined - srcdoc?: string | undefined - width?: number | string | undefined - } + interface HtmlHTMLAttributes extends HTMLAttributes { + manifest?: string | undefined + } - interface ImgHTMLAttributes extends HTMLAttributes { - alt?: string | undefined - crossorigin?: CrossOrigin - decoding?: 'async' | 'auto' | 'sync' | undefined - height?: number | string | undefined - loading?: 'eager' | 'lazy' | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - sizes?: string | undefined - src?: string | undefined - srcset?: string | undefined - usemap?: string | undefined - width?: number | string | undefined - } + interface IframeHTMLAttributes extends HTMLAttributes { + allow?: string | undefined + allowfullscreen?: boolean | undefined + height?: number | string | undefined + loading?: 'eager' | 'lazy' | undefined + name?: string | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + sandbox?: string | undefined + seamless?: boolean | undefined + src?: string | undefined + srcdoc?: string | undefined + width?: number | string | undefined + } - interface InsHTMLAttributes extends HTMLAttributes { - cite?: string | undefined - datetime?: string | undefined - } + interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string | undefined + crossorigin?: CrossOrigin + decoding?: 'async' | 'auto' | 'sync' | undefined + height?: number | string | undefined + loading?: 'eager' | 'lazy' | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + sizes?: string | undefined + src?: string | undefined + srcset?: string | undefined + usemap?: string | undefined + width?: number | string | undefined + } - type HTMLInputTypeAttribute = - | 'button' - | 'checkbox' - | 'color' - | 'date' - | 'datetime-local' - | 'email' - | 'file' - | 'hidden' - | 'image' - | 'month' - | 'number' - | 'password' - | 'radio' - | 'range' - | 'reset' - | 'search' - | 'submit' - | 'tel' - | 'text' - | 'time' - | 'url' - | 'week' - | string - - interface InputHTMLAttributes extends HTMLAttributes { - accept?: string | undefined - alt?: string | undefined - autocomplete?: string | undefined - capture?: boolean | 'user' | 'environment' | undefined // https://www.w3.org/TR/html-media-capture/#the-capture-attribute - checked?: boolean | undefined - disabled?: boolean | undefined - enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined - form?: string | undefined - formenctype?: string | undefined - formmethod?: string | undefined - formnovalidate?: boolean | undefined - formtarget?: string | undefined - height?: number | string | undefined - list?: string | undefined - max?: number | string | undefined - maxlength?: number | undefined - min?: number | string | undefined - minlength?: number | undefined - multiple?: boolean | undefined - name?: string | undefined - pattern?: string | undefined - placeholder?: string | undefined - readonly?: boolean | undefined - required?: boolean | undefined - size?: number | undefined - src?: string | undefined - step?: number | string | undefined - type?: HTMLInputTypeAttribute | undefined - value?: string | ReadonlyArray | number | undefined - width?: number | string | undefined - } + interface InsHTMLAttributes extends HTMLAttributes { + cite?: string | undefined + datetime?: string | undefined + } - interface KeygenHTMLAttributes extends HTMLAttributes { - challenge?: string | undefined - disabled?: boolean | undefined - form?: string | undefined - keytype?: string | undefined - name?: string | undefined - } + type HTMLInputTypeAttribute = + | 'button' + | 'checkbox' + | 'color' + | 'date' + | 'datetime-local' + | 'email' + | 'file' + | 'hidden' + | 'image' + | 'month' + | 'number' + | 'password' + | 'radio' + | 'range' + | 'reset' + | 'search' + | 'submit' + | 'tel' + | 'text' + | 'time' + | 'url' + | 'week' + | string + + interface InputHTMLAttributes extends HTMLAttributes { + accept?: string | undefined + alt?: string | undefined + autocomplete?: string | undefined + capture?: boolean | 'user' | 'environment' | undefined // https://www.w3.org/TR/html-media-capture/#the-capture-attribute + checked?: boolean | undefined + disabled?: boolean | undefined + enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined + form?: string | undefined + formenctype?: string | undefined + formmethod?: string | undefined + formnovalidate?: boolean | undefined + formtarget?: string | undefined + height?: number | string | undefined + list?: string | undefined + max?: number | string | undefined + maxlength?: number | undefined + min?: number | string | undefined + minlength?: number | undefined + multiple?: boolean | undefined + name?: string | undefined + pattern?: string | undefined + placeholder?: string | undefined + readonly?: boolean | undefined + required?: boolean | undefined + size?: number | undefined + src?: string | undefined + step?: number | string | undefined + type?: HTMLInputTypeAttribute | undefined + value?: string | ReadonlyArray | number | undefined + width?: number | string | undefined + } - interface LabelHTMLAttributes extends HTMLAttributes { - form?: string | undefined - for?: string | undefined - } + interface KeygenHTMLAttributes extends HTMLAttributes { + challenge?: string | undefined + disabled?: boolean | undefined + form?: string | undefined + keytype?: string | undefined + name?: string | undefined + } - interface LiHTMLAttributes extends HTMLAttributes { - value?: string | ReadonlyArray | number | undefined - } + interface LabelHTMLAttributes extends HTMLAttributes { + form?: string | undefined + for?: string | undefined + } - interface LinkHTMLAttributes extends HTMLAttributes { - as?: string | undefined - crossorigin?: CrossOrigin - href?: string | undefined - hreflang?: string | undefined - integrity?: string | undefined - media?: string | undefined - imagesrcset?: string | undefined - imagesizes?: string | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - sizes?: string | undefined - type?: string | undefined - charSet?: string | undefined - } + interface LiHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined + } - interface MapHTMLAttributes extends HTMLAttributes { - name?: string | undefined - } + interface LinkHTMLAttributes extends HTMLAttributes { + as?: string | undefined + crossorigin?: CrossOrigin + href?: string | undefined + hreflang?: string | undefined + integrity?: string | undefined + media?: string | undefined + imagesrcset?: string | undefined + imagesizes?: string | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + sizes?: string | undefined + type?: string | undefined + charSet?: string | undefined + } - interface MenuHTMLAttributes extends HTMLAttributes { - type?: string | undefined - } + interface MapHTMLAttributes extends HTMLAttributes { + name?: string | undefined + } - interface MediaHTMLAttributes extends HTMLAttributes { - autoplay?: boolean | undefined - controls?: boolean | undefined - controlslist?: string | undefined - crossorigin?: CrossOrigin - loop?: boolean | undefined - mediagroup?: string | undefined - muted?: boolean | undefined - playsinline?: boolean | undefined - preload?: string | undefined - src?: string | undefined - } + interface MenuHTMLAttributes extends HTMLAttributes { + type?: string | undefined + } - interface MetaHTMLAttributes extends HTMLAttributes { - charset?: string | undefined - 'http-equiv'?: string | undefined - name?: string | undefined - media?: string | undefined - content?: string | undefined - } + interface MediaHTMLAttributes extends HTMLAttributes { + autoplay?: boolean | undefined + controls?: boolean | undefined + controlslist?: string | undefined + crossorigin?: CrossOrigin + loop?: boolean | undefined + mediagroup?: string | undefined + muted?: boolean | undefined + playsinline?: boolean | undefined + preload?: string | undefined + src?: string | undefined + } - interface MeterHTMLAttributes extends HTMLAttributes { - form?: string | undefined - high?: number | undefined - low?: number | undefined - max?: number | string | undefined - min?: number | string | undefined - optimum?: number | undefined - value?: string | ReadonlyArray | number | undefined - } + interface MetaHTMLAttributes extends HTMLAttributes { + charset?: string | undefined + 'http-equiv'?: string | undefined + name?: string | undefined + media?: string | undefined + content?: string | undefined + } - interface QuoteHTMLAttributes extends HTMLAttributes { - cite?: string | undefined - } + interface MeterHTMLAttributes extends HTMLAttributes { + form?: string | undefined + high?: number | undefined + low?: number | undefined + max?: number | string | undefined + min?: number | string | undefined + optimum?: number | undefined + value?: string | ReadonlyArray | number | undefined + } - interface ObjectHTMLAttributes extends HTMLAttributes { - data?: string | undefined - form?: string | undefined - height?: number | string | undefined - name?: string | undefined - type?: string | undefined - usemap?: string | undefined - width?: number | string | undefined - } + interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined + } - interface OlHTMLAttributes extends HTMLAttributes { - reversed?: boolean | undefined - start?: number | undefined - type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined - } + interface ObjectHTMLAttributes extends HTMLAttributes { + data?: string | undefined + form?: string | undefined + height?: number | string | undefined + name?: string | undefined + type?: string | undefined + usemap?: string | undefined + width?: number | string | undefined + } - interface OptgroupHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined - label?: string | undefined - } + interface OlHTMLAttributes extends HTMLAttributes { + reversed?: boolean | undefined + start?: number | undefined + type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined + } - interface OptionHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined - label?: string | undefined - selected?: boolean | undefined - value?: string | ReadonlyArray | number | undefined - } + interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined + label?: string | undefined + } - interface OutputHTMLAttributes extends HTMLAttributes { - form?: string | undefined - for?: string | undefined - name?: string | undefined - } + interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined + label?: string | undefined + selected?: boolean | undefined + value?: string | ReadonlyArray | number | undefined + } - interface ParamHTMLAttributes extends HTMLAttributes { - name?: string | undefined - value?: string | ReadonlyArray | number | undefined - } + interface OutputHTMLAttributes extends HTMLAttributes { + form?: string | undefined + for?: string | undefined + name?: string | undefined + } - interface ProgressHTMLAttributes extends HTMLAttributes { - max?: number | string | undefined - value?: string | ReadonlyArray | number | undefined - } + interface ParamHTMLAttributes extends HTMLAttributes { + name?: string | undefined + value?: string | ReadonlyArray | number | undefined + } - interface SlotHTMLAttributes extends HTMLAttributes { - name?: string | undefined - } + interface ProgressHTMLAttributes extends HTMLAttributes { + max?: number | string | undefined + value?: string | ReadonlyArray | number | undefined + } - interface ScriptHTMLAttributes extends HTMLAttributes { - async?: boolean | undefined - crossorigin?: CrossOrigin - defer?: boolean | undefined - integrity?: string | undefined - nomodule?: boolean | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - src?: string | undefined - type?: string | undefined - } + interface SlotHTMLAttributes extends HTMLAttributes { + name?: string | undefined + } - interface SelectHTMLAttributes extends HTMLAttributes { - autocomplete?: string | undefined - disabled?: boolean | undefined - form?: string | undefined - multiple?: boolean | undefined - name?: string | undefined - required?: boolean | undefined - size?: number | undefined - value?: string | ReadonlyArray | number | undefined - } + interface ScriptHTMLAttributes extends HTMLAttributes { + async?: boolean | undefined + crossorigin?: CrossOrigin + defer?: boolean | undefined + integrity?: string | undefined + nomodule?: boolean | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + src?: string | undefined + type?: string | undefined + } - interface SourceHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined - media?: string | undefined - sizes?: string | undefined - src?: string | undefined - srcset?: string | undefined - type?: string | undefined - width?: number | string | undefined - } + interface SelectHTMLAttributes extends HTMLAttributes { + autocomplete?: string | undefined + disabled?: boolean | undefined + form?: string | undefined + multiple?: boolean | undefined + name?: string | undefined + required?: boolean | undefined + size?: number | undefined + value?: string | ReadonlyArray | number | undefined + } - interface StyleHTMLAttributes extends HTMLAttributes { - media?: string | undefined - scoped?: boolean | undefined - type?: string | undefined - } + interface SourceHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined + media?: string | undefined + sizes?: string | undefined + src?: string | undefined + srcset?: string | undefined + type?: string | undefined + width?: number | string | undefined + } - interface TableHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | undefined - bgcolor?: string | undefined - border?: number | undefined - cellpadding?: number | string | undefined - cellspacing?: number | string | undefined - frame?: boolean | undefined - rules?: 'none' | 'groups' | 'rows' | 'columns' | 'all' | undefined - summary?: string | undefined - width?: number | string | undefined - } + interface StyleHTMLAttributes extends HTMLAttributes { + media?: string | undefined + scoped?: boolean | undefined + type?: string | undefined + } - interface TextareaHTMLAttributes extends HTMLAttributes { - autocomplete?: string | undefined - cols?: number | undefined - dirname?: string | undefined - disabled?: boolean | undefined - form?: string | undefined - maxlength?: number | undefined - minlength?: number | undefined - name?: string | undefined - placeholder?: string | undefined - readonly?: boolean | undefined - required?: boolean | undefined - rows?: number | undefined - value?: string | ReadonlyArray | number | undefined - wrap?: string | undefined - } + interface TableHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | undefined + bgcolor?: string | undefined + border?: number | undefined + cellpadding?: number | string | undefined + cellspacing?: number | string | undefined + frame?: boolean | undefined + rules?: 'none' | 'groups' | 'rows' | 'columns' | 'all' | undefined + summary?: string | undefined + width?: number | string | undefined + } - interface TdHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined - colspan?: number | undefined - headers?: string | undefined - rowspan?: number | undefined - scope?: string | undefined - abbr?: string | undefined - height?: number | string | undefined - width?: number | string | undefined - valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined - } + interface TextareaHTMLAttributes extends HTMLAttributes { + autocomplete?: string | undefined + cols?: number | undefined + dirname?: string | undefined + disabled?: boolean | undefined + form?: string | undefined + maxlength?: number | undefined + minlength?: number | undefined + name?: string | undefined + placeholder?: string | undefined + readonly?: boolean | undefined + required?: boolean | undefined + rows?: number | undefined + value?: string | ReadonlyArray | number | undefined + wrap?: string | undefined + } - interface ThHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined - colspan?: number | undefined - headers?: string | undefined - rowspan?: number | undefined - scope?: string | undefined - abbr?: string | undefined - } + interface TdHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined + colspan?: number | undefined + headers?: string | undefined + rowspan?: number | undefined + scope?: string | undefined + abbr?: string | undefined + height?: number | string | undefined + width?: number | string | undefined + valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined + } - interface TimeHTMLAttributes extends HTMLAttributes { - datetime?: string | undefined - } + interface ThHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined + colspan?: number | undefined + headers?: string | undefined + rowspan?: number | undefined + scope?: string | undefined + abbr?: string | undefined + } - interface TrackHTMLAttributes extends HTMLAttributes { - default?: boolean | undefined - kind?: string | undefined - label?: string | undefined - src?: string | undefined - srclang?: string | undefined - } + interface TimeHTMLAttributes extends HTMLAttributes { + datetime?: string | undefined + } - interface VideoHTMLAttributes extends MediaHTMLAttributes { - height?: number | string | undefined - playsinline?: boolean | undefined - poster?: string | undefined - width?: number | string | undefined - disablePictureInPicture?: boolean | undefined - disableRemotePlayback?: boolean | undefined - } + interface TrackHTMLAttributes extends HTMLAttributes { + default?: boolean | undefined + kind?: string | undefined + label?: string | undefined + src?: string | undefined + srclang?: string | undefined + } - interface IntrinsicElements { - a: AnchorHTMLAttributes - abbr: HTMLAttributes - address: HTMLAttributes - area: AreaHTMLAttributes - article: HTMLAttributes - aside: HTMLAttributes - audio: AudioHTMLAttributes - b: HTMLAttributes - base: BaseHTMLAttributes - bdi: HTMLAttributes - bdo: HTMLAttributes - big: HTMLAttributes - blockquote: BlockquoteHTMLAttributes - body: HTMLAttributes - br: HTMLAttributes - button: ButtonHTMLAttributes - canvas: CanvasHTMLAttributes - caption: HTMLAttributes - center: HTMLAttributes - cite: HTMLAttributes - code: HTMLAttributes - col: ColHTMLAttributes - colgroup: ColgroupHTMLAttributes - data: DataHTMLAttributes - datalist: HTMLAttributes - dd: HTMLAttributes - del: DelHTMLAttributes - details: DetailsHTMLAttributes - dfn: HTMLAttributes - dialog: DialogHTMLAttributes - div: HTMLAttributes - dl: HTMLAttributes - dt: HTMLAttributes - em: HTMLAttributes - embed: EmbedHTMLAttributes - fieldset: FieldsetHTMLAttributes - figcaption: HTMLAttributes - figure: HTMLAttributes - footer: HTMLAttributes - form: FormHTMLAttributes - h1: HTMLAttributes - h2: HTMLAttributes - h3: HTMLAttributes - h4: HTMLAttributes - h5: HTMLAttributes - h6: HTMLAttributes - head: HTMLAttributes - header: HTMLAttributes - hgroup: HTMLAttributes - hr: HTMLAttributes - html: HtmlHTMLAttributes - i: HTMLAttributes - iframe: IframeHTMLAttributes - img: ImgHTMLAttributes - input: InputHTMLAttributes - ins: InsHTMLAttributes - kbd: HTMLAttributes - keygen: KeygenHTMLAttributes - label: LabelHTMLAttributes - legend: HTMLAttributes - li: LiHTMLAttributes - link: LinkHTMLAttributes - main: HTMLAttributes - map: MapHTMLAttributes - mark: HTMLAttributes - menu: MenuHTMLAttributes - menuitem: HTMLAttributes - meta: MetaHTMLAttributes - meter: MeterHTMLAttributes - nav: HTMLAttributes - noscript: HTMLAttributes - object: ObjectHTMLAttributes - ol: OlHTMLAttributes - optgroup: OptgroupHTMLAttributes - option: OptionHTMLAttributes - output: OutputHTMLAttributes - p: HTMLAttributes - param: ParamHTMLAttributes - picture: HTMLAttributes - pre: HTMLAttributes - progress: ProgressHTMLAttributes - q: QuoteHTMLAttributes - rp: HTMLAttributes - rt: HTMLAttributes - ruby: HTMLAttributes - s: HTMLAttributes - samp: HTMLAttributes - search: HTMLAttributes - slot: SlotHTMLAttributes - script: ScriptHTMLAttributes - section: HTMLAttributes - select: SelectHTMLAttributes - small: HTMLAttributes - source: SourceHTMLAttributes - span: HTMLAttributes - strong: HTMLAttributes - style: StyleHTMLAttributes - sub: HTMLAttributes - summary: HTMLAttributes - sup: HTMLAttributes - table: TableHTMLAttributes - template: HTMLAttributes - tbody: HTMLAttributes - td: TdHTMLAttributes - textarea: TextareaHTMLAttributes - tfoot: HTMLAttributes - th: ThHTMLAttributes - thead: HTMLAttributes - time: TimeHTMLAttributes - title: HTMLAttributes - tr: HTMLAttributes - track: TrackHTMLAttributes - u: HTMLAttributes - ul: HTMLAttributes - var: HTMLAttributes - video: VideoHTMLAttributes - wbr: HTMLAttributes - } + interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: number | string | undefined + playsinline?: boolean | undefined + poster?: string | undefined + width?: number | string | undefined + disablePictureInPicture?: boolean | undefined + disableRemotePlayback?: boolean | undefined + } + + export interface IntrinsicElements { + a: AnchorHTMLAttributes + abbr: HTMLAttributes + address: HTMLAttributes + area: AreaHTMLAttributes + article: HTMLAttributes + aside: HTMLAttributes + audio: AudioHTMLAttributes + b: HTMLAttributes + base: BaseHTMLAttributes + bdi: HTMLAttributes + bdo: HTMLAttributes + big: HTMLAttributes + blockquote: BlockquoteHTMLAttributes + body: HTMLAttributes + br: HTMLAttributes + button: ButtonHTMLAttributes + canvas: CanvasHTMLAttributes + caption: HTMLAttributes + center: HTMLAttributes + cite: HTMLAttributes + code: HTMLAttributes + col: ColHTMLAttributes + colgroup: ColgroupHTMLAttributes + data: DataHTMLAttributes + datalist: HTMLAttributes + dd: HTMLAttributes + del: DelHTMLAttributes + details: DetailsHTMLAttributes + dfn: HTMLAttributes + dialog: DialogHTMLAttributes + div: HTMLAttributes + dl: HTMLAttributes + dt: HTMLAttributes + em: HTMLAttributes + embed: EmbedHTMLAttributes + fieldset: FieldsetHTMLAttributes + figcaption: HTMLAttributes + figure: HTMLAttributes + footer: HTMLAttributes + form: FormHTMLAttributes + h1: HTMLAttributes + h2: HTMLAttributes + h3: HTMLAttributes + h4: HTMLAttributes + h5: HTMLAttributes + h6: HTMLAttributes + head: HTMLAttributes + header: HTMLAttributes + hgroup: HTMLAttributes + hr: HTMLAttributes + html: HtmlHTMLAttributes + i: HTMLAttributes + iframe: IframeHTMLAttributes + img: ImgHTMLAttributes + input: InputHTMLAttributes + ins: InsHTMLAttributes + kbd: HTMLAttributes + keygen: KeygenHTMLAttributes + label: LabelHTMLAttributes + legend: HTMLAttributes + li: LiHTMLAttributes + link: LinkHTMLAttributes + main: HTMLAttributes + map: MapHTMLAttributes + mark: HTMLAttributes + menu: MenuHTMLAttributes + menuitem: HTMLAttributes + meta: MetaHTMLAttributes + meter: MeterHTMLAttributes + nav: HTMLAttributes + noscript: HTMLAttributes + object: ObjectHTMLAttributes + ol: OlHTMLAttributes + optgroup: OptgroupHTMLAttributes + option: OptionHTMLAttributes + output: OutputHTMLAttributes + p: HTMLAttributes + param: ParamHTMLAttributes + picture: HTMLAttributes + pre: HTMLAttributes + progress: ProgressHTMLAttributes + q: QuoteHTMLAttributes + rp: HTMLAttributes + rt: HTMLAttributes + ruby: HTMLAttributes + s: HTMLAttributes + samp: HTMLAttributes + search: HTMLAttributes + slot: SlotHTMLAttributes + script: ScriptHTMLAttributes + section: HTMLAttributes + select: SelectHTMLAttributes + small: HTMLAttributes + source: SourceHTMLAttributes + span: HTMLAttributes + strong: HTMLAttributes + style: StyleHTMLAttributes + sub: HTMLAttributes + summary: HTMLAttributes + sup: HTMLAttributes + table: TableHTMLAttributes + template: HTMLAttributes + tbody: HTMLAttributes + td: TdHTMLAttributes + textarea: TextareaHTMLAttributes + tfoot: HTMLAttributes + th: ThHTMLAttributes + thead: HTMLAttributes + time: TimeHTMLAttributes + title: HTMLAttributes + tr: HTMLAttributes + track: TrackHTMLAttributes + u: HTMLAttributes + ul: HTMLAttributes + var: HTMLAttributes + video: VideoHTMLAttributes + wbr: HTMLAttributes } } diff --git a/deno_dist/jsx/jsx-dev-runtime.ts b/deno_dist/jsx/jsx-dev-runtime.ts index 39492291d..5c9f8fd10 100644 --- a/deno_dist/jsx/jsx-dev-runtime.ts +++ b/deno_dist/jsx/jsx-dev-runtime.ts @@ -2,6 +2,7 @@ import type { HtmlEscapedString } from '../utils/html.ts' import { jsxFn } from './base.ts' import type { JSXNode } from './base.ts' export { Fragment } from './base.ts' +export type { JSX } from './base.ts' export function jsxDEV( tag: string | Function, diff --git a/deno_dist/jsx/jsx-runtime.ts b/deno_dist/jsx/jsx-runtime.ts index cf1c0c0a9..bdfebcec9 100644 --- a/deno_dist/jsx/jsx-runtime.ts +++ b/deno_dist/jsx/jsx-runtime.ts @@ -1,5 +1,6 @@ export { jsxDEV as jsx, Fragment } from './jsx-dev-runtime.ts' export { jsxDEV as jsxs } from './jsx-dev-runtime.ts' +export type { JSX } from './jsx-dev-runtime.ts' import { raw, html } from '../helper/html/index.ts' import type { HtmlEscapedString } from '../utils/html.ts' diff --git a/deno_dist/jsx/types.ts b/deno_dist/jsx/types.ts index 3e1daf437..6f060bf2b 100644 --- a/deno_dist/jsx/types.ts +++ b/deno_dist/jsx/types.ts @@ -2,6 +2,7 @@ * All types exported from "hono/jsx" are in this file. */ import type { Child, JSXNode } from './base.ts' +import type { Hono } from './intrinsic-elements.ts' export type { Child, JSXNode, FC } from './base.ts' export type { RefObject } from './hooks/index.ts' diff --git a/src/helper/css/common.case.test.tsx b/src/helper/css/common.case.test.tsx index 85b8a09ce..2a9046e7e 100644 --- a/src/helper/css/common.case.test.tsx +++ b/src/helper/css/common.case.test.tsx @@ -1,6 +1,5 @@ /* eslint-disable quotes */ -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx, Fragment } from '../../jsx' +/** @jsxImportSource ../../jsx */ import type { css as cssHelper, keyframes as keyframesHelper, diff --git a/src/helper/css/index.test.tsx b/src/helper/css/index.test.tsx index 6cacdbbe1..abb9c0554 100644 --- a/src/helper/css/index.test.tsx +++ b/src/helper/css/index.test.tsx @@ -1,8 +1,8 @@ /* eslint-disable quotes */ +/** @jsxImportSource ../../jsx */ import { Hono } from '../../' import { html } from '../../helper/html' -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx, Fragment, isValidElement } from '../../jsx' +import { isValidElement } from '../../jsx' import type { JSXNode } from '../../jsx' import { Suspense, renderToReadableStream } from '../../jsx/streaming' import type { HtmlEscapedString } from '../../utils/html' diff --git a/src/helper/ssg/ssg.test.tsx b/src/helper/ssg/ssg.test.tsx index 6f8bb819f..c7a4bf13c 100644 --- a/src/helper/ssg/ssg.test.tsx +++ b/src/helper/ssg/ssg.test.tsx @@ -1,8 +1,7 @@ /* eslint-disable @typescript-eslint/unbound-method */ +/** @jsxImportSource ../../jsx */ import { beforeEach, describe, expect, it } from 'vitest' import { Hono } from '../../hono' -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx } from '../../jsx' import { poweredBy } from '../../middleware/powered-by' import { X_HONO_DISABLE_SSG_HEADER_KEY, diff --git a/src/jsx/base.ts b/src/jsx/base.ts index 15e1477d0..02ec4387e 100644 --- a/src/jsx/base.ts +++ b/src/jsx/base.ts @@ -4,6 +4,7 @@ import type { StringBuffer, HtmlEscaped, HtmlEscapedString } from '../utils/html import type { Context } from './context' import { globalContexts } from './context' import type { IntrinsicElements as IntrinsicElementsDefined } from './intrinsic-elements' +import type { Hono } from './intrinsic-elements' import { normalizeIntrinsicElementProps, styleObjectForEach } from './utils' // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -15,16 +16,14 @@ export type FC

= { } export type DOMAttributes = Hono.HTMLAttributes -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace JSX { - type Element = HtmlEscapedString | Promise - interface ElementChildrenAttribute { - children: Child - } - interface IntrinsicElements extends IntrinsicElementsDefined { - [tagName: string]: Props - } +// eslint-disable-next-line @typescript-eslint/no-namespace +export namespace JSX { + export type Element = HtmlEscapedString | Promise + export interface ElementChildrenAttribute { + children: Child + } + export interface IntrinsicElements extends IntrinsicElementsDefined { + [tagName: string]: Props } } diff --git a/src/jsx/components.test.tsx b/src/jsx/components.test.tsx index f15e68e43..43696d599 100644 --- a/src/jsx/components.test.tsx +++ b/src/jsx/components.test.tsx @@ -1,11 +1,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +/** @jsxImportSource ./ */ import { JSDOM } from 'jsdom' import type { HtmlEscapedString } from '../utils/html' import { HtmlEscapedCallbackPhase, resolveCallback as rawResolveCallback } from '../utils/html' import { ErrorBoundary } from './components' import { Suspense, renderToReadableStream } from './streaming' -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx } from '.' function resolveCallback(template: string | HtmlEscapedString) { return rawResolveCallback(template, HtmlEscapedCallbackPhase.Stream, false, {}) diff --git a/src/jsx/dom/components.test.tsx b/src/jsx/dom/components.test.tsx index b1852f234..de86cc10d 100644 --- a/src/jsx/dom/components.test.tsx +++ b/src/jsx/dom/components.test.tsx @@ -1,9 +1,8 @@ +/** @jsxImportSource ../ */ import { JSDOM } from 'jsdom' import { Suspense as SuspenseCommon, ErrorBoundary as ErrorBoundaryCommon } from '..' // for common // run tests by old style jsx default // hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx } from '..' import { use, useState } from '../hooks' import { Suspense as SuspenseDom, ErrorBoundary as ErrorBoundaryDom } from '.' // for dom import { render } from '.' diff --git a/src/jsx/dom/context.test.tsx b/src/jsx/dom/context.test.tsx index 8ab887389..60ccaf24b 100644 --- a/src/jsx/dom/context.test.tsx +++ b/src/jsx/dom/context.test.tsx @@ -1,10 +1,9 @@ +/** @jsxImportSource ../ */ import { JSDOM } from 'jsdom' import { createContext as createContextCommon, useContext as useContextCommon } from '..' // for common import { use, Suspense } from '..' // run tests by old style jsx default // hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx, Fragment } from '..' import { createContext as createContextDom, useContext as useContextDom } from '.' // for dom import { render, useState } from '.' diff --git a/src/jsx/dom/css.test.tsx b/src/jsx/dom/css.test.tsx index 97ba4ae0e..0aae152c0 100644 --- a/src/jsx/dom/css.test.tsx +++ b/src/jsx/dom/css.test.tsx @@ -1,8 +1,8 @@ +/** @jsxImportSource ../ */ import { JSDOM } from 'jsdom' // run tests by old style jsx default // hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx } from '..' import type { JSXNode } from '..' import { Style, css, rawCssString, createCssContext } from '../../helper/css' import { minify } from '../../helper/css/common' diff --git a/src/jsx/dom/index.test.tsx b/src/jsx/dom/index.test.tsx index f300b6f16..a4a6d6076 100644 --- a/src/jsx/dom/index.test.tsx +++ b/src/jsx/dom/index.test.tsx @@ -1,9 +1,9 @@ +/** @jsxImportSource ../ */ import { JSDOM } from 'jsdom' import type { FC, Child } from '..' // run tests by old style jsx default // hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx, Fragment, createElement } from '..' +import { createElement, jsx } from '..' import type { RefObject } from '../hooks' import { useState, diff --git a/src/jsx/dom/index.ts b/src/jsx/dom/index.ts index 3612119da..724b7f2ea 100644 --- a/src/jsx/dom/index.ts +++ b/src/jsx/dom/index.ts @@ -1,5 +1,6 @@ -import type { Props, Child, DOMAttributes, JSXNode } from '../base' import { memo, isValidElement } from '../base' +import type { Props, Child, DOMAttributes, JSXNode } from '../base' +import type { JSX } from '../base' import { Children } from '../children' import { useContext } from '../context' import { diff --git a/src/jsx/hooks/dom.test.tsx b/src/jsx/hooks/dom.test.tsx index a824019a8..df604f57e 100644 --- a/src/jsx/hooks/dom.test.tsx +++ b/src/jsx/hooks/dom.test.tsx @@ -1,8 +1,7 @@ +/** @jsxImportSource ../ */ import { JSDOM } from 'jsdom' // run tests by old style jsx default // hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx, Fragment } from '..' import { Suspense } from '../dom' import { render } from '../dom' import { diff --git a/src/jsx/hooks/index.ts b/src/jsx/hooks/index.ts index d142d44af..9e038c4db 100644 --- a/src/jsx/hooks/index.ts +++ b/src/jsx/hooks/index.ts @@ -1,3 +1,4 @@ +import type { JSX } from '../base' import { DOM_STASH } from '../constants' import { buildDataStack, update, build } from '../dom/render' import type { Node, NodeObject, Context, PendingType, UpdateHook } from '../dom/render' diff --git a/src/jsx/hooks/string.test.tsx b/src/jsx/hooks/string.test.tsx index 8167965f6..ae91177b0 100644 --- a/src/jsx/hooks/string.test.tsx +++ b/src/jsx/hooks/string.test.tsx @@ -1,5 +1,5 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { jsx, useState, useSyncExternalStore } from '..' +/** @jsxImportSource ../ */ +import { useState, useSyncExternalStore } from '..' describe('useState', () => { it('should be rendered with initial state', () => { diff --git a/src/jsx/index.test.tsx b/src/jsx/index.test.tsx index 249550d4b..6505efb08 100644 --- a/src/jsx/index.test.tsx +++ b/src/jsx/index.test.tsx @@ -1,10 +1,10 @@ +/** @jsxImportSource ./ */ // @denoify-ignore /* eslint-disable @typescript-eslint/no-explicit-any */ import { html } from '../helper/html' import { Hono } from '../hono' import { Suspense, renderToReadableStream } from './streaming' -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import DefaultExport, { jsx, memo, Fragment, createContext, useContext } from '.' +import DefaultExport, { memo, Fragment, createContext, useContext } from '.' import type { Context, FC, PropsWithChildren } from '.' interface SiteData { diff --git a/src/jsx/intrinsic-elements.ts b/src/jsx/intrinsic-elements.ts index 0d3b01525..67caba334 100644 --- a/src/jsx/intrinsic-elements.ts +++ b/src/jsx/intrinsic-elements.ts @@ -7,724 +7,722 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. */ -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace Hono { - type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined - type CSSProperties = {} - type AnyAttributes = { [attributeName: string]: any } - - interface JSXAttributes { - dangerouslySetInnerHTML?: { - __html: string - } - } +// eslint-disable-next-line @typescript-eslint/no-namespace +export namespace Hono { + export type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined + export type CSSProperties = {} + type AnyAttributes = { [attributeName: string]: any } - interface EventAttributes { - onScroll?: (event: Event) => void - onScrollCapture?: (event: Event) => void - onScrollEnd?: (event: Event) => void - onScrollEndCapture?: (event: Event) => void - onWheel?: (event: WheelEvent) => void - onWheelCapture?: (event: WheelEvent) => void - onAnimationCancel?: (event: AnimationEvent) => void - onAnimationCancelCapture?: (event: AnimationEvent) => void - onAnimationEnd?: (event: AnimationEvent) => void - onAnimationEndCapture?: (event: AnimationEvent) => void - onAnimationIteration?: (event: AnimationEvent) => void - onAnimationIterationCapture?: (event: AnimationEvent) => void - onAnimationStart?: (event: AnimationEvent) => void - onAnimationStartCapture?: (event: AnimationEvent) => void - onCopy?: (event: ClipboardEvent) => void - onCopyCapture?: (event: ClipboardEvent) => void - onCut?: (event: ClipboardEvent) => void - onCutCapture?: (event: ClipboardEvent) => void - onPaste?: (event: ClipboardEvent) => void - onPasteCapture?: (event: ClipboardEvent) => void - onCompositionEnd?: (event: CompositionEvent) => void - onCompositionEndCapture?: (event: CompositionEvent) => void - onCompositionStart?: (event: CompositionEvent) => void - onCompositionStartCapture?: (event: CompositionEvent) => void - onCompositionUpdate?: (event: CompositionEvent) => void - onCompositionUpdateCapture?: (event: CompositionEvent) => void - onBlur?: (event: FocusEvent) => void - onBlurCapture?: (event: FocusEvent) => void - onFocus?: (event: FocusEvent) => void - onFocusCapture?: (event: FocusEvent) => void - onFocusIn?: (event: FocusEvent) => void - onFocusInCapture?: (event: FocusEvent) => void - onFocusOut?: (event: FocusEvent) => void - onFocusOutCapture?: (event: FocusEvent) => void - onFullscreenChange?: (event: Event) => void - onFullscreenChangeCapture?: (event: Event) => void - onFullscreenError?: (event: Event) => void - onFullscreenErrorCapture?: (event: Event) => void - onKeyDown?: (event: KeyboardEvent) => void - onKeyDownCapture?: (event: KeyboardEvent) => void - onKeyPress?: (event: KeyboardEvent) => void - onKeyPressCapture?: (event: KeyboardEvent) => void - onKeyUp?: (event: KeyboardEvent) => void - onKeyUpCapture?: (event: KeyboardEvent) => void - onAuxClick?: (event: MouseEvent) => void - onAuxClickCapture?: (event: MouseEvent) => void - onClick?: (event: MouseEvent) => void - onClickCapture?: (event: MouseEvent) => void - onContextMenu?: (event: MouseEvent) => void - onContextMenuCapture?: (event: MouseEvent) => void - onDoubleClick?: (event: MouseEvent) => void - onDoubleClickCapture?: (event: MouseEvent) => void - onMouseDown?: (event: MouseEvent) => void - onMouseDownCapture?: (event: MouseEvent) => void - onMouseEnter?: (event: MouseEvent) => void - onMouseEnterCapture?: (event: MouseEvent) => void - onMouseLeave?: (event: MouseEvent) => void - onMouseLeaveCapture?: (event: MouseEvent) => void - onMouseMove?: (event: MouseEvent) => void - onMouseMoveCapture?: (event: MouseEvent) => void - onMouseOut?: (event: MouseEvent) => void - onMouseOutCapture?: (event: MouseEvent) => void - onMouseOver?: (event: MouseEvent) => void - onMouseOverCapture?: (event: MouseEvent) => void - onMouseUp?: (event: MouseEvent) => void - onMouseUpCapture?: (event: MouseEvent) => void - onMouseWheel?: (event: WheelEvent) => void - onMouseWheelCapture?: (event: WheelEvent) => void - onGotPointerCapture?: (event: PointerEvent) => void - onGotPointerCaptureCapture?: (event: PointerEvent) => void - onLostPointerCapture?: (event: PointerEvent) => void - onLostPointerCaptureCapture?: (event: PointerEvent) => void - onPointerCancel?: (event: PointerEvent) => void - onPointerCancelCapture?: (event: PointerEvent) => void - onPointerDown?: (event: PointerEvent) => void - onPointerDownCapture?: (event: PointerEvent) => void - onPointerEnter?: (event: PointerEvent) => void - onPointerEnterCapture?: (event: PointerEvent) => void - onPointerLeave?: (event: PointerEvent) => void - onPointerLeaveCapture?: (event: PointerEvent) => void - onPointerMove?: (event: PointerEvent) => void - onPointerMoveCapture?: (event: PointerEvent) => void - onPointerOut?: (event: PointerEvent) => void - onPointerOutCapture?: (event: PointerEvent) => void - onPointerOver?: (event: PointerEvent) => void - onPointerOverCapture?: (event: PointerEvent) => void - onPointerUp?: (event: PointerEvent) => void - onPointerUpCapture?: (event: PointerEvent) => void - onTouchCancel?: (event: TouchEvent) => void - onTouchCancelCapture?: (event: TouchEvent) => void - onTouchEnd?: (event: TouchEvent) => void - onTouchEndCapture?: (event: TouchEvent) => void - onTouchMove?: (event: TouchEvent) => void - onTouchMoveCapture?: (event: TouchEvent) => void - onTouchStart?: (event: TouchEvent) => void - onTouchStartCapture?: (event: TouchEvent) => void - onTransitionCancel?: (event: TransitionEvent) => void - onTransitionCancelCapture?: (event: TransitionEvent) => void - onTransitionEnd?: (event: TransitionEvent) => void - onTransitionEndCapture?: (event: TransitionEvent) => void - onTransitionRun?: (event: TransitionEvent) => void - onTransitionRunCapture?: (event: TransitionEvent) => void - onTransitionStart?: (event: TransitionEvent) => void - onTransitionStartCapture?: (event: TransitionEvent) => void - onFormData?: (event: FormDataEvent) => void - onFormDataCapture?: (event: FormDataEvent) => void - onReset?: (event: Event) => void - onResetCapture?: (event: Event) => void - onSubmit?: (event: Event) => void - onSubmitCapture?: (event: Event) => void - onInvalid?: (event: Event) => void - onInvalidCapture?: (event: Event) => void - onSelect?: (event: Event) => void - onSelectCapture?: (event: Event) => void - onSelectChange?: (event: Event) => void - onSelectChangeCapture?: (event: Event) => void - onInput?: (event: InputEvent) => void - onInputCapture?: (event: InputEvent) => void - onBeforeInput?: (event: InputEvent) => void - onBeforeInputCapture?: (event: InputEvent) => void - onChange?: (event: Event) => void - onChangeCapture?: (event: Event) => void + interface JSXAttributes { + dangerouslySetInnerHTML?: { + __html: string } + } - interface HTMLAttributes extends JSXAttributes, EventAttributes, AnyAttributes { - accesskey?: string | undefined - autofocus?: boolean | undefined - class?: string | Promise | undefined - contenteditable?: boolean | 'inherit' | undefined - contextmenu?: string | undefined - dir?: string | undefined - draggable?: boolean | undefined - hidden?: boolean | undefined - id?: string | undefined - lang?: string | undefined - nonce?: string | undefined - placeholder?: string | undefined - slot?: string | undefined - spellcheck?: boolean | undefined - style?: CSSProperties | undefined - tabindex?: number | undefined - title?: string | undefined - translate?: 'yes' | 'no' | undefined - } + interface EventAttributes { + onScroll?: (event: Event) => void + onScrollCapture?: (event: Event) => void + onScrollEnd?: (event: Event) => void + onScrollEndCapture?: (event: Event) => void + onWheel?: (event: WheelEvent) => void + onWheelCapture?: (event: WheelEvent) => void + onAnimationCancel?: (event: AnimationEvent) => void + onAnimationCancelCapture?: (event: AnimationEvent) => void + onAnimationEnd?: (event: AnimationEvent) => void + onAnimationEndCapture?: (event: AnimationEvent) => void + onAnimationIteration?: (event: AnimationEvent) => void + onAnimationIterationCapture?: (event: AnimationEvent) => void + onAnimationStart?: (event: AnimationEvent) => void + onAnimationStartCapture?: (event: AnimationEvent) => void + onCopy?: (event: ClipboardEvent) => void + onCopyCapture?: (event: ClipboardEvent) => void + onCut?: (event: ClipboardEvent) => void + onCutCapture?: (event: ClipboardEvent) => void + onPaste?: (event: ClipboardEvent) => void + onPasteCapture?: (event: ClipboardEvent) => void + onCompositionEnd?: (event: CompositionEvent) => void + onCompositionEndCapture?: (event: CompositionEvent) => void + onCompositionStart?: (event: CompositionEvent) => void + onCompositionStartCapture?: (event: CompositionEvent) => void + onCompositionUpdate?: (event: CompositionEvent) => void + onCompositionUpdateCapture?: (event: CompositionEvent) => void + onBlur?: (event: FocusEvent) => void + onBlurCapture?: (event: FocusEvent) => void + onFocus?: (event: FocusEvent) => void + onFocusCapture?: (event: FocusEvent) => void + onFocusIn?: (event: FocusEvent) => void + onFocusInCapture?: (event: FocusEvent) => void + onFocusOut?: (event: FocusEvent) => void + onFocusOutCapture?: (event: FocusEvent) => void + onFullscreenChange?: (event: Event) => void + onFullscreenChangeCapture?: (event: Event) => void + onFullscreenError?: (event: Event) => void + onFullscreenErrorCapture?: (event: Event) => void + onKeyDown?: (event: KeyboardEvent) => void + onKeyDownCapture?: (event: KeyboardEvent) => void + onKeyPress?: (event: KeyboardEvent) => void + onKeyPressCapture?: (event: KeyboardEvent) => void + onKeyUp?: (event: KeyboardEvent) => void + onKeyUpCapture?: (event: KeyboardEvent) => void + onAuxClick?: (event: MouseEvent) => void + onAuxClickCapture?: (event: MouseEvent) => void + onClick?: (event: MouseEvent) => void + onClickCapture?: (event: MouseEvent) => void + onContextMenu?: (event: MouseEvent) => void + onContextMenuCapture?: (event: MouseEvent) => void + onDoubleClick?: (event: MouseEvent) => void + onDoubleClickCapture?: (event: MouseEvent) => void + onMouseDown?: (event: MouseEvent) => void + onMouseDownCapture?: (event: MouseEvent) => void + onMouseEnter?: (event: MouseEvent) => void + onMouseEnterCapture?: (event: MouseEvent) => void + onMouseLeave?: (event: MouseEvent) => void + onMouseLeaveCapture?: (event: MouseEvent) => void + onMouseMove?: (event: MouseEvent) => void + onMouseMoveCapture?: (event: MouseEvent) => void + onMouseOut?: (event: MouseEvent) => void + onMouseOutCapture?: (event: MouseEvent) => void + onMouseOver?: (event: MouseEvent) => void + onMouseOverCapture?: (event: MouseEvent) => void + onMouseUp?: (event: MouseEvent) => void + onMouseUpCapture?: (event: MouseEvent) => void + onMouseWheel?: (event: WheelEvent) => void + onMouseWheelCapture?: (event: WheelEvent) => void + onGotPointerCapture?: (event: PointerEvent) => void + onGotPointerCaptureCapture?: (event: PointerEvent) => void + onLostPointerCapture?: (event: PointerEvent) => void + onLostPointerCaptureCapture?: (event: PointerEvent) => void + onPointerCancel?: (event: PointerEvent) => void + onPointerCancelCapture?: (event: PointerEvent) => void + onPointerDown?: (event: PointerEvent) => void + onPointerDownCapture?: (event: PointerEvent) => void + onPointerEnter?: (event: PointerEvent) => void + onPointerEnterCapture?: (event: PointerEvent) => void + onPointerLeave?: (event: PointerEvent) => void + onPointerLeaveCapture?: (event: PointerEvent) => void + onPointerMove?: (event: PointerEvent) => void + onPointerMoveCapture?: (event: PointerEvent) => void + onPointerOut?: (event: PointerEvent) => void + onPointerOutCapture?: (event: PointerEvent) => void + onPointerOver?: (event: PointerEvent) => void + onPointerOverCapture?: (event: PointerEvent) => void + onPointerUp?: (event: PointerEvent) => void + onPointerUpCapture?: (event: PointerEvent) => void + onTouchCancel?: (event: TouchEvent) => void + onTouchCancelCapture?: (event: TouchEvent) => void + onTouchEnd?: (event: TouchEvent) => void + onTouchEndCapture?: (event: TouchEvent) => void + onTouchMove?: (event: TouchEvent) => void + onTouchMoveCapture?: (event: TouchEvent) => void + onTouchStart?: (event: TouchEvent) => void + onTouchStartCapture?: (event: TouchEvent) => void + onTransitionCancel?: (event: TransitionEvent) => void + onTransitionCancelCapture?: (event: TransitionEvent) => void + onTransitionEnd?: (event: TransitionEvent) => void + onTransitionEndCapture?: (event: TransitionEvent) => void + onTransitionRun?: (event: TransitionEvent) => void + onTransitionRunCapture?: (event: TransitionEvent) => void + onTransitionStart?: (event: TransitionEvent) => void + onTransitionStartCapture?: (event: TransitionEvent) => void + onFormData?: (event: FormDataEvent) => void + onFormDataCapture?: (event: FormDataEvent) => void + onReset?: (event: Event) => void + onResetCapture?: (event: Event) => void + onSubmit?: (event: Event) => void + onSubmitCapture?: (event: Event) => void + onInvalid?: (event: Event) => void + onInvalidCapture?: (event: Event) => void + onSelect?: (event: Event) => void + onSelectCapture?: (event: Event) => void + onSelectChange?: (event: Event) => void + onSelectChangeCapture?: (event: Event) => void + onInput?: (event: InputEvent) => void + onInputCapture?: (event: InputEvent) => void + onBeforeInput?: (event: InputEvent) => void + onBeforeInputCapture?: (event: InputEvent) => void + onChange?: (event: Event) => void + onChangeCapture?: (event: Event) => void + } - type HTMLAttributeReferrerPolicy = - | '' - | 'no-referrer' - | 'no-referrer-when-downgrade' - | 'origin' - | 'origin-when-cross-origin' - | 'same-origin' - | 'strict-origin' - | 'strict-origin-when-cross-origin' - | 'unsafe-url' - - type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | string - - interface AnchorHTMLAttributes extends HTMLAttributes { - download?: any - href?: string | undefined - hreflang?: string | undefined - media?: string | undefined - ping?: string | undefined - target?: HTMLAttributeAnchorTarget | undefined - type?: string | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - } + export interface HTMLAttributes extends JSXAttributes, EventAttributes, AnyAttributes { + accesskey?: string | undefined + autofocus?: boolean | undefined + class?: string | Promise | undefined + contenteditable?: boolean | 'inherit' | undefined + contextmenu?: string | undefined + dir?: string | undefined + draggable?: boolean | undefined + hidden?: boolean | undefined + id?: string | undefined + lang?: string | undefined + nonce?: string | undefined + placeholder?: string | undefined + slot?: string | undefined + spellcheck?: boolean | undefined + style?: CSSProperties | undefined + tabindex?: number | undefined + title?: string | undefined + translate?: 'yes' | 'no' | undefined + } - interface AudioHTMLAttributes extends MediaHTMLAttributes {} - - interface AreaHTMLAttributes extends HTMLAttributes { - alt?: string | undefined - coords?: string | undefined - download?: any - href?: string | undefined - hreflang?: string | undefined - media?: string | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - shape?: string | undefined - target?: string | undefined - } + type HTMLAttributeReferrerPolicy = + | '' + | 'no-referrer' + | 'no-referrer-when-downgrade' + | 'origin' + | 'origin-when-cross-origin' + | 'same-origin' + | 'strict-origin' + | 'strict-origin-when-cross-origin' + | 'unsafe-url' + + type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | string + + interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any + href?: string | undefined + hreflang?: string | undefined + media?: string | undefined + ping?: string | undefined + target?: HTMLAttributeAnchorTarget | undefined + type?: string | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + } - interface BaseHTMLAttributes extends HTMLAttributes { - href?: string | undefined - target?: string | undefined - } + interface AudioHTMLAttributes extends MediaHTMLAttributes {} + + interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string | undefined + coords?: string | undefined + download?: any + href?: string | undefined + hreflang?: string | undefined + media?: string | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + shape?: string | undefined + target?: string | undefined + } - interface BlockquoteHTMLAttributes extends HTMLAttributes { - cite?: string | undefined - } + interface BaseHTMLAttributes extends HTMLAttributes { + href?: string | undefined + target?: string | undefined + } - interface ButtonHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined - form?: string | undefined - formenctype?: string | undefined - formmethod?: string | undefined - formnovalidate?: boolean | undefined - formtarget?: string | undefined - name?: string | undefined - type?: 'submit' | 'reset' | 'button' | undefined - value?: string | ReadonlyArray | number | undefined - } + interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined + } - interface CanvasHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined - width?: number | string | undefined - } + interface ButtonHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined + form?: string | undefined + formenctype?: string | undefined + formmethod?: string | undefined + formnovalidate?: boolean | undefined + formtarget?: string | undefined + name?: string | undefined + type?: 'submit' | 'reset' | 'button' | undefined + value?: string | ReadonlyArray | number | undefined + } - interface ColHTMLAttributes extends HTMLAttributes { - span?: number | undefined - width?: number | string | undefined - } + interface CanvasHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined + width?: number | string | undefined + } - interface ColgroupHTMLAttributes extends HTMLAttributes { - span?: number | undefined - } + interface ColHTMLAttributes extends HTMLAttributes { + span?: number | undefined + width?: number | string | undefined + } - interface DataHTMLAttributes extends HTMLAttributes { - value?: string | ReadonlyArray | number | undefined - } + interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: number | undefined + } - interface DetailsHTMLAttributes extends HTMLAttributes { - open?: boolean | undefined - } + interface DataHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined + } - interface DelHTMLAttributes extends HTMLAttributes { - cite?: string | undefined - dateTime?: string | undefined - } + interface DetailsHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined + } - interface DialogHTMLAttributes extends HTMLAttributes { - open?: boolean | undefined - } + interface DelHTMLAttributes extends HTMLAttributes { + cite?: string | undefined + dateTime?: string | undefined + } - interface EmbedHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined - src?: string | undefined - type?: string | undefined - width?: number | string | undefined - } + interface DialogHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined + } - interface FieldsetHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined - form?: string | undefined - name?: string | undefined - } + interface EmbedHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined + src?: string | undefined + type?: string | undefined + width?: number | string | undefined + } - interface FormHTMLAttributes extends HTMLAttributes { - 'accept-charset'?: string | undefined - autocomplete?: string | undefined - enctype?: string | undefined - method?: string | undefined - name?: string | undefined - novalidate?: boolean | undefined - target?: string | undefined - } + interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined + form?: string | undefined + name?: string | undefined + } - interface HtmlHTMLAttributes extends HTMLAttributes { - manifest?: string | undefined - } + interface FormHTMLAttributes extends HTMLAttributes { + 'accept-charset'?: string | undefined + autocomplete?: string | undefined + enctype?: string | undefined + method?: string | undefined + name?: string | undefined + novalidate?: boolean | undefined + target?: string | undefined + } - interface IframeHTMLAttributes extends HTMLAttributes { - allow?: string | undefined - allowfullscreen?: boolean | undefined - height?: number | string | undefined - loading?: 'eager' | 'lazy' | undefined - name?: string | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - sandbox?: string | undefined - seamless?: boolean | undefined - src?: string | undefined - srcdoc?: string | undefined - width?: number | string | undefined - } + interface HtmlHTMLAttributes extends HTMLAttributes { + manifest?: string | undefined + } - interface ImgHTMLAttributes extends HTMLAttributes { - alt?: string | undefined - crossorigin?: CrossOrigin - decoding?: 'async' | 'auto' | 'sync' | undefined - height?: number | string | undefined - loading?: 'eager' | 'lazy' | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - sizes?: string | undefined - src?: string | undefined - srcset?: string | undefined - usemap?: string | undefined - width?: number | string | undefined - } + interface IframeHTMLAttributes extends HTMLAttributes { + allow?: string | undefined + allowfullscreen?: boolean | undefined + height?: number | string | undefined + loading?: 'eager' | 'lazy' | undefined + name?: string | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + sandbox?: string | undefined + seamless?: boolean | undefined + src?: string | undefined + srcdoc?: string | undefined + width?: number | string | undefined + } - interface InsHTMLAttributes extends HTMLAttributes { - cite?: string | undefined - datetime?: string | undefined - } + interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string | undefined + crossorigin?: CrossOrigin + decoding?: 'async' | 'auto' | 'sync' | undefined + height?: number | string | undefined + loading?: 'eager' | 'lazy' | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + sizes?: string | undefined + src?: string | undefined + srcset?: string | undefined + usemap?: string | undefined + width?: number | string | undefined + } - type HTMLInputTypeAttribute = - | 'button' - | 'checkbox' - | 'color' - | 'date' - | 'datetime-local' - | 'email' - | 'file' - | 'hidden' - | 'image' - | 'month' - | 'number' - | 'password' - | 'radio' - | 'range' - | 'reset' - | 'search' - | 'submit' - | 'tel' - | 'text' - | 'time' - | 'url' - | 'week' - | string - - interface InputHTMLAttributes extends HTMLAttributes { - accept?: string | undefined - alt?: string | undefined - autocomplete?: string | undefined - capture?: boolean | 'user' | 'environment' | undefined // https://www.w3.org/TR/html-media-capture/#the-capture-attribute - checked?: boolean | undefined - disabled?: boolean | undefined - enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined - form?: string | undefined - formenctype?: string | undefined - formmethod?: string | undefined - formnovalidate?: boolean | undefined - formtarget?: string | undefined - height?: number | string | undefined - list?: string | undefined - max?: number | string | undefined - maxlength?: number | undefined - min?: number | string | undefined - minlength?: number | undefined - multiple?: boolean | undefined - name?: string | undefined - pattern?: string | undefined - placeholder?: string | undefined - readonly?: boolean | undefined - required?: boolean | undefined - size?: number | undefined - src?: string | undefined - step?: number | string | undefined - type?: HTMLInputTypeAttribute | undefined - value?: string | ReadonlyArray | number | undefined - width?: number | string | undefined - } + interface InsHTMLAttributes extends HTMLAttributes { + cite?: string | undefined + datetime?: string | undefined + } - interface KeygenHTMLAttributes extends HTMLAttributes { - challenge?: string | undefined - disabled?: boolean | undefined - form?: string | undefined - keytype?: string | undefined - name?: string | undefined - } + type HTMLInputTypeAttribute = + | 'button' + | 'checkbox' + | 'color' + | 'date' + | 'datetime-local' + | 'email' + | 'file' + | 'hidden' + | 'image' + | 'month' + | 'number' + | 'password' + | 'radio' + | 'range' + | 'reset' + | 'search' + | 'submit' + | 'tel' + | 'text' + | 'time' + | 'url' + | 'week' + | string + + interface InputHTMLAttributes extends HTMLAttributes { + accept?: string | undefined + alt?: string | undefined + autocomplete?: string | undefined + capture?: boolean | 'user' | 'environment' | undefined // https://www.w3.org/TR/html-media-capture/#the-capture-attribute + checked?: boolean | undefined + disabled?: boolean | undefined + enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined + form?: string | undefined + formenctype?: string | undefined + formmethod?: string | undefined + formnovalidate?: boolean | undefined + formtarget?: string | undefined + height?: number | string | undefined + list?: string | undefined + max?: number | string | undefined + maxlength?: number | undefined + min?: number | string | undefined + minlength?: number | undefined + multiple?: boolean | undefined + name?: string | undefined + pattern?: string | undefined + placeholder?: string | undefined + readonly?: boolean | undefined + required?: boolean | undefined + size?: number | undefined + src?: string | undefined + step?: number | string | undefined + type?: HTMLInputTypeAttribute | undefined + value?: string | ReadonlyArray | number | undefined + width?: number | string | undefined + } - interface LabelHTMLAttributes extends HTMLAttributes { - form?: string | undefined - for?: string | undefined - } + interface KeygenHTMLAttributes extends HTMLAttributes { + challenge?: string | undefined + disabled?: boolean | undefined + form?: string | undefined + keytype?: string | undefined + name?: string | undefined + } - interface LiHTMLAttributes extends HTMLAttributes { - value?: string | ReadonlyArray | number | undefined - } + interface LabelHTMLAttributes extends HTMLAttributes { + form?: string | undefined + for?: string | undefined + } - interface LinkHTMLAttributes extends HTMLAttributes { - as?: string | undefined - crossorigin?: CrossOrigin - href?: string | undefined - hreflang?: string | undefined - integrity?: string | undefined - media?: string | undefined - imagesrcset?: string | undefined - imagesizes?: string | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - sizes?: string | undefined - type?: string | undefined - charSet?: string | undefined - } + interface LiHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined + } - interface MapHTMLAttributes extends HTMLAttributes { - name?: string | undefined - } + interface LinkHTMLAttributes extends HTMLAttributes { + as?: string | undefined + crossorigin?: CrossOrigin + href?: string | undefined + hreflang?: string | undefined + integrity?: string | undefined + media?: string | undefined + imagesrcset?: string | undefined + imagesizes?: string | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + sizes?: string | undefined + type?: string | undefined + charSet?: string | undefined + } - interface MenuHTMLAttributes extends HTMLAttributes { - type?: string | undefined - } + interface MapHTMLAttributes extends HTMLAttributes { + name?: string | undefined + } - interface MediaHTMLAttributes extends HTMLAttributes { - autoplay?: boolean | undefined - controls?: boolean | undefined - controlslist?: string | undefined - crossorigin?: CrossOrigin - loop?: boolean | undefined - mediagroup?: string | undefined - muted?: boolean | undefined - playsinline?: boolean | undefined - preload?: string | undefined - src?: string | undefined - } + interface MenuHTMLAttributes extends HTMLAttributes { + type?: string | undefined + } - interface MetaHTMLAttributes extends HTMLAttributes { - charset?: string | undefined - 'http-equiv'?: string | undefined - name?: string | undefined - media?: string | undefined - content?: string | undefined - } + interface MediaHTMLAttributes extends HTMLAttributes { + autoplay?: boolean | undefined + controls?: boolean | undefined + controlslist?: string | undefined + crossorigin?: CrossOrigin + loop?: boolean | undefined + mediagroup?: string | undefined + muted?: boolean | undefined + playsinline?: boolean | undefined + preload?: string | undefined + src?: string | undefined + } - interface MeterHTMLAttributes extends HTMLAttributes { - form?: string | undefined - high?: number | undefined - low?: number | undefined - max?: number | string | undefined - min?: number | string | undefined - optimum?: number | undefined - value?: string | ReadonlyArray | number | undefined - } + interface MetaHTMLAttributes extends HTMLAttributes { + charset?: string | undefined + 'http-equiv'?: string | undefined + name?: string | undefined + media?: string | undefined + content?: string | undefined + } - interface QuoteHTMLAttributes extends HTMLAttributes { - cite?: string | undefined - } + interface MeterHTMLAttributes extends HTMLAttributes { + form?: string | undefined + high?: number | undefined + low?: number | undefined + max?: number | string | undefined + min?: number | string | undefined + optimum?: number | undefined + value?: string | ReadonlyArray | number | undefined + } - interface ObjectHTMLAttributes extends HTMLAttributes { - data?: string | undefined - form?: string | undefined - height?: number | string | undefined - name?: string | undefined - type?: string | undefined - usemap?: string | undefined - width?: number | string | undefined - } + interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined + } - interface OlHTMLAttributes extends HTMLAttributes { - reversed?: boolean | undefined - start?: number | undefined - type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined - } + interface ObjectHTMLAttributes extends HTMLAttributes { + data?: string | undefined + form?: string | undefined + height?: number | string | undefined + name?: string | undefined + type?: string | undefined + usemap?: string | undefined + width?: number | string | undefined + } - interface OptgroupHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined - label?: string | undefined - } + interface OlHTMLAttributes extends HTMLAttributes { + reversed?: boolean | undefined + start?: number | undefined + type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined + } - interface OptionHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined - label?: string | undefined - selected?: boolean | undefined - value?: string | ReadonlyArray | number | undefined - } + interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined + label?: string | undefined + } - interface OutputHTMLAttributes extends HTMLAttributes { - form?: string | undefined - for?: string | undefined - name?: string | undefined - } + interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined + label?: string | undefined + selected?: boolean | undefined + value?: string | ReadonlyArray | number | undefined + } - interface ParamHTMLAttributes extends HTMLAttributes { - name?: string | undefined - value?: string | ReadonlyArray | number | undefined - } + interface OutputHTMLAttributes extends HTMLAttributes { + form?: string | undefined + for?: string | undefined + name?: string | undefined + } - interface ProgressHTMLAttributes extends HTMLAttributes { - max?: number | string | undefined - value?: string | ReadonlyArray | number | undefined - } + interface ParamHTMLAttributes extends HTMLAttributes { + name?: string | undefined + value?: string | ReadonlyArray | number | undefined + } - interface SlotHTMLAttributes extends HTMLAttributes { - name?: string | undefined - } + interface ProgressHTMLAttributes extends HTMLAttributes { + max?: number | string | undefined + value?: string | ReadonlyArray | number | undefined + } - interface ScriptHTMLAttributes extends HTMLAttributes { - async?: boolean | undefined - crossorigin?: CrossOrigin - defer?: boolean | undefined - integrity?: string | undefined - nomodule?: boolean | undefined - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined - src?: string | undefined - type?: string | undefined - } + interface SlotHTMLAttributes extends HTMLAttributes { + name?: string | undefined + } - interface SelectHTMLAttributes extends HTMLAttributes { - autocomplete?: string | undefined - disabled?: boolean | undefined - form?: string | undefined - multiple?: boolean | undefined - name?: string | undefined - required?: boolean | undefined - size?: number | undefined - value?: string | ReadonlyArray | number | undefined - } + interface ScriptHTMLAttributes extends HTMLAttributes { + async?: boolean | undefined + crossorigin?: CrossOrigin + defer?: boolean | undefined + integrity?: string | undefined + nomodule?: boolean | undefined + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined + src?: string | undefined + type?: string | undefined + } - interface SourceHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined - media?: string | undefined - sizes?: string | undefined - src?: string | undefined - srcset?: string | undefined - type?: string | undefined - width?: number | string | undefined - } + interface SelectHTMLAttributes extends HTMLAttributes { + autocomplete?: string | undefined + disabled?: boolean | undefined + form?: string | undefined + multiple?: boolean | undefined + name?: string | undefined + required?: boolean | undefined + size?: number | undefined + value?: string | ReadonlyArray | number | undefined + } - interface StyleHTMLAttributes extends HTMLAttributes { - media?: string | undefined - scoped?: boolean | undefined - type?: string | undefined - } + interface SourceHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined + media?: string | undefined + sizes?: string | undefined + src?: string | undefined + srcset?: string | undefined + type?: string | undefined + width?: number | string | undefined + } - interface TableHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | undefined - bgcolor?: string | undefined - border?: number | undefined - cellpadding?: number | string | undefined - cellspacing?: number | string | undefined - frame?: boolean | undefined - rules?: 'none' | 'groups' | 'rows' | 'columns' | 'all' | undefined - summary?: string | undefined - width?: number | string | undefined - } + interface StyleHTMLAttributes extends HTMLAttributes { + media?: string | undefined + scoped?: boolean | undefined + type?: string | undefined + } - interface TextareaHTMLAttributes extends HTMLAttributes { - autocomplete?: string | undefined - cols?: number | undefined - dirname?: string | undefined - disabled?: boolean | undefined - form?: string | undefined - maxlength?: number | undefined - minlength?: number | undefined - name?: string | undefined - placeholder?: string | undefined - readonly?: boolean | undefined - required?: boolean | undefined - rows?: number | undefined - value?: string | ReadonlyArray | number | undefined - wrap?: string | undefined - } + interface TableHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | undefined + bgcolor?: string | undefined + border?: number | undefined + cellpadding?: number | string | undefined + cellspacing?: number | string | undefined + frame?: boolean | undefined + rules?: 'none' | 'groups' | 'rows' | 'columns' | 'all' | undefined + summary?: string | undefined + width?: number | string | undefined + } - interface TdHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined - colspan?: number | undefined - headers?: string | undefined - rowspan?: number | undefined - scope?: string | undefined - abbr?: string | undefined - height?: number | string | undefined - width?: number | string | undefined - valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined - } + interface TextareaHTMLAttributes extends HTMLAttributes { + autocomplete?: string | undefined + cols?: number | undefined + dirname?: string | undefined + disabled?: boolean | undefined + form?: string | undefined + maxlength?: number | undefined + minlength?: number | undefined + name?: string | undefined + placeholder?: string | undefined + readonly?: boolean | undefined + required?: boolean | undefined + rows?: number | undefined + value?: string | ReadonlyArray | number | undefined + wrap?: string | undefined + } - interface ThHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined - colspan?: number | undefined - headers?: string | undefined - rowspan?: number | undefined - scope?: string | undefined - abbr?: string | undefined - } + interface TdHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined + colspan?: number | undefined + headers?: string | undefined + rowspan?: number | undefined + scope?: string | undefined + abbr?: string | undefined + height?: number | string | undefined + width?: number | string | undefined + valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined + } - interface TimeHTMLAttributes extends HTMLAttributes { - datetime?: string | undefined - } + interface ThHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined + colspan?: number | undefined + headers?: string | undefined + rowspan?: number | undefined + scope?: string | undefined + abbr?: string | undefined + } - interface TrackHTMLAttributes extends HTMLAttributes { - default?: boolean | undefined - kind?: string | undefined - label?: string | undefined - src?: string | undefined - srclang?: string | undefined - } + interface TimeHTMLAttributes extends HTMLAttributes { + datetime?: string | undefined + } - interface VideoHTMLAttributes extends MediaHTMLAttributes { - height?: number | string | undefined - playsinline?: boolean | undefined - poster?: string | undefined - width?: number | string | undefined - disablePictureInPicture?: boolean | undefined - disableRemotePlayback?: boolean | undefined - } + interface TrackHTMLAttributes extends HTMLAttributes { + default?: boolean | undefined + kind?: string | undefined + label?: string | undefined + src?: string | undefined + srclang?: string | undefined + } - interface IntrinsicElements { - a: AnchorHTMLAttributes - abbr: HTMLAttributes - address: HTMLAttributes - area: AreaHTMLAttributes - article: HTMLAttributes - aside: HTMLAttributes - audio: AudioHTMLAttributes - b: HTMLAttributes - base: BaseHTMLAttributes - bdi: HTMLAttributes - bdo: HTMLAttributes - big: HTMLAttributes - blockquote: BlockquoteHTMLAttributes - body: HTMLAttributes - br: HTMLAttributes - button: ButtonHTMLAttributes - canvas: CanvasHTMLAttributes - caption: HTMLAttributes - center: HTMLAttributes - cite: HTMLAttributes - code: HTMLAttributes - col: ColHTMLAttributes - colgroup: ColgroupHTMLAttributes - data: DataHTMLAttributes - datalist: HTMLAttributes - dd: HTMLAttributes - del: DelHTMLAttributes - details: DetailsHTMLAttributes - dfn: HTMLAttributes - dialog: DialogHTMLAttributes - div: HTMLAttributes - dl: HTMLAttributes - dt: HTMLAttributes - em: HTMLAttributes - embed: EmbedHTMLAttributes - fieldset: FieldsetHTMLAttributes - figcaption: HTMLAttributes - figure: HTMLAttributes - footer: HTMLAttributes - form: FormHTMLAttributes - h1: HTMLAttributes - h2: HTMLAttributes - h3: HTMLAttributes - h4: HTMLAttributes - h5: HTMLAttributes - h6: HTMLAttributes - head: HTMLAttributes - header: HTMLAttributes - hgroup: HTMLAttributes - hr: HTMLAttributes - html: HtmlHTMLAttributes - i: HTMLAttributes - iframe: IframeHTMLAttributes - img: ImgHTMLAttributes - input: InputHTMLAttributes - ins: InsHTMLAttributes - kbd: HTMLAttributes - keygen: KeygenHTMLAttributes - label: LabelHTMLAttributes - legend: HTMLAttributes - li: LiHTMLAttributes - link: LinkHTMLAttributes - main: HTMLAttributes - map: MapHTMLAttributes - mark: HTMLAttributes - menu: MenuHTMLAttributes - menuitem: HTMLAttributes - meta: MetaHTMLAttributes - meter: MeterHTMLAttributes - nav: HTMLAttributes - noscript: HTMLAttributes - object: ObjectHTMLAttributes - ol: OlHTMLAttributes - optgroup: OptgroupHTMLAttributes - option: OptionHTMLAttributes - output: OutputHTMLAttributes - p: HTMLAttributes - param: ParamHTMLAttributes - picture: HTMLAttributes - pre: HTMLAttributes - progress: ProgressHTMLAttributes - q: QuoteHTMLAttributes - rp: HTMLAttributes - rt: HTMLAttributes - ruby: HTMLAttributes - s: HTMLAttributes - samp: HTMLAttributes - search: HTMLAttributes - slot: SlotHTMLAttributes - script: ScriptHTMLAttributes - section: HTMLAttributes - select: SelectHTMLAttributes - small: HTMLAttributes - source: SourceHTMLAttributes - span: HTMLAttributes - strong: HTMLAttributes - style: StyleHTMLAttributes - sub: HTMLAttributes - summary: HTMLAttributes - sup: HTMLAttributes - table: TableHTMLAttributes - template: HTMLAttributes - tbody: HTMLAttributes - td: TdHTMLAttributes - textarea: TextareaHTMLAttributes - tfoot: HTMLAttributes - th: ThHTMLAttributes - thead: HTMLAttributes - time: TimeHTMLAttributes - title: HTMLAttributes - tr: HTMLAttributes - track: TrackHTMLAttributes - u: HTMLAttributes - ul: HTMLAttributes - var: HTMLAttributes - video: VideoHTMLAttributes - wbr: HTMLAttributes - } + interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: number | string | undefined + playsinline?: boolean | undefined + poster?: string | undefined + width?: number | string | undefined + disablePictureInPicture?: boolean | undefined + disableRemotePlayback?: boolean | undefined + } + + export interface IntrinsicElements { + a: AnchorHTMLAttributes + abbr: HTMLAttributes + address: HTMLAttributes + area: AreaHTMLAttributes + article: HTMLAttributes + aside: HTMLAttributes + audio: AudioHTMLAttributes + b: HTMLAttributes + base: BaseHTMLAttributes + bdi: HTMLAttributes + bdo: HTMLAttributes + big: HTMLAttributes + blockquote: BlockquoteHTMLAttributes + body: HTMLAttributes + br: HTMLAttributes + button: ButtonHTMLAttributes + canvas: CanvasHTMLAttributes + caption: HTMLAttributes + center: HTMLAttributes + cite: HTMLAttributes + code: HTMLAttributes + col: ColHTMLAttributes + colgroup: ColgroupHTMLAttributes + data: DataHTMLAttributes + datalist: HTMLAttributes + dd: HTMLAttributes + del: DelHTMLAttributes + details: DetailsHTMLAttributes + dfn: HTMLAttributes + dialog: DialogHTMLAttributes + div: HTMLAttributes + dl: HTMLAttributes + dt: HTMLAttributes + em: HTMLAttributes + embed: EmbedHTMLAttributes + fieldset: FieldsetHTMLAttributes + figcaption: HTMLAttributes + figure: HTMLAttributes + footer: HTMLAttributes + form: FormHTMLAttributes + h1: HTMLAttributes + h2: HTMLAttributes + h3: HTMLAttributes + h4: HTMLAttributes + h5: HTMLAttributes + h6: HTMLAttributes + head: HTMLAttributes + header: HTMLAttributes + hgroup: HTMLAttributes + hr: HTMLAttributes + html: HtmlHTMLAttributes + i: HTMLAttributes + iframe: IframeHTMLAttributes + img: ImgHTMLAttributes + input: InputHTMLAttributes + ins: InsHTMLAttributes + kbd: HTMLAttributes + keygen: KeygenHTMLAttributes + label: LabelHTMLAttributes + legend: HTMLAttributes + li: LiHTMLAttributes + link: LinkHTMLAttributes + main: HTMLAttributes + map: MapHTMLAttributes + mark: HTMLAttributes + menu: MenuHTMLAttributes + menuitem: HTMLAttributes + meta: MetaHTMLAttributes + meter: MeterHTMLAttributes + nav: HTMLAttributes + noscript: HTMLAttributes + object: ObjectHTMLAttributes + ol: OlHTMLAttributes + optgroup: OptgroupHTMLAttributes + option: OptionHTMLAttributes + output: OutputHTMLAttributes + p: HTMLAttributes + param: ParamHTMLAttributes + picture: HTMLAttributes + pre: HTMLAttributes + progress: ProgressHTMLAttributes + q: QuoteHTMLAttributes + rp: HTMLAttributes + rt: HTMLAttributes + ruby: HTMLAttributes + s: HTMLAttributes + samp: HTMLAttributes + search: HTMLAttributes + slot: SlotHTMLAttributes + script: ScriptHTMLAttributes + section: HTMLAttributes + select: SelectHTMLAttributes + small: HTMLAttributes + source: SourceHTMLAttributes + span: HTMLAttributes + strong: HTMLAttributes + style: StyleHTMLAttributes + sub: HTMLAttributes + summary: HTMLAttributes + sup: HTMLAttributes + table: TableHTMLAttributes + template: HTMLAttributes + tbody: HTMLAttributes + td: TdHTMLAttributes + textarea: TextareaHTMLAttributes + tfoot: HTMLAttributes + th: ThHTMLAttributes + thead: HTMLAttributes + time: TimeHTMLAttributes + title: HTMLAttributes + tr: HTMLAttributes + track: TrackHTMLAttributes + u: HTMLAttributes + ul: HTMLAttributes + var: HTMLAttributes + video: VideoHTMLAttributes + wbr: HTMLAttributes } } diff --git a/src/jsx/jsx-dev-runtime.ts b/src/jsx/jsx-dev-runtime.ts index 7692ca7e0..7ff2bc846 100644 --- a/src/jsx/jsx-dev-runtime.ts +++ b/src/jsx/jsx-dev-runtime.ts @@ -2,6 +2,7 @@ import type { HtmlEscapedString } from '../utils/html' import { jsxFn } from './base' import type { JSXNode } from './base' export { Fragment } from './base' +export type { JSX } from './base' export function jsxDEV( tag: string | Function, diff --git a/src/jsx/jsx-runtime.ts b/src/jsx/jsx-runtime.ts index d75da1697..4633334e6 100644 --- a/src/jsx/jsx-runtime.ts +++ b/src/jsx/jsx-runtime.ts @@ -1,5 +1,6 @@ export { jsxDEV as jsx, Fragment } from './jsx-dev-runtime' export { jsxDEV as jsxs } from './jsx-dev-runtime' +export type { JSX } from './jsx-dev-runtime' import { raw, html } from '../helper/html' import type { HtmlEscapedString } from '../utils/html' diff --git a/src/jsx/streaming.test.tsx b/src/jsx/streaming.test.tsx index c5cd55792..f63c5c810 100644 --- a/src/jsx/streaming.test.tsx +++ b/src/jsx/streaming.test.tsx @@ -1,10 +1,9 @@ +/** @jsxImportSource ./ */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { JSDOM } from 'jsdom' import { raw } from '../helper/html' import { HtmlEscapedCallbackPhase, resolveCallback } from '../utils/html' import type { HtmlEscapedString } from '../utils/html' -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx, Fragment } from './base' import { use } from './hooks' import { Suspense, renderToReadableStream } from './streaming' diff --git a/src/jsx/types.ts b/src/jsx/types.ts index 85d2c2b9d..552ae6ad6 100644 --- a/src/jsx/types.ts +++ b/src/jsx/types.ts @@ -2,6 +2,7 @@ * All types exported from "hono/jsx" are in this file. */ import type { Child, JSXNode } from './base' +import type { Hono } from './intrinsic-elements' export type { Child, JSXNode, FC } from './base' export type { RefObject } from './hooks' diff --git a/src/middleware/jsx-renderer/index.test.tsx b/src/middleware/jsx-renderer/index.test.tsx index 486676171..17f979999 100644 --- a/src/middleware/jsx-renderer/index.test.tsx +++ b/src/middleware/jsx-renderer/index.test.tsx @@ -1,8 +1,7 @@ +/** @jsxImportSource ../../jsx */ import { expectTypeOf } from 'vitest' import { html } from '../../helper/html' import { Hono } from '../../hono' -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { jsx, Fragment } from '../../jsx' import type { FC } from '../../jsx' import { Suspense } from '../../jsx/streaming' import { jsxRenderer, useRequestContext } from '.' diff --git a/vitest.config.ts b/vitest.config.ts index bb9f07a08..90470c8b3 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,6 +2,10 @@ import { configDefaults, defineConfig } from 'vitest/config' export default defineConfig({ + esbuild: { + jsx: 'automatic', + jsxImportSource: __dirname + '/../src/jsx', + }, test: { globals: true, include: ['**/src/**/(*.)+(spec|test).+(ts|tsx|js)'],