Skip to content

Commit 7121c92

Browse files
OrbisKsxzz
andauthored
types: update TextareaHTMLAttributes and InputHTMLAttributes (#6294)
* types: update `TextareaHTMLAttributes` and `InputHTMLAttributes` add `InputTypeHTMLAttribute` (from `@types/react`) to `InputHTMLAttributes['type' ]` * chore: format --------- Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
1 parent 5ee992c commit 7121c92

File tree

1 file changed

+27
-2
lines changed
  • packages/runtime-dom/src

1 file changed

+27
-2
lines changed

packages/runtime-dom/src/jsx.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,31 @@ export interface InsHTMLAttributes extends HTMLAttributes {
464464
datetime?: string
465465
}
466466

467+
export type InputTypeHTMLAttribute =
468+
| 'button'
469+
| 'checkbox'
470+
| 'color'
471+
| 'date'
472+
| 'datetime-local'
473+
| 'email'
474+
| 'file'
475+
| 'hidden'
476+
| 'image'
477+
| 'month'
478+
| 'number'
479+
| 'password'
480+
| 'radio'
481+
| 'range'
482+
| 'reset'
483+
| 'search'
484+
| 'submit'
485+
| 'tel'
486+
| 'text'
487+
| 'time'
488+
| 'url'
489+
| 'week'
490+
| (string & {})
491+
467492
export interface InputHTMLAttributes extends HTMLAttributes {
468493
accept?: string
469494
alt?: string
@@ -495,7 +520,7 @@ export interface InputHTMLAttributes extends HTMLAttributes {
495520
size?: Numberish
496521
src?: string
497522
step?: Numberish
498-
type?: string
523+
type?: InputTypeHTMLAttribute
499524
value?: any // we support :value to be bound to anything w/ v-model
500525
width?: Numberish
501526
}
@@ -677,7 +702,7 @@ export interface TextareaHTMLAttributes extends HTMLAttributes {
677702
minlength?: Numberish
678703
name?: string
679704
placeholder?: string
680-
readonly?: boolean
705+
readonly?: Booleanish
681706
required?: Booleanish
682707
rows?: Numberish
683708
value?: string | string[] | number

0 commit comments

Comments
 (0)