Skip to content

Commit 282334f

Browse files
committed
add sample zero cost variant version of docgen representation
1 parent b40aa64 commit 282334f

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tools/src/Tools_Docgen2.res

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
type recordField = {
2+
name: string,
3+
deprecated?: string,
4+
optional: bool,
5+
docstrings: array<string>,
6+
signature: string,
7+
}
8+
9+
type constructor = {
10+
name: string,
11+
deprecated?: string,
12+
optional: bool,
13+
docstrings: array<string>,
14+
signature: string,
15+
}
16+
17+
@tag("kind")
18+
type typeDetail =
19+
| @as("record") Record({items: array<recordField>})
20+
| @as("variant") Variant({items: array<constructor>})
21+
22+
@tag("kind")
23+
type rec docItem =
24+
| @as("value")
25+
Value({
26+
id: string,
27+
name: string,
28+
deprecated?: string,
29+
signature: string,
30+
docstrings: array<string>,
31+
})
32+
| @as("type")
33+
Type({
34+
id: string,
35+
name: string,
36+
deprecated?: string,
37+
signature: string,
38+
detail?: typeDetail,
39+
})
40+
| @as("module") Module({id: string, name: string, items: array<docItem>})
41+
| @as("moduleAlias")
42+
ModuleAlias({
43+
id: string,
44+
name: string,
45+
docstrings: array<string>,
46+
items: array<docItem>,
47+
})
48+
49+
type docsForModule = {
50+
name: string,
51+
deprecated?: string,
52+
docstrings: array<string>,
53+
items: array<docItem>,
54+
}

0 commit comments

Comments
 (0)