-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjsx.d.ts
37 lines (33 loc) · 819 Bytes
/
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
declare namespace JSX {
interface Element {
type: string | Function;
props: any;
}
interface IntrinsicElements {
div: HTMLAttributes;
span: HTMLAttributes;
button: ButtonHTMLAttributes;
input: InputHTMLAttributes;
p: HTMLAttributes;
h1: HTMLAttributes;
// add more as needed
}
interface HTMLAttributes {
style?: string;
className?: string;
onClick?: (e: MouseEvent) => void;
children?: any;
[key: string]: any;
}
interface ButtonHTMLAttributes extends HTMLAttributes {
type?: "button" | "submit" | "reset";
disabled?: boolean;
}
interface InputHTMLAttributes extends HTMLAttributes {
value?: string | number;
type?: string;
placeholder?: string;
onInput?: (e: Event) => void;
onChange?: (e: Event) => void;
}
}