Skip to content
Myr

feat(jsx): improve input attribute types based on react (#3302)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

ref. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/865051c6befe8d67f7ac2fdcac6cdf4922c1dc83/types/react/index.d.ts#L3263-L3389

authored by TOMIKAWA Sotaro · committed by GitHub · parent 331b3d8 · Browse files · 1 file+63 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+63 added−3 removed

  • other:+63 added−3 removed

1 file+63 added−3 removed

modified:src/jsx/intrinsic-elements.ts+63 added-3 removed
345 unmodified lines
346 cite?: string | undefined347 datetime?: string | undefined348 }349350 type HTMLInputTypeAttribute =350 type HTMLInputTypeAttribute = StringLiteralUnion<351 | 'button'352 | 'checkbox'353 | 'color'354 | 'date'
14 unmodified lines
369 | 'text'370 | 'time'371 | 'url'372 | 'week'373 | string373 >374 type AutoFillAddressKind = 'billing' | 'shipping'375 type AutoFillBase = '' | 'off' | 'on'376 type AutoFillContactField =377 | 'email'378 | 'tel'379 | 'tel-area-code'380 | 'tel-country-code'381 | 'tel-extension'382 | 'tel-local'383 | 'tel-local-prefix'384 | 'tel-local-suffix'385 | 'tel-national'386 type AutoFillContactKind = 'home' | 'mobile' | 'work'387 type AutoFillCredentialField = 'webauthn'388 type AutoFillNormalField =389 | 'additional-name'390 | 'address-level1'391 | 'address-level2'392 | 'address-level3'393 | 'address-level4'394 | 'address-line1'395 | 'address-line2'396 | 'address-line3'397 | 'bday-day'398 | 'bday-month'399 | 'bday-year'400 | 'cc-csc'401 | 'cc-exp'402 | 'cc-exp-month'403 | 'cc-exp-year'404 | 'cc-family-name'405 | 'cc-given-name'406 | 'cc-name'407 | 'cc-number'408 | 'cc-type'409 | 'country'410 | 'country-name'411 | 'current-password'412 | 'family-name'413 | 'given-name'414 | 'honorific-prefix'415 | 'honorific-suffix'416 | 'name'417 | 'new-password'418 | 'one-time-code'419 | 'organization'420 | 'postal-code'421 | 'street-address'422 | 'transaction-amount'423 | 'transaction-currency'424 | 'username'425 type OptionalPrefixToken<T extends string> = `${T} ` | ''426 type OptionalPostfixToken<T extends string> = ` ${T}` | ''427 type AutoFillField =428 | AutoFillNormalField429 | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`430 type AutoFillSection = `section-${string}`431 type AutoFill =432 | AutoFillBase433 | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`434435 interface InputHTMLAttributes extends HTMLAttributes {436 accept?: string | undefined437 alt?: string | undefined378 autocomplete?: string | undefined438 autocomplete?: StringLiteralUnion<AutoFill> | undefined439 capture?: boolean | 'user' | 'environment' | undefined // https://www.w3.org/TR/html-media-capture/#the-capture-attribute440 checked?: boolean | undefined441 disabled?: boolean | undefined442 form?: string | undefined
457 unmodified lines