1
1
/* eslint-disable @typescript-eslint/no-explicit-any */
2
2
3
+ import type { BaseMime } from '../utils/mime'
4
+ import type { StringLiteralUnion } from '../utils/types'
5
+
3
6
/**
4
7
* This code is based on React.
5
8
* https://github.com/facebook/react
@@ -199,7 +202,7 @@ export namespace JSX {
199
202
| 'strict-origin-when-cross-origin'
200
203
| 'unsafe-url'
201
204
202
- type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | string
205
+ type HTMLAttributeAnchorTarget = StringLiteralUnion < '_self' | '_blank' | '_parent' | '_top' >
203
206
204
207
interface AnchorHTMLAttributes extends HTMLAttributes {
205
208
download ?: string | boolean | undefined
@@ -208,7 +211,7 @@ export namespace JSX {
208
211
media ?: string | undefined
209
212
ping ?: string | undefined
210
213
target ?: HTMLAttributeAnchorTarget | undefined
211
- type ?: string | undefined
214
+ type ?: StringLiteralUnion < BaseMime > | undefined
212
215
referrerpolicy ?: HTMLAttributeReferrerPolicy | undefined
213
216
}
214
217
@@ -466,11 +469,6 @@ export namespace JSX {
466
469
src ?: string | undefined
467
470
}
468
471
469
- /**
470
- * String literal types with auto-completion
471
- * @see https://github.com/Microsoft/TypeScript/issues/29729
472
- */
473
- type LiteralUnion < T > = T | ( string & Record < never , never > )
474
472
/**
475
473
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#http-equiv
476
474
*/
@@ -519,15 +517,15 @@ export namespace JSX {
519
517
| 'og:image:height'
520
518
| 'og:image:alt'
521
519
interface MetaHTMLAttributes extends HTMLAttributes {
522
- charset ?: LiteralUnion < 'utf-8' > | undefined
523
- 'http-equiv' ?: LiteralUnion < MetaHttpEquiv > | undefined
524
- name ?: LiteralUnion < MetaName > | undefined
520
+ charset ?: StringLiteralUnion < 'utf-8' > | undefined
521
+ 'http-equiv' ?: StringLiteralUnion < MetaHttpEquiv > | undefined
522
+ name ?: StringLiteralUnion < MetaName > | undefined
525
523
media ?: string | undefined
526
524
content ?: string | undefined
527
- property ?: LiteralUnion < MetaProperty > | undefined
525
+ property ?: StringLiteralUnion < MetaProperty > | undefined
528
526
529
527
// React 19 compatibility
530
- httpEquiv ?: LiteralUnion < MetaHttpEquiv > | undefined
528
+ httpEquiv ?: StringLiteralUnion < MetaHttpEquiv > | undefined
531
529
}
532
530
533
531
interface MeterHTMLAttributes extends HTMLAttributes {
0 commit comments