Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtime-dom): update type definition for jsx #8607

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 30 additions & 7 deletions packages/runtime-dom/src/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export interface ButtonHTMLAttributes extends HTMLAttributes {
formtarget?: string
name?: string
type?: 'submit' | 'reset' | 'button'
value?: string | string[] | number
value?: string | ReadonlyArray<string> | number
}

export interface CanvasHTMLAttributes extends HTMLAttributes {
Expand All @@ -384,11 +384,12 @@ export interface ColgroupHTMLAttributes extends HTMLAttributes {
}

export interface DataHTMLAttributes extends HTMLAttributes {
value?: string | string[] | number
value?: string | ReadonlyArray<string> | number
}

export interface DetailsHTMLAttributes extends HTMLAttributes {
open?: Booleanish
onToggle?: Event
}

export interface DelHTMLAttributes extends HTMLAttributes {
Expand Down Expand Up @@ -432,13 +433,17 @@ export interface IframeHTMLAttributes extends HTMLAttributes {
allow?: string
allowfullscreen?: Booleanish
allowtransparency?: Booleanish
/** @deprecated */
frameborder?: Numberish
height?: Numberish
/** @deprecated */
marginheight?: Numberish
/** @deprecated */
marginwidth?: Numberish
name?: string
referrerpolicy?: HTMLAttributeReferrerPolicy
sandbox?: string
/** @deprecated */
scrolling?: string
seamless?: Booleanish
src?: string
Expand All @@ -451,6 +456,7 @@ export interface ImgHTMLAttributes extends HTMLAttributes {
crossorigin?: 'anonymous' | 'use-credentials' | ''
decoding?: 'async' | 'auto' | 'sync'
height?: Numberish
loading?: 'eager' | 'lazy'
referrerpolicy?: HTMLAttributeReferrerPolicy
sizes?: string
src?: string
Expand All @@ -473,6 +479,14 @@ export interface InputHTMLAttributes extends HTMLAttributes {
checked?: Booleanish | any[] | Set<any> // for IDE v-model multi-checkbox support
crossorigin?: string
disabled?: Booleanish
enterKeyHint?:
| 'enter'
| 'done'
| 'go'
| 'next'
| 'previous'
| 'search'
| 'send'
form?: string
formaction?: string
formenctype?: string
Expand Down Expand Up @@ -516,7 +530,7 @@ export interface LabelHTMLAttributes extends HTMLAttributes {
}

export interface LiHTMLAttributes extends HTMLAttributes {
value?: string | string[] | number
value?: string | ReadonlyArray<string> | number
}

export interface LinkHTMLAttributes extends HTMLAttributes {
Expand All @@ -530,6 +544,7 @@ export interface LinkHTMLAttributes extends HTMLAttributes {
rel?: string
sizes?: string
type?: string
charset?: string
}

export interface MapHTMLAttributes extends HTMLAttributes {
Expand Down Expand Up @@ -567,7 +582,7 @@ export interface MeterHTMLAttributes extends HTMLAttributes {
max?: Numberish
min?: Numberish
optimum?: Numberish
value?: string | string[] | number
value?: string | ReadonlyArray<string> | number
}

export interface QuoteHTMLAttributes extends HTMLAttributes {
Expand Down Expand Up @@ -612,16 +627,17 @@ export interface OutputHTMLAttributes extends HTMLAttributes {

export interface ParamHTMLAttributes extends HTMLAttributes {
name?: string
value?: string | string[] | number
value?: string | ReadonlyArray<string> | number
}

export interface ProgressHTMLAttributes extends HTMLAttributes {
max?: Numberish
value?: string | string[] | number
value?: string | ReadonlyArray<string> | number
}

export interface ScriptHTMLAttributes extends HTMLAttributes {
async?: Booleanish
/** @deprecated */
charset?: string
crossorigin?: string
defer?: Booleanish
Expand Down Expand Up @@ -664,6 +680,7 @@ export interface TableHTMLAttributes extends HTMLAttributes {
cellpadding?: Numberish
cellspacing?: Numberish
summary?: string
width?: Numberish
}

export interface TextareaHTMLAttributes extends HTMLAttributes {
Expand All @@ -680,7 +697,7 @@ export interface TextareaHTMLAttributes extends HTMLAttributes {
readonly?: boolean
required?: Booleanish
rows?: Numberish
value?: string | string[] | number
value?: string | ReadonlyArray<string> | number
wrap?: string
}

Expand All @@ -690,6 +707,9 @@ export interface TdHTMLAttributes extends HTMLAttributes {
headers?: string
rowspan?: Numberish
scope?: string
abbr?: string
height?: Numberish
width?: Numberish
valign?: 'top' | 'middle' | 'bottom' | 'baseline'
}

Expand All @@ -699,6 +719,7 @@ export interface ThHTMLAttributes extends HTMLAttributes {
headers?: string
rowspan?: Numberish
scope?: string
abbr?: string
}

export interface TimeHTMLAttributes extends HTMLAttributes {
Expand All @@ -719,6 +740,7 @@ export interface VideoHTMLAttributes extends MediaHTMLAttributes {
poster?: string
width?: Numberish
disablePictureInPicture?: Booleanish
disableRemotePlayback?: Booleanish
}

export interface WebViewHTMLAttributes extends HTMLAttributes {
Expand Down Expand Up @@ -767,6 +789,7 @@ export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
// Other HTML properties supported by SVG elements in browsers
role?: string
tabindex?: Numberish
crossOrigin?: 'anonymous' | 'use-credentials' | ''

// SVG Specific attributes
'accent-height'?: Numberish
Expand Down