]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: update `TextareaHTMLAttributes` and `InputHTMLAttributes` (#6294)
authorOrbisK <37191683+OrbisK@users.noreply.github.com>
Sun, 9 Jul 2023 05:05:18 +0000 (07:05 +0200)
committerGitHub <noreply@github.com>
Sun, 9 Jul 2023 05:05:18 +0000 (13:05 +0800)
* types: update `TextareaHTMLAttributes` and `InputHTMLAttributes`

add `InputTypeHTMLAttribute` (from `@types/react`) to `InputHTMLAttributes['type' ]`

* chore: format

---------

Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
packages/runtime-dom/src/jsx.ts

index d103278c6e665adfced9ddefc623207d7b3c7070..3826c14faaf740f80116c1a8bf74bb52143bbabb 100644 (file)
@@ -464,6 +464,31 @@ export interface InsHTMLAttributes extends HTMLAttributes {
   datetime?: string
 }
 
+export type InputTypeHTMLAttribute =
+  | 'button'
+  | 'checkbox'
+  | 'color'
+  | 'date'
+  | 'datetime-local'
+  | 'email'
+  | 'file'
+  | 'hidden'
+  | 'image'
+  | 'month'
+  | 'number'
+  | 'password'
+  | 'radio'
+  | 'range'
+  | 'reset'
+  | 'search'
+  | 'submit'
+  | 'tel'
+  | 'text'
+  | 'time'
+  | 'url'
+  | 'week'
+  | (string & {})
+
 export interface InputHTMLAttributes extends HTMLAttributes {
   accept?: string
   alt?: string
@@ -495,7 +520,7 @@ export interface InputHTMLAttributes extends HTMLAttributes {
   size?: Numberish
   src?: string
   step?: Numberish
-  type?: string
+  type?: InputTypeHTMLAttribute
   value?: any // we support :value to be bound to anything w/ v-model
   width?: Numberish
 }
@@ -677,7 +702,7 @@ export interface TextareaHTMLAttributes extends HTMLAttributes {
   minlength?: Numberish
   name?: string
   placeholder?: string
-  readonly?: boolean
+  readonly?: Booleanish
   required?: Booleanish
   rows?: Numberish
   value?: string | string[] | number