-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsx.d.ts
52 lines (49 loc) · 1.26 KB
/
jsx.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
43
44
45
46
47
48
49
50
51
52
import Subscriber from '../xylem-js/types/Subscriber.js';
import Supplier from '../xylem-js/types/Supplier.js';
type PrimitiveAttribute = boolean|string|number|null|undefined;
type Attribute = (
PrimitiveAttribute
| Supplier<PrimitiveAttribute>
);
export namespace JSX {
interface IntrinsicElements {
[tagName: string]: (
{
class?:
Attribute
| { [className: string]: Supplier<boolean> }
| Array<
string
| Supplier<string>
| { [className: string]: Supplier<boolean> }
>,
style?:
Attribute
| { [propertyName: string] : Supplier<false|string> }
| Array<
string
| Supplier<string>
| { [propertyName: string]: Supplier<false|string> }
>,
[event: `on:${string}`]: EventListenerOrEventListenerObject,
'<>'?: Subscriber<HTMLElement>,
}
&
{
// this has to be superset of previous types
[other: string]:
Attribute
| { [className: string]: Supplier<boolean> }
| { [propertyName: string]: Supplier<false|string> }
| Array<
string
| Supplier<string>
| { [className: string]: Supplier<boolean> }
| { [propertyName: string]: Supplier<false|string> }
>
| EventListenerOrEventListenerObject
| Subscriber<HTMLElement>
}
),
}
}