/
docs.mli
58 lines (49 loc) · 1.42 KB
/
docs.mli
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
53
54
55
56
57
58
type DOMText := {
data: String,
type: "DOMTextNode",
nodeType: 3,
constructor: (value: String) => DOMText,
toString: () => String
}
type DOMNode := DOMText | DOMElement | DocumentFragment
type DOMChild := DOMText | DOMElement
type DOMElement := {
tagName: String,
className: String,
dataset: Object<String, Any>,
childNodes: Array<DOMChild>,
parentNode: null | DOMElement,
style: Object<String, String>,
type: "DOMElement",
nodeType: 1,
constructor: (tagName: String) => DOMElement,
appendChild: (child: DOMNode),
removeChild: (child: DOMChild),
replaceChild: (elem: DOMNode, needle: DOMChild),
focus: () => void,
toString: () => String
}
type DocumentFragment := {
childNodes: Array<DOMChild>,
parentNode: null | DOMElement,
type: "DocumentFragment",
nodeType: 11,
nodeName: "#document-fragment",
constructor: () => DocumentFragment,
appendChild
replaceChild
removeChild
toString: () => String
}
type Document := {
body: DOMElement,
Document: () => Document,
Text: (value: String) => DOMText,
Element: (tagName: String) => DOMElement,
DocumentFragment: () => DocumentFragment,
createTextNode: (value: String) => DOMText,
createElement: (tagName: String) => Element,
createDocumentFragment: () => DocumentFragment,
getElementById: (id: String) => null | Element
}
min-document := Document