-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathTools_Docgen.res
71 lines (65 loc) · 1.47 KB
/
Tools_Docgen.res
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
59
60
61
62
63
64
65
66
67
68
69
70
71
type field = {
name: string,
docstrings: array<string>,
signature: string,
optional: bool,
deprecated?: string,
}
@tag("kind")
type constructorPayload = | @as("inlineRecord") InlineRecord({fields: array<field>})
type constructor = {
name: string,
docstrings: array<string>,
signature: string,
deprecated?: string,
payload?: constructorPayload,
}
@tag("kind")
type detail =
| @as("record") Record({items: array<field>})
| @as("variant") Variant({items: array<constructor>})
@tag("kind")
type rec item =
| @as("value")
Value({
id: string,
docstrings: array<string>,
signature: string,
name: string,
deprecated?: string,
})
| @as("type")
Type({
id: string,
docstrings: array<string>,
signature: string,
name: string,
deprecated?: string,
/** Additional documentation for constructors and record fields, if available. */
detail?: detail,
})
| @as("module")
Module({
id: string,
docstrings: array<string>,
deprecated?: string,
name: string,
items: array<item>,
})
| @as("moduleAlias")
ModuleAlias({
id: string,
docstrings: array<string>,
name: string,
items: array<item>,
})
type doc = {
name: string,
deprecated: option<string>,
docstrings: array<string>,
items: array<item>,
}
/**
`decodeFromJson(json)` parse JSON generated from `restool doc` command
*/
external decodeFromJson: Js.Json.t => doc = "%identity"