UNPKG

1.15 kBJavaScriptView Raw
1/**
2 * A check type enum-like object. Uses integer values for fast match() lookup.
3 * The ordering does not matter as long as the ints are unique.
4 */
5const Type = {
6 /** E.g. node */
7 GROUP: 0,
8
9 /** A collection of elements */
10 COLLECTION: 1,
11
12 /** A filter(ele) function */
13 FILTER: 2,
14
15 /** E.g. [foo > 1] */
16 DATA_COMPARE: 3,
17
18 /** E.g. [foo] */
19 DATA_EXIST: 4,
20
21 /** E.g. [?foo] */
22 DATA_BOOL: 5,
23
24 /** E.g. [[degree > 2]] */
25 META_COMPARE: 6,
26
27 /** E.g. :selected */
28 STATE: 7,
29
30 /** E.g. #foo */
31 ID: 8,
32
33 /** E.g. .foo */
34 CLASS: 9,
35
36 /** E.g. #foo <-> #bar */
37 UNDIRECTED_EDGE: 10,
38
39 /** E.g. #foo -> #bar */
40 DIRECTED_EDGE: 11,
41
42 /** E.g. $#foo -> #bar */
43 NODE_SOURCE: 12,
44
45 /** E.g. #foo -> $#bar */
46 NODE_TARGET: 13,
47
48 /** E.g. $#foo <-> #bar */
49 NODE_NEIGHBOR: 14,
50
51 /** E.g. #foo > #bar */
52 CHILD: 15,
53
54 /** E.g. #foo #bar */
55 DESCENDANT: 16,
56
57 /** E.g. $#foo > #bar */
58 PARENT: 17,
59
60 /** E.g. $#foo #bar */
61 ANCESTOR: 18,
62
63 /** E.g. #foo > $bar > #baz */
64 COMPOUND_SPLIT: 19,
65
66 /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */
67 TRUE: 20
68};
69
70export default Type;
\No newline at end of file