From: OrbisK <37191683+OrbisK@users.noreply.github.com> Date: Sun, 9 Jul 2023 05:05:18 +0000 (+0200) Subject: types: update `TextareaHTMLAttributes` and `InputHTMLAttributes` (#6294) X-Git-Tag: v3.3.5~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7121c925c5bcdd1d00f88d454049a7b5e30e1926;p=thirdparty%2Fvuejs%2Fcore.git 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 --- diff --git a/packages/runtime-dom/src/jsx.ts b/packages/runtime-dom/src/jsx.ts index d103278c6e..3826c14faa 100644 --- a/packages/runtime-dom/src/jsx.ts +++ b/packages/runtime-dom/src/jsx.ts @@ -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