Skip to content
Myr

feat(jsx): improve meta-tag types with well known values (#3276)

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

* fix(jsx): improve meta-tag types with well known values * refactor(jsx): make more strict types

authored by TOMIKAWA Sotaro · committed by GitHub · parent 0c1e899 · Browse files · 1 file+57 added−4 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+57 added−4 removed

  • other:+57 added−4 removed

1 file+57 added−4 removed

modified:src/jsx/intrinsic-elements.ts+57 added-4 removed
464 unmodified lines
465 preload?: string | undefined466 src?: string | undefined467 }468469 /**470 * String literal types with auto-completion471 * @see https://github.com/Microsoft/TypeScript/issues/29729472 */473 type LiteralUnion<T> = T | (string & Record<never, never>)474 /**475 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#http-equiv476 */477 type MetaHttpEquiv =478 | 'content-security-policy'479 | 'content-type'480 | 'default-style'481 | 'x-ua-compatible'482 | 'refresh'483 /**484 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name485 */486 type MetaName =487 | 'application-name'488 | 'author'489 | 'description'490 | 'generator'491 | 'keywords'492 | 'referrer'493 | 'theme-color'494 | 'color-scheme'495 | 'viewport'496 | 'creator'497 | 'googlebot'498 | 'publisher'499 | 'robots'500 /**501 * @see https://ogp.me/502 */503 type MetaProperty =504 | 'og:title'505 | 'og:type'506 | 'og:image'507 | 'og:url'508 | 'og:audio'509 | 'og:description'510 | 'og:determiner'511 | 'og:locale'512 | 'og:locale:alternate'513 | 'og:site_name'514 | 'og:video'515 | 'og:image:url'516 | 'og:image:secure_url'517 | 'og:image:type'518 | 'og:image:width'519 | 'og:image:height'520 | 'og:image:alt'521 interface MetaHTMLAttributes extends HTMLAttributes {470 charset?: string | undefined471 'http-equiv'?: string | undefined472 name?: string | undefined522 charset?: LiteralUnion<'utf-8'> | undefined523 'http-equiv'?: LiteralUnion<MetaHttpEquiv> | undefined524 name?: LiteralUnion<MetaName> | undefined525 media?: string | undefined526 content?: string | undefined527 property?: LiteralUnion<MetaProperty> | undefined528529 // React 19 compatibility477 httpEquiv?: string | undefined530 httpEquiv?: LiteralUnion<MetaHttpEquiv> | undefined531 }532533 interface MeterHTMLAttributes extends HTMLAttributes {534 form?: string | undefined
307 unmodified lines