-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
jsx-automatic.d.ts
42 lines (38 loc) · 1.03 KB
/
jsx-automatic.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import {HProperties, HChild, HResult} from './core.js'
export namespace JSX {
/**
* This defines the return value of JSX syntax.
*/
type Element = HResult
/**
* This disallows the use of functional components.
*/
type IntrinsicAttributes = never
/**
* This defines the prop types for known elements.
*
* For `hastscript` this defines any string may be used in combination with `hast` `Properties`.
*
* This **must** be an interface.
*/
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface IntrinsicElements {
[name: string]:
| HProperties
| {
/**
* The prop that matches `ElementChildrenAttribute` key defines the type of JSX children, defines the children type.
*/
children?: HChild
}
}
/**
* The key of this interface defines as what prop children are passed.
*/
interface ElementChildrenAttribute {
/**
* Only the key matters, not the value.
*/
children?: never
}
}