-
Notifications
You must be signed in to change notification settings - Fork 57
/
everything.atd
65 lines (55 loc) · 1.48 KB
/
everything.atd
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
<python text="# This was inserted by the user.">
<python json_py.text="import deco">
<python json_py.text="from dataclasses import dataclass">
type kind = [
| Root (* class name conflict *)
| Thing of int
| WOW <json name="wow">
| Amaze <json name="!!!"> of string list
]
type frozen
<python decorator="dataclass(frozen=True)"> = [
| A
| B of int
]
type ('a, 'b) parametrized_record = {
field_a: 'a;
~field_b: 'b list;
}
type 'a parametrized_tuple = ('a * 'a * int)
type root = {
id <json name="ID">: string;
await: bool;
__init__: float;
items: int list list;
?maybe: int option;
~extras: int list;
~answer <python default="42">: int;
aliased: alias;
point: (float * float);
kinds: kind list;
assoc1: (float * int) list;
assoc2: (string * int) list <json repr="object">;
assoc3: (float * int) list <python repr="dict">;
assoc4: (string * int) list <json repr="object"> <python repr="dict">;
nullables: int nullable list;
options: int option list;
untyped_things: abstract list;
parametrized_record: (int, float) parametrized_record;
parametrized_tuple: kind parametrized_tuple;
}
type alias = int list
type pair = (string * int)
type require_field <python decorator="deco.deco1"
decorator="deco.deco2(42)"
decorator="dataclass(order=True)"> = {
req: string;
}
type recursive_class = {
id: int;
flag: bool;
children: recursive_class list;
}
type default_list = {
~items: int list;
}