-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
types.js
58 lines (47 loc) · 1.57 KB
/
types.js
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
// @flow
/* eslint-disable import/exports-last, flowtype/no-mixed */
// eslint-disable-next-line flowtype/no-weak-types
type ElementType = Object;
// eslint-disable-next-line flowtype/no-weak-types
type BindleType = Object;
export type EvaluatorType = {|
+clone: (element: ElementType) => ElementType,
+getAttributeValue: (element: ElementType, name: string) => string,
+getPropertyValue: (element: ElementType, name: string) => mixed,
+isElement: (maybeElement: mixed) => boolean,
+nextUntil: (element: ElementType, selector: string, filter?: string) => $ReadOnlyArray<ElementType>,
+parseDocument: (subject: string) => ElementType,
+previous: (element: ElementType, selector?: string) => ElementType,
+querySelectorAll: (element: ElementType, selector: string) => $ReadOnlyArray<ElementType>,
+remove: (element: ElementType) => void,
|};
export type SubroutineType = (subject: mixed, parameters: $ReadOnlyArray<string>, bindle: BindleType) => mixed;
export type SelectSubroutineQuantifierType = {|
+index: number | null,
+max: number,
+min: number,
|};
export type UserConfigurationType = {
+evaluator?: EvaluatorType,
+subroutines?: {
[key: string]: SubroutineType,
...
},
...
};
export type ConfigurationType = {|
+evaluator: EvaluatorType,
+subroutines: {
[key: string]: SubroutineType,
...
},
|};
type QueryChildrenType = {
// eslint-disable-next-line no-use-before-define
[key: string]: DenormalizedQueryType,
...
};
export type DenormalizedQueryType =
string |
$ReadOnlyArray<string | QueryChildrenType> |
QueryChildrenType;